Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp2578497pxy; Mon, 3 May 2021 03:27:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw8VyDYgn6CQPnhKbK5AcPHlbTuPi/T6HF0OVk+vCaRQREpL9qhuepWq57Z6siJcdr0oHb9 X-Received: by 2002:a05:6402:309c:: with SMTP id de28mr18912632edb.191.1620037669066; Mon, 03 May 2021 03:27:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620037669; cv=none; d=google.com; s=arc-20160816; b=UgbayztG8EFGDJIc0xYrcNGwJhC9etYJWykiA9fgoqk3WWUX+rzSMvKK79mBWieuGz OZylsmhFDDr9f74avf/0B3Om36BxI8QA4oFlJi4Qv8lCYJqIY5Pb8JwOhkgyh+knJtEm qgHpKKUiSfTCNEv1lpkbBxJgJNUnonNI/mYJrVqhLbGkChYGE02M94UU+aTYqeE5qBCi 0t/rjucbktXMS4hNvCf9gtqXEFXYiabJV12tF0WBC4KuUewDAS0qtxSaEOOQeBb1tuah 138QSMuT8sfAhK5nl+hfVeR6O7/aRKuCmW1+2WVsnBgqr90dXg/ZQBPy/R6ctgohKgmd nwEg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=fQ6aAT/liMfhE5jNKZuY9Yr6jIHeRCclvTfpISBi4Qk=; b=WstaCG0vI6XOoUfZQ8usciex9q82Tw6Ll372B1YKNBvaoq0wsscc4B+zLMDW3AGKYV X892cswFNv9LybtboFMpeP9uYViwf3Xs9kMB+UmfuHTiWcieb+0fSH5PghTfKz3PxwJS MNIc3JtErGE7fEQfrJDAE/pDpjru5U5Sxr/cdf8Xdbd9MVJ8gZw/oXD2txP5Ei4+wsDa ThQJCHvQGWEsKgRPCnZPDXwJ4C/6eOtvYSt5GFyXtvFGyoBO6h0YJ7m5wJMytqhsul5v ygyw05V6GD2e/sYtXr/RRXe5islNIFiEHw8FLPgb0Urt7qHCsBoqQ/7n/iPnO8AAYgh7 cSKQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e15si1452139edz.24.2021.05.03.03.27.25; Mon, 03 May 2021 03:27:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233152AbhECKMa (ORCPT + 99 others); Mon, 3 May 2021 06:12:30 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:37388 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232960AbhECKM3 (ORCPT ); Mon, 3 May 2021 06:12:29 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 8CE631C0B79; Mon, 3 May 2021 12:11:35 +0200 (CEST) Date: Mon, 3 May 2021 12:11:34 +0200 From: Pavel Machek To: Hannes Reinecke Cc: Enzo Matsumiya , linux-leds@vger.kernel.org, linux-block@vger.kernel.org, u.kleine-koenig@pengutronix.de, Jens Axboe , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [RFC PATCH 2/2] leds: trigger: implement block trigger Message-ID: <20210503101134.GB6621@amd> References: <20210430183216.27458-1-ematsumiya@suse.de> <20210430183216.27458-3-ematsumiya@suse.de> <7e8da9ec-b3e3-0329-d54c-bb44c4064f0d@suse.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="aM3YZ0Iwxop3KEKx" Content-Disposition: inline In-Reply-To: <7e8da9ec-b3e3-0329-d54c-bb44c4064f0d@suse.de> User-Agent: Mutt/1.5.23 (2014-03-12) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --aM3YZ0Iwxop3KEKx Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi! Please trim the emails you are responding to. > >+MODULE_AUTHOR("Enzo Matsumiya "); > >+MODULE_DESCRIPTION("LED block trigger"); > >+MODULE_LICENSE("GPL v2"); > >+ > > > As already commented on, this for_each_blk() construct is not a good idea. > Infact, I guess it would be better if you could invert the logic: > Not having the block trigger enumerating all devices, but rather let the > devices register with the block trigger. > That would have the benefit that one could choose which block device shou= ld > be handled by the LED trigger subsystem, _and_ you would avoid the need f= or > a for_each_blk() construct. > Thing is, I don't think that all block devices should be handled by the L= ED > trigger; eg for things like 'loop' or 'ramdisk' it is very > >questionable. > Downside is that you would need to modify the drivers, but realistically > there are only very few drivers which should be modified; I would go for > nvme-pci and the sd driver for starters. Maybe floppy, but arguably that = can > omitted as one has a very good audio indicator for floppy accesses > :-) And we already have disk activity trigger. Maybe NVMe and SD needs to be modified to use it? Best regards, Pavel --=20 http://www.livejournal.com/~pavelmachek --aM3YZ0Iwxop3KEKx Content-Type: application/pgp-signature; name="signature.asc" Content-Description: Digital signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1 iEYEARECAAYFAmCPzFYACgkQMOfwapXb+vKPawCfdpv2CRk6cfP28YKt4NNUlih1 NR0An0FymyfhKdJOnOcBYoWFhbxfIiFw =3zg8 -----END PGP SIGNATURE----- --aM3YZ0Iwxop3KEKx--