Hi all,
Only a few Intel Gigabit Adapters need ioport resources for workaround,
but most do not need them. Most adapters work properly without them.
In the case where ioport resources are not assigned to adapters, this can
happen on the large system, drivers' probe function fails like the following,
and adapters can not be used as a result.
e1000e 0002:22:00.0: device not available because of BAR 2 [0:1f] collisions
e1000e: probe of 0002:22:00.0 failed with error -22
These patches corrects behavior in probe function so as not to request ioport
resources as long as they are not really needed. These are based on the
ioport-free patch of e1000 driver from Auke Kok and Tomohiro Kusumi.
* [PATCH 1/3] e1000: make ioport free
* [PATCH 2/3] e1000e: make ioport free
* [PATCH 3/3] igb: make ioport free
Best regards,
Taku Izumi [off-list ref]
This patch makes e1000 driver ioport-free.
This corrects behavior in probe function so as not to request ioport
resources as long as they are not really needed. This is based on the
ioport-free patch of e1000 driver from Auke Kok and Tomohiro Kusumi.
Signed-off-by: Tomohiro Kusumi <redacted>
Signed-off-by: Auke Kok <redacted>
Signed-off-by: Taku Izumi <redacted>
---
drivers/net/e1000/e1000.h | 4 +
drivers/net/e1000/e1000_main.c | 88 +++++++++++++++++++++++++++++++++++------
2 files changed, 80 insertions(+), 12 deletions(-)
Index: linux-2.6.25.7/drivers/net/e1000/e1000.h
===================================================================
@@ -932,9 +970,19 @@ e1000_probe(struct pci_dev *pdev,inti,err,pci_using_dac;uint16_teeprom_data=0;uint16_teeprom_apme_mask=E1000_EEPROM_APME;+intbars,need_ioport;DECLARE_MAC_BUF(mac);-if((err=pci_enable_device(pdev)))+/* do not allocate ioport bars when not needed */+need_ioport=e1000_is_need_ioport(pdev);+if(need_ioport){+bars=pci_select_bars(pdev,IORESOURCE_MEM|IORESOURCE_IO);+err=pci_enable_device(pdev);+}else{+bars=pci_select_bars(pdev,IORESOURCE_MEM);+err=pci_enable_device_mem(pdev);+}+if(err)returnerr;if(!(err=pci_set_dma_mask(pdev,DMA_64BIT_MASK))&&
From: Jeff Garzik <hidden> Date: 2008-06-27 06:09:42
Taku Izumi wrote:
This patch makes e1000 driver ioport-free.
This corrects behavior in probe function so as not to request ioport
resources as long as they are not really needed. This is based on the
ioport-free patch of e1000 driver from Auke Kok and Tomohiro Kusumi.
Signed-off-by: Tomohiro Kusumi <redacted>
Signed-off-by: Auke Kok <redacted>
Signed-off-by: Taku Izumi <redacted>
---
drivers/net/e1000/e1000.h | 4 +
drivers/net/e1000/e1000_main.c | 88 +++++++++++++++++++++++++++++++++++------
2 files changed, 80 insertions(+), 12 deletions(-)
This patch makes e1000 driver ioport-free.
This corrects behavior in probe function so as not to request ioport
resources as long as they are not really needed. This is based on the
ioport-free patch of e1000 driver from Auke Kok and Tomohiro Kusumi.
Signed-off-by: Tomohiro Kusumi <redacted>
Signed-off-by: Auke Kok <redacted>
Signed-off-by: Taku Izumi <redacted>
---
drivers/net/e1000/e1000.h | 4 +
drivers/net/e1000/e1000_main.c | 88 +++++++++++++++++++++++++++++++++++------
2 files changed, 80 insertions(+), 12 deletions(-)
This patch makes e1000 driver ioport-free.
This corrects behavior in probe function so as not to request ioport
resources as long as they are not really needed. This is based on the
ioport-free patch of e1000 driver from Auke Kok and Tomohiro Kusumi.
Signed-off-by: Tomohiro Kusumi <redacted>
Signed-off-by: Auke Kok <redacted>
Signed-off-by: Taku Izumi <redacted>
---
drivers/net/e1000/e1000.h | 4 +
drivers/net/e1000/e1000_main.c | 88 +++++++++++++++++++++++++++++++++++------
2 files changed, 80 insertions(+), 12 deletions(-)
Index: netdev-2.6/drivers/net/e1000/e1000.h
===================================================================
@@ -895,9 +933,19 @@ e1000_probe(struct pci_dev *pdev,inti,err,pci_using_dac;u16eeprom_data=0;u16eeprom_apme_mask=E1000_EEPROM_APME;+intbars,need_ioport;DECLARE_MAC_BUF(mac);-if((err=pci_enable_device(pdev)))+/* do not allocate ioport bars when not needed */+need_ioport=e1000_is_need_ioport(pdev);+if(need_ioport){+bars=pci_select_bars(pdev,IORESOURCE_MEM|IORESOURCE_IO);+err=pci_enable_device(pdev);+}else{+bars=pci_select_bars(pdev,IORESOURCE_MEM);+err=pci_enable_device_mem(pdev);+}+if(err)returnerr;if(!(err=pci_set_dma_mask(pdev,DMA_64BIT_MASK))&&
From: Jeff Kirsher <hidden> Date: 2008-06-27 17:08:41
On Fri, Jun 27, 2008 at 6:05 AM, Taku Izumi [off-list ref] wrote:
This patch makes e1000 driver ioport-free.
This corrects behavior in probe function so as not to request ioport
resources as long as they are not really needed. This is based on the
ioport-free patch of e1000 driver from Auke Kok and Tomohiro Kusumi.
Signed-off-by: Tomohiro Kusumi <redacted>
Signed-off-by: Auke Kok <redacted>
Signed-off-by: Taku Izumi <redacted>
---
drivers/net/e1000/e1000.h | 4 +
drivers/net/e1000/e1000_main.c | 88 +++++++++++++++++++++++++++++++++++------
2 files changed, 80 insertions(+), 12 deletions(-)
I will add this into my e1000 queue and push it out in my next
patchset for e1000.
--
Cheers,
Jeff
This patch makes e1000e driver ioport-free.
This corrects behavior in probe function so as not to request ioport
resources as long as they are not really needed.
Signed-off-by: Taku Izumi <redacted>
---
drivers/net/e1000e/e1000.h | 4 +++
drivers/net/e1000e/netdev.c | 48 ++++++++++++++++++++++++++++++++++++++------
2 files changed, 46 insertions(+), 6 deletions(-)
Index: linux-2.6.25.7/drivers/net/e1000e/e1000.h
===================================================================
@@ -3700,6 +3709,21 @@ static void e1000_print_device_info(stru}/**+*e1000e_is_need_ioport-determineifanadapterneedsioportresourcesornot+*@pdev:PCIdeviceinformationstruct+*+*Returnstrueifanadaptersneedsioportresources+**/+staticinte1000e_is_need_ioport(structpci_dev*pdev)+{+switch(pdev->device){+/* Currently there are no adapters that need ioport resources */+default:+returnfalse;+}+}++/***e1000_probe-DeviceInitializationRoutine*@pdev:PCIdeviceinformationstruct*@ent:entryine1000_pci_tbl
@@ -3724,9 +3748,19 @@ static int __devinit e1000_probe(structinti,err,pci_using_dac;u16eeprom_data=0;u16eeprom_apme_mask=E1000_EEPROM_APME;+intbars,need_ioport;e1000e_disable_l1aspm(pdev);-err=pci_enable_device(pdev);++/* do not allocate ioport bars when not needed */+need_ioport=e1000e_is_need_ioport(pdev);+if(need_ioport){+bars=pci_select_bars(pdev,IORESOURCE_MEM|IORESOURCE_IO);+err=pci_enable_device(pdev);+}else{+bars=pci_select_bars(pdev,IORESOURCE_MEM);+err=pci_enable_device_mem(pdev);+}if(err)returnerr;
@@ -3749,7 +3783,7 @@ static int __devinit e1000_probe(struct}}-err=pci_request_regions(pdev,e1000e_driver_name);+err=pci_request_selected_regions(pdev,bars,e1000e_driver_name);if(err)gotoerr_pci_reg;
@@ -3773,6 +3807,8 @@ static int __devinit e1000_probe(structadapter->hw.adapter=adapter;adapter->hw.mac.type=ei->mac;adapter->msg_enable=(1<<NETIF_MSG_DRV|NETIF_MSG_PROBE)-1;+adapter->bars=bars;+adapter->need_ioport=need_ioport;mmio_start=pci_resource_start(pdev,0);mmio_len=pci_resource_len(pdev,0);
This patch makes e1000e driver ioport-free.
This corrects behavior in probe function so as not to request ioport
resources.
Signed-off-by: Taku Izumi <redacted>
---
drivers/net/e1000e/e1000.h | 3 +++
drivers/net/e1000e/netdev.c | 20 ++++++++++++++------
2 files changed, 17 insertions(+), 6 deletions(-)
Index: linux-2.6.25.7/drivers/net/e1000e/e1000.h
===================================================================
@@ -3724,9 +3727,13 @@ static int __devinit e1000_probe(structinti,err,pci_using_dac;u16eeprom_data=0;u16eeprom_apme_mask=E1000_EEPROM_APME;+intbars;e1000e_disable_l1aspm(pdev);-err=pci_enable_device(pdev);++/* do not allocate ioport bars when not needed */+bars=pci_select_bars(pdev,IORESOURCE_MEM);+err=pci_enable_device_mem(pdev);if(err)returnerr;
@@ -3749,7 +3756,7 @@ static int __devinit e1000_probe(struct}}-err=pci_request_regions(pdev,e1000e_driver_name);+err=pci_request_selected_regions(pdev,bars,e1000e_driver_name);if(err)gotoerr_pci_reg;
@@ -3773,6 +3780,7 @@ static int __devinit e1000_probe(structadapter->hw.adapter=adapter;adapter->hw.mac.type=ei->mac;adapter->msg_enable=(1<<NETIF_MSG_DRV|NETIF_MSG_PROBE)-1;+adapter->bars=bars;mmio_start=pci_resource_start(pdev,0);mmio_len=pci_resource_len(pdev,0);
From: Jeff Garzik <hidden> Date: 2008-06-27 06:10:05
Taku Izumi wrote:
This patch makes e1000e driver ioport-free.
This corrects behavior in probe function so as not to request ioport
resources as long as they are not really needed.
Signed-off-by: Taku Izumi <redacted>
---
drivers/net/e1000e/e1000.h | 4 +++
drivers/net/e1000e/netdev.c | 48 ++++++++++++++++++++++++++++++++++++++------
2 files changed, 46 insertions(+), 6 deletions(-)
This patch makes igb driver ioport-free.
This corrects behavior in probe function so as not to request ioport
resources as long as they are not really needed.
Signed-off-by: Taku Izumi <redacted>
---
drivers/net/igb/igb.h | 4 +++
drivers/net/igb/igb_main.c | 47 +++++++++++++++++++++++++++++++++++++++------
2 files changed, 45 insertions(+), 6 deletions(-)
Index: linux-2.6.25.7/drivers/net/igb/igb.h
===================================================================
@@ -820,6 +820,21 @@ void igb_reset(struct igb_adapter *adapt}/**+*igb_is_need_ioport-determineifanadapterneedsioportresourcesornot+*@pdev:PCIdeviceinformationstruct+*+*Returnstrueifanadapterneedsioportresources+**/+staticintigb_is_need_ioport(structpci_dev*pdev)+{+switch(pdev->device){+/* Currently there are no adapters that need ioport resources */+default:+returnfalse;+}+}++/***igb_probe-DeviceInitializationRoutine*@pdev:PCIdeviceinformationstruct*@ent:entryinigb_pci_tbl
@@ -843,8 +858,17 @@ static int __devinit igb_probe(struct pcu16eeprom_data=0;u16eeprom_apme_mask=IGB_EEPROM_APME;u32part_num;+intbars,need_ioport;-err=pci_enable_device(pdev);+/* do not allocate ioport bars when not needed */+need_ioport=igb_is_need_ioport(pdev);+if(need_ioport){+bars=pci_select_bars(pdev,IORESOURCE_MEM|IORESOURCE_IO);+err=pci_enable_device(pdev);+}else{+bars=pci_select_bars(pdev,IORESOURCE_MEM);+err=pci_enable_device_mem(pdev);+}if(err)returnerr;
@@ -866,7 +890,7 @@ static int __devinit igb_probe(struct pc}}-err=pci_request_regions(pdev,igb_driver_name);+err=pci_request_selected_regions(pdev,bars,igb_driver_name);if(err)gotoerr_pci_reg;
@@ -886,6 +910,8 @@ static int __devinit igb_probe(struct pchw=&adapter->hw;hw->back=adapter;adapter->msg_enable=NETIF_MSG_DRV|NETIF_MSG_PROBE;+adapter->bars=bars;+adapter->need_ioport=need_ioport;mmio_start=pci_resource_start(pdev,0);mmio_len=pci_resource_len(pdev,0);
This patch makes igb driver ioport-free.
This corrects behavior in probe function so as not to request ioport
resources.
Signed-off-by: Taku Izumi <redacted>
---
drivers/net/igb/igb.h | 3 +++
drivers/net/igb/igb_main.c | 19 +++++++++++++------
2 files changed, 16 insertions(+), 6 deletions(-)
Index: linux-2.6.25.7/drivers/net/igb/igb.h
===================================================================
@@ -843,8 +843,11 @@ static int __devinit igb_probe(struct pcu16eeprom_data=0;u16eeprom_apme_mask=IGB_EEPROM_APME;u32part_num;+intbars;-err=pci_enable_device(pdev);+/* do not allocate ioport bars when not needed */+bars=pci_select_bars(pdev,IORESOURCE_MEM);+err=pci_enable_device_mem(pdev);if(err)returnerr;
@@ -866,7 +869,7 @@ static int __devinit igb_probe(struct pc}}-err=pci_request_regions(pdev,igb_driver_name);+err=pci_request_selected_regions(pdev,bars,igb_driver_name);if(err)gotoerr_pci_reg;
@@ -886,6 +889,7 @@ static int __devinit igb_probe(struct pchw=&adapter->hw;hw->back=adapter;adapter->msg_enable=NETIF_MSG_DRV|NETIF_MSG_PROBE;+adapter->bars=bars;mmio_start=pci_resource_start(pdev,0);mmio_len=pci_resource_len(pdev,0);
Hi all,
Only a few Intel Gigabit Adapters need ioport resources for workaround,
but most do not need them. Most adapters work properly without them.
In the case where ioport resources are not assigned to adapters, this can
happen on the large system, drivers' probe function fails like the following,
and adapters can not be used as a result.
e1000e 0002:22:00.0: device not available because of BAR 2 [0:1f] collisions
e1000e: probe of 0002:22:00.0 failed with error -22
These patches corrects behavior in probe function so as not to request ioport
resources as long as they are not really needed. These are based on the
ioport-free patch of e1000 driver from Auke Kok and Tomohiro Kusumi.
* [PATCH 1/3] e1000: make ioport free
* [PATCH 2/3] e1000e: make ioport free
* [PATCH 3/3] igb: make ioport free
I think patch 2 and 3 are way too large since igb and e1000e can be totally ioport
free at all times. There is no need to keep compatibility code for ioport in those
drivers as it's unlikely that this will ever be needed.
So, perhaps you can remove the ioport code from those 2 drivers (e1000e/igb)
completely and resubmit to Jeff Kirsher?
Cheers,
Auke
* [PATCH 1/3] e1000: make ioport free
* [PATCH 2/3] e1000e: make ioport free
* [PATCH 3/3] igb: make ioport free
I think patch 2 and 3 are way too large since igb and e1000e can be totally ioport
free at all times. There is no need to keep compatibility code for ioport in those
drivers as it's unlikely that this will ever be needed.
I left an old implementation in case adapters that need ioport resources appear,
but it's true that these codes are a little redundant for igb and e1000e drivers.
So, perhaps you can remove the ioport code from those 2 drivers (e1000e/igb)
completely and resubmit to Jeff Kirsher?
OK, I'll send them later.
Best regards,
Taku Izumi [off-list ref]
From: Jeff Kirsher <hidden> Date: 2008-06-23 23:41:22
On Mon, Jun 23, 2008 at 1:28 AM, Taku Izumi [off-list ref] wrote:
Dear Auke
quoted
quoted
* [PATCH 1/3] e1000: make ioport free
* [PATCH 2/3] e1000e: make ioport free
* [PATCH 3/3] igb: make ioport free
I think patch 2 and 3 are way too large since igb and e1000e can be
totally ioport
free at all times. There is no need to keep compatibility code for ioport
in those
drivers as it's unlikely that this will ever be needed.
I left an old implementation in case adapters that need ioport resources
appear,
but it's true that these codes are a little redundant for igb and e1000e
drivers.
quoted
So, perhaps you can remove the ioport code from those 2 drivers
(e1000e/igb)
completely and resubmit to Jeff Kirsher?
OK, I'll send them later.
The updated patchset looks fine. ACK.
Signed-off-by: Jeff Kirsher <redacted>
--
Cheers,
Jeff