Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3478465rwb; Fri, 9 Dec 2022 15:19:51 -0800 (PST) X-Google-Smtp-Source: AA0mqf7iWumCcEkm/mB8/bW4yhwYUSwOdORH3ChjwxPB+Q+qmJICVzR70670sAwglLsOOr2eZDt3 X-Received: by 2002:a05:6a21:329d:b0:ac:10:adfe with SMTP id yt29-20020a056a21329d00b000ac0010adfemr11818762pzb.30.1670627991660; Fri, 09 Dec 2022 15:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670627991; cv=none; d=google.com; s=arc-20160816; b=F49RhcmKOku+qjISUFOO2Keb3lTLpPDkZa5iwTusTg04p2KlHBsoVEV23MSeASiw4K 8it7eOSxBUvfZQXTB3ul7wVcEGQjWgzSeNNgF+k1JT0ORm2zlSqflpNdZtatMKkLbddp 6Xq6MN8SE/WAqWLM+p830UlCz6QymmwOEFyY7lSu+nnKxptriA3d/Lhk3H6zO0A664X5 D/IDthRPaBgB5p27CWwAqmzNvICfmqoIlcVyOshsqUoBF3j2G08stRTqEHamtaUlqh27 1b4Tv44JTKoa5XKnJ3juhVQig8xw2iPrknshb2QY6UVfsdN1GuGGvRYhgcLYHqvtA481 bgbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:to:from:dkim-signature; bh=UU0ssHiXfET+hqVagIrjrzQ0MzF4VHIU8OBAjoMRpW4=; b=E4VyqAZ72ednMvhyqWd4+HOdiAVY9Jiw9H0f/k9aV1AYyL0t9b791tx7vBCOq0T6wc icnnvx5VxTlH+OHcF6eklwfvcTWKVoZ3UGMM4peSwhybYU6Lxhk0YUKyiSvuTENwlU1z LNDeH7AyvuQOh50D4H3bYTF97n/kz2NWZPTTrOYMMlqwPiN6m5fsfOsBUw4ywUkf3sEg trA1QwMS6omcoCsakyNfWWX3G7zsu1znvBmuAwjmn22qlv9JMrOnALyl3K5UX75ACTHb 5nVgsQDtPB2lXhQjldlQ+uu81vzBVa12zvYpb1SOVBefeAOpJOJevssOWH77wvD5cidH OpGg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=PpkHHs37; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 10-20020a63010a000000b004611cfaca6asi2696658pgb.381.2022.12.09.15.19.41; Fri, 09 Dec 2022 15:19:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=PpkHHs37; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229876AbiLIWrp (ORCPT + 74 others); Fri, 9 Dec 2022 17:47:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44494 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229885AbiLIWrV (ORCPT ); Fri, 9 Dec 2022 17:47:21 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.153.233]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 69499A5DE4; Fri, 9 Dec 2022 14:47:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1670626040; x=1702162040; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=01J1GdfGeDpMqj5EEuZPKItLr8DiKEKk/dDza5yX0co=; b=PpkHHs37s77kPHiDMUJG1YQGSUS+MiBZ2E+Jf6VbtXjRAiljUCmj5oo+ cjsPXbxXjqvAhAIlBbBzJ+WYfvJ6x82IUwthUfgpuArnZ0JKpknFnXxyb 4bameXe1tJOqbyg2CjDRSYhs4yePjTgi62/acZfhX+TX+LLVc4B3FPKs/ azJ9revQuxKwR2qNZdLxLbc/4HZ5GBiNCbvyTyhTCR3Qe69nHacNCim2o XXK0JrpQdF1JBkHRetziDjzBAT//ybYUYGKK4yyKjkQP2CLVUQNHHmhTb 27t5Oi8slqJ1ujO4bQa+tv51YDcs9QyU+LjroP1BjLIp6mZf7seKw32hs Q==; X-IronPort-AV: E=Sophos;i="5.96,232,1665471600"; d="scan'208";a="203381009" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa1.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Dec 2022 15:47:19 -0700 Received: from chn-vm-ex03.mchp-main.com (10.10.85.151) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.12; Fri, 9 Dec 2022 15:47:19 -0700 Received: from AUS-LT-C33025.microchip.com (10.10.115.15) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server id 15.1.2507.12 via Frontend Transport; Fri, 9 Dec 2022 15:47:18 -0700 From: Jerry Ray To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , , , , , Jerry Ray Subject: [PATCH net-next v5 4/6] dsa: lan9303: Performance Optimization Date: Fri, 9 Dec 2022 16:47:11 -0600 Message-ID: <20221209224713.19980-5-jerry.ray@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20221209224713.19980-1-jerry.ray@microchip.com> References: <20221209224713.19980-1-jerry.ray@microchip.com> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org As the regmap_write() is over a slow bus that will sleep, we can speed up the boot-up time a bit my not bothering to clear a bit that is already clear. Signed-off-by: Jerry Ray --- drivers/net/dsa/lan9303-core.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303-core.c index b0f49d9c3d0c..694249aa1f19 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -891,8 +891,11 @@ static int lan9303_check_device(struct lan9303 *chip) if (ret) return (ret); - reg &= ~LAN9303_VIRT_SPECIAL_TURBO; - regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, reg); + /* Clear the TURBO Mode bit if it was set. */ + if (reg & LAN9303_VIRT_SPECIAL_TURBO) { + reg &= ~LAN9303_VIRT_SPECIAL_TURBO; + regmap_write(chip->regmap, LAN9303_VIRT_SPECIAL_CTRL, reg); + } return 0; } -- 2.17.1