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] [day] [month] [year] [list]
Message-ID: <20181129161643.GZ30658@n2100.armlinux.org.uk>
Date:   Thu, 29 Nov 2018 16:16:43 +0000
From:   Russell King - ARM Linux <linux@...linux.org.uk>
To:     Miquel Raynal <miquel.raynal@...tlin.com>
Cc:     Gregory Clement <gregory.clement@...tlin.com>,
        Jason Cooper <jason@...edaemon.net>,
        Andrew Lunn <andrew@...n.ch>,
        Sebastian Hesselbarth <sebastian.hesselbarth@...il.com>,
        Kishon Vijay Abraham I <kishon@...com>,
        Mark Rutland <mark.rutland@....com>,
        devicetree@...r.kernel.org, Grzegorz Jaszczyk <jaz@...ihalf.com>,
        linux-kernel@...r.kernel.org, Evan Wang <xswang@...vell.com>,
        "Nadav Haklai (Marvell)" <nadavh@...vell.com>,
        Rob Herring <robh+dt@...nel.org>,
        Thomas Petazzoni <thomas.petazzoni@...tlin.com>,
        Marcin Wojtas <mw@...ihalf.com>,
        linux-arm-kernel@...ts.infradead.org
Subject: Re: [PATCH 2/6] phy: add A3700 COMPHY support

On Thu, Nov 29, 2018 at 05:12:45PM +0100, Miquel Raynal wrote:
> Hello,
> 
> Miquel Raynal <miquel.raynal@...tlin.com> wrote on Thu, 22 Nov 2018
> 22:04:16 +0100:
> > +static struct phy *mvebu_a3700_comphy_xlate(struct device *dev,
> > +					    struct of_phandle_args *args)
> > +{
> > +	struct mvebu_a3700_comphy_lane *lane;
> > +	struct phy *phy;
> > +
> > +	if (WARN_ON(args->args[0] >= MVEBU_A3700_COMPHY_PORTS))
> > +		return ERR_PTR(-EINVAL);
> > +
> > +	phy = of_phy_simple_xlate(dev, args);
> > +	if (IS_ERR(phy))
> > +		return phy;
> > +
> > +	lane = phy_get_drvdata(phy);
> > +	if (lane->port >= 0)
> > +		return ERR_PTR(-EBUSY);
> 
> This is not valid. It works only the first time the consumer gets
> a PHY for this lane. If the consumer put the PHY (module is unloaded)
> and then gets the PHY again (module is re-loaded a second time), the
> port is already set to != -1 and this will exit with an error and
> prevent the module to probe.
> 
> > +
> > +	lane->port = args->args[0];
> 
> I will remove the above check and transform it into a valid "port"
> value right here.

Please note that mvebu_comphy_xlate() in
drivers/phy/marvell/phy-mvebu-cp110-comphy.c does exactly the same.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line in suburbia: sync at 12.1Mbps down 622kbps up
According to speedtest.net: 11.9Mbps down 500kbps up

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ