From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 41AC12E7187; Tue, 15 Jul 2025 13:51:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752587482; cv=none; b=HO8oOXb2De4ThH3OEgGamIo6S8pvNbTm2aPpaJG9Be29eHYv4QpSZVMFHiv1E29fg2dGPzC/dd+KL4gUpiTsKWTHikvnoWTh3HwkZXvEf2DLQvlTu2kwecaMpqOPIuTZjMtru2pIyqUX76cUPCPcxPD2xxQDJqnxCideofrBE8w= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752587482; c=relaxed/simple; bh=68sYT2WPYje+pjvbrQeotPe+DSMsLoV24YZOD3gA54s=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=HV240xMta7F3aOzbVT5TSbsjeM5pVcQnr34Ivy1kYbI7qO+bi55o1Pt9VZZaSjt+IX63ZTQ3bsXRrV6A0lElmeZez5VWLEKxEBbGxRaMJ+vTfeaCaq+NIO8mBrtSnR1H674PQLcvxlKnhqis6KphdN/LBOhef5ABb/30A1ywca8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=yqfUDlQq; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="yqfUDlQq" Received: by smtp.kernel.org (Postfix) with ESMTPSA id C683EC4CEE3; Tue, 15 Jul 2025 13:51:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1752587482; bh=68sYT2WPYje+pjvbrQeotPe+DSMsLoV24YZOD3gA54s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=yqfUDlQq1rJceAxIYJP1U6aT1xoZHphC0JfkMUYnNTCcVdxc2Jm3Bcz48mTsZpPUD wT2p0lR87Axv3ZtWnivxXGilvoKB5tZwQ73e34U41W2ChOUszA0yl+kes8GpIaf1L/ fnc35Ob9opzOM6ubkRymtHZbHsYPFJZ0jCxP2xhQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Jacek Anaszewski , Pavel Machek , Tobias Deiminger , Sven Schuchmann , Sven Schwermer , Lee Jones , Sasha Levin Subject: [PATCH 5.10 005/208] leds: multicolor: Fix intensity setting while SW blinking Date: Tue, 15 Jul 2025 15:11:54 +0200 Message-ID: <20250715130811.051928496@linuxfoundation.org> X-Mailer: git-send-email 2.50.1 In-Reply-To: <20250715130810.830580412@linuxfoundation.org> References: <20250715130810.830580412@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 5.10-stable review patch. If anyone has any objections, please let me know. ------------------ From: Sven Schwermer [ Upstream commit e35ca991a777ef513040cbb36bc8245a031a2633 ] When writing to the multi_intensity file, don't unconditionally call led_set_brightness. By only doing this if blinking is inactive we prevent blinking from stopping if the blinking is in its off phase while the file is written. Instead, if blinking is active, the changed intensity values are applied upon the next blink. This is consistent with changing the brightness on monochrome LEDs with active blinking. Suggested-by: Jacek Anaszewski Acked-by: Jacek Anaszewski Acked-by: Pavel Machek Reviewed-by: Tobias Deiminger Tested-by: Sven Schuchmann Signed-off-by: Sven Schwermer Link: https://lore.kernel.org/r/20250404184043.227116-1-sven@svenschwermer.de Signed-off-by: Lee Jones Signed-off-by: Sasha Levin --- drivers/leds/led-class-multicolor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/leds/led-class-multicolor.c b/drivers/leds/led-class-multicolor.c index e317408583df9..5b1479b5d32ca 100644 --- a/drivers/leds/led-class-multicolor.c +++ b/drivers/leds/led-class-multicolor.c @@ -59,7 +59,8 @@ static ssize_t multi_intensity_store(struct device *dev, for (i = 0; i < mcled_cdev->num_colors; i++) mcled_cdev->subled_info[i].intensity = intensity_value[i]; - led_set_brightness(led_cdev, led_cdev->brightness); + if (!test_bit(LED_BLINK_SW, &led_cdev->work_flags)) + led_set_brightness(led_cdev, led_cdev->brightness); ret = size; err_out: mutex_unlock(&led_cdev->led_access); -- 2.39.5