U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Kathpalia, Tanmay" <tanmay.kathpalia@altera.com>
To: Guodong Xu <guodong@riscstar.com>,
	Takahiro Kuwano <takahiro.kuwano@infineon.com>,
	u-boot@lists.denx.de, u-boot-spacemit@groups.io
Cc: Vignesh R <vigneshr@ti.com>, Tom Rini <trini@konsulko.com>,
	Raymond Mao <raymond.mao@riscstar.com>,
	Rick Chen <rick@andestech.com>, Leo <ycliang@andestech.com>,
	Huan Zhou <pericycle.cc@gmail.com>, Peng Fan <peng.fan@nxp.com>,
	Sam Protsenko <semen.protsenko@linaro.org>,
	Mayuresh Chitale <mchitale@ventanamicro.com>,
	Yao Zi <me@ziyao.cc>, Anis Chali <chalianis1@gmail.com>,
	Dan Carpenter <dan.carpenter@linaro.org>,
	Sean Anderson <sean.anderson@linux.dev>,
	Heiko Schocher <hs@nabladev.com>,
	Rasmus Villemoes <ravi@prevas.dk>,
	Philip Molloy <philip.molloy@analog.com>,
	Michal Simek <michal.simek@amd.com>,
	Yegor Yefremov <yegorslists@googlemail.com>,
	Eoin Dickson <eoin.dickson@microchip.com>,
	Sumit Garg <sumit.garg@oss.qualcomm.com>,
	Casey Connolly <casey.connolly@linaro.org>,
	Neil Armstrong <neil.armstrong@linaro.org>,
	Guodong Xu <guodong.xu@riscstar.com>,
	Rui Miguel Silva <rui.silva@linaro.org>
Subject: Re: [PATCH v2 2/9] mtd: spi: enable spi_nor_remove() in soft reset config
Date: Wed, 27 May 2026 19:10:39 +0530	[thread overview]
Message-ID: <7bd8dcbb-c1fc-4d0f-9678-b7b638d9aff4@altera.com> (raw)
In-Reply-To: <20260520-b4-k1-spl-pinctrl-spinor-v2-2-8d25db98ac8e@riscstar.com>


On 5/20/2026 4:15 PM, Guodong Xu wrote:
> From: Raymond Mao <raymond.mao@riscstar.com>
>
> spi_nor_remove() is only implemented in spi-nor-core.o, not spi-nor-tiny.o.
>
> So make spi_nor_remove() only valid for CONFIG_SPI_FLASH_SOFT_RESET.
>
> Signed-off-by: Raymond Mao <raymond.mao@riscstar.com>
> Signed-off-by: Guodong Xu <guodong@riscstar.com>
>
> ---
> v2:
> - No change.
> ---
>   drivers/mtd/spi/sf_probe.c | 8 +++++---
>   1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/mtd/spi/sf_probe.c b/drivers/mtd/spi/sf_probe.c
> index 7100b64bf22..dee03662d45 100644
> --- a/drivers/mtd/spi/sf_probe.c
> +++ b/drivers/mtd/spi/sf_probe.c
> @@ -229,9 +229,11 @@ static int spi_flash_std_remove(struct udevice *dev)
>   		spi_mem_dirmap_destroy(flash->dirmap.rdesc);
>   	}
>   
> -	ret = spi_nor_remove(flash);
> -	if (ret)
> -		return ret;
> +	if (CONFIG_IS_ENABLED(SPI_FLASH_SOFT_RESET)) {
> +		ret = spi_nor_remove(flash);
> +		if (ret)
> +			return ret;
> +	}
>   
>   	if (CONFIG_IS_ENABLED(SPI_FLASH_MTD))
>   		spi_flash_mtd_unregister(flash);

The tiny configuration is already handled by the inline stub in spi-nor.h,
where spi_nor_remove() is a no-op for SPI_FLASH_TINY. So I think adding a
SPI_FLASH_SOFT_RESET guard around the remove call does not provide
additional value.


  reply	other threads:[~2026-05-27 13:41 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 10:45 [PATCH v2 0/9] riscv: spacemit: k1: add pinctrl/GPIO and SPI NOR support Guodong Xu
2026-05-20 10:45 ` [PATCH v2 1/9] mtd: spi: select SPL_SPI_FLASH_TINY in SPL stage Guodong Xu
2026-05-27 13:28   ` Kathpalia, Tanmay
2026-05-20 10:45 ` [PATCH v2 2/9] mtd: spi: enable spi_nor_remove() in soft reset config Guodong Xu
2026-05-27 13:40   ` Kathpalia, Tanmay [this message]
2026-05-20 10:45 ` [PATCH v2 3/9] spi: fsl: add support for Spacemit K1 SoC Guodong Xu
2026-05-20 10:45 ` [PATCH v2 4/9] spl: k1: enable SPI NOR flash detection and boot Guodong Xu
2026-05-20 10:45 ` [PATCH v2 5/9] riscv: binman: Always set default configuration in FIT image Guodong Xu
2026-05-20 10:45 ` [PATCH v2 6/9] spacemit: k1: Add multiple device tree support Guodong Xu
2026-05-24 21:25   ` Aurelien Jarno
2026-05-26 13:24     ` Guodong Xu
2026-05-26 13:36   ` Simon Glass
2026-06-04 14:21     ` Guodong Xu
2026-05-20 10:45 ` [PATCH v2 7/9] pinctrl: add pinctrl driver for Spacemit K1 SoC Guodong Xu
2026-05-20 10:45 ` [PATCH v2 8/9] gpio: add gpio " Guodong Xu
2026-05-20 10:45 ` [PATCH v2 9/9] configs: k1: enable pinctrl and gpio Guodong Xu

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=7bd8dcbb-c1fc-4d0f-9678-b7b638d9aff4@altera.com \
    --to=tanmay.kathpalia@altera.com \
    --cc=casey.connolly@linaro.org \
    --cc=chalianis1@gmail.com \
    --cc=dan.carpenter@linaro.org \
    --cc=eoin.dickson@microchip.com \
    --cc=guodong.xu@riscstar.com \
    --cc=guodong@riscstar.com \
    --cc=hs@nabladev.com \
    --cc=mchitale@ventanamicro.com \
    --cc=me@ziyao.cc \
    --cc=michal.simek@amd.com \
    --cc=neil.armstrong@linaro.org \
    --cc=peng.fan@nxp.com \
    --cc=pericycle.cc@gmail.com \
    --cc=philip.molloy@analog.com \
    --cc=ravi@prevas.dk \
    --cc=raymond.mao@riscstar.com \
    --cc=rick@andestech.com \
    --cc=rui.silva@linaro.org \
    --cc=sean.anderson@linux.dev \
    --cc=semen.protsenko@linaro.org \
    --cc=sumit.garg@oss.qualcomm.com \
    --cc=takahiro.kuwano@infineon.com \
    --cc=trini@konsulko.com \
    --cc=u-boot-spacemit@groups.io \
    --cc=u-boot@lists.denx.de \
    --cc=vigneshr@ti.com \
    --cc=ycliang@andestech.com \
    --cc=yegorslists@googlemail.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