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 EA1A4C433EF for ; Mon, 8 Nov 2021 00:38:35 +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 8778B61251 for ; Mon, 8 Nov 2021 00:38:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8778B61251 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=vt.edu 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 1mjsfy-0007Qi-MJ; Sun, 07 Nov 2021 19:38:18 -0500 Received: from mail-qv1-xf31.google.com ([2607:f8b0:4864:20::f31]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1mjsfv-0007M8-IF for kernelnewbies@kernelnewbies.org; Sun, 07 Nov 2021 19:38:15 -0500 Received: by mail-qv1-xf31.google.com with SMTP id v2so10942533qve.11 for ; Sun, 07 Nov 2021 16:38:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vt-edu.20210112.gappssmtp.com; s=20210112; h=sender:from:to:cc:subject:in-reply-to:references:mime-version :content-transfer-encoding:date:message-id; bh=xZ5nN5WHmfOj69eH4qe9XuCIyFQ5ifL+Jt+JzmdUWak=; b=oHE8O6h7PKX3VO7zlqhcm+rBK04/ju2gMBpAuVPSqQvKlyYmHUmX7q1xuXsSnpFVXu Pxyb/etPk/4cvwWnfZkABvsJaHYrr9hxllbqRtrmNTRhJLV7yMWskR5LZME9bfMUDWCh sYdU3YZc0beKXk/h4dFk79an4xMvdi9lF91RYBNBN8iJlJPX4GfInAcR7qcjrwjRzQCl 86aJdvwp37TknV0nts5zjrCCIb4CO/I1l2WB7+l+Q3bk1x+uGVQ5btqGxdt2UWFwnKgx G1U/F+Ay6egUsEzD1vHuKXtHSoVopuVHCOwJQdwtAM9G0RE9YRJdxE6qN9U6l5XdsVsw Jvpw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :mime-version:content-transfer-encoding:date:message-id; bh=xZ5nN5WHmfOj69eH4qe9XuCIyFQ5ifL+Jt+JzmdUWak=; b=KLSS0g4Vmcrj1HUeiaKPz52jmyaMykz76LCIiLTo5o1VVApyB+f7p+VmjZpbkgh/6E QntXqRh9XfaNi2d6/hifO/Dn8+FRdqCt71TF1feQOpaw5JMmP6KMVYtgThdzCmspXUHY FrjP1Kw+ZLry+lO5mU6torHTIOkJYv9fYissHi2zymCClqAYX1wmebqQaBITxGIzBZVK hrNis9ehEndWxHbnakNrGDzNVzoE7t1U+2mBu8ZHCu/db04QxIWxbsL1NvTmhS0O2PDg hq48razDf8y9S5Pd3klfngKsEdfh8IrF+MdjwnC9sXH7GT3TFjGJnGDfEipJ620Sglya xbpw== X-Gm-Message-State: AOAM530VRQIrEIzYGS8TXu7n3sg7uEZcoAthFrH6ANZE8UMgBsFMhDTP 4VDow09uJXy8+MjChc9Efunkjw== X-Google-Smtp-Source: ABdhPJw5n1rQbUqaeALiNJh1FHdqBMB5F4Us0QASOFTT7xo9O9fc/msFJMmCIK82xAaq2SoVRGpxAQ== X-Received: by 2002:a05:6214:29e9:: with SMTP id jv9mr35724449qvb.67.1636331892148; Sun, 07 Nov 2021 16:38:12 -0800 (PST) Received: from turing-police ([2601:5c0:c380:d61::359]) by smtp.gmail.com with ESMTPSA id w9sm9397357qkp.12.2021.11.07.16.38.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Nov 2021 16:38:11 -0800 (PST) From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Google-Original-From: "Valdis Kl=?utf-8?Q?=c4=93?=tnieks" X-Mailer: exmh version 2.10.0-pre 07/05/2021 with nmh-1.7+dev To: Drew Abbott Subject: Re: Kernel module that shuts down the device In-Reply-To: References: Mime-Version: 1.0 Date: Sun, 07 Nov 2021 19:38:10 -0500 Message-ID: <160859.1636331890@turing-police> Cc: Greg KH , 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: multipart/mixed; boundary="===============6111239393807762955==" Errors-To: kernelnewbies-bounces@kernelnewbies.org --===============6111239393807762955== Content-Type: multipart/signed; boundary="==_Exmh_1636331890_3603P"; micalg=pgp-sha256; protocol="application/pgp-signature" Content-Transfer-Encoding: 7bit --==_Exmh_1636331890_3603P Content-Type: text/plain; charset=us-ascii 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 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? There's a whole bunch of ways to schedule work in the kernel, it doesn't have to be a heartbeat function. Plenty of drivers are split into IRQ and non-IRQ parts (sometimes called the top and bottom parts of the driver). See how they get info from the IRQ part to the non-IRQ part. --==_Exmh_1636331890_3603P Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Comment: Exmh version 2.9.0 11/07/2018 iQEcBAEBCAAGBQJhiHFxAAoJEI0DS38y7CIckpsIAIZdzbxQEHMyIZI8+tb7b8w2 gHDm0rNC8xQiMHHlE2JIirfLwP+PCcbkAEr/yLS8IB+CLAeGNVsRGAX4Zo3oZW+Y DuH7K56eV7olHaocKw+H4GMGnn7K5ifM4EoVI3xtEEBrlEYnfpCT7MdQTak+ztDl 0osZajwgCRQaJv9ItoGcFsmV2XjysvTNVyOSn0rO/JBWeLBgsNYqEB/Rvphlb+Su gJn0v7SUFSywZ124JvdpJT44uwY0WhMUYouzcvYJyZQ4ySJ8UEpHKYtWcZs/lTz7 JK6DOGz//suXnB3ZrLbQdBHAS0hE6bs2jk2IRx3A6AAQxl4hUz4/Y6cX2Oc+vlg= =XGM6 -----END PGP SIGNATURE----- --==_Exmh_1636331890_3603P-- --===============6111239393807762955== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies --===============6111239393807762955==--