From patchwork Fri May 7 02:11:24 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12243903 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32239C433B4 for ; Fri, 7 May 2021 02:14:06 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6FAE06113D for ; Fri, 7 May 2021 02:14:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6FAE06113D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Im4SWblZ84qdNpGaprjj+iFEM7p6HhUth2xkgQD/wCo=; b=nMiPE8eP3BUplDIgfiokYQRYbp r2jsp5IpZRsK2+8lh8V0PjrGpVm6sgNzEsbQpN4swNpGfMKMObDW59WMeaAt0UgYwfTAKDgSrrF+9 44NbuMRoCtHMWfz/hyGyL6FllVzWog9EI2mT7q1hTi+9HuPDhgQ6EEoG+wv0dtm4UyFmSnkquT6Wf pnEzA1bi4o0yBwAPlAKxyP6aKvvAAtvIpZNxFYzzXMdHPmVwD6sQ8W2Xi3JTiCxkfIMaFV+a+VOd+ ZaQeOI2m8EZxJVF7XU/vSYP9iY7cR/AwkhF2tNhuYFWFpcUCJ3in2MFk1i2X2xublaeCxX4x4uLHD 8TU3uNxw==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lepyL-005q90-3o; Fri, 07 May 2021 02:12:09 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lepxu-005q4t-5O; Fri, 07 May 2021 02:11:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From:Sender:Reply-To: Content-ID:Content-Description:In-Reply-To:References; bh=+CRFEW7jC3GF7ncxsEto7imsYG75x1r73+pauOuqj1w=; b=A3Yr4iWzoQiz66D/ebud7QnpkN wqLabeAAp0gNZa4MKgsFljl9ttVtcKFQKJjplrGjIb0lky/6Weivnqh64kovD/JNlhyfPyWmoUbCd gf4Yl9i8dYCqtJkK1thq1+r5uIJZ9+65nKh7OveGoYEVF67xbfocP4BsIrgJ+ViVRVj00930m7Bk2 gVXfHbAMvapdiIYI6Z4hUPV2VeJh/xPTImyrjTBjrReoE8fuZpOxZt/NFd0yN/5JiwKDyeR8ZNW8P hu/ymQesjnDdOosAW+MHPzKqSHP6Uh2M7F+YaHbAOeynXQ5p813U/PWeQbMNaY/830l82simeRwJl Lkv49aYw==; Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lepxr-006WKP-F8; Fri, 07 May 2021 02:11:40 +0000 X-UUID: 0a8a0073eaec4017b9af1f86cfdaa292-20210506 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=+CRFEW7jC3GF7ncxsEto7imsYG75x1r73+pauOuqj1w=; b=QKeUkQHWTgmiiP3B1zU6V9G2HtNVczCnPXOq8aNLYXAD3v1j0xFcA6oPCQOtqtsVxstXnk6TNm/aIwKjFZXYADOuNtUIpaTORXiJiMBWpd/d36aX/OvCoqe6KX5KfgUVyOPBY2UZQvHtGVgQXNJwqavc6I3H/bLc6Nlm8Umzy40=; X-UUID: 0a8a0073eaec4017b9af1f86cfdaa292-20210506 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 656585801; Thu, 06 May 2021 19:11:32 -0700 Received: from MTKMBS06N1.mediatek.inc (172.21.101.129) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 6 May 2021 19:11:30 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 10:11:29 +0800 Received: from mtkslt301.mediatek.inc (10.21.14.114) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 May 2021 10:11:29 +0800 From: Chunfeng Yun To: Mathias Nyman CC: Chunfeng Yun , Greg Kroah-Hartman , Matthias Brugger , , , , , "Ikjoon Jang" , Eddie Hung , "Sergei Shtylyov" Subject: [PATCH v3 1/4] usb: xhci-mtk: use bitfield instead of bool Date: Fri, 7 May 2021 10:11:24 +0800 Message-ID: <20210507021127.54717-1-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_191139_535456_19220494 X-CRM114-Status: GOOD ( 11.59 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use bitfield instead of bool in struct Refer to coding-style.rst 17) Using bool: "If a structure has many true/false values, consider consolidating them into a bitfield with 1 bit members, or using an appropriate fixed width type, such as u8." Signed-off-by: Chunfeng Yun --- v3: split @has_ippc out into anather patch suggested by Greg v2: add more changelog suggested by Greg --- drivers/usb/host/xhci-mtk.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/usb/host/xhci-mtk.h b/drivers/usb/host/xhci-mtk.h index cd3a37bb73e6..94a59b3d178f 100644 --- a/drivers/usb/host/xhci-mtk.h +++ b/drivers/usb/host/xhci-mtk.h @@ -138,17 +138,17 @@ struct xhci_hcd_mtk { struct mu3h_sch_bw_info *sch_array; struct list_head bw_ep_chk_list; struct mu3c_ippc_regs __iomem *ippc_regs; - bool has_ippc; int num_u2_ports; int num_u3_ports; int u3p_dis_msk; struct regulator *vusb33; struct regulator *vbus; struct clk_bulk_data clks[BULK_CLKS_NUM]; - bool lpm_support; - bool u2_lpm_disable; + unsigned int has_ippc:1; + unsigned int lpm_support:1; + unsigned int u2_lpm_disable:1; /* usb remote wakeup */ - bool uwk_en; + unsigned int uwk_en:1; struct regmap *uwk; u32 uwk_reg_base; u32 uwk_vers; From patchwork Fri May 7 02:11:25 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12243905 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D702C433ED for ; Fri, 7 May 2021 02:14:07 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C9B5761157 for ; Fri, 7 May 2021 02:14:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9B5761157 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WNkroYzR+jZCLpzsdZqkjq5SeWSH3RYGYueisHQOfis=; b=PNjd2sD4HUC937vqTg3ExR/tD zlqeU1EOGidealP+O7trPCZKogIDASIvMeJF0Iotn5Fkd7yK2g1+ipIoyVHqmvdy8s7iYn5xvOYB6 m3eF3SThJ0GHoYNHDz8RrO0MAlh8ayPwu10cOL5G4mobjBIo0N4BLWIdWR9AmQd6V3RMPq6E74hoq DmG633SKd0bmTF7aA1NnX90aUTUZqPDTUuwppBBV3+v6bsqXh8wKPCMsye93K6LkvNsB5oHwshBIv oMjezhyMj9QeN7OaGSEhZorJ2tSP4+bnMzsqV54n+ogV9knaFPFATcXoPCeGUOQN1g41xu8WCCYgf seQgUX/Kg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lepye-005qBL-KN; Fri, 07 May 2021 02:12:28 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lepxt-005q4m-Ef; Fri, 07 May 2021 02:11:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=00KTnH39cnFiWCckLKVXZT6Fhz11QcyPqbGpOK2H5iw=; b=p88WVrdacdlO4vVLMYGLod+VqX Op4Ey5wEOVatygvwzXMsQqZdiX4RVuIeKTWWJWKBoyomcFBkll+nqgpq13xFNIVNGvlApqSnadiYk k3bqdtVtKb7q9AsKZQkCREWUpc+rIlHVzaw9v/Bef+y3Py8xoSe3gDkYq/ouSgn10uvfQcGLwXrGA VA7u3XThgqOd7hwCQCU+SBdW1g29sCh42yKSt7s1Tg55xsKL3AFcUkheT73uL+6P7jdUcmZVZ2nBa i5FZhdiMBu4Wu7PnvOQNMTdWgX5EkGEGS55GM9rrrq7Nycu5TH+ueIamY5/sC/hiQOx5Mfby+nMQy LnWF+5gQ==; Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lepxq-006WKy-Bj; Fri, 07 May 2021 02:11:39 +0000 X-UUID: d7590db66dcf4a30846b8454abb6b5c6-20210506 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=00KTnH39cnFiWCckLKVXZT6Fhz11QcyPqbGpOK2H5iw=; b=WUrT20F6+Z/9wxDU53JFZNFwnLpqxfaKdn+0GxH/3Q4qSOm/MmtSaIdy3c4izUoH+wBy9YrCzUlqri/LY+QjfLZM+CcMqU6NRVgQzQ1mFfq4iShISrtJQrlsaoJ7O8u7Jr5R+iTvntC7hsu0vAOZ7YAg3TproWyh1sr/iRYxEAk=; X-UUID: d7590db66dcf4a30846b8454abb6b5c6-20210506 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 746435417; Thu, 06 May 2021 19:11:33 -0700 Received: from MTKMBS06N2.mediatek.inc (172.21.101.130) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 6 May 2021 19:11:31 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 10:11:29 +0800 Received: from mtkslt301.mediatek.inc (10.21.14.114) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 May 2021 10:11:29 +0800 From: Chunfeng Yun To: Mathias Nyman CC: Chunfeng Yun , Greg Kroah-Hartman , Matthias Brugger , , , , , "Ikjoon Jang" , Eddie Hung , "Sergei Shtylyov" Subject: [PATCH v3 2/4] usb: xhci-mtk: remove unnecessary setting of has_ippc Date: Fri, 7 May 2021 10:11:25 +0800 Message-ID: <20210507021127.54717-2-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210507021127.54717-1-chunfeng.yun@mediatek.com> References: <20210507021127.54717-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: EDB69650B5819A47EFB3C763348CDA24389B7BFCA6749B257CB08F83C37B88772000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_191138_430630_9F1734B7 X-CRM114-Status: UNSURE ( 9.73 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Due to @has_ippc's default value is 0, no need set it again if fail to get ippc base address Signed-off-by: Chunfeng Yun --- v3: new patch suggested by Greg fix typo suggested by Sergei --- drivers/usb/host/xhci-mtk.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/host/xhci-mtk.c b/drivers/usb/host/xhci-mtk.c index b2058b3bc834..2548976bcf05 100644 --- a/drivers/usb/host/xhci-mtk.c +++ b/drivers/usb/host/xhci-mtk.c @@ -495,8 +495,6 @@ static int xhci_mtk_probe(struct platform_device *pdev) goto put_usb2_hcd; } mtk->has_ippc = true; - } else { - mtk->has_ippc = false; } device_init_wakeup(dev, true); From patchwork Fri May 7 02:11:26 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12243907 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 681FEC43460 for ; Fri, 7 May 2021 02:14:07 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C9B236113D for ; Fri, 7 May 2021 02:14:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C9B236113D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=a9v5jz1V32i+gdYSkgAyKeYBtNB/aD8Qmc0vkViVi8M=; b=QeBmiCGTSPVYnT0fSyNVd9ska mlOFTc8OQ44IJmVcC6Jrh68p3pHnsD7ppuCH13rP/Jsl2qyqAqxkHT4xo4cOZ9zqBIdjxpScWIm8e UPRhMq8Y3LH5eHxckmEX6DitAjEgyDaxA06v+SL8K/FaSBymW742bxcvhHTCQQqPTB3f/XdX1pIOY w/0Smx4QDEZzh7KfvS9OxFdLIkaceC93tHqewXFNP/5RKjIvUDkRHVGOwKXC+xV9wvig/bYgSN3Qe SA6HjA9v/nK+YsDDdG8X95Q1xuqrwFSW6ZuP1TXRJtrdpKzgNYvtt/Yz/ylS08fr6sg4HIuWAXFbs fsjYAn+FQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lepyA-005q77-Ez; Fri, 07 May 2021 02:11:59 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lepxu-005q4y-Dk; Fri, 07 May 2021 02:11:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=EjVRhoPkxXWDaApQU9bxloU2ZCGQXN4O/z7YWCF/ydA=; b=ofNRKmGQ/asIbCbFam38s4F799 LDQj/OvPvEKCjmdofwV/VY3O12WQGbxZ5ZTol15DdrF922TNyeQq4OLWyrbAHrvljglWwfInrydqD B/a0NCLuK5/76jFEWtydmeii6zeegiL7ScddS0YVvF8iikbRUeztILkL/U0OFUkJS7iQVQFZA1Kme LFS4nv6UECotcXAS44Zgk9hsb6/3NUn7VkunXJmbxV4+VAJHys1Fy/zYkVBqj4xU7e8aOnsrsjx3P m6mCBUWfMW/gyK5u8Utx9UKNbg+TerKnK6pX/hust3bzlHCvy3QWDtze/gKVrkARSY8uccpBYK5Tn jJP6AIHQ==; Received: from mailgw02.mediatek.com ([216.200.240.185]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lepxr-006WKk-F8; Fri, 07 May 2021 02:11:41 +0000 X-UUID: e7d8334c71904794a9b2fd3cdbcc7324-20210506 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=EjVRhoPkxXWDaApQU9bxloU2ZCGQXN4O/z7YWCF/ydA=; b=PO885voywAQ7XKlHOfYbxRM5ddTadSoCHgPZl2B2aRI0NzesN1vzDFYNO5SUwh4hvEa1KEUuC6s6TpfI/T3pWyeHms3qcLCSth2bjsYVTqKi+mrFsqVEPdv458XBzWDnyBkjSaMo9SyyGBAwvs206YBQoDeXMPo+UgBVQwuolTQ=; X-UUID: e7d8334c71904794a9b2fd3cdbcc7324-20210506 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw02.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1018154527; Thu, 06 May 2021 19:11:32 -0700 Received: from MTKMBS06N1.mediatek.inc (172.21.101.129) by MTKMBS62DR.mediatek.inc (172.29.94.18) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 6 May 2021 19:11:31 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n1.mediatek.inc (172.21.101.129) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 10:11:29 +0800 Received: from mtkslt301.mediatek.inc (10.21.14.114) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 May 2021 10:11:29 +0800 From: Chunfeng Yun To: Mathias Nyman CC: Chunfeng Yun , Greg Kroah-Hartman , Matthias Brugger , , , , , "Ikjoon Jang" , Eddie Hung , "Sergei Shtylyov" Subject: [PATCH v3 3/4] usb: xhci-mtk: remove unnecessary assignments in periodic TT scheduler Date: Fri, 7 May 2021 10:11:26 +0800 Message-ID: <20210507021127.54717-3-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210507021127.54717-1-chunfeng.yun@mediatek.com> References: <20210507021127.54717-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_191139_534144_15006939 X-CRM114-Status: GOOD ( 14.42 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Ikjoon Jang Remove unnecessary variables in check_sch_bw(). No functional changes, just for better readability. Signed-off-by: Ikjoon Jang Signed-off-by: Chunfeng Yun --- v2~3: no changes --- drivers/usb/host/xhci-mtk-sch.c | 37 +++++++++++++-------------------- 1 file changed, 14 insertions(+), 23 deletions(-) diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index 8b90da5a6ed1..9fb75085e40f 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -476,6 +476,9 @@ static int check_sch_tt(struct mu3h_sch_ep_info *sch_ep, u32 offset) u32 start_cs, last_cs; int i; + if (!sch_ep->sch_tt) + return 0; + start_ss = offset % 8; if (sch_ep->ep_type == ISOC_OUT_EP) { @@ -603,54 +606,42 @@ static u32 get_esit_boundary(struct mu3h_sch_ep_info *sch_ep) static int check_sch_bw(struct mu3h_sch_bw_info *sch_bw, struct mu3h_sch_ep_info *sch_ep) { + const u32 esit_boundary = get_esit_boundary(sch_ep); + const u32 bw_boundary = get_bw_boundary(sch_ep->speed); u32 offset; - u32 min_bw; - u32 min_index; u32 worst_bw; - u32 bw_boundary; - u32 esit_boundary; - u32 min_num_budget; - u32 min_cs_count; + u32 min_bw = ~0; + int min_index = -1; int ret = 0; /* * Search through all possible schedule microframes. * and find a microframe where its worst bandwidth is minimum. */ - min_bw = ~0; - min_index = 0; - min_cs_count = sch_ep->cs_count; - min_num_budget = sch_ep->num_budget_microframes; - esit_boundary = get_esit_boundary(sch_ep); for (offset = 0; offset < sch_ep->esit; offset++) { - if (sch_ep->sch_tt) { - ret = check_sch_tt(sch_ep, offset); - if (ret) - continue; - } + ret = check_sch_tt(sch_ep, offset); + if (ret) + continue; if ((offset + sch_ep->num_budget_microframes) > esit_boundary) break; worst_bw = get_max_bw(sch_bw, sch_ep, offset); + if (worst_bw > bw_boundary) + continue; + if (min_bw > worst_bw) { min_bw = worst_bw; min_index = offset; - min_cs_count = sch_ep->cs_count; - min_num_budget = sch_ep->num_budget_microframes; } if (min_bw == 0) break; } - bw_boundary = get_bw_boundary(sch_ep->speed); - /* check bandwidth */ - if (min_bw > bw_boundary) + if (min_index < 0) return ret ? ret : -ESCH_BW_OVERFLOW; sch_ep->offset = min_index; - sch_ep->cs_count = min_cs_count; - sch_ep->num_budget_microframes = min_num_budget; return load_ep_bw(sch_bw, sch_ep, true); } From patchwork Fri May 7 02:11:27 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunfeng Yun X-Patchwork-Id: 12243909 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 03C75C43462 for ; Fri, 7 May 2021 02:14:08 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 95E5261154 for ; Fri, 7 May 2021 02:14:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 95E5261154 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=mediatek.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:CC:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YeK04Vrx9SRnHsWwPhzo6yEW16oQDgqZbV3s5D4WWC4=; b=N5YyYfzyGyWQiDh16R+fxltn6 /Lr7v+FBqW4ple0JimyY82a8YsFlYhbElLyuL30dUQXRMw/BidBQlUleAR6kh0MVXRs4OGvRxsinr A9BIVSTSDx5J6trWFQnBt1NNa3DMzzvtheHEAB0/jxUSJlgTp5ec7wZrqZsWbzJEIS31w06XBzchL yr/y/QNv4EkLm6VVE6qb2Cra4HCM8mvB2WUPUx2qwA1sgscpZA3eFzS5xcoezUkkJ1AUl4ku2KRjw kZzk/PXjqGdZAMbMV6By9xABWw/xsD4CDbQWGy/nizIpMxso0Di+eP4l91Z8tA0pGcuyxE//wfkda M40W94qgQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lepyT-005q9m-UO; Fri, 07 May 2021 02:12:19 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lepxt-005q4n-Ef; Fri, 07 May 2021 02:11:47 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC: To:From:Sender:Reply-To:Content-ID:Content-Description; bh=NPgTcIgW2uDi8Jb3tOlGTVkuqdYHCq5ukEckW6p8fnM=; b=uIir3VL+4osW0I4iXzF+kLUiRA mvQdmWiQvy2UNKa/BMBAWfbiR5fttrL5+4OQG6vjoEs/o+b03NZmmVe3BKmxyALG9RJFg/qrUvdB2 xRb5CptQNJlazt+ewGuKEGqSM20itO2slrPPosC1h/+qcggNAS4rXkhiJbh9B+kSJDaG9r8YOY6+q UmiQj3jKx78x+ndzh1xuXCoGioI1c6UbahF7w9bcYn4lJgR87QsStwLTC6ctRUb+/YuObRSMkVu8G IwzlOjHBsZv2yj7V2P0W2iq226ZIHwHDoizSLngKrvLuLVm9WT6ejKElvOttq9TAeo+xa8tDAf+lG 4nPB42Cg==; Received: from mailgw01.mediatek.com ([216.200.240.184]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lepxq-006WKl-Bi; Fri, 07 May 2021 02:11:39 +0000 X-UUID: 0dd3db02a96d441a9da3197e3177cf63-20210506 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Transfer-Encoding:Content-Type:MIME-Version:References:In-Reply-To:Message-ID:Date:Subject:CC:To:From; bh=NPgTcIgW2uDi8Jb3tOlGTVkuqdYHCq5ukEckW6p8fnM=; b=IHzRZxwK91GrLh1b/IpjqHfAAmQUaSnCXXdOvjSoh9xK7xjVAmcsoyNcJ0twDWFc/QGY0R7FsYPRq4ns4OdfZMGrrUiMQDIIaIuv/a0P8EmOd0spdHF2nkbmXVbRrAm8CpfMsIZpn666FKQE0RS8ESPyxxrBCjBFQIhvy/zetxY=; X-UUID: 0dd3db02a96d441a9da3197e3177cf63-20210506 Received: from mtkcas66.mediatek.inc [(172.29.193.44)] by mailgw01.mediatek.com (envelope-from ) (musrelay.mediatek.com ESMTP with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1920907830; Thu, 06 May 2021 19:11:33 -0700 Received: from MTKMBS06N2.mediatek.inc (172.21.101.130) by MTKMBS62N1.mediatek.inc (172.29.193.41) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 6 May 2021 19:11:32 -0700 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs06n2.mediatek.inc (172.21.101.130) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Fri, 7 May 2021 10:11:30 +0800 Received: from mtkslt301.mediatek.inc (10.21.14.114) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Fri, 7 May 2021 10:11:29 +0800 From: Chunfeng Yun To: Mathias Nyman CC: Chunfeng Yun , Greg Kroah-Hartman , Matthias Brugger , , , , , "Ikjoon Jang" , Eddie Hung , "Sergei Shtylyov" Subject: [PATCH v3 4/4] usb: xhci-mtk: use first-fit for LS/FS Date: Fri, 7 May 2021 10:11:27 +0800 Message-ID: <20210507021127.54717-4-chunfeng.yun@mediatek.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20210507021127.54717-1-chunfeng.yun@mediatek.com> References: <20210507021127.54717-1-chunfeng.yun@mediatek.com> MIME-Version: 1.0 X-TM-SNTS-SMTP: 0269824944F8711192F45F979C6A83DEF9026876C84B90A1EAD5F5ECE6A8B7732000:8 X-MTK: N X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210506_191138_430800_DE011329 X-CRM114-Status: GOOD ( 10.12 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Use first-fit instead of best-fit for LS/FS devices under TT, we found that best-fit will consume more bandwidth for some cases. Signed-off-by: Chunfeng Yun --- v3: no changes --- drivers/usb/host/xhci-mtk-sch.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/usb/host/xhci-mtk-sch.c b/drivers/usb/host/xhci-mtk-sch.c index 9fb75085e40f..c07411d9b16f 100644 --- a/drivers/usb/host/xhci-mtk-sch.c +++ b/drivers/usb/host/xhci-mtk-sch.c @@ -634,6 +634,11 @@ static int check_sch_bw(struct mu3h_sch_bw_info *sch_bw, min_bw = worst_bw; min_index = offset; } + + /* use first-fit for LS/FS */ + if (sch_ep->sch_tt && min_index >= 0) + break; + if (min_bw == 0) break; }