linux-um.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Johannes Berg <johannes@sipsolutions.net>
To: Vincent Whitchurch <vincent.whitchurch@axis.com>
Cc: Richard Weinberger <richard@nod.at>,
	Anton Ivanov <anton.ivanov@cambridgegreys.com>,
	"robh@kernel.org" <robh@kernel.org>,
	 devicetree@vger.kernel.org,
	"linux-um@lists.infradead.org" <linux-um@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	kernel <kernel@axis.com>
Subject: Re: [PATCH] virt-pci: add platform bus support
Date: Tue, 28 Feb 2023 18:39:34 +0100	[thread overview]
Message-ID: <699d35cd36f3d77c112a6aa8705b043efaa63711.camel@sipsolutions.net> (raw)
In-Reply-To: <Y+t6qXBxLqf/+eQM@axis.com>

On Tue, 2023-02-14 at 13:12 +0100, Vincent Whitchurch wrote:
> 
> Yes, Greg was initially totally opposed to the idea of putting platform
> devices under PCI devices, but in his latest email he seemed to
> allow it in some cases.  It's still unclear if he'd be OK with a
> "virtual PCI-to-platform bridge" though.  And yes, adding platform
> devices support like in this patch removes one layer and also eliminates
> the disadvantage of having to wait for user space to specify a PCI ID
> for the bridge device.

Right.

> > > +	if (!dev->irq)
> > > +		return;
> > > 
> > 
> > Does that mean platform devices don't have interrupts, or does that mean
> > not all of them must have interrupts?
> 
> They don't have interrupts via this driver.  There isn't any standard
> way for platform devices to handle interrupts since it it all depends on
> what interrupt-parent is specified in the devicetree and how that is
> implemented.

Ah, OK.

> > I'll note that this also would allow the device to send an MSI which
> > feels a bit wrong? But I guess it doesn't really matter.
> 
> We could avoid setting up the IRQ/MSI virtqueue when we know we're
> dealing with platform devices.

Not sure it matters then?

> > So let me ask this: Conceptually, wouldn't the "right" way to handle
> > this be a new virtio device and protocol and everything, with a new
> > driver to handle it? I realise that would likely lead to quite a bit of
> > code duplication, for now I just want to understand the concept here a
> > bit better.
> 
> Yes, that could be a way to do it.  Or there could perhaps be some
> feature bits indicating that only MMIO read/write/memset are allowed.

Right.

> > How much code would we actually duplicate? Most of virt-pci is dedicated
> > to the mess of PCI MSI domains, bridges, etc.
> 
> Probably not a huge amount, I can try to cook up a patch if you'd like.
> But, besides the code duplication, I'm not sure if adding another new
> virtio driver without a specification would be OK?

Yeah ... let's not worry. Was mostly trying to understand it better.

I'm not really bothered by it :)

> > The limitation to a single device feels odd, and the fact that you have
> 
> The limitation to a single device here is not a problem since one can
> use simple-bus to instantiate any number of platform devices via the
> devicetree.  The devicetree at the end of this email shows how that
> looks like.

OK cool.

> With a devicetree like the one below, using it shouldn't be all that
> different from using the normal virt-pci except that the register ranges
> and IRQ information are in the devicetree rather than coming via the
> config space implementation in the virtio device.

Makes sense.

Thanks for all the answers & examples! Let's just leave it as is then :)

johannes

_______________________________________________
linux-um mailing list
linux-um@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-um

  reply	other threads:[~2023-02-28 17:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-27 14:30 [PATCH] virt-pci: add platform bus support Vincent Whitchurch
2023-02-13 17:54 ` Johannes Berg
2023-02-13 18:09   ` Richard Weinberger
2023-02-14 12:12   ` Vincent Whitchurch
2023-02-28 17:39     ` Johannes Berg [this message]
2023-03-07  0:31     ` Rob Herring

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=699d35cd36f3d77c112a6aa8705b043efaa63711.camel@sipsolutions.net \
    --to=johannes@sipsolutions.net \
    --cc=anton.ivanov@cambridgegreys.com \
    --cc=devicetree@vger.kernel.org \
    --cc=kernel@axis.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-um@lists.infradead.org \
    --cc=richard@nod.at \
    --cc=robh@kernel.org \
    --cc=vincent.whitchurch@axis.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).