Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1857636pxb; Fri, 5 Mar 2021 01:04:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJxqeoNtQz1badew/z2Cgo+5mQmq4HxEUiWcCwROMvp4Nr5rWRIiCNSzyw29Tyq+nUyljYZr X-Received: by 2002:a17:906:53d7:: with SMTP id p23mr1428456ejo.140.1614935091311; Fri, 05 Mar 2021 01:04:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614935091; cv=none; d=google.com; s=arc-20160816; b=mDaBJ28hydBap/sQP79Tu+WUwE0ZZs7dZRN9VWepplMKG6hvIkxyfr65l/qvmPaCDN EJGdFGKa0MVTKpJ4L+OF6N2kePf6jk4NhuLQZowfPNiB1AaQeemGUUWp27JHIe5+5Pjn ycx2JY1MbTTgnt0rFpJDXM+vWtYuTW0wVuND5FPtneb1e7eFK2GPjQ1yf8HNe2tGTWz7 FTBK7rLG97Z9/yrka4U8y18Oxd7tkspeVXLddZ9Fjn3yhV4HjCdO2whle9o6k7Ey/gYK K1scxJK0Uv2lsidtQS0oYTRYejdUUEB5Y8d8Pz4Wr7A5wxB2I4+ydHMUXq5Vj7ztd7Bs /DfA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from; bh=cJaUH0nk6XQJ8TQW51ayFPKxfGlsaoPdTaHhJ0LstM0=; b=TtTcFxSTJLcIcOkZuL0TeX463nfZCahc2HeSTmjxBpc0d9pDznrOV5D69RAWecJYoV s9FIYhAfoNio9Pmg/XisvYx7tSDYF2ICOt2Ojiim+585lZ+HtXTbK4DfPJ1tPtWC4W5x hJVGQenAhvoCXtSn1k2TqYoq53MZgZyZRL7LXUgAQPM/RyzIIdO6uAm/yqWHWc5fXO9C ktoeGhJLteJfMzQ+v8QxHcx34/lO5Jb75bouKEEFgQb6sNtlz/my1dVxcMh3x6h1ZvOs mFjBsXKUfjlIgXvepPL70bPgkOCCV30V97FIMpu7KGCWHfCFnZzfB3dUu8/zBMjVSeqI sdKw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dn18si990585ejc.590.2021.03.05.01.04.28; Fri, 05 Mar 2021 01:04:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229591AbhCEJDb (ORCPT + 99 others); Fri, 5 Mar 2021 04:03:31 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:44130 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S229674AbhCEJDU (ORCPT ); Fri, 5 Mar 2021 04:03:20 -0500 X-UUID: a1e477d3cc52436eaddd3ad09e6bf530-20210305 X-UUID: a1e477d3cc52436eaddd3ad09e6bf530-20210305 Received: from mtkmrs01.mediatek.inc [(172.21.131.159)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.14 Build 0819 with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 322041104; Fri, 05 Mar 2021 17:03:16 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 5 Mar 2021 17:03:14 +0800 Received: from localhost.localdomain (10.17.3.153) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 5 Mar 2021 17:03:13 +0800 From: Chunfeng Yun To: Mathias Nyman , Greg Kroah-Hartman , Ikjoon Jang CC: Chunfeng Yun , Matthias Brugger , , , , , Nicolas Boichat , Eddie Hung , stable Subject: [PATCH 01/17] usb: xhci-mtk: remove or operator for setting schedule parameters Date: Fri, 5 Mar 2021 17:02:39 +0800 Message-ID: <1614934975-15188-1-git-send-email-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Side effect may happen if use or operator to set schedule parameters when the parameters are already set before. Set them directly due to other bits are reserved. Fixes: 54f6a8af3722 ("usb: xhci-mtk: skip dropping bandwidth of unchecked endpoints") Cc: stable Signed-off-by: Chunfeng Yun --- drivers/usb/host/xhci-mtk-sch.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index b45e5bf08997..5891f56c64da 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -643,7 +643,7 @@ int xhci_mtk_add_ep_quirk(struct usb_hcd *hcd, struct usb_device *udev, */ if (usb_endpoint_xfer_int(&ep->desc) || usb_endpoint_xfer_isoc(&ep->desc)) - ep_ctx->reserved[0] |= cpu_to_le32(EP_BPKTS(1)); + ep_ctx->reserved[0] = cpu_to_le32(EP_BPKTS(1)); return 0; } @@ -730,10 +730,10 @@ int xhci_mtk_check_bandwidth(struct usb_hcd *hcd, struct usb_device *udev) list_move_tail(&sch_ep->endpoint, &sch_bw->bw_ep_list); ep_ctx = xhci_get_ep_ctx(xhci, virt_dev->in_ctx, ep_index); - ep_ctx->reserved[0] |= cpu_to_le32(EP_BPKTS(sch_ep->pkts) + ep_ctx->reserved[0] = cpu_to_le32(EP_BPKTS(sch_ep->pkts) | EP_BCSCOUNT(sch_ep->cs_count) | EP_BBM(sch_ep->burst_mode)); - ep_ctx->reserved[1] |= cpu_to_le32(EP_BOFFSET(sch_ep->offset) + ep_ctx->reserved[1] = cpu_to_le32(EP_BOFFSET(sch_ep->offset) | EP_BREPEAT(sch_ep->repeat)); xhci_dbg(xhci, " PKTS:%x, CSCOUNT:%x, BM:%x, OFFSET:%x, REPEAT:%x\n", -- 2.18.0