From: Johan Hovold <johan@kernel.org>
To: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
Cc: linus.walleij@linaro.org, bjorn.andersson@linaro.org,
robimarko@gmail.com, linux-arm-msm@vger.kernel.org,
linux-gpio@vger.kernel.org, linux-kernel@vger.kernel.org,
maz@kernel.org, johan+linaro@kernel.org, steev@kali.org
Subject: Re: [PATCH v3] pinctrl: qcom: spmi-gpio: Make irqchip immutable
Date: Tue, 30 Aug 2022 14:08:10 +0200 [thread overview]
Message-ID: <Yw39qmuS3T+DLcfB@hovoldconsulting.com> (raw)
In-Reply-To: <20220830092232.168561-1-manivannan.sadhasivam@linaro.org>
On Tue, Aug 30, 2022 at 02:52:32PM +0530, Manivannan Sadhasivam wrote:
> The irqchip implementation used inside the gpiochips are not supposed to
> be changed during runtime. So let's make the one inside the spmi-gpio
> gpiochip immutable.
>
> This fixes the below warning during boot:
> gpio gpiochip0: (c440000.spmi:pmic@0:gpio@c000): not an immutable chip, please consider fixing it!
>
> Acked-by: Marc Zyngier <maz@kernel.org>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@linaro.org>
> ---
>
> Changes in v3:
>
> * Added Ack from Marc
> * Removed the text that was mimicking the documentation
>
> Changes in v2:
>
> * Added new callbacks for irq_{mask/unmask} for masking/unmasking the parent
> IRQ that was missing in v1. (Thanks to Marc)
> * Modified the commit message accordingly.
>
> drivers/pinctrl/qcom/pinctrl-spmi-gpio.c | 38 +++++++++++++++++-------
> 1 file changed, 28 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
> index ccaf40a9c0e6..d40e3b2d38cc 100644
> --- a/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
> +++ b/drivers/pinctrl/qcom/pinctrl-spmi-gpio.c
> @@ -985,6 +984,33 @@ static int pmic_gpio_populate_parent_fwspec(struct gpio_chip *chip,
> return 0;
> }
>
> +static void pmic_gpio_irq_mask(struct irq_data *data)
> +{
> + struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
> +
> + irq_chip_mask_parent(data);
> + gpiochip_disable_irq(gc, data->hwirq);
> +}
> +
> +static void pmic_gpio_irq_unmask(struct irq_data *data)
> +{
> + struct gpio_chip *gc = irq_data_get_irq_chip_data(data);
> +
> + irq_chip_unmask_parent(data);
> + gpiochip_enable_irq(gc, data->hwirq);
Could you set the IRQ-enabled flag before unmasking the parent here for
symmetry (and as most other implementations do)?
> +}
Other than that, looks good:
Reviewed-by: Johan Hovold <johan+linaro@kernel.org>
Johan
next prev parent reply other threads:[~2022-08-30 12:08 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-30 9:22 [PATCH v3] pinctrl: qcom: spmi-gpio: Make irqchip immutable Manivannan Sadhasivam
2022-08-30 12:08 ` Johan Hovold [this message]
2022-09-08 12:25 ` Linus Walleij
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=Yw39qmuS3T+DLcfB@hovoldconsulting.com \
--to=johan@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=johan+linaro@kernel.org \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=manivannan.sadhasivam@linaro.org \
--cc=maz@kernel.org \
--cc=robimarko@gmail.com \
--cc=steev@kali.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