From: "Jonathan Neuschäfer" <j.neuschaefer@gmx.net>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Kees Cook <keescook@chromium.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: [GIT PULL] pin control bulk changes for v5.18
Date: Mon, 28 Mar 2022 23:38:17 +0200 [thread overview]
Message-ID: <YkIqyb6lhn5uU2jb@latitude> (raw)
In-Reply-To: <CAHk-=whzqAB6kfHUcX2uhfPnNiWJRq=UmeA1TbgGi3XA+57j3w@mail.gmail.com>
[-- Attachment #1: Type: text/plain, Size: 2328 bytes --]
Hi,
On Mon, Mar 28, 2022 at 12:11:49PM -0700, Linus Torvalds wrote:
> On Mon, Mar 28, 2022 at 6:08 AM Linus Walleij <linus.walleij@linaro.org> wrote:
> >
> > git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
> > tags/pinctrl-v5.18-1
>
> Hmm.
>
> This clashes badly with the fact that we in the meantime have enabled
> -Warray-bounds, and I got
>
> drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c: In function ‘npcmgpio_irq_handler’:
> ./include/linux/find.h:40:23: error: array subscript ‘long unsigned
> int[0]’ is partly outside array bounds of ‘u32[1]’ {aka ‘unsigned
> int[1]’} [-Werror=array-bounds]
> 40 | val = *addr & GENMASK(size - 1, offset);
> | ^~~~~
> drivers/pinctrl/nuvoton/pinctrl-npcm7xx.c:219:13: note: while
> referencing ‘sts’
> 219 | u32 sts, en, bit;
> | ^~~
>
> as a result.
>
> Was this not in linux-next?
It was — but when it was noticed, the fix went through the IRQ tree, on
top of a refactoring that happened there (the switch to generic_handle_domain_irq):
https://lore.kernel.org/lkml/164751044707.389.16417510835118111853.tip-bot2@tip-bot2/
So… the issue should resolve itself when the IRQ tree is pulled.
> Or was the array bounds checking not there?
>
> Anyway, that cast to "const void *"
>
> for_each_set_bit(bit, (const void *)&sts,
>
> in that driver is completely wrong.
>
> The bit operations are defined in arrays of 'unsigned long', and you
> can't just cast the issue away, because the end result is not the same
> on a big-endian machine.
>
> I fixed it up in the merge, but what really confuses me (apart from
> the apparent lack of testing in linux-next) is that I don't actually
> see what made this happen now, and not before. Maybe that's why it
> didn't show up in linux-next: it's some odd gcc heisenbug.
>
> Because there seems to be no actual changes to that driver that would
> explain why I get the warning now, but not before the pull.
When I added the pinctrl-wpcm450 driver, I changed the pinctrl/nuvoton/
directory to obj-y and exposed the pinctrl-npcm7xx to CI bot testing.
The bug existed, untouched, since the driver was added a few years ago.
Jonathan
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2022-03-28 22:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-28 13:08 Linus Walleij
2022-03-28 19:11 ` Linus Torvalds
2022-03-28 21:38 ` Jonathan Neuschäfer [this message]
2022-03-28 21:41 ` Linus Torvalds
2022-03-29 16:15 ` Linus Walleij
2022-03-28 19:15 ` pr-tracker-bot
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=YkIqyb6lhn5uU2jb@latitude \
--to=j.neuschaefer@gmx.net \
--cc=keescook@chromium.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@linux-foundation.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
all inboxes | Powered by JetHome®