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: <fa686aa40907161544je92317dy7abea6819746847@mail.gmail.com>
Date:	Thu, 16 Jul 2009 16:44:21 -0600
From:	Grant Likely <grant.likely@...retlab.ca>
To:	Wolfgang Denk <wd@...x.de>
Cc:	linuxppc-dev@...abs.org, Kumar Gala <galak@...nel.crashing.org>,
	netdev@...r.kernel.org
Subject: Re: [PATCH 1/2 v4] fs_enet/mii-fec.c: fix MII speed calculation

On Thu, Jul 16, 2009 at 3:42 PM, Wolfgang Denk<wd@...x.de> wrote:
> The MII speed calculation was based on the CPU clock (ppc_proc_freq),
> but for MPC512x we must use the bus clock instead.
>
> This patch makes it use the correct clock and makes sure we don't
> clobber reserved bits in the MII_SPEED register.
>
> Signed-off-by: Wolfgang Denk <wd@...x.de>
> Cc: Grant Likely <grant.likely@...retlab.ca>
> Cc: Kumar Gala <galak@...nel.crashing.org>
> Cc: <netdev@...r.kernel.org>

Looks good to me.  Thanks for the work!

I assume this is tested.  I have not tested this on my board, and I've
got one question below, but otherwise I think I can say....
Acked-by: Grant Likely <grant.likely@...retlab.ca>

> -       fec->mii_speed = ((ppc_proc_freq + 4999999) / 5000000) << 1;
> +       if (get_bus_freq) {
> +               clock = get_bus_freq(ofdev->node);
> +
> +               if (!clock) {
> +                       dev_err(&ofdev->dev, "could not determine IPS/IPB clock\n");
> +                       goto out_unmap_regs;
> +               }
> +       } else
> +               clock = ppc_proc_freq;
> +
> +       /* scale for a MII clock <= 2.5 MHz */
> +       speed = (clock + 2499999) / 2500000;

The calculation has changed here for non mpc5121 users.  Shouldn't the
"clock = ppc_proc_freq;" line above be "clock = ppc_proc_freq / 2;"?
Or was this also a bug in the original driver?

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ