Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp55771imm; Thu, 20 Sep 2018 15:05:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYLG9mh2JRVuaGRoJJbDG1e8LG7Cm6ycTzWQdpLc1M/LauEVytY4V7/1HKqoo8hPmDZCAOp X-Received: by 2002:a17:902:e20d:: with SMTP id ce13-v6mr24889101plb.47.1537481131425; Thu, 20 Sep 2018 15:05:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537481131; cv=none; d=google.com; s=arc-20160816; b=Dtq34+VauVjKVeU+m3rlIfF0xG0GdwL3uu9i3WEv32lUQ0C5qcsP0dDpxo2E1Zue8r EtIQWHHK26jUmOUhZW5NFxh94CNfpcnk4+VcgqX4OOio4yiK8/YxHaUUlPkdrZmec0qc YmLqzszrCjat2Hr6cuYyy/Nmj+wO8GwKg17Vpi7o/dN9C4ZwfqoNQKckuZTZeRZAsmKj rxVnNCIzHSUEfMJD0w8JXlhfyPzi5SH0TBUlSwoAXOyTREnD0T59aGSwbJZYMmc/9Koh A9PsApcKBHAZ5R46ulm34W34T/uxGcxhIGFVI5WJ5z+bD2XGVnecuJfcS2swiH6WOE0K hlyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=XFWAICa5NkMBwvEp1yrPpxLbfVi2eyYkecVvtlRPPm8=; b=JDThOIPe+G6V9MjF0Ga6jLz8ObGcby9aACb0b0nO1R9lz4ctpuCKHqsMptEuGaJEMJ JdFWDwJqD4ggM/Ab0fNFe/Mc/ZmH/4H1plzHJpNTuwasTncv644u6PeLJImhMVUv3OoO lVmVfwEBq6qcug389oj0pT1LwIqAo/4QpT09SQcR42T1GCMc4Jp2InM4//ezzdcOe8Ff wB5CHAustQlFYhqy1/VTS7YXC1KreGwOHAhy8aeHE4gOxvyeoIysWVd5XUnPxddBzu5b sU2E/+qxSe8tUg4n7GoCH7gTQzOHOFYcNIflYSg308gprO6mav3Legi3JrtFHw01F+hQ qV7Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o128-v6si25125431pgo.276.2018.09.20.15.05.15; Thu, 20 Sep 2018 15:05:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388730AbeIUDu3 (ORCPT + 99 others); Thu, 20 Sep 2018 23:50:29 -0400 Received: from atrey.karlin.mff.cuni.cz ([195.113.26.193]:55749 "EHLO atrey.karlin.mff.cuni.cz" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbeIUDu2 (ORCPT ); Thu, 20 Sep 2018 23:50:28 -0400 Received: by atrey.karlin.mff.cuni.cz (Postfix, from userid 512) id DE2558075A; Fri, 21 Sep 2018 00:04:49 +0200 (CEST) Date: Fri, 21 Sep 2018 00:04:49 +0200 From: Pavel Machek To: Daniel Golle Cc: Aditya Prayoga , linux-ide@vger.kernel.org, linux-leds@vger.kernel.org, Jason Cooper , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Russell King , Jens Axboe , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, Jacek Anaszewski Subject: Re: [PATCH 1/2] libata: add ledtrig support Message-ID: <20180920220449.GC27468@xo-6d-61-c0.localdomain> References: <1537328730-9156-1-git-send-email-aditya@kobol.io> <1537328730-9156-2-git-send-email-aditya@kobol.io> <20180920072354.GA20392@amd> <20180920082425.GB20006@makrotopia.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180920082425.GB20006@makrotopia.org> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! > > > +#ifdef CONFIG_ATA_LEDS > > > + /* register LED triggers for all ports */ > > > + for (i = 0; i < host->n_ports; i++) { > > > + if (unlikely(!host->ports[i]->ledtrig)) > > > + continue; > > > + > > > + snprintf(host->ports[i]->ledtrig_name, > > > + sizeof(host->ports[i]->ledtrig_name), "ata%u", > > > + host->ports[i]->print_id); > > > > > + host->ports[i]->ledtrig->name = host->ports[i]->ledtrig_name; > > > + > > > + if (led_trigger_register(host->ports[i]->ledtrig)) { > > > + kfree(host->ports[i]->ledtrig); > > > + host->ports[i]->ledtrig = NULL; > > > + } > > > + } > > > +#endif > > > > No, we don't want you to register multiple triggers. We want one > > trigger, than has parameter "which port to watch". (Number of triggers > > is limited as by sysfs limitations). > > Back then I implemented it that way to be able to define the > default trigger for each LED in device tree and "trigger-sources" > didn't exist yet (it was introduced for USB ports and isn't yet used > for anything other than that) I see why you did it... BUt I believe we still want single trigger solution... > However, the problem till today is also that ATA ports are often not > individual device-tree objects we can refer to, see for example > marvell,armada-370-sata which appears as one opaque controller. Ie. > all SATA drivers have to be converted to expose individual ports on > device-tree before the trigger-sources approach can be applied... Yep, well... something to do in SATA then. Perhaps this should also have an option for single LED for _any_ SATA activity, and 90% devices will be happy with that? Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html