Received: by 2002:a05:6500:1b8a:b0:1ef:a0f1:aef6 with SMTP id df10csp46253lqb; Sun, 10 Mar 2024 04:37:53 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUVJlTel4CnNKYeIV94zqOWI1MfnAwizBZDUDiqWzZMLAkwL2ATSQM+iKeLjX2XwqIVumZRiVmJmN9mZY8IFaQRdIxILenHH1dFMah2Hg== X-Google-Smtp-Source: AGHT+IHu5M394tfrVslzCuLaGolwzEkWHn+POebJ+RAnpcXUAHnmhUy+V487PHiBgIWHqOnjJHsC X-Received: by 2002:a17:903:184:b0:1db:3618:fed5 with SMTP id z4-20020a170903018400b001db3618fed5mr3855978plg.53.1710070672925; Sun, 10 Mar 2024 04:37:52 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710070672; cv=pass; d=google.com; s=arc-20160816; b=EIaSZ961PH8TXIiRcpeI8YKH2U2aUM1pBYvM0lbn3bRuLYu1K1HBDxh4RWJtErUqzJ zPLuJgGY5TX5sKm/+kiX8W23NoDFp5yserj45XeEcAJEemP2O4qHDvqqJPGhUGIK6XyB czrK99TF2q9EWVAj6WOokVQNk0o+srkCfZ3Spww/E8GccyadKZzH2jb2eRL2bVAS/vLy RKKeh43ek5o6zbETQDO0m4b+RGcq3SMry1JKVbc/MjeqH+VYmiYDZfZ2WBJTi5+pr3ci 4nvjQp6a9fq4R1stvpNH4ptWzyJ9sx/3XZrvX9fiVz3zjsqq0zHYcS9X9eCNfe8SXi9W yP9w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=mASIWn7m9jk5Q4PGzf1J/6AF8qI+Gxfz+QrXe9awrn0=; fh=eyen3nPfh50FEIjMsMQLzuobUObXZ8jmywPAnTuoCxM=; b=vcIfINu+bka41KscIBWZg0Vqh5MjTktnIzEy39GRz630lf7uCTaeQ8DB0MSRN1Hu4M R+sx4C0rb5Jqy/MhT87ZqYQnSAZDvlRYUdjP5iWlGEupv9JpedmyWNtpqZGG0aXYSP23 EqOdwkU6NnogqfO7+gJwUy8Q9ld/R81FvZ5/EpB7DujFfqw3wnnEt2BTcpOKvLLK560t Bxom989kvP7AzFvVh7gT8X0E3x3B2O9NOB6FW4bbZmmkWrWWxROpXobFGU5fTuIDgL// zmYxXIJZ5xK3Jfe2yxVvS2ARAKdT6l8enN0mlHQucIZCXF9bb6Lh9Nt8/H9S5v6MvV+e r5oQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aJKSzryx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-98199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id x9-20020a170902a38900b001dd7fc45425si2169976pla.56.2024.03.10.04.37.52 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 04:37:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=aJKSzryx; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-98199-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98199-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 984B3281619 for ; Sun, 10 Mar 2024 11:37:52 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C54E2200D6; Sun, 10 Mar 2024 11:37:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="aJKSzryx" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id ECC708465; Sun, 10 Mar 2024 11:37:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710070664; cv=none; b=cN7sTYINoLywm0KFQFNAqOI9+0ZDhI81cLuWKJVcMnHp1pDfi5eNWAodxFNoFwR4VBn5XXdqlD2W1VhSxF2sWzfe0EAdYMuDER3Tw1a7CLf283rm+HcPpqxu+Z4SkyPyLHPf0hd05c3YzL6PQJIfboSzvj/wBKyRSQR2pSJ7Xew= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710070664; c=relaxed/simple; bh=m7RZczD1dDV032y05IlmdDOzJwvwGNZyOWRvNsYwM+U=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ONTHjPgg/acfHCess93Ovgk1NM7LU+s61Af7hd3fx9z9Q29ar0vbklJd2F/K29SxaRcAOgQ/rbSnTbCurrc3qLN6GcbWTT5WCsn9QXaVGgBzOB1UjDAvwcV7/qZ46hgMFXZ61zgQ0o4RCG3iEMB/0dvVuH9QS39ll2YKc5NPAS8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=aJKSzryx; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 37024C433C7; Sun, 10 Mar 2024 11:37:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710070663; bh=m7RZczD1dDV032y05IlmdDOzJwvwGNZyOWRvNsYwM+U=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aJKSzryxcgu8cb6ktkPYMCQJoAlK7Sv2qXMupZoGls10vgj7PrUNhEChSUg2btniC HN8/c5vySOXnleF8r+xzpJcmhNiBiQ73XnkUqwXRHyRcd2o4tsMKcwlqPjNo+8aJjY LuydjTZenav48Yzf/Q1JE/QCf29OlXxe8NF6ELIeizL2Udoaqc6KcaVjyAYMHbLtkP e4jVIQI6txHLrjYc4EBokpt92tk7L7SCfRhdQ8qJ+RdJFsfu3kSdNdWZkcpIgvneis FTDrnxQDXOEH+OSEXLqB+RnvfpE38/MZ3ElyNDrS1VLWuScJ1kDCfyMDrhjfH9C+11 /lE7/3bg0ZeUg== Date: Sun, 10 Mar 2024 11:37:38 +0000 From: Simon Horman To: Krzysztof Kozlowski Cc: Luiz Angelo Daros de Luca , Linus Walleij , Alvin =?utf-8?Q?=C5=A0ipraga?= , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH net-next 2/4] net: dsa: realtek: keep default LED state in rtl8366rb Message-ID: <20240310113738.GA1623@kernel.org> References: <20240310-realtek-led-v1-0-4d9813ce938e@gmail.com> <20240310-realtek-led-v1-2-4d9813ce938e@gmail.com> <388b435f-13c5-446f-b265-6da98ccfd313@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <388b435f-13c5-446f-b265-6da98ccfd313@kernel.org> On Sun, Mar 10, 2024 at 09:01:46AM +0100, Krzysztof Kozlowski wrote: > On 10/03/2024 05:51, Luiz Angelo Daros de Luca wrote: > > This switch family supports four LEDs for each of its six ports. Each > > LED group is composed of one of these four LEDs from all six ports. LED > > groups can be configured to display hardware information, such as link > > activity, or manually controlled through a bitmap in registers > > RTL8366RB_LED_0_1_CTRL_REG and RTL8366RB_LED_2_3_CTRL_REG. > > > > After a reset, the default LED group configuration for groups 0 to 3 > > indicates, respectively, link activity, link at 1000M, 100M, and 10M, or > > RTL8366RB_LED_CTRL_REG as 0x5432. These configurations are commonly used > > for LED indications. However, the driver was replacing that > > configuration to use manually controlled LEDs (RTL8366RB_LED_FORCE) > > without providing a way for the OS to control them. The default > > configuration is deemed more useful than fixed, uncontrollable turned-on > > LEDs. > > > > The driver was enabling/disabling LEDs during port_enable/disable. > > However, these events occur when the port is administratively controlled > > (up or down) and are not related to link presence. Additionally, when a > > port N was disabled, the driver was turning off all LEDs for group N, > > not only the corresponding LED for port N in any of those 4 groups. In > > such cases, if port 0 was brought down, the LEDs for all ports in LED > > group 0 would be turned off. As another side effect, the driver was > > wrongly warning that port 5 didn't have an LED ("no LED for port 5"). > > Since showing the administrative state of ports is not an orthodox way > > to use LEDs, it was not worth it to fix it and all this code was > > dropped. > > > > The code to disable LEDs was simplified only changing each LED group to > > the RTL8366RB_LED_OFF state. Registers RTL8366RB_LED_0_1_CTRL_REG and > > RTL8366RB_LED_2_3_CTRL_REG are only used when the corresponding LED > > group is configured with RTL8366RB_LED_FORCE and they don't need to be > > cleaned. The code still references an LED controlled by > > RTL8366RB_INTERRUPT_CONTROL_REG, but as of now, no test device has > > actually used it. Also, some magic numbers were replaced by macros. > > > > Signed-off-by: Luiz Angelo Daros de Luca > > Reviewed-by: Linus Walleij > > This is the first version, so where did review happen? FWIIW, I think this relates to review of an RFC of this patch-set. https://lore.kernel.org/netdev/CACRpkda8tQ2u4+jCrpOQXbBd84oW98vmiDgU+GgdYCHuZfn49A@mail.gmail.com/