Received: by 2002:ab2:c01:0:b0:1ef:a04a:229c with SMTP id b1csp21366lqb; Sun, 10 Mar 2024 00:02:07 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUIgi6/eNqotB0CvSZLEUgw8F0tPTrcEvmOAFeqVJbi1UzrzbwWETVxNf5lGu+JaCNaZTT4DfMYWzK+neKnCx/H6oCWcXUrJkMV/mcolg== X-Google-Smtp-Source: AGHT+IHS+R9xU5XQZpNfAomvZogC3S9/eTqpknnyicJ7qNWVFTjronScwrIfWZiw/to1x+O2HE+i X-Received: by 2002:a05:6a00:1491:b0:6e6:8e7e:8bd3 with SMTP id v17-20020a056a00149100b006e68e7e8bd3mr96831pfu.21.1710057727456; Sun, 10 Mar 2024 00:02:07 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1710057727; cv=pass; d=google.com; s=arc-20160816; b=gYP7Y2+J3PCk8EizaaSpgC7zr4CUYbhCxGJ8Irx00khL5LFLM/mKZtABYt4ZuCnOVU Nrib9MJCDHaO/PdvIOppXSIAYd0ZS1MSI6Ih8JudUp2+Km/NH5ptzZgKmea2QW3gojTq U+1yp1eErPlzoDvjB7qhB/mWDcRjTf0Kzfi85Cg7INH5a4u+Gq7O5l7twZucU2iBqE8Y d+dIpMHn4mrR3Z8LelIVXTZ/8MjqNqWP6JomkeTvLWMoi+vJyJ+yAIVBRqEu7Lf/pOBt RzD8/52x3amiuEPC4hhZ/pi3hvyMCoRgJ0akZNXFnN+HtnKdKDMwnTgt8KxJRQWvsDVe LLNg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:autocrypt:from:references:cc :to:content-language:subject:user-agent:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:date:message-id :dkim-signature; bh=j4ahSdnaCt/u/pU0oTH4/k1MYMHxRjxQia14xcAWqPs=; fh=oO4/55DbVaLeQZmSjab6jDopfW7RZOGG4wZ9kDLOb1o=; b=nmD+Bw274hrHX7eGh94Gpsebr0U2UHOOGLDPyCDfGUwsefOLhREQd8IB38GTC5fGEL h6fZPF3IRPmyp42k4nVPbrUeACkyeCLxiRGT27LJooL1uocQchFLw2ZJzPdOqsbLQdyM CIufwJWxBzrk+06dOJ1vNq5QI1x/Q2fvLdkW/PrTgVvI1R3uWMl2pw1eOxLRiieU4Y5O aHK/dDDPeJJv2e9fbf9HlLgjOaojLqV7BcgsgiuVCO0zSu4NIregTS89hwXnbd3VcwS1 8Onu7flti7adQH8SHRaJxHahF9anNwFcuYsqAcCJ3n8+hXpd/iGbWOiMVzUkQtb6QqXq SDgg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BTM29pPX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-98147-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98147-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. [139.178.88.99]) by mx.google.com with ESMTPS id jo15-20020a056a00908f00b006e5eab67913si2789768pfb.403.2024.03.10.00.02.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 10 Mar 2024 00:02:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-98147-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=BTM29pPX; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-98147-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-98147-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 1F2C62833AF for ; Sun, 10 Mar 2024 08:02:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DA4E417BA4; Sun, 10 Mar 2024 08:01:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="BTM29pPX" 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 D3DB5FBED; Sun, 10 Mar 2024 08:01:54 +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=1710057715; cv=none; b=QmF+y+acfnTeEXYPllwWlqd1fcXYUijPS5rYsexx0JuykMz1IzkhnT4miU/UAGJ5BoAsm4oOQ65vEMuIwMKH3tsnJIExhTSsxoxZcMIsnIRfmPbdjiPWYdAqxZYnZHtwbipCAdQdBtaSSz4zFesdkK0yraIkZvx+aZkWV8NeXEc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710057715; c=relaxed/simple; bh=E+MxDKe+KsHvPmTBqM2DlpPwW2CIuyWdH49cjntutmM=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=lmFfneJuV21gukMUqH9AmRQGRhO8GocuNsy+e5VRSujP0UyY966sqNGcEfrQaogmkvw7ePdIxUFTQO3ZMIynjch+ZV89CDwMrgZgnT/OLYH2JB/eYENG4Ra0kUR0KIbx9D0nJstZiZE0HmSpWtWWGM+MKjaJ9AKxJPyqjp54A50= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=BTM29pPX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8E8B8C433F1; Sun, 10 Mar 2024 08:01:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1710057714; bh=E+MxDKe+KsHvPmTBqM2DlpPwW2CIuyWdH49cjntutmM=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=BTM29pPXzOQTpyAHRPKU0QJU36DOLFVueJxGoagskCfVBYukYDCYdXotdsL9ZGB7l Wns2j8gZgTtC2Zv76ZfLU/0Q/rUATM86YNGoX+Th4OAeD8btpUxCqEsmiIgVrPkr37 gMCDFCO77cjUh4IxZ7yCoMeYJeFEZuZvmoOFudSUu8oLEHmfzu7s/w8t22zCDAJRnM TzhxZcZzniS8IBs+Xjr46JUSxrI5aK81Vt2j6KMB1hyfs7ALjbQkQWqJ0vOmucPjIA 67oC/x9sslk7GuvzQsfrw9X0qn5WVFrq2wc7TWYSiOzbNu+IZRHSvPOM3XdZvjj52A ZEKD4fviV1Z4w== Message-ID: <388b435f-13c5-446f-b265-6da98ccfd313@kernel.org> Date: Sun, 10 Mar 2024 09:01:46 +0100 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH net-next 2/4] net: dsa: realtek: keep default LED state in rtl8366rb Content-Language: en-US To: Luiz Angelo Daros de Luca , Linus Walleij , =?UTF-8?Q?Alvin_=C5=A0ipraga?= , Andrew Lunn , Florian Fainelli , Vladimir Oltean , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni Cc: netdev@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240310-realtek-led-v1-0-4d9813ce938e@gmail.com> <20240310-realtek-led-v1-2-4d9813ce938e@gmail.com> From: Krzysztof Kozlowski Autocrypt: addr=krzk@kernel.org; keydata= xsFNBFVDQq4BEAC6KeLOfFsAvFMBsrCrJ2bCalhPv5+KQF2PS2+iwZI8BpRZoV+Bd5kWvN79 cFgcqTTuNHjAvxtUG8pQgGTHAObYs6xeYJtjUH0ZX6ndJ33FJYf5V3yXqqjcZ30FgHzJCFUu JMp7PSyMPzpUXfU12yfcRYVEMQrmplNZssmYhiTeVicuOOypWugZKVLGNm0IweVCaZ/DJDIH gNbpvVwjcKYrx85m9cBVEBUGaQP6AT7qlVCkrf50v8bofSIyVa2xmubbAwwFA1oxoOusjPIE J3iadrwpFvsZjF5uHAKS+7wHLoW9hVzOnLbX6ajk5Hf8Pb1m+VH/E8bPBNNYKkfTtypTDUCj NYcd27tjnXfG+SDs/EXNUAIRefCyvaRG7oRYF3Ec+2RgQDRnmmjCjoQNbFrJvJkFHlPeHaeS BosGY+XWKydnmsfY7SSnjAzLUGAFhLd/XDVpb1Een2XucPpKvt9ORF+48gy12FA5GduRLhQU vK4tU7ojoem/G23PcowM1CwPurC8sAVsQb9KmwTGh7rVz3ks3w/zfGBy3+WmLg++C2Wct6nM Pd8/6CBVjEWqD06/RjI2AnjIq5fSEH/BIfXXfC68nMp9BZoy3So4ZsbOlBmtAPvMYX6U8VwD TNeBxJu5Ex0Izf1NV9CzC3nNaFUYOY8KfN01X5SExAoVTr09ewARAQABzSVLcnp5c3p0b2Yg S296bG93c2tpIDxrcnprQGtlcm5lbC5vcmc+wsGVBBMBCgA/AhsDBgsJCAcDAgYVCAIJCgsE FgIDAQIeAQIXgBYhBJvQfg4MUfjVlne3VBuTQ307QWKbBQJgPO8PBQkUX63hAAoJEBuTQ307 QWKbBn8P+QFxwl7pDsAKR1InemMAmuykCHl+XgC0LDqrsWhAH5T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-led-v1-2-4d9813ce938e@gmail.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit 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? Best regards, Krzysztof