From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Linus Walleij <linusw@kernel.org>
Cc: jiale yao <19888972804@163.com>, Mark Brown <broonie@kernel.org>,
linux-spi@vger.kernel.org, Biju Das <biju.das.jz@bp.renesas.com>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: RE: Re:RE: [PATCH] pinctrl: mcp23s08: reject devices without match data
Date: Fri, 2 Oct 2026 09:58:59 +0300 [thread overview]
Message-ID: <ar9WM0ZtDJD2H5Ii@ashevche-desk.local> (raw)
In-Reply-To: <CAD++jLnVna-E61Z1GiKKX9G0Q+1CMq4GYi8p7vjKzeEtroAFdA@mail.gmail.com>
On Thu, Oct 01, 2026 at 10:07:29PM +0200, Linus Walleij wrote:
> On Mon, Sep 28, 2026 at 9:25 AM jiale yao <19888972804@163.com> wrote:
>
> > I reproduced this deterministically with KASAN on arm64 QEMU.
> > The SPI device has an unmatched compatible and a valid microchip,spi-present-mask property, and is then bound with:
> >
> > echo mcp23s08 > /sys/bus/spi/devices/spi0.0/driver_override
> > echo spi0.0 > /sys/bus/spi/drivers/mcp23s08/bind
>
> [KASAN splat from spi_get_device_match_data() returning NULL]
>
> But hey look in the driver:
>
> static const struct spi_device_id mcp23s08_ids[] = {
> { "mcp23s08", (kernel_ulong_t)&mcp23s08_spi },
> { "mcp23s17", (kernel_ulong_t)&mcp23s17_spi },
> { "mcp23s18", (kernel_ulong_t)&mcp23s18_spi },
> { }
> };
> MODULE_DEVICE_TABLE(spi, mcp23s08_ids);
>
> Why doesn't the override find the right data from the match table?
>
> This looks more like a bug in the SPI bus implementation,
> surely the bus should match a driver_overrid and return a
> valid match data from spi_get_device_match_data()?
>
> I think this is just papering over the real issue, you need
> to dig into the SPI bus implementation and see why this isn't
> working.
I believe this is the whole design of driver_override like this...
There is an attempt to allow drivers to forbid that feature.
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2026-10-02 6:59 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-25 13:38 Jiale Yao
2026-09-26 10:07 ` Biju Das
2026-09-26 10:23 ` jiale yao
2026-09-26 10:28 ` jiale yao
2026-09-28 6:03 ` Biju Das
2026-09-28 7:24 ` jiale yao
2026-09-28 7:32 ` Biju Das
2026-09-28 7:54 ` jiale yao
2026-09-28 8:05 ` Biju Das
2026-10-01 20:07 ` Linus Walleij
2026-10-02 6:58 ` Andy Shevchenko [this message]
2026-10-02 9:52 ` Linus Walleij
2026-10-02 10:18 ` Andy Shevchenko
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=ar9WM0ZtDJD2H5Ii@ashevche-desk.local \
--to=andriy.shevchenko@linux.intel.com \
--cc=19888972804@163.com \
--cc=biju.das.jz@bp.renesas.com \
--cc=broonie@kernel.org \
--cc=linusw@kernel.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.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®