From: Linus Walleij <linus.walleij@linaro.org>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: linux-spi <linux-spi@vger.kernel.org>,
Mark Brown <broonie@kernel.org>,
Fabio Estevam <festevam@gmail.com>,
"open list:GPIO SUBSYSTEM" <linux-gpio@vger.kernel.org>
Subject: Re: Boot failure with 5.4-rc5, bisected to 0f0581b24bd0 ("spi: fsl: Convert to use CS GPIO descriptors")
Date: Wed, 27 Nov 2019 14:00:27 +0100 [thread overview]
Message-ID: <CACRpkdb15n4DpxAGEw+Av89XZDxi7Amh1XEyJEzWBd4tet7C2Q@mail.gmail.com> (raw)
In-Reply-To: <748eb503-b692-6d30-bc5e-94539a939b06@c-s.fr>
On Wed, Nov 27, 2019 at 1:05 PM Christophe Leroy
<christophe.leroy@c-s.fr> wrote:
> Le 27/11/2019 à 11:55, Linus Walleij a écrit :
> > That's weird, because when ->use_gpio_descriptors is set
> > (as for this driver) the core only attempts to look up
> > spi->cs_gpiods and not spi->cs_gpios, and consequently
> > can only assign spi->cd_gpiod and not spi->cs_gpio:
>
> That's it. ->use_gpio_descriptors isn't set for the FSL driver:
Oh, my coding mistake. :(
And an especially stupid one too. OK I make a separate patch
in the series to fix that too.
> I have now added it, together with the DTS cs-gpios name change (without
> your counting patch with crashes), and I get something which is almost
> working: I get temperature back into sensors, but temperature is 0°C !!!
OK we almost fixed it I think. It is probably better to test with
all three patches (will send out soon) that rely on the gpiolib
to do appropriate counting of the gpiod's and so on.
> Looking into dmesg, I see:
>
> [ 3.153521] lm74@1 GPIO handle specifies active low - ignored
> [ 3.178093] lm74@5 GPIO handle specifies active low - ignored
>
> Any link with the problem ?
This is because your GPIO handles look like this:
gpios = <&CPM1_PIO_C 4 1 /* SICOFI 1 */
&CPM1_PIO_B 23 1 /* TEMP MCR */
&CPM1_PIO_C 8 1 /* SICOFI 2 */
&CPM1_PIO_C 12 1 /* EEPROM MIAE */
&CPM1_PIO_D 6 1 /* SICOFI 3 */
&CPM1_PIO_B 14 1 /* TEMP MPC885 */
&CPM1_PIO_B 21 1 /* EEPROM CMPC885 */
&FAV_CS_SPI 0 1 /* FAV SPI */
&FAV_CS_SPI 2 1>; /* FAV POSTE FPGA */
That "1" at the end of each GPIO phandle means "active low"
as can be seen in <dt-bindings/gpio/gpio.h>
/* Bit 0 express polarity */
#define GPIO_ACTIVE_HIGH 0
#define GPIO_ACTIVE_LOW 1
But your child nodes look like this:
sicofi@0 {
compatible = "infineon,sicofi";
spi-max-frequency = <1000000>;
reg = <0>;
spi-cs-high;
spi-cpha;
};
lm74@1 {
compatible = "ns,lm74";
spi-max-frequency = <1000000>;
reg = <1>;
spi-cs-high;
};
And the spi-cs-high in the child node takes precedence.
That's a bit ambigous so that is what the warning is about.
Try to remove the "spi-cs-high" bool flag from your nodes,
because it seems like the old code was ignoring them.
Does that solve the problem?
Yours,
Linus Walleij
next prev parent reply other threads:[~2019-11-27 13:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-08 12:33 Boot failure with 5.4-rc5, bisected to 0f0581b24bd0 ("spi: fsl: Convert to use CS GPIO descriptors") Christophe Leroy
2019-11-08 13:09 ` Linus Walleij
2019-11-08 13:34 ` Christophe Leroy
2019-11-26 15:01 ` Christophe Leroy
2019-11-26 15:35 ` Fabio Estevam
2019-11-26 16:16 ` Christophe Leroy
2019-11-26 16:23 ` Mark Brown
2019-11-26 15:48 ` Linus Walleij
2019-11-26 19:08 ` Christophe Leroy
2019-11-26 19:14 ` Christophe Leroy
2019-11-27 8:26 ` Linus Walleij
2019-11-27 8:57 ` Christophe Leroy
2019-11-27 9:07 ` Christophe Leroy
2019-11-27 9:11 ` Linus Walleij
2019-11-27 9:34 ` Christophe Leroy
2019-11-27 10:02 ` Linus Walleij
2019-11-27 10:39 ` Christophe Leroy
2019-11-27 10:55 ` Linus Walleij
2019-11-27 12:04 ` Christophe Leroy
2019-11-27 13:00 ` Linus Walleij [this message]
2019-11-27 13:44 ` Christophe Leroy
2019-11-27 13:52 ` Linus Walleij
2019-11-27 13:54 ` Christophe Leroy
2019-11-27 13:56 ` Linus Walleij
2019-11-27 14:29 ` Christophe Leroy
2019-11-28 8:42 ` Linus Walleij
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=CACRpkdb15n4DpxAGEw+Av89XZDxi7Amh1XEyJEzWBd4tet7C2Q@mail.gmail.com \
--to=linus.walleij@linaro.org \
--cc=broonie@kernel.org \
--cc=christophe.leroy@c-s.fr \
--cc=festevam@gmail.com \
--cc=linux-gpio@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).