Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
uio/pdrv_genirq: Add OF support
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  Messages 1 - 25 of 29 - Collapse all  -  Translate all to Translated (View all originals)   Newer >
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
Michal Simek  
View profile  
 More options Apr 14 2011, 5:50 am
Newsgroups: linux.kernel
From: Michal Simek <mon...@monstr.eu>
Date: Thu, 14 Apr 2011 11:50:03 +0200
Local: Thurs, Apr 14 2011 5:50 am
Subject: [PATCH v2] uio/pdrv_genirq: Add OF support
Support OF support. "generic-uio" compatible property is used.

Signed-off-by: Michal Simek <mon...@monstr.eu>

---
v2: Remove additional resource binding
    Setup correct version string
    Clear compatible string
---
 drivers/uio/uio_pdrv_genirq.c |   45 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 45 insertions(+), 0 deletions(-)

diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index 7174d51..fd84a93 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -23,6 +23,10 @@
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>

+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/of_address.h>
+
 #define DRIVER_NAME "uio_pdrv_genirq"

 struct uio_pdrv_genirq_platdata {
@@ -97,6 +101,28 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
        int ret = -EINVAL;
        int i;

+       if (!uioinfo) {
+               /* alloc uioinfo for one device */
+               uioinfo = kzalloc(sizeof(*uioinfo), GFP_KERNEL);
+               if (!uioinfo) {
+                       ret = -ENOMEM;
+                       dev_err(&pdev->dev, "unable to kmalloc\n");
+                       goto bad2;
+               }
+               uioinfo->name = pdev->dev.of_node->name;
+               uioinfo->version = "dt";
+
+               /* Multiple IRQs are not supported */
+               if (pdev->num_resources > 1) {
+                       struct resource *r = &pdev->resource[1];
+                       uioinfo->irq = r->start;
+                       dev_info(&pdev->dev, "irq %d\n", (u32)uioinfo->irq);
+               } else {
+                       uioinfo->irq = UIO_IRQ_NONE;
+                       dev_info(&pdev->dev, "no IRQ found\n");
+               }
+       }
+
        if (!uioinfo || !uioinfo->name || !uioinfo->version) {
                dev_err(&pdev->dev, "missing platform_data\n");
                goto bad0;
@@ -180,6 +206,10 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
        kfree(priv);
        pm_runtime_disable(&pdev->dev);
  bad0:
+       /* kfree uioinfo for CONFIG_OF */
+       if (!pdev->dev.platform_data)
+               kfree(uioinfo);
+ bad2:
        return ret;
 }

@@ -215,6 +245,20 @@ static const struct dev_pm_ops uio_pdrv_genirq_dev_pm_ops = {
        .runtime_resume = uio_pdrv_genirq_runtime_nop,
 };

+#ifdef CONFIG_OF
+/*
+ * Empty match table for of_platform binding
+ * Select your custom compatible string in format
+ * { .compatible = "<compatible string>", },
+ */
+static const struct of_device_id __devinitconst uio_of_genirq_match[] = {
+       { /* end of list */ },
+};
+MODULE_DEVICE_TABLE(of, uio_of_genirq_match);
+#else
+# define uio_of_genirq_match NULL
+#endif
+
 static struct platform_driver uio_pdrv_genirq = {
        .probe = uio_pdrv_genirq_probe,
        .remove = uio_pdrv_genirq_remove,
@@ -222,6 +266,7 @@ static struct platform_driver uio_pdrv_genirq = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
                .pm = &uio_pdrv_genirq_dev_pm_ops,
+               .of_match_table = uio_of_genirq_match,
        },
 };

--
1.5.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wolfram Sang  
View profile  
 More options Apr 14 2011, 1:00 pm
Newsgroups: linux.kernel
From: Wolfram Sang <w.s...@pengutronix.de>
Date: Thu, 14 Apr 2011 19:00:02 +0200
Local: Thurs, Apr 14 2011 1:00 pm
Subject: Re: [PATCH v2] uio/pdrv_genirq: Add OF support

Hi Michal,

On Thu, Apr 14, 2011 at 11:41:46AM +0200, Michal Simek wrote:
> Support OF support. "generic-uio" compatible property is used.

This description is not true anymore. Please also add a short paragrpah how it
is intended to be used now.

> Signed-off-by: Michal Simek <mon...@monstr.eu>
> +          uioinfo->version = "dt";

Minor nit: "devicetree" is probably more descriptive.

> +
> +          /* Multiple IRQs are not supported */
> +          if (pdev->num_resources > 1) {
> +                  struct resource *r = &pdev->resource[1];

Are you sure the irq-ressource is always [1]? (Similar question for the
if()-block above). Try platform_get_irq().

> +#ifdef CONFIG_OF
> +/*
> + * Empty match table for of_platform binding

While it probably doesn't make change to put every supported device in
upstream, it still deosn't technically have to be empty. So, mabye drop this
comment and add something like "/* empty for now */" to the table?

Thanks,

   Wolfram

--
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  signature.asc
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hans J. Koch  
View profile  
 More options Apr 14 2011, 7:10 pm
Newsgroups: linux.kernel
From: "Hans J. Koch" <h...@hansjkoch.de>
Date: Fri, 15 Apr 2011 01:10:02 +0200
Local: Thurs, Apr 14 2011 7:10 pm
Subject: Re: [PATCH v2] uio/pdrv_genirq: Add OF support

Can that be something more descriptive?

> +
> +          /* Multiple IRQs are not supported */

But multiple mappings are, and also no mappings.

> +          if (pdev->num_resources > 1) {
> +                  struct resource *r = &pdev->resource[1];
> +                  uioinfo->irq = r->start;

Why has the irq be resource[1] ?

doesn't that want a NULL termination?

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arnd Bergmann  
View profile  
 More options Apr 17 2011, 2:00 pm
Newsgroups: linux.kernel
From: Arnd Bergmann <a...@arndb.de>
Date: Sun, 17 Apr 2011 20:00:02 +0200
Local: Sun, Apr 17 2011 2:00 pm
Subject: Re: [PATCH v2] uio/pdrv_genirq: Add OF support
On Friday 15 April 2011, Hans J. Koch wrote:

> > +#ifdef CONFIG_OF
> > +/*
> > + * Empty match table for of_platform binding
> > + * Select your custom compatible string in format
> > + * { .compatible = "<compatible string>", },
> > + */
> > +static const struct of_device_id __devinitconst uio_of_genirq_match[] = {
> > +     { /* end of list */ },

> doesn't that want a NULL termination?

It is NULL terminated, that is the /* end of list */.

        Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hans J. Koch  
View profile  
 More options Apr 17 2011, 2:10 pm
Newsgroups: linux.kernel
From: "Hans J. Koch" <h...@hansjkoch.de>
Date: Sun, 17 Apr 2011 20:10:02 +0200
Local: Sun, Apr 17 2011 2:10 pm
Subject: Re: [PATCH v2] uio/pdrv_genirq: Add OF support

On Sun, Apr 17, 2011 at 07:53:42PM +0200, Arnd Bergmann wrote:
> On Friday 15 April 2011, Hans J. Koch wrote:
> > > +#ifdef CONFIG_OF
> > > +/*
> > > + * Empty match table for of_platform binding
> > > + * Select your custom compatible string in format
> > > + * { .compatible = "<compatible string>", },
> > > + */
> > > +static const struct of_device_id __devinitconst uio_of_genirq_match[] = {
> > > +     { /* end of list */ },

> > doesn't that want a NULL termination?

> It is NULL terminated, that is the /* end of list */.

Right.

Thanks,
Hans
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michal Simek  
View profile  
 More options Apr 18 2011, 4:40 am
Newsgroups: linux.kernel
From: Michal Simek <mon...@monstr.eu>
Date: Mon, 18 Apr 2011 10:40:03 +0200
Local: Mon, Apr 18 2011 4:40 am
Subject: Re: [PATCH v2] uio/pdrv_genirq: Add OF support
Hi Wolfram,

Wolfram Sang wrote:
> Hi Michal,

> On Thu, Apr 14, 2011 at 11:41:46AM +0200, Michal Simek wrote:
>> Support OF support. "generic-uio" compatible property is used.

> This description is not true anymore. Please also add a short paragrpah how it
> is intended to be used now.

ok.

>> Signed-off-by: Michal Simek <mon...@monstr.eu>

>> +              uioinfo->version = "dt";

> Minor nit: "devicetree" is probably more descriptive.

no problem to change it

>> +
>> +              /* Multiple IRQs are not supported */
>> +              if (pdev->num_resources > 1) {
>> +                      struct resource *r = &pdev->resource[1];

> Are you sure the irq-ressource is always [1]?  (Similar question for the
> if()-block above). Try platform_get_irq().

I wasn't aware about platform_get_irq. You are right.

What "if()-block above" are you talking about?
Above is kzalloc uioinfo allocation.
I am going to send v3 that's why please comment this there.

>> +#ifdef CONFIG_OF
>> +/*
>> + * Empty match table for of_platform binding

> While it probably doesn't make change to put every supported device in
> upstream, it still deosn't technically have to be empty. So, mabye drop this
> comment and add something like "/* empty for now */" to the table?

ok, done.

Thanks,
Michal

--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michal Simek  
View profile  
 More options Apr 18 2011, 4:50 am
Newsgroups: linux.kernel
From: Michal Simek <mon...@monstr.eu>
Date: Mon, 18 Apr 2011 10:50:03 +0200
Local: Mon, Apr 18 2011 4:50 am
Subject: Re: [PATCH v2] uio/pdrv_genirq: Add OF support

look at my previous post.

>> +
>> +              /* Multiple IRQs are not supported */

> But multiple mappings are, and also no mappings.

I have tested multiple mappings and it is no problem to use it.
No mapping is also fine.

>> +              if (pdev->num_resources > 1) {
>> +                      struct resource *r = &pdev->resource[1];
>> +                      uioinfo->irq = r->start;

> Why has the irq be resource[1] ?

look at my previous post.

Thanks,
Michal

--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michal Simek  
View profile  
 More options Apr 18 2011, 5:00 am
Newsgroups: linux.kernel
From: Michal Simek <mon...@monstr.eu>
Date: Mon, 18 Apr 2011 11:00:01 +0200
Local: Mon, Apr 18 2011 5:00 am
Subject: [PATCH v3] uio/pdrv_genirq: Add OF support
Adding OF binding to genirq.
Version string is setup to the "devicetree".

Compatible string is not setup for now but you can add your
custom compatible string to uio_of_genirq_match structure.

For example with "uio" compatible string:
static const struct of_device_id __devinitconst uio_of_genirq_match[] = {
        { .compatible = "uio", },
        { /* empty for now */ },

};

Signed-off-by: Michal Simek <mon...@monstr.eu>

---

v3: Fix irq binding
    Use "devicetree" as version string

v2: Remove additional resource binding
    Setup correct version string
    Clear compatible string
---
 drivers/uio/uio_pdrv_genirq.c |   42 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 42 insertions(+), 0 deletions(-)

diff --git a/drivers/uio/uio_pdrv_genirq.c b/drivers/uio/uio_pdrv_genirq.c
index 7174d51..c8d565a 100644
--- a/drivers/uio/uio_pdrv_genirq.c
+++ b/drivers/uio/uio_pdrv_genirq.c
@@ -23,6 +23,10 @@
 #include <linux/pm_runtime.h>
 #include <linux/slab.h>

+#include <linux/of.h>
+#include <linux/of_platform.h>
+#include <linux/of_address.h>
+
 #define DRIVER_NAME "uio_pdrv_genirq"

 struct uio_pdrv_genirq_platdata {
@@ -97,6 +101,30 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
        int ret = -EINVAL;
        int i;

+       if (!uioinfo) {
+               int irq;
+
+               /* alloc uioinfo for one device */
+               uioinfo = kzalloc(sizeof(*uioinfo), GFP_KERNEL);
+               if (!uioinfo) {
+                       ret = -ENOMEM;
+                       dev_err(&pdev->dev, "unable to kmalloc\n");
+                       goto bad2;
+               }
+               uioinfo->name = pdev->dev.of_node->name;
+               uioinfo->version = "devicetree";
+
+               /* Multiple IRQs are not supported */
+               irq = platform_get_irq(pdev, 0);
+               if (irq < 0) {
+                       uioinfo->irq = UIO_IRQ_NONE;
+                       dev_info(&pdev->dev, "no IRQ found\n");
+               } else {
+                       uioinfo->irq = irq;
+                       dev_info(&pdev->dev, "irq %d\n", (u32)uioinfo->irq);
+               }
+       }
+
        if (!uioinfo || !uioinfo->name || !uioinfo->version) {
                dev_err(&pdev->dev, "missing platform_data\n");
                goto bad0;
@@ -180,6 +208,10 @@ static int uio_pdrv_genirq_probe(struct platform_device *pdev)
        kfree(priv);
        pm_runtime_disable(&pdev->dev);
  bad0:
+       /* kfree uioinfo for CONFIG_OF */
+       if (!pdev->dev.platform_data)
+               kfree(uioinfo);
+ bad2:
        return ret;
 }

@@ -215,6 +247,15 @@ static const struct dev_pm_ops uio_pdrv_genirq_dev_pm_ops = {
        .runtime_resume = uio_pdrv_genirq_runtime_nop,
 };

+#ifdef CONFIG_OF
+static const struct of_device_id __devinitconst uio_of_genirq_match[] = {
+       { /* empty for now */ },
+};
+MODULE_DEVICE_TABLE(of, uio_of_genirq_match);
+#else
+# define uio_of_genirq_match NULL
+#endif
+
 static struct platform_driver uio_pdrv_genirq = {
        .probe = uio_pdrv_genirq_probe,
        .remove = uio_pdrv_genirq_remove,
@@ -222,6 +263,7 @@ static struct platform_driver uio_pdrv_genirq = {
                .name = DRIVER_NAME,
                .owner = THIS_MODULE,
                .pm = &uio_pdrv_genirq_dev_pm_ops,
+               .of_match_table = uio_of_genirq_match,
        },
 };

--
1.5.5.6

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Paul Mundt  
View profile  
 More options Apr 18 2011, 6:40 am
Newsgroups: linux.kernel
From: Paul Mundt <let...@linux-sh.org>
Date: Mon, 18 Apr 2011 12:40:01 +0200
Local: Mon, Apr 18 2011 6:40 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support
On Mon, Apr 18, 2011 at 10:50:54AM +0200, Michal Simek wrote:
> Adding OF binding to genirq.
> Version string is setup to the "devicetree".

> Compatible string is not setup for now but you can add your
> custom compatible string to uio_of_genirq_match structure.

> For example with "uio" compatible string:
> static const struct of_device_id __devinitconst uio_of_genirq_match[] = {
>    { .compatible = "uio", },
>    { /* empty for now */ },
> };

> Signed-off-by: Michal Simek <mon...@monstr.eu>

Perhaps a silly question, but how are you planning on differentiating
between uio_pdrv and uio_pdrv_genirq binding if someone has both enabled?

uio_pdrv obviously doesn't have OF bindings at the moment, but it seems
like you could easily parse the memory ranges in addition to the IRQ and
come up with a generic binding that would work for both.

We also have a shiny new Documentation/devicetree these days, so it would
be nice to see the binding documented at the same time.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michal Simek  
View profile  
 More options Apr 18 2011, 7:20 am
Newsgroups: linux.kernel
From: Michal Simek <mon...@monstr.eu>
Date: Mon, 18 Apr 2011 13:20:02 +0200
Local: Mon, Apr 18 2011 7:20 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support

It is not a silly question. OF support in uio_pdrv_genirq can handle both cases
with/without IRQ (I tested it) and I don't want to add OF support to uio_pdrv.
Not sure if uio_pdrv_genirq without OF can handle UIO without IRQ.

> uio_pdrv obviously doesn't have OF bindings at the moment, but it seems
> like you could easily parse the memory ranges in addition to the IRQ and
> come up with a generic binding that would work for both.

I think the question is if uio_pdrv_genirq can handle both cases, if yes, we can
completely remove uio_pdrv. But it is up to UIO maintainers.

> We also have a shiny new Documentation/devicetree these days, so it would
> be nice to see the binding documented at the same time.

Sure - make sense.

Michal

--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wolfram Sang  
View profile  
 More options Apr 18 2011, 11:30 am
Newsgroups: linux.kernel
From: Wolfram Sang <w.s...@pengutronix.de>
Date: Mon, 18 Apr 2011 17:30:02 +0200
Local: Mon, Apr 18 2011 11:30 am
Subject: Re: [PATCH v2] uio/pdrv_genirq: Add OF support

> >>+
> >>+          /* Multiple IRQs are not supported */
> >>+          if (pdev->num_resources > 1) {
> >>+                  struct resource *r = &pdev->resource[1];

> >Are you sure the irq-ressource is always [1]?  (Similar question for the
> >if()-block above). Try platform_get_irq().

> I wasn't aware about platform_get_irq. You are right.

> What "if()-block above" are you talking about?

The one I quoted: if (pdev->num_resources > 1)

--
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  signature.asc
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Wolfram Sang  
View profile  
 More options Apr 18 2011, 12:10 pm
Newsgroups: linux.kernel
From: Wolfram Sang <w.s...@pengutronix.de>
Date: Mon, 18 Apr 2011 18:10:01 +0200
Local: Mon, Apr 18 2011 12:10 pm
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support

Hi,

> For example with "uio" compatible string:
> static const struct of_device_id __devinitconst uio_of_genirq_match[] = {
>    { .compatible = "uio", },
>    { /* empty for now */ },
> };

Please use a proper example with "vendor,device".
(And after that it won't be empty anymore)

> +          /* Multiple IRQs are not supported */
> +          irq = platform_get_irq(pdev, 0);
> +          if (irq < 0) {
> +                  uioinfo->irq = UIO_IRQ_NONE;
> +                  dev_info(&pdev->dev, "no IRQ found\n");
> +          } else {
> +                  uioinfo->irq = irq;
> +                  dev_info(&pdev->dev, "irq %d\n", (u32)uioinfo->irq);
> +          }

Come to think of it, the driver so far does not print any dev_info messages,
only err and warn. So, I'd think these messages should go, too, but this is up
to Hans.

Regards,

   Wolfram

--
Pengutronix e.K.                           | Wolfram Sang                |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  signature.asc
< 1K Download

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Williams  
View profile  
 More options Apr 18 2011, 10:00 pm
Newsgroups: linux.kernel
From: John Williams <john.willi...@petalogix.com>
Date: Tue, 19 Apr 2011 04:00:01 +0200
Local: Mon, Apr 18 2011 10:00 pm
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support

On Tue, Apr 19, 2011 at 2:06 AM, Wolfram Sang <w.s...@pengutronix.de> wrote:
> Hi,

>> For example with "uio" compatible string:
>> static const struct of_device_id __devinitconst uio_of_genirq_match[] = {
>>       { .compatible = "uio", },
>>       { /* empty for now */ },
>> };

> Please use a proper example with "vendor,device".
> (And after that it won't be empty anymore)

My vote is, and always has been 'generic-uio' :)

Putting some random vendor/device string in there is just nuts. Do you
really want a kernel patch every time some one binds their device to
it?

Or, is there no expectation that anybody would attempt to merge such a
pointless patch to begin with?

As we discussed at ELC, putting a real vendor/device in there is also
broken because all instances in the system wil bind to the generic
uio, which is not necessarily what is desired.

I know the arguments against the 'generic-uio' tag, but come on, let's
look at the lesser of two evils here!  I call BS on this DTS purity.

John
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Grant Likely  
View profile  
 More options Apr 19 2011, 2:10 am
Newsgroups: linux.kernel
From: Grant Likely <grant.lik...@secretlab.ca>
Date: Tue, 19 Apr 2011 08:10:02 +0200
Local: Tues, Apr 19 2011 2:10 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support

PowerPC and x86 will return 0 for an unassigned IRQ, as will most platforms.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Grant Likely  
View profile  
 More options Apr 19 2011, 2:20 am
Newsgroups: linux.kernel
From: Grant Likely <grant.lik...@secretlab.ca>
Date: Tue, 19 Apr 2011 08:20:01 +0200
Local: Tues, Apr 19 2011 2:20 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support

Call it what you like, but the reasons are well founded.  The alternative
that has been proposed which I am in agreement with is to investigate
giving userspace the hook to tell the kernel at runtime which devices
should be picked up by the uio driver.

In the mean time, explicitly modifying the match table is an okay
compromise.

g.

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arnd Bergmann  
View profile  
 More options Apr 19 2011, 3:40 am
Newsgroups: linux.kernel
From: Arnd Bergmann <a...@arndb.de>
Date: Tue, 19 Apr 2011 09:40:03 +0200
Local: Tues, Apr 19 2011 3:40 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support
On Tuesday 19 April 2011, Grant Likely wrote:

> On Tue, Apr 19, 2011 at 11:58:25AM +1000, John Williams wrote:

> > I know the arguments against the 'generic-uio' tag, but come on, let's
> > look at the lesser of two evils here!  I call BS on this DTS purity.

Both a specific device ID and something like "generic-uio" are
equally broken:

If you have generic-uio, it is impossible to write an in-kernel driver
for the same hardware without changing the device tree, meaning that
it is impossible to correctly describe the hardware in the device tree.

If you put a meaningful identifier into the match table, it is also
impossible to have an in-kernel driver for the hardware, because now
you have no way to choose whether to handle the device with UIO
or an in-kernel driver.

There may be cases where you have two instances of the same device
in a machine and  want one of them to be driven by UIO and the other
by another driver. A common example of this would be a virtual machine
where one device is passed through to the guest and the other is
used by the host. I've done this for USB input devices and PCI network
interfaces.

> Call it what you like, but the reasons are well founded.  The alternative
> that has been proposed which I am in agreement with is to investigate
> giving userspace the hook to tell the kernel at runtime which devices
> should be picked up by the uio driver.

Yes, I believe this is the best option.

> In the mean time, explicitly modifying the match table is an okay
> compromise.

Agreed.

        Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michal Simek  
View profile  
 More options Apr 19 2011, 4:20 am
Newsgroups: linux.kernel
From: Michal Simek <mon...@monstr.eu>
Date: Tue, 19 Apr 2011 10:20:02 +0200
Local: Tues, Apr 19 2011 4:20 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support

I used that because I wanted to see more information about UIO in bootlog. If
you and Hans want to remove it, I will do it.

Thanks,
Michal

--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Michal Simek  
View profile  
 More options Apr 19 2011, 4:20 am
Newsgroups: linux.kernel
From: Michal Simek <mon...@monstr.eu>
Date: Tue, 19 Apr 2011 10:20:03 +0200
Local: Tues, Apr 19 2011 4:20 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support

Not for Microblaze but anyway I am OK to change it and I will look at that
(maybe even your) patch to fix Microblaze code to return 0 for an unassigned IRQs.

Thanks,
Michal

--
Michal Simek, Ing. (M.Eng)
w: www.monstr.eu p: +42-0-721842854
Maintainer of Linux kernel 2.6 Microblaze Linux - http://www.monstr.eu/fdt/
Microblaze U-BOOT custodian
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
John Williams  
View profile  
 More options Apr 19 2011, 8:40 am
Newsgroups: linux.kernel
From: John Williams <john.willi...@petalogix.com>
Date: Tue, 19 Apr 2011 14:40:02 +0200
Local: Tues, Apr 19 2011 8:40 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support

OK, so let's talk about this interface.  As I see it, it must be able
to handle bind per-instance, not per compatibility.

For example, we make systems with multiple, identical timers.  One
will be used as the system timer, the others need to be (optionally)
bound to generic UIO.

Therefore, it's not OK to just do

echo "vendor,device" >> /sys/class/something/generic-uio/compatlist

or whatever, as this would bind all instances matching vendor,device.

So, the question I have is, how to handle bind per-instance?

I can accept that the generic-uio idea is permanently blocked, but
please can we have some concrete suggestions on an approach that would
be acceptable?

> In the mean time, explicitly modifying the match table is an okay
> compromise.

My mind is still boggling that in this day and age it could possibly
be preferred to modify code, instead of a data structure.  However,
clearly this is a lost cause!

John
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arnd Bergmann  
View profile  
 More options Apr 19 2011, 9:10 am
Newsgroups: linux.kernel
From: Arnd Bergmann <a...@arndb.de>
Date: Tue, 19 Apr 2011 15:10:02 +0200
Local: Tues, Apr 19 2011 9:10 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support
On Tuesday 19 April 2011, John Williams wrote:

> OK, so let's talk about this interface.  As I see it, it must be able
> to handle bind per-instance, not per compatibility.

Yes.

> For example, we make systems with multiple, identical timers.  One
> will be used as the system timer, the others need to be (optionally)
> bound to generic UIO.

> Therefore, it's not OK to just do

> echo "vendor,device" >> /sys/class/something/generic-uio/compatlist

> or whatever, as this would bind all instances matching vendor,device.

> So, the question I have is, how to handle bind per-instance?

> I can accept that the generic-uio idea is permanently blocked, but
> please can we have some concrete suggestions on an approach that would
> be acceptable?

I think nobody has had a good idea so far, unfortunately. It would
be nice if you could research how libusb, vfio and qemu pci passthrough
work. Hopefully one of these uses a method that we can do here, too.

> > In the mean time, explicitly modifying the match table is an okay
> > compromise.

> My mind is still boggling that in this day and age it could possibly
> be preferred to modify code, instead of a data structure.  However,
> clearly this is a lost cause!

It's preferred to do a local modification to a single kernel build over
introducing an interface that we have to maintain compatibility with
when we already know we don't want it.

        Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Grant Likely  
View profile  
 More options Apr 19 2011, 11:00 am
Newsgroups: linux.kernel
From: Grant Likely <grant.lik...@secretlab.ca>
Date: Tue, 19 Apr 2011 17:00:03 +0200
Local: Tues, Apr 19 2011 11:00 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support
On Tue, Apr 19, 2011 at 6:37 AM, John Williams

By manipulating a property on the device instance of course!  :-)

Something like:  echo "generic-uio" >>
/sys/devices/path/to/device/a-property-that-changes-the-driver-it-will-bind -to.

>> In the mean time, explicitly modifying the match table is an okay
>> compromise.

> My mind is still boggling that in this day and age it could possibly
> be preferred to modify code, instead of a data structure.  However,
> clearly this is a lost cause!

I don't think anybody wants this as a long term solution.  It is
merely a stop-gap so that development is not stalled while working out
a real interface.

g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Arnd Bergmann  
View profile  
 More options Apr 19 2011, 11:10 am
Newsgroups: linux.kernel
From: Arnd Bergmann <a...@arndb.de>
Date: Tue, 19 Apr 2011 17:10:02 +0200
Local: Tues, Apr 19 2011 11:10 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support
On Tuesday 19 April 2011, Grant Likely wrote:

> > or whatever, as this would bind all instances matching vendor,device.

> > So, the question I have is, how to handle bind per-instance?

> By manipulating a property on the device instance of course!  :-)

> Something like:  echo "generic-uio" >>
> /sys/devices/path/to/device/a-property-that-changes-the-driver-it-will-bind -to.

But what code would create that in sysfs, and based on what properties
of the device? Should we do that for every platform device, or perhaps
for every one that has any resources?

        Arnd
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Grant Likely  
View profile  
 More options Apr 19 2011, 11:50 am
Newsgroups: linux.kernel
From: Grant Likely <grant.lik...@secretlab.ca>
Date: Tue, 19 Apr 2011 17:50:02 +0200
Local: Tues, Apr 19 2011 11:50 am
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support

On Tue, Apr 19, 2011 at 9:07 AM, Arnd Bergmann <a...@arndb.de> wrote:
> On Tuesday 19 April 2011, Grant Likely wrote:
>> > or whatever, as this would bind all instances matching vendor,device.

>> > So, the question I have is, how to handle bind per-instance?

>> By manipulating a property on the device instance of course!  :-)

>> Something like:  echo "generic-uio" >>
>> /sys/devices/path/to/device/a-property-that-changes-the-driver-it-will-bind -to.

> But what code would create that in sysfs, and based on what properties
> of the device? Should we do that for every platform device, or perhaps
> for every one that has any resources?

Yes, I think it can be a generic facility for all platform_devices.
We already have some code to support user-space manipulated driver
binding/unbinding.  This is very much in the same vein.

g.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Hans J. Koch  
View profile  
 More options Apr 19 2011, 6:10 pm
Newsgroups: linux.kernel
From: "Hans J. Koch" <h...@hansjkoch.de>
Date: Wed, 20 Apr 2011 00:10:02 +0200
Local: Tues, Apr 19 2011 6:10 pm
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support

That might be right for these architectures. On ARM SoCs, IRQ0 is often a
normal irq like any other (e.g. "Audio DMA Controller 1" on Telechips TCC8000).

We've had this discussion before. In my original uio_driver.h, UIO_IRQ_NONE
was #defined as -1. There was heavy opposition against that, and I finally
accepted a patch changing UIO_IRQ_NONE to 0. It's a tradeoff between 0 being
a valid interrupt number on most archs and the convenience of the compiler
automatically inserting a 0 into an unassigned variable.

The above line

if (irq < 0) {

is probably a copy-paste leftover of some older code. Today, irq < 0 should
never be true in UIO, so the line is wrong.

Thanks for pointing to it,
Hans

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Scott Wood  
View profile  
 More options Apr 19 2011, 7:10 pm
Newsgroups: linux.kernel
From: Scott Wood <scottw...@freescale.com>
Date: Wed, 20 Apr 2011 01:10:02 +0200
Local: Tues, Apr 19 2011 7:10 pm
Subject: Re: [PATCH v3] uio/pdrv_genirq: Add OF support
On Wed, 20 Apr 2011 00:00:18 +0200
"Hans J. Koch" <h...@hansjkoch.de> wrote:

> On Tue, Apr 19, 2011 at 12:08:16AM -0600, Grant Likely wrote:
> > PowerPC and x86 will return 0 for an unassigned IRQ, as will most platforms.

> That might be right for these architectures. On ARM SoCs, IRQ0 is often a
> normal irq like any other (e.g. "Audio DMA Controller 1" on Telechips TCC8000).

It's true on at least some powerpc and x86 interrupt controllers as well.
ARM isn't special. :-)

I'm not sure what goes on on x86, as I see a real " 0:" in
/proc/interrupts.  But on powerpc, Linux's IRQ numberspace is decoupled
from that of any IRQ controller.  This is mainly to accommodate multiple
IRQ controllers with their own numberspaces in the same system; being able
to avoid irq 0 is just a bonus.

-Scott

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
Messages 1 - 25 of 29   Newer >
« Back to Discussions « Newer topic     Older topic »