From: Tharun Kumar P <tharunkumar.pasumarthi@microchip.com>
To: <linux-spi@vger.kernel.org>
Cc: <linux-kernel@vger.kernel.org>, <broonie@kernel.org>
Subject: [PATCH SPI for-next 1/3] spi: mchp-pci1xxxx: Fix length of SPI transactions not set properly in driver
Date: Tue, 4 Apr 2023 22:46:11 +0530 [thread overview]
Message-ID: <20230404171613.1336093-2-tharunkumar.pasumarthi@microchip.com> (raw)
In-Reply-To: <20230404171613.1336093-1-tharunkumar.pasumarthi@microchip.com>
In pci1xxxx_spi_transfer_one API, length of SPI transaction gets cleared
by setting of length mask. Set length of transaction only after masking
length field.
Fixes: 1cc0cbea7167 ("spi: microchip: pci1xxxx: Add driver for SPI controller of PCI1XXXX PCIe switch")
Signed-off-by: Tharun Kumar P <tharunkumar.pasumarthi@microchip.com>
---
drivers/spi/spi-pci1xxxx.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/spi/spi-pci1xxxx.c b/drivers/spi/spi-pci1xxxx.c
index 1c5731641a04..419a1d3a5c2e 100644
--- a/drivers/spi/spi-pci1xxxx.c
+++ b/drivers/spi/spi-pci1xxxx.c
@@ -199,8 +199,9 @@ static int pci1xxxx_spi_transfer_one(struct spi_controller *spi_ctlr,
else
regval &= ~SPI_MST_CTL_MODE_SEL;
- regval |= ((clkdiv << 5) | SPI_FORCE_CE | (len << 8));
+ regval |= ((clkdiv << 5) | SPI_FORCE_CE);
regval &= ~SPI_MST_CTL_CMD_LEN_MASK;
+ regval |= (len << 8);
writel(regval, par->reg_base +
SPI_MST_CTL_REG_OFFSET(p->hw_inst));
regval = readl(par->reg_base +
--
2.25.1
next prev parent reply other threads:[~2023-04-04 17:17 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-04 17:16 [PATCH SPI for-next 0/3] spi: mchp-pci1xxxx: Fix minor bugs in spi-pci1xxxx driver Tharun Kumar P
2023-04-04 17:16 ` Tharun Kumar P [this message]
2023-04-04 17:16 ` [PATCH SPI for-next 2/3] spi: mchp-pci1xxxx: Fix SPI transactions not working after suspend and resume Tharun Kumar P
2023-04-04 17:16 ` [PATCH SPI for-next 3/3] spi: mchp-pci1xxxx: Fix improper implementation of disabling chip select lines Tharun Kumar P
2023-04-05 13:43 ` [PATCH SPI for-next 0/3] spi: mchp-pci1xxxx: Fix minor bugs in spi-pci1xxxx driver Mark Brown
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=20230404171613.1336093-2-tharunkumar.pasumarthi@microchip.com \
--to=tharunkumar.pasumarthi@microchip.com \
--cc=broonie@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.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).