Received: by 10.213.65.68 with SMTP id h4csp485603imn; Fri, 16 Mar 2018 09:10:25 -0700 (PDT) X-Google-Smtp-Source: AG47ELu9sQ3TLX4z5sO4Ev/pBtAH2hsa3+k6BUbSVZ9D+VtsYvardqdsJJ8C1eI1Oj8xP3lyPdQY X-Received: by 2002:a17:902:7c94:: with SMTP id y20-v6mr2742816pll.314.1521216625747; Fri, 16 Mar 2018 09:10:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521216625; cv=none; d=google.com; s=arc-20160816; b=ZOsssGgtKQfFjOcPCWmrgyVbuyYxeF6gCGRgaNITAqf7uEoRIScVDespmHPJgBfKO3 QOAg9bZ90yauu8yEMPa/Jw9fRoRQPyodifP6g8owYsKh49/FUAsbj7tNZz05qviIFmzz Hf0Ot1fLzbjUKojloyvk6ard2iEExy8iFHXjD+adNPNOsHpSvF9NiyH0JUKaT/TRhtid a8y69oEk0risr0V2EkenPB8uf11DuntbA09o0/8jFEKCvIm5sMdSs25V7NjCygVhBAF+ KTwc3ZhclW4lEblSDfLh97wI43nPdNBew6K6UE3ydFFEfK1jyma0pfAtWcza2VVPvLbw nwtw== 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=3+K4xk4btDk7+ao9alL1Oho5b0EFx3PUYQEPrRLLdTU=; b=kLOlXtTtMaVrLh5b0DNUS+s8qiVLconmINrg7GahwFcS9T//V6SpXv62+LN+QhJA8u FupmoNknBLxcsi7FVdKywDwbqmFSvQpXuoxy/bvvmctW2+x2KxNH+P1MZmlmYnM62QaU Dhft/xn6l+5VCQXHIHP+OH5YKnsGq+9KsoxE+v39IYbm3N8dN5M0NFDyXT927UThD8KF +S8i2dRfk6qzoAyGbEZkWtBuMnD1+BMfrO40vXNVe0eC1jwH5EBznwINxSq/7h2MGSpU JjGXrs7j6GbNKXbZJY0s3vblnRDy2Sy1l21XuCj359sA29XB0xDdF52SqGegyXG9REx3 +5nw== 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 m10-v6si7056104pln.595.2018.03.16.09.10.11; Fri, 16 Mar 2018 09:10:25 -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 S965141AbeCPPlC (ORCPT + 99 others); Fri, 16 Mar 2018 11:41:02 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:43808 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965099AbeCPPkz (ORCPT ); Fri, 16 Mar 2018 11:40:55 -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 3C613EE4; Fri, 16 Mar 2018 15:40:55 +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.15 008/128] xhci: fix endpoint context tracer output Date: Fri, 16 Mar 2018 16:22:29 +0100 Message-Id: <20180316152336.631551411@linuxfoundation.org> X-Mailer: git-send-email 2.16.2 In-Reply-To: <20180316152336.199007505@linuxfoundation.org> References: <20180316152336.199007505@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.15-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 @@ -718,11 +718,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. */ @@ -2538,21 +2539,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);