* [PATCH] Revert "usb: dwc3: qcom: Constify the software node"
@ 2021-03-11 9:00 Shawn Guo
2021-03-11 9:11 ` Heikki Krogerus
0 siblings, 1 reply; 3+ messages in thread
From: Shawn Guo @ 2021-03-11 9:00 UTC (permalink / raw)
To: Felipe Balbi
Cc: Bjorn Andersson, Heikki Krogerus, Greg Kroah-Hartman,
linux-arm-msm, linux-usb, Shawn Guo
This reverts commit 8dc6e6dd1bee39cd65a232a17d51240fc65a0f4a.
The commit causes an regression for ACPI probe on Lenovo Yoga C630
laptop. platform_device_add_properties() will fail with -EEXIST for the
second USB instance, because of the software_node_to_swnode() check in
function software_node_register().
Signed-off-by: Shawn Guo <shawn.guo@linaro.org>
---
drivers/usb/dwc3/dwc3-qcom.c | 12 +++---------
1 file changed, 3 insertions(+), 9 deletions(-)
diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index 0c11e45bccaf..7dc74885a635 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -570,10 +570,6 @@ static const struct property_entry dwc3_qcom_acpi_properties[] = {
{}
};
-static const struct software_node dwc3_qcom_swnode = {
- .properties = dwc3_qcom_acpi_properties,
-};
-
static int dwc3_qcom_acpi_register_core(struct platform_device *pdev)
{
struct dwc3_qcom *qcom = platform_get_drvdata(pdev);
@@ -620,17 +616,16 @@ static int dwc3_qcom_acpi_register_core(struct platform_device *pdev)
goto out;
}
- ret = device_add_software_node(&qcom->dwc3->dev, &dwc3_qcom_swnode);
+ ret = platform_device_add_properties(qcom->dwc3,
+ dwc3_qcom_acpi_properties);
if (ret < 0) {
dev_err(&pdev->dev, "failed to add properties\n");
goto out;
}
ret = platform_device_add(qcom->dwc3);
- if (ret) {
+ if (ret)
dev_err(&pdev->dev, "failed to add device\n");
- device_remove_software_node(&qcom->dwc3->dev);
- }
out:
kfree(child_res);
@@ -845,7 +840,6 @@ static int dwc3_qcom_remove(struct platform_device *pdev)
struct device *dev = &pdev->dev;
int i;
- device_remove_software_node(&qcom->dwc3->dev);
of_platform_depopulate(dev);
for (i = qcom->num_clocks - 1; i >= 0; i--) {
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] Revert "usb: dwc3: qcom: Constify the software node"
2021-03-11 9:00 [PATCH] Revert "usb: dwc3: qcom: Constify the software node" Shawn Guo
@ 2021-03-11 9:11 ` Heikki Krogerus
2021-03-11 9:54 ` Shawn Guo
0 siblings, 1 reply; 3+ messages in thread
From: Heikki Krogerus @ 2021-03-11 9:11 UTC (permalink / raw)
To: Shawn Guo
Cc: Felipe Balbi, Bjorn Andersson, Greg Kroah-Hartman, linux-arm-msm,
linux-usb
On Thu, Mar 11, 2021 at 05:00:49PM +0800, Shawn Guo wrote:
> This reverts commit 8dc6e6dd1bee39cd65a232a17d51240fc65a0f4a.
>
> The commit causes an regression for ACPI probe on Lenovo Yoga C630
> laptop. platform_device_add_properties() will fail with -EEXIST for the
> second USB instance, because of the software_node_to_swnode() check in
> function software_node_register().
I think you mean device_add_software_node() fails with -EEXIST, no?
There should be already a fix for that:
https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=2a92c90f2ecca4475d6050f2f93
+8a1755a8954cc
thanks,
--
heikki
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] Revert "usb: dwc3: qcom: Constify the software node"
2021-03-11 9:11 ` Heikki Krogerus
@ 2021-03-11 9:54 ` Shawn Guo
0 siblings, 0 replies; 3+ messages in thread
From: Shawn Guo @ 2021-03-11 9:54 UTC (permalink / raw)
To: Heikki Krogerus
Cc: Felipe Balbi, Bjorn Andersson, Greg Kroah-Hartman, linux-arm-msm,
linux-usb
On Thu, Mar 11, 2021 at 11:11:43AM +0200, Heikki Krogerus wrote:
> On Thu, Mar 11, 2021 at 05:00:49PM +0800, Shawn Guo wrote:
> > This reverts commit 8dc6e6dd1bee39cd65a232a17d51240fc65a0f4a.
> >
> > The commit causes an regression for ACPI probe on Lenovo Yoga C630
> > laptop. platform_device_add_properties() will fail with -EEXIST for the
> > second USB instance, because of the software_node_to_swnode() check in
> > function software_node_register().
>
> I think you mean device_add_software_node() fails with -EEXIST, no?
Yeah, I was looking at the wrong line.
>
> There should be already a fix for that:
> https://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm.git/commit/?h=linux-next&id=2a92c90f2ecca4475d6050f2f93
> +8a1755a8954cc
Cool! It fixes my problem. Hope it will land 5.12-rc soon.
Shawn
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-03-11 9:55 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-11 9:00 [PATCH] Revert "usb: dwc3: qcom: Constify the software node" Shawn Guo
2021-03-11 9:11 ` Heikki Krogerus
2021-03-11 9:54 ` Shawn Guo
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.