qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Marcelo Tosatti <mtosatti@redhat.com>
To: Paul Brook <paul@codesourcery.com>
Cc: qemu-devel@nongnu.org, Markus Armbruster <armbru@redhat.com>
Subject: Re: [Qemu-devel] [patch 2/2] qemu: switch pci device init functions to accept devfn
Date: Mon, 13 Apr 2009 10:30:21 -0300	[thread overview]
Message-ID: <20090413133021.GA1065@amt.cnet> (raw)
In-Reply-To: <200904131327.35201.paul@codesourcery.com>

On Mon, Apr 13, 2009 at 01:27:34PM +0100, Paul Brook wrote:
> On Monday 13 April 2009, Marcelo Tosatti wrote:
> > Some pci device initialization functions do not accept a devfn parameter,
> > but instead use "-1", which caused pci_register_device to find the first
> > free slot on the given bus.
> >
> > Have them accept a "devfn" parameter, and use the newly introduced
> > pci_bus_assign_dev_addr function on platform init code to perform
> > the "first free" enumeration.
> 
> I don't see how this is better. If anything we want the platform code to get 
> smaller, not larger.

Paul,

This is a intermediate step. Later you'd get rid of
pci_bus_assign_dev_addr in platform code.

Ideally you'd have (I think):

- generic machine initialization code fills in details of pci device
  address in pci device structure (or a temporary placeholder) taken from
  machine description (optionally auto assigns from a free slot).

- pci driver init functions take generic device pointer as an
  argument (either containing the pre allocated pci device or temporary
  placeholder), and pass that to pci_register_device, which does
  actual registration of pci device on particular bus.

Does that make sense?

A benefit of the proposed patch is that it moves assumptions about pci  
device address assignment from drivers up to platform code. Later you'd
remove that from platform code to devtree data.

  reply	other threads:[~2009-04-13 13:34 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-13  3:53 [Qemu-devel] [patch 0/2] RFC: move PCI device enumeration out of pci drivers Marcelo Tosatti
2009-04-13  3:53 ` [Qemu-devel] [patch 1/2] qemu: move pci devfn "first free" assignment to separate function Marcelo Tosatti
2009-04-13  8:08   ` Avi Kivity
2009-04-13  3:53 ` [Qemu-devel] [patch 2/2] qemu: switch pci device init functions to accept devfn Marcelo Tosatti
2009-04-13 12:27   ` Paul Brook
2009-04-13 13:30     ` Marcelo Tosatti [this message]
2009-04-13 13:47       ` Brian Wheeler
2009-04-13 14:34         ` Marcelo Tosatti
2009-04-14  3:29           ` Marcelo Tosatti
2009-04-14  8:17     ` Marcelo Tosatti

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=20090413133021.GA1065@amt.cnet \
    --to=mtosatti@redhat.com \
    --cc=armbru@redhat.com \
    --cc=paul@codesourcery.com \
    --cc=qemu-devel@nongnu.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 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).