Linux USB
 help / color / mirror / Atom feed
* [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code
@ 2026-11-03  1:44 Xiangwu Lai
  2026-11-03  1:50 ` sashiko-bot
  2026-11-17  1:14 ` Xiangwu Lai
  0 siblings, 2 replies; 4+ messages in thread
From: Xiangwu Lai @ 2026-11-03  1:44 UTC (permalink / raw)
  To: Kevin Cernekee, Neill Kapron, Greg Kroah-Hartman
  Cc: linux-usb, linux-kernel, Xiangwu Lai

bcm63xx_init_udc_hw() calls iudma_init() and stores the return code
in rc, but then returns 0 unconditionally.  When iudma_init() fails,
the hardware has already been torn down by bcm63xx_uninit_udc_hw(),
yet the probe believes initialization succeeded and goes on to
register a gadget controller with non-functional IUDMA channels.

Return rc so the probe fails and reports the real error.

Fixes: 613065e53cb1 ("usb: gadget: bcm63xx UDC driver")
Signed-off-by: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>
---
 drivers/usb/gadget/udc/bcm63xx_udc.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/gadget/udc/bcm63xx_udc.c b/drivers/usb/gadget/udc/bcm63xx_udc.c
index ba91b1ebb..250bb7685 100644
--- a/drivers/usb/gadget/udc/bcm63xx_udc.c
+++ b/drivers/usb/gadget/udc/bcm63xx_udc.c
@@ -1012,7 +1012,7 @@ static int bcm63xx_init_udc_hw(struct bcm63xx_udc *udc)
 	if (rc)
 		bcm63xx_uninit_udc_hw(udc);
 
-	return 0;
+	return rc;
 }
 
 /***********************************************************************



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code
  2026-11-03  1:44 [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code Xiangwu Lai
@ 2026-11-03  1:50 ` sashiko-bot
  2026-11-17  1:14 ` Xiangwu Lai
  1 sibling, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-11-03  1:50 UTC (permalink / raw)
  To: Xiangwu Lai; +Cc: linux-usb

> bcm63xx_init_udc_hw() calls iudma_init() and stores the return code
> in rc, but then returns 0 unconditionally.  When iudma_init() fails,
> the hardware has already been torn down by bcm63xx_uninit_udc_hw(),
> yet the probe believes initialization succeeded and goes on to
> register a gadget controller with non-functional IUDMA channels.
> 
> Return rc so the probe fails and reports the real error.
> 
> Fixes: 613065e53cb1 ("usb: gadget: bcm63xx UDC driver")
> Signed-off-by: Xiangwu Lai <laixiangwu@cmss.chinamobile.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261103014457.1255-1-laixiangwu@cmss.chinamobile.com?part=1


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code
  2026-11-03  1:44 [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code Xiangwu Lai
  2026-11-03  1:50 ` sashiko-bot
@ 2026-11-17  1:14 ` Xiangwu Lai
  2026-11-17  5:26   ` Greg Kroah-Hartman
  1 sibling, 1 reply; 4+ messages in thread
From: Xiangwu Lai @ 2026-11-17  1:14 UTC (permalink / raw)
  To: Kevin Cernekee, Neill Kapron, Greg Kroah-Hartman
  Cc: Xiangwu Lai, linux-usb, linux-kernel

Hi,

gentle ping for:

  usb: gadget: udc: bcm63xx: Propagate iudma_init() error code
  https://lore.kernel.org/all/20261103014457.1255-1-laixiangwu@cmss.chinamobile.com/

bcm63xx_init_udc_hw() calls iudma_init() and stores the return code,
but then returns 0 unconditionally.  When iudma_init() fails the
hardware has already been torn down, yet the probe believes the
initialization succeeded and registers a gadget controller with
non-functional IUDMA channels.  The patch propagates the error.

Is there anything blocking this patch, or does it just need more
time?

Best regards,
Xiangwu Lai



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code
  2026-11-17  1:14 ` Xiangwu Lai
@ 2026-11-17  5:26   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 4+ messages in thread
From: Greg Kroah-Hartman @ 2026-11-17  5:26 UTC (permalink / raw)
  To: Xiangwu Lai; +Cc: Kevin Cernekee, Neill Kapron, linux-usb, linux-kernel

On Tue, Nov 17, 2026 at 09:14:00AM +0800, Xiangwu Lai wrote:
> Hi,
> 
> gentle ping for:
> 
>   usb: gadget: udc: bcm63xx: Propagate iudma_init() error code
>   https://lore.kernel.org/all/20261103014457.1255-1-laixiangwu@cmss.chinamobile.com/
> 
> bcm63xx_init_udc_hw() calls iudma_init() and stores the return code,
> but then returns 0 unconditionally.  When iudma_init() fails the
> hardware has already been torn down, yet the probe believes the
> initialization succeeded and registers a gadget controller with
> non-functional IUDMA channels.  The patch propagates the error.
> 
> Is there anything blocking this patch, or does it just need more
> time?

Has it been tested on real hardware?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-17  5:27 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-03  1:44 [PATCH] usb: gadget: udc: bcm63xx: Propagate iudma_init() error code Xiangwu Lai
2026-11-03  1:50 ` sashiko-bot
2026-11-17  1:14 ` Xiangwu Lai
2026-11-17  5:26   ` Greg Kroah-Hartman

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox