From patchwork Fri Dec 7 14:19:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 153161 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp550844ljp; Fri, 7 Dec 2018 06:16:03 -0800 (PST) X-Google-Smtp-Source: AFSGD/XGlqy3DR3NKv8qxnFuonakQimmQGl5NIut6FOQAzSMXMhA/OW3a+eyVOP14aprltyFrqOK X-Received: by 2002:a17:902:2867:: with SMTP id e94mr2328311plb.264.1544192162883; Fri, 07 Dec 2018 06:16:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544192162; cv=none; d=google.com; s=arc-20160816; b=TBv+5oUaJ+nSpnvx3dmGHVadg0Kty0A6L3UIqxCtiChpQKK5b3t95aEWgKrpozzOQ+ JGUecPWREKOaxDR6txyIKH7iDQtOBX9Jg8h0VUtATIvZybWniikFlpFUHrn/kJ2z6kY1 I63gm3bBCCwp8IT2jNn0a3jjkhk7q8LJGgKZNd/TZq3baG+O8tXBQVo47NlXwRQo/zio mVLxuC825tqJKOkDznVhBKbpCbjhlD9oh77NYbgrL26S+Fgtu7cMMcz8EwkJVLnk0F9z IhJQ6HHXK3DTlXd9QAPBX0LfJU+MhokebSS/7uisinKbQxSCvW5zw4wZ+MNcdJEUHgLS 9svw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=+BQGwgZFoI3zFgHyTXBzr8MmioCYZ/O6osQ1fs8CbpM=; b=LzsCUaZOrCM9xtxGwZsHRf0FxfhK+9FqcG7NUl4iasC+wijuHKNd1P/kfJRW05swc0 sw64yfUb6NwZgbaytiEtcS/nESX1hthXFh5TXsd1VpC3SuWU26dl9e3RNc0fXxAInmd/ ASZ0fE+kV6LoArOhtHdfm1IPLIYih+84zwt8nX2nIe/YI8vAzfQ4xlgkhpm2yox75K0N ZmMAqHA/ljTwJElayI5IAfH3K1vL1ywqi0cNhppI7mzoVQdKOPEuHO37bNm7T4V+d42O slw++x8YVHMcmUTGKbuyww+Itl6yQMgVvaJX3rkdtlyeerWyhN9oQjNLOaIhPP434c/9 8etw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 92si3015813pld.84.2018.12.07.06.16.02; Fri, 07 Dec 2018 06:16:02 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-usb-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726054AbeLGOQB (ORCPT + 5 others); Fri, 7 Dec 2018 09:16:01 -0500 Received: from mga02.intel.com ([134.134.136.20]:27872 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726010AbeLGOQB (ORCPT ); Fri, 7 Dec 2018 09:16:01 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Dec 2018 06:15:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,326,1539673200"; d="scan'208";a="105672596" Received: from mattu-haswell.fi.intel.com ([10.237.72.164]) by fmsmga007.fm.intel.com with ESMTP; 07 Dec 2018 06:15:47 -0800 From: Mathias Nyman To: Cc: , Zeng Tao , Mathias Nyman Subject: [PATCH 1/8] xhci: remove the unused sw_lpm_support Date: Fri, 7 Dec 2018 16:19:29 +0200 Message-Id: <1544192376-6619-2-git-send-email-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544192376-6619-1-git-send-email-mathias.nyman@linux.intel.com> References: <1544192376-6619-1-git-send-email-mathias.nyman@linux.intel.com> Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org From: Zeng Tao It is introduced for the pre-0.96 xHC controllers, and the driver only support HW LPM for 1.0 and later controllers.It's not actually used now and is thought not to be used in the future any more, so just remove it. Signed-off-by: Zeng Tao Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-mem.c | 20 ++++---------------- drivers/usb/host/xhci.c | 3 +-- drivers/usb/host/xhci.h | 2 -- 3 files changed, 5 insertions(+), 20 deletions(-) -- 2.7.4 diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c index b1f27aa..791c5d8 100644 --- a/drivers/usb/host/xhci-mem.c +++ b/drivers/usb/host/xhci-mem.c @@ -2181,23 +2181,11 @@ static void xhci_add_in_port(struct xhci_hcd *xhci, unsigned int num_ports, if (major_revision < 0x03 && xhci->num_ext_caps < max_caps) xhci->ext_caps[xhci->num_ext_caps++] = temp; - /* Check the host's USB2 LPM capability */ - if ((xhci->hci_version == 0x96) && (major_revision != 0x03) && - (temp & XHCI_L1C)) { + if ((xhci->hci_version >= 0x100) && (major_revision != 0x03) && + (temp & XHCI_HLC)) { xhci_dbg_trace(xhci, trace_xhci_dbg_init, - "xHCI 0.96: support USB2 software lpm"); - xhci->sw_lpm_support = 1; - } - - if ((xhci->hci_version >= 0x100) && (major_revision != 0x03)) { - xhci_dbg_trace(xhci, trace_xhci_dbg_init, - "xHCI 1.0: support USB2 software lpm"); - xhci->sw_lpm_support = 1; - if (temp & XHCI_HLC) { - xhci_dbg_trace(xhci, trace_xhci_dbg_init, - "xHCI 1.0: support USB2 hardware lpm"); - xhci->hw_lpm_support = 1; - } + "xHCI 1.0: support USB2 hardware lpm"); + xhci->hw_lpm_support = 1; } port_offset--; diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c index c928dbb..553e974 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4370,8 +4370,7 @@ static int xhci_update_device(struct usb_hcd *hcd, struct usb_device *udev) struct xhci_hcd *xhci = hcd_to_xhci(hcd); int portnum = udev->portnum - 1; - if (hcd->speed >= HCD_USB3 || !xhci->sw_lpm_support || - !udev->lpm_capable) + if (hcd->speed >= HCD_USB3 || !udev->lpm_capable) return 0; /* we only support lpm for non-hub device connected to root hub yet */ diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h index 260b259..59b8562 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1858,8 +1858,6 @@ struct xhci_hcd { struct xhci_port *hw_ports; struct xhci_hub usb2_rhub; struct xhci_hub usb3_rhub; - /* support xHCI 0.96 spec USB2 software LPM */ - unsigned sw_lpm_support:1; /* support xHCI 1.0 spec USB2 hardware LPM */ unsigned hw_lpm_support:1; /* cached usb2 extened protocol capabilites */