From: Michal Simek <michal.simek@xilinx.com>
To: Linus Walleij <linus.walleij@linaro.org>,
Srinivas Neeli <srinivas.neeli@xilinx.com>
Cc: Bartosz Golaszewski <bgolaszewski@baylibre.com>,
Michal Simek <michal.simek@xilinx.com>,
Shubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>,
<sgoud@xilinx.com>, Robert Hancock <hancock@sedsystems.ca>,
William Breathitt Gray <vilhelm.gray@gmail.com>,
Syed Nayyar Waris <syednwaris@gmail.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>,
Linux ARM <linux-arm-kernel@lists.infradead.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
<git@xilinx.com>
Subject: Re: [PATCH V4 5/5] gpio: gpio-xilinx: Add check if width exceeds 32
Date: Thu, 7 Jan 2021 11:29:08 +0100 [thread overview]
Message-ID: <11abb0f7-407a-3509-ad50-cc7698147ee5@xilinx.com> (raw)
In-Reply-To: <CACRpkdZrBXJSo_kicWKQ_wtFTZvkOUNyjP6UHZfY7xwRSNZBRw@mail.gmail.com>
On 07. 01. 21 11:17, Linus Walleij wrote:
> On Wed, Jan 6, 2021 at 1:27 PM Srinivas Neeli <srinivas.neeli@xilinx.com> wrote:
>
>> Add check to see if gpio-width property does not exceed 32.
>> If it exceeds then return -EINVAL.
>>
>> Signed-off-by: Srinivas Neeli <srinivas.neeli@xilinx.com>
>
> Aha
>
>> @@ -591,6 +591,9 @@ static int xgpio_probe(struct platform_device *pdev)
>> if (of_property_read_u32(np, "xlnx,gpio-width", &chip->gpio_width[0]))
>> chip->gpio_width[0] = 32;
>
> This xlnx,gpio-width seems very much like the standard ngpios property
> from Documentation/devicetree/bindings/gpio/gpio.txt
> but I guess not much to do about that now. :/
>
> Do you think you can add support for both?
support for both is definitely possible but we need to handle also gpio
width for second channel referenced by xlnx,gpio2-widht now.
It means we could end up in situation which can be misleading for users
where ngpios will be 10 and xlnx,gpio2-width another 10 and in total we
have 20 gpios.
I think that it is better not to start to mess with ngpios property not
to confuse people which are coming from other SOCs because ngpios can
suggest all gpios assigned to this controller.
And in second case where ngpios is total number of gpios and if
xlnx,gpio2-width is defined you can find width for first bank.
But it is questionable if this improve situation here.
Please correct me if my logic is not correct.
Definitely this should be done separately out of this patch.
>
>> + if (chip->gpio_width[0] > 32)
>> + return -EINVAL;
>
> This looks OK.
Does it mean ack for this patch?
Thanks,
Michal
next prev parent reply other threads:[~2021-01-07 10:30 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-01-06 12:26 [PATCH V4 0/5] gpio-xilinx: Update on xilinx gpio driver Srinivas Neeli
2021-01-06 12:26 ` [PATCH V4 1/5] gpio: gpio-xilinx: Simplify with dev_err_probe() Srinivas Neeli
2021-01-07 9:13 ` Linus Walleij
2021-01-06 12:26 ` [PATCH V4 2/5] gpio: gpio-xilinx: Reduce spinlock array to array Srinivas Neeli
2021-01-07 9:14 ` Linus Walleij
2021-01-06 12:26 ` [PATCH V4 3/5] gpio: gpio-xilinx: Add interrupt support Srinivas Neeli
2021-01-07 9:26 ` Linus Walleij
2021-01-06 12:26 ` [PATCH V4 4/5] gpio: gpio-xilinx: Add support for suspend and resume Srinivas Neeli
2021-01-07 9:46 ` Linus Walleij
2021-01-08 11:41 ` Srinivas Neeli
2021-01-09 0:25 ` Linus Walleij
2021-01-06 12:26 ` [PATCH V4 5/5] gpio: gpio-xilinx: Add check if width exceeds 32 Srinivas Neeli
2021-01-07 10:17 ` Linus Walleij
2021-01-07 10:29 ` Michal Simek [this message]
2021-01-07 10:47 ` Linus Walleij
2021-01-07 10:52 ` Michal Simek
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=11abb0f7-407a-3509-ad50-cc7698147ee5@xilinx.com \
--to=michal.simek@xilinx.com \
--cc=bgolaszewski@baylibre.com \
--cc=git@xilinx.com \
--cc=hancock@sedsystems.ca \
--cc=linus.walleij@linaro.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sgoud@xilinx.com \
--cc=shubhrajyoti.datta@xilinx.com \
--cc=srinivas.neeli@xilinx.com \
--cc=syednwaris@gmail.com \
--cc=vilhelm.gray@gmail.com \
/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
all inboxes | Powered by JetHome®