All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Michael Walle" <mwalle@kernel.org>
To: "Romli, Khairul Anuar" <khairul.anuar.romli@altera.com>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"open list:SPI NOR SUBSYSTEM" <linux-mtd@lists.infradead.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	"Gerlach, Matthew" <matthew.gerlach@altera.com>
Subject: Re: [PATCH v3 1/1] mtd: spi-nor: core: Prevent oops during driver removal with active read or write operations
Date: Wed, 30 Jul 2025 09:50:07 +0200	[thread overview]
Message-ID: <DBP84FIUUQO7.369TFNTJFELMW@kernel.org> (raw)
In-Reply-To: < <MN2PR03MB49271E2D022D305BC149BA4FC624A@MN2PR03MB4927.namprd03.prod.outlook.com>


[-- Attachment #1.1: Type: text/plain, Size: 1104 bytes --]

Hi,

> > On Wed Jul 30, 2025 at 3:39 AM CEST, Khairul Anuar Romli wrote:
> > > From: kromli <khairul.anuar.romli@altera.com>
> > >
> > > Ensure that the pointer passed to module_put() in spi_nor_put_device()
> > > is not NULL before use. This change adds a guard clause to return
> > > early, preventing the kernel crash below when the cadence-qspi driver
> > > is removed during a dd operation:
> > 
> > As already asked in v2. This needs a (more detailed) description what is going
> > on and what is going wrong.
> > 
> > -michael
>
> Hi,
>
> We just run the following test we observe the crash. 
>
> time dd if=/dev/mtd1 of=out.img bs=1MB count=1000 &
> echo spi0.0 > /sys/bus/spi/drivers/spi-nor/unbind
> echo spi0.0 > /sys/bus/spi/drivers/spi-nor/bind
>
> From the observation, the dd is not entirely terminated when the unbind took place.
> Maybe there is other changes require to ensure the dd operation gets terminated 
> when driver unbind/remove.

I'd expect an analysis what's going wrong in the kernel to judge the
correctness of the patch.

Thanks,
-michael

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

[-- Attachment #2: Type: text/plain, Size: 144 bytes --]

______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

WARNING: multiple messages have this Message-ID (diff)
From: "Michael Walle" <mwalle@kernel.org>
To: "Romli, Khairul Anuar" <khairul.anuar.romli@altera.com>,
	"Tudor Ambarus" <tudor.ambarus@linaro.org>,
	"Pratyush Yadav" <pratyush@kernel.org>,
	"Miquel Raynal" <miquel.raynal@bootlin.com>,
	"Richard Weinberger" <richard@nod.at>,
	"Vignesh Raghavendra" <vigneshr@ti.com>,
	"open list:SPI NOR SUBSYSTEM" <linux-mtd@lists.infradead.org>,
	"open list" <linux-kernel@vger.kernel.org>,
	"Gerlach, Matthew" <matthew.gerlach@altera.com>
Subject: Re: [PATCH v3 1/1] mtd: spi-nor: core: Prevent oops during driver removal with active read or write operations
Date: Wed, 30 Jul 2025 09:50:07 +0200	[thread overview]
Message-ID: <DBP84FIUUQO7.369TFNTJFELMW@kernel.org> (raw)
In-Reply-To: < <MN2PR03MB49271E2D022D305BC149BA4FC624A@MN2PR03MB4927.namprd03.prod.outlook.com>

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

Hi,

> > On Wed Jul 30, 2025 at 3:39 AM CEST, Khairul Anuar Romli wrote:
> > > From: kromli <khairul.anuar.romli@altera.com>
> > >
> > > Ensure that the pointer passed to module_put() in spi_nor_put_device()
> > > is not NULL before use. This change adds a guard clause to return
> > > early, preventing the kernel crash below when the cadence-qspi driver
> > > is removed during a dd operation:
> > 
> > As already asked in v2. This needs a (more detailed) description what is going
> > on and what is going wrong.
> > 
> > -michael
>
> Hi,
>
> We just run the following test we observe the crash. 
>
> time dd if=/dev/mtd1 of=out.img bs=1MB count=1000 &
> echo spi0.0 > /sys/bus/spi/drivers/spi-nor/unbind
> echo spi0.0 > /sys/bus/spi/drivers/spi-nor/bind
>
> From the observation, the dd is not entirely terminated when the unbind took place.
> Maybe there is other changes require to ensure the dd operation gets terminated 
> when driver unbind/remove.

I'd expect an analysis what's going wrong in the kernel to judge the
correctness of the patch.

Thanks,
-michael

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

  parent reply	other threads:[~2025-07-30  7:58 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <cover.1753839339.git.khairul.anuar.romli@altera.com>
2025-07-30  1:39 ` [PATCH v3 1/1] mtd: spi-nor: core: Prevent oops during driver removal with active read or write operations Khairul Anuar Romli
2025-07-30  1:39   ` Khairul Anuar Romli
2025-07-30  7:30   ` Michael Walle
2025-07-30  7:30     ` Michael Walle
2025-07-30  7:46     ` Romli, Khairul Anuar
2025-07-30  7:46       ` Romli, Khairul Anuar
     [not found]       ` < <MN2PR03MB49271E2D022D305BC149BA4FC624A@MN2PR03MB4927.namprd03.prod.outlook.com>
2025-07-30  7:50         ` Michael Walle [this message]
2025-07-30  7:50           ` Michael Walle
2025-08-21  0:32           ` Romli, Khairul Anuar
2025-08-21  0:32             ` Romli, Khairul Anuar
     [not found]             ` < <MN2PR03MB4927D29E06586CCE7D0547FEC632A@MN2PR03MB4927.namprd03.prod.outlook.com>
2025-08-21  6:44               ` Michael Walle
2025-08-21  6:44                 ` Michael Walle

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=DBP84FIUUQO7.369TFNTJFELMW@kernel.org \
    --to=mwalle@kernel.org \
    --cc=khairul.anuar.romli@altera.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=matthew.gerlach@altera.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=pratyush@kernel.org \
    --cc=richard@nod.at \
    --cc=tudor.ambarus@linaro.org \
    --cc=vigneshr@ti.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.