Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp1057288pxb; Thu, 9 Sep 2021 19:19:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrDYi/mHnAqjsZmSa3td38WiTrzyZqpi7XeTyjHoyeTEW3k3bmLpsJ6zB5cqhZrJF76Jrq X-Received: by 2002:a17:907:6192:: with SMTP id mt18mr6604417ejc.378.1631240358729; Thu, 09 Sep 2021 19:19:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631240358; cv=none; d=google.com; s=arc-20160816; b=yCcQAluN5Z0IWvMrNAcVJPDNt6pKPDBiC4z1zWMi4dKztst99iGJ6yhWMn25poAGO2 Eykyc1+1IPVvio+2MJ4B+mO0WsmMuiaQsq6PoyZSzR8lf3JzqAWsA0ZM0x3o3lmhwz+Z slxFcT9pQUte9PXzKnM4QkTzZI2ptSAYtZt//ZAW7IGC9TbXVwKobTSi5RPXit77G3p6 UGW2X3B1uCwSjpmfbwySZZqzoFGkX2G3jmn0CCG4BLF6B/PCmrQfaD9chg5VbVh55a1m so/0Hxf4cyI4AuNtg83QDh9Bo9zBr4axxVfSP4IqtjfjnB3an7rYKARwbU75LxKfTRh9 Vu9w== 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 :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=tL4TLvB8cAftuvNZWaLKYk0TDB1/waFVK+AtiQm1IHI=; b=KTzbyPmz3yuzd7w/OVF+66pBeiLUkaF1lyRgpyBJRmATQFNSk0sUiv2uo5YbYkWKeC aPzXtK7Pa88j/tQxDGJHs4KC0m7LQdJClMRCDctWxXcCeWbdoVGL7JuN4i7SoWI6gESs jVtpeMSTQ1+4KZzLoD05hoqsPx7KcGCnbqUgzEHPTYPfOPNjEEZHKVT+Dz1lsVWAeTO9 6r7jIobgxMJeIVv7yQgkGSQAMkeo7sUhI3V1fZHsj3BS8gABftqzfdSL7vTsb7wLY8yR TNUFDaB+vjjRDNheT/nNpNb4Vxw0I7jE43LyyVCpxaPuuCQNhHxejta8odNsf2ndp2NE D94w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=GBh6KPY8; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p16si4091821eju.155.2021.09.09.19.18.55; Thu, 09 Sep 2021 19:19:18 -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=@kernel.org header.s=k20201202 header.b=GBh6KPY8; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229702AbhIJCS2 (ORCPT + 99 others); Thu, 9 Sep 2021 22:18:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:33054 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229628AbhIJCS1 (ORCPT ); Thu, 9 Sep 2021 22:18:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id DDD0860F94; Fri, 10 Sep 2021 02:17:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1631240237; bh=c3RRvTlhhK0ZHI/AL1jQEm27c30eexogLcOnN7PKsdQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=GBh6KPY8KGsZnBUrLVJHkfpVmFJ0F4wvxUnXwaYUFlQwgGBnE58WfIAK5LKN2YDsi fGQaSHOQ1JQ1h7p1adt94UKUhxZ19qspyTFSvPONf4tcXdU2/i9eA6p4eAZ388URaC llA+6EFoLWaZBJTDthsn1k8aPV26ttdcCr0TsyGl/trS8Aot8N3Gx2ZPvOAby8t5E/ 0a16f9bEhHYnfFWof9HCf1+jIjgHu2/Cs6dqa4kyS3hQVSd7KcMekF9cGfx+t0qJG0 9GIPIXL94/NPSueE5rvI+ld+Fx8HCm4mjh4K3bl9Uy5evyBJSonCmbfi+XMI8nq1x3 u25n6NTZhihAg== Date: Fri, 10 Sep 2021 04:17:13 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Ian Pilcher Cc: axboe@kernel.dk, pavel@ucw.cz, linux-leds@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, gregkh@linuxfoundation.org Subject: Re: [PATCH v2 09/15] leds: trigger: blkdev: Check devices for activity and blink LEDs Message-ID: <20210910041713.4722760a@thinkpad> In-Reply-To: <20210909222513.2184795-10-arequipeno@gmail.com> References: <20210909222513.2184795-1-arequipeno@gmail.com> <20210909222513.2184795-10-arequipeno@gmail.com> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 9 Sep 2021 17:25:07 -0500 Ian Pilcher wrote: > +static void blkdev_update_disk(struct ledtrig_blkdev_disk *const disk, > + const unsigned int generation) > +{ > + const struct block_device *const part0 = disk->gd->part0; > + const unsigned long read_ios = part_stat_read(part0, ios[STAT_READ]); > + const unsigned long write_ios = part_stat_read(part0, ios[STAT_WRITE]) > + + part_stat_read(part0, ios[STAT_DISCARD]) > + + part_stat_read(part0, ios[STAT_FLUSH]); So your code allows me to use a partition block device (like sda2) to register with the blkdev LED trigger, but when I do this, the code will disregard that I just want the LED to blink on activity on that one partition. Instead you will blink for whole sda, since you are looking at stats of only part0. Am I right? If so, this in unacceptable. The whole point of blkdev trigger is that you can reliably use it for any block device, and then it will blink the LED for that device, be it partition or whole disk. Marek