All of lore.kernel.org
 help / color / mirror / Atom feed
From: Yinghai Lu <yinghai@kernel.org>
To: Bjorn Helgaas <bhelgaas@google.com>
Cc: Jiang Liu <liuj97@gmail.com>, Jiang Liu <jiang.liu@huawei.com>,
	Yijing Wang <wangyijing@huawei.com>,
	"linux-pci@vger.kernel.org" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH 2/2] PCI: make PCI host bridge/bus creating and destroying logic symmetric
Date: Sat, 8 Jun 2013 00:01:26 -0700	[thread overview]
Message-ID: <CAE9FiQUCR0cSH1u59qyZo8KM9J6P0+AG79vodGYPDVohg6UOfQ@mail.gmail.com> (raw)
In-Reply-To: <20130608015133.GB5874@google.com>

On Fri, Jun 7, 2013 at 6:51 PM, Bjorn Helgaas <bhelgaas@google.com> wrote:
>>
>> should split pci_release_host_bridge_dev renaming and moving to another patch.
>
> I split the rename/move to another patch and added both to my
> pci/jiang-bus-lock-v3 branch.

good.

>
>> > @@ -1726,30 +1722,21 @@ struct pci_bus *pci_create_root_bus(struct ..
...
>
> I think this function would be better if we created the host bridge
> first, then the bus.  But your patch is an improvement, so we can look
> at doing that later.

Yes, that will more straightforward, create hostbidge before root bus,
like we have pci bridge before subordinate bus under it.

current logic is

        b = pci_alloc_bus();
        if (!b)
                return NULL;

        b->sysdata = sysdata;
        b->ops = ops;
        b->number = b->busn_res.start = bus;
        b2 = pci_find_bus(pci_domain_nr(b), bus);
        if (b2) {
                /* If we already got to this bus through a different
bridge, ignore it */
                dev_dbg(&b2->dev, "bus already known\n");
                goto err_out;
        }

        bridge = pci_alloc_host_bridge(b);

We need to find the duplicated hostbridge or racing.

If we need call pci_alloc_host_bridge at first, we will need my
for_each_host_bridge patchset, and use it to check if there is
existing hostbridge.

>
>> looks like we don't need to split device_register to device_del and put_device.
>>
>> we can make root bus removal to use device_unregister too, in the patches,
>
> If we can use device_register()/device_unregister() directly instead of
> splitting them into initialize/add/del/put, that would be awesome.
>
> Anyway, http://git.kernel.org/cgit/linux/kernel/git/helgaas/pci.git/log/?h=pci/jiang-bus-lock-v3
> is the current state of what I've got.  If you want to iterate on this some
> more and improve things, that's great.  But please start with what's on my
> branch and post your updates as a complete v4 because I did tweak some
> changelogs and code formatting, and I don't want to lose that work.

ok, please consider drop
commit d751727a1792262cb464d8d9608500facb763301
    PCI: Make host bridge/bus creating and destroying logic symmetric
from pci/jiang-bus-lock-v3, and apply my three patches at

  https://patchwork.kernel.org/patch/2562431/
    [1/7] PCI: move back pci_proc_attach_devices calling
  https://patchwork.kernel.org/patch/2562461/
    [2/7] PCI: move resources and bus_list releasing to pci_release_dev
  https://patchwork.kernel.org/patch/2562451/
    [3/7] PCI: Detach driver in pci_stop_device

Thanks

Yinghai

  reply	other threads:[~2013-06-08  7:01 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-25 13:48 [PATCH v3, part1 00/10] Prepare for introducing PCI bus lock interfaces Jiang Liu
2013-05-25 13:48 ` [PATCH v3, part1 01/10] PCI: introduce pci_bus_{get|put}() to manage PCI bus reference count Jiang Liu
2013-05-25 13:48 ` [PATCH v3, part1 02/10] PCI: Introduce pci_alloc_dev(struct pci_bus*) to replace alloc_pci_dev() Jiang Liu
2013-05-25 13:48 ` [PATCH v3, part1 03/10] PCI: Convert alloc_pci_dev(void) to pci_alloc_dev(bus) instead Jiang Liu
2013-05-25 13:48   ` Jiang Liu
2013-05-25 13:48   ` Jiang Liu
2013-06-05 20:07   ` Bjorn Helgaas
2013-06-05 20:07     ` Bjorn Helgaas
2013-06-05 20:07     ` Bjorn Helgaas
2013-06-06 16:16     ` Jiang Liu
2013-06-06 16:16       ` Jiang Liu
2013-06-06 16:16       ` Jiang Liu
2013-05-25 13:48 ` [PATCH v3, part1 04/10] PCI: mark pci_scan_bus_parented() as __deprecated Jiang Liu
2013-05-31 20:12   ` Chris Metcalf
2013-06-05 20:04   ` Bjorn Helgaas
2013-06-06 16:32     ` Jiang Liu
2013-06-07 14:37       ` Konrad Rzeszutek Wilk
2013-06-07 15:11         ` Jiang Liu
2013-06-07 15:30         ` Jiang Liu
2013-06-07 20:37           ` Bjorn Helgaas
2013-05-25 13:48 ` [PATCH v3, part1 05/10] PCI, IA64: minor code clean up Jiang Liu
2013-05-25 13:48   ` Jiang Liu
2013-05-25 13:48 ` [PATCH v3, part1 06/10] PCI: make PCI host bridge/bus creating and destroying logic symmetric Jiang Liu
2013-06-05 20:14   ` Bjorn Helgaas
2013-06-06 17:10     ` [PATCH 1/2] PCI: fix a double free issue in pci_create_root_bus() error recovery path Jiang Liu
2013-06-08  1:42       ` Bjorn Helgaas
2013-06-06 17:10     ` [PATCH 2/2] PCI: make PCI host bridge/bus creating and destroying logic symmetric Jiang Liu
2013-06-06 20:01       ` Yinghai Lu
2013-06-08  1:51         ` Bjorn Helgaas
2013-06-08  7:01           ` Yinghai Lu [this message]
2013-06-14 23:53             ` Bjorn Helgaas
2013-06-15  1:46               ` Jiang Liu
2013-05-25 13:48 ` [PATCH v3, part1 07/10] PCI, unicore, m68k: remove redundant call of pci_bus_add_devices() Jiang Liu
2013-06-05 21:31   ` Bjorn Helgaas
2013-06-05 21:31     ` Bjorn Helgaas
2013-06-06  6:54     ` Greg Ungerer
2013-06-06  6:54       ` Greg Ungerer
2013-06-05 21:31   ` Bjorn Helgaas
2013-05-25 13:48 ` [PATCH v3, part1 08/10] PCI, IOV: don't touch bus->is_added flag Jiang Liu
2013-05-25 13:48 ` [PATCH v3, part1 09/10] PCI, IOV: simplify IOV implementation Jiang Liu
2013-05-28  2:00   ` Yinghai Lu
2013-05-28 14:48     ` Liu Jiang
2013-05-30  4:31   ` [PATCH] PCI, IOV: fix a resource leakage on error recovery path Jiang Liu
2013-05-30 18:24     ` Bjorn Helgaas
2013-05-25 13:48 ` [PATCH v3, part1 10/10] PCI, IOV: hide remove and rescan sysfs interfaces for SR-IOV virtual functions Jiang Liu

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=CAE9FiQUCR0cSH1u59qyZo8KM9J6P0+AG79vodGYPDVohg6UOfQ@mail.gmail.com \
    --to=yinghai@kernel.org \
    --cc=bhelgaas@google.com \
    --cc=jiang.liu@huawei.com \
    --cc=linux-pci@vger.kernel.org \
    --cc=liuj97@gmail.com \
    --cc=wangyijing@huawei.com \
    /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.