lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Yw39qmuS3T+DLcfB@hovoldconsulting.com>
Date:   Tue, 30 Aug 2022 14:08:10 +0200
From:   Johan Hovold <johan@...nel.org>
To:     Manivannan Sadhasivam <manivannan.sadhasivam@...aro.org>
Cc:     linus.walleij@...aro.org, bjorn.andersson@...aro.org,
        robimarko@...il.com, linux-arm-msm@...r.kernel.org,
        linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org,
        maz@...nel.org, johan+linaro@...nel.org, steev@...i.org
Subject: Re: [PATCH v3] pinctrl: qcom: spmi-gpio: Make irqchip immutable

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@...0): not an immutable chip, please consider fixing it!
> 
> Acked-by: Marc Zyngier <maz@...nel.org>
> Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@...aro.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@...nel.org>

Johan

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ