From patchwork Wed Sep 21 12:34:45 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 12983680 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 741E6ECAAD8 for ; Wed, 21 Sep 2022 12:33:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230079AbiIUMdq (ORCPT ); Wed, 21 Sep 2022 08:33:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60560 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229804AbiIUMde (ORCPT ); Wed, 21 Sep 2022 08:33:34 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE3CD8052F for ; Wed, 21 Sep 2022 05:33:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663763613; x=1695299613; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=PZnpArWlMpfniqg1zekF1KYAo7d18CORYX2FkomSLKw=; b=IafSwMB3LtrHUioo1A4B7dHx75vJBSvdwcpcP78PPcXEgBDtD1XLAQ+5 5pw8621a87fZDiVSOeyFB7dznR+KtYW3WigIBCXBIOVZs7zCVUz1EQGzq svc5yANXiAMCtqg38SuzSHML9QxVFJQESy66s7+xtmKNunC6481sESe9C PyF3wly9CasbBH9jAdQ1hX09wDqlWZqvvmrLbTUwWWtsAIC67/UCZJSv8 dcLBXtfWSm8lq07rtB8PdfQ9HmAFsbRHj7t5AB+eTtnv8oTwuW+JiyFu9 23JdzZkG6uSPPwemRD69utTJoUcqPHCNwdb5/e2u/0c87jTx0u7Snxri3 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="363965090" X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="363965090" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 05:33:33 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="708429447" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by FMSMGA003.fm.intel.com with ESMTP; 21 Sep 2022 05:33:32 -0700 From: Mathias Nyman To: Cc: , Jianglei Nie , Mathias Nyman Subject: [PATCH 1/6] usb: host: xhci: Fix potential memory leak in xhci_alloc_stream_info() Date: Wed, 21 Sep 2022 15:34:45 +0300 Message-Id: <20220921123450.671459-2-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921123450.671459-1-mathias.nyman@linux.intel.com> References: <20220921123450.671459-1-mathias.nyman@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Jianglei Nie xhci_alloc_stream_info() allocates stream context array for stream_info ->stream_ctx_array with xhci_alloc_stream_ctx(). When some error occurs, stream_info->stream_ctx_array is not released, which will lead to a memory leak. We can fix it by releasing the stream_info->stream_ctx_array with xhci_free_stream_ctx() on the error path to avoid the potential memory leak. Signed-off-by: Jianglei Nie Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index 8c19e151a945..9e56aa28efcd 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -641,7 +641,7 @@ struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci, num_stream_ctxs, &stream_info->ctx_array_dma, mem_flags); if (!stream_info->stream_ctx_array) - goto cleanup_ctx; + goto cleanup_ring_array; memset(stream_info->stream_ctx_array, 0, sizeof(struct xhci_stream_ctx)*num_stream_ctxs); @@ -702,6 +702,11 @@ struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci, } xhci_free_command(xhci, stream_info->free_streams_command); cleanup_ctx: + xhci_free_stream_ctx(xhci, + stream_info->num_stream_ctxs, + stream_info->stream_ctx_array, + stream_info->ctx_array_dma); +cleanup_ring_array: kfree(stream_info->stream_rings); cleanup_info: kfree(stream_info); From patchwork Wed Sep 21 12:34:46 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 12983681 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61AC4C6FA8E for ; Wed, 21 Sep 2022 12:33:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229721AbiIUMds (ORCPT ); Wed, 21 Sep 2022 08:33:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229677AbiIUMdg (ORCPT ); Wed, 21 Sep 2022 08:33:36 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A78536F247; Wed, 21 Sep 2022 05:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663763615; x=1695299615; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ziGX66AbiYR2EZskkYdpAo55M94DeQXsDOfDCkgAD+A=; b=U77eIK0wMxURkoiCB6jRF7PMXPKoTSXQyE0Mkg5IrennzYEf5aroyVOd r7GyBhlumKfV2CSo7sEUP/IuS0iiAqp/2sytTV1SWpjv049EQL7hBK1f5 IbhAyJ3PnkUWhY9adVu8FcMCUp4PzZdD9onmY7cNEIS20l5HanObafmq9 3wTl6riwb8FmhegClvTgSnMDH004y70JxKNOMwQOYRtAXLh7/gaGiud1F ZsyeybeBel9Z43N0IAJ9r9DIG+BUmD8NYaXEcUdN0+RjS7k+npIGwrtKy idomPtS9fGdCR5D50eh+/GO7X2ACmt08ai2IaK0ZxDj9Xqsz0PVs002T1 g==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="363965097" X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="363965097" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 05:33:35 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="708429453" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by FMSMGA003.fm.intel.com with ESMTP; 21 Sep 2022 05:33:33 -0700 From: Mathias Nyman To: Cc: , Rafael Mendonca , stable@vger.kernel.org, Mathias Nyman Subject: [PATCH 2/6] xhci: dbc: Fix memory leak in xhci_alloc_dbc() Date: Wed, 21 Sep 2022 15:34:46 +0300 Message-Id: <20220921123450.671459-3-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921123450.671459-1-mathias.nyman@linux.intel.com> References: <20220921123450.671459-1-mathias.nyman@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Rafael Mendonca If DbC is already in use, then the allocated memory for the xhci_dbc struct doesn't get freed before returning NULL, which leads to a memleak. Fixes: 534675942e90 ("xhci: dbc: refactor xhci_dbc_init()") Cc: stable@vger.kernel.org Signed-off-by: Rafael Mendonca Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-dbgcap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci-dbgcap.c b/drivers/usb/host/xhci-dbgcap.c index e61155fa6379..f1367b53b260 100644 --- a/drivers/usb/host/xhci-dbgcap.c +++ b/drivers/usb/host/xhci-dbgcap.c @@ -988,7 +988,7 @@ xhci_alloc_dbc(struct device *dev, void __iomem *base, const struct dbc_driver * dbc->driver = driver; if (readl(&dbc->regs->control) & DBC_CTRL_DBC_ENABLE) - return NULL; + goto err; INIT_DELAYED_WORK(&dbc->event_work, xhci_dbc_handle_events); spin_lock_init(&dbc->lock); From patchwork Wed Sep 21 12:34:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 12983682 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 121B2C32771 for ; Wed, 21 Sep 2022 12:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230015AbiIUMdt (ORCPT ); Wed, 21 Sep 2022 08:33:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33414 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229985AbiIUMdi (ORCPT ); Wed, 21 Sep 2022 08:33:38 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 811C28B2CF for ; Wed, 21 Sep 2022 05:33:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663763617; x=1695299617; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=JmaK7Qgk+E+RDAwhbQUAVkfcXfPxIFxtoxbaYzf60RQ=; b=O+YMbA6HudPv5R6PFuqfKFLtN9Zpoontpfc8UKf/Y5Qk1gxAwq/8o9wM h/VPYvt+x4CL5s0APFOL9JdB66bba0iGMm1YtVpfqs6tRTJ3MFZ2JFiiU DX9lr5NawF57WMdvU++IVlEX5xQUgLjR1UiS03LA7jOIeV4OLAzxB2vlM rqMgkBH96wgaNenFfksDaB0OvB0tuDqjkXyAl7NQqs7AhAjGsK1polj9B qpWsRXN6XoMzlJaeo6hwpDONf4pHxxBYPxh+LnU6Qi4JPnd0TzKpEL/zq 80Uu+fCk3kWINfrx487AP3Ix1MWqWXMHADdHqUB21fNT6aWbGwxajIRCL g==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="363965105" X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="363965105" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 05:33:37 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="708429464" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by FMSMGA003.fm.intel.com with ESMTP; 21 Sep 2022 05:33:35 -0700 From: Mathias Nyman To: Cc: , Mario Limonciello , "Artem S . Tashkinov" , Mathias Nyman Subject: [PATCH 3/6] xhci: Don't show warning for reinit on known broken suspend Date: Wed, 21 Sep 2022 15:34:47 +0300 Message-Id: <20220921123450.671459-4-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921123450.671459-1-mathias.nyman@linux.intel.com> References: <20220921123450.671459-1-mathias.nyman@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Mario Limonciello commit 8b328f8002bc ("xhci: re-initialize the HC during resume if HCE was set") introduced a new warning message when the host controller error was set and re-initializing. This is expected behavior on some designs which already set `xhci->broken_suspend` so the new warning is alarming to some users. Modify the code to only show the warning if this was a surprising behavior to the XHCI driver. Fixes: 8b328f8002bc ("xhci: re-initialize the HC during resume if HCE was set") Link: https://bugzilla.kernel.org/show_bug.cgi?id=216470 Reported-by: Artem S. Tashkinov Signed-off-by: Mario Limonciello Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index 38649284ff88..a7ef675f00fd 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -1183,7 +1183,8 @@ int xhci_resume(struct xhci_hcd *xhci, bool hibernated) /* re-initialize the HC on Restore Error, or Host Controller Error */ if (temp & (STS_SRE | STS_HCE)) { reinit_xhc = true; - xhci_warn(xhci, "xHC error in resume, USBSTS 0x%x, Reinit\n", temp); + if (!xhci->broken_suspend) + xhci_warn(xhci, "xHC error in resume, USBSTS 0x%x, Reinit\n", temp); } if (reinit_xhc) { From patchwork Wed Sep 21 12:34:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 12983683 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8C884ECAAD8 for ; Wed, 21 Sep 2022 12:33:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230034AbiIUMdw (ORCPT ); Wed, 21 Sep 2022 08:33:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60858 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230028AbiIUMdk (ORCPT ); Wed, 21 Sep 2022 08:33:40 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E6F5995AEA for ; Wed, 21 Sep 2022 05:33:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663763618; x=1695299618; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=yTbRBo90pcB/fBqv5liREs7w64JtHDfBcp6r2nk6iBQ=; b=gfD1w020dJtNqu6PhWQleEZx0N41dMj4kPTzGgsgewJL7f16mEQ97aC+ jhum+rh1Kdtbo+xictspyyOlnHiRSa/xVF4CdpTGmB9mG7JRNc57Djuo2 EbBkg2Xf9qvSpqLpufLTnp+6rpma9YYQQYkF5FikW49PzkshI8rW2OUME CfXVLrMmKdrs8bdU979woiabAF/lbfwVViKE9ylcFb90Gd8q8OuISIxiI G/G2wYonA8n1kqGb8F4c2+Cbj/dWYoxIN0ntXLEzXZ/e89OgMG2ZS9A8U ubyYr6ybxwxxKyavKaH1sJaYgM78VCeR6BYLTX5PrdB/e10pTFAFs+RBa w==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="363965111" X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="363965111" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 05:33:38 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="708429477" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by FMSMGA003.fm.intel.com with ESMTP; 21 Sep 2022 05:33:37 -0700 From: Mathias Nyman To: Cc: , Mathias Nyman Subject: [PATCH 4/6] xhci: show fault reason for a failed enable slot command Date: Wed, 21 Sep 2022 15:34:48 +0300 Message-Id: <20220921123450.671459-5-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921123450.671459-1-mathias.nyman@linux.intel.com> References: <20220921123450.671459-1-mathias.nyman@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Show the completion code of a unsuccessful "enable slot" command. Add it in a human readable form to the existing error message. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index a7ef675f00fd..17f5dda913be 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4096,7 +4096,8 @@ int xhci_alloc_dev(struct usb_hcd *hcd, struct usb_device *udev) slot_id = command->slot_id; if (!slot_id || command->status != COMP_SUCCESS) { - xhci_err(xhci, "Error while assigning device slot ID\n"); + xhci_err(xhci, "Error while assigning device slot ID: %s\n", + xhci_trb_comp_code_string(command->status)); xhci_err(xhci, "Max number of devices this xHCI host supports is %u.\n", HCS_MAX_SLOTS( readl(&xhci->cap_regs->hcs_params1))); From patchwork Wed Sep 21 12:34:49 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 12983684 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AEEE0C6FA8E for ; Wed, 21 Sep 2022 12:33:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230027AbiIUMdy (ORCPT ); Wed, 21 Sep 2022 08:33:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60200 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230035AbiIUMdm (ORCPT ); Wed, 21 Sep 2022 08:33:42 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A62B85A8E for ; Wed, 21 Sep 2022 05:33:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663763621; x=1695299621; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=ONuKV2yLwKOThv/Ew9CFGPHNg7XL86muxyJ4gW2I6DA=; b=CywNwtKc2B3tCs5/IWs5i1Xvxa+0qfC6e6FP9yqMJZZMI99V5qrj/OJJ HqBjHgqHhf6Wiz2NOSjxWwTxBhqXxlK7DGLdKILwqqi9zz8dXX7Ef3jeB S28epn+tPkzQeUSDZkY7MsGr1wIaCVn2ZkjCPeU48YtTdA5AAJ8G8bNzw U9u6SnH15OdixBp/E2hVDwRHxMuL/Jd8zTmKC8q0yaz7DMNUegcvw0It9 kjcKLOh/j+DJ5dPxralUjcu8HPcyZVp7wWAqOu5wEYbK54HLGQUiLfGFm mT0xMM18xJp7mL7nmzE+Fr5QTigK5JOTTi2R43zXLml/6R2fHbW0Z4+oN A==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="363965116" X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="363965116" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 05:33:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="708429481" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by FMSMGA003.fm.intel.com with ESMTP; 21 Sep 2022 05:33:38 -0700 From: Mathias Nyman To: Cc: , Mathias Nyman Subject: [PATCH 5/6] xhci: remove unused command member from struct xhci_hcd struct Date: Wed, 21 Sep 2022 15:34:49 +0300 Message-Id: <20220921123450.671459-6-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921123450.671459-1-mathias.nyman@linux.intel.com> References: <20220921123450.671459-1-mathias.nyman@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org The u32 command was added to struct xhci_hcd over 10 years ago in commit 9777e3ce907d ("USB: xHCI: bus power management implementation") It wasn't even used back then, so remove it. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci.h | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 7caa0db5e826..fa352fb24867 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1827,7 +1827,6 @@ struct xhci_hcd { /* Host controller watchdog timer structures */ unsigned int xhc_state; unsigned long run_graceperiod; - u32 command; struct s3_save s3; /* Host controller is dying - not responding to commands. "I'm not dead yet!" * From patchwork Wed Sep 21 12:34:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 12983685 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id D0629ECAAD8 for ; Wed, 21 Sep 2022 12:33:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229677AbiIUMdz (ORCPT ); Wed, 21 Sep 2022 08:33:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229873AbiIUMdm (ORCPT ); Wed, 21 Sep 2022 08:33:42 -0400 Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2077C6FA2B for ; Wed, 21 Sep 2022 05:33:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1663763622; x=1695299622; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=rUgUhtASnaiK6eATLGtu+qD1PmTbCuly6GRZunE4fcU=; b=RwMfpQZQ0ljJzpzpQNf1E/hkaON69QckssVDiRCK5Sznc0YU2XeIgl6y Lw3eNB9luo0wbRAVe452yy5H+4tYuAPAiHvAN9cuib3U38dpfbJtxUg4w lil8R8gXUiSqYcktfUw02kHUrv+DZhqivXvOa42zDGHNgQYxXCYF1pbXR U/9tiJiq3ZYW7KsNp/Ru+dp8kWE0RPhsU125RLJjqIlYZw4eCm1ZubyUI ZMVpMW5lT06xshVhyJnmkf1ak0MAJiPThefiNKI9863vOpQNu9dRgNLwa dQp1tCz9X1N3z8sglxykM5GZiYoZ8dzcNZD0V2ZtN2bk2oufxBQ6U2x3O A==; X-IronPort-AV: E=McAfee;i="6500,9779,10477"; a="363965119" X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="363965119" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Sep 2022 05:33:41 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,333,1654585200"; d="scan'208";a="708429483" Received: from mattu-haswell.fi.intel.com ([10.237.72.199]) by FMSMGA003.fm.intel.com with ESMTP; 21 Sep 2022 05:33:40 -0700 From: Mathias Nyman To: Cc: , Mathias Nyman Subject: [PATCH 6/6] xhci: remove unused lpm_failed_dev member from struct xhci_hcd Date: Wed, 21 Sep 2022 15:34:50 +0300 Message-Id: <20220921123450.671459-7-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220921123450.671459-1-mathias.nyman@linux.intel.com> References: <20220921123450.671459-1-mathias.nyman@linux.intel.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org xhci used to test if link power management (LPM) capable USB2 devices really could enter and exit L1 state link state. Failed devices were added to a lpm_failed_dev list. This feature was removed 9 years ago in commit de68bab4fa96 ("usb: Don't enable USB 2.0 Link PM by default.") but lpm_failed_dev member was still left. Remove it now. Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index fa352fb24867..807fc4e47959 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1807,8 +1807,6 @@ struct xhci_hcd { struct xhci_erst erst; /* Scratchpad */ struct xhci_scratchpad *scratchpad; - /* Store LPM test failed devices' information */ - struct list_head lpm_failed_devs; /* slot enabling and address device helpers */ /* these are not thread safe so use mutex */