Received: by 2002:a05:6a10:c604:0:0:0:0 with SMTP id y4csp3717073pxt; Tue, 10 Aug 2021 09:42:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy2pAYLoZG6D+ikEZFYelj4ZtQDzjV7Rsthw2y8dqg9r8ZK01GvbCJ3bztiGWNxqYdE7ayy X-Received: by 2002:a17:907:3d8f:: with SMTP id he15mr26691886ejc.256.1628613740143; Tue, 10 Aug 2021 09:42:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1628613740; cv=none; d=google.com; s=arc-20160816; b=b7UUzqetH0EAk9wXxBQetg3i3Wd1kfU1G/LkHzEpmqVQmZLJ2UepW96M3Mp8Zid8+u TJz6arhZZtrqCu2JdH675wevrRUTKQnECPJaqSUHdQQWPOEW2bsykL3+WjCd4PZmIqMX tTF7iCFsS8K+05FPbOPqXBM3Ug/biOgIyuaP9CsCq9LVykEkKbRcPzFUjYCJzFE80Qcu 4RFSYDgzlncGnNfLyFRQZyDlpiZECUyRXoBk2SicZXoB8jgy35oNagLf26DNTM7nAD+i P4D9YTDxHwxVHKrdYEMlaruLWCvmYSAbW6eVTjxCzlAm+cZJq2DsnywTrjdnKcyZE8O5 q5tw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=u7IquILawjBm78inRCPLvIVMfEVhL/yKlRRqOlxpHYY=; b=I4luf3R1wGIlPRhZKEwFuvYkS0lYJdUXL8Jt/hdpxu5ssiEKL32Z5La30I1NxqXD1X RY5ynhRA4N6zy2GO5cekbFV/ohdZtXHrzgyfYlK60rW5AsnnRmL87raoa+iniqY0uwJM SFyHiVrxITiFK1TMq1P2+MfrYMTJzVPql21se7ZpfGFDTqoCBolp5iFy4zajtGOP0Pe4 of5CdbqLniCSpx0VXwsdczMDUPxRLBtxGJr+jBaMqPtzkbwZFaFv2m8eH7DfQoCNiCiQ jZYKLIbdkJOiWH/wgS7PgxLm6YVE/YwALCg3JePoSWCCZR7KIRy2YBVGSUNa6//5sstx oUuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aejb1GlE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cq2si20845850edb.572.2021.08.10.09.41.55; Tue, 10 Aug 2021 09:42:20 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=aejb1GlE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241936AbhHJOse (ORCPT + 99 others); Tue, 10 Aug 2021 10:48:34 -0400 Received: from mail.kernel.org ([198.145.29.99]:42436 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241888AbhHJOsb (ORCPT ); Tue, 10 Aug 2021 10:48:31 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4835560F25; Tue, 10 Aug 2021 14:48:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1628606889; bh=BCaw6jsYR+1+ch9MuRv11DN73c0NzIIA0uUPkD5qS+Q=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=aejb1GlEF8xfjZg3Dr67Ia/+4GKCFO8u3xGOqykZ1QOXFXvGioKaoWlknitlue5jy qP6VTMWyAJbbfpGq7Os9IMYLQhtpH92htrvSy6mCEvGJMjWoGnbD2YsYH5f7kgir9r XT4G8X93IOY/K4TixaZ117wv82K9ARjVLNNzBJ1g= Date: Tue, 10 Aug 2021 16:48:05 +0200 From: Greg KH To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: axboe@kernel.dk, kernelnewbies@kernelnewbies.org, Ian Pilcher , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, pavel@ucw.cz, pali@kernel.org, hch@lst.de, linux-leds@vger.kernel.org Subject: Re: [RFC PATCH v2 00/10] Add configurable block device LED triggers Message-ID: References: <20210809033217.1113444-1-arequipeno@gmail.com> <20210809205633.4300bbea@thinkpad> <81c128a1-c1b8-0f1e-a77b-6704bade26c0@gmail.com> <20210810004331.0f0094a5@thinkpad> <7b5f3509-5bcd-388b-8d3b-4ea95a9483ad@gmail.com> <20210810153840.42419d06@thinkpad> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210810153840.42419d06@thinkpad> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Aug 10, 2021 at 03:38:40PM +0200, Marek Beh?n wrote: > On Tue, 10 Aug 2021 08:35:08 +0200 > Greg KH wrote: > > > On Mon, Aug 09, 2021 at 06:50:44PM -0500, Ian Pilcher wrote: > > > On 8/9/21 5:43 PM, Marek Beh?n wrote: > > > > I confess that I am not very familiar with internal blkdev API. > > > > > > It's mainly a matter of symbol visibility. See this thread from a few > > > months ago: > > > > > > https://www.spinics.net/lists/linux-leds/msg18244.html > > > > > > Now ... my code currently lives in block/, so there isn't actually > > > anything technically preventing it from iterating through the block > > > devices. > > > > > > The reactions to Enzo's patch (which you can see in that thread) make me > > > think that anything that iterates through all block devices is likely to > > > be rejected, but maybe I'm reading too much into it. > > > > > > > > > Greg / Christoph - > > > > > > (As you were the people who expressed disapproval of Enzo's patch to > > > export block_class and disk_type ...) > > > > > > Can you weigh in on the acceptability of iterating through the block > > > devices (searching by name) from LED trigger code within the block > > > subsystem (i.e. no new symbols would need to be exported)? > > > > > > This would allow the trigger to implement the sysfs API that Marek and > > > Pavel want. > > > > No idea, let's see the change first, we can never promise anything :) > > Hi Greg, > > Can't we use blkdev_get_by_path() (or blk_lookup_devt() with > blkdev_get_by_dev())? > This would open the block device and return a struct block_device *. > When the LED trigger is disabled, it would also have to release the > device. But what about when the device is removed from the system first? Be careful about that... Anyway, sure, try those functions, I really do not know, all I originally complained about was those exports which did not need to be exported. thanks, greg k-h