linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0
@ 2023-09-22 18:28 William A. Kennington III
  2023-10-02 15:41 ` Mark Brown
  0 siblings, 1 reply; 3+ messages in thread
From: William A. Kennington III @ 2023-09-22 18:28 UTC (permalink / raw)
  To: tmaimon77, tali.perry1, avifishman70, broonie, joel
  Cc: linux-spi, linux-kernel, William A. Kennington III

We don't want to use the value of ilog2(0) as dummy.buswidth is 0 when
dummy.nbytes is 0. Since we have no dummy bytes, we don't need to
configure the dummy byte bits per clock register value anyway.

Signed-off-by: William A. Kennington III <william@wkennington.com>
---
 drivers/spi/spi-npcm-fiu.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-npcm-fiu.c b/drivers/spi/spi-npcm-fiu.c
index 0ca21ff0e9cc..e42248519688 100644
--- a/drivers/spi/spi-npcm-fiu.c
+++ b/drivers/spi/spi-npcm-fiu.c
@@ -353,8 +353,9 @@ static int npcm_fiu_uma_read(struct spi_mem *mem,
 		uma_cfg |= ilog2(op->cmd.buswidth);
 		uma_cfg |= ilog2(op->addr.buswidth)
 			<< NPCM_FIU_UMA_CFG_ADBPCK_SHIFT;
-		uma_cfg |= ilog2(op->dummy.buswidth)
-			<< NPCM_FIU_UMA_CFG_DBPCK_SHIFT;
+		if (op->dummy.nbytes)
+			uma_cfg |= ilog2(op->dummy.buswidth)
+				<< NPCM_FIU_UMA_CFG_DBPCK_SHIFT;
 		uma_cfg |= ilog2(op->data.buswidth)
 			<< NPCM_FIU_UMA_CFG_RDBPCK_SHIFT;
 		uma_cfg |= op->dummy.nbytes << NPCM_FIU_UMA_CFG_DBSIZ_SHIFT;
-- 
2.42.0.515.g380fc7ccd1-goog


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0
  2023-09-22 18:28 [PATCH] spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0 William A. Kennington III
@ 2023-10-02 15:41 ` Mark Brown
       [not found]   ` <CAD_4BXgMp5-gdsmzbCsWu7Xn+cFC=pwRf=YvNDSK0mDP=se0fQ@mail.gmail.com>
  0 siblings, 1 reply; 3+ messages in thread
From: Mark Brown @ 2023-10-02 15:41 UTC (permalink / raw)
  To: tmaimon77, tali.perry1, avifishman70, joel, William A. Kennington III
  Cc: linux-spi, linux-kernel

On Fri, 22 Sep 2023 11:28:12 -0700, William A. Kennington III wrote:
> We don't want to use the value of ilog2(0) as dummy.buswidth is 0 when
> dummy.nbytes is 0. Since we have no dummy bytes, we don't need to
> configure the dummy byte bits per clock register value anyway.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0
      commit: 2ec8b010979036c2fe79a64adb6ecc0bd11e91d1

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0
       [not found]   ` <CAD_4BXgMp5-gdsmzbCsWu7Xn+cFC=pwRf=YvNDSK0mDP=se0fQ@mail.gmail.com>
@ 2023-10-09 22:52     ` Mark Brown
  0 siblings, 0 replies; 3+ messages in thread
From: Mark Brown @ 2023-10-09 22:52 UTC (permalink / raw)
  To: William Kennington
  Cc: avifishman70, joel, linux-kernel, linux-spi, tali.perry1, tmaimon77

[-- Attachment #1: Type: text/plain, Size: 737 bytes --]

On Mon, Oct 09, 2023 at 03:39:43PM -0700, William Kennington wrote:
> > All being well this means that it will be integrated into the linux-next
> > tree (usually sometime in the next 24 hours) and sent to Linus during
> > the next merge window (or sooner if it is a bug fix), however if
> > problems are discovered then the patch may be dropped or

> Should I have marked this as a fix? I realized this after the fact but I
> need this backported to stable tree in order for my spi device to not crash
> the kernel.

Yes, although given the way stable picks things up there's a good chance
they'll grab it anyway based on the changelog.  You can mail the stable
maintainers and ask for a backport once it hits Linus' tree to make
sure.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-10-09 22:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-22 18:28 [PATCH] spi: npcm-fiu: Fix UMA reads when dummy.nbytes == 0 William A. Kennington III
2023-10-02 15:41 ` Mark Brown
     [not found]   ` <CAD_4BXgMp5-gdsmzbCsWu7Xn+cFC=pwRf=YvNDSK0mDP=se0fQ@mail.gmail.com>
2023-10-09 22:52     ` Mark Brown

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).