xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: Jan Beulich <JBeulich@novell.com>
Cc: Jeremy Fitzhardinge <jeremy@goop.org>,
	xen-devel@lists.xensource.com,
	Stefano Stabellini <stefano.stabellini@eu.citrix.com>,
	linux-kernel@vger.kernel.org, Ryan Wilson <hap9@darnok.org>,
	Konrad Rzeszutek Wilk <konrad@kernel.org>
Subject: Re: Re: [PATCH 20/23] xen-pcifront: Xen PCI frontend driver.
Date: Thu, 14 Oct 2010 13:35:37 -0400	[thread overview]
Message-ID: <20101014173536.GA7312@dumpdata.com> (raw)
In-Reply-To: <4CB6CA1A020000780001D161@vpn.id2.novell.com>

On Thu, Oct 14, 2010 at 08:15:06AM +0100, Jan Beulich wrote:
> >>> On 13.10.10 at 18:16, Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> wrote:
> > On Wed, Oct 13, 2010 at 09:53:44AM -0400, Konrad Rzeszutek Wilk wrote:
> >> Hey Jan,
> >> 
> >> Thank you for taking your time to look at this patch. Will fix up, test it, 
> >> and if there are no issues, have it ready tomorrow.
> > 
> > Attached (and inline) is the updated version of this patch. If I missed 
> > anything
> > please do point it out to me!
> 
> There's one more missing "static", and one incorrect change to
> free_pdev() you did.

Fixed.
> 
> Also, any word on the pdev_lock you dropped from the original
> implementation?

Yes. The reason for dropping it was that the xenwatch thread provides
the neccessary locking for the states. So no more need for this
spin_lock.

> 
> > If this is to your satisfaction, can I put a Reviewed-by tag on the patch?
> 
> Feel free to do so.

Thank you.
> 
> > --- /dev/null
> > +++ b/drivers/pci/xen-pcifront.c
> >...
> > +int __devinit pcifront_scan_bus(struct pcifront_device *pdev,
> 
> static?

Yup, done.
> 
> >...
> > +static void free_pdev(struct pcifront_device *pdev)
> > +{
> > +	dev_dbg(&pdev->xdev->dev, "freeing pdev @ 0x%p\n", pdev);
> > +
> > +	pcifront_free_roots(pdev);
> > +
> > +	/*For PCIE_AER error handling job*/
> > +	flush_scheduled_work();
> > +
> > +	if (pdev->irq)
> 
> 	if (pdev->irq > 0)
> 
> It gets initialized to -1 in alloc_pdev(). It may be debatable whether
> it should be >= 0 - I'm not sure if the pv-ops code allows IRQ 0 to
> be used. If it doesn't, initializing to 0 in alloc_pdev() would be an
> alternative.

I made it '>=' The Xen PCI (arch/x86/pci/xen.c) and Xen Events (riers/xen/events.c)
are both OK with an IRQ of zero. So lets be uniform and be OK here too.

> 
> > +		unbind_from_irqhandler(pdev->irq, pdev);
> > +
> > +	if (pdev->evtchn != INVALID_EVTCHN)
> > +		xenbus_free_evtchn(pdev->xdev, pdev->evtchn);
> > +
> > +	if (pdev->gnt_ref != INVALID_GRANT_REF)
> > +		gnttab_end_foreign_access(pdev->gnt_ref, 0 /* r/w page */,
> > +					  (unsigned long)pdev->sh_info);
> > +	else
> > +		free_page((unsigned long)pdev->sh_info);
> > +
> > +	dev_set_drvdata(&pdev->xdev->dev, NULL);
> > +
> > +	kfree(pdev);
> > +}
> > +
> > +static int pcifront_publish_info(struct pcifront_device *pdev)
> > +{
> > +	int err = 0;
> > +	struct xenbus_transaction trans;
> > +
> > +	err = xenbus_grant_ring(pdev->xdev, virt_to_mfn(pdev->sh_info));
> > +	if (err < 0)
> > +		goto out;
> > +
> > +	pdev->gnt_ref = err;
> > +
> > +	err = xenbus_alloc_evtchn(pdev->xdev, &pdev->evtchn);
> > +	if (err)
> > +		goto out;
> > +
> > +	err = bind_evtchn_to_irqhandler(pdev->evtchn, pcifront_handler_aer,
> > +		0, "pcifront", pdev);
> > +	if (err < 0) {
> > +		/*
> > +		xenbus_free_evtchn(pdev->xdev, pdev->evtchn);
> > +		xenbus_dev_fatal(pdev->xdev, err, "Failed to bind evtchn to "
> > +				 "irqhandler.\n");
> > +		*/
> 
> Why are you commenting it out rather than removing it?

Umm. I was in a hurry to test it out and just in case it would fail I
made it a comment. And then forgot about it. Removed that comented out
section of code.
> 
> Jan
> 
> 
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2010-10-14 17:35 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-12 15:44 [PATCH v8] Xen PCI + Xen PCI frontend driver Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 01/23] xen: Don't disable the I/O space Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 02/23] xen: define BIOVEC_PHYS_MERGEABLE() Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 03/23] xen: implement pirq type event channels Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 04/23] x86/io_apic: add get_nr_irqs_gsi() Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 05/23] xen: identity map gsi->irqs Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 06/23] xen: dynamically allocate irq & event structures Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 07/23] xen: set pirq name to something useful Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 08/23] xen: statically initialize cpu_evtchn_mask_p Konrad Rzeszutek Wilk
2011-01-24 17:44   ` Paolo Bonzini
2011-01-25 14:02     ` [Xen-devel] " Ian Campbell
2011-02-09 13:42       ` Andrew Jones
2011-02-09 14:08         ` Ian Campbell
2011-02-09 14:11           ` Andrew Jones
2010-10-12 15:44 ` [PATCH 09/23] xen: Find an unbound irq number in reverse order (high to low) Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 10/23] xen: Provide a variant of xen_poll_irq with timeout Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 11/23] xen: fix shared irq device passthrough Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 12/23] x86/PCI: Clean up pci_cache_line_size Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 13/23] x86/PCI: make sure _PAGE_IOMAP it set on pci mappings Konrad Rzeszutek Wilk
2010-10-12 15:54   ` Jesse Barnes
2010-10-12 15:44 ` [PATCH 14/23] x86/PCI: Export pci_walk_bus function Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 15/23] msi: Introduce default_[teardown|setup]_msi_irqs with fallback Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 16/23] x86: Introduce x86_msi_ops Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 17/23] xen/x86/PCI: Add support for the Xen PCI subsystem Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 18/23] xenbus: Xen paravirtualised PCI hotplug support Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 19/23] xenbus: prevent warnings on unhandled enumeration values Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 20/23] xen-pcifront: Xen PCI frontend driver Konrad Rzeszutek Wilk
2010-10-13  9:36   ` Jan Beulich
2010-10-13 13:53     ` Konrad Rzeszutek Wilk
2010-10-13 16:16       ` Konrad Rzeszutek Wilk
2010-10-14  7:15         ` [Xen-devel] " Jan Beulich
2010-10-14 17:35           ` Konrad Rzeszutek Wilk [this message]
2010-10-12 15:44 ` [PATCH 21/23] xen/pci: Request ACS when Xen-SWIOTLB is activated Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 22/23] MAINTAINERS: Add myself for Xen PCI and Xen SWIOTLB maintainer Konrad Rzeszutek Wilk
2010-10-12 15:44 ` [PATCH 23/23] swiotlb-xen: On x86-32 builts, select SWIOTLB instead of depending on it Konrad Rzeszutek Wilk

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=20101014173536.GA7312@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=JBeulich@novell.com \
    --cc=hap9@darnok.org \
    --cc=jeremy@goop.org \
    --cc=konrad@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).