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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 550ADC77B7A for ; Mon, 17 Apr 2023 18:33:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230232AbjDQSd5 (ORCPT ); Mon, 17 Apr 2023 14:33:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46136 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230298AbjDQSdy (ORCPT ); Mon, 17 Apr 2023 14:33:54 -0400 Received: from mail-lj1-x234.google.com (mail-lj1-x234.google.com [IPv6:2a00:1450:4864:20::234]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C2AD346A8 for ; Mon, 17 Apr 2023 11:33:35 -0700 (PDT) Received: by mail-lj1-x234.google.com with SMTP id 38308e7fff4ca-2a7b08e84d4so15486901fa.3 for ; Mon, 17 Apr 2023 11:33:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1681756414; x=1684348414; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=GloJ2SbV+VoPUOdGLkpUto0XVRhM3PdLse2vIr6qFYo=; b=Zh/Cx1qB8coVBnt43xqwLzMBrse8J9W4qQNgqLz2qcWWS5XHKKM5iCRbA6IzLk9exn 5nlzFwQa7ZIAGauK5sURrdPwnOXllMCjIECF5WhflSITddVewm04bG1Ehd2FwyZ1hbml f6TwFYByCZl2ZGTxQtaHnV6ItqJSblx7ea5fsZwNLJ8XA+TL1/KoYwAVcZihWkkV9hwo mZu5DkneisGJ2FeSdkZxmj0J/2qZR2V5AEuT3AoAOtW90wgkl5hDrYz4XNGkl2PzvxLK RbvR/dZQ91007jBHRE7lB6cu/Q2ytdTYqr2U/LRIawa6okfmNIsNHrhEZPcdIJu0bQwH eTEA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1681756414; x=1684348414; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=GloJ2SbV+VoPUOdGLkpUto0XVRhM3PdLse2vIr6qFYo=; b=EtQCacs7cRJ+pgHgxsxXoopMxYVyJCATo4x038mda2FLLEMLGfhNJPprgmb2Q3AiYN n04kmIC3+2605V95uStzyo7w/Qn/uaNTCIwcD8N3cIjrJFoAAYefQQy5dOzpXxG06AIk oRLlY2P0kmq0m9hYz/oRS6p6yLV8tx3sUck8GCJpWcbzrDYPozU7Ibc7Pwyc/HAy/flv B3o3teeCQxF+2QqRQr47h0+GLQxDlyNAzuOyhAg4HmsbwfaWYVBnuFTC8CSNN4mOCv8W p3QfxtuXonsh0CJE4lWKJdMpTStYJu7AWPgUrrE8qk+O5F3pQGV06pzsIBmDLHTH47js I5DA== X-Gm-Message-State: AAQBX9dq7FkEZhQNn1Fu3nZwEBEA1A5Lj9SkGQ/ZfIRmHoyaTrCRQUS+ gmyd4vdEntWgmckZfIVLXFpDOdJjH1c= X-Google-Smtp-Source: AKy350Y6l0U7D7yRSP0l6Dri5kPmDWqYGruhjJwJ0FTj6ILOKWOMmy7NtI/uIdEcBCmMnlqc0Vwq4g== X-Received: by 2002:a19:ad02:0:b0:4db:3a92:2c85 with SMTP id t2-20020a19ad02000000b004db3a922c85mr1504676lfc.67.1681756413636; Mon, 17 Apr 2023 11:33:33 -0700 (PDT) Received: from [192.168.0.131] ([194.183.54.57]) by smtp.gmail.com with ESMTPSA id v2-20020ac25922000000b004d85895d7e0sm2100331lfi.147.2023.04.17.11.33.32 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 17 Apr 2023 11:33:32 -0700 (PDT) Message-ID: <90efe25c-fea5-cdd0-8bd3-16b9e53e8b56@gmail.com> Date: Mon, 17 Apr 2023 20:33:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.9.0 Subject: Re: [PATCH] leds: trigger/tty: Use led_set_brightness_nosleep() to set brightness Content-Language: en-US To: =?UTF-8?Q?Uwe_Kleine-K=c3=b6nig?= , Pavel Machek Cc: Lee Jones , linux-leds@vger.kernel.org, Florian Eckert References: <20230414164853.3668229-1-u.kleine-koenig@pengutronix.de> <20230417124403.j64c2lftgyqo2a67@pengutronix.de> From: Jacek Anaszewski In-Reply-To: <20230417124403.j64c2lftgyqo2a67@pengutronix.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-leds@vger.kernel.org Hi Uwe, On 4/17/23 14:44, Uwe Kleine-König wrote: > Hello, > > On Mon, Apr 17, 2023 at 02:28:52PM +0200, Pavel Machek wrote: >>> After commit ba8a86e4dadb ("leds: trigger/tty: Use >>> led_set_brightness_sync() from workqueue") this is the second try to >>> pick the right function to set the LED brightness from a trigger. >>> >>> led_set_brightness_sync() has the problem that it doesn't work for LEDs >>> without a .brightness_set_blocking() callback. This is (among others) >>> the case for LEDs connected to non-sleeping GPIOs. >>> >>> Signed-off-by: Uwe Kleine-König >> >> I don't think this is right. >> >> _nosleep calls _nopm, which assmues it can't sleep, and schedules >> another workqueue to set the LED. > > Then which is the right variant? > led_set_brightness() and led_set_brightness_nosleep() set via a workqueue > (which is bad) and led_set_brightness_sync() doesn't work for some LEDs > (notably LEDs on non-sleeping GPIOs). Can you remind me the context of this patch, why using workqueue is bad here? -- Best regards, Jacek Anaszewski