mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Christophe Leroy <christophe.leroy@csgroup.eu>
To: Mark Brown <broonie@kernel.org>, Jonas Gorski <jonas.gorski@gmail.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Herve Codina <herve.codina@bootlin.com>,
	Amit Kumar Mahapatra <amit.kumar-mahapatra@amd.com>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Thomas Petazzoni <thomas.petazzoni@bootlin.com>
Subject: Re: [PATCH] spi: Raise limit on number of chip selects
Date: Wed, 24 Jan 2024 15:28:32 +0000	[thread overview]
Message-ID: <bc19929e-8231-4bb6-bb36-555a68cb7335@csgroup.eu> (raw)
In-Reply-To: <38630519-733c-4598-97a7-19a5e6306513@sirena.org.uk>



Le 24/01/2024 à 15:59, Mark Brown a écrit :
> On Wed, Jan 24, 2024 at 02:41:03PM +0100, Jonas Gorski wrote:
> 
>> For some reason we don't store neither the actual number of supported
>> parallel chipselects in the controller, nor the amount of chipselects
>> used by the spi device, so all loops always  need to iterate
>> SPI_CS_CNT_MAX times and check for the chipselect numbers not being
>> 0xff instead of limiting by the (possible to know) actual number of
>> chip selects in use.
> 
> Yes, we really can do a lot better here if we keep a bit more data
> around.

When I see all those loops over SPI_CS_CNT_MAX I have the feeling it 
could have been done a lot easier, for instance by using bitmaps.

Should we revert that commit 4d8ff6b0991d ("spi: Add multi-cs memories 
support in SPI core") and implement something simpler ?

Also have the impression that the commit is doing several things at once 
and should have been split in several commits, for instance that 'if 
((of_property_read_bool(nc, "parallel-memories")) ' stuff seems 
unrelated to the implementation of the generic support of multi-chipselects.

Christophe

  reply	other threads:[~2024-01-24 15:28 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-22  1:21 Mark Brown
2024-01-22 22:07 ` Mark Brown
2024-01-23 11:04 ` Herve Codina
2024-01-23 13:18   ` Mark Brown
2024-01-23 13:26     ` Christophe Leroy
2024-01-23 13:53       ` Mark Brown
2024-01-23 16:50         ` Jonas Gorski
2024-01-23 17:47           ` Guenter Roeck
2024-01-24 13:41             ` Jonas Gorski
2024-01-24 14:35               ` David Laight
2024-01-24 14:59               ` Mark Brown
2024-01-24 15:28                 ` Christophe Leroy [this message]
2024-01-24 16:08                   ` 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=bc19929e-8231-4bb6-bb36-555a68cb7335@csgroup.eu \
    --to=christophe.leroy@csgroup.eu \
    --cc=amit.kumar-mahapatra@amd.com \
    --cc=broonie@kernel.org \
    --cc=herve.codina@bootlin.com \
    --cc=jonas.gorski@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=thomas.petazzoni@bootlin.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®