linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard@bootlin.com>
To: Michael Nazzareno Trimarchi <michael@amarulasolutions.com>
Cc: Mark Rutland <mark.rutland@arm.com>,
	devicetree <devicetree@vger.kernel.org>,
	linux-sunxi <linux-sunxi@googlegroups.com>,
	LKML <linux-kernel@vger.kernel.org>, Chen-Yu Tsai <wens@csie.org>,
	Rob Herring <robh+dt@kernel.org>,
	Jagan Teki <jagan@amarulasolutions.com>,
	linux-amarula <linux-amarula@amarulasolutions.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH] arm64: dts: allwinner: a64-oceanic-5205-5inmfd: Enable CAN
Date: Thu, 23 May 2019 22:54:50 +0200	[thread overview]
Message-ID: <20190523205450.bwccpvehpiugogbs@flea> (raw)
In-Reply-To: <CAOf5uwnhXjur=2NezCydaCxP5d33S+AwdD9WTDtp2EUJr4UTgg@mail.gmail.com>

Hi Michael,

On Tue, May 21, 2019 at 01:08:09PM +0200, Michael Nazzareno Trimarchi wrote:
> On Tue, May 21, 2019 at 10:10 AM Maxime Ripard
> <maxime.ripard@bootlin.com> wrote:
> >
> > On Tue, May 21, 2019 at 08:47:02AM +0200, Michael Nazzareno Trimarchi wrote:
> > > > > +     };
> > > > > +
> > > > >  };
> > > > >
> > > > >  &ehci0 {
> > > > > @@ -77,6 +95,31 @@
> > > > >       status = "okay";
> > > > >  };
> > > > >
> > > > > +&pio {
> > > > > +     can_pins: can-pins {
> > > > > +             pins = "PD6",                   /* RX_BUF1_CAN0 */
> > > > > +                    "PD7";                   /* RX_BUF0_CAN0 */
> > > > > +             function = "gpio_in";
> > > > > +     };
> > > > > +};
> > > >
> > > > That isn't needed. What are they used for, you're not tying them to
> > > > anything?
> > >
> > > Mux of their function is correct. They are connected in the schematics
> > > but not used right now.
> >
> > Then describe the whole thing or don't?
> >
>
> Ok
>
> > And that's kind of missing my point. If that pin group isn't related
> > to any device, the pin muxing will not be changed. So that group, in
> > itself, has strictly no effect.
> >
> > Moreover, you don't need a pin group in the first place to mux pins in
> > GPIOs, the GPIO API will make sure that is the case when you request
> > it.
>
> This is correct on sunxi. Is this valid for sunxi or in general in
> all the SoC?

IIRC, it happens on all the SoCs that have a shared GPIO/pinctrl
driver.

> Anyway make sense to have pins configured and place in the right
> state, just suppose if the booting stage is wrong or anything that
> make those pins in the wrong configuration

It would be a bug in the pinctrl / GPIO code that would need to be
fixed.

> >
> > > I can garantee that kernel wlll always configurred in the right way
> > > and if I want I can export in userspace
> > > for debug purpose
>
> Correct if you start to use it but if you want them right configured
> the right place is in the default state e/o initstate if this can be
> a problem of the hardware

What problem do you have exactly?

> Default state: the state the pinctrl handle shall be put
>  *      into as default, usually this means the pins are up and ready to
>  *      be used by the device driver. This state is commonly used by
>  *      hogs to configure muxing and pins at boot, and also as a state
>  *      to go into when returning from sleep and idle in
>  *      .pm_runtime_resume() or ordinary .resume() for example.
>
> Now the pins are connected to the canbus as should be and they are
> configured and usually put in the right state.

As soon as you call gpio_get, the pins will be configured properly.

And, pinctrl shouldn't allow that configuration (gpio_get + a pinctrl
node for GPIOs) in our case. We do on most SoCs (all but the H6) for
historical reasons, but this creates other bugs that we can't really
fix right now. Still, we're slowly removing all of those pinctrl
nodes, so it's not really to add new ones.

> +               compatible = "microchip,mcp2515";
> +               reg = <0>;
> +               spi-max-frequency = <10000000>;
> +               pinctrl-names = "default";
> +               pinctrl-0 = <&can_pins>;
>
> >
> > Yes, because the API does it, not your change
>
> Do you prefer to drop the pinmux? or update the commit message

Drop the pinctrl group

Maxime

--
Maxime Ripard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

      reply	other threads:[~2019-05-23 20:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-18 14:16 [PATCH] arm64: dts: allwinner: a64-oceanic-5205-5inmfd: Enable CAN Jagan Teki
2019-04-18 14:56 ` Maxime Ripard
2019-05-21  6:47   ` Michael Nazzareno Trimarchi
2019-05-21  8:10     ` Maxime Ripard
2019-05-21 11:08       ` Michael Nazzareno Trimarchi
2019-05-23 20:54         ` Maxime Ripard [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=20190523205450.bwccpvehpiugogbs@flea \
    --to=maxime.ripard@bootlin.com \
    --cc=devicetree@vger.kernel.org \
    --cc=jagan@amarulasolutions.com \
    --cc=linux-amarula@amarulasolutions.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sunxi@googlegroups.com \
    --cc=mark.rutland@arm.com \
    --cc=michael@amarulasolutions.com \
    --cc=robh+dt@kernel.org \
    --cc=wens@csie.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).