[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20140331173218.d12bc3ca7773139a09822dfc@linaro.org>
Date: Mon, 31 Mar 2014 17:32:18 -0500
From: Kim Phillips <kim.phillips@...aro.org>
To: stuart.yoder@...escale.com
Cc: gregkh@...uxfoundation.org, kvm@...r.kernel.org,
jan.kiszka@...mens.com, will.deacon@....com, mhocko@...e.cz,
bhelgaas@...gle.com, Varun.Sethi@...escale.com,
kvmarm@...ts.cs.columbia.edu, rafael.j.wysocki@...el.com,
linux@...ck-us.net, d.kasatkin@...sung.com, tj@...nel.org,
alex.williamson@...hat.com, scottwood@...escale.com,
tech@...tualopensystems.com, toshi.kani@...com,
linux-kernel@...r.kernel.org, iommu@...ts.linux-foundation.org,
joe@...ches.com, kim.phillips@...escale.com
Subject: Re: mechanism to allow a driver to bind to any device
On Mon, 31 Mar 2014 20:23:36 +0000
Stuart Yoder <stuart.yoder@...escale.com> wrote:
> > From: Greg KH [mailto:gregkh@...uxfoundation.org]
> > Sent: Monday, March 31, 2014 2:47 PM
> >
> > On Mon, Mar 31, 2014 at 06:47:51PM +0000, Stuart Yoder wrote:
> > > I also, was at the point where I thought we should perhaps just
> > > go with current mechanisms and implement new_id for the platform
> > > bus...but Greg's recent response is 'platform devices suck' and it
> > sounds
> > > like he would reject a new_id patch for the platform bus. So it kind
> > > of feels like we are stuck.
> >
> > ids mean nothing in the platform device model, so having a new_id file
> > for them makes no sense.
>
> They don't have IDs like PCI, but platform drivers have to match on
> something. Platform device match tables are based on compatible strings.
>
> Example from Freescale DMA driver:
> static const struct of_device_id fsldma_of_ids[] = {
> { .compatible = "fsl,elo3-dma", },
> { .compatible = "fsl,eloplus-dma", },
> { .compatible = "fsl,elo-dma", },
> {}
> };
>
> The process of unbinding, setting a new_id, and binding to vfio would work
> just like PCI:
>
> echo ffe101300.dma > /sys/bus/platform/devices/ffe101300.dma/driver/unbind
> echo fsl,eloplus-dma > /sys/bus/platform/drivers/vfio-platform/new_id
In platform device land, we don't want to pursue the
new_id/match-by-compatible methodology: we know exactly which specific
device (not device types) we want bound to which driver, so we just
want to be able to simply:
echo fff51000.ethernet | sudo tee -a /sys/bus/platform/devices/fff51000.ethernet/driver/unbind
echo fff51000.ethernet | sudo tee -a /sys/bus/platform/drivers/vfio-platform/bind
and not get involved with how PCI "doesn't simply do that," independent
of autoprobe/hotplug.
Kim
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists