From patchwork Fri Dec 9 22:47:11 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Ray X-Patchwork-Id: 31946 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1029866wrr; Fri, 9 Dec 2022 14:53:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf5k60ssGxx6bSlq5nfE7utxRdkop7/dgnbN1GN159EhPp7nVGsvc9m6glp3P14tjrxIDa87 X-Received: by 2002:a17:906:70d0:b0:7c0:8371:97aa with SMTP id g16-20020a17090670d000b007c0837197aamr6781166ejk.28.1670626388277; Fri, 09 Dec 2022 14:53:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670626388; cv=none; d=google.com; s=arc-20160816; b=hHLGCS2/F1iGFsdJnzrMjbFPAV8PqQHmrgZsr1FMYtF4FWIxOqMCJRBOf/SnOuDnib 4QUpZgcx63/6NlKoluzh/mh7TGk9a/7ZeLSpEnmpgA4Jfm5ijvYNQV4ZvEyQK/wP5Yn/ JWHuTsOgI1xsHlPwMr/XPnjeHgPJVbC1EwkN1JmmlZfpt30H6o8wYgZoaSlhIplzhk3O Ruzh4XqO+ILIw+BSTq7ArDjpPDtDnLCFL63BL3zjtZlxd98imlHxXH9WZU+4Z0/t6+/r 6kqW91j0lGHcb0rVUEAyZZCxFyqvORrrZzM9/dsgcXYZQD8caRzXgFWhx6Ne6BNaE9Qn AHaA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id rv25-20020a17090710d900b007b5dd3e6995si607647ejb.917.2022.12.09.14.52.43; Fri, 09 Dec 2022 14:53:08 -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 + 99 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 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1751778735567642247?= X-GMAIL-MSGID: =?utf-8?q?1751778735567642247?= 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; }