Skip to content

Fixups for duplicate slot names

Alex Chiang lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest7 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7acpiphp: convert to a kmalloc'ed slot namedrivers/pci/hotplug/acpiphp.h drivers/pci/hotplug/acpiphp_core.c+11 -80 replies
2/7fakephp: convert to a kmalloc'ed slot namedrivers/pci/hotplug/fakephp.c+12 -30 replies
3/7pciehp: convert to a kmalloc'ed slot namedrivers/pci/hotplug/pciehp.h drivers/pci/hotplug/pciehp_core.c drivers/pci/hotplug/pciehp_hpc.c+10 -210 replies
4/7PCI hotplug: convert skeleton code to a kmalloc'ed slot namedrivers/pci/hotplug/pcihp_skeleton.c+9 -20 replies
5/7shpchp: convert to a kmalloc'ed slot namedrivers/pci/hotplug/shpchp.h drivers/pci/hotplug/shpchp_core.c+11 -220 replies
6/7pci_slot: convert to a kmalloc'ed slot namedrivers/acpi/pci_slot.c+12 -20 replies
7/7PCI Hotplug core: fixups for duplicate slot namesdrivers/pci/hotplug/pci_hotplug_core.c drivers/pci/slot.c include/linux/pci.h+59 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/7] Fixups for duplicate slot names

* Kenji Kaneshige <[email protected]>:

Quoted 7 lines

With this change, kobject_init_and_add() called in pci_create_slot() will show stack trace if a hotplug driver attempts to register multiple slot with the same name. That is, stack trace will be shown on the platform that wrongly assing the physical slot number to multiple slots. I'm very sorry, but I don't have enough time to consider how to fix it today.

Hello Kenji-san,

You are obviously correct about my prior bad patch that simply removed the check in pci_hp_register() for duplicate names.

I also talked with Willy, and he thought that the proper way to fix all these issues was not in the individual drivers, but in the PCI core, which I agree with.

Here is a patch series that attempts to implement Willy's suggestion.

Patches 1--6 convert the callers of pci_hp_register/pci_create_slot from a static char name[] to a dynamically kmalloc'ed char *name.

There are also cleanups in the individual drivers to remove the _slot_with_bus parameters.

Patch 7/7 implements the collision rename logic. It's not the prettiest thing in the world, so your comments are welcome. :)

It's getting late here and I haven't had time to really test it, other than a quick compile test, but I wanted to try and send it so that you could take a look and possibly try it. ;)

These patches apply on top of Linus's latest tree.

Thanks!

/ac

 drivers/acpi/pci_slot.c                |   15 ++++++-
 drivers/pci/hotplug/acpiphp.h          |    2 -
 drivers/pci/hotplug/acpiphp_core.c     |   18 +++++----
 drivers/pci/hotplug/fakephp.c          |   16 ++++++--
 drivers/pci/hotplug/pci_hotplug_core.c |    4 --
 drivers/pci/hotplug/pciehp.h           |    6 +--
 drivers/pci/hotplug/pciehp_core.c      |    7 ---
 drivers/pci/hotplug/pciehp_hpc.c       |   19 ++++-----
 drivers/pci/hotplug/pcihp_skeleton.c   |   12 ++++--
 drivers/pci/hotplug/shpchp.h           |    5 +-
 drivers/pci/hotplug/shpchp_core.c      |   29 ++++----------
 drivers/pci/slot.c                     |   65 +++++++++++++++++++++++++++++----
 include/linux/pci.h                    |    3 -
 13 files changed, 124 insertions(+), 77 deletions(-)