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 X-Spam-Level: X-Spam-Status: No, score=-5.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_2 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 165EAC2D0A3 for ; Thu, 29 Oct 2020 23:14:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67DFF20791 for ; Thu, 29 Oct 2020 23:14:57 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604013297; bh=gTNfXJGtxbnszyR6UQzmog+Uta66SVkG3bk+ErfAkzM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:List-ID:From; b=SxCZBgzR9rmc6hyEMcZOrPjrFWFF/buuVD26M8DYcbn830ZN0E0J+6fMYTOO3+LAX DgdTzkEZhK3cHMMAHJopJ90lrONoi/jbvWEqFPwlXHpuFVoju1i2qN5hxS8loK7cTh A+I9/wnWqyA2RUGrZtVtC0oL0+QiRMBjO0nv7RS8= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725765AbgJ2XO5 (ORCPT ); Thu, 29 Oct 2020 19:14:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:56852 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725372AbgJ2XO4 (ORCPT ); Thu, 29 Oct 2020 19:14:56 -0400 Received: from localhost (otava-0257.koleje.cuni.cz [78.128.181.4]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 585092076E; Thu, 29 Oct 2020 23:14:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604013296; bh=gTNfXJGtxbnszyR6UQzmog+Uta66SVkG3bk+ErfAkzM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=pL+xF2C1RFGDXg597rTdnybpZAhc4AQOjbPKfQmFrs0e8dzY4ec+SxX2eDN2ioK0+ ZLQFg8Wfg4iGcEpoerFHgqFkngjRP1YQ9bjSl1zhlX1QPWJSkuXAkt7r7DPmC8TjyO FYDcTcmmLS8K9Q6D1VCWG+M+HoWCVNi/kQkywcPE= Date: Fri, 30 Oct 2020 00:14:45 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: Jacek Anaszewski Cc: Pavel Machek , Ben Whitten , linux-leds@vger.kernel.org Subject: Re: ledtrig netdev: what is the purpose of spinlock usage? Message-ID: <20201030001445.40154b4a@kernel.org> In-Reply-To: <984dfc46-f9a0-fb6e-0eef-3837e3fec0b7@gmail.com> References: <20201029070000.15472666@kernel.org> <20201029174529.GA26053@duo.ucw.cz> <20201029191347.6d509614@kernel.org> <984dfc46-f9a0-fb6e-0eef-3837e3fec0b7@gmail.com> X-Mailer: Claws Mail 3.17.6 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org On Thu, 29 Oct 2020 23:49:19 +0100 Jacek Anaszewski wrote: > register_netdevice_notifier() registers raw notifier chain, > whose callbacks are not called from atomic context and there are > no restrictions on callbacks. See include/linux/notifier.h. > > So it looks like the spin_lock_bh() can be safely changed to > mutex_lock(). > Niiiiceeee, this simplifies things much. Thank you, Jacek :)