Article View: linux.kernel.netdev
Article #24633Re: [PATCH net 10/14] net: phy: as21xxx: Fix LED hw control set for unsupported rules
From: Andrew Lunn
Date: Mon, 30 Nov 2026 13:37
Date: Mon, 30 Nov 2026 13:37
51 lines
9918 bytes
9918 bytes
On Mon, Nov 30, 2026 at 01:29:45PM +0200, Cristian Ciocaltea wrote:
> On 11/30/26 5:01 AM, Andrew Lunn wrote:
> >> + if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
> >> + return -EOPNOTSUPP;
> >> +
> >> return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
> >> VEND1_LED_REG(index),
> >> VEND1_LED_REG_A_EVENT,
> >
> > This works, but maybe:
> >
> > for (i = 0; i < ARRAY_SIZE(as21xxx_led_supported_pattern); i++)
> > if (rules == as21xxx_led_supported_pattern[i].pattern) {
> > val = as21xxx_led_supported_pattern[i].val;
> > return phy_modify_mmd(phydev, MDIO_MMD_VEND1,
> > VEND1_LED_REG(index),
> > VEND1_LED_REG_A_EVENT,
> > FIELD_PREP(VEND1_LED_REG_A_EVENT,
> > val));
> >
> > }
> >
> > return -EOPNOTSUPP
> > }
>
> On upcoming Gen2 PHY the LEDs are meant to be driven by the firmware via IPC
> rather than by writing the vendor LED registers directly.
Why would a vendor implement an IPC, when MDIO is already an IPC?
It seems to me the quality of design of PHYs has gone down in recent
years.
Anyway...
> info = aeon_led_find_pattern(phydev, rules);
> if (!info)
> return -EOPNOTSUPP;
>
> return data->led_ops->set_event(phydev, index, info->val);
This is fine. I just did not like the:
if (i == ARRAY_SIZE(as21xxx_led_supported_pattern))
but that seems to be going away.
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Andrew
Technical Details
Message-ID:
<ba82c8aa-03d4-4e44-a0ee-93e71bb01685@lunn.ch>Path:
mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374229-linux-kernel-netdev=dewy.ruReferences:
<20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc@collabora.com> <20261130-as21xxx-fixes-v1-10-1bd2eae6ccbc@collabora.com> <400a6e13-31fc-47ec-af3e-afccdf64655a@lunn.ch> <f827d08a-ea37-4af7-bf77-e389d0b236c7@collabora.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!srv.newsdeef.eu!newsfeed.bofh.team!news.nntp4.net!nntp.xenet.de!news.neodome.net!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-374229-linux-kernel-netdev=dewy.ru From: andrew@lunn.ch (Andrew Lunn) Newsgroups: linux.kernel.netdev Subject: Re: [PATCH net 10/14] net: phy: as21xxx: Fix LED hw control set for unsupported rules Date: Mon, 30 Nov 2026 14:37:38 +0100 Organization: Usenet Network Message-ID: <ba82c8aa-03d4-4e44-a0ee-93e71bb01685@lunn.ch> References: <20261130-as21xxx-fixes-v1-0-1bd2eae6ccbc@collabora.com> <20261130-as21xxx-fixes-v1-10-1bd2eae6ccbc@collabora.com> <400a6e13-31fc-47ec-af3e-afccdf64655a@lunn.ch> <f827d08a-ea37-4af7-bf77-e389d0b236c7@collabora.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: usenet.network; logging-data="1435251"; mail-complaints-to="abuse@usenet.network" Cancel-Lock: sha1:/yhvwL6n/HqG2OkrWmrBqdMAXqM= sha256:l2M0ch5XHsGNBTPtDgTe7cnG1po3ousXDPf0rWIeUlc= sha1:/Bf0xQLnXp3vJi+SFxP4Urto1fo= sha256:08eGvCzHH+RyWmRytmM7mB0byciPU8uhaETvVGtjkuI= Content-Disposition: inline List-ID: <netdev.vger.kernel.org> X-Mailpost-Empty-Hdrs: X-Spam-Level X-Received: from localhost (localhost [127.0.0.1]) by mail.dewy.ru (Postfix) with ESMTP id 169D2125FF1; Mon, 30 Nov 2026 16:38:21 +0300 (MSK) X-Virus-Scanned: Debian amavisd-new at usenet.network X-Spam-Flag: NO X-Spam-Score: -3.051 X-Spam-Status: No, score=-3.051 tagged_above=-9999 required=6.31 tests=[DCC_REPUT_70_89=0.1, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HEADER_FROM_DIFFERENT_DOMAINS=0.249, MAILING_LIST_MULTI=-1, RCVD_IN_DNSWL_MED=-2.3, SPF_HELO_NONE=0.001, SPF_PASS=-0.001] autolearn=ham autolearn_force=no X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (1024-bit key) header.d=lunn.ch X-Received: from mail.dewy.ru ([127.0.0.1]) by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id nGTkXOv8L8bM; Mon, 30 Nov 2026 16:38:17 +0300 (MSK) X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-374229-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN> X-Authentication-Results: OpenDMARC; dmarc=fail (p=none dis=none) header.from=lunn.ch X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10]) by mail.dewy.ru (Postfix) with ESMTPS id 2396D125FEE; Mon, 30 Nov 2026 16:38:08 +0300 (MSK) X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.77.114.92]) by sea.lore.kernel.org (Postfix) with ESMTP id 52C392D0E1; Mon, 30 Nov 2026 13:37:55 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1796045872; b=PTZTK19v+X3esmP8eBr6Z9e5AEYQqeIlJwcwpBZkqag4SJxmXs2VrsORlUTIFVlK0+xW 66QcblRc9Zrt2HRIX+T7pUCtwK/9P3nr0UbejvBPWQhktgMDnuTw3AfCpI2ihUVwXBSY4 llnwo32lvWqTDBf2MnufvWZ5cYD2jW2O4Mdumx3MTnYsturBOkgjlr4TEkzGeWBm/qFlk 9AI2zOKLxk1Ckw9VWp/k1qdKBwyq/qdmocMIxC1yIwCQu8D8wkju349vVsbpJbhabD1zJ yuxWj2flwEkLwvF22/wsGSZ5qPzddHuFYXVBCHVJhh3fCFLoy93J+ATb08DBy2QDXVQ== X-ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796045872; h=X-Original-To:Received:DMARC-Filter:DKIM-Signature:Received:Date: From:To:Cc:Subject:Message-ID:References:X-Mailing-List:List-Id: List-Post:List-Help:List-Subscribe:List-Unsubscribe:List-Owner: Precedence:MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=7bWVOsEJF04FDT4Y2fnMhHLQ3pUdip+0a9D5lTUOwZ4=; b=EqCo3mpdSNttwNCDXoIRjrz4pQ3m0GtGy4wZ9qAEhbrK4ptAvK1cQ22D5thILGzUEavu 1GDyrOxvPrcdPmXvC720fbjrJSMawV48CMz69XYAfr87r28fuEhprKqnkKPdtDM8a+FK3 imrW7cc6JPHGLJl/mOBg/FW5UZw2Unx6z0MWzET7/jetZNHOYTQ6cqGFMSNp38y7Rj9ih baOHCY+koNsf3j51SiwH+taiPLxOeGqmYgGTSvEgmUvuhHs1R8VUr1iRlj2GrN1oJnSs5 6dntfiB2Vyv2tDXwF3rFhlhKed7WQe8UVxoSQzbndFg79uYUPRcNBrDmbUm+pveaWJw== X-ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b="NN+/tZfQ"; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; arc=pass header.oldest-pass=0 smtp.remote-ip=127.0.0.1 X-Received: from localhost.localdomain (localhost [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B1150606A6A7; Mon, 30 Nov 2026 13:37:52 +0000 (UTC) X-Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b=NN+/tZfQ X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=156.67.10.101 X-ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796045871; b=IAGbS29lrXNfcw+bWeBu97k6h27xBL3S6m2mHFtRTm4B4Roh9bgOMwPkPgqdg5int6QV fet1jhAAL8Uz1Vv3D4e2jTlx3qHLebN728Q0HTGhzAHKa+Pevb18Jt+4TzfN/cysUmQga PmKCpx/pbLFS6otetDC5lXmNXxyL1rPzQYllijTKOoD9G62EjPF3ufChhKLixZiGk90wl Hpkebu9g3VXgEW+ghR/yWx0hb6DzBbzpw91nawfjkAz7ehh6DgH53l9St1qmz9GESxCt0 0KLvO84mHb+Ov1JMDV3m7c784v3CKW01/f3WG5lfVk/Mw0YEpVQ+l0yA3vK8ESQiDVQ== X-ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796045871; h=DMARC-Filter:DKIM-Signature:Received:Date:From:To:Cc:Subject: Message-ID:References:MIME-Version:Content-Type:Content-Disposition: In-Reply-To; bh=7bWVOsEJF04FDT4Y2fnMhHLQ3pUdip+0a9D5lTUOwZ4=; b=gTL02UtvNqmJBfAnepjc7CkJ2oNaCyEHRaumEESWdjFVcHDrbz1vfkNTBtCFrv8YZ9Uz wJzrSSmehlVY2ZQKHWO3zH+fySmAwMV0kossbAI12/KrD4rBq5ozMjLznXiZ4wkmFR7er uOjfDPSwuPdDJSxae1b60pZk+HFaSuUP29atQQ2Pvd7nTHrH9rZZV5r844UbxBlKfl1oV pWlWEqd4PzjMIm9pSYLlGzBnFIMNUc7iOPNoNG3w1oLgNavcRClB2NzkCU9lzEC2flPp3 pUxN3RffzFpA4sue3oNUYjvPundwMPqhZ12KEy1K+xTAf8Y0+7Lj8GNSpwMg6c/UAzw== X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=lunn.ch; spf=pass smtp.mailfrom=lunn.ch; dkim=pass header.d=lunn.ch header.i=@lunn.ch header.a=rsa-sha256 header.s=20171124 header.b="NN+/tZfQ"; arc=none smtp.remote-ip=156.67.10.101 X-Received: from vps0.lunn.ch (vps0.lunn.ch [156.67.10.101]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8EDC0606A696 for <netdev@vger.kernel.org>; Mon, 30 Nov 2026 13:37:51 +0000 (UTC) X-DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 8EDC0606A696 X-Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=lunn.ch X-Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=lunn.ch X-DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lunn.ch; s=20171124; h=In-Reply-To:Content-Disposition:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:From:Sender:Reply-To:Subject: Date:Message-ID:To:Cc:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:Content-Disposition:In-Reply-To:References; bh=7bWVOsEJF04FDT4Y2fnMhHLQ3pUdip+0a9D5lTUOwZ4=; b=NN+/tZfQ2Jtow9tQcNjaxkz1oV YSfU+bQFRDudgskB8YbKfLMzpPPN9esPRTp02rfdvDnGQucLKtLrYd9QSA4aDLuvyUt5TJSyqakCI GhCHppien4qe6VbTEI2r1frKBWV4sxqAa1DX7KiKjfbLX5ufk/jWVMPpo4Lqy2jAD1w0=; X-Received: from andrew by vps0.lunn.ch with local (Exim 4.94.2) (envelope-from <andrew@lunn.ch>) id 1xY1Za-002NKJ-39; Mon, 30 Nov 2026 14:37:38 +0100 X-Cc: Christian Marangi <ansuelsmth@gmail.com>, Heiner Kallweit <hkallweit1@gmail.com>, Russell King <linux@armlinux.org.uk>, "David S. Miller" <davem@davemloft.net>, Eric Dumazet <edumazet@kernel.org>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>, kernel@collabora.com, netdev@vger.kernel.org X-Mailing-List: netdev@vger.kernel.org X-List-Post: <mailto:netdev@vger.kernel.org> X-List-Help: <mailto:netdev+help@vger.kernel.org> X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org> X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org> X-List-Owner: <mailto:netdev+owner@vger.kernel.org> X-Precedence: list X-In-Reply-To: <f827d08a-ea37-4af7-bf77-e389d0b236c7@collabora.com>