public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Kim Phillips <kim.phillips@linaro.org>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
	scottwood@freescale.com, R65777@freescale.com,
	B07421@freescale.com, B08248@freescale.com,
	christoffer.dall@linaro.org, alex.williamson@redhat.com,
	a.motakis@virtualopensystems.com, agraf@suse.de,
	B16395@freescale.com
Subject: Re: [REPOST][PATCH 2/2] driver core: platform: allow platform drivers to bind to any device
Date: Wed, 18 Dec 2013 17:03:40 -0800	[thread overview]
Message-ID: <20131219010340.GA23055@kroah.com> (raw)
In-Reply-To: <20131203123454.3ab18749ed0d0d943b10df9a@linaro.org>

On Tue, Dec 03, 2013 at 12:34:54PM +0000, Kim Phillips wrote:
> Platform drivers such as the vfio-platform "meta-" driver [1]
> should be allowed to specify that they can bind to any device,
> much like PCI drivers can with PCI_ANY_ID.
> 
> Currently, binding platform drivers to devices depends on:
> 
> - a string match in the device node's compatible entry (OF)
> - a string match in the ACPI id list (ACPI)
> - a string match in the id_table (platform data)
> - a string match on the driver name (fall-back)
> 
> none of which allow for the notion of "match any."
> 
> This patch adds the notion by adding a "match any device" boolean to
> struct platform_driver, for drivers to be able to set and thus not cause
> platform_match() to fail when a bind is requested.
> 
> [1] http://www.spinics.net/lists/kvm/msg96701.html
> 
> Signed-off-by: Kim Phillips <kim.phillips@linaro.org>
> ---
> rebased onto 3.13-rc2, and reposted from first submission which
> received no comments:
> 
> https://lkml.org/lkml/2013/10/11/48
> 
>  drivers/base/platform.c         | 4 ++++
>  include/linux/platform_device.h | 1 +
>  2 files changed, 5 insertions(+)
> 
> diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> index 3a94b79..78a5b62 100644
> --- a/drivers/base/platform.c
> +++ b/drivers/base/platform.c
> @@ -736,6 +736,10 @@ static int platform_match(struct device *dev, struct device_driver *drv)
>  	struct platform_device *pdev = to_platform_device(dev);
>  	struct platform_driver *pdrv = to_platform_driver(drv);
>  
> +	/* the driver matches any device */
> +	if (pdrv->match_any_dev)
> +		return 1;

This breaks userspace in that it will never know to load the module that
can "bind to anything".

You need a way to encode this in the platform device id that can be a
wildcard type of thing, so that userspace can know about this.

thanks,

greg k-h

  reply	other threads:[~2013-12-19  1:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-12-03 12:34 [REPOST][PATCH 2/2] driver core: platform: allow platform drivers to bind to any device Kim Phillips
2013-12-19  1:03 ` Greg Kroah-Hartman [this message]
2013-12-19 20:29   ` Scott Wood
2013-12-19 20:44     ` Greg Kroah-Hartman
2013-12-19 22:17       ` Scott Wood

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=20131219010340.GA23055@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=B07421@freescale.com \
    --cc=B08248@freescale.com \
    --cc=B16395@freescale.com \
    --cc=R65777@freescale.com \
    --cc=a.motakis@virtualopensystems.com \
    --cc=agraf@suse.de \
    --cc=alex.williamson@redhat.com \
    --cc=christoffer.dall@linaro.org \
    --cc=kim.phillips@linaro.org \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=scottwood@freescale.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