stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	patches@lists.linux.dev,
	Alexander Stein <alexander.stein@ew.tq-group.com>,
	Tudor Ambarus <tudor.ambarus@linaro.org>,
	Pratyush Yadav <pratyush@kernel.org>,
	Miquel Raynal <miquel.raynal@bootlin.com>,
	Sasha Levin <sashal@kernel.org>
Subject: [PATCH 6.6 21/72] Revert "mtd: spi-nor: core: replace dummy buswidth from addr to data"
Date: Tue, 21 Jan 2025 18:51:47 +0100	[thread overview]
Message-ID: <20250121174524.243421410@linuxfoundation.org> (raw)
In-Reply-To: <20250121174523.429119852@linuxfoundation.org>

6.6-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Pratyush Yadav <pratyush@kernel.org>

[ Upstream commit d15638bf76ad47874ecb5dc386f0945fc0b2a875 ]

This reverts commit 98d1fb94ce75f39febd456d6d3cbbe58b6678795.

The commit uses data nbits instead of addr nbits for dummy phase. This
causes a regression for all boards where spi-tx-bus-width is smaller
than spi-rx-bus-width. It is a common pattern for boards to have
spi-tx-bus-width == 1 and spi-rx-bus-width > 1. The regression causes
all reads with a dummy phase to become unavailable for such boards,
leading to a usually slower 0-dummy-cycle read being selected.

Most controllers' supports_op hooks call spi_mem_default_supports_op().
In spi_mem_default_supports_op(), spi_mem_check_buswidth() is called to
check if the buswidths for the op can actually be supported by the
board's wiring. This wiring information comes from (among other things)
the spi-{tx,rx}-bus-width DT properties. Based on these properties,
SPI_TX_* or SPI_RX_* flags are set by of_spi_parse_dt().
spi_mem_check_buswidth() then uses these flags to make the decision
whether an op can be supported by the board's wiring (in a way,
indirectly checking against spi-{rx,tx}-bus-width).

Now the tricky bit here is that spi_mem_check_buswidth() does:

	if (op->dummy.nbytes &&
	    spi_check_buswidth_req(mem, op->dummy.buswidth, true))
		return false;

The true argument to spi_check_buswidth_req() means the op is treated as
a TX op. For a board that has say 1-bit TX and 4-bit RX, a 4-bit dummy
TX is considered as unsupported, and the op gets rejected.

The commit being reverted uses the data buswidth for dummy buswidth. So
for reads, the RX buswidth gets used for the dummy phase, uncovering
this issue. In reality, a dummy phase is neither RX nor TX. As the name
suggests, these are just dummy cycles that send or receive no data, and
thus don't really need to have any buswidth at all.

Ideally, dummy phases should not be checked against the board's wiring
capabilities at all, and should only be sanity-checked for having a sane
buswidth value. Since we are now at rc7 and such a change might
introduce many unexpected bugs, revert the commit for now. It can be
sent out later along with the spi_mem_check_buswidth() fix.

Fixes: 98d1fb94ce75 ("mtd: spi-nor: core: replace dummy buswidth from addr to data")
Reported-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Closes: https://lore.kernel.org/linux-mtd/3342163.44csPzL39Z@steina-w/
Tested-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Reviewed-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Signed-off-by: Pratyush Yadav <pratyush@kernel.org>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 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 8d75a66775cb1..1b0c6770c14e4 100644
--- a/drivers/mtd/spi-nor/core.c
+++ b/drivers/mtd/spi-nor/core.c
@@ -89,7 +89,7 @@ void spi_nor_spimem_setup_op(const struct spi_nor *nor,
 		op->addr.buswidth = spi_nor_get_protocol_addr_nbits(proto);
 
 	if (op->dummy.nbytes)
-		op->dummy.buswidth = spi_nor_get_protocol_data_nbits(proto);
+		op->dummy.buswidth = spi_nor_get_protocol_addr_nbits(proto);
 
 	if (op->data.nbytes)
 		op->data.buswidth = spi_nor_get_protocol_data_nbits(proto);
-- 
2.39.5




  parent reply	other threads:[~2025-01-21 17:55 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-21 17:51 [PATCH 6.6 00/72] 6.6.74-rc1 review Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 01/72] net: ethernet: ti: cpsw_ale: Fix cpsw_ale_get_field() Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 02/72] bpf: Fix bpf_sk_select_reuseport() memory leak Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 03/72] openvswitch: fix lockup on tx to unregistering netdev with carrier Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 04/72] pktgen: Avoid out-of-bounds access in get_imix_entries Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 05/72] net: add exit_batch_rtnl() method Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 06/72] gtp: use " Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 07/72] gtp: Use for_each_netdev_rcu() in gtp_genl_dump_pdp() Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 08/72] gtp: Destroy device along with udp sockets netns dismantle Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 09/72] nfp: bpf: prevent integer overflow in nfp_bpf_event_output() Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 10/72] net: xilinx: axienet: Fix IRQ coalescing packet count overflow Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 11/72] net: fec: handle page_pool_dev_alloc_pages error Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 12/72] net/mlx5: Fix RDMA TX steering prio Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 13/72] net/mlx5: Clear port select structure when fail to create Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 14/72] net/mlx5e: Fix inversion dependency warning while enabling IPsec tunnel Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 15/72] net/mlx5e: Rely on reqid in IPsec tunnel mode Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 16/72] net/mlx5e: Always start IPsec sequence number from 1 Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 17/72] drm/vmwgfx: Add new keep_resv BO param Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 18/72] drm/v3d: Ensure job pointer is set to NULL after job completion Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 19/72] soc: ti: pruss: Fix pruss APIs Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 20/72] hwmon: (tmp513) Fix division of negative numbers Greg Kroah-Hartman
2025-01-21 17:51 ` Greg Kroah-Hartman [this message]
2025-01-21 17:51 ` [PATCH 6.6 22/72] i2c: mux: demux-pinctrl: check initial mux selection, too Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 23/72] i2c: rcar: fix NACK handling when being a target Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 24/72] smb: client: fix double free of TCP_Server_Info::hostname Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 25/72] mac802154: check local interfaces before deleting sdata list Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 26/72] hfs: Sanity check the root record Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 27/72] fs: fix missing declaration of init_files Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 28/72] kheaders: Ignore silly-rename files Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 29/72] cachefiles: Parse the "secctx" immediately Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 30/72] scsi: ufs: core: Honor runtime/system PM levels if set by host controller drivers Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 31/72] selftests: tc-testing: reduce rshift value Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 32/72] ACPI: resource: acpi_dev_irq_override(): Check DMI match last Greg Kroah-Hartman
2025-01-21 17:51 ` [PATCH 6.6 33/72] iomap: avoid avoid truncating 64-bit offset to 32 bits Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 34/72] poll_wait: add mb() to fix theoretical race between waitqueue_active() and .poll() Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 35/72] RDMA/bnxt_re: Fix to export port num to ib_query_qp Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 36/72] nvmet: propagate npwg topology Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 37/72] x86/asm: Make serialize() always_inline Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 38/72] ALSA: hda/realtek: Add support for Ayaneo System using CS35L41 HDA Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 39/72] zram: fix potential UAF of zram table Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 40/72] i2c: atr: Fix client detach Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 41/72] mptcp: be sure to send ack when mptcp-level window re-opens Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 42/72] mptcp: fix spurious wake-up on under memory pressure Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 43/72] selftests: mptcp: avoid spurious errors on disconnect Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 44/72] net: ethernet: xgbe: re-add aneg to supported features in PHY quirks Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 45/72] vsock/bpf: return early if transport is not assigned Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 46/72] vsock/virtio: discard packets if the transport changes Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 47/72] vsock/virtio: cancel close work in the destructor Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 48/72] vsock: reset socket state when de-assigning the transport Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 49/72] vsock: prevent null-ptr-deref in vsock_*[has_data|has_space] Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 50/72] nouveau/fence: handle cross device fences properly Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 51/72] filemap: avoid truncating 64-bit offset to 32 bits Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 52/72] fs/proc: fix softlockup in __read_vmcore (part 2) Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 53/72] gpio: xilinx: Convert gpio_lock to raw spinlock Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 54/72] pmdomain: imx8mp-blk-ctrl: add missing loop break condition Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 55/72] irqchip: Plug a OF node reference leak in platform_irqchip_probe() Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 56/72] irqchip/gic-v3: Handle CPU_PM_ENTER_FAILED correctly Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 57/72] irqchip/gic-v3-its: Dont enable interrupts in its_irq_set_vcpu_affinity() Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 58/72] hrtimers: Handle CPU state correctly on hotplug Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 59/72] drm/i915/fb: Relax clear color alignment to 64 bytes Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 60/72] drm/amdgpu: always sync the GFX pipe on ctx switch Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 61/72] Revert "PCI: Use preserve_config in place of pci_flags" Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 62/72] iio: imu: inv_icm42600: fix spi burst write not supported Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 63/72] drm/amd/display: Fix out-of-bounds access in dcn21_link_encoder_create Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 64/72] block: fix uaf for flush rq while iterating tags Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 65/72] ocfs2: fix deadlock in ocfs2_get_system_file_inode Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 66/72] ovl: pass realinode to ovl_encode_real_fh() instead of realdentry Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 67/72] ovl: support encoding fid from inode with no alias Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 68/72] fs: relax assertions on failure to encode file handles Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 69/72] Revert "drm/amdgpu: rework resume handling for display (v2)" Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 70/72] nfsd: add list_head nf_gc to struct nfsd_file Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 71/72] x86/xen: fix SLS mitigation in xen_hypercall_iret() Greg Kroah-Hartman
2025-01-21 17:52 ` [PATCH 6.6 72/72] net: fix data-races around sk->sk_forward_alloc Greg Kroah-Hartman
2025-01-21 18:57 ` [PATCH 6.6 00/72] 6.6.74-rc1 review Florian Fainelli
2025-01-21 20:41 ` Peter Schneider
2025-01-21 23:35 ` Shuah Khan
2025-01-21 23:47 ` SeongJae Park
2025-01-22  9:25 ` Ron Economos
2025-01-22 12:06 ` Naresh Kamboju
2025-01-22 13:23 ` Jon Hunter
2025-01-22 14:41 ` Muhammad Usama Anjum
2025-01-22 17:04 ` Mark Brown
2025-01-22 20:18 ` [PATCH 6.6] " Hardik Garg

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=20250121174524.243421410@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alexander.stein@ew.tq-group.com \
    --cc=miquel.raynal@bootlin.com \
    --cc=patches@lists.linux.dev \
    --cc=pratyush@kernel.org \
    --cc=sashal@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=tudor.ambarus@linaro.org \
    /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;
as well as URLs for NNTP newsgroup(s).