From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=185.171.202.116 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796418874; b=39lDFe2qmGM6B8o8GbMwT6rYCMaUiTa+1WQ0adSCAMG+iVE1TYl3slh1dQfdHKa/tKMZ 2lR61FrFoH2zGjK0peuXxQ8P3sPSoK3kDPkD09tEa0vRtrG115Sml+fwQ9SXv9ujz8B6/ Rb990rsNZNMCJwhkUAfG+cQ2xONofEQ/GjPlZeMVuNNwdFyABMUsKoj5ikoK8xMZSQ/tv 571d3LPAquh+I/Sch3JdMJQtkuGGIKgUQ4X3x+SyktSGZJusUXePwfKF5H2PWamtCM7lA 9zQlCuxcE/Y/97HmBN5Cy8S8245FvVuSBISI4Q6/yf6HLt5Q54k/bgZ87OFlmLBqWaA== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796418874; h=DMARC-Filter:Received:Received:Received:DKIM-Signature:From:To:Cc: Subject:In-Reply-To:References:User-Agent:Date:Message-ID: MIME-Version:Content-Type:X-Last-TLS-Session-Version; bh=34EapqboMulfNCm3t/MeZVME0SZaovGBAtxsNUBoNAI=; b=Cgt2m6DMgFN4L2hteHO+84qxmqZgCdUkEWr20zy4v6dF7IDQSzwMDN46mqkwyZ0Z6EWS AF2t/OVS3p+0k+NZ4XKFVudjV0WKc/KiRynrolbM9ZZ0TgPr0vjg3lzRT3rilvZOZRO1v JdpYHRsiId49b2MMn9r5wxb0X71vW/IPOFiPE5qeQzax2IeEEKWPEs8obBV5Ldc9mLFBd vW4PuNQkGRqhBXjcVXByLoQNoG8Uf08+FEaaH/vnkIqg7QlQYtNjiskIMkgXc4gfS2xFW ufyjmQNRmfqRY8xQp6tFiG0tlVjzbRSR/NZ5fxEyz5+/ZCoA+3d8NwXmHuX30Rv+jyQ== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=bootlin.com; spf=pass smtp.mailfrom=bootlin.com; dkim=pass header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=tKZ+aAL4; arc=none smtp.remote-ip=185.171.202.116 Received: from smtpout-04.galae.net (smtpout-04.galae.net [185.171.202.116]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 08684606A322; Fri, 4 Dec 2026 21:14:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 08684606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=bootlin.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bootlin.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=tKZ+aAL4 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-04.galae.net (Postfix) with ESMTPS id C0D7DC026DC; Fri, 4 Dec 2026 21:14:43 +0000 (UTC) Received: from mail.galae.net (mail.galae.net [212.83.136.155]) by smtpout-01.galae.net (Postfix) with ESMTPS id BE0B9603C4; Fri, 4 Dec 2026 21:14:31 +0000 (UTC) Received: from [127.0.0.1] (localhost [127.0.0.1]) by localhost (Mailerdaemon) with ESMTPSA id D996711EA17C8; Fri, 04 Dec 2026 22:14:23 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=dkim; t=1796418867; h=from:subject:date:message-id:to:cc:mime-version:content-type: in-reply-to:references; bh=34EapqboMulfNCm3t/MeZVME0SZaovGBAtxsNUBoNAI=; b=tKZ+aAL4fqLEsupeWXlLdvAfqk4En+sCi6s6Pjd7y4h5Owck1sHmDiuxVc9QFckKAZvIlf DeLQIRzwTZbjnoz3up5soYES6m4QqjMdCg6uG8AlpbLxumS6IyM1noOo4qwr0mgf7mxFP4 Bj4zRdFOmCSoSKO/XfFGYAzd07eR9qjdJeMlbMg32bPvhAYBgD7h/lLgG7acs/oWPtjPdg WTorbxZrkLcPE0fgei8gAVszoHZNgAMlhzyVGwPCdaXL2Pwj1LF20KDB0wlUvI4K+48HB7 aT2rhM9WlE55LtC7dxGNGonRP/EU2yqDjzVrXZHBuvJurCSpwDUq+UDM4cMa+g== From: Miquel Raynal To: James Hilliard Cc: Richard Weinberger , Vignesh Raghavendra , Maxim Levitsky , 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 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") References: <20261108-submit-r852-card-detect-lock-v1-v3-1-ea9e5411314d@gmail.com> User-Agent: mu4e 1.12.12; emacs 30.2 Date: Fri, 04 Dec 2026 22:14:23 +0100 Message-ID: <878q24hhow.fsf@bootlin.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain X-Last-TLS-Session-Version: TLSv1.3 On 08/11/2026 at 17:22:18 -07, James Hilliard 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 Same, after applying the first patch, these do not apply. Please make a series for all the r852 fixes.