From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Felipe Balbi <balbi@kernel.org>,
linux-samsung-soc@vger.kernel.org,
Neil Armstrong <narmstrong@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Kevin Hilman <khilman@baylibre.com>,
linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
Andy Gross <agross@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Patrice Chotard <patrice.chotard@st.com>,
Kukjin Kim <kgene@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org,
Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: [PATCH usb-next] usb: dwc3: Use devm_of_platform_populate
Date: Mon, 9 Nov 2020 19:12:57 +0800 [thread overview]
Message-ID: <20201109191257.1074ad74@xhacker.debian> (raw)
In-Reply-To: <20201109103414.GF1559@shell.armlinux.org.uk>
On Mon, 9 Nov 2020 10:34:14 +0000 Russell King - ARM Linux admin wrote:
>
>
> On Mon, Nov 09, 2020 at 09:59:53AM +0800, Jisheng Zhang wrote:
> > diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
> > index 417e05381b5d..83015bb7b926 100644
> > --- a/drivers/usb/dwc3/dwc3-meson-g12a.c
> > +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
> > @@ -702,7 +702,6 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
> > {
> > struct dwc3_meson_g12a *priv;
> > struct device *dev = &pdev->dev;
> > - struct device_node *np = dev->of_node;
> > void __iomem *base;
> > int ret, i;
> >
> > @@ -794,7 +793,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
> > goto err_phys_power;
> > }
> >
> > - ret = of_platform_populate(np, NULL, NULL, dev);
> > + ret = devm_of_platform_populate(dev);
> > if (ret)
> > goto err_phys_power;
> >
> > @@ -832,8 +831,6 @@ static int dwc3_meson_g12a_remove(struct platform_device *pdev)
> > if (priv->drvdata->otg_switch_supported)
> > usb_role_switch_unregister(priv->role_switch);
> >
> > - of_platform_depopulate(dev);
> > -
> > for (i = 0 ; i < PHY_COUNT ; ++i) {
> > phy_power_off(priv->phys[i]);
> > phy_exit(priv->phys[i]);
>
> Does it matter that the order that things happen in
> dwc3_meson_g12a_remove() is changed as a result of your patch? Was
> the code relying on the platform devices being depopulated before
> powering off the PHYs?
...
>
> Same here... and for anywhere else in this patch that you're deleting
> a of_platform_depopulate().
oops, good question! I believe it's not safe to move the depopulate after
the phy_* APIs.
So please ignore this patch.
>
> You effectively are moving the call to of_platform_depopulate() *after*
> the driver's .remove function has been called.
>
> --
>
_______________________________________________
linux-amlogic mailing list
linux-amlogic@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-amlogic
WARNING: multiple messages have this Message-ID (diff)
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Felipe Balbi <balbi@kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Kukjin Kim <kgene@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Kevin Hilman <khilman@baylibre.com>,
Neil Armstrong <narmstrong@baylibre.com>,
Jerome Brunet <jbrunet@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Andy Gross <agross@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Patrice Chotard <patrice.chotard@st.com>,
linux-samsung-soc@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH usb-next] usb: dwc3: Use devm_of_platform_populate
Date: Mon, 9 Nov 2020 19:12:57 +0800 [thread overview]
Message-ID: <20201109191257.1074ad74@xhacker.debian> (raw)
In-Reply-To: <20201109103414.GF1559@shell.armlinux.org.uk>
On Mon, 9 Nov 2020 10:34:14 +0000 Russell King - ARM Linux admin wrote:
>
>
> On Mon, Nov 09, 2020 at 09:59:53AM +0800, Jisheng Zhang wrote:
> > diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
> > index 417e05381b5d..83015bb7b926 100644
> > --- a/drivers/usb/dwc3/dwc3-meson-g12a.c
> > +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
> > @@ -702,7 +702,6 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
> > {
> > struct dwc3_meson_g12a *priv;
> > struct device *dev = &pdev->dev;
> > - struct device_node *np = dev->of_node;
> > void __iomem *base;
> > int ret, i;
> >
> > @@ -794,7 +793,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
> > goto err_phys_power;
> > }
> >
> > - ret = of_platform_populate(np, NULL, NULL, dev);
> > + ret = devm_of_platform_populate(dev);
> > if (ret)
> > goto err_phys_power;
> >
> > @@ -832,8 +831,6 @@ static int dwc3_meson_g12a_remove(struct platform_device *pdev)
> > if (priv->drvdata->otg_switch_supported)
> > usb_role_switch_unregister(priv->role_switch);
> >
> > - of_platform_depopulate(dev);
> > -
> > for (i = 0 ; i < PHY_COUNT ; ++i) {
> > phy_power_off(priv->phys[i]);
> > phy_exit(priv->phys[i]);
>
> Does it matter that the order that things happen in
> dwc3_meson_g12a_remove() is changed as a result of your patch? Was
> the code relying on the platform devices being depopulated before
> powering off the PHYs?
...
>
> Same here... and for anywhere else in this patch that you're deleting
> a of_platform_depopulate().
oops, good question! I believe it's not safe to move the depopulate after
the phy_* APIs.
So please ignore this patch.
>
> You effectively are moving the call to of_platform_depopulate() *after*
> the driver's .remove function has been called.
>
> --
>
WARNING: multiple messages have this Message-ID (diff)
From: Jisheng Zhang <Jisheng.Zhang@synaptics.com>
To: Russell King - ARM Linux admin <linux@armlinux.org.uk>
Cc: Felipe Balbi <balbi@kernel.org>,
linux-samsung-soc@vger.kernel.org,
Neil Armstrong <narmstrong@baylibre.com>,
Martin Blumenstingl <martin.blumenstingl@googlemail.com>,
Kevin Hilman <khilman@baylibre.com>,
linux-arm-msm@vger.kernel.org, linux-usb@vger.kernel.org,
Andy Gross <agross@kernel.org>,
Krzysztof Kozlowski <krzk@kernel.org>,
Bjorn Andersson <bjorn.andersson@linaro.org>,
Patrice Chotard <patrice.chotard@st.com>,
Kukjin Kim <kgene@kernel.org>,
linux-arm-kernel@lists.infradead.org,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
linux-amlogic@lists.infradead.org, linux-omap@vger.kernel.org,
linux-kernel@vger.kernel.org,
Jerome Brunet <jbrunet@baylibre.com>
Subject: Re: [PATCH usb-next] usb: dwc3: Use devm_of_platform_populate
Date: Mon, 9 Nov 2020 19:12:57 +0800 [thread overview]
Message-ID: <20201109191257.1074ad74@xhacker.debian> (raw)
In-Reply-To: <20201109103414.GF1559@shell.armlinux.org.uk>
On Mon, 9 Nov 2020 10:34:14 +0000 Russell King - ARM Linux admin wrote:
>
>
> On Mon, Nov 09, 2020 at 09:59:53AM +0800, Jisheng Zhang wrote:
> > diff --git a/drivers/usb/dwc3/dwc3-meson-g12a.c b/drivers/usb/dwc3/dwc3-meson-g12a.c
> > index 417e05381b5d..83015bb7b926 100644
> > --- a/drivers/usb/dwc3/dwc3-meson-g12a.c
> > +++ b/drivers/usb/dwc3/dwc3-meson-g12a.c
> > @@ -702,7 +702,6 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
> > {
> > struct dwc3_meson_g12a *priv;
> > struct device *dev = &pdev->dev;
> > - struct device_node *np = dev->of_node;
> > void __iomem *base;
> > int ret, i;
> >
> > @@ -794,7 +793,7 @@ static int dwc3_meson_g12a_probe(struct platform_device *pdev)
> > goto err_phys_power;
> > }
> >
> > - ret = of_platform_populate(np, NULL, NULL, dev);
> > + ret = devm_of_platform_populate(dev);
> > if (ret)
> > goto err_phys_power;
> >
> > @@ -832,8 +831,6 @@ static int dwc3_meson_g12a_remove(struct platform_device *pdev)
> > if (priv->drvdata->otg_switch_supported)
> > usb_role_switch_unregister(priv->role_switch);
> >
> > - of_platform_depopulate(dev);
> > -
> > for (i = 0 ; i < PHY_COUNT ; ++i) {
> > phy_power_off(priv->phys[i]);
> > phy_exit(priv->phys[i]);
>
> Does it matter that the order that things happen in
> dwc3_meson_g12a_remove() is changed as a result of your patch? Was
> the code relying on the platform devices being depopulated before
> powering off the PHYs?
...
>
> Same here... and for anywhere else in this patch that you're deleting
> a of_platform_depopulate().
oops, good question! I believe it's not safe to move the depopulate after
the phy_* APIs.
So please ignore this patch.
>
> You effectively are moving the call to of_platform_depopulate() *after*
> the driver's .remove function has been called.
>
> --
>
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2020-11-09 11:13 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-11-09 1:59 [PATCH usb-next] usb: dwc3: Use devm_of_platform_populate Jisheng Zhang
2020-11-09 1:59 ` Jisheng Zhang
2020-11-09 1:59 ` Jisheng Zhang
2020-11-09 10:34 ` Russell King - ARM Linux admin
2020-11-09 10:34 ` Russell King - ARM Linux admin
2020-11-09 10:34 ` Russell King - ARM Linux admin
2020-11-09 11:12 ` Jisheng Zhang [this message]
2020-11-09 11:12 ` Jisheng Zhang
2020-11-09 11:12 ` Jisheng Zhang
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=20201109191257.1074ad74@xhacker.debian \
--to=jisheng.zhang@synaptics.com \
--cc=agross@kernel.org \
--cc=balbi@kernel.org \
--cc=bjorn.andersson@linaro.org \
--cc=gregkh@linuxfoundation.org \
--cc=jbrunet@baylibre.com \
--cc=kgene@kernel.org \
--cc=khilman@baylibre.com \
--cc=krzk@kernel.org \
--cc=linux-amlogic@lists.infradead.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=linux-samsung-soc@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=martin.blumenstingl@googlemail.com \
--cc=narmstrong@baylibre.com \
--cc=patrice.chotard@st.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.