From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38D6BC433F5 for ; Sun, 7 Nov 2021 08:31:51 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D61E561208 for ; Sun, 7 Nov 2021 08:31:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org D61E561208 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kroah.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1mjdaG-0001yh-6E; Sun, 07 Nov 2021 03:31:24 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1mjdaC-0001v0-HW for kernelnewbies@kernelnewbies.org; Sun, 07 Nov 2021 03:31:20 -0500 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id D1CE25C00E3; Sun, 7 Nov 2021 03:31:16 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sun, 07 Nov 2021 03:31:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kroah.com; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm2; bh=RcNG02XXyMNyDht3yqlRWrss6k1 vThknGiLP3v3KJTI=; b=qdap6vrOuzXquhddLM9hnbx61f/EgRsoQH7rQD8vRzi 93ItO7e2R74bTiG23u2Bg6MSK8XnEzReZFkXZAB66YJ/pKY/KgxHaBWVTuizgoNl ZBmq74JMyj+wKPUbhNngP6eSUT1cQGnlPZ04B9xxuzukxGqDEiTadFScsh5HX6+X Wlnte6XzmzPQw0MyK/hGx8QJ8w7wxUMh7wl47qBjyQIjMXWEDDJEIkeEbDmxqqaf ainMCwvl1UjM+4AwND7s2OVlNGFH+FWRZELDUV4S2l8EzlvjozXcl95+zUBF0HwA XFvPxuG/+XY+M7bX+wKW8Nkh7+nOi4gr1nmmyyyrU+w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=RcNG02 XXyMNyDht3yqlRWrss6k1vThknGiLP3v3KJTI=; b=Yh4qZGsN287XuCbg0fO+PD wIGwH44TDOwBslr91Ponhkor05tIJ9jVv0rK6s5jIb8TqnCbGHQwC3uwV6GSauJU p3/qSDnTMAsIDJ1iBRIQpUDPcD+dI/Mc6k+NCHScoENmCQLoledr63/BReEUWfPy /O9qtk5TFHFZfs1OzsmIThS1DXRPMQTOidFz6KNt8otvJhB8ULsZMPPpnQ0nAwNm wfvHqrZ9hFCa38/XsH6kSWlubf9tbMYRUWSR+LqbymcVTw2KJT+NaOabzZBLgY26 gwRHWS5BDnOmXnqJ6LU2Vfwl9uMZXyz12zFmBWK9HkS3YgopvwZKvMevC6O33wsA == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrtdelgdduudegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfhfgggtuggjsehttdertddttddvnecuhfhrohhmpefirhgvghcu mffjuceoghhrvghgsehkrhhorghhrdgtohhmqeenucggtffrrghtthgvrhhnpeevueehje fgfffgiedvudekvdektdelleelgefhleejieeugeegveeuuddukedvteenucevlhhushht vghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehgrhgvgheskhhrohgrhh drtghomh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sun, 7 Nov 2021 03:31:15 -0500 (EST) Date: Sun, 7 Nov 2021 09:31:11 +0100 From: Greg KH To: Drew Abbott Subject: Re: Kernel module that shuts down the device Message-ID: References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: Cc: kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org 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(&reboot_notifier_list, > (state == SYSTEM_HALT) ? SYS_HALT : SYS_POWER_OFF, NULL); in > kernel_shutdown_prepare(). Where are you calling it from? Don't call it from irq context, which is the context that USB urbs are called from. > There is currently another driver that has the same function, and shuts > down the device by calling kernel_power_off() successfully. I have tried > adding prints in blocking_notifier_call_chain, but then the kernel log is > flooded with calls and I can't really see what is happening. > Does anyone have any insight into why my call to kernel_power_off() is > hanging? Do you have a link to your driver code so it can be reviewed? thanks, greg k-h _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies