Re: [PATCH v3 1/2] Support NVIDIA BlueField-3 GPIO controller

From: andy . shevchenko
Date: Mon Feb 13 2023 - 18:39:51 EST


Mon, Feb 13, 2023 at 11:14:06PM +0000, Asmaa Mnebhi kirjoitti:
> Thanks Andy for the feedback! Will address your comment in v4.
>
> > + generic_handle_irq(irq_find_mapping(gc->irq.domain, level));
>
> There is a helper that unites these two calls together.
>
> I didn't find any helper in v6.2. Could you please point me to it?

It's available even longer than just in v6.2:
generic_handle_domain_irq().

...

> > +static int mlxbf3_gpio_init_valid_mask(struct gpio_chip *gc,
> > + unsigned long *valid_mask,
> > + unsigned int ngpios)
> > +{
> > + struct mlxbf3_gpio_context *gs = gpiochip_get_data(gc);
> > +
> > + *valid_mask = gs->valid_mask;
> > +
> > + return 0;
> > +}
>
> Why do you need this?
>
> Since we only use ACPI tables and we want user space (libgpiod tool) or possibly (in the future)
> other kernel drivers to have access to certain GPIO pins, we use this valid_mask to do so.
> Linus previously explained that if we ask for a GPIO then it will be muxed in using .gpio_request_enable().
> And so we would use .valid_mask to restrict the use of certain gpios.

So, why you can't use gpio-reserved-ranges property?

--
With Best Regards,
Andy Shevchenko