Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp57126pxb; Fri, 9 Apr 2021 18:08:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyJN7rchvnRC9tf0vOgJUklD6dykO7GTp5vTv3sr6Y/ICZDvHOxZAReq0XdFbGTj1WUIpLj X-Received: by 2002:a17:90b:1050:: with SMTP id gq16mr605583pjb.123.1618016912263; Fri, 09 Apr 2021 18:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618016912; cv=none; d=google.com; s=arc-20160816; b=bI3zEJfTvvCrm1kA7R2bL5jxBqZyHi1wZw8O9nH5hkYJ5ZlQhy3fo5u9uxV0x79dQE +Df2zOVH6Y/UH7gTA11AaEsKzPikbOPmBMCL/nkBlmwosf9aRIac2OcZ2xQI4EkC0dyf A0JFx+/BdfoZVNJbwMYxAzg3ShAQlb8FS634Siob5m1abohz0JSxpOOBDhPB45dX6COY yZxcpkO4ZrnKm/fIhkytKLYbf6nZVYTHtfkh0TwkYu7oUZ9zf3Dqj6ZQKaCFyBl27bxS L0eYuS6LIjdAI+wyPomMF+nZ8Ow6EQaUZLqYSNIp8cX4g7qDgXwl7eTmTs8bfY5efQGl wuQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=RKzcG5OdjNeRVPAax2h4Pjcc1jb7peW8L6UTTyW87Fw=; b=SpGyGYnf4jw3ixfQk1etcjbh79AhLnnOMV6f/zrnyHnoNjOokOa/LyckZxGt7RkIWL keC5S0uFZ6kVlpMSVvHLdORj/I5jvJbDr1TifbamnInzbRgcn8GAroi3iFjm94Lp5uAx hdHZ5r7y7NnjNy4oXaER8fQc8ccR5dfT+1nJnqzOLgn35JQ3j7yTFbMvoV0k0EeqKU34 VR1NzzPH8u9hAk5jJWRQNFpVQsQjw4pkeKukV8izoLevzjCsqVz/P+bvGXPp5MwXswOz aklcA98YOEv+r41h0KZseG5KUAGZ6kbiq+t6uvZTjf5x1K3j/mdUy4NpUR/ooIUJTeS1 67iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dSnWl81L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q4si4896438pgv.30.2021.04.09.18.08.19; Fri, 09 Apr 2021 18:08:32 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=dSnWl81L; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235347AbhDJBGx (ORCPT + 99 others); Fri, 9 Apr 2021 21:06:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:54924 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235215AbhDJBGw (ORCPT ); Fri, 9 Apr 2021 21:06:52 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id F020F61108; Sat, 10 Apr 2021 01:06:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1618016799; bh=s8osdEXEHWK0uXbZb3OoiNNhqDzjRjCPWvJu8aGIU10=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=dSnWl81LkF8fs/Vl1jFFifVH75VDgdKPn6NuNMaMkoXN9M70hzU1+n3gVLMRO/ZNt E6uOo3tOQen8ZOc6+4Rma9m0cPXTsAuAQIJ6oy96mbP+woCoqWvxbcHafCOsMwt3aF pvCC/8mvGuFJ/JdX9KNgsoFk2va4B+eYhQX5TbAt2/PtNknDKknX05aTmm2/J67Y1O b1WgSwfwYtdJ/H9/OM6anR59uE4nXRS9Mkdfz6PAqoegzRQJFMguWulOS24xw22uPj iFAT+tGFWNqodSeD4rghJaEt/Qplv9jSg7VC78mRE9bNaoDbuaYeNxu5aYZWK1B3HG E7DRCjdrYy3FA== Date: Sat, 10 Apr 2021 09:06:31 +0800 From: Peter Chen To: Dinghao Liu Cc: kjlu@umn.edu, Pawel Laszczak , Roger Quadros , Aswath Govindraju , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] usb: cdns3: Fix rumtime PM imbalance on error Message-ID: <20210410010631.GA3862@b29397-desktop> References: <20210407052226.1056-1-dinghao.liu@zju.edu.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210407052226.1056-1-dinghao.liu@zju.edu.cn> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 21-04-07 13:22:26, Dinghao Liu wrote: > 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; It doesn't need to delay entering runtime suspend, I prefer using pm_runtime_put_sync directly. -- Thanks, Peter Chen