From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id E15D829D26E; Wed, 20 May 2026 17:36:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779298581; cv=none; b=Yz3cRgWDpQotLabjCf0wnnMG6HtQYtFI6tRw6PV3jDPzkQFnnZ089NaWjcTkH98qabuzfmay+7f7FG830N3emsXGbq74XPBrPnCUrZSrbP6OesY+wh/7bFlYjxE3rFRehzrkaswwekUsRvU8FMQpKNUV55AspVia6bF3mAh5WCg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779298581; c=relaxed/simple; bh=giCI62Hyn10Hw42H+rxz/bpA7ttcuUPwkbps6SxJj00=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=GTJF50CZdpGotpoA2Bq2jb7TrzKd+ypiX9hdTqffOxUqn/Y13CKFPPhXiY96/Gt1t/8Nxu5UsXDB2UrJ7fcydyku1JROhYmJoZg6IJCGBJCj73W6exHmPW5Qj3Vc8r48YLWkItxa8yTcYiZIV1pmga9/2yPQhrBTVX1R+N+SUaA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nhuRhXup; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nhuRhXup" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1CD131F000E9; Wed, 20 May 2026 17:36:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779298580; bh=1UUS+Eoe+iby1fMMURbTlRiLMYuMZF14fBBHtgNnDXM=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nhuRhXupNrYnmq4lYXoGmJpc2rz54RT8hW8yBD0fWlVHTBslavp2OHmfn3FOLkn8T wgIJAP7y1V28cZmKJ0ZJC0mINsa3Bo8W3zKbP+SOlOny8yzk8mJvjMUyVyqWTvVxi9 RQOqiyrgUS8vm/w2c68w7iUGCXW5aZGKK2hk8s7w= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Haibo Chen , Pratyush Yadav , Sasha Levin Subject: [PATCH 6.18 465/957] mtd: spi-nor: core: correct the op.dummy.nbytes when check read operations Date: Wed, 20 May 2026 18:15:48 +0200 Message-ID: <20260520162144.607959089@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162134.554764788@linuxfoundation.org> References: <20260520162134.554764788@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.18-stable review patch. If anyone has any objections, please let me know. ------------------ From: Haibo Chen [ Upstream commit 756564a536ecd8c9d33edd89f0647a91a0b03587 ] When check read operation, need to setting the op.dummy.nbytes based on current read operation rather than the nor->read_proto. Fixes: 0e30f47232ab ("mtd: spi-nor: add support for DTR protocol") Signed-off-by: Haibo Chen Reviewed-by: Pratyush Yadav Signed-off-by: Pratyush Yadav (Google) Signed-off-by: Sasha Levin --- drivers/mtd/spi-nor/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/core.c b/drivers/mtd/spi-nor/core.c index 20ea80450f222..19dc13faf9fd9 100644 --- a/drivers/mtd/spi-nor/core.c +++ b/drivers/mtd/spi-nor/core.c @@ -2393,7 +2393,7 @@ static int spi_nor_spimem_check_readop(struct spi_nor *nor, /* convert the dummy cycles to the number of bytes */ op.dummy.nbytes = (read->num_mode_clocks + read->num_wait_states) * op.dummy.buswidth / 8; - if (spi_nor_protocol_is_dtr(nor->read_proto)) + if (spi_nor_protocol_is_dtr(read->proto)) op.dummy.nbytes *= 2; return spi_nor_spimem_check_op(nor, &op); -- 2.53.0