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>] [day] [month] [year] [list]
Message-ID: <1629442873-24655-1-git-send-email-sean.wang@mediatek.com>
Date:   Fri, 20 Aug 2021 15:01:13 +0800
From:   <sean.wang@...iatek.com>
To:     <sam.shih@...iatek.com>
CC:     <robh+dt@...nel.org>, <sean.wang@...nel.org>,
        <linus.walleij@...aro.org>, <matthias.bgg@...il.com>,
        <mpm@...enic.com>, <herbert@...dor.apana.org.au>,
        <gregkh@...uxfoundation.org>, <wim@...ux-watchdog.org>,
        <linux@...ck-us.net>, <mturquette@...libre.com>,
        <sboyd@...nel.org>, <hsinyi@...omium.org>,
        <enric.balletbo@...labora.com>, <fparent@...libre.com>,
        <seiya.wang@...iatek.com>, <devicetree@...r.kernel.org>,
        <linux-kernel@...r.kernel.org>,
        <linux-mediatek@...ts.infradead.org>, <linux-gpio@...r.kernel.org>,
        <linux-arm-kernel@...ts.infradead.org>,
        <linux-crypto@...r.kernel.org>, <linux-serial@...r.kernel.org>,
        <linux-watchdog@...r.kernel.org>, <linux-clk@...r.kernel.org>,
        <john@...ozen.org>, <Ryder.Lee@...iatek.com>,
        Sean Wang <sean.wang@...iatek.com>
Subject: Re: [v2, 04/12] pinctrl: mediatek: moore: check if pin_desc is valid before use

From: Sean Wang <sean.wang@...iatek.com>

>Certain SoC are missing the middle part gpios in consecutive pins, it's better to check if mtk_pin_desc is a valid pin for the extensibility
>
>Signed-off-by: Sam Shih <sam.shih@...iatek.com>
>


>---
>v2: applied the comment suggested by reviewers:
>    - for the pins not ballout, we can fill .name in struct mtk_pin_desc
>      as NULL and return -ENOTSUPP in gpio/pinconf ops.

Thanks for take the suggestion and the improvement.
Acked-by: Sean Wang <sean.wang@...iatek.com>

>
>---
> drivers/pinctrl/mediatek/pinctrl-moore.c | 18 ++++++++++++++++++
> 1 file changed, 18 insertions(+)
>
>diff --git a/drivers/pinctrl/mediatek/pinctrl-moore.c b/drivers/pinctrl/mediatek/pinctrl-moore.c
>index 3a4a23c40a71..ad3b67163973 100644
>--- a/drivers/pinctrl/mediatek/pinctrl-moore.c
>+++ b/drivers/pinctrl/mediatek/pinctrl-moore.c
>@@ -60,6 +60,8 @@ static int mtk_pinmux_set_mux(struct pinctrl_dev *pctldev,
>		int pin = grp->pins[i];
>
>		desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
>+		if (!desc->name)
>+			return -ENOTSUPP;
>
>		mtk_hw_set_value(hw, desc, PINCTRL_PIN_REG_MODE,
>				 pin_modes[i]);
>@@ -76,6 +78,8 @@ static int mtk_pinmux_gpio_request_enable(struct pinctrl_dev *pctldev,
>	const struct mtk_pin_desc *desc;
>
>	desc = (const struct mtk_pin_desc *)&hw->soc->pins[pin];
>+	if (!desc->name)
>+		return -ENOTSUPP;

<snip>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ