[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <20151102.234557.2138288424124774759.davem@davemloft.net>
Date: Mon, 02 Nov 2015 23:45:57 -0500 (EST)
From: David Miller <davem@...emloft.net>
To: shh.xie@...il.com
Cc: netdev@...r.kernel.org, f.fainelli@...il.com,
Shaohui.Xie@...escale.com
Subject: Re: [PATCH][v3] net: phy: fix a bug in get_phy_c45_ids
From: <shh.xie@...il.com>
Date: Tue, 3 Nov 2015 12:27:33 +0800
> From: Shaohui Xie <Shaohui.Xie@...escale.com>
>
> When probing devices-in-package for a c45 phy, device zero is the last
> device to probe, however, if driver reads 0 from device zero,
> c45_ids->devices_in_package is set to '0', the loop condition of probing
> will be matched again, see codes below:
>
> for (i = 1;i < num_ids && c45_ids->devices_in_package == 0;i++)
>
> driver will run in a dead loop.
>
> This patch restructures the bug and confusing loop, it provides a helper
> function get_phy_c45_devs_in_pkg which to read devices-in-package registers
> of a MMD, and rewrites the loop with using the helper function.
>
> Signed-off-by: Shaohui Xie <Shaohui.Xie@...escale.com>
Applied.
--
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