]> git.baikalelectronics.ru Git - kernel.git/commit
PCI: pciehp: Rename duplicate slot name N as N-1, N-2, N-M...
authorAlex Chiang <achiang@hp.com>
Thu, 21 Aug 2008 21:13:29 +0000 (15:13 -0600)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Thu, 21 Aug 2008 22:15:10 +0000 (15:15 -0700)
commitb87bfa0d0558f50394b4f525cbfeaaf21c081534
treec226d2a2de10ff6d437505ac05ea55ae897a83cc
parente95324920d5b477f43cdc2878e92ff7cca88223d
PCI: pciehp: Rename duplicate slot name N as N-1, N-2, N-M...

Commit 1a7a1facda0d327a1ed19409930e327def7b221b (pciehp: fix slot name)
introduces the pciehp_slot_with_bus module parameter, which was intended
to help work around broken firmware that assigns the same name to multiple
slots.

Commit 8475273837385ac3ee752ef97da03c5379354c38 (pciehp: add message about
pciehp_slot_with_bus option) tells the user to use the above parameter
in the event of a name collision.

This approach is sub-optimal because it requires too much work from
the user.

Instead, let's rename the slot on behalf of the user. If firmware
assigns the name N to multiple slots, then:

The first registered slot is assigned N
The second registered slot is assigned N-1
The third registered slot is assigned N-2
The Mth registered slot becomes N-M

In the event we overflow the slot->name parameter, we report an
error to the user.

This is a temporary fix until the entire PCI core can be reworked
such that individual drivers no longer have to manage their own
slot names.

Tested-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Acked-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Alex Chiang <achiang@hp.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/hotplug/pciehp.h
drivers/pci/hotplug/pciehp_core.c
drivers/pci/hotplug/pciehp_hpc.c