All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jiang Liu <liuj97@gmail.com>
Cc: Bjorn Helgaas <bhelgaas@google.com>,
	Yinghai Lu <yinghai@kernel.org>, Jiang Liu <jiang.liu@huawei.com>,
	"Rafael J . Wysocki" <rjw@sisk.pl>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Gu Zheng <guz.fnst@cn.fujitsu.com>,
	Toshi Kani <toshi.kani@hp.com>,
	Myron Stowe <myron.stowe@redhat.com>,
	Yijing Wang <wangyijing@huawei.com>,
	linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
	Jeremy Fitzhardinge <jeremy@goop.org>,
	xen-devel@lists.xensource.com,
	virtualization@lists.linux-foundation.org
Subject: Re: [RFC PATCH v2, part3 07/11] PCI, xen-pcifront: use new PCI interfaces to simplify implementation
Date: Fri, 14 Jun 2013 14:07:19 -0400	[thread overview]
Message-ID: <20130614180719.GA21729@phenom.dumpdata.com> (raw)
In-Reply-To: <51B607FE.3020108@gmail.com>

On Tue, Jun 11, 2013 at 01:08:14AM +0800, Jiang Liu wrote:
> On Tue 11 Jun 2013 12:58:01 AM CST, Konrad Rzeszutek Wilk wrote:
> > On Mon, Jun 10, 2013 at 12:50:46AM +0800, Jiang Liu wrote:
> >> On Sat 08 Jun 2013 01:07:06 AM CST, Konrad Rzeszutek Wilk wrote:
> >>> On Sat, Jun 08, 2013 at 12:50:31AM +0800, Jiang Liu wrote:
> >>>> On 06/07/2013 11:38 PM, Konrad Rzeszutek Wilk wrote:
> >>>>> On Fri, Jun 07, 2013 at 10:50:24AM -0400, Konrad Rzeszutek Wilk wrote:
> >>>>>> On Thu, May 16, 2013 at 11:50:55PM +0800, Jiang Liu wrote:
> >>>>>>> Use new PCI interfaces to simplify xen-pcifront implementation:
> >>>>>>> 1) Use pci_create_root_bus() instead of pci_scan_bus_parented()
> >>>>>>>    because pci_scan_bus_parented() is marked as __deprecated.This
> >>>>>>>    also gets rid of a duplicated call of pci_bus_start_devices().
> >>>>>>> 2) Use pci_stop_root_bus() and pci_remove_root_bus() instead of
> >>>>>>>    open-coded private implementation.
> >>>>>>> 3) Use pci_set_host_bridge_release() to release data structures
> >>>>>>>    associated with PCI root buses.
> >>>>>>> 4) Use pci_bus_get()/pci_bus_put() to manage PCI root bus reference
> >>>>>>>    count.
> >>>>>>>
> >>>>>>> This is also a preparation for coming PCI bus lock enhancement.
> >>>>>
> >>>>> With this patch from :
> >>>>>
> >>>>>  Merge branch 'pci_lock_v3' of https://github.com/jiangliu/linux into testing
> >>>>>
> >>>>>
> >>>>> it blows up when detaching the device.
> >>>> Hi Konrad,
> >>>>    Thanks for testing! According to the log messages, this issue should
> >>>> be related to pci bus reference counter management. Seems we have done
> >>>> an extra(unbalanced) release of pci bus device.
> >>>>    Will investigate it tomorrow!
> >>>
> >>> That is quite commendable that you are willing to look over this on
> >>> the weekend but I am not going to be able to rerun this test until
> >>> some time in the week. You could enjoy the weekend and just look at
> >>> this during the week.
> >>
> >> Hi Konrad,
> >>      We should have root-caused this bug, which is caused by
> >> for_each_pci_root_bus().
> >> Current implementation doesn't support root bus deletion when walking
> >> PCI root
> >> buses by for_each_pci_root_bus(). The reference counter
> >> (pci_bus->dev.knode_class.n_ref)
> >> becomes zero after returning from pci_remove_root_bus(), so it triggers
> >> kref warnings
> >> and double-free of klist_node object when we call
> >> pci_get_next_root_bus() to get the
> >> next PCI root bus.
> >>      So we will first revert to  list_for_each_entry_safe(bus, temp,
> >> &pci_root_buses, node)
> >> and solve this issue in next version of for_each_pci_root_bus().
> >
> > That definitly solves the issue. Thanks!
> >
> > I used pci_lock_v3 of https://github.com/jiangliu/linux and the fix
> > below.
> >
> > Is there a new patchset you are going to be posting or a git branch
> > that I can look over?
> >
> > Thanks.
> Hi Konrad,
>      Really appreciate your support! I will try to post a new version 
> tomorrow,
> but I think there won't be big changes except addressing some review
> comments from you.

I also get this:

ERROR: "pci_set_host_bridge_release" [drivers/pci/xen-pcifront.ko] undefined!
ERROR: "pci_create_root_bus" [drivers/pci/xen-pcifront.ko] undefined!
ERROR: "pci_remove_root_bus" [drivers/pci/xen-pcifront.ko] undefined!
ERROR: "pci_stop_root_bus" [drivers/pci/xen-pcifront.ko] undefined!

when building it as a module.

WARNING: multiple messages have this Message-ID (diff)
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jiang Liu <liuj97@gmail.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	xen-devel@lists.xensource.com, Toshi Kani <toshi.kani@hp.com>,
	Jiang Liu <jiang.liu@huawei.com>,
	Myron Stowe <myron.stowe@redhat.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org,
	virtualization@lists.linux-foundation.org,
	"Rafael J . Wysocki" <rjw@sisk.pl>,
	Gu Zheng <guz.fnst@cn.fujitsu.com>,
	Yijing Wang <wangyijing@huawei.com>,
	linux-pci@vger.kernel.org, Bjorn Helgaas <bhelgaas@google.com>,
	Yinghai Lu <yinghai@kernel.org>
Subject: Re: [RFC PATCH v2, part3 07/11] PCI, xen-pcifront: use new PCI interfaces to simplify implementation
Date: Fri, 14 Jun 2013 14:07:19 -0400	[thread overview]
Message-ID: <20130614180719.GA21729@phenom.dumpdata.com> (raw)
In-Reply-To: <51B607FE.3020108@gmail.com>

On Tue, Jun 11, 2013 at 01:08:14AM +0800, Jiang Liu wrote:
> On Tue 11 Jun 2013 12:58:01 AM CST, Konrad Rzeszutek Wilk wrote:
> > On Mon, Jun 10, 2013 at 12:50:46AM +0800, Jiang Liu wrote:
> >> On Sat 08 Jun 2013 01:07:06 AM CST, Konrad Rzeszutek Wilk wrote:
> >>> On Sat, Jun 08, 2013 at 12:50:31AM +0800, Jiang Liu wrote:
> >>>> On 06/07/2013 11:38 PM, Konrad Rzeszutek Wilk wrote:
> >>>>> On Fri, Jun 07, 2013 at 10:50:24AM -0400, Konrad Rzeszutek Wilk wrote:
> >>>>>> On Thu, May 16, 2013 at 11:50:55PM +0800, Jiang Liu wrote:
> >>>>>>> Use new PCI interfaces to simplify xen-pcifront implementation:
> >>>>>>> 1) Use pci_create_root_bus() instead of pci_scan_bus_parented()
> >>>>>>>    because pci_scan_bus_parented() is marked as __deprecated.This
> >>>>>>>    also gets rid of a duplicated call of pci_bus_start_devices().
> >>>>>>> 2) Use pci_stop_root_bus() and pci_remove_root_bus() instead of
> >>>>>>>    open-coded private implementation.
> >>>>>>> 3) Use pci_set_host_bridge_release() to release data structures
> >>>>>>>    associated with PCI root buses.
> >>>>>>> 4) Use pci_bus_get()/pci_bus_put() to manage PCI root bus reference
> >>>>>>>    count.
> >>>>>>>
> >>>>>>> This is also a preparation for coming PCI bus lock enhancement.
> >>>>>
> >>>>> With this patch from :
> >>>>>
> >>>>>  Merge branch 'pci_lock_v3' of https://github.com/jiangliu/linux into testing
> >>>>>
> >>>>>
> >>>>> it blows up when detaching the device.
> >>>> Hi Konrad,
> >>>>    Thanks for testing! According to the log messages, this issue should
> >>>> be related to pci bus reference counter management. Seems we have done
> >>>> an extra(unbalanced) release of pci bus device.
> >>>>    Will investigate it tomorrow!
> >>>
> >>> That is quite commendable that you are willing to look over this on
> >>> the weekend but I am not going to be able to rerun this test until
> >>> some time in the week. You could enjoy the weekend and just look at
> >>> this during the week.
> >>
> >> Hi Konrad,
> >>      We should have root-caused this bug, which is caused by
> >> for_each_pci_root_bus().
> >> Current implementation doesn't support root bus deletion when walking
> >> PCI root
> >> buses by for_each_pci_root_bus(). The reference counter
> >> (pci_bus->dev.knode_class.n_ref)
> >> becomes zero after returning from pci_remove_root_bus(), so it triggers
> >> kref warnings
> >> and double-free of klist_node object when we call
> >> pci_get_next_root_bus() to get the
> >> next PCI root bus.
> >>      So we will first revert to  list_for_each_entry_safe(bus, temp,
> >> &pci_root_buses, node)
> >> and solve this issue in next version of for_each_pci_root_bus().
> >
> > That definitly solves the issue. Thanks!
> >
> > I used pci_lock_v3 of https://github.com/jiangliu/linux and the fix
> > below.
> >
> > Is there a new patchset you are going to be posting or a git branch
> > that I can look over?
> >
> > Thanks.
> Hi Konrad,
>      Really appreciate your support! I will try to post a new version 
> tomorrow,
> but I think there won't be big changes except addressing some review
> comments from you.

I also get this:

ERROR: "pci_set_host_bridge_release" [drivers/pci/xen-pcifront.ko] undefined!
ERROR: "pci_create_root_bus" [drivers/pci/xen-pcifront.ko] undefined!
ERROR: "pci_remove_root_bus" [drivers/pci/xen-pcifront.ko] undefined!
ERROR: "pci_stop_root_bus" [drivers/pci/xen-pcifront.ko] undefined!

when building it as a module.

  reply	other threads:[~2013-06-14 18:07 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-16 15:50 [RFC PATCH v2, part3 00/11] Introduce PCI bus lock and state machine Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 01/11] PCI: introduce bus lock and state machine to serialize PCI hotplug operations Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 02/11] PCI: implement state machine for PCI bus Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 03/11] PCI: introduce a state machine to manage PCI device lifecycle Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 04/11] PCI: introduce helper function pci_stop_and_remove_device() Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 05/11] PCI: enhance PCI core logic to support PCI bus lock Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 06/11] PCI, sysfs: use PCI bus lock to serialize hotplug operations triggered by sysfs Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 07/11] PCI, xen-pcifront: use new PCI interfaces to simplify implementation Jiang Liu
2013-05-16 15:50   ` Jiang Liu
2013-06-07 14:50   ` Konrad Rzeszutek Wilk
2013-06-07 14:50     ` Konrad Rzeszutek Wilk
2013-06-07 15:17     ` Jiang Liu
2013-06-07 15:17       ` Jiang Liu
2013-06-07 15:38     ` Konrad Rzeszutek Wilk
2013-06-07 15:38       ` Konrad Rzeszutek Wilk
2013-06-07 16:50       ` Jiang Liu
2013-06-07 17:07         ` Konrad Rzeszutek Wilk
2013-06-07 17:07           ` Konrad Rzeszutek Wilk
2013-06-09 16:50           ` Jiang Liu
2013-06-09 16:50           ` Jiang Liu
2013-06-10 16:58             ` Konrad Rzeszutek Wilk
2013-06-10 16:58               ` Konrad Rzeszutek Wilk
2013-06-10 17:08               ` Jiang Liu
2013-06-10 17:08                 ` Jiang Liu
2013-06-14 18:07                 ` Konrad Rzeszutek Wilk [this message]
2013-06-14 18:07                   ` Konrad Rzeszutek Wilk
2013-06-07 16:50       ` Jiang Liu
2013-06-07 15:50     ` Jiang Liu
2013-06-07 15:50     ` Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 08/11] PCI, xen-pcifront: use PCI bus lock to protect PCI device hotplug Jiang Liu
2013-05-16 15:50   ` Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 09/11] PCI, acpiphp: " Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 10/11] PCI, pciehp: " Jiang Liu
2013-05-16 15:50 ` [RFC PATCH v2, part3 11/11] PCI, ACPI, pci_root: " Jiang Liu
2013-05-16 19:59   ` Rafael J. Wysocki
2013-05-22  9:48 ` [RFC PATCH v2, part3 00/11] Introduce PCI bus lock and state machine Gu Zheng
2013-05-28  4:51   ` Yinghai Lu

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=20130614180719.GA21729@phenom.dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=bhelgaas@google.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=guz.fnst@cn.fujitsu.com \
    --cc=jeremy@goop.org \
    --cc=jiang.liu@huawei.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=liuj97@gmail.com \
    --cc=myron.stowe@redhat.com \
    --cc=rjw@sisk.pl \
    --cc=toshi.kani@hp.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=wangyijing@huawei.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=yinghai@kernel.org \
    /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.