Skip to contentSkip to conversation

Net: e100, fix iomap mem accesses

PATCH Applied Jiri Slaby 4 participants 11 messages Jan 17, 2008 – Feb 1, 2008 Network drivers

lore
Share & tools
lore

Jiri Slaby

author
#0 lore raw

PATCH 1/1 Net: e100, fix iomap mem accesses

readX functions are not permitted on iomap-ped space change to ioreadX, also pci_unmap pci_map-ped space on exit (instead of iounmap).

---
 drivers/net/e100.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/e100.c +4 -4
index 51cf577..47548ef 100644
@@ -1836,7 +1836,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 		if ((le16_to_cpu(rfd->command) & cb_el) &&
 		    (RU_RUNNING == nic->ru_running))
 
-			if (readb(&nic->csr->scb.status) & rus_no_res)
+			if (ioread8(&nic->csr->scb.status) & rus_no_res)
 				nic->ru_running = RU_SUSPENDED;
 		return -ENODATA;
 	}
@@ -1859,7 +1859,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 	if ((le16_to_cpu(rfd->command) & cb_el) &&
 	    (RU_RUNNING == nic->ru_running)) {
 
-	    if (readb(&nic->csr->scb.status) & rus_no_res)
+	    if (ioread8(&nic->csr->scb.status) & rus_no_res)
 		nic->ru_running = RU_SUSPENDED;
 	}
 
@@ -1958,7 +1958,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
 
 	if(restart_required) {
 		// ack the rnr?
-		writeb(stat_ack_rnr, &nic->csr->scb.stat_ack);
+		iowrite8(stat_ack_rnr, &nic->csr->scb.stat_ack);
 		e100_start_receiver(nic, nic->rx_to_clean);
 		if(work_done)
 			(*work_done)++;
@@ -2774,7 +2774,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
 		struct nic *nic = netdev_priv(netdev);
 		unregister_netdev(netdev);
 		e100_free(nic);
-		iounmap(nic->csr);
+		pci_iounmap(pdev, nic->csr);
 		free_netdev(netdev);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
Signature · 1 line
1.5.3.7
#1 lore raw
Quoted 40 lines · Jiri Slaby

readX functions are not permitted on iomap-ped space change to ioreadX, also pci_unmap pci_map-ped space on exit (instead of iounmap).

---
 drivers/net/e100.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/e100.c +3 -3
index 51cf577..47548ef 100644
@@ -1836,7 +1836,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 		if ((le16_to_cpu(rfd->command) & cb_el) &&
 		    (RU_RUNNING == nic->ru_running))
 
-			if (readb(&nic->csr->scb.status) & rus_no_res)
+			if (ioread8(&nic->csr->scb.status) & rus_no_res)
 				nic->ru_running = RU_SUSPENDED;
 		return -ENODATA;
 	}
@@ -1859,7 +1859,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 	if ((le16_to_cpu(rfd->command) & cb_el) &&
 	    (RU_RUNNING == nic->ru_running)) {
 
-	    if (readb(&nic->csr->scb.status) & rus_no_res)
+	    if (ioread8(&nic->csr->scb.status) & rus_no_res)
 		nic->ru_running = RU_SUSPENDED;
 	}
 
@@ -1958,7 +1958,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
 
 	if(restart_required) {
 		// ack the rnr?
-		writeb(stat_ack_rnr, &nic->csr->scb.stat_ack);
+		iowrite8(stat_ack_rnr, &nic->csr->scb.stat_ack);
 		e100_start_receiver(nic, nic->rx_to_clean);
 		if(work_done)
 			(*work_done)++;

drivers/net/e100.c static void __devexit e100_remove(struct pci_dev *pdev) · line 2779

Quoted 7 lines
drivers/net/e100.c +1 -1
@@ -2774,7 +2774,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
 		struct nic *nic = netdev_priv(netdev);
 		unregister_netdev(netdev);
 		e100_free(nic);
-		iounmap(nic->csr);
+		pci_iounmap(pdev, nic->csr);
 		free_netdev(netdev);
 		pci_release_regions(pdev);

ACK, but patch doesn't seem to apply...

author
#2 lore raw
Quoted 46 lines · Jeff Garzik
Quoted 45 lines · Jiri Slaby

readX functions are not permitted on iomap-ped space change to ioreadX, also pci_unmap pci_map-ped space on exit (instead of iounmap).

---
 drivers/net/e100.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/e100.c +1 -1
index 51cf577..47548ef 100644
@@ -1836,7 +1836,7 @@ static int e100_rx_indicate(struct nic *nic, 
 struct rx *rx,
         if ((le16_to_cpu(rfd->command) & cb_el) &&
             (RU_RUNNING == nic->ru_running))
 
-            if (readb(&nic->csr->scb.status) & rus_no_res)
+            if (ioread8(&nic->csr->scb.status) & rus_no_res)
                 nic->ru_running = RU_SUSPENDED;
         return -ENODATA;
     }
drivers/net/e100.c +2 -2
@@ -1859,7 +1859,7 @@ static int e100_rx_indicate(struct nic *nic, 
 struct rx *rx,
     if ((le16_to_cpu(rfd->command) & cb_el) &&
         (RU_RUNNING == nic->ru_running)) {
 
-        if (readb(&nic->csr->scb.status) & rus_no_res)
+        if (ioread8(&nic->csr->scb.status) & rus_no_res)
         nic->ru_running = RU_SUSPENDED;
     }
@@ -1958,7 +1958,7 @@ static void e100_rx_clean(struct nic *nic, 
 unsigned int *work_done,
 
     if(restart_required) {
         // ack the rnr?
-        writeb(stat_ack_rnr, &nic->csr->scb.stat_ack);
+        iowrite8(stat_ack_rnr, &nic->csr->scb.stat_ack);
         e100_start_receiver(nic, nic->rx_to_clean);
         if(work_done)
             (*work_done)++;
drivers/net/e100.c +0 -0
@@ -2774,7 +2774,7 @@ static void __devexit e100_remove(struct pci_dev 
 *pdev)
         struct nic *nic = netdev_priv(netdev);
Quoted 8 lines

drivers/net/e100.c static void __devexit e100_remove(struct pci_dev *pdev) · line 2779

Quoted 6 lines
drivers/net/e100.c +1 -1
         unregister_netdev(netdev);
         e100_free(nic);
-        iounmap(nic->csr);
+        pci_iounmap(pdev, nic->csr);
         free_netdev(netdev);
         pci_release_regions(pdev);

ACK, but patch doesn't seem to apply...

It's against 2.6.24-rc8-mm1. Doesn't apply against net.git?

#3 lore raw
In reply to Jeff Garzik
Quoted 42 lines · On Fri, 18 Jan 2008 14:38:51 -0500 Jeff Garzik <[email protected]> wrote:
Quoted 41 lines · Jiri Slaby

readX functions are not permitted on iomap-ped space change to ioreadX, also pci_unmap pci_map-ped space on exit (instead of iounmap).

---
 drivers/net/e100.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/e100.c +3 -3
index 51cf577..47548ef 100644
@@ -1836,7 +1836,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 		if ((le16_to_cpu(rfd->command) & cb_el) &&
 		    (RU_RUNNING == nic->ru_running))
 
-			if (readb(&nic->csr->scb.status) & rus_no_res)
+			if (ioread8(&nic->csr->scb.status) & rus_no_res)
 				nic->ru_running = RU_SUSPENDED;
 		return -ENODATA;
 	}
@@ -1859,7 +1859,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 	if ((le16_to_cpu(rfd->command) & cb_el) &&
 	    (RU_RUNNING == nic->ru_running)) {
 
-	    if (readb(&nic->csr->scb.status) & rus_no_res)
+	    if (ioread8(&nic->csr->scb.status) & rus_no_res)
 		nic->ru_running = RU_SUSPENDED;
 	}
 
@@ -1958,7 +1958,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
 
 	if(restart_required) {
 		// ack the rnr?
-		writeb(stat_ack_rnr, &nic->csr->scb.stat_ack);
+		iowrite8(stat_ack_rnr, &nic->csr->scb.stat_ack);
 		e100_start_receiver(nic, nic->rx_to_clean);
 		if(work_done)
 			(*work_done)++;
@@ -2774,7 +2774,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
 		struct nic *nic = netdev_priv(netdev);
Quoted 8 lines

drivers/net/e100.c static void __devexit e100_remove(struct pci_dev *pdev) · line 2779

Quoted 6 lines
drivers/net/e100.c +1 -1
 		unregister_netdev(netdev);
 		e100_free(nic);
-		iounmap(nic->csr);
+		pci_iounmap(pdev, nic->csr);
 		free_netdev(netdev);
 		pci_release_regions(pdev);

ACK, but patch doesn't seem to apply...

It's been a week, nothing seems to have happened and the e100 maintainers are asleep.

Please resend when convenient. Maybe more luodly or something, I dunno.

#4 lore raw
Quoted 52 lines · Andrew Morton
Quoted 33 lines · On Fri, 18 Jan 2008 14:38:51 -0500 Jeff Garzik <[email protected]> wrote:
Quoted 32 lines · Jiri Slaby

readX functions are not permitted on iomap-ped space change to ioreadX, also pci_unmap pci_map-ped space on exit (instead of iounmap).

---
 drivers/net/e100.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/e100.c +2 -2
index 51cf577..47548ef 100644
@@ -1836,7 +1836,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 		if ((le16_to_cpu(rfd->command) & cb_el) &&
 		    (RU_RUNNING == nic->ru_running))
 
-			if (readb(&nic->csr->scb.status) & rus_no_res)
+			if (ioread8(&nic->csr->scb.status) & rus_no_res)
 				nic->ru_running = RU_SUSPENDED;
 		return -ENODATA;
 	}
@@ -1859,7 +1859,7 @@ static int e100_rx_indicate(struct nic *nic, struct rx *rx,
 	if ((le16_to_cpu(rfd->command) & cb_el) &&
 	    (RU_RUNNING == nic->ru_running)) {
 
-	    if (readb(&nic->csr->scb.status) & rus_no_res)
+	    if (ioread8(&nic->csr->scb.status) & rus_no_res)
 		nic->ru_running = RU_SUSPENDED;
 	}
 
@@ -1958,7 +1958,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
 
Quoted 16 lines
Quoted 8 lines
drivers/net/e100.c +1 -1
 	if(restart_required) {
 		// ack the rnr?
-		writeb(stat_ack_rnr, &nic->csr->scb.stat_ack);
+		iowrite8(stat_ack_rnr, &nic->csr->scb.stat_ack);
 		e100_start_receiver(nic, nic->rx_to_clean);
 		if(work_done)
 			(*work_done)++;

drivers/net/e100.c static void __devexit e100_remove(struct pci_dev *pdev) · line 2779

Quoted 7 lines
drivers/net/e100.c +1 -1
@@ -2774,7 +2774,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
 		struct nic *nic = netdev_priv(netdev);
 		unregister_netdev(netdev);
 		e100_free(nic);
-		iounmap(nic->csr);
+		pci_iounmap(pdev, nic->csr);
 		free_netdev(netdev);
 		pci_release_regions(pdev);

ACK, but patch doesn't seem to apply...

Quoted 2 lines

It's been a week, nothing seems to have happened and the e100 maintainers are asleep.

not asleep, just pleasantly stuck on an atol in the south pacific, far far away from LCA :)

Quoted 1 line

Please resend when convenient. Maybe more luodly or something, I dunno.

just repost to me and Jeff and I'll pick it up this week if Jeff does not.

I think the recent non-cache coherent fixes might have messed up the merge.

Auke

author
#5 lore raw
Quoted 4 lines · Auke
Quoted 1 line · Andrew Morton

Please resend when convenient. Maybe more luodly or something, I dunno.

just repost to me and Jeff and I'll pick it up this week if Jeff does not.

Sent few hours ago, you should had received a copy, hadn't you?

#6 lore raw
Quoted 8 lines · Jiri Slaby
Quoted 5 lines · Auke
Quoted 1 line · Andrew Morton

Please resend when convenient. Maybe more luodly or something, I dunno.

just repost to me and Jeff and I'll pick it up this week if Jeff does not.

Sent few hours ago, you should had received a copy, hadn't you?

nothing yet, can you resend it to me again?

Auke

author
#7 lore raw
Quoted 9 lines · Auke
Quoted 6 lines · Jiri Slaby
Quoted 4 lines · Auke
Quoted 1 line · Andrew Morton

Please resend when convenient. Maybe more luodly or something, I dunno.

just repost to me and Jeff and I'll pick it up this week if Jeff does not.

Sent few hours ago, you should had received a copy, hadn't you?

nothing yet, can you resend it to me again?

Sure, in a moment.

thanks,
--js

author
#8 lore raw

PATCH 1/1 Net: e100, fix iomap mem accesses

In reply to Kok, Auke

Patch against netdev-2.6 follows.
--
writeX functions are not permitted on iomap-ped space change to iowriteX, also pci_unmap pci_map-ped space on exit (instead of iounmap).

---
 drivers/net/e100.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/e100.c +2 -2
index 51cf577..47548ef 100644
@@ -1904,7 +1904,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
 
 	if(restart_required) {
 		// ack the rnr?
-		writeb(stat_ack_rnr, &nic->csr->scb.stat_ack);
+		iowrite8(stat_ack_rnr, &nic->csr->scb.stat_ack);
 		e100_start_receiver(nic, rx_to_start);
 		if(work_done)
 			(*work_done)++;
@@ -2706,7 +2706,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
 		struct nic *nic = netdev_priv(netdev);
 		unregister_netdev(netdev);
 		e100_free(nic);
-		iounmap(nic->csr);
+		pci_iounmap(pdev, nic->csr);
 		free_netdev(netdev);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);
Signature · 1 line
1.5.3.7
Acked-by on v1 1/1
#9 lore raw
Quoted 24 lines · Jiri Slaby

Patch against netdev-2.6 follows.
--
writeX functions are not permitted on iomap-ped space change to iowriteX, also pci_unmap pci_map-ped space on exit (instead of iounmap).

---
 drivers/net/e100.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)
drivers/net/e100.c +1 -1
index 51cf577..47548ef 100644
@@ -1904,7 +1904,7 @@ static void e100_rx_clean(struct nic *nic, unsigned int *work_done,
 
 	if(restart_required) {
 		// ack the rnr?
-		writeb(stat_ack_rnr, &nic->csr->scb.stat_ack);
+		iowrite8(stat_ack_rnr, &nic->csr->scb.stat_ack);
 		e100_start_receiver(nic, rx_to_start);
 		if(work_done)
 			(*work_done)++;

drivers/net/e100.c static void __devexit e100_remove(struct pci_dev *pdev) · line 2712

Quoted 8 lines
drivers/net/e100.c +1 -1
@@ -2706,7 +2706,7 @@ static void __devexit e100_remove(struct pci_dev *pdev)
 		struct nic *nic = netdev_priv(netdev);
 		unregister_netdev(netdev);
 		e100_free(nic);
-		iounmap(nic->csr);
+		pci_iounmap(pdev, nic->csr);
 		free_netdev(netdev);
 		pci_release_regions(pdev);
 		pci_disable_device(pdev);

Jeff, feel free to merge in upstream-fixes.

Cheers,

Auke

Applied
#10 lore raw
In reply to Jiri Slaby
Quoted 9 lines · Jiri Slaby

Patch against netdev-2.6 follows.
--
writeX functions are not permitted on iomap-ped space change to iowriteX, also pci_unmap pci_map-ped space on exit (instead of iounmap).

---
 drivers/net/e100.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

applied