[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220405140221.GC28574@axis.com>
Date: Tue, 5 Apr 2022 16:02:21 +0200
From: Vincent Whitchurch <vincent.whitchurch@...s.com>
To: Mark Brown <broonie@...nel.org>
CC: <linux-kernel@...r.kernel.org>, <kernel@...s.com>,
<devicetree@...r.kernel.org>, <linux-um@...ts.infradead.org>,
<shuah@...nel.org>, <brendanhiggins@...gle.com>,
<linux-kselftest@...r.kernel.org>, <jic23@...nel.org>,
<linux-iio@...r.kernel.org>, <lgirdwood@...il.com>,
<a.zummo@...ertech.it>, <alexandre.belloni@...tlin.com>,
<linux-rtc@...r.kernel.org>, <corbet@....net>,
<linux-doc@...r.kernel.org>
Subject: Re: [RFC v1 09/10] regulator: tps62864: add roadtest
On Thu, Mar 17, 2022 at 05:53:22PM +0000, Mark Brown wrote:
> On Thu, Mar 17, 2022 at 04:13:26PM +0100, Vincent Whitchurch wrote:
> > On Fri, Mar 11, 2022 at 06:06:54PM +0000, Mark Brown wrote:
>
> > > > + @classmethod
> > > > + def setUpClass(cls) -> None:
> > > > + insmod("tps6286x-regulator")
>
> > > Shouldn't this get figured out when the device gets created in DT (if it
> > > doesn't I guess the tests found a bug...)?
>
> > The system isn't set up to load modules automatically. The reason for
> > this is to give the test cases full control of when the module is loaded
> > and unload, since the tests could want to load the module with specific
> > options.
>
> That seems like the uncommon case which could remove the module if it
> explicitly needed it.
Another reason was to get the tests to test module unloading since I've
seen a lot of especially new driver writers forget to test that, but I
realise that for most normal drivers that should be mostly covered by
the fact that we test device unbinding.
So I went ahead and implemented this and it seems to work. As you
hinted earlier, this also means that the modalias stuff gets tested, and
as we know that's been broken in the recent past for a bunch of drivers,
so that's another advantage to automatic module loading, besides the
boilerplate reduction in the tests.
Powered by blists - more mailing lists