From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Srinivas Neeli <sneeli@xilinx.com>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Michal Simek <michals@xilinx.com>,
Shubhrajyoti Datta <shubhraj@xilinx.com>,
Srinivas Goud <sgoud@xilinx.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
linux-arm Mailing List <linux-arm-kernel@lists.infradead.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
git <git@xilinx.com>, Robert Hancock <hancock@sedsystems.ca>
Subject: Re: [PATCH V2 2/3] gpio: xilinx: Add interrupt support
Date: Fri, 24 Jul 2020 22:58:56 +0300 [thread overview]
Message-ID: <CAHp75VeFE3b4mpvkQifuC5WPkTk9RUQy4yM8jTQXtrfNWRmDXA@mail.gmail.com> (raw)
In-Reply-To: <DM6PR02MB53867D532A3298BE06E32B86AF770@DM6PR02MB5386.namprd02.prod.outlook.com>
On Fri, Jul 24, 2020 at 8:15 PM Srinivas Neeli <sneeli@xilinx.com> wrote:
...
> > > +#include <linux/irqchip/chained_irq.h>
> >
> > Not sure I see a user of it.
> >
> > ...
> we are using chained_irq_enter() and chained_irq_exit()
> APIs , so need "chained_irq.h"
I see. But gpio/driver.h does it for you.
...
> > > + for (index = 0; index < num_channels; index++) {
> > > + if ((status & BIT(index))) {
> >
> > If gpio_width is the same among banks, you can use for_each_set_bit()
> > here as well.
> >
> > ...
> gpio_wdith vary depends on design. We can configure gpio pins for each bank.
I see.
...
> > > + chip->irq = platform_get_irq_optional(pdev, 0);
> > > + if (chip->irq <= 0) {
> > > + dev_info(&pdev->dev, "GPIO IRQ not set\n");
> >
> > Why do you need an optional variant if you print an error anyway?
>
> Here intention is just printing a debug message to user.
Debug message should be debug, and not info. But in any case, I would
rather drop it, or use platform_get_irq() b/c now you have a code
controversy.
...
> > > + chip->gc.irq.parents = (unsigned int *)&chip->irq;
> > > + chip->gc.irq.num_parents = 1;
> >
> > Current pattern is to use devm_kcalloc() for it (Linus has plans to
> > simplify this in the future and this will help him to find what
> > patterns are being used)
>
> I didn't get this , Could you please explain more.
girq->num_parents = 1;
girq->parents = devm_kcalloc(dev, girq->num_parents, ...);
if (!girq->parents)
return -ENOMEM;
girq->parents[0] = chip->irq;
Also, use temporary variable for IRQ chip structure:
girq = &chip->gc.irq;
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2020-07-24 19:59 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-23 14:06 [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver Srinivas Neeli
2020-07-23 14:06 ` [PATCH V2 1/3] gpio: xilinx: Add clock adaptation support Srinivas Neeli
2020-08-18 20:11 ` Bartosz Golaszewski
2020-07-23 14:06 ` [PATCH V2 2/3] gpio: xilinx: Add interrupt support Srinivas Neeli
2020-07-23 18:03 ` Andy Shevchenko
2020-07-24 17:15 ` Srinivas Neeli
2020-07-24 19:58 ` Andy Shevchenko [this message]
2020-07-24 21:02 ` Robert Hancock
2020-07-24 4:11 ` kernel test robot
2020-07-24 9:22 ` Linus Walleij
2020-07-24 14:56 ` Srinivas Neeli
2020-07-23 14:06 ` [PATCH V2 3/3] MAINTAINERS: add fragment for xilinx GPIO drivers Srinivas Neeli
2020-07-24 9:28 ` Michal Simek
2020-07-24 9:33 ` Shubhrajyoti Datta
[not found] ` <YT1PR01MB3546541973024526CDB6BBECEC1E0@YT1PR01MB3546.CANPRD01.PROD.OUTLOOK.COM>
2020-10-20 6:59 ` [PATCH V2 0/3] gpio-xilinx: Update on xilinx gpio driver Srinivas Neeli
2020-10-20 7:22 ` Michal Simek
2020-11-06 22:29 ` Robert Hancock
2020-11-09 9:32 ` Srinivas Neeli
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=CAHp75VeFE3b4mpvkQifuC5WPkTk9RUQy4yM8jTQXtrfNWRmDXA@mail.gmail.com \
--to=andy.shevchenko@gmail.com \
--cc=bgolaszewski@baylibre.com \
--cc=git@xilinx.com \
--cc=hancock@sedsystems.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=michals@xilinx.com \
--cc=sgoud@xilinx.com \
--cc=shubhraj@xilinx.com \
--cc=sneeli@xilinx.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).