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]
Date:	Thu, 7 Jul 2016 15:14:22 +0100
From:	Russell King - ARM Linux <linux@...linux.org.uk>
To:	Andrew Lunn <andrew@...n.ch>
Cc:	Iyappan Subramanian <isubramanian@....com>,
	"devicetree@...r.kernel.org" <devicetree@...r.kernel.org>,
	netdev <netdev@...r.kernel.org>, patches <patches@....com>,
	Matthias Brugger <matthias.bgg@...il.com>,
	David Miller <davem@...emloft.net>,
	"linux-arm-kernel@...ts.infradead.org" 
	<linux-arm-kernel@...ts.infradead.org>
Subject: Re: [PATCH v2 3/5] drivers: net: phy: Add MDIO driver

On Thu, Jul 07, 2016 at 04:03:02PM +0200, Andrew Lunn wrote:
> > Wed, Jul 06, 2016 at 04:44:44PM -0700, Iyappan Subramanian wrote:
> > Hi Andrew,
> > 
> > On Tue, Jul 5, 2016 at 6:49 AM, Andrew Lunn <andrew@...n.ch> wrote:
> > > On Mon, Jun 06, 2016 at 10:12:35AM -0700, Iyappan Subramanian wrote:
> > >> Hi Andrew,
> > >>
> > >> Thanks for the review.
> > >>
> > >> On Tue, May 31, 2016 at 6:11 PM, Andrew Lunn <andrew@...n.ch> wrote:
> > >> > On Tue, May 31, 2016 at 05:10:38PM -0700, Iyappan Subramanian wrote:
> > >> >> +static int xgene_mdio_reset(struct xgene_mdio_pdata *pdata)
> > >> >> +{
> > >> >> +     int ret;
> > >> >> +
> > >> >> +     if (pdata->mdio_id == XGENE_MDIO_RGMII) {
> > >> >> +             if (pdata->dev->of_node) {
> > >> >> +                     clk_prepare_enable(pdata->clk);
> > >> >> +                     clk_disable_unprepare(pdata->clk);
> > >> >> +                     clk_prepare_enable(pdata->clk);
> > >> >
> > >> > Hi Iyappan
> > >> >
> > >> > Is that a workaround for a hardware problem? If so, i would suggest
> > >> > adding a comment, to stop people submitting a patch simplifying it.
> > >>
> > >> Hardware expects this clock sequence.  I'll add comment as you suggested.
> > >
> > > What exactly does the hardware require? Is this a workaround for a bug
> > > in the clock generator? Or a workaround for a bug in the MDIO device?
> > 
> > Hardware requires a clock pulse.  There is no bug.
> 
> And how are you guaranteeing a pulse? You enable/disable/enable
> without any sleeps, so it could all happen within a single clock
> cycle?

It's still really not good, because it does this:

- prepare + enable
- disable + unprepare
- prepare + enable

So every time the reset function is called, the prepare and enable
counts against the clock get incremented.  That's a bug.  This needs
a better solution.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ