linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Linus Walleij <linus.walleij@linaro.org>
To: Srinivas Neeli <srinivas.neeli@xilinx.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
	Michal Simek <michal.simek@xilinx.com>,
	Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>,
	sgoud@xilinx.com, Robert Hancock <hancock@sedsystems.ca>,
	William Breathitt Gray <vilhelm.gray@gmail.com>,
	Syed Nayyar Waris <syednwaris@gmail.com>,
	"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
	Linux ARM <linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	git@xilinx.com
Subject: Re: [PATCH V4 3/5] gpio: gpio-xilinx: Add interrupt support
Date: Thu, 7 Jan 2021 10:26:48 +0100	[thread overview]
Message-ID: <CACRpkdYRJH8hO2W8D6waaUEHib7nPj_7ogLr-BzTYdXX_1-7ag@mail.gmail.com> (raw)
In-Reply-To: <1609936000-28378-4-git-send-email-srinivas.neeli@xilinx.com>

On Wed, Jan 6, 2021 at 1:27 PM Srinivas Neeli <srinivas.neeli@xilinx.com> wrote:

> Adds interrupt support to the Xilinx GPIO driver so that rising and
> falling edge line events can be supported. Since interrupt support is
> an optional feature in the Xilinx IP, the driver continues to support
> devices which have no interrupt provided.
> Depends on OF_GPIO framework for of_xlate function to translate
> gpiospec to the GPIO number and flags.
>
> Signed-off-by: Robert Hancock <hancock@sedsystems.ca>
> Signed-off-by: Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
> Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
(...)

>  config GPIO_XILINX
>         tristate "Xilinx GPIO support"
> +       select GPIOLIB_IRQCHIP
> +       select IRQ_DOMAIN_HIERARCHY

Why do you select IRQ_DOMAIN_HIERARCHY?

You don't seem to use it.

> +#include <linux/of_gpio.h>

No modern driver should include this header. I suspect you
can just drop it.

See drivers/gpio/TODO

> +       /* Update cells with gpio-cells value */
> +       if (of_property_read_u32(np, "#gpio-cells", &cells))
> +               dev_dbg(&pdev->dev, "Missing gpio-cells property\n");
> +
>         /*
>          * Check device node and parent device node for device width
>          * and assume default width of 32
> @@ -343,6 +545,7 @@ static int xgpio_probe(struct platform_device *pdev)
>         chip->gc.parent = &pdev->dev;
>         chip->gc.direction_input = xgpio_dir_in;
>         chip->gc.direction_output = xgpio_dir_out;
> +       chip->gc.of_gpio_n_cells = cells;

This looks a bit dangerous. What actually happens if this is something
like 3. The translate function is not going to work. I would just dev_err()
and bail out if #gpio-cells != 2.

Other than that this looks good!

Yours,
Linus Walleij

  reply	other threads:[~2021-01-07  9:27 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-06 12:26 [PATCH V4 0/5] gpio-xilinx: Update on xilinx gpio driver Srinivas Neeli
2021-01-06 12:26 ` [PATCH V4 1/5] gpio: gpio-xilinx: Simplify with dev_err_probe() Srinivas Neeli
2021-01-07  9:13   ` Linus Walleij
2021-01-06 12:26 ` [PATCH V4 2/5] gpio: gpio-xilinx: Reduce spinlock array to array Srinivas Neeli
2021-01-07  9:14   ` Linus Walleij
2021-01-06 12:26 ` [PATCH V4 3/5] gpio: gpio-xilinx: Add interrupt support Srinivas Neeli
2021-01-07  9:26   ` Linus Walleij [this message]
2021-01-06 12:26 ` [PATCH V4 4/5] gpio: gpio-xilinx: Add support for suspend and resume Srinivas Neeli
2021-01-07  9:46   ` Linus Walleij
2021-01-08 11:41     ` Srinivas Neeli
2021-01-09  0:25       ` Linus Walleij
2021-01-06 12:26 ` [PATCH V4 5/5] gpio: gpio-xilinx: Add check if width exceeds 32 Srinivas Neeli
2021-01-07 10:17   ` Linus Walleij
2021-01-07 10:29     ` Michal Simek
2021-01-07 10:47       ` Linus Walleij
2021-01-07 10:52         ` Michal Simek

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=CACRpkdYRJH8hO2W8D6waaUEHib7nPj_7ogLr-BzTYdXX_1-7ag@mail.gmail.com \
    --to=linus.walleij@linaro.org \
    --cc=bgolaszewski@baylibre.com \
    --cc=git@xilinx.com \
    --cc=hancock@sedsystems.ca \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=sgoud@xilinx.com \
    --cc=shubhrajyoti.datta@xilinx.com \
    --cc=srinivas.neeli@xilinx.com \
    --cc=syednwaris@gmail.com \
    --cc=vilhelm.gray@gmail.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).