Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1726694imm; Thu, 20 Sep 2018 01:45:01 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYY7+WTAlT+QsDXSxFbFFcrjreSDCEkT12KUNETeJIsKIuuSId3sn7i9NrrHXa/8pjdgX7T X-Received: by 2002:a63:f713:: with SMTP id x19-v6mr35162686pgh.233.1537433101497; Thu, 20 Sep 2018 01:45:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537433101; cv=none; d=google.com; s=arc-20160816; b=b5lJ3RFadLAKGbK2a7fvDI7JD5MTzDlBhLbHTVW9b/pY625bU/qhcbp4YYiOmPAM/n nvPPyJMsc/t+6/d3PkZWX/pS1XZBJVhI4j9YxTA8ASl/8oErn++p2uBnH1v1nF/z54ew 3F+xeDexbopWcGlcLktelNPZh12RjDfMMkueGpNmnK/gHqbaQMRQkSx0qP+4rhGbFtEM NjtrtyG2HjvAqp/DLBjGpy6h+nUIcNFxJhB8bo+h07Cnvuq1cjOtIp/2R744mJPZ2Y5P SpNS+TdbHZuDpXY+OT0Y9cRB979YM6A9vwlzXZztM380off3NyEBjnvO5rMqlIp2c5o+ xG7w== 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=rqu/eUQuQzDeOG0HUkz09G2MI1UkuCfHTd1AO7qo9XY=; b=BDJZcopyG8uP4mv+3TBiPxuYKawNgPvAJXeXhCnXYrTt5RxCsoobAfJjwWDQWssp7m zB18/VjXwqbSHp8U5VwvCUTqQ5oSTMSX9Itt84O5Jp0KR+tEIDwHBCgL3GH+QZEtdhLa nOpu4riR+z7oE3FSw8c/iDlrceZggKpslLhLeX8ou+OIHUL5XrPqZtKcf8w8erf2Wc2h kcaT7mXdtbE11nR52YEREJc3scaJY2HMpYRO7R7CyHgnbXEba1kp2hJnbimjDRT7KeHL tRYW/WKUQwXjoa/s+QJDLceg1VO3izoqKXO5ObLthS9Jx3aa0fz53mjrNp9yoY8lYSGw Bdkg== 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 b9-v6si22803123plr.78.2018.09.20.01.44.45; Thu, 20 Sep 2018 01:45:01 -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 S1731546AbeITO1C (ORCPT + 99 others); Thu, 20 Sep 2018 10:27:02 -0400 Received: from fudo.makrotopia.org ([185.142.180.71]:50353 "EHLO fudo.makrotopia.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726383AbeITO1C (ORCPT ); Thu, 20 Sep 2018 10:27:02 -0400 X-Greylist: delayed 1180 seconds by postgrey-1.27 at vger.kernel.org; Thu, 20 Sep 2018 10:27:00 EDT Received: from local by fudo.makrotopia.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1g2uGW-0003pp-Vq; Thu, 20 Sep 2018 10:24:51 +0200 Date: Thu, 20 Sep 2018 10:24:29 +0200 From: Daniel Golle To: Pavel Machek 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: <20180920082425.GB20006@makrotopia.org> References: <1537328730-9156-1-git-send-email-aditya@kobol.io> <1537328730-9156-2-git-send-email-aditya@kobol.io> <20180920072354.GA20392@amd> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180920072354.GA20392@amd> User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Thu, Sep 20, 2018 at 09:23:54AM +0200, Pavel Machek wrote: > 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) 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... > > Otherwise yes, ata trigger makes sense. > Pavel > -- > (english) http://www.livejournal.com/~pavelmachek > (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html