]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
usb: bdc: fix sleep during atomic
authorJustin Chen <justin.chen@broadcom.com>
Tue, 20 Jan 2026 20:07:54 +0000 (12:07 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 23 Jan 2026 16:16:31 +0000 (17:16 +0100)
bdc_run() can be ran during atomic context leading to a sleep during
atomic warning. Fix this by replacing read_poll_timeout() with
read_poll_timeout_atomic().

Fixes: 75ae051efc9b ("usb: gadget: bdc: use readl_poll_timeout() to simplify code")
Signed-off-by: Justin Chen <justin.chen@broadcom.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>
Link: https://patch.msgid.link/20260120200754.2488765-1-justin.chen@broadcom.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/usb/gadget/udc/bdc/bdc_core.c

index 5c3d8b64c0e76e434cc1bcc39f9976f1a17d83b0..f47aac078f6be6d4f134beda2239d271b63d3d46 100644 (file)
@@ -35,8 +35,8 @@ static int poll_oip(struct bdc *bdc, u32 usec)
        u32 status;
        int ret;
 
-       ret = readl_poll_timeout(bdc->regs + BDC_BDCSC, status,
-                                (BDC_CSTS(status) != BDC_OIP), 10, usec);
+       ret = readl_poll_timeout_atomic(bdc->regs + BDC_BDCSC, status,
+                                       (BDC_CSTS(status) != BDC_OIP), 10, usec);
        if (ret)
                dev_err(bdc->dev, "operation timedout BDCSC: 0x%08x\n", status);
        else