From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.5 required=3.0 tests=BAYES_00,DKIM_ADSP_CUSTOM_MED, DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AC42C4338F for ; Thu, 29 Jul 2021 01:55:04 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0CBF260525 for ; Thu, 29 Jul 2021 01:55:03 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0CBF260525 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernelnewbies.org Received: from localhost ([::1] helo=shelob.surriel.com) by shelob.surriel.com with esmtp (Exim 4.94.2) (envelope-from ) id 1m8vFq-0002j5-75; Wed, 28 Jul 2021 21:54:34 -0400 Received: from mail-oi1-x229.google.com ([2607:f8b0:4864:20::229]) by shelob.surriel.com with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1m8vFm-0002i8-66 for kernelnewbies@kernelnewbies.org; Wed, 28 Jul 2021 21:54:30 -0400 Received: by mail-oi1-x229.google.com with SMTP id y18so6368056oiv.3 for ; Wed, 28 Jul 2021 18:54:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bBOOqkTj7VfQtppJgA3DRf1xTVJ3jngXH3eM9beR2jE=; b=UZkPpHJbUa1GEesgvUr8RRfY/5uEgz/fkHrUhw28ymMT9TuywUDUXPlFoY6RAKFVen izjQux0i9YVdlnuik22EdrnNrOGIC4QKjW+SLFKShfrylFH/OvSAOHdiJTBaJstQ1GJz 2SGSy0OAv85CrCbdbtrQE80Hb0b5QYoLH3yS2DZrIn+j6ry9tN1+YFEUMHwTDNElRuMV sSZl0ZafFEzlVyV43HxReGGRSnBVcNygonSh3eRTjnpwWAwGqt9egAKtQR1ilWoffN1D kKajE6Iqk4xD4xFyydMlfhsPp+6ODEVmcC5VyWtpZwJvw3HDIVBrsOwpnT8dQVTTJLPC PrPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=bBOOqkTj7VfQtppJgA3DRf1xTVJ3jngXH3eM9beR2jE=; b=rfY8Ej5D17/TRLBJ5fIX2jQ/79VL/aHL3RqmyPR5336C7ReypuPUvbTaBgy0JgY2Yy Ru1Bx1fLMglnTMyHpoEDIRaqhSdOwd4Gj4EmQP9K+DpTbQ6+s9GnX7IfcRlUPe/JJWwh 6fD3a2iwb8htcV2vSaKNv135Dv5EI3oB48mHvPFvJKGpipFByIR17niMZfGidAV/ilRu dUQrpZ7Fhrqla8hqUj3ccwXFpbz+b4kS+v7SdLnRB/9vsKRCSa3D96vcdZ4YewIGIXwT w26run3Vgqr7QUjOXs8P/U915ckSfIYAlOfQtho/vkbbQAKwlg5BV7FvNauZwD9rqtag 3Udw== X-Gm-Message-State: AOAM533yThY1cc8mWkwnWkX6NM3CYuapMeQ4fwVBaEiIUP19b88w7Uxb 54/UV3F4YaETxr6QyK3JWPY= X-Google-Smtp-Source: ABdhPJzDiG5SfOf1a07BhZr0SfMvHnTgGzGUFjdhVz5hP19aH4QWkq156EjGle0acTV57e58Lp12Pg== X-Received: by 2002:a05:6808:1887:: with SMTP id bi7mr47393oib.115.1627523668026; Wed, 28 Jul 2021 18:54:28 -0700 (PDT) Received: from ian.penurio.us ([47.184.51.90]) by smtp.gmail.com with ESMTPSA id c11sm311424otm.37.2021.07.28.18.54.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 28 Jul 2021 18:54:27 -0700 (PDT) From: Ian Pilcher To: linux-block@vger.kernel.org, linux-leds@vger.kernel.org Subject: [RFC PATCH 0/8] Add configurable block device LED triggers Date: Wed, 28 Jul 2021 20:53:36 -0500 Message-Id: <20210729015344.3366750-1-arequipeno@gmail.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Cc: axboe@kernel.dk, Ian Pilcher , linux-kernel@vger.kernel.org, pavel@ucw.cz, kernelnewbies@kernelnewbies.org X-BeenThere: kernelnewbies@kernelnewbies.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Learn about the Linux kernel List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: kernelnewbies-bounces@kernelnewbies.org This patch series adds configurable (i.e. user-defined) block device LED triggers. * Triggers can be created, listed, and deleted via sysfs block class attributes (led_trigger_{new,list,del}). * Once created, block device LED triggers are associated with LEDs just like any other LED trigger (via /sys/class/leds/${LED}/trigger). * Each block device gains a new device attribute (led_trigger) that can be used to associate the device with a trigger or clear its association. * My expectation is that most configuration will be done via sysfs (driven by udev), but there also in-kernel APIs for creating, deleting, and (dis)associating triggers. * Multiple devices can be associated with one trigger, so this supports a single LED driven by multiple devices, multiple device-specific LEDs, or arbitrary combinations. Along with support for more than just ATA devices, this is the main difference between this function and the current disk activity trigger. It makes it suitable for use on systems like the Thecus N5550 NAS, which has a software-driven activity LEDs for each disk. * In addition to physical block devices, many types of virtual block devices can drive LEDs; device mapper, MD RAID, and loop devices work (but zram swap devices do not). * The led trigger is "blinked" (75 msec on, 25 msec off) when a request is successfully sent to the low-level driver. The intent is to provide a visual indication of device activity, not any sort of exact measurement. * Related to the previous bullet, if the blink function is unable to immediately acquire a lock on the device's LED trigger information it simply returns, so that I/O processing can continue. It's probably obvious that I'm basically a complete newbie at kernel development, so I welcome feedback. Thanks! Ian Pilcher (8): docs: Add block device LED trigger documentation block: Add block device LED trigger list block: Add kernel APIs to create & delete block device LED triggers block: Add block class attributes to manage LED trigger list block: Add block device LED trigger info to struct genhd block: Add kernel APIs to set & clear per-block device LED triggers block: Add block device attributes to set & clear LED triggers block: Blink device LED when request is sent to low-level driver Documentation/block/index.rst | 1 + Documentation/block/led-triggers.rst | 124 ++++++ block/Kconfig | 10 + block/Makefile | 1 + block/blk-ledtrig.c | 570 +++++++++++++++++++++++++++ block/blk-ledtrig.h | 51 +++ block/blk-mq.c | 2 + block/genhd.c | 14 + include/linux/blk-ledtrig.h | 24 ++ include/linux/genhd.h | 4 + 10 files changed, 801 insertions(+) create mode 100644 Documentation/block/led-triggers.rst create mode 100644 block/blk-ledtrig.c create mode 100644 block/blk-ledtrig.h create mode 100644 include/linux/blk-ledtrig.h -- 2.31.1 _______________________________________________ Kernelnewbies mailing list Kernelnewbies@kernelnewbies.org https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies