linux-acpi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andy Shevchenko <andy.shevchenko@gmail.com>
To: Asmaa Mnebhi <asmaa@nvidia.com>
Cc: linus.walleij@linaro.org, bgolaszewski@baylibre.com,
	linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-acpi@vger.kernel.org
Subject: Re: [PATCH v5 1/2] gpio: gpio-mlxbf3: Add gpio driver support
Date: Wed, 15 Mar 2023 11:15:38 +0200	[thread overview]
Message-ID: <CAHp75Vd5NhPcgUokJ0i8ftqVXjSB10q4VfxH9A7wcYhei-s2wA@mail.gmail.com> (raw)
In-Reply-To: <20230314221609.22433-2-asmaa@nvidia.com>

On Wed, Mar 15, 2023 at 12:16 AM Asmaa Mnebhi <asmaa@nvidia.com> wrote:
>
> Add support for the BlueField-3 SoC GPIO driver.
> This driver configures and handles GPIO interrupts. It also enables a user
> to manipulate certain GPIO pins via libgpiod tools or other kernel drivers.
> The usables pins are defined via the "gpio-reserved-ranges" property.

Thank you for the update, my comments below.

...

> +         This controller should be used in parallel with pinctrl-mlxbf to
> +         control the desired gpios.

GPIOs

Btw, have you considered renaming that driver to pinctrl-mlxbf3?

...

> +#include <linux/resource.h>

I dunno why you added this one.

The missing ones are:
err.h
io.h

...

> +       raw_spin_lock_irqsave(&gs->gc.bgpio_lock, flags);
> +       gpiochip_enable_irq(gc, offset);

No need to call this under the spin lock, or must be explained why.

> +       writel(BIT(offset), gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_CLRCAUSE);
> +
> +       val = readl(gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0);
> +       val |= BIT(offset);
> +       writel(val, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0);
> +       raw_spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags);

...

> +       raw_spin_lock_irqsave(&gs->gc.bgpio_lock, flags);
> +       val = readl(gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0);
> +       val &= ~BIT(offset);
> +       writel(val, gs->gpio_cause_io + MLXBF_GPIO_CAUSE_OR_EVTEN0);
> +       gpiochip_disable_irq(gc, offset);

Ditto.

> +       raw_spin_unlock_irqrestore(&gs->gc.bgpio_lock, flags);
> +}

...

> +/* This function needs to be defined for handle_edge_irq */

handle_edge_irq()

...

> +static const struct acpi_device_id __maybe_unused mlxbf3_gpio_acpi_match[] = {

Why __maybe_unused?

> +       { "MLNXBF33", 0 },
> +       {}
> +};

-- 
With Best Regards,
Andy Shevchenko

  reply	other threads:[~2023-03-15  9:16 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-14 22:16 [PATCH v5 0/2] Support Nvidia BlueField-3 GPIO driver and pin controller Asmaa Mnebhi
2023-03-14 22:16 ` [PATCH v5 1/2] gpio: gpio-mlxbf3: Add gpio driver support Asmaa Mnebhi
2023-03-15  9:15   ` Andy Shevchenko [this message]
2023-03-15  9:24     ` Andy Shevchenko
2023-03-14 22:16 ` [PATCH v5 2/2] pinctrl: pinctrl-mlxbf: Add pinctrl " Asmaa Mnebhi
2023-03-15  9:21   ` Andy Shevchenko
2023-03-15  9:23     ` Andy Shevchenko
2023-03-15 21:45     ` Asmaa Mnebhi
2023-03-15  9:22 ` [PATCH v5 0/2] Support Nvidia BlueField-3 GPIO driver and pin controller Andy Shevchenko
2023-03-15 10:12 ` Linus Walleij
2023-03-15 13:11   ` Asmaa Mnebhi

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=CAHp75Vd5NhPcgUokJ0i8ftqVXjSB10q4VfxH9A7wcYhei-s2wA@mail.gmail.com \
    --to=andy.shevchenko@gmail.com \
    --cc=asmaa@nvidia.com \
    --cc=bgolaszewski@baylibre.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-acpi@vger.kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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).