diff mbox series

[v7,1/3] usb: dwc3: qcom: Add missing DWC3 OF node refcount decrement

Message ID 20210212205521.14280-1-Sergey.Semin@baikalelectronics.ru
State New
Headers show
Series [v7,1/3] usb: dwc3: qcom: Add missing DWC3 OF node refcount decrement | expand

Commit Message

Serge Semin Feb. 12, 2021, 8:55 p.m. UTC
of_get_child_by_name() increments the reference counter of the OF node it
managed to find. So after the code is done using the device node, the
refcount must be decremented. Add missing of_node_put() invocation then
to the dwc3_qcom_of_register_core() method, since DWC3 OF node is being
used only there.

Fixes: a4333c3a6ba9 ("usb: dwc3: Add Qualcomm DWC3 glue driver")
Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru>

---

Note the patch will get cleanly applied on the commit 2bc02355f8ba ("usb:
dwc3: qcom: Add support for booting with ACPI"), while the bug has been
there since the Qualcomm DWC3 glue driver was submitted.

Changelog v7:
- This is a new patch. Please drop it If I missed something and the OF
  node refcount decrement wasn't supposed to be there.
---
 drivers/usb/dwc3/dwc3-qcom.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

Comments

Greg KH Feb. 18, 2021, 3:32 p.m. UTC | #1
On Thu, Feb 18, 2021 at 06:29:04PM +0300, Serge Semin wrote:
> Bjorn, Greg, Felippe, Andy,
> Any comments on this series? Bjorn, Greg you asked me to resend the
> patches related with the DW USB3 node name change. I did as you said,
> but no news since then. I'd be glad to have this patch accepted in
> some -next repo and forget about it.

Sorry, but it's the merge window right now and I can't add anything new
until 5.12-rc1 is out.  So can you wait until then?

thanks,

greg k-h
Serge Semin Feb. 18, 2021, 3:40 p.m. UTC | #2
On Thu, Feb 18, 2021 at 04:32:29PM +0100, Greg Kroah-Hartman wrote:
> On Thu, Feb 18, 2021 at 06:29:04PM +0300, Serge Semin wrote:
> > Bjorn, Greg, Felippe, Andy,
> > Any comments on this series? Bjorn, Greg you asked me to resend the
> > patches related with the DW USB3 node name change. I did as you said,
> > but no news since then. I'd be glad to have this patch accepted in
> > some -next repo and forget about it.
> 

> Sorry, but it's the merge window right now and I can't add anything new
> until 5.12-rc1 is out.  So can you wait until then?

Well, I don't think there is another choice but to wait now.)
Hopefully the patchset won't be forgotten when the merge window closes
as that happened with the original series...

-Sergey

> 
> thanks,
> 
> greg k-h
Serge Semin March 24, 2021, 12:18 p.m. UTC | #3
Hi Greg,

On Tue, Mar 23, 2021 at 12:29:17PM +0100, Greg Kroah-Hartman wrote:
> On Thu, Feb 18, 2021 at 06:40:51PM +0300, Serge Semin wrote:
> > On Thu, Feb 18, 2021 at 04:32:29PM +0100, Greg Kroah-Hartman wrote:
> > > On Thu, Feb 18, 2021 at 06:29:04PM +0300, Serge Semin wrote:
> > > > Bjorn, Greg, Felippe, Andy,
> > > > Any comments on this series? Bjorn, Greg you asked me to resend the
> > > > patches related with the DW USB3 node name change. I did as you said,
> > > > but no news since then. I'd be glad to have this patch accepted in
> > > > some -next repo and forget about it.
> > > 
> > 
> > > Sorry, but it's the merge window right now and I can't add anything new
> > > until 5.12-rc1 is out.  So can you wait until then?
> > 
> > Well, I don't think there is another choice but to wait now.)
> > Hopefully the patchset won't be forgotten when the merge window closes
> > as that happened with the original series...
> 

> Can you resend this if still needed?  I don't see them in my queue...

I see the very first patch of this series has already been merged in 
somewhere between v5.12-rc3 and v5.12-rc2. See commit 1cffb1c66499 ("usb: 
dwc3: qcom: Add missing DWC3 OF node refcount decrement"). But the rest of
the patches still hanging up unattended. I'll resend them in a few minutes.
Could you merge them in too?

-Sergey

> 
> thanks,
> 
> greg k-h
Greg KH March 26, 2021, 1:34 p.m. UTC | #4
On Wed, Mar 24, 2021 at 03:18:58PM +0300, Serge Semin wrote:
> Hi Greg,

> 

> On Tue, Mar 23, 2021 at 12:29:17PM +0100, Greg Kroah-Hartman wrote:

> > On Thu, Feb 18, 2021 at 06:40:51PM +0300, Serge Semin wrote:

> > > On Thu, Feb 18, 2021 at 04:32:29PM +0100, Greg Kroah-Hartman wrote:

> > > > On Thu, Feb 18, 2021 at 06:29:04PM +0300, Serge Semin wrote:

> > > > > Bjorn, Greg, Felippe, Andy,

> > > > > Any comments on this series? Bjorn, Greg you asked me to resend the

> > > > > patches related with the DW USB3 node name change. I did as you said,

> > > > > but no news since then. I'd be glad to have this patch accepted in

> > > > > some -next repo and forget about it.

> > > > 

> > > 

> > > > Sorry, but it's the merge window right now and I can't add anything new

> > > > until 5.12-rc1 is out.  So can you wait until then?

> > > 

> > > Well, I don't think there is another choice but to wait now.)

> > > Hopefully the patchset won't be forgotten when the merge window closes

> > > as that happened with the original series...

> > 

> 

> > Can you resend this if still needed?  I don't see them in my queue...

> 

> I see the very first patch of this series has already been merged in 

> somewhere between v5.12-rc3 and v5.12-rc2. See commit 1cffb1c66499 ("usb: 

> dwc3: qcom: Add missing DWC3 OF node refcount decrement"). But the rest of

> the patches still hanging up unattended. I'll resend them in a few minutes.

> Could you merge them in too?


Do you have a lore.kernel.org link to your resend, I don't see it...

thanks,

greg k-h
Serge Semin March 26, 2021, 7:55 p.m. UTC | #5
On Fri, Mar 26, 2021 at 02:34:23PM +0100, Greg Kroah-Hartman wrote:
> On Wed, Mar 24, 2021 at 03:18:58PM +0300, Serge Semin wrote:

> > Hi Greg,

> > 

> > On Tue, Mar 23, 2021 at 12:29:17PM +0100, Greg Kroah-Hartman wrote:

> > > On Thu, Feb 18, 2021 at 06:40:51PM +0300, Serge Semin wrote:

> > > > On Thu, Feb 18, 2021 at 04:32:29PM +0100, Greg Kroah-Hartman wrote:

> > > > > On Thu, Feb 18, 2021 at 06:29:04PM +0300, Serge Semin wrote:

> > > > > > Bjorn, Greg, Felippe, Andy,

> > > > > > Any comments on this series? Bjorn, Greg you asked me to resend the

> > > > > > patches related with the DW USB3 node name change. I did as you said,

> > > > > > but no news since then. I'd be glad to have this patch accepted in

> > > > > > some -next repo and forget about it.

> > > > > 

> > > > 

> > > > > Sorry, but it's the merge window right now and I can't add anything new

> > > > > until 5.12-rc1 is out.  So can you wait until then?

> > > > 

> > > > Well, I don't think there is another choice but to wait now.)

> > > > Hopefully the patchset won't be forgotten when the merge window closes

> > > > as that happened with the original series...

> > > 

> > 

> > > Can you resend this if still needed?  I don't see them in my queue...

> > 

> > I see the very first patch of this series has already been merged in 

> > somewhere between v5.12-rc3 and v5.12-rc2. See commit 1cffb1c66499 ("usb: 

> > dwc3: qcom: Add missing DWC3 OF node refcount decrement"). But the rest of

> > the patches still hanging up unattended. I'll resend them in a few minutes.

> > Could you merge them in too?

> 


> Do you have a lore.kernel.org link to your resend, I don't see it...


I've got the rest two patches back to the main series and resent it
two days ago:
https://lore.kernel.org/lkml/20210324204836.29668-1-Sergey.Semin@baikalelectronics.ru/
See the last two patches there.

They have been part of the main series from the very first time I
submitted it. But two months ago Bjorn asked me to detach Qcom-related
ones and resubmit to take into account his comment. Since then I
didn't hear any new update neither on these three patches nor on the
main series except you merging in the very first Qcom-related patch
(usb: dwc3: qcom: Add missing DWC3 OF node refcount decrement). Since
even being detached the patches left unattended I've decided to
combine them back to ease the re-submission process.

Note the patchset has been re-submitting for about five months
already with no comments for the last three versions.

-Sergey

> 

> thanks,

> 

> greg k-h
diff mbox series

Patch

diff --git a/drivers/usb/dwc3/dwc3-qcom.c b/drivers/usb/dwc3/dwc3-qcom.c
index c703d552bbcf..3564d00cdce3 100644
--- a/drivers/usb/dwc3/dwc3-qcom.c
+++ b/drivers/usb/dwc3/dwc3-qcom.c
@@ -639,16 +639,19 @@  static int dwc3_qcom_of_register_core(struct platform_device *pdev)
 	ret = of_platform_populate(np, NULL, NULL, dev);
 	if (ret) {
 		dev_err(dev, "failed to register dwc3 core - %d\n", ret);
-		return ret;
+		goto node_put;
 	}
 
 	qcom->dwc3 = of_find_device_by_node(dwc3_np);
 	if (!qcom->dwc3) {
+		ret = -ENODEV;
 		dev_err(dev, "failed to get dwc3 platform device\n");
-		return -ENODEV;
 	}
 
-	return 0;
+node_put:
+	of_node_put(dwc3_np);
+
+	return ret;
 }
 
 static int dwc3_qcom_probe(struct platform_device *pdev)