From: David S. Miller Date: Fri, 25 Jul 2014 01:10:02 +0000 (-0700) Subject: Merge branch 'mdio_module_unload' X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=a88a7be6a2efcc4d3ea4543feb1b0d71d0100541;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Merge branch 'mdio_module_unload' Ezequiel Garcia says: ==================== net: phy: Prevent an MDIO bus from being unloaded while in use Changes from v1: * Dropped the unneeded module_put() on phy_attach_direct(). The motivation of this small series is to fix the current lack of relationship between an ethernet driver and the MDIO bus behind the PHY device. In such cases, we would find no visible link between the drivers: $ lsmod Module Size Used by Not tainted mvmdio 2941 0 mvneta 22069 0 Which means nothing prevents the MDIO driver from being removed: $ modprobe -r mvmdio # Unable to handle kernel NULL pointer dereference at virtual address 00000060 pgd = c0004000 [00000060] *pgd=00000000 Internal error: Oops: 17 [#1] SMP ARM Modules linked in: mvneta [last unloaded: mvmdio] CPU: 0 PID: 22 Comm: kworker/0:1 Not tainted 3.16.0-rc5-01127-g62c0816-dirty #608 Workqueue: events_power_efficient phy_state_machine task: df5ec840 ti: df67a000 task.ti: df67a000 PC is at phy_state_machine+0x1c/0x468 LR is at phy_state_machine+0x18/0x468 [snip] This patchset fixes this problem by adding a pair of module_{get,put}, so the module reference count is increased when the PHY device is attached and is decreased when the PHY is detached. Tested with mvneta and mv643xx_eth drivers, which depend on the mvmdio driver to handle MDIO. This series applies on both net and net-next branches. ==================== Signed-off-by: David S. Miller --- a88a7be6a2efcc4d3ea4543feb1b0d71d0100541