Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp279573imm; Thu, 20 Sep 2018 23:32:25 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdbw5+7T5DfeN5wPpABFsWOqTGVKu7KqwFDeyvoAgSiInLGFYU5daTcf3GdCv7DnhxXZGRV6 X-Received: by 2002:a63:2906:: with SMTP id p6-v6mr39617413pgp.204.1537511545803; Thu, 20 Sep 2018 23:32:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1537511545; cv=none; d=google.com; s=arc-20160816; b=uiUi+YMZslbbm4Rh57rZzhtL5yvF81MW0/IzOuv0jf5pOOeRTA/PQt1t9mdoSRhwNL itqHX38U3+e3Ck5xeOuuSJ2olxA63lV4c4leOJx5JmNUVd3mMZfp4VcmlSZKExOJtBW2 +Fv8Sq5q5HwpQRY71NbzqxPXhet0GpX0jJnVqXPy6KhCjrk/1vxJ3HG1yzy90OTkirQo 7D6w7IU2Bct4XeOMn6rHbKshanq3Q4o+b7Sxb9ayfnbJ/2x5G+8UIL45v89eyy4LUWpu dmeCeSPVDjSKxxMz1eInCdNMqvZK1jjPhkhQlkMYw4McTlvPdENGDbbFbFCOzQJpva34 qEJg== 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=sd2G86MtrVo9YNMh0uPzFp6mmb9HVI01lT+ZqclfsCc=; b=t61jtwVgS7vbKIwcPhB+EQLJroWryLrDFCAtzdtOGrBMRCVUzWPfg6SOe7L0coyrde q1KLQk0RV7zZpFyYoY7HF5Odv2uMO61CN4WIVzgywWqEwrF3yA3GynqacueOKZIKhkjD kTV4pgARAfVlAt1NLmtcFQoWfyEirDmpFNZASK3KXvJWLQQW5Niz+ZFf9Ivdr3HTuebF 3Sh5l5kvdArcE6WRPzns4K98a6itTQohuqawd2NGc424GGIDtU5b9jvU83a+e4h4KKa0 gS8YplPPbFi4roNAq8dvCNuBHX1iKm8lvvrRi3XeL9Xv2BmJk3hiOYamwB3EPwKIv0s3 CaWw== 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 r20-v6si21359620pgk.207.2018.09.20.23.32.09; Thu, 20 Sep 2018 23:32:25 -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 S2389340AbeIUMTF (ORCPT + 99 others); Fri, 21 Sep 2018 08:19:05 -0400 Received: from fudo.makrotopia.org ([185.142.180.71]:54296 "EHLO fudo.makrotopia.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389190AbeIUMTF (ORCPT ); Fri, 21 Sep 2018 08:19:05 -0400 Received: from local by fudo.makrotopia.org with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.90_1) (envelope-from ) id 1g3EyN-0007bm-Pc; Fri, 21 Sep 2018 08:31:29 +0200 Date: Fri, 21 Sep 2018 08:31:09 +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: <20180921063103.GD20006@makrotopia.org> 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> <20180920220449.GC27468@xo-6d-61-c0.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180920220449.GC27468@xo-6d-61-c0.localdomain> 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 Pavel, On Fri, Sep 21, 2018 at 12:04:49AM +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) > > 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? The whole reason for not using one of the existing disk-activity triggers was to address individual SATA ports to individual LEDs of NAS devices (in my case Shuttle KD20)...