From patchwork Tue Jan 17 20:57:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Ray X-Patchwork-Id: 44856 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp2039846wrn; Tue, 17 Jan 2023 15:35:44 -0800 (PST) X-Google-Smtp-Source: AMrXdXuC3hVMw6PK3Fp0Y9B+btxQJ6ix/PmJDDrFysxZ9A3YSGndCzY19sHxmfi2n14ixWTxBBFF X-Received: by 2002:a17:907:9623:b0:869:236c:ac40 with SMTP id gb35-20020a170907962300b00869236cac40mr5823323ejc.31.1673998544329; Tue, 17 Jan 2023 15:35:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673998544; cv=none; d=google.com; s=arc-20160816; b=od+zGxExIxT9hufCXRUtX90xpG7hSwm8aqbLSS0KxFMp5690CLO59n4Q49JRq7wrsu bRPl2y31rbckUs7bYwouGlZDzwx6eJ4VHOYPitimxgSFNcOTUGWAPLOCLi0R2lN5gLmc 1NrC5fZyF7DGn+Vnz+jpUZRtXu16lkmLE+MOc3GXTnYORJLshG9LX07hB6BUmA4ZnvVl Zonvb6SR1onnH/1dysZ2SdKmGkm9691SdrZBEbbfTN/4aPkoAHWmipD9EroqNvX7/LJk 1Cmm8cWmyhX3361tPeDdmCJiiujPES5fqItyjD6QZgNoTdgAUKXzVWYeuheQIMFPNetE 5W7g== 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=ZbZFfnVZoDArTdNBMfEHNKiUXb8slOc5q1XCsYzXwU4=; b=zIybldnszBAtFQhRab22EPLKcuOSSMn/SbZPpCk4hXuPF1DtJnKKI6t04bEIUv3Iz6 PRFqoohJkatFhYX1kEveWxEYkJUp67dqF1GIq1ZkEgmnvPCyHiAFI93/7EExBRk9h9uM wEDu9fLP/2Fwuv7r71uyyE89pAK3BSdYNsx1GMgCHI9LjZ7pt5yEKb6X4B7LxJXgyNzN YfANNY2SbB47sJCzlhMof7G302E872wZTpXA77ZJHhG/1c7LXA1AhnKtmqD/9gVAnsk1 z4iJ9JeVmqxwDdUeMq9QON5B5cSYtslYYUBNZMVcZII5FFOg2zizjrrlm2V3M3ys+mi8 TVAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b="u/cPn3TB"; 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 nd21-20020a170907629500b0084d0ebd704bsi36893078ejc.71.2023.01.17.15.35.20; Tue, 17 Jan 2023 15:35:44 -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="u/cPn3TB"; 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 S230100AbjAQXcX (ORCPT + 99 others); Tue, 17 Jan 2023 18:32:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230039AbjAQXbf (ORCPT ); Tue, 17 Jan 2023 18:31:35 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E94FF8CE79; Tue, 17 Jan 2023 12:57:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673989040; x=1705525040; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=zwa4GW5jWlP5YXzoa6EZS1ONEyHsZM9zF0qwfkL82oY=; b=u/cPn3TBeaR7EUtcKm9aOx3pra/8vg/XJL8x7k6vollR0PPHlZabuPmD VUDMITc39AlgMjmA6KUcI3SPEuHrQeIKdmAtCwtC4JkAXAr7bdk+1YzHi wLm2+RExXuGDcIls924eXxfHlg/oVwaIEDdF/2Y6SpD4yHkAcowdxEIuq Vsk6B1AdrHaDAd3GqYeJx1rKTeZVjHkvI3bb5OVZUgEQKnZT3n2hKEBAO EESgYc+pnOdQTWKYstzYSZhB5y2guR8D9UTXP/nAvWEq0e5SkkxgXvVbQ 5bIFgbRFSkTL0HV69rlSgmn7cCGb5NyMwwCsYTYTKeuaJxFr4QzOlELzR w==; X-IronPort-AV: E=Sophos;i="5.97,224,1669100400"; d="scan'208";a="132797655" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 17 Jan 2023 13:57:15 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex04.mchp-main.com (10.10.85.152) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Tue, 17 Jan 2023 13:57:15 -0700 Received: from AUS-LT-C33025.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Tue, 17 Jan 2023 13:57:13 -0700 From: Jerry Ray To: Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , "Paolo Abeni" , Russell King , , , , Jerry Ray Subject: [net-next: PATCH v7 4/7] dsa: lan9303: write reg only if necessary Date: Tue, 17 Jan 2023 14:57:00 -0600 Message-ID: <20230117205703.25960-5-jerry.ray@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230117205703.25960-1-jerry.ray@microchip.com> References: <20230117205703.25960-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?1755314697353742503?= X-GMAIL-MSGID: =?utf-8?q?1755314697353742503?= As the regmap_write() is over a slow bus that will sleep, we can speed up the boot-up time a bit by 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 66466d50d015..a4decf42a002 100644 --- a/drivers/net/dsa/lan9303-core.c +++ b/drivers/net/dsa/lan9303-core.c @@ -915,8 +915,11 @@ static int lan9303_setup(struct dsa_switch *ds) 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); + } ret = lan9303_setup_tagging(chip); if (ret)