public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
To: Alex Chiang <achiang@hp.com>,
	Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>,
	Matthew Wilcox <matthew@wil.cx>,
	Pierre Ossman <drzeus-list@drzeus.cx>,
	Jesse Barnes <jbarnes@virtuousgeek.org>,
	LKML <linux-kernel@vger.kernel.org>,
	linux-pci@vger.kernel.org
Subject: Re: [PATCH 0/7] Fixups for duplicate slot names
Date: Thu, 07 Aug 2008 17:43:01 +0900	[thread overview]
Message-ID: <489AB595.7000006@jp.fujitsu.com> (raw)
In-Reply-To: <20080806050745.GA31319@ldl.fc.hp.com>

Hi Alex-san,

Thank you for patches!

I looked at your patches and it looks good. But I have only one
concern about how to allocate/free memory for slot name.

With your change, memory region for slot name will be allocated
by hotplug *controller* driver and it can be freed using kfree()
by hotplug *core* driver (not hotplug controller driver). So all
hotplug controller drivers including drivers implemented in the
future need to take it into account.

I think it will be more robust if we can allocate and free memory
in the same component (maybe hotplug core driver in this case).

Thanks,
Kenji Kaneshige


Alex Chiang wrote:
> * Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>:
>> 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(-)
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pci" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 



  parent reply	other threads:[~2008-08-07  8:44 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-06  5:07 [PATCH 0/7] Fixups for duplicate slot names Alex Chiang
2008-08-06  5:10 ` [PATCH 1/7] acpiphp: convert to a kmalloc'ed slot name Alex Chiang
2008-08-06  5:11 ` [PATCH 2/7] fakephp: " Alex Chiang
2008-08-06  5:11 ` [PATCH 3/7] pciehp: " Alex Chiang
2008-08-06  5:11 ` [PATCH 4/7] PCI hotplug: convert skeleton code " Alex Chiang
2008-08-06  5:11 ` [PATCH 5/7] shpchp: convert " Alex Chiang
2008-08-06  5:12 ` [PATCH 6/7] pci_slot: " Alex Chiang
2008-08-06  5:12 ` [PATCH 7/7] PCI Hotplug core: fixups for duplicate slot names Alex Chiang
2008-08-07  8:43 ` Kenji Kaneshige [this message]
2008-08-07 17:25   ` [PATCH 0/7] Fixups " Alex Chiang
2008-08-11  1:19     ` Kenji Kaneshige

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=489AB595.7000006@jp.fujitsu.com \
    --to=kaneshige.kenji@jp.fujitsu.com \
    --cc=achiang@hp.com \
    --cc=drzeus-list@drzeus.cx \
    --cc=jbarnes@virtuousgeek.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=matthew@wil.cx \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox