All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Saravana Kannan <saravanak@google.com>
Cc: "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS"
	<devicetree@vger.kernel.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: fw_devlink on will break all snps,dw-apb-gpio users
Date: Thu, 15 Oct 2020 12:02:06 +0800	[thread overview]
Message-ID: <20201015120206.41b6a454@xhacker.debian> (raw)
In-Reply-To: <CAGETcx9PiX==mLxB9PO8Myyk6u2vhPVwTMsA5NkD-ywH5xhusw@mail.gmail.com>

On Wed, 14 Oct 2020 10:29:36 -0700
Saravana Kannan <saravanak@google.com> wrote:

> CAUTION: Email originated externally, do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> On Wed, Oct 14, 2020 at 4:12 AM Jisheng Zhang
> <Jisheng.Zhang@synaptics.com> wrote:
> >
> > Hi,
> >
> > If set fw_devlink as on, any consumers of dw apb gpio won't probe.
> >
> > The related dts looks like:
> >
> > gpio0: gpio@2400 {
> >        compatible = "snps,dw-apb-gpio";
> >        #address-cells = <1>;
> >        #size-cells = <0>;
> >
> >        porta: gpio-port@0 {
> >               compatible = "snps,dw-apb-gpio-port";
> >               gpio-controller;
> >               #gpio-cells = <2>;
> >               ngpios = <32>;
> >               reg = <0>;
> >        };
> > };
> >
> > device_foo {
> >         status = "okay"
> >         ...;
> >         reset-gpio = <&porta, 0, GPIO_ACTIVE_HIGH>;
> > };
> >
> > If I change the reset-gpio property to use another kind of gpio phandle,
> > e.g gpio expander, then device_foo can be probed successfully.
> >
> > The gpio expander dt node looks like:
> >
> >         expander3: gpio@44 {
> >                 compatible = "fcs,fxl6408";
> >                 pinctrl-names = "default";
> >                 pinctrl-0 = <&expander3_pmux>;
> >                 reg = <0x44>;
> >                 gpio-controller;
> >                 #gpio-cells = <2>;
> >                 interrupt-parent = <&portb>;
> >                 interrupts = <23 IRQ_TYPE_NONE>;
> >                 interrupt-controller;
> >                 #interrupt-cells = <2>;
> >         };
> >
> > The common pattern looks like the devlink can't cope with suppliers from
> > child dt node.  
> 
> fw_devlink doesn't have any problem dealing with child devices being
> suppliers. The problem with your case is that the
> drivers/gpio/gpio-dwapb.c driver directly parses the child nodes and
> never creates struct devices for them. If you have a node with
> compatible string, fw_devlink expects you to create and probe a struct
> device for it. So change your driver to add the child devices as
> devices instead of just parsing the node directly and doing stuff with
> it.
> 
> Either that, or stop putting "compatible" string in a node if you
> don't plan to actually treat it as a device -- but that's too late for
> this driver (it needs to be backward compatible). So change the driver
> to add of_platform_populate() and write a driver that probes
> "snps,dw-apb-gpio-port".
> 

Thanks for the information. The "snps,dw-apb-gpio-port" is never used,
so I just sent out a series to remove it.

Thanks

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

WARNING: multiple messages have this Message-ID (diff)
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Saravana Kannan <saravanak@google.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J. Wysocki" <rafael@kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Rob Herring <robh+dt@kernel.org>,
	Frank Rowand <frowand.list@gmail.com>,
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" 
	<devicetree@vger.kernel.org>,
	linux-arm-kernel <linux-arm-kernel@lists.infradead.org>
Subject: Re: fw_devlink on will break all snps,dw-apb-gpio users
Date: Thu, 15 Oct 2020 12:02:06 +0800	[thread overview]
Message-ID: <20201015120206.41b6a454@xhacker.debian> (raw)
In-Reply-To: <CAGETcx9PiX==mLxB9PO8Myyk6u2vhPVwTMsA5NkD-ywH5xhusw@mail.gmail.com>

On Wed, 14 Oct 2020 10:29:36 -0700
Saravana Kannan <saravanak@google.com> wrote:

> CAUTION: Email originated externally, do not click links or open attachments unless you recognize the sender and know the content is safe.
> 
> 
> On Wed, Oct 14, 2020 at 4:12 AM Jisheng Zhang
> <Jisheng.Zhang@synaptics.com> wrote:
> >
> > Hi,
> >
> > If set fw_devlink as on, any consumers of dw apb gpio won't probe.
> >
> > The related dts looks like:
> >
> > gpio0: gpio@2400 {
> >        compatible = "snps,dw-apb-gpio";
> >        #address-cells = <1>;
> >        #size-cells = <0>;
> >
> >        porta: gpio-port@0 {
> >               compatible = "snps,dw-apb-gpio-port";
> >               gpio-controller;
> >               #gpio-cells = <2>;
> >               ngpios = <32>;
> >               reg = <0>;
> >        };
> > };
> >
> > device_foo {
> >         status = "okay"
> >         ...;
> >         reset-gpio = <&porta, 0, GPIO_ACTIVE_HIGH>;
> > };
> >
> > If I change the reset-gpio property to use another kind of gpio phandle,
> > e.g gpio expander, then device_foo can be probed successfully.
> >
> > The gpio expander dt node looks like:
> >
> >         expander3: gpio@44 {
> >                 compatible = "fcs,fxl6408";
> >                 pinctrl-names = "default";
> >                 pinctrl-0 = <&expander3_pmux>;
> >                 reg = <0x44>;
> >                 gpio-controller;
> >                 #gpio-cells = <2>;
> >                 interrupt-parent = <&portb>;
> >                 interrupts = <23 IRQ_TYPE_NONE>;
> >                 interrupt-controller;
> >                 #interrupt-cells = <2>;
> >         };
> >
> > The common pattern looks like the devlink can't cope with suppliers from
> > child dt node.  
> 
> fw_devlink doesn't have any problem dealing with child devices being
> suppliers. The problem with your case is that the
> drivers/gpio/gpio-dwapb.c driver directly parses the child nodes and
> never creates struct devices for them. If you have a node with
> compatible string, fw_devlink expects you to create and probe a struct
> device for it. So change your driver to add the child devices as
> devices instead of just parsing the node directly and doing stuff with
> it.
> 
> Either that, or stop putting "compatible" string in a node if you
> don't plan to actually treat it as a device -- but that's too late for
> this driver (it needs to be backward compatible). So change the driver
> to add of_platform_populate() and write a driver that probes
> "snps,dw-apb-gpio-port".
> 

Thanks for the information. The "snps,dw-apb-gpio-port" is never used,
so I just sent out a series to remove it.

Thanks

  reply	other threads:[~2020-10-15  4:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-14 11:12 fw_devlink on will break all snps,dw-apb-gpio users Jisheng Zhang
2020-10-14 11:12 ` Jisheng Zhang
2020-10-14 17:29 ` Saravana Kannan
2020-10-14 17:29   ` Saravana Kannan
2020-10-15  4:02   ` Jisheng Zhang [this message]
2020-10-15  4:02     ` Jisheng Zhang
2020-10-15  5:04     ` Saravana Kannan
2020-10-15  5:04       ` Saravana Kannan
2020-10-15  8:14       ` Jisheng Zhang
2020-10-15  8:14         ` Jisheng Zhang
2020-10-15  8:48         ` Saravana Kannan
2020-10-15  8:48           ` Saravana Kannan
2020-10-15  9:52           ` Jisheng Zhang
2020-10-15  9:52             ` Jisheng Zhang
2020-10-15 14:08             ` Robin Murphy
2020-10-15 14:08               ` Robin Murphy
2020-10-16  3:39               ` Jisheng Zhang
2020-10-16  3:39                 ` Jisheng Zhang
2020-10-17  0:44                 ` Saravana Kannan
2020-10-17  0:44                   ` Saravana Kannan

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=20201015120206.41b6a454@xhacker.debian \
    --to=jisheng.zhang@synaptics.com \
    --cc=devicetree@vger.kernel.org \
    --cc=frowand.list@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rafael@kernel.org \
    --cc=robh+dt@kernel.org \
    --cc=saravanak@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.