All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Chiang <achiang@hp.com>
To: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	jbarnes@virtuousgeek.org, kristen.c.accardi@intel.com,
	matthew@wil.cx
Subject: Re: [PATCH v5 04/16] PCI: prevent duplicate slot names
Date: Fri, 10 Oct 2008 15:29:05 -0600	[thread overview]
Message-ID: <20081010212905.GH3286@ldl.fc.hp.com> (raw)
In-Reply-To: <48EF0E21.5000500@jp.fujitsu.com>

* Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>:
> Alex Chiang wrote:
>> Ugh, I'm not sure which is worse, an unbalanced API vs passing a
>> hotplug_slot to pci_destroy_slot.
>>
>> pci_destroy_slot should never touch the pci_slot->hotplug
>> argument, I think, because it is possible for non-hotplug callers
>> to call pci_create_slot.
>>
>> I think the rule should just be:
>>
>> 	- all hotplug drivers must use pci_hp_register/deregister
>> 	- hotplug drivers must pass a valid hotplug_slot argument
>>
>> 	- all detection drivers must use pci_create/destroy_slot
>> 	- detection drivers must pass NULL for hotplug_slot
>>
>
> I'm still concerned about one thing. Now that we added hotplug
> arg to pci_create_slot(), pci_bus_sem could be used for changing
> pci_slot->hotplug. But if there is no generic API to clean up
> pci_slot->hotplug, we can't use pci_bus_sem because pci hotplug
> core cannot hold pci_bus_sem. As a result, we need to add the
> following rule in addition to the above rules.
>
> 	- hotplug core driver must hold some mutex/semaphore when
> 	  calling pci_create_slot()
> 	- hotplug core driver must hold the same mutex/semaphore
> 	  when cleaning up pci_slot->hotplug.
>
> That is, even though pci_create_slot provides the interface to
> setup pci_slot->hotplug, caller needs to pay attention to race
> condition about pci_slot->hotplug. I think it's a little strange.

I think we can use your earlier patch that replaced the hotplug
list spinlock with a pci_hp_mutex, and that should implement the
two new rules you mention, right?

Let me try and insert your patch into the rest of my series and
see how it looks.

/ac


  reply	other threads:[~2008-10-10 21:29 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09  4:46 [PATCH v5 00/16] PCI: let the core manage slot names Alex Chiang
2008-10-09  4:46 ` [PATCH v5 01/16] PCI Hotplug core: add 'name' param pci_hp_register interface Alex Chiang
2008-10-09  4:46 ` [PATCH v5 02/16] PCI: rename pci_update_slot_number to pci_renumber_slot Alex Chiang
2008-10-09  4:46 ` [PATCH v5 03/16] PCI: update pci_create_slot() to take a 'rename' param Alex Chiang
2008-10-09  4:46 ` [PATCH v5 04/16] PCI: prevent duplicate slot names Alex Chiang
2008-10-09  5:31   ` Kenji Kaneshige
2008-10-09  5:56     ` Alex Chiang
2008-10-09 12:32       ` Kenji Kaneshige
2008-10-10  2:10         ` Alex Chiang
2008-10-10  2:11           ` Alex Chiang
2008-10-10  2:12           ` Alex Chiang
2008-10-10  4:43           ` Kenji Kaneshige
2008-10-10  5:27             ` Alex Chiang
2008-10-10  8:11               ` Kenji Kaneshige
2008-10-10 21:29                 ` Alex Chiang [this message]
2008-10-09  4:46 ` [PATCH v5 05/16] PCI, PCI Hotplug: introduce slot_name helpers Alex Chiang
2008-10-09  4:47 ` [PATCH v5 06/16] PCI: acpiphp: remove 'name' parameter Alex Chiang
2008-10-09  4:47 ` [PATCH v5 07/16] PCI: cpci_hotplug: stop managing hotplug_slot->name Alex Chiang
2008-10-09  4:47 ` [PATCH v5 08/16] PCI: cpqphp: " Alex Chiang
2008-10-09  4:47 ` [PATCH v5 09/16] PCI: fakephp: remove 'name' parameter Alex Chiang
2008-10-09  4:47 ` [PATCH v5 10/16] PCI: ibmphp: stop managing hotplug_slot->name Alex Chiang
2008-10-09  4:47 ` [PATCH v5 11/16] PCI: pciehp: remove 'name' parameter Alex Chiang
2008-10-09  4:47 ` [PATCH v5 12/16] PCI: rpaphp: kmalloc/kfree slot->name directly Alex Chiang
2008-10-09  4:47 ` [PATCH v5 13/16] PCI: SGI Hotplug: stop managing bss_hotplug_slot->name Alex Chiang
2008-10-09  4:47 ` [PATCH v5 14/16] PCI: shcphp: remove 'name' parameter Alex Chiang
2008-10-09  4:47 ` [PATCH v5 15/16] PCI: Hotplug core: remove 'name' Alex Chiang
2008-10-09  4:47 ` [PATCH v5 16/16] PCI Hotplug: fakephp: add duplicate slot name debugging Alex Chiang

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=20081010212905.GH3286@ldl.fc.hp.com \
    --to=achiang@hp.com \
    --cc=jbarnes@virtuousgeek.org \
    --cc=kaneshige.kenji@jp.fujitsu.com \
    --cc=kristen.c.accardi@intel.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.