spi: Updaets for v7.1

One substantive fix here, fixing corruption of the maximum frequency for
 spi-mem operations which caused users to remember what should have been
 a temporarily modified maximum frequency as the standard going forward,
 potentially causing instability when the modification raised rather than
 lowered the frequency.
 
 We also have a trivial patch which just documents the correct way to
 describe the Qualcomm IPQ5210 SNAND controller in the DT, there are no
 code changes.
 -----BEGIN PGP SIGNATURE-----
 
 iQEzBAABCgAdFiEEreZoqmdXGLWf4p/qJNaLcl1Uh9AFAmoZyKAACgkQJNaLcl1U
 h9BkSQf+OPY/DuHr46oL4AH36df3FkihkFmaTlipyP2io7HiTgYG67wdXtVfh4H2
 w8D9GT+ukrCGgWkJK+Qgf3IbX19BkL/1kyeDATBJErMd/XHQqn6u38+Lhe3EAqzP
 L4S/pWHmtC/pKynPbsUUkunAYeUa3DK6ZHteZyCe/R+fTKizXOH5Lh74Dcm/pa+V
 b8Aut8Igq32K5KXDkk+TzACkiGDaFs+M7QDfNGI9WN3zBrzxWtS/9ktF5/cN5gBG
 dzjcLb+XJoZnJHwMa7geS7cVvKpPMbqX8fYwip+hhaPfyugP9EvdPibcAhUltGw3
 TNFYV4HpFeGuf7yIoEIzapvVdvvbjA==
 =iELF
 -----END PGP SIGNATURE-----

Merge tag 'spi-fix-v7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi

Pull spi fixes from Mark Brown:
 "One substantive fix here, fixing corruption of the maximum frequency
  for spi-mem operations which caused users to remember what should have
  been a temporarily modified maximum frequency as the standard going
  forward, potentially causing instability when the modification raised
  rather than lowered the frequency.

  We also have a trivial patch which just documents the correct way to
  describe the Qualcomm IPQ5210 SNAND controller in the DT, there are no
  code changes"

* tag 'spi-fix-v7.1-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi:
  spi: spi-mem: avoid mutating op template in spi_mem_supports_op()
  spi: dt-bindings: spi-qpic-snand: Add ipq5210 compatible
This commit is contained in:
Linus Torvalds 2026-05-29 18:07:37 -07:00
commit f5e5d3509b
2 changed files with 12 additions and 4 deletions

View File

@ -25,6 +25,7 @@ properties:
- items:
- enum:
- qcom,ipq5018-snand
- qcom,ipq5210-snand
- qcom,ipq5332-snand
- qcom,ipq5424-snand
- const: qcom,ipq9574-snand

View File

@ -279,13 +279,20 @@ static bool spi_mem_internal_supports_op(struct spi_mem *mem,
*/
bool spi_mem_supports_op(struct spi_mem *mem, const struct spi_mem_op *op)
{
/* Make sure the operation frequency is correct before going futher */
spi_mem_adjust_op_freq(mem, (struct spi_mem_op *)op);
struct spi_mem_op eval_op = *op;
if (spi_mem_check_op(op))
/*
* Work on a local copy; this is a pure capability check and must
* not modify the caller's op. Stored templates with max_freq == 0
* must remain unset so their frequency is always re-capped to the
* current device maximum at execution time.
*/
spi_mem_adjust_op_freq(mem, &eval_op);
if (spi_mem_check_op(&eval_op))
return false;
return spi_mem_internal_supports_op(mem, op);
return spi_mem_internal_supports_op(mem, &eval_op);
}
EXPORT_SYMBOL_GPL(spi_mem_supports_op);