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 D16562ED857; Thu, 3 Jul 2025 15:19:18 +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=1751555958; cv=none; b=J1z/NkpIq5ba9yD91YrDnkNiMKIgzN83n2do0MCdMFfPQy8RtGV0MRem27CFdZ7cMUU9sjYk+2MnQSbRgnlcT95f/HP+18VHOw7nYHpAhRtTwNeq5/MjtzmuE/1aaBaQw5VXPeV3MCzgODvARRBivmUrNLjDCwIszSh9RoLFFxM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1751555958; c=relaxed/simple; bh=+9kl+foAqgh4fbcODcXfXS62tTOj2DUfen0Nz46EeGg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=i+Hot6CHLdtzWT2h7vYIPQnDXUfGueUkedrnUbjEecLiGsl43N6m/1z+TN5Uh+0zmS//Kc1FVtH/Oc39hA/Yol6Ms/O8+Rx2FtSSkjScg5S2eLbY+A9tu/YVjmYlaA4HwNyBts2l3uEmpwo57fz2KVD9DsU6PO2KiiqUguJopBI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=1GRvlyDc; 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="1GRvlyDc" Received: by smtp.kernel.org (Postfix) with ESMTPSA id EE8F8C4CEED; Thu, 3 Jul 2025 15:19:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1751555958; bh=+9kl+foAqgh4fbcODcXfXS62tTOj2DUfen0Nz46EeGg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1GRvlyDcAHJu4HlUD6Rwrtf2darOyNvu1uMaWgZhiGXxoepkp7ty3UqApMFoGcVBz EbYji9SVoxdTfBBxjK3NdqOqZVnY8idqHkxXUfp3eLk4u1ACkaIDtEmoqh0yNKwS6s Tax9gdS9mqrGbx8mMDu0s+YS/XbFX3ZXNqHBfzf8= 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 6.1 007/132] leds: multicolor: Fix intensity setting while SW blinking Date: Thu, 3 Jul 2025 16:41:36 +0200 Message-ID: <20250703143939.681590816@linuxfoundation.org> X-Mailer: git-send-email 2.50.0 In-Reply-To: <20250703143939.370927276@linuxfoundation.org> References: <20250703143939.370927276@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-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 ec62a48116135..e0785935f4ba6 100644 --- a/drivers/leds/led-class-multicolor.c +++ b/drivers/leds/led-class-multicolor.c @@ -61,7 +61,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