Re: Kernel module that shuts down the device

2021-11-07 Thread Greg KH
On Sun, Nov 07, 2021 at 06:16:55PM -0600, Drew Abbott wrote: > > 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

Re: Kernel module that shuts down the device

2021-11-07 Thread Valdis Klētnieks
On Sun, 07 Nov 2021 18:16:55 -0600, Drew Abbott said: > 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

Re: Kernel module that shuts down the device

2021-11-07 Thread Drew Abbott
> 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

Re: Kernel module that shuts down the device

2021-11-07 Thread Greg KH
On Sat, Nov 06, 2021 at 07:54:39PM -0500, Drew Abbott wrote: > Hi all, > > I am working on a kernel module that should shut down the device when USB > is unplugged. I make a call to kernel_power_off(), but I see that it gets > stuck trying to call blocking_notifier_call_chain(_notifier_list, >