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-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YR6b15zKkjWFoM1X@piout.net>
Date:   Thu, 19 Aug 2021 19:58:47 +0200
From:   Alexandre Belloni <alexandre.belloni@...tlin.com>
To:     Vladimir Oltean <vladimir.oltean@....com>
Cc:     "devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
        "UNGLinuxDriver@...rochip.com" <UNGLinuxDriver@...rochip.com>,
        Horatiu Vultur <horatiu.vultur@...rochip.com>,
        Rob Herring <robh+dt@...nel.org>,
        Thomas Bogendoerfer <tsbogend@...ha.franken.de>,
        "linux-mips@...r.kernel.org" <linux-mips@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH devicetree 2/2] MIPS: mscc: ocelot: mark the phy-mode for
 internal PHY ports

On 19/08/2021 17:17:05+0000, Vladimir Oltean wrote:
> On Thu, Aug 19, 2021 at 08:04:16PM +0300, Vladimir Oltean wrote:
> > The ocelot driver was converted to phylink, and that expects a valid
> > phy_interface_t. Without a phy-mode, of_get_phy_mode returns
> > PHY_INTERFACE_MODE_NA, which is not ideal because phylink rejects that.
> > 
> > The ocelot driver was patched to treat PHY_INTERFACE_MODE_NA as
> > PHY_INTERFACE_MODE_INTERNAL to work with the broken DT blobs, but we
> > should fix the device trees and specify the phy-mode too.
> > 
> > Signed-off-by: Vladimir Oltean <vladimir.oltean@....com>
> > ---
> 
> Please note that the pre-phylink driver has this check:
> 
> 		switch (ocelot_port->phy_mode) {
> 		case PHY_INTERFACE_MODE_NA:
> 			(...)
> 		case PHY_INTERFACE_MODE_SGMII:
> 			(...)
> 		case PHY_INTERFACE_MODE_QSGMII:
> 			(...)
> 		default:
> 			dev_err(ocelot->dev,
> 				"invalid phy mode for port%d, (Q)SGMII only\n",
> 				port);
> 			of_node_put(portnp);
> 			err = -EINVAL;
> 			goto out_teardown;
> 		}
> 
> So it does not actually expect PHY_INTERFACE_MODE_INTERNAL and will
> error out.
> 
> Are we okay with the new device tree blobs breaking the old kernel?

>From my point of view, newer device trees are not required to work on
older kernel, this would impose an unreasonable limitation and the use
case is very limited.

-- 
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ