linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Charles Keepax <ckeepax@opensource.cirrus.com>
To: Sven Van Asbroeck <thesven73@gmail.com>
Cc: Mark Brown <broonie@kernel.org>,
	Linus Walleij <linus.walleij@linaro.org>,
	Jonathan Cameron <jonathan.cameron@huawei.com>,
	Lukas Wunner <lukas@wunner.de>,
	linux-spi <linux-spi@vger.kernel.org>,
	Simon Han <z.han@kunbus.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v1] spi: fix client driver breakages when using GPIO descriptors
Date: Thu, 12 Nov 2020 11:41:36 +0000	[thread overview]
Message-ID: <20201112114136.GE10899@ediswmail.ad.cirrus.com> (raw)
In-Reply-To: <CAGngYiVAdPSCEQm5pJdFQ+3VpwNH1vGD6rPNK1_SQK3Uvfbt5A@mail.gmail.com>

On Wed, Nov 11, 2020 at 11:24:14AM -0500, Sven Van Asbroeck wrote:
> On Wed, Nov 11, 2020 at 10:48 AM Mark Brown <broonie@kernel.org> wrote:
> >
> > Applied to
> >
> >    https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
> 
> Thank you !
> 
> Now that our minds are still focused on this subject, should
> commit 138c9c32f090 ("spi: spidev: Fix CS polarity if GPIO descriptors
> are used")
> be reverted?
> 
> This fixed spidev to deal with SPI_CS_HIGH on gpiod.
> But after our fix, its behaviour will probably be broken again.
> 
> Another candidate for revert is
> commit ada9e3fcc175 ("spi: dw: Correct handling of native chipselect")
> although I don't understand that code well enough to be sure.
> 
> Adding Charles Keepax.

Looks like the code has changed a fair amount since my patch. The
important detail from it was trying to clarify the semantics of the
controller->set_cs callback. That function is called with a boolean
argument and that argument could have two possible meanings:

1) True means apply a high logic level to the chip select line.
2) True mean apply chip select.

Under interpretation 2) the chip select line would be set to a
different logic level depending on if the device is active high or
active low.

If I remember correctly at the point of my patch the core had just
changed between the two a couple of times but now consistently did 1)
(and looks like it still does), my patch intended to updated the
spi-dw driver to match that, as my SPI had stopped working. I think
it then turned out, my patch broke some other use-cases and that
the bit in the IP basically had 2) semantics in hardware. Which is
what this patch fixed:

commit 9aea644ca17b ("spi: dw: Fix native CS being unset")

After that patch my patch is mostly replaced so I don't think it
would make any sense to revert my patch at this point, and I
don't think your patch will break the spi-dw driver. I don't
have easy access to the hardware right now to test, but I will
give it is quick run when that option becomes available to me
again.

Your fix looks good to me, but I suspect you do need to fix the
spidev stuff although I have haven't looked at that in detail.

Thanks,
Charles

      parent reply	other threads:[~2020-11-12 11:47 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-06 15:07 [PATCH v1] spi: fix client driver breakages when using GPIO descriptors Sven Van Asbroeck
2020-11-09 14:25 ` Andy Shevchenko
2020-11-09 14:41   ` Sven Van Asbroeck
2020-11-11  1:05     ` Linus Walleij
2020-11-11 12:33       ` Mark Brown
2020-11-11 13:36         ` Linus Walleij
2020-11-16 21:06           ` Mark Brown
2020-11-18  1:03             ` Linus Walleij
2020-11-18 11:40               ` Mark Brown
2020-11-24 15:21                 ` Linus Walleij
2020-11-24 16:40                   ` Mark Brown
2020-11-25  9:19                 ` Grant Likely
2020-11-25  9:17           ` Grant Likely
2020-11-11  1:08 ` Linus Walleij
2020-11-11 15:48 ` Mark Brown
2020-11-11 16:24   ` Sven Van Asbroeck
2020-11-11 16:32     ` Mark Brown
2020-11-12 11:41     ` Charles Keepax [this message]

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=20201112114136.GE10899@ediswmail.ad.cirrus.com \
    --to=ckeepax@opensource.cirrus.com \
    --cc=broonie@kernel.org \
    --cc=jonathan.cameron@huawei.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=lukas@wunner.de \
    --cc=thesven73@gmail.com \
    --cc=z.han@kunbus.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;
as well as URLs for NNTP newsgroup(s).