Commit 8cc6b6cd authored by Thadeu Lima de Souza Cascardo's avatar Thadeu Lima de Souza Cascardo Committed by Benjamin Herrenschmidt

powerpc/eeh: Drop taken reference to driver on eeh_rmv_device

Commit f5c57710 ("powerpc/eeh: Use
partial hotplug for EEH unaware drivers") introduces eeh_rmv_device,
which may grab a reference to a driver, but not release it.

That prevents a driver from being removed after it has gone through EEH
recovery.

This patch drops the reference if it was taken.
Signed-off-by: default avatarThadeu Lima de Souza Cascardo <cascardo@linux.vnet.ibm.com>
Acked-by: default avatarGavin Shan <shangw@linux.vnet.ibm.com>
Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
parent 0215b4aa
...@@ -362,9 +362,13 @@ static void *eeh_rmv_device(void *data, void *userdata) ...@@ -362,9 +362,13 @@ static void *eeh_rmv_device(void *data, void *userdata)
*/ */
if (!dev || (dev->hdr_type & PCI_HEADER_TYPE_BRIDGE)) if (!dev || (dev->hdr_type & PCI_HEADER_TYPE_BRIDGE))
return NULL; return NULL;
driver = eeh_pcid_get(dev); driver = eeh_pcid_get(dev);
if (driver && driver->err_handler) if (driver) {
eeh_pcid_put(dev);
if (driver->err_handler)
return NULL; return NULL;
}
/* Remove it from PCI subsystem */ /* Remove it from PCI subsystem */
pr_debug("EEH: Removing %s without EEH sensitive driver\n", pr_debug("EEH: Removing %s without EEH sensitive driver\n",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment