e0f03e87fc6f27a8af9896f430f2945b3b1664c0 is the first bad commit
commit e0f03e87fc6f27a8af9896f430f2945b3b1664c0
Author: Heiner Kallweit <email address hidden>
Date: Wed Dec 16 07:33:22 2015 +0100
PNP: respect PNP_DRIVER_RES_DO_NOT_CHANGE when detaching
I have a device (Nuvoton 6779D Super-IO IR RC with nuvoton-cir driver)
which works after initial boot but not any longer if I unload and
re-load the driver module.
Digging into the issue I found that unloading the driver calls
pnp_disable_dev although the driver has flag PNP_DRIVER_RES_DO_NOT_CHANGE
set. IMHO this is not right.
Let's have a look at the call chain when probing a device:
pnp_device_probe
1. attaches the device
2. if it's not active and PNP_DRIVER_RES_DO_NOT_CHANGE is not set
it gets activated
3. probes driver
I think pnp_device_remove should do it in reverse order and also
respect PNP_DRIVER_RES_DO_NOT_CHANGE. Therefore:
1. call drivers remove callback
2. if device is active and PNP_DRIVER_RES_DO_NOT_CHANGE is not set
disable it
3. detach device
The change works for me and sounds logical to me.
However I don't know the pnp driver in detail so I might be wrong.
Signed-off-by: Heiner Kallweit <email address hidden>
Signed-off-by: Rafael J. Wysocki <email address hidden>
:040000 040000 8b208d9346c4a3948dbf8cde3083cc9c8adb026d 2f91a8f9fcf0699cc5d8ea3bc4322d8f1724e67b M drivers
e0f03e87fc6f27a 8af9896f430f294 5b3b1664c0 is the first bad commit 8af9896f430f294 5b3b1664c0
commit e0f03e87fc6f27a
Author: Heiner Kallweit <email address hidden>
Date: Wed Dec 16 07:33:22 2015 +0100
PNP: respect PNP_DRIVER_ RES_DO_ NOT_CHANGE when detaching
I have a device (Nuvoton 6779D Super-IO IR RC with nuvoton-cir driver)
which works after initial boot but not any longer if I unload and
re-load the driver module.
Digging into the issue I found that unloading the driver calls RES_DO_ NOT_CHANGE
pnp_disable_dev although the driver has flag PNP_DRIVER_
set. IMHO this is not right.
Let's have a look at the call chain when probing a device: device_ probe RES_DO_ NOT_CHANGE is not set
pnp_
1. attaches the device
2. if it's not active and PNP_DRIVER_
it gets activated
3. probes driver
I think pnp_device_remove should do it in reverse order and also RES_DO_ NOT_CHANGE. Therefore: RES_DO_ NOT_CHANGE is not set
respect PNP_DRIVER_
1. call drivers remove callback
2. if device is active and PNP_DRIVER_
disable it
3. detach device
The change works for me and sounds logical to me.
However I don't know the pnp driver in detail so I might be wrong.
Signed-off-by: Heiner Kallweit <email address hidden>
Signed-off-by: Rafael J. Wysocki <email address hidden>
:040000 040000 8b208d9346c4a39 48dbf8cde3083cc 9c8adb026d 2f91a8f9fcf0699 cc5d8ea3bc4322d 8f1724e67b M drivers