mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Pavel Machek <pavel@denx.de>
To: Guenter Roeck <linux@roeck-us.net>
Cc: sr@denx.de, w.sang@pengutronix.de, magnus.damm@gmail.com,
	hjk@linutronix.de, Greg KH <greg@kroah.com>,
	linux-kernel@vger.kernel.org, dzu@denx.de
Subject: Re: UIO device tree bindings.
Date: Tue, 2 Apr 2013 22:35:19 +0200	[thread overview]
Message-ID: <20130402203519.GA12385@amd.pavel.ucw.cz> (raw)
In-Reply-To: <20130402154333.GA21941@roeck-us.net>

Hi!

> > > > > Or maybe we can do some magic with module parameter. That should be
> > > > > enough for expected use.
> > > > > 
> > > > I don't think that would make a difference. I mean, just take ns16550 as another
> > > > example. No one has problems declaring some block of hardware addresses to be
> > > > compatible with "ns16550", even though it can be anything including a memory
> > > > block on one of the FPGAs or ASICs we are talking about here, it can be anything
> > > > but a NS16550, and many of the actual "compatible" strings are not defined
> > > > anythere either.
> > > > 
> > > > So there is no problem with "ata-generic" and "ns16550", and no one cares if
> > > > "fsl,mpc8349emitx-pata" or "xlnx,xps-uart16550-2.00.b" is defined or not, but
> > > > "generic-uio" together with "ptx,c64fpga001" is unacceptable.
> > > > 
> > > > I think it has more to do with the uio driver not being an actual driver, but
> > > > the kernel part of a user-space driver, though that is just a wild guess.
> > > 
> > > Well, it turned out that adding module parameter was not that much
> > > work... and yes I believe it is a tiny bit cleaner.
> > > 
> > > Here's updated patch, if you can please test this one.
> > > 
> > > [You can just pass "uio_of_genirq.of_id=generic-uio" to get previous
> > > behaviour. But don't tell anyone :-)]
> > 
> > Actually, looking at it some more, perhaps even solution is possible?
> > (This will need uio_pdrv_genirq.of_id=generic-uio .)
> > 
> Possibly for your case, but not for mine, as I'll have several instances of the
> driver, and the hardware is not always present. Also, I am not sure if the match
> function runs before the module paratemers are initialized or afterwards, but that
> would be a matter of testing.

I tested that much: it works ok.

And... yes, this should work for you. You'll simply put
compatible="generic-uio" into the dts. (Ok, ugly part is that this is
probably not acceptable for upstream.) Then you'll use this patch,
with uio_pdrv_genirq.of_id=generic-uio commandline. It should pick up
all the devices old version of patch picked. (Not sure how you'll
assign right userland drivers to right devices, but that problem was
that even with old patch version, right?)

> > Unfortunately, I don't have easy way to test this :-(. So feedback is
> > essential.
> > 
> I'll try to get it to work, but it will take a bit.

Thanks,
									Pavel

> > Signed-off-by: Pavel Machek <pavel@denx.de>
> > 
> > diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
> > index 4a50ead..64b6dac 100644
> > --- a/drivers/uio/uio_pdrv_genirq.c
> > +++ b/drivers/uio/uio_pdrv_genirq.c
> > @@ -271,9 +273,13 @@ static const struct dev_pm_ops uio_pdrv_genirq_dev_pm_ops = {
> >  
> >  #ifdef CONFIG_OF
> >  static const struct of_device_id uio_of_genirq_match[] = {
> > -	{ /* empty for now */ },
> > +	{ /* This is filled with module_parm */ },
> > +	{ /* Sentinel */ },
> >  };
> >  MODULE_DEVICE_TABLE(of, uio_of_genirq_match);
> > +
> > +module_param_string(of_id, uio_of_genirq_match[0].compatible, 128, 0);
> > +MODULE_PARM_DESC(of_id, "Openfirmware id of the device to be handled by uio");
> >  #else
> >  # define uio_of_genirq_match NULL
> >  #endif

-- 
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html

      reply	other threads:[~2013-04-02 20:35 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-04-01 14:23 Pavel Machek
2013-04-01 15:40 ` Pavel Machek
2013-04-02  2:42   ` Guenter Roeck
2013-04-02 11:51     ` Pavel Machek
2013-04-02 12:51       ` Guenter Roeck
2013-04-02 13:19         ` Pavel Machek
2013-04-02 13:46           ` Pavel Machek
2013-04-02 15:43             ` Guenter Roeck
2013-04-02 20:35               ` Pavel Machek [this message]

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=20130402203519.GA12385@amd.pavel.ucw.cz \
    --to=pavel@denx.de \
    --cc=dzu@denx.de \
    --cc=greg@kroah.com \
    --cc=hjk@linutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=magnus.damm@gmail.com \
    --cc=sr@denx.de \
    --cc=w.sang@pengutronix.de \
    /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

all inboxes | Powered by JetHome®