Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp799479pxf; Wed, 7 Apr 2021 11:50:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzrvyNKB6U8xBAMO33XhyR8NcVn/36SbOSycJIABw7Rq0yVk2TJK43ZwHwNtiYvLBcMrESU X-Received: by 2002:a92:1943:: with SMTP id e3mr3806009ilm.166.1617821458193; Wed, 07 Apr 2021 11:50:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617821458; cv=none; d=google.com; s=arc-20160816; b=YQa8oE0i0E8s7MBf61h9TfZ4RpvuibZLJIJMqt+iaGUtodm1gZQsvHs0wfAe6RrC3/ LFAhp10bbUIrD+fFwzB8vB6ke9vU4oWW5WKTZ54ZV++qIXOGHzMeY31V4VQLosllko8m xTZjb2sp1GHmMxwe5k62/wSIEVp9GClRuo44MS4MHcg3tHs9vdS9Ov3GGQmZ3EihfE+/ Rk9/rPBAWw5D6SvxJM2euT/rSm/6qzc5PE8wnNA6UdgTOdyXukEkLqV1+8DYPBJ2tToP 2uPeJ2ROL0knm6Lh/ube8QCE+T01GUWgrcwZjUgCiZbOssG3wCo0YCW5nDyGyDgs4nH0 qx+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=QFMVTNTxpPWLnH6iZzztNU/DIozhwwXa3xuqDlU9/IA=; b=jJ03d5x/cS0VSxBfZ/d4ebQrhEhr65/tDYnsPYEWpPn/hThQo0XYjbX0oINrxC9wmj 8wuhDy98nkHvA8zhND5HcNgbDdfxQIgZ28nvWzjBanKTiu5/XWPhF5vJ7sCy+59BlxoM 7b8rZe+L6u3B+vVMmTMBGN9/2kORIhVDvqF2dmpPLVjXSt9dWuMwEpOAwEn0v6atpIdy yj9DLv6BlaQFznVD6bCtyeTitS53U7vW6wp1EqHQeWvAjjFl0M5/FerJZGJ7KtlhDOXj qTJuFXcE/X7wG47nlJmVT/p+38IL2pyuPp8s2rpUxhGF8cm51Af6eTDkldfh4vUuDtL1 D3wg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x18si23457167jas.18.2021.04.07.11.50.45; Wed, 07 Apr 2021 11:50:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345184AbhDGFWv (ORCPT + 99 others); Wed, 7 Apr 2021 01:22:51 -0400 Received: from spam.zju.edu.cn ([61.164.42.155]:33194 "EHLO zju.edu.cn" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S229603AbhDGFWv (ORCPT ); Wed, 7 Apr 2021 01:22:51 -0400 Received: from localhost.localdomain (unknown [10.192.24.118]) by mail-app2 (Coremail) with SMTP id by_KCgB3GcSTQW1g2+nRAA--.27427S4; Wed, 07 Apr 2021 13:22:30 +0800 (CST) From: Dinghao Liu To: dinghao.liu@zju.edu.cn, kjlu@umn.edu Cc: Peter Chen , Pawel Laszczak , Roger Quadros , Aswath Govindraju , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] usb: cdns3: Fix rumtime PM imbalance on error Date: Wed, 7 Apr 2021 13:22:26 +0800 Message-Id: <20210407052226.1056-1-dinghao.liu@zju.edu.cn> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: by_KCgB3GcSTQW1g2+nRAA--.27427S4 X-Coremail-Antispam: 1UD129KBjvdXoW7GrWfKF4rury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Mailing-List: linux-kernel@vger.kernel.org When cdns3_gadget_start() fails, a pairing PM usage counter decrement is needed to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/usb/cdns3/cdns3-gadget.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/cdns3-gadget.c b/drivers/usb/cdns3/cdns3-gadget.c index 582bfeceedb4..ad891a108aed 100644 --- a/drivers/usb/cdns3/cdns3-gadget.c +++ b/drivers/usb/cdns3/cdns3-gadget.c @@ -3255,8 +3255,11 @@ static int __cdns3_gadget_init(struct cdns *cdns) pm_runtime_get_sync(cdns->dev); ret = cdns3_gadget_start(cdns); - if (ret) + if (ret) { + pm_runtime_mark_last_busy(cdns->dev); + pm_runtime_put_autosuspend(cdns->dev); return ret; + } /* * Because interrupt line can be shared with other components in -- 2.17.1