[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a2SN3pdXV8=0jXfrsz8L64yV46fEM4zrSXfA25QK0GNuA@mail.gmail.com>
Date: Thu, 30 Jul 2020 16:09:08 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Daniel Gutson <daniel@...ypsium.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Tudor Ambarus <tudor.ambarus@...rochip.com>,
Miquel Raynal <miquel.raynal@...tlin.com>,
Richard Weinberger <richard@....at>,
Vignesh Raghavendra <vigneshr@...com>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
Boris Brezillon <bbrezillon@...nel.org>,
linux-mtd <linux-mtd@...ts.infradead.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Alex Bazhaniuk <alex@...ypsium.com>,
Richard Hughes <hughsient@...il.com>
Subject: Re: [PATCH] Module argument to control whether intel-spi-pci attempts
to turn the SPI flash chip writeable
On Thu, Jul 30, 2020 at 2:21 PM Daniel Gutson <daniel@...ypsium.com> wrote:
> El jue., 30 jul. 2020 2:31 a. m., Greg Kroah-Hartman <gregkh@...uxfoundation.org> escribió:
>>
>> Again, module parameters are working on a per-chunk-of-code basis, while
>> you want to work on a per-device basis,
>
>
> I think there is a misunderstanding. What I want is to control (turn on or off) is a very specific code snippet that provides the "functionality" of trying to turn the chip writable. The rest of the device driver is fine.
> I assume that the one that doesn't understand is me.
>
I looked at the source code again and found that the existing module
parameter applies to both the platform and pci device front-ends, both
of which go through
/* Prevent writes if not explicitly enabled */
if (!ispi->writeable || !writeable)
ispi->nor.mtd.flags &= ~MTD_WRITEABLE;
Setting the PCI device writable in hardware makes it possible to
actually write to it *only* if the module parameter is also set to '1'.
One might disagree with that design, but I don't think your patch
would make it any better, it just means one would have to set
two module parameters instead of one.
Arnd
Powered by blists - more mailing lists