mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Conor Dooley <conor@kernel.org>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Cc: Prajna Rajendra Kumar <prajna.rajendrakumar@microchip.com>,
	Mark Brown <broonie@kernel.org>,
	david laight <david.laight@runbox.com>,
	linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org,
	Conor Dooley - M52691 <Conor.Dooley@microchip.com>
Subject: Re: [PATCH v2 2/6] spi: microchip-core: Refactor FIFO read and write handlers
Date: Thu, 27 Nov 2025 18:05:04 +0000	[thread overview]
Message-ID: <20251127-pliable-magnetism-c59c560e49ad@spud> (raw)
In-Reply-To: <aSiBF9nStZzUNGLA@smile.fi.intel.com>

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

On Thu, Nov 27, 2025 at 06:49:27PM +0200, Andy Shevchenko wrote:
> On Thu, Nov 27, 2025 at 04:08:25PM +0000, Prajna Rajendra Kumar wrote:
> > On 26/11/2025 12:13, Andy Shevchenko wrote:
> > > On Wed, Nov 26, 2025 at 12:05:22PM +0000, Mark Brown wrote:
> > > > On Wed, Nov 26, 2025 at 09:21:45AM +0000, david laight wrote:
> 
> ...
> 
> > > > > I'm not sure I don't prefer the version with one writeb() call.
> > > > > How about:
> > > > >              writeb(spi->tx_buf ? *spi->tx_buf++ : 0xaa,
> > > > >                      spi->regs + MCHP_CORESPI_REG_TXDATA);
> > > > Please don't abuse the ternery operator like this, just write normal
> > > > conditional statements.
> > > FWIW, that's what my patch does already :-)
> > 
> > Thanks for the series. However, this particular patch appears to
> > introduce a regression. The SPI controller reads an incorrect
> > Device ID from the peripheral.
> 
> Hmm... This is interesting. The only thing I see is missed dummy byte read in
> case of TX only transfers. Is this what you have?

Seems very likely, the hardware is pretty simple, so it has no concept
of whether bytes it receives are useful or any ability to operate on
transfers and discard data from the FIFOs when a new one starts. That's
why the unconditional read is there to make sure the rx FIFO is kept in
sync.

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

  parent reply	other threads:[~2025-11-27 18:05 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-26  7:54 [PATCH v2 0/6] spi: microchip-core: Code improvements Andy Shevchenko
2025-11-26  7:54 ` [PATCH v2 1/6] spi: microchip-core: use min() instead of min_t() Andy Shevchenko
2025-11-26  9:22   ` david laight
2025-11-27 15:55     ` Prajna Rajendra Kumar
2025-11-26  7:54 ` [PATCH v2 2/6] spi: microchip-core: Refactor FIFO read and write handlers Andy Shevchenko
2025-11-26  9:21   ` david laight
2025-11-26 11:17     ` Andy Shevchenko
2025-11-26 12:05     ` Mark Brown
2025-11-26 12:13       ` Andy Shevchenko
2025-11-27 16:08         ` Prajna Rajendra Kumar
2025-11-27 16:49           ` Andy Shevchenko
2025-11-27 16:50             ` Andy Shevchenko
2025-11-27 18:05             ` Conor Dooley [this message]
2025-11-27 19:01               ` Andy Shevchenko
2025-11-26  7:54 ` [PATCH v2 3/6] spi: microchip-core: Replace dead code (-ENOMEM error message) Andy Shevchenko
2025-11-27 15:58   ` Prajna Rajendra Kumar
2025-11-26  7:54 ` [PATCH v2 4/6] spi: microchip-core: Utilise temporary variable for struct device Andy Shevchenko
2025-11-27 15:59   ` Prajna Rajendra Kumar
2025-11-26  7:54 ` [PATCH v2 5/6] spi: microchip-core: Use SPI_MODE_X_MASK Andy Shevchenko
2025-11-27 16:00   ` Prajna Rajendra Kumar
2025-11-26  7:54 ` [PATCH v2 6/6] spi: microchip-core: Remove unneeded PM related macro Andy Shevchenko
2025-11-27 16:01   ` Prajna Rajendra Kumar
2025-11-28 18:01 ` (subset) [PATCH v2 0/6] spi: microchip-core: Code improvements 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=20251127-pliable-magnetism-c59c560e49ad@spud \
    --to=conor@kernel.org \
    --cc=Conor.Dooley@microchip.com \
    --cc=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=david.laight@runbox.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=prajna.rajendrakumar@microchip.com \
    /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

all inboxes | Powered by JetHome®