From patchwork Tue Apr 4 07:25:16 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 78890 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp2844428vqo; Tue, 4 Apr 2023 00:47:49 -0700 (PDT) X-Google-Smtp-Source: AKy350aGi+Mf/WfqOj9dQIjUkhw/Es/lm1k+RVjurjDVmC/8SwrRQh9RQ2vGDLBwuhcjSTd7vW2x X-Received: by 2002:a05:6a20:1e45:b0:d9:77f7:d62e with SMTP id cy5-20020a056a201e4500b000d977f7d62emr1328646pzb.36.1680594469197; Tue, 04 Apr 2023 00:47:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680594469; cv=none; d=google.com; s=arc-20160816; b=XNZxNnGSAqCpAR+IYuiANQvYF6/gWo9ra+bL2Mi/CxzEviaEv9Ppggag6imp409IGb R4iUl878emQG3QGtAe6NBy5fp1bx/F6YzpUA/WEWLemyMNCLjDy9jt8+AHZYqm3XeOQU i8qyp9752n6H+Pz3gB8aSBQJ11seDImyiSAndn94LLj42E8tKz9LjPFscd2RROv2eh2p kkOOTPbhcVuxAotIDEkbN4AWHHi1P6Hfpz8EzXP/n6DWck0HPoB5wv6cDlVtEv7Eimzv 8sO/q0JM6nwRAq0IDV3wwxWwYyfmNLArag66nk3EiQKh+IZIGw2ARQrWprj9YRP/vnGA 9pKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=RqyXgtVXjUlY3uUbESjc8RxqrqzY+xLIvrXqJm006wQ=; b=ljY/di7JSRsfXcWENf1wYtF1Jo6p+fi2PEi6MG/tv07J7iyZmR0qcT+9qKIsvhGBpG /TbXOZ9Po5bwQgPFV7jyzjXyRd8chHmu7x+6zhQgoKBpnQXcSq8jdmW9QKPP2CUkSG34 lFxWcKB+AS5C1AVuiUOegSscBSj8uJsPZJ/HyyELZipmzBG66fRjFrtdmJNbmQ8VxG/L SYYT9/Rz7iGloucFgOEe0TgQwmTWa85dTts6Ttb1wWMuY2m54pccupGuVROHeE+5g/0/ QyjrQWe7IYVCxzgTcVXtSk/x3FzlzjeoXEu9RbfZplUNQZca1p9TKj6QX/FWU5xcVonm Ox/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hftUNjye; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y28-20020aa79afc000000b0062d9eed7d25si10145682pfp.57.2023.04.04.00.47.36; Tue, 04 Apr 2023 00:47:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=hftUNjye; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233732AbjDDH0D (ORCPT + 99 others); Tue, 4 Apr 2023 03:26:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233838AbjDDHZz (ORCPT ); Tue, 4 Apr 2023 03:25:55 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C0982705; Tue, 4 Apr 2023 00:25:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 80CAB62F73; Tue, 4 Apr 2023 07:25:46 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id CDBBEC4339C; Tue, 4 Apr 2023 07:25:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1680593145; bh=1RmeZ7eM69xUCZQiQmM1oIPdpmsX9p3ONCsxLC4LpKU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hftUNjyeBIzD0TIC8tbdbDUVbToOmeCUC+JR48PbQdj/Kzq1Ll9/ZxCODsb1KLLFM gJE6vCyfgz4ObPQPb/WfQttIjACTR60jMYKi8ieq8wgdaNXservG+gtiJiKTVpfjam UE9gckp1phC5Vduf7/HiToSuGu0YnpchVoVZVyY9cme6Nv6E5l6DH7WS1oC9zcpw53 2n9db6UuYMlW5YAvuaMRO5L0nGrHMFs/Pf2Wg4UgW/7flgRobLbauGdcxRV9O8AB95 JScJFuWQ3kqMv014hR+iSL0mRQaaIcDdWvipU+0JP4LVu06+i9seeqlXwIETbDIVSV YG2XseYDts5Vw== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1pjb3U-0004xU-R8; Tue, 04 Apr 2023 09:26:12 +0200 From: Johan Hovold To: Thinh Nguyen Cc: Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 03/11] USB: dwc3: disable autosuspend on unbind Date: Tue, 4 Apr 2023 09:25:16 +0200 Message-Id: <20230404072524.19014-4-johan+linaro@kernel.org> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230404072524.19014-1-johan+linaro@kernel.org> References: <20230404072524.19014-1-johan+linaro@kernel.org> MIME-Version: 1.0 X-Spam-Status: No, score=-2.5 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1762231026302992116?= X-GMAIL-MSGID: =?utf-8?q?1762231026302992116?= Add the missing calls to disable autosuspend on probe errors and on driver unbind. Signed-off-by: Johan Hovold Acked-by: Thinh Nguyen --- drivers/usb/dwc3/core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c index 9f8c988c25cb..5b362ed43e7e 100644 --- a/drivers/usb/dwc3/core.c +++ b/drivers/usb/dwc3/core.c @@ -1954,6 +1954,7 @@ static int dwc3_probe(struct platform_device *pdev) err2: pm_runtime_allow(dev); pm_runtime_disable(dev); + pm_runtime_dont_use_autosuspend(dev); pm_runtime_set_suspended(dev); pm_runtime_put_noidle(dev); disable_clks: @@ -1981,6 +1982,7 @@ static int dwc3_remove(struct platform_device *pdev) pm_runtime_allow(&pdev->dev); pm_runtime_disable(&pdev->dev); + pm_runtime_dont_use_autosuspend(&pdev->dev); pm_runtime_put_noidle(&pdev->dev); pm_runtime_set_suspended(&pdev->dev);