From patchwork Tue Oct 16 11:37:08 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zeng Tao X-Patchwork-Id: 148905 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp4564193lji; Mon, 15 Oct 2018 20:32:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV63JZOazNQEtOCI9JweiabsheaYS3x5U4X4TwKlsBmPQIgex494gJ2q++8g00opT25jUpyFY X-Received: by 2002:a17:902:2909:: with SMTP id g9-v6mr14965613plb.223.1539660774846; Mon, 15 Oct 2018 20:32:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539660774; cv=none; d=google.com; s=arc-20160816; b=bAB5dj2UCImBernKbidmeVAd3guFp6KdlBBlhZIcvXa+Ej4Z+EZ7DZ9xTlwG8PpI/V Kx4A153bIbFWMB0v1SGUGHxuaIyhgdMmeOIdeJhviH//dxuWSWNXszAMaqPcSe0Gl1tN q171SQXWb4o67VLybnlUc7ihCd8azESkg6b+3yrHjxUECuCy5wTseu3p+PEmyzP8O/1e bvEojNtPhcO++TzqPxClrb2uIlfA1DuNI/z3HBR6Eptvnp1m9wFzl64+ryRlppj7mD7c PbF3HRdrNgLkQyIbysE1bPMg9cs3fCIa3jWQQx45lAEZVBBStl9VZcep74cjl8dtEL7n DzwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=Ba7bKMhwKw3LA1/TfxBDiGBZyY9/ZgtwEBE7/uIYWIE=; b=aBO0lBp7M81FG6vZm8wmP5FBqbwGxSgoc5lsPxsxjXtGaEw0aIQS16bFvc119cxtFm 00lYlH5yUvUidQA/OuHCmNqs5WGC17nwscXs4xin1x6/f9exhZcl3j1vTxYsf9XTxTBj nlp81ku24Qzm/rY9hDD2TnQzxbyTnUFNoncxv/wNpMPnOyfJVwSQOVdoBdf+5vVMnWbJ rglQzP1OT4OJBhG+RrcOE3WVbZIlC3B1De7Ks3MWWNstTIh23ZfK60OPHevj6dVDgldT 5zu+0f+/htySBMSNTw8eNzYSoaLvO11oMHwjC6eKG+k30Srompybv1Jzh8hFZcaHOVtU 6gHw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x1-v6si13904568pfx.105.2018.10.15.20.32.54; Mon, 15 Oct 2018 20:32:54 -0700 (PDT) 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727175AbeJPLVI (ORCPT + 5 others); Tue, 16 Oct 2018 07:21:08 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:13641 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726934AbeJPLVI (ORCPT ); Tue, 16 Oct 2018 07:21:08 -0400 Received: from DGGEMS410-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 08D09722F64C8; Tue, 16 Oct 2018 11:32:50 +0800 (CST) Received: from dessert.huawei.com (10.69.192.158) by DGGEMS410-HUB.china.huawei.com (10.3.19.210) with Microsoft SMTP Server id 14.3.399.0; Tue, 16 Oct 2018 11:32:44 +0800 From: Zeng Tao To: , CC: Zeng Tao , , Subject: [PATCH] xhci: remove the unused sw_lpm_support Date: Tue, 16 Oct 2018 19:37:08 +0800 Message-ID: <1539689828-35940-1-git-send-email-prime.zeng@hisilicon.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.69.192.158] X-CFilter-Loop: Reflected Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org 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. Acked-by: Mathias Nyman Signed-off-by: Zeng Tao --- 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 0420eef..d565d5a 100644 --- a/drivers/usb/host/xhci.c +++ b/drivers/usb/host/xhci.c @@ -4372,8 +4372,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 6230a57..746129d 100644 --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -1854,8 +1854,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 */