Re: [PATCH v2] ARM: imx: allow to disable board specific PHY fixups

From: Andrew Lunn
Date: Sun Mar 29 2020 - 11:09:03 EST


On Sun, Mar 29, 2020 at 01:04:57PM +0200, Oleksij Rempel wrote:

Hi Oleksij

> +config DEPRECATED_PHY_FIXUPS
> + bool "Enable deprecated PHY fixups"
> + default y
> + ---help---
> + In the early days it was common practice to configure PHYs by adding a
> + phy_register_fixup*() in the machine code. This practice turned out to
> + be potentially dangerous, because:
> + - it affects all PHYs in the system
> + - these register changes are usually not preserved during PHY reset
> + or suspend/resume cycle.
> + - it complicates debugging, since these configuration changes were not
> + done by the actual PHY driver.
> + This option allows to disable all fixups which are identified as
> + potentially harmful and give the developers a chance to implement the
> + proper configuration via the device tree (e.g.: phy-mode) and/or the
> + related PHY drivers.

This appears to be an IMX only problem. Everybody else seems to of got
this right. There is no need to bother everybody with this new
option. Please put this in arch/arm/mach-mxs/Kconfig and have IMX in
the name.

Having said that, i'm not sure this is the best solution. You cannot
build one kernel which runs on all machines. Did you consider some
sort of DT property to disable these fixup? What other ideas did you
have before deciding on this solution?

Andrew