linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vignesh Raghavendra <vigneshr@ti.com>
To: Daniel Walker <danielwa@cisco.com>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: Jinhua Wu <jinhwu@cisco.com>, <xe-linux-external@cisco.com>,
	Tudor Ambarus <tudor.ambarus@microchip.com>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	<linux-mtd@lists.infradead.org>, <linux-kernel@vger.kernel.org>,
	Mika Westerberg <mika.westerberg@linux.intel.com>
Subject: Re: [PATCH 2/2] mtd: spi-nor: intel-spi: fix forced writable option
Date: Thu, 28 May 2020 16:31:44 +0530	[thread overview]
Message-ID: <73a475fa-3c26-89ab-aac6-54f9b5b15936@ti.com> (raw)
In-Reply-To: <20200518175930.10948-2-danielwa@cisco.com>



On 18/05/20 11:29 pm, Daniel Walker wrote:
> This option currently doesn't work as expected. If the BIOS has this
> flash as read-only there is no way to change this thru the driver.
> There is a parameter which allows the flash to become writable with the
> "writable" option to the module, but it does nothing if the BIOS has it
> set to read-only.
> 
> I would expect this option would make the flash writable regardless of
> the BIOS settings. This patch changes this option so the BIOS setting
> doesn't stop the writable option from enabling read write on the flash.
> 

I am confused you say "If the BIOS has this flash as read-only there is
no way to change this thru the driver", so is it possible to override
BIOS setting? If yes, where is the code in the driver?

What happens if BIOS is set to allow writes but writeable is set to 0?

Also please send patch series as thread (2/2 in reply to 1/2). You can
use tool like git send-email

> Original patch by Jinhua Wu <jinhwu@cisco.com>
> 
> Cc: Jinhua Wu <jinhwu@cisco.com>
> Cc: xe-linux-external@cisco.com
> Signed-off-by: Daniel Walker <danielwa@cisco.com>
> ---
>  drivers/mtd/spi-nor/controllers/intel-spi.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/mtd/spi-nor/controllers/intel-spi.c b/drivers/mtd/spi-nor/controllers/intel-spi.c
> index e5a3d51a2e4d..68a5877bfc0b 100644
> --- a/drivers/mtd/spi-nor/controllers/intel-spi.c
> +++ b/drivers/mtd/spi-nor/controllers/intel-spi.c
> @@ -954,7 +954,7 @@ struct intel_spi *intel_spi_probe(struct device *dev,
>  	intel_spi_fill_partition(ispi, &part);
>  
>  	/* Prevent writes if not explicitly enabled */
> -	if (!ispi->writeable || !writeable)
> +	if (!ispi->writeable && !writeable)
>  		ispi->nor.mtd.flags &= ~MTD_WRITEABLE;
>  
>  	ret = mtd_device_register(&ispi->nor.mtd, &part, 1);
> 

  reply	other threads:[~2020-05-28 11:02 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-18 17:59 [PATCH 2/2] mtd: spi-nor: intel-spi: fix forced writable option Daniel Walker
2020-05-28 11:01 ` Vignesh Raghavendra [this message]
2020-05-28 15:55   ` Jinhua Wu (jinhwu)
2020-06-02 16:36     ` Daniel Walker (danielwa)

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=73a475fa-3c26-89ab-aac6-54f9b5b15936@ti.com \
    --to=vigneshr@ti.com \
    --cc=akpm@linux-foundation.org \
    --cc=danielwa@cisco.com \
    --cc=jinhwu@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=mika.westerberg@linux.intel.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=tudor.ambarus@microchip.com \
    --cc=xe-linux-external@cisco.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).