All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Wei Yongjun <weiyongjun1@huawei.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
	Ingo Molnar <mingo@redhat.com>,
	linux-kernel@vger.kernel.org, linux-spi@vger.kernel.org
Subject: Re: [PATCH -next 0/4] spi: Introduce BPF based SPI mockup controller
Date: Tue, 30 Aug 2022 20:08:56 +0100	[thread overview]
Message-ID: <Yw5gSElhbYwoXrfw@sirena.org.uk> (raw)
In-Reply-To: <20220826144341.532265-1-weiyongjun1@huawei.com>

[-- Attachment #1: Type: text/plain, Size: 2485 bytes --]

On Fri, Aug 26, 2022 at 02:43:37PM +0000, Wei Yongjun wrote:
> This series Introduce a BPF based SPI mockup controller, which can be
> used for testing SPI drivers without real device.
> 
> The testsuite for SPI drivers will be post in other series, with also
> support for I2C and PCI bus device drivers.

I replied to some of the individual patches here with some more
detailed issues but I do have some big picture reservations with
this approach as well.  One big one is that this seems like it's
only going to be able to handle emulation of devices that are
purely synchronous - I don't see any sensible direction here for
extending to devices that need an interrupt line as well.  That
seems like a major limitation.  It's fine not to immediately
implement everything but it should be fairly clear how that would
be done when someone needs it and some of the BPF design goals I
understood seem to conflict with that.

I'm also not clear what the BPF environment is like when it comes
to extensible frameworks, as soon as you start thinking about the
problem space there are some obvious extensions with things like
more detailed register map descriptions and validating that the
operations that the driver is doing to the device are actually in
spec for the device or trying to stimulate race conditions or
error paths in the driver.

There's also the issue with getting the BPF userspace tooling
that I mentioned in reply to one of the individual patches.

Basically while this does look very simple from a kernel point of
view I worry that BPF might not be the right tool for the job and
could be a bit of a blind alley, with people rapidly running into
issues trying to do anything non-trivial.

There was a series in the past year or so from someone
implementing a similarish idea but rather than using BPF they
provided a framework for writing device emulations in qemu with
a simplified Python framework.  That seemed like a more obvious
direction here.  They were initially focusing on I2C but it's a
similar space.  Unfortunately I'm drawing a blank on who was
working on it or the name of the framework so I can't give a
useful reference here.  Their direction was towards having
something that could also be used to validate what the driver was
doing to the device from the device's perspective.  I do know it
was written up on LWN.  Hopefully someone else will remember what
I'm talking about from this vauge description.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

  parent reply	other threads:[~2022-08-30 19:09 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-26 14:43 [PATCH -next 0/4] spi: Introduce BPF based SPI mockup controller Wei Yongjun
2022-08-26 14:43 ` [PATCH -next 1/4] spi: mockup: Add SPI controller testing driver Wei Yongjun
2022-08-30 19:11   ` Mark Brown
2022-08-31  4:39     ` weiyongjun (A)
2022-08-26 14:43 ` [PATCH -next 2/4] spi: mockup: Add writeable tracepoint for spi transfer Wei Yongjun
2022-08-30 18:14   ` Mark Brown
2022-08-31  4:43     ` weiyongjun (A)
2022-08-26 14:43 ` [PATCH -next 3/4] spi: mockup: Add runtime device tree overlay interface Wei Yongjun
2022-08-29 21:29   ` Frank Rowand
2022-08-30  3:05     ` weiyongjun (A)
2022-08-30 10:27   ` Mark Brown
2022-08-30 19:24     ` Frank Rowand
2022-08-31  4:44       ` weiyongjun (A)
2022-08-26 14:43 ` [PATCH -next 4/4] spi: mockup: Add documentation Wei Yongjun
2022-08-30 18:21   ` Mark Brown
2022-08-30 19:08 ` Mark Brown [this message]
2022-09-01 10:38   ` [PATCH -next 0/4] spi: Introduce BPF based SPI mockup controller Mark Brown
2022-09-01 12:23   ` weiyongjun (A)

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=Yw5gSElhbYwoXrfw@sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=rostedt@goodmis.org \
    --cc=weiyongjun1@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.