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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:   Tue, 9 May 2017 09:56:38 +0300
From:   Alexandru Ardelean <ardeleanalex@...il.com>
To:     David Miller <davem@...emloft.net>
Cc:     netdev@...r.kernel.org
Subject: Re: [PATCH] net/fsl: remove func xgmac_wait_until_free() as duplicate

On Mon, May 8, 2017 at 10:34 PM, David Miller <davem@...emloft.net> wrote:
> From: Alexandru Ardelean <ardeleanalex@...il.com>
> Date: Mon,  8 May 2017 14:31:18 +0300
>
>> Looking at xgmac_wait_until_done() and xgmac_wait_until_free()
>> functions, they seem to have turned out completely identical.
>>
>> Though, judging from the git history it seems they
>> initially weren't.
>>
>> Remove xgmac_wait_until_free() in favor of xgmac_wait_until_done().
>>
>> Signed-off-by: Alexandru Ardelean <ardeleanalex@...il.com>
>
> This situation got created by the commit below, I wonder if it
> is even correct.
>
> Certainly the original author of this code intended the MDIO
> _data_ rather than the _status_ register to be polled.
>
> Otherwise, why in the world have two functions which are in
> every other regard identical?

[ Removed Shaohui.Xie@....com email from thread ; seems email addr no
longer valid ].

I should have added an RFC tag.
Thing is, we just use this driver, so, I can't offer much input here.

I was debugging [a while ago] some other issue related to this and
stumbled over this.
I haven't seem any obvious issues yet, to suggest one thing or or the
other [regarding polling status or data registers].

I would have liked some input from some NXP/Freescale people on this email list.
Or maybe I could forward this to more people that contribute the NXP eco-system.

If you have any suggestions, please advise and I'll adapt.

Thanks
Alex

>
> commit 26eee0210ad72a29eb4a70b34320bda266f91a0d
> Author: Shaohui Xie <Shaohui.Xie@...escale.com>
> Date:   Mon Mar 16 18:55:50 2015 +0800
>
>     net/fsl: fix a bug in xgmac_mdio
>
>     There is a bug in xgmac_wait_until_done() which mdio_stat should be used
>     instead of mdio_data when checking if busy bit is cleared.
>
>     Signed-off-by: Shaohui Xie <Shaohui.Xie@...escale.com>
>     Signed-off-by: David S. Miller <davem@...emloft.net>
>
> diff --git a/drivers/net/ethernet/freescale/xgmac_mdio.c b/drivers/net/ethernet/freescale/xgmac_mdio.c
> index 3a83bc2..5f691f2 100644
> --- a/drivers/net/ethernet/freescale/xgmac_mdio.c
> +++ b/drivers/net/ethernet/freescale/xgmac_mdio.c
> @@ -79,7 +79,7 @@ static int xgmac_wait_until_done(struct device *dev,
>
>         /* Wait till the MDIO write is complete */
>         timeout = TIMEOUT;
> -       while ((ioread32be(&regs->mdio_data) & MDIO_DATA_BSY) && timeout) {
> +       while ((ioread32be(&regs->mdio_stat) & MDIO_STAT_BSY) && timeout) {
>                 cpu_relax();
>                 timeout--;
>         }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ