Bug 161270

Summary: PCI hotplug fails due to I/O resource shortage
Product: Red Hat Enterprise Linux 4 Reporter: David Milburn <dmilburn>
Component: kernelAssignee: Prarit Bhargava <prarit>
Status: CLOSED NOTABUG QA Contact: Brian Brock <bbrock>
Severity: medium Docs Contact:
Priority: medium    
Version: 4.0CC: tao
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-11-29 11:16:10 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 176344, 198868    
Attachments:
Description Flags
Proposed patch that doesn't return -ENOMEM if there are no I/O resources available for the slot when hot-adding none

Description David Milburn 2005-06-21 22:24:36 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.6) Gecko/20050302 Firefox/1.0.1 Fedora/1.0.1-1.3.2

Description of problem:
PCI hotplug with SHPCHP driver fails when I/O space cannot be
allocated for the slot, even though the PCI device being hot-added
could be handled by its driver without using I/O space.

At hot-add time, SHPCHP driver will try to allocate I/O Resources
(I/O space, MMIO, Prefechable MMIO) to the device being hot-added.
If SHPCHP driver fails to allocate one of these resources to the slot, 
it will return as error (-ENOMEM) with the following message.

      shpchp: Got NO IO resource(length=0xXXXX)
   
As a result, hotplug will be failure and hotpluged devices are 
unusable.

For PCI devices that are handled by drivers without using 
I/O space, the device being hot-added can work even if
SHPCHP driver fails to allocate I/O space as long as it doesn't
return an error.





Version-Release number of selected component (if applicable):
kernel-2.6.9-5.0.3.EL

How reproducible:
Always

Steps to Reproduce:
1. Hot-add a PCI device with SHPCHP driver on a large scale server
that has already allocated I/O slot resources for existing PCI devices.
2. 
3.
  

Actual Results:  PCI hotplug fails with the following error message:

shpchp: Got NO IO resource(length=0xXXXX)

Expected Results:  PCI hotplug succeeds even if it couldn't allocate I/O resources for
the slot.

Additional info:

Attaching a patch that customer has verified to work with their drivers
that use pci_enable_device_bars() instead of pci_enable_device().

Comment 1 David Milburn 2005-06-21 22:26:30 UTC
Created attachment 115786 [details]
Proposed patch that doesn't return -ENOMEM if there are no I/O resources available for the slot when hot-adding

Comment 4 Jason Baron 2005-08-19 15:53:14 UTC
sorry for taking so long on this one. I'm no hotplug expert...but i don't see
this patch in the upstream 2.6 kernel. Was there any attempt to get it merged there?

Comment 11 Bob Johnson 2006-04-11 16:16:23 UTC
This issue is on Red Hat Engineering's list of planned work items 
for the upcoming Red Hat Enterprise Linux 4.4 release.  Engineering 
resources have been assigned and barring unforeseen circumstances, Red 
Hat intends to include this item in the 4.4 release.

Comment 15 Prarit Bhargava 2006-09-05 18:10:13 UTC
AFAICT, the patch breaks the situation where a device has been hotplug inserted
and there are no available resources for the device...

A suggestion to Fujitsu is to:

- change the return of get_io_resource to success/fail
- add a struct resource *res arg to get_io_resource for the actual resource
values

P.