lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20191209084430.11107-1-o.rempel@pengutronix.de>
Date:   Mon,  9 Dec 2019 09:44:30 +0100
From:   Oleksij Rempel <o.rempel@...gutronix.de>
To:     Shawn Guo <shawnguo@...nel.org>,
        Sascha Hauer <s.hauer@...gutronix.de>
Cc:     Oleksij Rempel <o.rempel@...gutronix.de>, kernel@...gutronix.de,
        netdev@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        linux-kernel@...r.kernel.org, linux-imx@....com,
        Fabio Estevam <festevam@...il.com>
Subject: [PATCH v1] ARM i.MX6q: make sure PHY fixup for KSZ9031 is applied only on one board

Currently all board specific fixups defined in mach-imx*.c are not
working properly. They are applied on all boards with the same iMX SoC
variant and even if:
- PHY needs different settings because of different board design
- PHY needs different settings if it is not connected directly to the SoC.
  For example, the PHY is connected to a switch and the switch is connected
  to the SoC.

Since most PHY drivers don't know about changed default settings, these
settings will not be restored by the PHY driver after reset or
suspend/resume cycle.

This patch changes the MICREL KSZ9031 fixup, which was introduced for
the "Data Modul eDM-QMX6" board in following patch, to be only activated
for this specific board.

|commit dbf6719a4a080669acb5087893704586c791aa41
|Author: Sascha Hauer <s.hauer@...gutronix.de>
|Date:   Thu Jun 20 17:34:33 2013 +0200
|
| ARM: i.MX6: add ethernet phy fixup for KSZ9031
|
| The KSZ9031 is used on the i.MX6 based Data Modul eDM-QMX6
| board. It needs the same fixup to the rx/tx delays as other
| i.MX6 boards.

If some board was working by accident with this fixup, it will probably
break and should be fixed properly by setting related device tree
properties.

To fix this properly the "eDM-QMX6" devicetree:

    arch/arm/boot/dts/imx6q-dmo-edmqmx6.dts

should have board specific *-skew-ps properties. See:

    Documentation/devicetree/bindings/net/micrel-ksz90x1.txt

Cc: Sascha Hauer <s.hauer@...gutronix.de>
Signed-off-by: Oleksij Rempel <o.rempel@...gutronix.de>
---
 arch/arm/mach-imx/mach-imx6q.c | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/arch/arm/mach-imx/mach-imx6q.c b/arch/arm/mach-imx/mach-imx6q.c
index 6441281cf4f2..2370cb5d8501 100644
--- a/arch/arm/mach-imx/mach-imx6q.c
+++ b/arch/arm/mach-imx/mach-imx6q.c
@@ -162,11 +162,19 @@ static int ar8035_phy_fixup(struct phy_device *dev)
 
 static void __init imx6q_enet_phy_init(void)
 {
+	/* Warning: please do not extend this fixup list. This fixups are
+	 * applied even on boards where related PHY is not directly connected
+	 * to the ethernet controller. For example with switch in the middle.
+	 */
 	if (IS_BUILTIN(CONFIG_PHYLIB)) {
 		phy_register_fixup_for_uid(PHY_ID_KSZ9021, MICREL_PHY_ID_MASK,
 				ksz9021rn_phy_fixup);
-		phy_register_fixup_for_uid(PHY_ID_KSZ9031, MICREL_PHY_ID_MASK,
-				ksz9031rn_phy_fixup);
+
+		if (of_machine_is_compatible("dmo,imx6q-edmqmx6"))
+			phy_register_fixup_for_uid(PHY_ID_KSZ9031,
+						   MICREL_PHY_ID_MASK,
+						   ksz9031rn_phy_fixup);
+
 		phy_register_fixup_for_uid(PHY_ID_AR8031, 0xffffffef,
 				ar8031_phy_fixup);
 		phy_register_fixup_for_uid(PHY_ID_AR8035, 0xffffffef,
-- 
2.24.0

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ