From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 3D203606A322 for ; Fri, 4 Dec 2026 21:14:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=hS8dSBus; dkim=fail reason="signature verification failed" (2048-bit key) header.d=bootlin.com header.i=@bootlin.com header.a=rsa-sha256 header.s=dkim header.b=tKZ+aAL4 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:References :In-Reply-To:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Unsubscribe-Post:List-Owner; bh=AkUNcv0PWEZbWAb25ymlZWRI7uPFzEhmm0ru15UtiNo=; b=hS8dSBusqqf851WbN7fyiNxoad mUgPRzZZhdGbKt+RSF/m3P+Eig3wINkhFLUnbYAIKc5ZL2kZItVB/d2NdUcDvXYmu8s4U75shOqB1 jAY3msjvcYBA/YA8eKvGB/Q35xdCaSpxn5416f1PDOIm5cmxleRXylZBpEUYvDPD/ZXZW4oVgVLOQ GnTfBJxdYeUN1bUexKYMv6ZdHQro680voYdPRPiLT0WkRXJrOO206Y09Ao214UaKgzo2eRbdZ8pCF /sYDGtDg2wJElSm/U758wxJ+ls3HbuCgkblyc/5dj9etV0PqFJBrldL34jCnUvUilSeuXKRWnRMnh KJ8gzpJg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZac7-00000001Vtb-3P5A; Fri, 04 Dec 2026 21:14:43 +0000 Received: from smtpout-03.galae.net ([185.246.85.4]) by bombadil.infradead.org with esmtps (Exim 4.100.1 #2 (Red Hat Linux)) id 1xZaby-00000001Vrz-237U for linux-mtd@lists.infradead.org; Fri, 04 Dec 2026 21:14:42 +0000 Received: from smtpout-01.galae.net (smtpout-01.galae.net [212.83.139.233]) by smtpout-03.galae.net (Postfix) with ESMTPS id F141C4E418A0 for ; Fri, 4 Dec 2026 21:14:31 +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-Archived-By: MIME-Version: 1.0 X-Last-TLS-Session-Version: TLSv1.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.9.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20261204_131439_876236_A3B08347 X-CRM114-Status: GOOD ( 14.36 ) X-Spam-Score: -2.1 (--) X-BeenThere: linux-mtd@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Linux MTD discussion mailing list List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-mtd" X-Spam-Status: No, score=-9.3 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=4.0.1 X-Spam-Checker-Version: SpamAssassin 4.0.1 (2024-03-26) on aws-us-west-2-korg-listserv-alma10-1 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. ______________________________________________________ Linux MTD discussion mailing list http://lists.infradead.org/mailman/listinfo/linux-mtd/