Kernel module that shuts down the device
abbotta4 at gmail.com
Sun Nov 7 19:16:55 EST 2021
> Where are you calling it from? Don't call it from irq context, which is
the context that USB urbs are called from.
I am currently calling it from an irq context, in the fusb302_irq_work()
function of the in-tree fusb302.c driver. My relevant patch is below.
> Do you have a link to your driver code so it can be reviewed?
The relevant change is here:
You mentioned that this shouldn't be called in an irq context, but the
unplug event is detected with an irq. Where should I be calling
kernel_power_off() if not in the irq context? I think one way of doing this
would be to set a value that a heartbeat function reads in the irq, and
then the heartbeat function calls the shutdown, but this driver doesn't use
a heartbeat. Where else would I handle this?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Kernelnewbies