From patchwork Mon Jan 9 21:18:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jerry Ray X-Patchwork-Id: 41153 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4e01:0:0:0:0:0 with SMTP id p1csp2386426wrt; Mon, 9 Jan 2023 13:20:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXsHj2yDziGouq6x+Ys03OBUdXhpuvSwbVlBaJ3ZvODGpC+O1O9lcgUlv/g39TILnlN3MI+p X-Received: by 2002:a17:90a:5d13:b0:220:9794:249c with SMTP id s19-20020a17090a5d1300b002209794249cmr69575406pji.47.1673299219609; Mon, 09 Jan 2023 13:20:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673299219; cv=none; d=google.com; s=arc-20160816; b=qrhFTHst/vZlfGBBSth1E3o8D5VNXlg33NXQziDcbL6ZjrRCggLKA2FbGKrTy1XZqc FlIivpttpp34UY+/pleXmnsfx0uYr3TRL78vwbXCpRbVjnyebPBpvoaVzKUbLPelezAX RTMGF4IzhDJXtG6jbzkC5NUbZh3TpCYOGJeBPnq5RSHwL035ZWnHUNwFUbtAmj7fj6Ww zOflk56lt5RiKY6UmBqVs8hEpZARm9B8fqg5D9tVcrYcmoXyqBMJJmEljglM+1HLdYRr 7Sf/F5ua9d87utTQfQZ4sMyajCkzW+xhMSxT8m9NV78XMLBOCL7E3LXQabyyTT2uSTwj 2cQQ== 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=yx4airNtbVAiu4qOs67qaliwRRKay9ar5Z6sfaH/IgA=; b=lfT4hYUTeNz5cUqcOdOh6BrzzcDAZVNnxctEG6EYCH0rwdyGiNwF5SN4fV90YKuIF1 IoPNpu+HDw/OoqzZCZA6uHpO5djahC7nPNkY09LCGf6aNm7b+XD7JL6qLLmcS5F7fX6L hJroBHlXqyzUbdTok7Y5Djiukx4N5leEYAgExC+JVDAFziYdznfkBdxC2b1345Niomvt LrOqpfGJproIzeuFlnUn+MR8mbK0RxIEJ/agRtTXYvpKyXQeuRRDu9VI3hc02RbLqSDO Ozuht3r4DwasCKNDowpMpF5Zw2fwZreuByifYbfGeexhyEaTQTf10/pIlcJ1l+uGTuUm Jlxg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=fQKl1gKI; 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 fz7-20020a17090b024700b00225f3c4288bsi9698389pjb.160.2023.01.09.13.20.06; Mon, 09 Jan 2023 13:20:19 -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=fQKl1gKI; 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 S237933AbjAIVUB (ORCPT + 99 others); Mon, 9 Jan 2023 16:20:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57166 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237557AbjAIVTV (ORCPT ); Mon, 9 Jan 2023 16:19:21 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 692E619D; Mon, 9 Jan 2023 13:19:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1673299145; x=1704835145; h=from:to:subject:date:message-id:in-reply-to:references: mime-version; bh=+spUW6W7ItozH7ki1a6AOa72sASOb3/uSrDwr95CuuI=; b=fQKl1gKINI6V7utDwLl94rarT2dR6jCM5YyetMrIBKQeNLrXN28Hnbhe 9eRPlYbkRXdWVNKvKNVGFLzv1ys+W10bLTdGZLNOd2YzmCPyuNvVSCx2j czmcUPmMaoJD93ze6S6s0skaSGCyENVBWv9s1aIxz+mq2THbtoemKl1jO 5XQH6ZbU5YGiEhW8Hjl+qKTECn9C00n9QsnX+DJ0b+K+xbkhB1SAwy9ld qpg25VjSHrgkdm2BLu/+o9Ec9westopqqtNIQoU8ofmtRy5sIIA7LHhbU ldPIvBlU7fQW+LwVfWENUR5bfbQyDiijo985Q6QzUG+lwMYtwbfqdS0f+ g==; X-IronPort-AV: E=Sophos;i="5.96,313,1665471600"; d="scan'208";a="131543910" Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa6.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 09 Jan 2023 14:19:04 -0700 Received: from chn-vm-ex02.mchp-main.com (10.10.85.144) 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; Mon, 9 Jan 2023 14:19:04 -0700 Received: from AUS-LT-C33025.microchip.com (10.10.115.15) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server id 15.1.2507.16 via Frontend Transport; Mon, 9 Jan 2023 14:19:01 -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: [PATCH net-next v6 4/6] dsa: lan9303: write reg only if necessary Date: Mon, 9 Jan 2023 15:18:47 -0600 Message-ID: <20230109211849.32530-5-jerry.ray@microchip.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20230109211849.32530-1-jerry.ray@microchip.com> References: <20230109211849.32530-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?1754581402768977845?= X-GMAIL-MSGID: =?utf-8?q?1754581402768977845?= 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 8eee340f6464..792ce6a26a6a 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; }