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=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham 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 EC96FC49ED6 for ; Wed, 11 Sep 2019 15:36:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C011F2084D for ; Wed, 11 Sep 2019 15:36:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568216167; bh=qxZQXSziXo+H6d/nno1dmQLnRFxQwJr3Dw8uDFe2odo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:List-ID:From; b=phYpKsp52L6damAfoYRXLH7kQm2S8CZJFDQurrlElTp01qVLiWUHb4feAEHskAiT1 e+Tix/gxdJjJRDJO4JxjsKc8eTo5bKDQEKb7SSyjsB1cxYZqbyrNkSVUVmRW0Gx8IF ipCxkBGNNpKUoUU1eqgr/8+/c7snjvHb+uVBIheM= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728244AbfIKPgH (ORCPT ); Wed, 11 Sep 2019 11:36:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:40192 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727839AbfIKPgH (ORCPT ); Wed, 11 Sep 2019 11:36:07 -0400 Received: from localhost (unknown [62.28.240.114]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 46CF9206A1; Wed, 11 Sep 2019 15:36:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1568216166; bh=qxZQXSziXo+H6d/nno1dmQLnRFxQwJr3Dw8uDFe2odo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=rhyFuL/9goMGIHfRJC27hH2SlluHVfsAP5kFre9S7h8dVxwZ1nHouElayo3hE/g2O 4OaX8r6nHmzqwEv4d+DZ9v+GCUiGsX6vkvSIljm/UZfOgtRWaDGFQOs8f345UT4qMe X7p16CYetPBInxHrgDYfiPFVQfaAts5ILEu6tX2Q= Date: Wed, 11 Sep 2019 16:36:02 +0100 From: Greg Kroah-Hartman To: Akinobu Mita Cc: linux-leds@vger.kernel.org, LKML , "Rafael J. Wysocki" , Jacek Anaszewski , Pavel Machek , Dan Murphy Subject: Re: [PATCH 1/5] leds: remove PAGE_SIZE limit of /sys/class/leds//trigger Message-ID: <20190911153602.GB13865@kroah.com> References: <1567946472-10075-1-git-send-email-akinobu.mita@gmail.com> <1567946472-10075-2-git-send-email-akinobu.mita@gmail.com> <20190908131034.GD9466@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-leds-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org On Thu, Sep 12, 2019 at 12:25:28AM +0900, Akinobu Mita wrote: > 2019年9月8日(日) 22:10 Greg Kroah-Hartman : > > > > On Sun, Sep 08, 2019 at 09:41:08PM +0900, Akinobu Mita wrote: > > > Reading /sys/class/leds//trigger returns all available LED triggers. > > > However, the size of this file is limited to PAGE_SIZE because of the > > > limitation for sysfs attribute. > > > > > > Enabling LED CPU trigger on systems with thousands of CPUs easily hits > > > PAGE_SIZE limit, and makes it impossible to see all available LED triggers > > > and which trigger is currently activated. > > > > > > This converts /sys/class/leds//trigger to bin attribute and removes > > > the PAGE_SIZE limitation. > > > > > > Cc: Greg Kroah-Hartman > > > Cc: "Rafael J. Wysocki" > > > Cc: Jacek Anaszewski > > > Cc: Pavel Machek > > > Cc: Dan Murphy > > > Acked-by: Pavel Machek > > > Signed-off-by: Akinobu Mita > > > --- > > > drivers/leds/led-class.c | 8 ++-- > > > drivers/leds/led-triggers.c | 90 ++++++++++++++++++++++++++++++++++----------- > > > drivers/leds/leds.h | 6 +++ > > > include/linux/leds.h | 5 --- > > > 4 files changed, 79 insertions(+), 30 deletions(-) > > > > > > diff --git a/drivers/leds/led-class.c b/drivers/leds/led-class.c > > > index 4793e77..8b5a1d1 100644 > > > --- a/drivers/leds/led-class.c > > > +++ b/drivers/leds/led-class.c > > > @@ -73,13 +73,13 @@ static ssize_t max_brightness_show(struct device *dev, > > > static DEVICE_ATTR_RO(max_brightness); > > > > > > #ifdef CONFIG_LEDS_TRIGGERS > > > -static DEVICE_ATTR(trigger, 0644, led_trigger_show, led_trigger_store); > > > -static struct attribute *led_trigger_attrs[] = { > > > - &dev_attr_trigger.attr, > > > +static BIN_ATTR(trigger, 0644, led_trigger_read, led_trigger_write, 0); > > > > BIN_ATTR_RW()? > > We can use BIN_ATTR_RW() by renaming led_trigger_{read,write}() to > trigger_{read,write}(). But led_trigger_{read,write}() are not static > functions. These are defined as export symbols for led-class module. > > So trigger_{read,write}() will be too generic symbol names, won't they? Yes they would, sorry I didn't notice that. Wait, why are those functions being exported? Who is calling a sysfs function from a different code path than sysfs? thanks, greg k-h