From: Miquel Raynal <miquel.raynal@bootlin.com>
To: James Hilliard <james.hilliard1@gmail.com>
Cc: Richard Weinberger <richard@nod.at>,
Vignesh Raghavendra <vigneshr@ti.com>,
Maxim Levitsky <maximlevitsky@gmail.com>,
linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH v3] mtd: rawnand: r852: preserve card changes during detection work
Date: Fri, 04 Dec 2026 22:14:23 +0100 [thread overview]
Message-ID: <878q24hhow.fsf@bootlin.com> (raw)
In-Reply-To: <20261108-submit-r852-card-detect-lock-v1-v3-1-ea9e5411314d@gmail.com> (James Hilliard's message of "Sun, 08 Nov 2026 17:22:18 -0700")
On 08/11/2026 at 17:22:18 -07, James Hilliard <james.hilliard1@gmail.com> wrote:
> r852_update_card_detect() reads and writes the card interrupt enable
> register without holding irqlock. A card interrupt can mask detection
> interrupts and mark the card unstable between those accesses, only for
> the worker to overwrite the mask with its saved value.
>
> The worker also calls this helper before and after registering or
> unregistering a card. An interrupt between these calls starts a new
> debounce interval, but the second call clears card_unstable and enables
> interrupts again before that interval has elapsed. The interrupt can
> also change card_detected between the worker's registration checks and
> its media-property update.
>
> Hold irqlock across the interrupt mask update and leave the mask alone
> while the card is unstable. Move the transition to stable state into
> the locked card sample, and return that sample for both of the worker's
> registration decisions. Sample the write-protect and media-type fields
> there as well when a present card is not yet registered, so a later IRQ
> cannot make registration use properties left over from a previous card.
> Keep the properties of an already registered card unchanged.
>
> Keep registration failure from overwriting a newer interrupt's card
> state, so the next delayed work invocation can process that change.
>
> Fixes: 67e054e91924 ("mtd: nand: Add driver for Ricoh xD/SmartMedia reader")
> Cc: stable@vger.kernel.org
> Closes: https://lore.kernel.org/r/sashiko-outbox-204068@kernel.org/
> Closes: https://lore.kernel.org/r/sashiko-outbox-204135@kernel.org/
> Link: https://lore.kernel.org/r/sashiko-outbox-204169@kernel.org/
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
Same, after applying the first patch, these do not apply. Please make a
series for all the r852 fixes.
next prev parent reply other threads:[~2026-12-04 21:14 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-09 0:22 [PATCH v3] mtd: rawnand: r852: preserve card changes during detection work James Hilliard
2026-12-04 21:14 ` Miquel Raynal [this message]
2026-12-04 21:33 ` Miquel Raynal
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=878q24hhow.fsf@bootlin.com \
--to=miquel.raynal@bootlin.com \
--cc=james.hilliard1@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mtd@lists.infradead.org \
--cc=maximlevitsky@gmail.com \
--cc=richard@nod.at \
--cc=stable@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox