Received: by 10.213.65.68 with SMTP id h4csp509484imn; Fri, 16 Mar 2018 09:56:09 -0700 (PDT) X-Google-Smtp-Source: AG47ELuU25s/kFYrJREsF0hjXllsbUsHpB+kNcy1a6HM76bwUY6gQ4HgJ+uwUnSngWlHxUZxZs9w X-Received: by 10.99.155.1 with SMTP id r1mr2023297pgd.422.1521219369285; Fri, 16 Mar 2018 09:56:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521219369; cv=none; d=google.com; s=arc-20160816; b=MTnBgkRSH27gmIdrYg8RTvZISVUrKZtyuta88llZ4fwX8bWKYGI7k/Ko4u8oPIcL4z zd9eRqNfkP+87+aDpfhQRnaHjx+NtQqQEV4JnCma5hhDs75z6onV8jAU/5OjSLwyh9iG 5LdQynsNXwxVPV35OmkChX7BZNBfVXw2lBxiGjes//Npuk6IbrXAlsC5tSZ90hg7ch/2 ccCCDePMhZo191nAhcJnCnwBndnUO9QYa90gIr5EVa81EclG4yRB/pHluLe7z9TBnjoB g0ZxMUKqxl04noPbrPUdcK/IwhCbcE4yMAnQyoih+vGuS60AOx7UuA72X4CAXFZ/pTPl uAZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=PFv6opqgNStawK57ZydPR32cAAotgoz2S+jUcyaJ9kE=; b=TPPCukAcLNOZDVOgHJnHYjibmJKrjTKRUZFwomXaUW+5FMAgZ6tpCUnVaV8EuJzBSP hvUmoEyLAqOZhkEcdvosBueSgx+8sluW5WzTn1H/3N+ZCk59Qf7tKEKougAX79bcZX7F F7wiHFby1TMIaHe2NPSxxyenYP+2wiCZ/jP4yamaZtppUZeqex66Q0HFa1cBeVqhhXYd tnh4TNEv679P+NSI3Jt4idDrDsTFi9mxXGzkcK4lUE6WkXKA+StS38Ky3oPDsPDO4H8i WoUNwoUzGKtcZ+aI1h4T0iLAMvDc74GNsQOYpTfegyWjGRmHGRqdQCsiuJJTsR8lbW9k Vf3g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 f12si5078565pgo.625.2018.03.16.09.55.54; Fri, 16 Mar 2018 09:56:09 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-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-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753492AbeCPQy7 (ORCPT + 99 others); Fri, 16 Mar 2018 12:54:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:39278 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933448AbeCPPeG (ORCPT ); Fri, 16 Mar 2018 11:34:06 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 6D71EF2F; Fri, 16 Mar 2018 15:34:05 +0000 (UTC) From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathias Nyman Subject: [PATCH 4.14 010/109] xhci: fix endpoint context tracer output Date: Fri, 16 Mar 2018 16:22:39 +0100 Message-Id: <20180316152330.422245941@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152329.844663293@linuxfoundation.org> References: <20180316152329.844663293@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Mathias Nyman commit 97ef0faf575e03b352553f92c9430cb4c0431436 upstream. Fix incorrent values showed for max Primary stream and Linear stream array (LSA) values in the endpoint context decoder. Fixes: 19a7d0d65c4a ("usb: host: xhci: add Slot and EP Context tracers") Cc: # v4.12+ Signed-off-by: Mathias Nyman Signed-off-by: Greg Kroah-Hartman --- drivers/usb/host/xhci.h | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) --- a/drivers/usb/host/xhci.h +++ b/drivers/usb/host/xhci.h @@ -728,11 +728,12 @@ struct xhci_ep_ctx { /* bits 10:14 are Max Primary Streams */ /* bit 15 is Linear Stream Array */ /* Interval - period between requests to an endpoint - 125u increments. */ -#define EP_INTERVAL(p) (((p) & 0xff) << 16) -#define EP_INTERVAL_TO_UFRAMES(p) (1 << (((p) >> 16) & 0xff)) -#define CTX_TO_EP_INTERVAL(p) (((p) >> 16) & 0xff) -#define EP_MAXPSTREAMS_MASK (0x1f << 10) -#define EP_MAXPSTREAMS(p) (((p) << 10) & EP_MAXPSTREAMS_MASK) +#define EP_INTERVAL(p) (((p) & 0xff) << 16) +#define EP_INTERVAL_TO_UFRAMES(p) (1 << (((p) >> 16) & 0xff)) +#define CTX_TO_EP_INTERVAL(p) (((p) >> 16) & 0xff) +#define EP_MAXPSTREAMS_MASK (0x1f << 10) +#define EP_MAXPSTREAMS(p) (((p) << 10) & EP_MAXPSTREAMS_MASK) +#define CTX_TO_EP_MAXPSTREAMS(p) (((p) & EP_MAXPSTREAMS_MASK) >> 10) /* Endpoint is set up with a Linear Stream Array (vs. Secondary Stream Array) */ #define EP_HAS_LSA (1 << 15) /* hosts with LEC=1 use bits 31:24 as ESIT high bits. */ @@ -2540,21 +2541,22 @@ static inline const char *xhci_decode_ep u8 burst; u8 cerr; u8 mult; - u8 lsa; - u8 hid; + + bool lsa; + bool hid; esit = CTX_TO_MAX_ESIT_PAYLOAD_HI(info) << 16 | CTX_TO_MAX_ESIT_PAYLOAD(tx_info); ep_state = info & EP_STATE_MASK; - max_pstr = info & EP_MAXPSTREAMS_MASK; + max_pstr = CTX_TO_EP_MAXPSTREAMS(info); interval = CTX_TO_EP_INTERVAL(info); mult = CTX_TO_EP_MULT(info) + 1; - lsa = info & EP_HAS_LSA; + lsa = !!(info & EP_HAS_LSA); cerr = (info2 & (3 << 1)) >> 1; ep_type = CTX_TO_EP_TYPE(info2); - hid = info2 & (1 << 7); + hid = !!(info2 & (1 << 7)); burst = CTX_TO_MAX_BURST(info2); maxp = MAX_PACKET_DECODED(info2);