Skip to contentSkip to conversation

net: ibm: emac: mal: add dcr_unmap to _remove

PATCH Applied Rosen Penev 4 participants 5 messages Oct 8, 2024 – Oct 10, 2024

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 net: ibm: emac: mal: add dcr_unmap to _remove

It's done in probe so it should be done here.

Fixes 1d3bb996 ("Device tree aware EMAC driver")

---
v2: Rebase and add proper fixes line.

 drivers/net/ethernet/ibm/emac/mal.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/ibm/emac/mal.c +2 -0
index a93423035325..c634534710d9 100644
@@ -742,6 +742,8 @@ static void mal_remove(struct platform_device *ofdev)
 
 	free_netdev(mal->dummy_dev);
 
+	dcr_unmap(mal->dcr_host, 0x100);
+
 	dma_free_coherent(&ofdev->dev,
 			  sizeof(struct mal_descriptor) *
 			  (NUM_TX_BUFF * mal->num_tx_chans +
Signature · 1 line
2.46.2
Reviewed-by on v2 1/1
#1 lore raw

Hello Rosen,

Quoted 14 lines · Rosen Penev

It's done in probe so it should be done here.

Fixes 1d3bb996 ("Device tree aware EMAC driver")

---
v2: Rebase and add proper fixes line.

 drivers/net/ethernet/ibm/emac/mal.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/ibm/emac/mal.c +0 -0
index a93423035325..c634534710d9 100644

drivers/net/ethernet/ibm/emac/mal.c static void mal_remove(struct platform_device *ofdev) · line 749

Quoted 8 lines
drivers/net/ethernet/ibm/emac/mal.c +2 -0
@@ -742,6 +742,8 @@ static void mal_remove(struct platform_device *ofdev)
 
 	free_netdev(mal->dummy_dev);
 
+	dcr_unmap(mal->dcr_host, 0x100);
+
 	dma_free_coherent(&ofdev->dev,
 			  sizeof(struct mal_descriptor) *
 			  (NUM_TX_BUFF * mal->num_tx_chans +

The fix per see seems correct, but, there are a few things you might want to improve:

1) Fixes: format
Your "Fixes:" line does not follow the expected format, as detected by checkpatch. you might want something as:

Fixes 1d3bb996481e ("Device tree aware EMAC driver")

2) The description can be improved. For instance, you say it is done in probe but not in remove. Why should it be done in remove instead of removed from probe()? That would help me to review it better, instead of going into the code and figure it out.

Once you have fixed it, feel free to add:

maintainer
#2 lore raw
Quoted 36 lines · On Wed, 9 Oct 2024 01:23:02 -0700 Breno Leitao wrote:

Hello Rosen,

Quoted 14 lines · Rosen Penev

It's done in probe so it should be done here.

Fixes 1d3bb996 ("Device tree aware EMAC driver")

---
v2: Rebase and add proper fixes line.

 drivers/net/ethernet/ibm/emac/mal.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/ibm/emac/mal.c +0 -0
index a93423035325..c634534710d9 100644

drivers/net/ethernet/ibm/emac/mal.c static void mal_remove(struct platform_device *ofdev) · line 749

Quoted 8 lines
drivers/net/ethernet/ibm/emac/mal.c +2 -0
@@ -742,6 +742,8 @@ static void mal_remove(struct platform_device *ofdev)
 
 	free_netdev(mal->dummy_dev);
 
+	dcr_unmap(mal->dcr_host, 0x100);
+
 	dma_free_coherent(&ofdev->dev,
 			  sizeof(struct mal_descriptor) *
 			  (NUM_TX_BUFF * mal->num_tx_chans +  

The fix per see seems correct, but, there are a few things you might want to improve:

1) Fixes: format
Your "Fixes:" line does not follow the expected format, as detected by checkpatch. you might want something as:

Fixes 1d3bb996481e ("Device tree aware EMAC driver")
Quoted 8 lines

2) The description can be improved. For instance, you say it is done in probe but not in remove. Why should it be done in remove instead of removed from probe()? That would help me to review it better, instead of going into the code and figure it out.

Once you have fixed it, feel free to add:

Good points, I'll fix when applying - I want to make sure this gets into tomorrow's PR 'cause Rosen has patches for net-next depending on it.

#4 lore raw
In reply to Rosen Penev
This patch was applied to netdev/net.git (main) by Jakub Kicinski <[email protected]>:

Hello:

This patch was applied to netdev/net.git (main)
by Jakub Kicinski <[email protected]>:

Quoted 8 lines · On Tue, 8 Oct 2024 16:30:50 -0700 you wrote:

It's done in probe so it should be done here.

Fixes 1d3bb996 ("Device tree aware EMAC driver")

---
v2: Rebase and add proper fixes line.

 drivers/net/ethernet/ibm/emac/mal.c | 2 ++
 1 file changed, 2 insertions(+)

Here is the summary with links:
- [PATCHv2,net] net: ibm: emac: mal: add dcr_unmap to _remove

    https://git.kernel.org/netdev/net/c/080ddc22f3b0

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
#3 lore raw
In reply to Jakub Kicinski
Quoted 43 lines · Jakub Kicinski
Quoted 41 lines · On Wed, 9 Oct 2024 01:23:02 -0700 Breno Leitao wrote:

Hello Rosen,

Quoted 14 lines · Rosen Penev

It's done in probe so it should be done here.

Fixes 1d3bb996 ("Device tree aware EMAC driver")

---
v2: Rebase and add proper fixes line.

 drivers/net/ethernet/ibm/emac/mal.c | 2 ++
 1 file changed, 2 insertions(+)
drivers/net/ethernet/ibm/emac/mal.c +0 -0
index a93423035325..c634534710d9 100644

drivers/net/ethernet/ibm/emac/mal.c static void mal_remove(struct platform_device *ofdev) · line 749

Quoted 8 lines
drivers/net/ethernet/ibm/emac/mal.c +2 -0
@@ -742,6 +742,8 @@ static void mal_remove(struct platform_device *ofdev)
 
    free_netdev(mal->dummy_dev);
 
+   dcr_unmap(mal->dcr_host, 0x100);
+
    dma_free_coherent(&ofdev->dev,
                      sizeof(struct mal_descriptor) *
                      (NUM_TX_BUFF * mal->num_tx_chans +

The fix per see seems correct, but, there are a few things you might want to improve:

1) Fixes: format
Your "Fixes:" line does not follow the expected format, as detected by checkpatch. you might want something as:

Fixes 1d3bb996481e ("Device tree aware EMAC driver")

2) The description can be improved. For instance, you say it is done in probe but not in remove. Why should it be done in remove instead of removed from probe()? That would help me to review it better, instead of going into the code and figure it out.

Quoted 7 lines
Quoted 3 lines

Once you have fixed it, feel free to add:

Good points, I'll fix when applying - I want to make sure this gets into tomorrow's PR 'cause Rosen has patches for net-next depending on it.

Much appreciated.