linux/drivers/net/phy
Anton Vorontsov 6f051069d8 phylib: Fix oops in suspend/resume paths
Suspend/resume routines check for phydrv != NULL, but that is
wrong because "phydrv" comes from container_of(drv). If drv is NULL,
then container_of(drv) will return non-NULL result, and the checks
won't work.

The Freescale TBI PHYs are driver-less, so "drv" is NULL, and that
leads to the following oops:

Unable to handle kernel paging request for data at address 0xffffffe4
Faulting instruction address: 0xc0215554
Oops: Kernel access of bad area, sig: 11 [#1]
[...]
NIP [c0215554] mdio_bus_suspend+0x34/0x70
LR [c01cc508] suspend_device+0x258/0x2bc
Call Trace:
[cfad3da0] [cfad3db8] 0xcfad3db8 (unreliable)
[cfad3db0] [c01cc508] suspend_device+0x258/0x2bc
[cfad3dd0] [c01cc62c] dpm_suspend+0xc0/0x140
[cfad3e20] [c01cc6f4] device_suspend+0x48/0x5c
[cfad3e40] [c0068dd8] suspend_devices_and_enter+0x8c/0x148
[cfad3e60] [c00690f8] enter_state+0x100/0x118
[cfad3e80] [c00691c0] state_store+0xb0/0xe4
[cfad3ea0] [c018c938] kobj_attr_store+0x24/0x3c
[cfad3eb0] [c00ea9a8] flush_write_buffer+0x58/0x7c
[cfad3ed0] [c00eadf0] sysfs_write_file+0x58/0xa0
[cfad3ef0] [c009e810] vfs_write+0xb4/0x16c
[cfad3f10] [c009ed40] sys_write+0x4c/0x90
[cfad3f40] [c0014954] ret_from_syscall+0x0/0x38
[...]

This patch fixes the issue, plus removes unneeded parentheses
and fixes indentation level in mdio_bus_suspend().

Signed-off-by: Anton Vorontsov <avorontsov@ru.mvista.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2009-01-22 13:51:24 -08:00
..
broadcom.c broadcom: Add 57780 support 2008-11-21 17:22:53 -08:00
cicada.c
davicom.c dm9161: add configuration for MII/RMII 2008-03-05 06:26:56 -05:00
et1011c.c phy: Add LSI ET1011C PHY driver 2008-12-09 22:21:25 -08:00
fixed.c phylib: two dynamic mii_bus allocation fallout fixes 2008-10-09 09:45:04 -07:00
icplus.c phylib: add the ICPlus IP175C PHY driver 2007-07-08 22:16:38 -04:00
Kconfig phy: Add LSI ET1011C PHY driver 2008-12-09 22:21:25 -08:00
lxt.c
Makefile phy: Add LSI ET1011C PHY driver 2008-12-09 22:21:25 -08:00
marvell.c phy: Add support for Marvell 88E1118 PHY 2008-11-15 14:04:27 -08:00
mdio_bus.c phylib: Fix oops in suspend/resume paths 2009-01-22 13:51:24 -08:00
mdio-bitbang.c phylib: move to dynamic allocation of struct mii_bus 2008-10-08 16:29:57 -07:00
mdio-gpio.c phylib: make mdio-gpio work without OF (v4) 2008-11-16 18:59:45 -08:00
national.c phy: Add file missed in previous commit. 2008-11-28 16:40:26 -08:00
phy_device.c phylib: Fix Freescale TBI PHY detection 2009-01-14 14:38:02 -08:00
phy.c net: struct device - replace bus_id with dev_name(), dev_set_name() 2008-11-10 13:55:14 -08:00
qsemi.c
realtek.c phylib: Add Realtek 821x eth PHY support 2008-02-03 04:28:42 -08:00
smsc.c SMSC LAN911x and LAN921x vendor driver 2008-11-06 00:58:40 -05:00
ste10Xp.c phy: add the ST ste10Xp PHYs 2008-11-28 16:42:41 -08:00
vitesse.c phylib: Add Vitesse VSC8221 SGMII PHY 2008-11-25 01:00:47 -08:00