Re: [PATCH 2/2] stmmac: intel: Honor phy LED set by system firmware on a Dell hardware

From: Andrew Lunn
Date: Fri Jan 14 2022 - 08:09:41 EST


On Fri, Jan 14, 2022 at 12:07:54PM +0800, Kai-Heng Feng wrote:
> BIOS on Dell Edge Gateway 3200 already makes its own phy LED setting, so
> instead of setting another value, keep it untouched and restore the saved
> value on system resume.
>
> Signed-off-by: Kai-Heng Feng <kai.heng.feng@xxxxxxxxxxxxx>
> ---
> .../net/ethernet/stmicro/stmmac/dwmac-intel.c | 16 +++++
> drivers/net/ethernet/stmicro/stmmac/stmmac.h | 2 +
> .../net/ethernet/stmicro/stmmac/stmmac_main.c | 4 ++
> drivers/net/phy/marvell.c | 58 ++++++++++++-------
> include/linux/marvell_phy.h | 1 +
> 5 files changed, 61 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> index 8e8778cfbbadd..f8a2879e0264a 100644
> --- a/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> +++ b/drivers/net/ethernet/stmicro/stmmac/dwmac-intel.c
> @@ -857,6 +857,16 @@ static const struct dmi_system_id quark_pci_dmi[] = {
> {}
> };
>
> +static const struct dmi_system_id use_preset_led[] = {
> + {
> + .matches = {
> + DMI_MATCH(DMI_SYS_VENDOR, "Dell EMC"),
> + DMI_MATCH(DMI_PRODUCT_NAME, "Edge Gateway 3200"),
> + },
> + },
> + {}
> +};

This is a PHY property. Why is the MAC involved?

Please also think about how to make this generic, so any ACPI based
system can use it, with any PHY.

Andrew