Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1578296pxb; Mon, 8 Mar 2021 00:39:31 -0800 (PST) X-Google-Smtp-Source: ABdhPJzpZXf2Ie2/8A9hh2cuvZgeMc8RjUgQjhToyr8Rigu48TSSQZdZRktrjAEuyWIIt6tXp+My X-Received: by 2002:a05:6402:3075:: with SMTP id bs21mr21076814edb.274.1615192771204; Mon, 08 Mar 2021 00:39:31 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1615192771; cv=none; d=google.com; s=arc-20160816; b=Z6iNl82w25N7ZXUZYmhcAsUGrMbzlzpptFvFjVQKeR1sp1a0r5icEsqWskHWYJP7RB /7BBoWip3BNxoQYaggPDnDLWPrcqCAiGWd1Wa2tLNPV5Nx3aJj+do4v4DhxKFrGC7zwY bcOgGwpGq8AkBZac6NPWbat0vbLZuDlr/tcuFonxPn94sbidh3qq47PD0uKKIfodI8TI pW6oG9/vEOLjcf0NjWno1rEbFmZBpdOxaSWdmX5758V9c2q0qrC86Bz6ibrifC73qVc9 u9yKppohOEZHqCOl1qoChQ1qcVsfI/PYikqInlI/1eSzBfmMK5ffawQf3sGVwKo7hZz+ O+nQ== 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=qEktDUneTKBHoToA9YH0EMX32o3RNXBHARNA28MTb1g=; b=w1btBImCd4hwF1b+7bti8bIjsthejD3tTWPKnmrPwo9eTRkYIxx5Z+CXGm28KgFarB ul28IjocMfJ1YPg0d0AyTzl1z0tk99QETqypOWddXu7FuEis/qWRzP9QvhsSDSrqFzP8 /gTKHWFk6uj1oiUz9LHBhOt7jT/pTTkQqkgWdVtyrvH5WZ8YL8asmfj5+AJcQaI89usz Embwt30eGxx51z0y8rKlg5314oC6uENUY0HOQmh8gyLEUefshpXhv8KZfBmCixKK9uxo 2V3mlFsuc4Intr3H06RDHx2kjHLfpVr1mUlb9FYkrVH3S9nT6tTstRwdprhjhcVRyzxo mW7g== 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 si28si6529933ejb.106.2021.03.08.00.39.09; Mon, 08 Mar 2021 00:39:31 -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 S233742AbhCHCwl (ORCPT + 99 others); Sun, 7 Mar 2021 21:52:41 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:36471 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S232400AbhCHCwX (ORCPT ); Sun, 7 Mar 2021 21:52:23 -0500 X-UUID: 6e7d53ffdf034c7fa9a24dbc3dbeefae-20210308 X-UUID: 6e7d53ffdf034c7fa9a24dbc3dbeefae-20210308 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] 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 1639849672; Mon, 08 Mar 2021 10:52:16 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Mon, 8 Mar 2021 10:52: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; Mon, 8 Mar 2021 10:52:13 +0800 From: Chunfeng Yun To: Mathias Nyman , Greg Kroah-Hartman , Ikjoon Jang CC: Chunfeng Yun , Matthias Brugger , , , , , Nicolas Boichat , Eddie Hung , Sergei Shtylyov , Alan Stern , stable Subject: [PATCH v2 01/18] usb: xhci-mtk: remove or operator for setting schedule parameters Date: Mon, 8 Mar 2021 10:51:50 +0800 Message-ID: X-Mailer: git-send-email 1.8.1.1.dirty MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: B7FEDE61C5E0257C605BDFB5FFB6D6E4B57ABE7FFA305F1606D8A400FE2FB4BC2000:8 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 --- v2: no changes --- 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