summaryrefslogtreecommitdiff
path: root/drivers/leds
AgeCommit message (Collapse)AuthorFilesLines
2024-08-03leds: mt6360: Fix memory leak in mt6360_init_isnk_properties()Javier Carrasco1-1/+4
commit e41d574b359ccd8d99be65c6f11502efa2b83136 upstream. The fwnode_for_each_child_node() loop requires manual intervention to decrement the child refcount in case of an early return. Add the missing calls to fwnode_handle_put(child) to avoid memory leaks in the error paths. Cc: stable@vger.kernel.org Fixes: 679f8652064b ("leds: Add mt6360 driver") Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com> Acked-by: Pavel Machek <pavel@ucw.cz> Link: https://lore.kernel.org/r/20240611-leds-mt6360-memleak-v1-1-93642eb5011e@gmail.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-03leds: triggers: Flush pending brightness before activating triggerThomas Weißschuh2-5/+6
commit ab477b766edd3bfb6321a6e3df4c790612613fae upstream. The race fixed in timer_trig_activate() between a blocking set_brightness() call and trigger->activate() can affect any trigger. So move the call to flush_work() into led_trigger_set() where it can avoid the race for all triggers. Fixes: 0db37915d912 ("leds: avoid races with workqueue") Fixes: 8c0f693c6eff ("leds: avoid flush_work in atomic context") Cc: stable@vger.kernel.org Tested-by: Dustin L. Howett <dustin@howett.net> Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/r/20240613-led-trigger-flush-v2-1-f4f970799d77@weissschuh.net Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-03leds: ss4200: Convert PCIBIOS_* return codes to errnosIlpo Järvinen1-2/+5
commit ce068e83976140badb19c7f1307926b4b562fac4 upstream. ich7_lpc_probe() uses pci_read_config_dword() that returns PCIBIOS_* codes. The error handling code assumes incorrectly it's a normal errno and checks for < 0. The return code is returned from the probe function as is but probe functions should return normal errnos. Remove < 0 from the check and convert PCIBIOS_* returns code using pcibios_err_to_errno() into normal errno before returning it. Fixes: a328e95b82c1 ("leds: LED driver for Intel NAS SS4200 series (v5)") Cc: <stable@vger.kernel.org> Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com> Link: https://lore.kernel.org/r/20240527132700.14260-1-ilpo.jarvinen@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-03leds: flash: leds-qcom-flash: Test the correct variable in initDan Carpenter1-3/+7
[ Upstream commit 87e552ad654554be73e62dd43c923bcee215287d ] This code was passing the incorrect pointer to PTR_ERR_OR_ZERO() so it always returned success. It should have been checking the array element instead of the array itself. Fixes: 96a2e242a5dc ("leds: flash: Add driver to support flash LED module in QCOM PMICs") Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Link: https://lore.kernel.org/r/ZoWJS_epjIMCYITg@stanley.mountain Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-03Revert "leds: led-core: Fix refcount leak in of_led_get()"Luca Ceresoli1-1/+0
[ Upstream commit 940b27161afc6ec53fc66245a4fb3518394cdc92 ] This reverts commit da1afe8e6099980fe1e2fd7436dca284af9d3f29. Commit 699a8c7c4bd3 ("leds: Add of_led_get() and led_put()"), introduced in 5.5, added of_led_get() and led_put() but missed a put_device() in led_put(), thus creating a leak in case the consumer device is removed. Arguably device removal was not very popular, so this went apparently unnoticed until 2022. In January 2023 two different patches got merged to fix the same bug: - commit da1afe8e6099 ("leds: led-core: Fix refcount leak in of_led_get()") - commit 445110941eb9 ("leds: led-class: Add missing put_device() to led_put()") They fix the bug in two different ways, which creates no patch conflicts, and both were merged in v6.2. The result is that now there is one more put_device() than get_device()s, instead of one less. Arguably device removal is not very popular yet, so this apparently hasn't been noticed as well up to now. But it blew up here while I'm working with device tree overlay insertion and removal. The symptom is an apparently unrelated list of oopses on device removal, with reasons: kernfs: can not remove 'uevent', no directory kernfs: can not remove 'brightness', no directory kernfs: can not remove 'max_brightness', no directory ... Here sysfs fails removing attribute files, which is because the device name changed and so the sysfs path. This is because the device name string got corrupted, which is because it got freed too early and its memory reused. Different symptoms could appear in different use cases. Fix by removing one of the two fixes. The choice was to remove commit da1afe8e6099 because: * it is calling put_device() inside of_led_get() just after getting the device, thus it is basically not refcounting the LED device at all during its entire lifetime * it does not add a corresponding put_device() in led_get(), so it fixes only the OF case The other fix (445110941eb9) is adding the put_device() in led_put() so it covers the entire lifetime, and it works even in the non-DT case. Fixes: da1afe8e6099 ("leds: led-core: Fix refcount leak in of_led_get()") Co-developed-by: Hervé Codina <herve.codina@bootlin.com> Signed-off-by: Hervé Codina <herve.codina@bootlin.com> Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com> Link: https://lore.kernel.org/r/20240625-led-class-device-leak-v2-1-75fdccf47421@bootlin.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-03leds: rgb: leds-qcom-lpg: Add PPG check for setting/clearing PBS triggersAnjelique Melendez1-1/+7
[ Upstream commit 7e776e21255bf4c271e0df0a7d289a4963580e61 ] Currently, all LED LPG devices will call lpg_{set,clear}_pbs_trigger() when setting brightness regardless of if they support PPG and have PBS triggers. Check if device supports PPG before setting/clearing PBS triggers. Fixes: 6ab1f766a80a ("leds: rgb: leds-qcom-lpg: Add support for PPG through single SDAM") Fixes: 5e9ff626861a ("leds: rgb: leds-qcom-lpg: Include support for PPG with dedicated LUT SDAM") Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com> Reviewed-by: Bjorn Andersson <andersson@kernel.org> Link: https://lore.kernel.org/r/20240607005250.4047135-1-quic_amelende@quicinc.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-08-03leds: trigger: Unregister sysfs attributes before calling deactivate()Hans de Goede1-1/+1
[ Upstream commit c0dc9adf9474ecb7106e60e5472577375aedaed3 ] Triggers which have trigger specific sysfs attributes typically store related data in trigger-data allocated by the activate() callback and freed by the deactivate() callback. Calling device_remove_groups() after calling deactivate() leaves a window where the sysfs attributes show/store functions could be called after deactivation and then operate on the just freed trigger-data. Move the device_remove_groups() call to before deactivate() to close this race window. This also makes the deactivation path properly do things in reverse order of the activation path which calls the activate() callback before calling device_add_groups(). Fixes: a7e7a3156300 ("leds: triggers: add device attribute support") Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Hans de Goede <hdegoede@redhat.com> Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20240504162533.76780-1-hdegoede@redhat.com Signed-off-by: Lee Jones <lee@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-06-16leds: class: Revert: "If no default trigger is given, make hw_control ↵Hans de Goede1-6/+0
trigger the default trigger" Commit 66601a29bb23 ("leds: class: If no default trigger is given, make hw_control trigger the default trigger") causes ledtrig-netdev to get set as default trigger on various network LEDs. This causes users to hit a pre-existing AB-BA deadlock issue in ledtrig-netdev between the LED-trigger locks and the rtnl mutex, resulting in hung tasks in kernels >= 6.9. Solving the deadlock is non trivial, so for now revert the change to set the hw_control trigger as default trigger, so that ledtrig-netdev no longer gets activated automatically for various network LEDs. The netdev trigger is not needed because the network LEDs are usually under hw-control and the netdev trigger tries to leave things that way so setting it as the active trigger for the LED class device is a no-op. Fixes: 66601a29bb23 ("leds: class: If no default trigger is given, make hw_control trigger the default trigger") Reported-by: Genes Lists <lists@sapience.com> Closes: https://lore.kernel.org/all/9d189ec329cfe68ed68699f314e191a10d4b5eda.camel@sapience.com/ Reported-by: Johannes Wüller <johanneswueller@gmail.com> Closes: https://lore.kernel.org/lkml/e441605c-eaf2-4c2d-872b-d8e541f4cf60@gmail.com/ Cc: stable@vger.kernel.org Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Acked-by: Lee Jones <lee@kernel.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2024-05-02leds: mt6370: Remove unused field 'reg_cfgs' from 'struct mt6370_priv'Christophe JAILLET1-1/+0
In 'struct mt6370_priv', the 'reg_cfgs' field is unused. Moreover 'struct reg_cfg' isn't defined anywhere, so remove it. Found with cppcheck, unusedStructMember. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com> Link: https://lore.kernel.org/r/e389be5e1012dc05fc2641123883ca3b0747525a.1714328839.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-02leds: lp50xx: Remove unused field 'num_of_banked_leds' from 'struct lp50xx'Christophe JAILLET1-4/+0
In 'struct lp50xx', the 'num_of_banked_leds' field is only written and is never used. Moreover, storing such an information in the 'priv' structure looks pointless, so remove it. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/a0d472ff587d13a2b91ec32c8776061019caab6a.1714324500.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-02leds: lp50xx: Remove unused field 'bank_modules' from 'struct lp50xx_led'Christophe JAILLET1-1/+0
In 'struct lp50xx_led', the 'bank_modules' field is unused. Remove it. Found with cppcheck, unusedStructMember. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/bc2e5e57b93ca0a33bcc84e9bdc89f26fc8f6d57.1714324500.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-02leds: aat1290: Remove unused field 'torch_brightness' from 'struct aat1290_led'Christophe JAILLET1-2/+0
In 'struct aat1290_led', the 'torch_brightness' field is unused. Remove it. Found with cppcheck, unusedStructMember. Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr> Link: https://lore.kernel.org/r/f7c8c22242544b11e95d9a77d7d0ea17f5a24fd5.1714318454.git.christophe.jaillet@wanadoo.fr Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-02leds: sun50i-a100: Use match_string() helper to simplify the codeAndy Shevchenko1-8/+6
match_string() returns the array index of a matching string. Use it instead of the open-coded implementation. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com> Link: https://lore.kernel.org/r/20240426152515.872917-1-andriy.shevchenko@linux.intel.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-02leds: pwm: Disable PWM when going to suspendUwe Kleine-König1-1/+7
On stm32mp1xx based machines (and others) a PWM consumer has to disable the PWM because an enabled PWM refuses to suspend. So check the LED_SUSPENDED flag and depending on that set the .enabled property. Link: https://bugzilla.kernel.org/show_bug.cgi?id=218559 Fixes: 76fe464c8e64 ("leds: pwm: Don't disable the PWM when the LED should be off") Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Link: https://lore.kernel.org/r/20240417153846.271751-2-u.kleine-koenig@pengutronix.de Signed-off-by: Lee Jones <lee@kernel.org>
2024-05-02leds: trigger: pattern: Add support for hrtimerMartin Kurbanov1-23/+103
Currently, led pattern trigger uses timer_list to schedule brightness changing. As we know from timer_list API [1], it's not accurate to milliseconds and depends on HZ granularity. Example: "0 10 0 0 50 10 50 0 100 10 100 0 150 10 150 0 200 10 200 0 250 10 250 0", we expect it to be 60ms long, but it can actually be up to ~120ms (add ~10ms for each pattern when HZ == 100). But sometimes, userspace needs time accurate led patterns to make sure that pattern will be executed during expected time slot. To achieve this goal the patch introduces optional hrtimer usage for led trigger pattern, because hrtimer is microseconds accurate timer. [1]: kernel/time/timer.c#L104 Signed-off-by: Martin Kurbanov <mmkurbanov@salutedevices.com> Link: https://lore.kernel.org/r/20240416201847.357099-1-mmkurbanov@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-12leds: mt6360: Fix the second LED can not enable torch mode by V4L2ChiaEn Wu1-1/+11
V4L2 will disable strobe mode of the LED device when enable torch mode, but this logic will conflict with the "priv->fled_torch_used" in "mt6360_strobe_set()". So after enabling torch mode of the first LED, the second LED will not be able to enable torch mode correctly. Therefore, at the beginning of "mt6360_strobe_set()", check whether the state of the upcoming change and the current LED device state are the same, so as to avoid the above problem. Signed-off-by: ChiaEn Wu <chiaen_wu@richtek.com> Link: https://lore.kernel.org/r/28FE6F1712799128000.chiaen_wu@richtek.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-12leds: qcom-lpg: Add support for PMI8950 PWMGianluca Boiano1-0/+8
The PMI8950 PMIC contains 1 PWM channel Signed-off-by: Gianluca Boiano <morf3089@gmail.com> Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org> Link: https://lore.kernel.org/r/20240402-pmi8950-pwm-support-v1-1-1a66899eeeb3@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-12leds: apu: Remove duplicate DMI lookup dataArnd Bergmann1-2/+1
Building with W=1 shows a warning about an unused dmi_system_id table: drivers/leds/leds-apu.c:85:35: error: 'apu_led_dmi_table' defined but not used [-Werror=unused-const-variable=] 85 | static const struct dmi_system_id apu_led_dmi_table[] __initconst = { Since the current version doesn't even do anything about the different implementations but only checks the type of system, just drop the custom lookup logic and call dmi_check_system() using the table itself. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://lore.kernel.org/r/20240403080702.3509288-16-arnd@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-12leds: trigger: netdev: Remove not needed call to led_set_brightness in ↵Heiner Kallweit1-2/+0
deactivate led_trigger_set() is the only caller of the deactivate() callback, and it calls led_set_brightness(LED_OFF) anyway after deactivate(). So we can remove the call here. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/8dc929e7-8e14-4c85-aa28-9c5fe2620f52@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-12leds: simatic-ipc-leds-gpio: Add support for module BX-59AXing Tong Wu2-6/+47
This is used for the Siemens Simatic IPC BX-59A, which has its LEDs connected to GPIOs provided by the Nuvoton NCT6126D. Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: Xing Tong Wu <xingtong.wu@siemens.com> Link: https://lore.kernel.org/r/20240314070506.2384-1-xingtong_wu@163.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-12Merge branches 'ib-leds-mips-sound-6.10' and 'ib-leds-locking-6.10' into ↵Lee Jones7-74/+84
ibs-for-leds-merged
2024-04-11leds: an30259a: Use devm_mutex_init() for mutex initializationGeorge Stark1-10/+4
In this driver LEDs are registered using devm_led_classdev_register() so they are automatically unregistered after module's remove() is done. led_classdev_unregister() calls module's led_set_brightness() to turn off the LEDs and that callback uses mutex which was destroyed already in module's remove() so use devm API instead. Signed-off-by: George Stark <gnstark@salutedevices.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240411161032.609544-9-gnstark@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-11leds: mlxreg: Use devm_mutex_init() for mutex initializationGeorge Stark1-9/+5
In this driver LEDs are registered using devm_led_classdev_register() so they are automatically unregistered after module's remove() is done. led_classdev_unregister() calls module's led_set_brightness() to turn off the LEDs and that callback uses mutex which was destroyed already in module's remove() so use devm API instead. Signed-off-by: George Stark <gnstark@salutedevices.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240411161032.609544-8-gnstark@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-11leds: nic78bx: Use devm API to cleanup module's resourcesGeorge Stark1-10/+13
In this driver LEDs are registered using devm_led_classdev_register() so they are automatically unregistered after module's remove() is done. led_classdev_unregister() calls module's led_set_brightness() to turn off the LEDs and that callback uses resources which were destroyed already in module's remove() so use devm API instead of remove(). Signed-off-by: George Stark <gnstark@salutedevices.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240411161032.609544-7-gnstark@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-11leds: lm3532: Use devm API to cleanup module's resourcesGeorge Stark1-12/+17
In this driver LEDs are registered using devm_led_classdev_register() so they are automatically unregistered after module's remove() is done. led_classdev_unregister() calls module's led_set_brightness() to turn off the LEDs and that callback uses resources which were destroyed already in module's remove() so use devm API instead of remove(). Signed-off-by: George Stark <gnstark@salutedevices.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240411161032.609544-6-gnstark@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-11leds: lp3952: Use devm API to cleanup module's resourcesGeorge Stark1-10/+11
In this driver LEDs are registered using devm_led_classdev_register() so they are automatically unregistered after module's remove() is done. led_classdev_unregister() calls module's led_set_brightness() to turn off the LEDs and that callback uses resources which were destroyed already in module's remove() so use devm API instead of remove(). Also drop explicit turning LEDs off from remove() due to they will be off anyway by led_classdev_unregister(). Signed-off-by: George Stark <gnstark@salutedevices.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240411161032.609544-5-gnstark@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-11leds: aw200xx: Use devm API to cleanup module's resourcesGeorge Stark1-11/+21
In this driver LEDs are registered using devm_led_classdev_register() so they are automatically unregistered after module's remove() is done. led_classdev_unregister() calls module's led_set_brightness() to turn off the LEDs and that callback uses resources which were destroyed already in module's remove() so use devm API instead of remove(). Signed-off-by: George Stark <gnstark@salutedevices.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20240411161032.609544-4-gnstark@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-04-11leds: aw2013: Use devm API to cleanup module's resourcesGeorge Stark1-12/+13
In this driver LEDs are registered using devm_led_classdev_register() so they are automatically unregistered after module's remove() is done. led_classdev_unregister() calls module's led_set_brightness() to turn off the LEDs and that callback uses resources which were destroyed already in module's remove() so use devm API instead of remove(). Signed-off-by: George Stark <gnstark@salutedevices.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Tested-by: Nikita Travkin <nikita@trvn.ru> Link: https://lore.kernel.org/r/20240411161032.609544-3-gnstark@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-28leds: trigger: audio: Remove this triggerHeiner Kallweit1-67/+0
Now that the audio trigger is fully integrated in sound/core/control_led.c, we can remove it here. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/1e339779-6d04-4392-8ea2-5592c0fd1aa2@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-28ALSA: control-led: Integrate mute led triggerHeiner Kallweit2-8/+0
This driver is the only one calling ledtrig_audio_set(), therefore the LED audio trigger isn't usable standalone. So it makes sense to fully integrate LED audio triger handling here. The module aliases ensure that the driver is auto-loaded (if built as module) if a LED device has one of the two audio triggers as default trigger. In addition disable building the old audio mute LED trigger. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/107634e6-d9ad-4a9f-881d-1eb72ea1a5a7@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-28leds: trigger: Store brightness set by led_trigger_event()Heiner Kallweit1-2/+4
If a simple trigger is assigned to a LED, then the LED may be off until the next led_trigger_event() call. This may be an issue for simple triggers with rare led_trigger_event() calls, e.g. power supply charging indicators (drivers/power/supply/power_supply_leds.c). Therefore persist the brightness value of the last led_trigger_event() call and use this value if the trigger is assigned to a LED. In addition add a getter for the trigger brightness value. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Link: https://lore.kernel.org/r/b1358b25-3f30-458d-8240-5705ae007a8a@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-15Merge tag 'mm-nonmm-stable-2024-03-14-09-36' of ↵Linus Torvalds1-1/+1
git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Pull non-MM updates from Andrew Morton: - Kuan-Wei Chiu has developed the well-named series "lib min_heap: Min heap optimizations". - Kuan-Wei Chiu has also sped up the library sorting code in the series "lib/sort: Optimize the number of swaps and comparisons". - Alexey Gladkov has added the ability for code running within an IPC namespace to alter its IPC and MQ limits. The series is "Allow to change ipc/mq sysctls inside ipc namespace". - Geert Uytterhoeven has contributed some dhrystone maintenance work in the series "lib: dhry: miscellaneous cleanups". - Ryusuke Konishi continues nilfs2 maintenance work in the series "nilfs2: eliminate kmap and kmap_atomic calls" "nilfs2: fix kernel bug at submit_bh_wbc()" - Nathan Chancellor has updated our build tools requirements in the series "Bump the minimum supported version of LLVM to 13.0.1". - Muhammad Usama Anjum continues with the selftests maintenance work in the series "selftests/mm: Improve run_vmtests.sh". - Oleg Nesterov has done some maintenance work against the signal code in the series "get_signal: minor cleanups and fix". Plus the usual shower of singleton patches in various parts of the tree. Please see the individual changelogs for details. * tag 'mm-nonmm-stable-2024-03-14-09-36' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm: (77 commits) nilfs2: prevent kernel bug at submit_bh_wbc() nilfs2: fix failure to detect DAT corruption in btree and direct mappings ocfs2: enable ocfs2_listxattr for special files ocfs2: remove SLAB_MEM_SPREAD flag usage assoc_array: fix the return value in assoc_array_insert_mid_shortcut() buildid: use kmap_local_page() watchdog/core: remove sysctl handlers from public header nilfs2: use div64_ul() instead of do_div() mul_u64_u64_div_u64: increase precision by conditionally swapping a and b kexec: copy only happens before uchunk goes to zero get_signal: don't initialize ksig->info if SIGNAL_GROUP_EXIT/group_exec_task get_signal: hide_si_addr_tag_bits: fix the usage of uninitialized ksig get_signal: don't abuse ksig->info.si_signo and ksig->sig const_structs.checkpatch: add device_type Normalise "name (ad@dr)" MODULE_AUTHORs to "name <ad@dr>" dyndbg: replace kstrdup() + strchr() with kstrdup_and_replace() list: leverage list_is_head() for list_entry_is_head() nilfs2: MAINTAINERS: drop unreachable project mirror site smp: make __smp_processor_id() 0-argument macro fat: fix uninitialized field in nostale filehandles ...
2024-03-14Merge tag 'leds-next-6.9' of ↵Linus Torvalds22-85/+811
git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds Pull LED updates from Lee Jones: "Core Framework: - Introduce ExpressWire library New Drivers: - Add support for ON Semiconductor NCP5623 RGB LED Driver New Device Support: - Add support for PM660L to Qualcomm's LPG driver New Functionality: - Dynamically load modules required for the default-trigger - Add some support for suspend and resume - Allow LEDs to remain lit during suspend Fix-ups: - Device Tree binding adaptions/conversions/creation - Fix include lists; alphabetise, remove unused, explicitly add used - Add new led_match_default_trigger to avoid duplication - Add module alias' to aid auto-loading - Default to hw_control if no others are specified - De-bloat the supported link speed attribute lists - Remove superfluous code and simplify overall - Constify some variables Bug Fixes: - Prevent kernel panic when renaming the net interface - Fix Kconfig related build errors - Ensure mutexes are unlocked prior to destroying them - Provide clean-up between state changes to avoid invalid state - Fix some broken kernel-doc headers" * tag 'leds-next-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/leds: (41 commits) leds: ncp5623: Add MS suffix to time defines leds: Add NCP5623 multi-led driver dt-bindings: leds: Add NCP5623 multi-LED Controller leds: mlxreg: Drop an excess struct mlxreg_led_data member leds: leds-mlxcpld: Fix struct mlxcpld_led_priv member name leds: lm3601x: Fix struct lm3601_led kernel-doc warnings leds: Fix ifdef check for gpio_led_register_device() dt-bindings: leds: qcom-lpg: Narrow nvmem for other variants dt-bindings: leds: qcom-lpg: Drop redundant qcom,pm8550-pwm in if:then: dt-bindings: leds: Add LED_FUNCTION_WAN_ONLINE for Internet access leds: sgm3140: Add missing timer cleanup and flash gpio control leds: expresswire: Don't depend on NEW_LEDS Revert "leds: Only descend into leds directory when CONFIG_NEW_LEDS is set" leds: aw2013: Unlock mutex before destroying it leds: qcom-lpg: Add QCOM_PBS dependency leds: rgb: leds-group-multicolor: Allow LEDs to stay on in suspend leds: trigger: netdev: Fix kernel panic on interface rename trig notify leds: qcom-lpg: Add PM660L configuration and compatible leds: spi-byte: Use devm_led_classdev_register_ext() leds: pca963x: Add support for suspend and resume ...
2024-03-14Merge tag 'backlight-next-6.9' of ↵Linus Torvalds5-90/+108
git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight Pull backlight updates from Lee Jones: "New Drivers: - Add support for Kinetic KTD2801 Backlight Fix-ups: - Fix include lists; alphabetise, remove unused, explicitly add used - Device Tree binding adaptions/conversions/creation - Use dev_err_probe() to clean-up error paths - Use/convert to new/better APIs/helpers/MACROs instead of hand-rolling implementations Bug Fixes: - Fix changes of NULL pointer dereference - Remedy a bunch of logic errors - Initialise (zero) Backlight properties data structures" * tag 'backlight-next-6.9' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/backlight: (32 commits) backlight: pandora_bl: Drop unneeded ENOMEM error message backlight: lm3630a_bl: Simplify probe return on gpio request error backlight: lm3630a_bl: Handle deferred probe backlight: as3711_bl: Handle deferred probe backlight: bd6107: Handle deferred probe backlight: l4f00242t03: Simplify with dev_err_probe() backlight: gpio: Simplify with dev_err_probe() backlight: lp8788: Fully initialize backlight_properties during probe backlight: lm3639: Fully initialize backlight_properties during probe backlight: da9052: Fully initialize backlight_properties during probe backlight: lm3630a: Use backlight_get_brightness helper in update_status backlight: lm3630a: Don't set bl->props.brightness in get_brightness backlight: lm3630a: Initialize backlight_properties on init backlight: mp3309c: Fully initialize backlight_properties during probe backlight: mp3309c: Utilise temporary variable for struct device backlight: mp3309c: Use dev_err_probe() instead of dev_err() backlight: mp3309c: Make use of device properties dt-bindings: backlight: qcom-wled: Fix bouncing email addresses backlight: hx8357: Utilise temporary variable for struct device backlight: hx8357: Make use of dev_err_probe() ...
2024-03-07leds: ncp5623: Add MS suffix to time definesAbdel Alkuor1-5/+5
To make the time macro defines clearer, add MS as a suffix. Signed-off-by: Abdel Alkuor <alkuor@gmail.com> Link: https://lore.kernel.org/r/20240305133824.1551809-1-alkuor@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: Add NCP5623 multi-led driverAbdel Alkuor3-0/+283
NCP5623 is DC-DC multi-LEDs driver which has three PWMs that can be programmed up to 32 steps giving 32768 colors hue. NCP5623 driver supports gradual dimming upward/downward with programmable delays. Also, the driver supports driving a single LED or multi-LED like RGB. Signed-off-by: Abdel Alkuor <alkuor@gmail.com> Link: https://lore.kernel.org/r/20240305042049.1533279-2-alkuor@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: mlxreg: Drop an excess struct mlxreg_led_data memberRandy Dunlap1-1/+0
Drop one struct member description to fix a kernel-doc warning: drivers/leds/leds-mlxreg.c:42: warning: Excess struct member 'led_data' description in 'mlxreg_led_data' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20240229071931.7870-4-rdunlap@infradead.org Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: leds-mlxcpld: Fix struct mlxcpld_led_priv member nameRandy Dunlap1-1/+1
Change "cled" to "cdev" to quieten kernel-doc warnings: leds-mlxcpld.c:86: warning: Function parameter or struct member 'cdev' not described in 'mlxcpld_led_priv' leds-mlxcpld.c:86: warning: Excess struct member 'cled' description in 'mlxcpld_led_priv' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20240229071931.7870-3-rdunlap@infradead.org Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: lm3601x: Fix struct lm3601_led kernel-doc warningsRandy Dunlap1-2/+1
Add a short struct description and remove one extraneous struct field description to quieten these warnings: leds-lm3601x.c:73: warning: missing initial short description on line: * struct lm3601x_led - leds-lm3601x.c:100: warning: Excess struct member 'led_name' description in 'lm3601x_led' Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Acked-by: Vadim Pasternak <vadimp@nvidia.com> Link: https://lore.kernel.org/r/20240229071931.7870-2-rdunlap@infradead.org Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: sgm3140: Add missing timer cleanup and flash gpio controlOndrej Jirman1-0/+3
Enabling strobe and then setting brightness to 0 causes the driver to enter invalid state after strobe end timer fires. We should cancel strobe mode resources when changing brightness (aka torch mode). Fixes: cef8ec8cbd21 ("leds: add sgm3140 driver") Signed-off-by: Ondrej Jirman <megi@xff.cz> Link: https://lore.kernel.org/r/20240217191133.1757553-1-megi@xff.cz Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: expresswire: Don't depend on NEW_LEDSDuje Mihanović1-0/+6
The ExpressWire library does not depend on NEW_LEDS and selecting it from a subsystem other than LEDs may cause Kconfig warnings: WARNING: unmet direct dependencies detected for LEDS_EXPRESSWIRE Depends on [n]: NEW_LEDS [=n] && GPIOLIB [=y] Selected by [y]: - BACKLIGHT_KTD2801 [=y] && HAS_IOMEM [=y] && BACKLIGHT_CLASS_DEVICE [=y] Move it out of the "if NEW_LEDS" block to allow selection from other subsystems (in particular backlight) without raising this warning. Reported-by: Arnd Bergmann <arnd@arndb.de> Closes: https://lore.kernel.org/20240212111819.936815-1-arnd@kernel.org Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202402161410.IG9I4odj-lkp@intel.com/ Suggested-by: Daniel Thompson <daniel.thompson@linaro.org> Fixes: 25ae5f5f4168 ("leds: Introduce ExpressWire library") Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org> Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr> Link: https://lore.kernel.org/r/20240216-expresswire-deps-v2-2-8be59c4a75f5@skole.hr Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: aw2013: Unlock mutex before destroying itGeorge Stark1-0/+1
In the probe() callback in case of error mutex is destroyed being locked which is not allowed so unlock the mutex before destroying. Fixes: 59ea3c9faf32 ("leds: add aw2013 driver") Signed-off-by: George Stark <gnstark@salutedevices.com> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com> Link: https://lore.kernel.org/r/20231214173614.2820929-2-gnstark@salutedevices.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: qcom-lpg: Add QCOM_PBS dependencyArnd Bergmann1-0/+1
The lpg driver fails to link now when the pbs driver is in a loadable module: x86_64-linux-ld: drivers/leds/rgb/leds-qcom-lpg.o: in function `lpg_brightness_set': leds-qcom-lpg.c:(.text+0xe7f): undefined reference to `qcom_pbs_trigger_event' x86_64-linux-ld: drivers/leds/rgb/leds-qcom-lpg.o: in function `lpg_probe': leds-qcom-lpg.c:(.text+0x16a5): undefined reference to `get_pbs_client_device' Add a dependency to avoid the broken configuration. Apparently there is still a use for lpg with pbs disabled entirely for certain chips, so allow both but not LEDS_QCOM_LPG=y with QCOM_PBS=m. Fixes: 214110175679 ("leds: rgb: leds-qcom-lpg: Add support for PPG through single SDAM") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Reviewed-by: Jean Delvare <jdelvare@suse.de> Link: https://lore.kernel.org/r/20240212111526.829122-1-arnd@kernel.org Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: rgb: leds-group-multicolor: Allow LEDs to stay on in suspendAren Moynihan1-2/+6
If none of the managed LEDs enable LED_CORE_SUSPENDRESUME, then we shouldn't need to set it here. This makes it possible to use multicolor groups with GPIO LEDs that enable retain-state-suspended in the device tree. Signed-off-by: Aren Moynihan <aren@peacevolution.org> Acked-by: Pavel Machek <pavel@ucw.cz> Link: https://lore.kernel.org/r/20240206185400.596979-1-aren@peacevolution.org [Lee: Changed the comment to respect proper grammar] Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: trigger: netdev: Fix kernel panic on interface rename trig notifyChristian Marangi1-2/+2
Commit d5e01266e7f5 ("leds: trigger: netdev: add additional specific link speed mode") in the various changes, reworked the way to set the LINKUP mode in commit cee4bd16c319 ("leds: trigger: netdev: Recheck NETDEV_LED_MODE_LINKUP on dev rename") and moved it to a generic function. This changed the logic where, in the previous implementation the dev from the trigger event was used to check if the carrier was ok, but in the new implementation with the generic function, the dev in trigger_data is used instead. This is problematic and cause a possible kernel panic due to the fact that the dev in the trigger_data still reference the old one as the new one (passed from the trigger event) still has to be hold and saved in the trigger_data struct (done in the NETDEV_REGISTER case). On calling of get_device_state(), an invalid net_dev is used and this cause a kernel panic. To handle this correctly, move the call to get_device_state() after the new net_dev is correctly set in trigger_data (in the NETDEV_REGISTER case) and correctly parse the new dev. Fixes: d5e01266e7f5 ("leds: trigger: netdev: add additional specific link speed mode") Cc: stable@vger.kernel.org Signed-off-by: Christian Marangi <ansuelsmth@gmail.com> Reviewed-by: Andrew Lunn <andrew@lunn.ch> Link: https://lore.kernel.org/r/20240203235413.1146-1-ansuelsmth@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: qcom-lpg: Add PM660L configuration and compatibleMarijn Suijten1-0/+18
Inherit PM660L PMIC LPG/triled block configuration from downstream drivers and DT sources, consisting of a triled block with automatic trickle charge control and source selection, three colored led channels belonging to the synchronized triled block and one loose PWM channel. Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org> Reviewed-by: Bjorn Andersson <bjorn.andersson@linaro.org> Link: https://lore.kernel.org/r/20240204-pm660l-lpg-v5-1-2f54d1a0894b@somainline.org Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: spi-byte: Use devm_led_classdev_register_ext()Stefan Kalscheuer1-5/+6
Use extended classdev registration to generate generic device names from color and function enums instead of reading only the label from the device tree. Signed-off-by: Stefan Kalscheuer <stefan@stklcode.de> Link: https://lore.kernel.org/r/20240204150726.29783-1-stefan@stklcode.de Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: pca963x: Add support for suspend and resumeAmitesh Singh1-0/+28
This implements power management for pca9633 which enables device sleep and resume on system-wide sleep/hibernation Signed-off-by: Amitesh Singh <singh.amitesh@gmail.com> Link: https://lore.kernel.org/r/20240203162524.343936-1-singh.amitesh@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: triggers: Add helper led_match_default_triggerHeiner Kallweit1-12/+17
Avoid code duplication and factor out common functionality to new helper led_match_default_trigger(). Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/d78eef6f-c18c-4546-b83e-6d1890849154@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>
2024-03-07leds: trigger: Stop exporting trigger_listHeiner Kallweit2-2/+1
Commit 682e98564ffb ("leds: trigger: panic: Simplify led_trigger_set_panic") removed the last external user of variable trigger_list. So stop exporting it. If in future a need should arise again to access this variable, I think we better add some accessor instead of exporting the variable directly. Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com> Link: https://lore.kernel.org/r/ca185fb1-3a66-46b9-920e-bfecbe39c6bf@gmail.com Signed-off-by: Lee Jones <lee@kernel.org>