linux/drivers/net
Paul Gortmaker 7c1e7e99ab gianfar: dont conditionally alloc Rx/Err irq structs
Commit ee873fda3b

    "gianfar: Pack struct gfar_priv_grp into three cachelines"

causes the following null dereference at driver init on sbc8548:

   libphy: Freescale PowerQUICC MII Bus: probed
   Unable to handle kernel paging request for data at address 0x00000000
   Faulting instruction address: 0xc01d6a38
   Oops: Kernel access of bad area, sig: 11 [#1]
   [...]
   NIP [c01d6a38] gfar_parse_group+0x228/0x280
   LR [c01d6a34] gfar_parse_group+0x224/0x280
   Call Trace:
   [ef82dd60] [c01d6a34] gfar_parse_group+0x224/0x280 (unreliable)
   [ef82dd90] [c01d73a4] gfar_probe+0x284/0xfe0

The reason is that the commit also changed the allocation of the
Rx and error handling irq structs to be skipped for !MQ_MG_MODE.
In the !MQ_MG_MODE case, only the Tx irq struct is allocated.

Digging further, we see that MQ_MG_MODE is set only if we find
the OF compatible string "fsl,etsec2".

A quick grep in the dts directory shows lots of boards that support
Rx/Tx/Err, but without this specific compat string.  And hence they
go after the unallocated Rx/Error structs and cause the above oops.

Hence such a change can not be deployed until all the dts files
are updated and sufficiently deployed.  Further, the optimization
is of limited value, since the kmalloc'd struct in question has only
a single unsigned int, and an (IFNAMSIZ + 6) sized string.

Note that no changes to the freeing code are needed here, as it
already did an unconditional free of Rx/Tx/Error gfar_irqinfo.

Cc: Claudiu Manoil <claudiu.manoil@freescale.com>
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
2013-02-04 21:08:01 -05:00
..
appletalk
arcnet ARCNET: remove __dev* attributes 2012-12-03 11:16:10 -08:00
bonding netns: bond: allow unprivileged users to control bond device 2013-02-04 13:12:16 -05:00
caif caif: Remove unnecessary alloc/OOM messages 2013-02-04 13:22:33 -05:00
can can: Remove unnecessary alloc/OOM messages 2013-02-04 13:22:33 -05:00
cris ethtool: fix drvinfo strings set in drivers 2013-01-06 21:06:31 -08:00
dsa DSA: Convert spaces to tabs where appropriate 2013-01-10 00:04:34 -08:00
ethernet gianfar: dont conditionally alloc Rx/Err irq structs 2013-02-04 21:08:01 -05:00
fddi drivers/net: fix up function prototypes after __dev* removals 2012-12-07 14:22:22 -05:00
hamradio drivers:net:misc: Remove unnecessary alloc/OOM messages 2013-02-04 13:22:35 -05:00
hippi drivers/net: fix up function prototypes after __dev* removals 2012-12-07 14:22:22 -05:00
hyperv Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-01-29 15:32:13 -05:00
ieee802154 remove init of dev->perm_addr in drivers 2013-01-08 18:00:48 -08:00
irda drivers/net: fix up function prototypes after __dev* removals 2012-12-07 14:22:22 -05:00
phy drivers:net:misc: Remove unnecessary alloc/OOM messages 2013-02-04 13:22:35 -05:00
plip
ppp ppp: make ppp_get_stats64 static 2012-11-01 12:38:31 -04:00
slip
team team: ab: set active port option as changed when port is leaving 2013-02-04 14:55:45 -05:00
usb drivers: net: usb: Remove unnecessary alloc/OOM messages 2013-02-04 13:22:34 -05:00
vmxnet3 vmxnet3: better RSS support 2013-01-16 14:40:53 -05:00
wan wan: Remove unnecessary alloc/OOM messages 2013-02-04 13:22:34 -05:00
wimax wimax: Remove unnecessary alloc/OOM messages, alloc cleanups 2013-02-04 13:22:34 -05:00
wireless wireless: Remove unnecessary alloc/OOM messages, alloc cleanups 2013-02-04 13:22:34 -05:00
xen-netback xen-netback: allow changing the MAC address of the interface 2013-01-23 13:42:20 -05:00
dummy.c dummy: implement carrier change 2012-12-28 15:24:19 -08:00
eql.c
ifb.c ifb: dont hard code inet_net use 2013-01-14 15:13:39 -05:00
Kconfig
LICENSE.SRC
loopback.c net: loopback: fix a dst refcounting issue 2013-01-27 01:30:35 -05:00
macvlan.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-01-29 15:32:13 -05:00
macvtap.c net: fix possible wrong checksum generation 2013-01-28 00:27:15 -05:00
Makefile
mdio.c
mii.c
netconsole.c netpoll: add IPv6 support 2013-01-08 17:56:10 -08:00
rionet.c ethtool: fix drvinfo strings set in drivers 2013-01-06 21:06:31 -08:00
sb1000.c
Space.c drivers/net: delete old x86 variant of the seeq8005 driver 2013-01-22 10:39:56 -05:00
sungem_phy.c Fix misspellings of "whether" in comments. 2012-11-19 14:31:35 +01:00
tun.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net 2013-01-29 15:32:13 -05:00
veth.c veth: fix a NULL deref in netif_carrier_off 2013-01-10 14:11:46 -08:00
virtio_net.c drivers:net:misc: Remove unnecessary alloc/OOM messages 2013-02-04 13:22:35 -05:00
vxlan.c net/vxlan: Add ethtool drvinfo 2013-01-30 22:47:22 -05:00
xen-netfront.c xen/netfront: improve truesize tracking 2013-01-07 19:51:19 -08:00