Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp2247915pxm; Sun, 27 Feb 2022 15:58:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJw8ltJlLqhNUS925sKXg8sFCYuQ37Zx6f6rup4YWPkzNvYwnZU5zjvEAxIGWn7HmP4WzugG X-Received: by 2002:a17:906:3144:b0:6ce:de5d:5e3b with SMTP id e4-20020a170906314400b006cede5d5e3bmr13291081eje.689.1646006331678; Sun, 27 Feb 2022 15:58:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646006331; cv=none; d=google.com; s=arc-20160816; b=PyCxz4LCIrKc5lMLukfqKKBoah1SMsGWw8tKK81fd6rNi001TpYFtJxyqzqJx+3qfY q/6ZlQ1Smbtr4vjwlcwQDles7D0m37MD1ubEtglFdi5zAiF+Sz02+T5drvqZ1U8jS/3G /kjTd8EgoqX0krCV8mnuWiv0b6bW1xMJGwf45P3Xxf/i2igSoZLtWPW7VHNgp2IlVaH4 H99K7DRW9lpK5qanA6owOwk9rJwcD3HqvjPSD7c/Hm0AHduJ4tpXSSgLGENNJw929sPJ S4qTzhDa9D4SG2KAacdJaliOMjmBVpqxAEbemDIpFXo0WBqbaM09lCuIR31AwSyRL3oE TIgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature:dkim-signature; bh=CuV6bZm6+Tvp4Pdji59uVuBLNwa5+Q5hK3f1bpYPxOg=; b=YT8doIVeSboBerlVBRztevEV+oCp/4PLdojWF0II7SIEFG9WCJtcnpvumAObpkijB/ 43d/PH+bgX51NPYY1I8egxAI/FR3p0pDGrJipsZgHZKZjmzsvy3ZLyZ1s5ZNKHo+shJF o2ZKm7RQMusBrgbCjqTkCAUrRESKmJKuNNG6EGJ27HhThe1Ykvg4dBZcvOMNEZNdgRtL G/HOnY1Tb5A18TLPv+ypiT43EoO26Uxz4wjVZIYfkSTasZxMLPt4ZGVIgxCxlgXVntOd GrHcJQWYEBZzJ7oBp3ZeC7oFiq7bCKcJn9RhKCO3FhPaca5iNiJrr+So4QbB6udU/wrf m3LA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=fBJrOfJ3; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=k7itSJ4L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h21-20020a170906399500b006b798d40881si5372551eje.472.2022.02.27.15.58.27; Sun, 27 Feb 2022 15:58:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=fBJrOfJ3; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=k7itSJ4L; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231294AbiB0Xns (ORCPT + 99 others); Sun, 27 Feb 2022 18:43:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48050 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229486AbiB0Xnq (ORCPT ); Sun, 27 Feb 2022 18:43:46 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4C5EE43EC2 for ; Sun, 27 Feb 2022 15:43:07 -0800 (PST) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 4B1B3212BB; Sun, 27 Feb 2022 23:43:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1646005386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CuV6bZm6+Tvp4Pdji59uVuBLNwa5+Q5hK3f1bpYPxOg=; b=fBJrOfJ3EE9mBbUoIvXDE4Tk+DSSVjbjcPZ+uzH41Dcqcdlbmt0DOa9YnIt3v+Q6d9jtIE UrBlgginZP6QBNKmeYLVR469Y9xO63Er3vb49RgLfJaS/T6geiDS9Ro8E0343LX+jElrn6 NT7kQTQeTdehi1q7RnisKmSg6AB2TKI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1646005386; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=CuV6bZm6+Tvp4Pdji59uVuBLNwa5+Q5hK3f1bpYPxOg=; b=k7itSJ4L86rBKq33/Q+EPVa4Rrg8O83+X9uEuc0pdG2LBFe/xJhiSq9CDi2s3yM/o3lyWo /KfD0PAGky7hMiBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id BFC4912FC5; Sun, 27 Feb 2022 23:43:05 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id Ze4gIIkMHGLrKQAAMHmgww (envelope-from ); Sun, 27 Feb 2022 23:43:05 +0000 From: Enzo Matsumiya To: linux-nvme@lists.infradead.org Cc: Enzo Matsumiya , Keith Busch , Jens Axboe , Christoph Hellwig , Sagi Grimberg , linux-kernel@vger.kernel.org Subject: [PATCH] nvme-pci: trigger disk activity LED Date: Sun, 27 Feb 2022 20:42:58 -0300 Message-Id: <20220227234258.24619-1-ematsumiya@suse.de> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Users can enable an LED to indicate I/O activity on NVMe PCIe devices: # echo "disk-activity" > /sys/class/leds//trigger for the composite activity, or disk-{read,write} for individual activities/LEDs. Signed-off-by: Enzo Matsumiya --- drivers/nvme/host/pci.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 6a99ed680915..3e49d5980beb 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -1037,6 +1038,8 @@ static __always_inline void nvme_pci_unmap_rq(struct request *req) rq_integrity_vec(req)->bv_len, rq_data_dir(req)); if (blk_rq_nr_phys_segments(req)) nvme_unmap_data(dev, req); + + ledtrig_disk_activity(req_op(req) == REQ_OP_WRITE); } static void nvme_pci_complete_rq(struct request *req) -- 2.34.1