From patchwork Mon May 21 13:39:58 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mathias Nyman X-Patchwork-Id: 10415329 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CE0BD6032C for ; Mon, 21 May 2018 13:38:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BE8FE28806 for ; Mon, 21 May 2018 13:38:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B36BC288F6; Mon, 21 May 2018 13:38:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 42DCD28806 for ; Mon, 21 May 2018 13:38:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752525AbeEUNiA (ORCPT ); Mon, 21 May 2018 09:38:00 -0400 Received: from mga05.intel.com ([192.55.52.43]:64081 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751624AbeEUNh6 (ORCPT ); Mon, 21 May 2018 09:37:58 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 21 May 2018 06:37:58 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,426,1520924400"; d="scan'208";a="40976862" Received: from mattu-haswell.fi.intel.com ([10.237.72.164]) by fmsmga007.fm.intel.com with ESMTP; 21 May 2018 06:37:57 -0700 From: Mathias Nyman To: Cc: , Mathias Nyman Subject: [PATCH 10/18] xhci: rename faked_port_index to hcd_portnum Date: Mon, 21 May 2018 16:39:58 +0300 Message-Id: <1526910006-26104-11-git-send-email-mathias.nyman@linux.intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1526910006-26104-1-git-send-email-mathias.nyman@linux.intel.com> References: <1526910006-26104-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 X-Virus-Scanned: ClamAV using ClamSMTP hcd_portnum is a better desctiption than faked_port_index, and is in line with the name the port structure uses. No functional changes Signed-off-by: Mathias Nyman --- drivers/usb/host/xhci-ring.c | 41 +++++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 22 deletions(-) diff --git a/drivers/usb/host/xhci-ring.c b/drivers/usb/host/xhci-ring.c index 4d2d0e8..31b7213 100644 --- a/drivers/usb/host/xhci-ring.c +++ b/drivers/usb/host/xhci-ring.c @@ -1525,7 +1525,7 @@ static void handle_port_status(struct xhci_hcd *xhci, u32 portsc, cmd_reg; int max_ports; int slot_id; - unsigned int faked_port_index; + unsigned int hcd_portnum; struct xhci_bus_state *bus_state; __le32 __iomem **port_array; bool bogus_port_status = false; @@ -1560,10 +1560,10 @@ static void handle_port_status(struct xhci_hcd *xhci, else port_array = xhci->usb2_ports; - faked_port_index = port->hcd_portnum; + hcd_portnum = port->hcd_portnum; portsc = readl(port->addr); - trace_xhci_handle_port_status(faked_port_index, portsc); + trace_xhci_handle_port_status(hcd_portnum, portsc); if (hcd->state == HC_STATE_SUSPENDED) { xhci_dbg(xhci, "resume root hub\n"); @@ -1571,7 +1571,7 @@ static void handle_port_status(struct xhci_hcd *xhci, } if (hcd->speed >= HCD_USB3 && (portsc & PORT_PLS_MASK) == XDEV_INACTIVE) - bus_state->port_remote_wakeup &= ~(1 << faked_port_index); + bus_state->port_remote_wakeup &= ~(1 << hcd_portnum); if ((portsc & PORT_PLC) && (portsc & PORT_PLS_MASK) == XDEV_RESUME) { xhci_dbg(xhci, "port resume event for port %d\n", port_id); @@ -1588,29 +1588,28 @@ static void handle_port_status(struct xhci_hcd *xhci, * so we can tell the difference between the end of * device and host initiated resume. */ - bus_state->port_remote_wakeup |= 1 << faked_port_index; + bus_state->port_remote_wakeup |= 1 << hcd_portnum; xhci_test_and_clear_bit(xhci, port_array, - faked_port_index, PORT_PLC); - xhci_set_link_state(xhci, port_array, faked_port_index, + hcd_portnum, PORT_PLC); + xhci_set_link_state(xhci, port_array, hcd_portnum, XDEV_U0); /* Need to wait until the next link state change * indicates the device is actually in U0. */ bogus_port_status = true; goto cleanup; - } else if (!test_bit(faked_port_index, - &bus_state->resuming_ports)) { + } else if (!test_bit(hcd_portnum, &bus_state->resuming_ports)) { xhci_dbg(xhci, "resume HS port %d\n", port_id); - bus_state->resume_done[faked_port_index] = jiffies + + bus_state->resume_done[hcd_portnum] = jiffies + msecs_to_jiffies(USB_RESUME_TIMEOUT); - set_bit(faked_port_index, &bus_state->resuming_ports); + set_bit(hcd_portnum, &bus_state->resuming_ports); /* Do the rest in GetPortStatus after resume time delay. * Avoid polling roothub status before that so that a * usb device auto-resume latency around ~40ms. */ set_bit(HCD_FLAG_POLL_RH, &hcd->flags); mod_timer(&hcd->rh_timer, - bus_state->resume_done[faked_port_index]); + bus_state->resume_done[hcd_portnum]); bogus_port_status = true; } } @@ -1625,17 +1624,15 @@ static void handle_port_status(struct xhci_hcd *xhci, * so the roothub behavior is consistent with external * USB 3.0 hub behavior. */ - slot_id = xhci_find_slot_id_by_port(hcd, xhci, - faked_port_index + 1); + slot_id = xhci_find_slot_id_by_port(hcd, xhci, hcd_portnum + 1); if (slot_id && xhci->devs[slot_id]) xhci_ring_device(xhci, slot_id); - if (bus_state->port_remote_wakeup & (1 << faked_port_index)) { - bus_state->port_remote_wakeup &= - ~(1 << faked_port_index); + if (bus_state->port_remote_wakeup & (1 << hcd_portnum)) { + bus_state->port_remote_wakeup &= ~(1 << hcd_portnum); xhci_test_and_clear_bit(xhci, port_array, - faked_port_index, PORT_PLC); + hcd_portnum, PORT_PLC); usb_wakeup_notification(hcd->self.root_hub, - faked_port_index + 1); + hcd_portnum + 1); bogus_port_status = true; goto cleanup; } @@ -1647,15 +1644,15 @@ static void handle_port_status(struct xhci_hcd *xhci, * out of the RExit state. */ if (!DEV_SUPERSPEED_ANY(portsc) && - test_and_clear_bit(faked_port_index, + test_and_clear_bit(hcd_portnum, &bus_state->rexit_ports)) { - complete(&bus_state->rexit_done[faked_port_index]); + complete(&bus_state->rexit_done[hcd_portnum]); bogus_port_status = true; goto cleanup; } if (hcd->speed < HCD_USB3) - xhci_test_and_clear_bit(xhci, port_array, faked_port_index, + xhci_test_and_clear_bit(xhci, port_array, hcd_portnum, PORT_PLC); cleanup: