Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp1288912pxm; Sat, 26 Feb 2022 10:44:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwFoQzZg1qWe8RRjzLAKttj9aR/+3ZoKaJAY0XtnXD2wIabpRHAiDxjS2cZ38sis6CETBpq X-Received: by 2002:a17:902:e747:b0:150:2a7:735e with SMTP id p7-20020a170902e74700b0015002a7735emr13249542plf.32.1645901039814; Sat, 26 Feb 2022 10:43:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1645901039; cv=pass; d=google.com; s=arc-20160816; b=exmYZOzPpe+GLSIDfmM3vkKH3WxzJbIcT483gMamY6M9yDZTIfylYiRLJ1gmtugzqT waO5lLSOtPV2SWgwiHLSwgT0fPRcHs0UuLL2u9s2NrH2Q1ypePWmh5vuF8oy+3dTspBr x01SQ5tu/33D8bXz9pm2GrvUWlK3eDV/eSbVccuQc+aeAEQgn+J1SrjrY8RYRIzT+leg XQHFF42GefK9pJ2CYntPu5GgePMEcOxL0iXavBPlPvg1tagDMQQBy24CRHvgYdO3HRxK hmAD9bL1mlIM6RQ/ltPt+a2VYeH0LparS1Izx5uLTaNkRoTQQJGD52FfmAMnDpNEYjKz Z16Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :suggested_attachment_session_id:content-language:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from:dkim-signature; bh=qk0odrzELd85C1eaS3t0QYb9eC4EwJUTlWIQSXzvsYI=; b=M9rnk7V+ixyM6F9zT14sbgfxFuUQcZseLIIdC1uUajG6izR650P28FGJ6UE5UiC3OF /qsUuvyDSSM1TwNJrOevFIePVF1cFw3hWAHq2DHVDSv80ZIxL5JPY5K8LgWvSc8tlLWO DK42+mJbr8fcL5MPbtLToUlpo/abEByFmhkowmy7TIYrlhmJPDaBE9bBs7rI2PGD3j/S e5/1hc6vKd2lHadVJDwS4o6z1U1N91XNCtlvAdlA6pYe6QodgT6IcCZ2iWK8zoE0lee3 zjF0o/N6XVtmZMvd0Yokg6SjjsxKIEcg8ou6iT409Lcu5Rdu3JiF1b1eDF3QoAiNt40F TeeA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@Nvidia.com header.s=selector2 header.b=tuk6bSDQ; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v14-20020a056a00148e00b004e1924f78f8si5463384pfu.34.2022.02.26.10.43.44; Sat, 26 Feb 2022 10:43:59 -0800 (PST) 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=@Nvidia.com header.s=selector2 header.b=tuk6bSDQ; arc=pass (i=1 spf=pass spfdomain=nvidia.com dkim=pass dkdomain=nvidia.com dmarc=pass fromdomain=nvidia.com); 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=REJECT sp=REJECT dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232315AbiBZQVi (ORCPT + 99 others); Sat, 26 Feb 2022 11:21:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232281AbiBZQVh (ORCPT ); Sat, 26 Feb 2022 11:21:37 -0500 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2065.outbound.protection.outlook.com [40.107.92.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 66DF91E7A63; Sat, 26 Feb 2022 08:21:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Aozd6/efbvEPq+vSn3LldptDmWo6jw8iMR/TSYFCURJVcQ0wFIfmZpItibfK0gs9hX5SyGAEorkxVNJgSpFJSeh+eDizrBKLqslicMlEbtaOsy94aU2oSpjuyCf6jVVJ1rHNR9daFOtwPi6iBaYDmvBOZjlH/XwSIYYt2BayzIy0PXpFRXWFmcm1hM2s0gl3xdq4QbV5TygQgjUYXuGfmef9ncJy/BXnTjvX2iM2qmfDEkB5G+noHYcAJjmcCU0p3pPpE0KwnNpVBSPp6Wk71NlkLWBGNVSi2D/JxID2eA9GntKvMQ+djKPde768aP3tqyzaQxu27r0XeS0+Tgh2mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qk0odrzELd85C1eaS3t0QYb9eC4EwJUTlWIQSXzvsYI=; b=GdyXGOElm3qYNn3g3bVM2py3glBA6zVlUwyvja+XtmDweFnVs4SmgQ8OflCJHCNd3SRoGJ+H8M89kuPYV4HAP1Z0a1K3vDL7zKtJrdOOFIVwih9OK1oQN3v30zBqZ0zjTU4hVjm0KV6qCSGMgxolbPZy7SatfUX250poh/AivTs7KVP8DBDSHn8sn+3POCJajS4dq+qyf66ws8hq3hLu1Ay6tEKVYaLbIJf28cgZjH8yquL4xgiZIBFijo9qwgJJlkbUjR7qUeXveJHZ0H4pM/CponApU8pVOhTKc9IpLLCRbJa76gZp3qJXFdEv5mwu/wdEMJdwXAl/MVGCOekdaw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qk0odrzELd85C1eaS3t0QYb9eC4EwJUTlWIQSXzvsYI=; b=tuk6bSDQIgoqjQhm1LMIlWKyFXaTHfDKI5/3aS5JkcbE2aNeQbzfyFNH1XGlOWcbX4xKKAkWUvCPljv4uakPfqxFZbdUxrkHtDYtUHFtfiNAEB435zaJzwV9qB3AjreuHLvYcLeGZXav6D56AqAqHVAQJz+frrklsKfovwnmlglgIvfkZSurQudLRwWz1mnuNzS0vMQvRU4irxo8ve/lIYyB5sj6/8f9G0FgHYFOrafxPv3auJzEUgswMc9cT6J7VU7qhf0rYKfFkgtNNF3JgZruvAPS6/7+w/5Z/QytBl94SjNLec1GpwzIMKbjxHaI5/FX+YTvqP6PYC3Ye+oLxA== Received: from CH0PR12MB5089.namprd12.prod.outlook.com (2603:10b6:610:bc::8) by CH0PR12MB5281.namprd12.prod.outlook.com (2603:10b6:610:d4::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5017.21; Sat, 26 Feb 2022 16:20:59 +0000 Received: from CH0PR12MB5089.namprd12.prod.outlook.com ([fe80::2158:bc32:112a:2860]) by CH0PR12MB5089.namprd12.prod.outlook.com ([fe80::2158:bc32:112a:2860%2]) with mapi id 15.20.5017.026; Sat, 26 Feb 2022 16:20:59 +0000 From: Henry Lin To: Greg KH CC: Mathias Nyman , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH v2] xhci: fix runtime PM imbalance in USB2 resume Thread-Topic: [PATCH v2] xhci: fix runtime PM imbalance in USB2 resume Thread-Index: AQHYKhd7AopZ8pn1EUiip/DzNcJli6yj/JuAgAH/8D+AAAgX2g== Date: Sat, 26 Feb 2022 16:20:59 +0000 Message-ID: References: <20220225055311.92447-1-henryl@nvidia.com> <20220225071506.22012-1-henryl@nvidia.com> In-Reply-To: Accept-Language: en-US, zh-TW Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: suggested_attachment_session_id: 7da19dee-a09a-04c0-cf1b-b3089b2e16c1 authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: f5514dfe-9673-4190-bc34-08d9f943f9d3 x-ms-traffictypediagnostic: CH0PR12MB5281:EE_ x-microsoft-antispam-prvs: x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 5l7NSsGQKbRgy94U2Zzn2zpuAbPz7mLp+S/L3NItXe4CuJbtlrEhCz/b3cULHFxnGGw23vNwwQdbNkLTHCZNnuqmYfvDuEvyIGLJRs05yURu2FsEPU99AD5+kFEDPUr4lkCPvgbiyKmi2ylwj8nt7m75kOTjlFMWCXXu425VLoF4CAcg/2NUc0gF064WsV4MZfBZuk2AXu4/CtfuyWB8a2r3TBsQxa9xA8MXS2GhCp2bb3hsBz/oNqkkh7NWWjI5LP/FNq7IfYaK2sII1nJ5aiqxSWyfqIcPR8JYyJMoQmpR2HPhrgxlAZuX2IHGDfw+aD7JKiqVGnr7tMkXsumqmLSF4Hyh+1E4MFHriBhRE0wlcfUY2FeaL099Y4P1hBNncgmlNEASz0RjEOG3c84TAL2rO4Sm1w5yIRe6yugnl1H/PB1j8HjOwY0t7Lrnsdrt2bSNssEKZzNprP2sInVNTjPMqQIRGxGSoNTjwfABu4SJneRi9GZ1o08j5kqgzQKed+/frG4vfY6SfVQhZY9omAdOXD487eRfANZ5l6xeQeeu6iyOg7ZkLchxlTNxPghQi26vSKqIdKkRtWKIihkYhkm0cu4SBH2XlSKkQRL/Eel50mIxYIRr1xibDTb7l//ZYz9Uap9Xdswrb1wt4cwIvsR/k8BJyiUb81rZ8bxcbecfKNKn0nkTn3zNagF5E+dosS5+swuAiwFggemxm+YXzg== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH0PR12MB5089.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(38100700002)(83380400001)(64756008)(8676002)(71200400001)(91956017)(4326008)(122000001)(38070700005)(9686003)(7696005)(53546011)(6506007)(2940100002)(2906002)(186003)(26005)(8936002)(66556008)(52536014)(66446008)(66476007)(5660300002)(76116006)(66946007)(508600001)(316002)(54906003)(6916009)(33656002)(55016003)(86362001);DIR:OUT;SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?kVvIPL2SdXHZ39rgn9E8uoZa7Qwpft9YqnxlcibFU2LRdPI9ges1X+fyAmBU?= =?us-ascii?Q?qLV+TAS3AGStBTRBkDRcwogCGjc6R3yqp9AMyHbjyfbvU9MpypwjoXC+v2kw?= =?us-ascii?Q?6uDq7S+6krfRKXWx5ZP855ERtt5ngARQPbD75m8L96JYN+PXnW2C6FD+1owt?= =?us-ascii?Q?Wbi7UEjKFKVBnm0xHrCzfFJqLyKa14BBeE7WCJXSjcsrPQTYL2vmUSkDTbZJ?= =?us-ascii?Q?TgCjtQDXcUHOVFN0tz2oIwvLlbGBNremjip/jvUhgXfASfsh++hucmmToDXY?= =?us-ascii?Q?Axdq5hsK3dsLrqKsPq5khjJtOsSp9rmJwiaxsNipOa/e6+IAF9aBKYhMpYzO?= =?us-ascii?Q?RhK2zWzDpSd7rFHd4X7lk57ZNOXVAhB+k/NKmZxKhCClSTRZqpwSss5iFBLi?= =?us-ascii?Q?Akd7aGYrRcK9YUy9tISxuf3WBNDEkypzpJx3MNFegGjRlC3u9LA4c5VBEJqK?= =?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6H7NACFKnq3AX+OfCBbXn5i/L?= =?us-ascii?Q?D81g883WogheH/e0VVW3lIJH7elbD/TNlBVC1+uZHK1NykpEIlY6kM4DmLq7?= =?us-ascii?Q?CMpHUI/h2khu+1dwG/tg580ERxm0Dz1hb1r5N+/0LYVaMvpIBty0mAVD804O?= =?us-ascii?Q?Nvlg//TLx43S69wO1xWxe4ApAaij7a6jN5w4SC76On8RSTJYdhLsxWhe+1B6?= =?us-ascii?Q?WabahAC7MSoaHiOgxRh7QHDNtUncch//TEEuhX2b+iVbhGyVHKTo8uNOI4fC?= =?us-ascii?Q?qQ=3D=3D?= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: CH0PR12MB5089.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5514dfe-9673-4190-bc34-08d9f943f9d3 X-MS-Exchange-CrossTenant-originalarrivaltime: 26 Feb 2022 16:20:59.8538 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 0q0ooALH17D+ehoxG9rjMUVNxojxQA/9IeCMahcdDQO9AluyAAb2YV5ySpg37RBvvJKjcS72oPM/iuO4Rik+Gg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH0PR12MB5281 X-Spam-Status: No, score=-1.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=no 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 > + usb_hcd_end_port_resume(&port->rhub->hcd->self, > + portnum); Tab indent is broken in this version. Will resend this. ________________________________________ From: Henry Lin Sent: Sunday, February 27, 2022 12:06 AM To: Greg KH Cc: Mathias Nyman; linux-usb@vger.kernel.org; linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] xhci: fix runtime PM imbalance in USB2 resume USB2 resume starts with usb_hcd_start_port_resume() in port status change handling for RESUME link state. usb_hcd_end_port_resume() call is needed to keep runtime PM balance. Fixes: a231ec41e6f6 ("xhci: refactor U0 link state handling in get_port_sta= tus") Signed-off-by: Henry Lin --- V1 -> V2: Added Fixes tag in changelog drivers/usb/host/xhci-hub.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/usb/host/xhci-hub.c b/drivers/usb/host/xhci-hub.c index df3522dab31b..4a8b07b8ee01 100644 --- a/drivers/usb/host/xhci-hub.c +++ b/drivers/usb/host/xhci-hub.c @@ -1090,6 +1090,8 @@ static void xhci_get_usb2_port_status(struct xhci_por= t *port, u32 *status, if (link_state =3D=3D XDEV_U0) { bus_state->resume_done[portnum] =3D 0; clear_bit(portnum, &bus_state->resuming_ports); + usb_hcd_end_port_resume(&port->rhub->hcd->self, + portnum); if (bus_state->suspended_ports & (1 << portnum)) { bus_state->suspended_ports &=3D ~(1 << por= tnum); bus_state->port_c_suspend |=3D 1 << portnu= m; -- 2.17.1