Received: by 2002:a05:6a10:a852:0:0:0:0 with SMTP id d18csp3735345pxy; Tue, 4 May 2021 08:47:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzqDT3cL6aZR/juqXaVJpJaNi/7VQQ6CWCMHPE5d+mQIQh1lW3eIZp+bTRsel5U7XqAvDmO X-Received: by 2002:a17:902:a582:b029:ec:d002:623b with SMTP id az2-20020a170902a582b02900ecd002623bmr26716625plb.36.1620143230974; Tue, 04 May 2021 08:47:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1620143230; cv=none; d=google.com; s=arc-20160816; b=Frw+1ukqgAw8yKJSWmJLjZ9/y9E0WldxLF44mhmJPjL8WCs7ARKEgiXUxtnXc05Qrc OzbkiHsM8BZggCFiGhgCvirfEc3NlX/ScbDc151E3cU4os00fYJS944VpIUPL1/ih3fb sj4D9ilJ0GrBTOfMqh5pZgZetw5taGUtFAVmhmK/VWrH5m7ccEw7kZmE49suuVRnt5lj 5TCyUdv9D8qGVXHMpbad1bnLQQT+Y18+w61o08ndgffr/S8U0LSK/kGXO6vF1eVpAhyg q+y0MZCF8A0bWaYmqEz6askINDHOdMP4/xwkDlCeGlfYaXwG/hSqILv/6tEAHZ9hXsXo IIDQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=PDZuQ2mlhkxIfbBy+GvHwcgbRmNh17KVmOZeHikw3iY=; b=CWsxQTc3iuKpHW3gnoldS8Alzz7+xr5Ddq4eeugbaL+OR4EfkLoPSWhhU/rOR2vSci av2vuG89KsSM3FVABdOMGlx1N4HHPdPN4Y+QPjbUiZujRxU1x57kkaD1i0kmQ5+iMMJT vE6gUq9Ag3DbvdRP1FX9ic/lgAs7TsGlo5YXmge8CNLy25cxJtfiXNoWNVlNwIO1kzNJ 0UAAdj+obGhDrM3mUaTFwMXYtMfiFM2z8IXC5Yu818AhmCrPHV3nAbaeI5gLWKy8vyN6 umpowg05cQpSgiTdR86swtSKWYhGtZ5RjAd3JdXpHhzba46HN8ad9yJqu3eXxnP89M1F Q++w== 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 t24si473560pgi.360.2021.05.04.08.46.56; Tue, 04 May 2021 08:47:10 -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 S231441AbhEDPo7 (ORCPT + 99 others); Tue, 4 May 2021 11:44:59 -0400 Received: from jabberwock.ucw.cz ([46.255.230.98]:49126 "EHLO jabberwock.ucw.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231438AbhEDPo4 (ORCPT ); Tue, 4 May 2021 11:44:56 -0400 Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id EC6C71C0B87; Tue, 4 May 2021 17:43:59 +0200 (CEST) Date: Tue, 4 May 2021 17:43:56 +0200 From: Pavel Machek To: Enzo Matsumiya Cc: Hannes Reinecke , 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: References: <20210430183216.27458-1-ematsumiya@suse.de> <20210430183216.27458-3-ematsumiya@suse.de> <7e8da9ec-b3e3-0329-d54c-bb44c4064f0d@suse.de> <20210503101134.GB6621@amd> <20210503165615.maqgm5e2gq554hcm@hyori> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210503165615.maqgm5e2gq554hcm@hyori> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 2021-05-03 13:56:15, Enzo Matsumiya wrote: > On 05/03, Pavel Machek wrote: > > > 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 should > > > be handled by the LED trigger subsystem, _and_ you would avoid the need for > > > a for_each_blk() construct. > > > Thing is, I don't think that all block devices should be handled by the LED > > > 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? > > TBH I haven't thought of that. My initial idea was to actually offer > maximum flexibility to the user, so exposing all block devices on the > system [*], being able to set any LED available as an indicator for each > of those. > > But, indeed, just using ledtrig-disk in NVMe and SD might just be > simpler. > > > [*] - again, I see now this was a bad idea and will be changed in a > possible next version Sounds like there should be no new version. Modify NVMe/SD if required, instead. Oh and disk-activity LED trigger blinks when disk is fully loaded. I believe that is a bug and I'd not mind if it was fixed. I probably have local patch that needs cleaning up somewhere. Best regards, Pavel --