[PATCH] led: trig: timer: stop offloading on deactivation

Daniel Golle posted 1 patch 2 years, 6 months ago
drivers/leds/trigger/ledtrig-timer.c | 2 ++
1 file changed, 2 insertions(+)
[PATCH] led: trig: timer: stop offloading on deactivation
Posted by Daniel Golle 2 years, 6 months ago
Stop hardware blinking when switching from 'timer' to another trigger.

Fixes: 5ada28bf7675 ("led-class: always implement blinking")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/leds/trigger/ledtrig-timer.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/leds/trigger/ledtrig-timer.c b/drivers/leds/trigger/ledtrig-timer.c
index b4688d1d9d2b2..fb6b207b052b8 100644
--- a/drivers/leds/trigger/ledtrig-timer.c
+++ b/drivers/leds/trigger/ledtrig-timer.c
@@ -125,6 +125,8 @@ static void timer_trig_deactivate(struct led_classdev *led_cdev)
 {
 	/* Stop blinking */
 	led_set_brightness(led_cdev, LED_OFF);
+	if (led_cdev->blink_set)
+		led_cdev->blink_set(led_cdev, 0, 0);
 }
 
 static struct led_trigger timer_led_trigger = {
-- 
2.41.0
Re: [PATCH] led: trig: timer: stop offloading on deactivation
Posted by kernel test robot 2 years, 6 months ago
Hi Daniel,

kernel test robot noticed the following build warnings:

[auto build test WARNING on lee-leds/for-leds-next]
[also build test WARNING on wireless-next/main wireless/main linus/master pavel-leds/for-next v6.5-rc3 next-20230728]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Daniel-Golle/led-trig-timer-stop-offloading-on-deactivation/20230728-203243
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
patch link:    https://lore.kernel.org/r/728da6e11d34a39f717be07e246dcc4964b0fd51.1690542871.git.daniel%40makrotopia.org
patch subject: [PATCH] led: trig: timer: stop offloading on deactivation
config: mips-randconfig-r093-20230728 (https://download.01.org/0day-ci/archive/20230729/202307290641.SUCRTRMI-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230729/202307290641.SUCRTRMI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307290641.SUCRTRMI-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/leds/trigger/ledtrig-timer.c:129:47: sparse: sparse: Using plain integer as NULL pointer
   drivers/leds/trigger/ledtrig-timer.c:129:50: sparse: sparse: Using plain integer as NULL pointer

vim +129 drivers/leds/trigger/ledtrig-timer.c

   123	
   124	static void timer_trig_deactivate(struct led_classdev *led_cdev)
   125	{
   126		/* Stop blinking */
   127		led_set_brightness(led_cdev, LED_OFF);
   128		if (led_cdev->blink_set)
 > 129			led_cdev->blink_set(led_cdev, 0, 0);
   130	}
   131	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
Re: [PATCH] led: trig: timer: stop offloading on deactivation
Posted by Lee Jones 2 years, 5 months ago
On Sat, 29 Jul 2023, kernel test robot wrote:

> Hi Daniel,
> 
> kernel test robot noticed the following build warnings:
> 
> [auto build test WARNING on lee-leds/for-leds-next]
> [also build test WARNING on wireless-next/main wireless/main linus/master pavel-leds/for-next v6.5-rc3 next-20230728]
> [If your patch is applied to the wrong git tree, kindly drop us a note.
> And when submitting patch, we suggest to use '--base' as documented in
> https://git-scm.com/docs/git-format-patch#_base_tree_information]
> 
> url:    https://github.com/intel-lab-lkp/linux/commits/Daniel-Golle/led-trig-timer-stop-offloading-on-deactivation/20230728-203243
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
> patch link:    https://lore.kernel.org/r/728da6e11d34a39f717be07e246dcc4964b0fd51.1690542871.git.daniel%40makrotopia.org
> patch subject: [PATCH] led: trig: timer: stop offloading on deactivation
> config: mips-randconfig-r093-20230728 (https://download.01.org/0day-ci/archive/20230729/202307290641.SUCRTRMI-lkp@intel.com/config)
> compiler: mips-linux-gcc (GCC) 12.3.0
> reproduce: (https://download.01.org/0day-ci/archive/20230729/202307290641.SUCRTRMI-lkp@intel.com/reproduce)
> 
> If you fix the issue in a separate patch/commit (i.e. not just a new version of
> the same patch/commit), kindly add following tags
> | Reported-by: kernel test robot <lkp@intel.com>
> | Closes: https://lore.kernel.org/oe-kbuild-all/202307290641.SUCRTRMI-lkp@intel.com/
> 
> sparse warnings: (new ones prefixed by >>)
> >> drivers/leds/trigger/ledtrig-timer.c:129:47: sparse: sparse: Using plain integer as NULL pointer
>    drivers/leds/trigger/ledtrig-timer.c:129:50: sparse: sparse: Using plain integer as NULL pointer

Are you planning on fixing this?

> vim +129 drivers/leds/trigger/ledtrig-timer.c
> 
>    123	
>    124	static void timer_trig_deactivate(struct led_classdev *led_cdev)
>    125	{
>    126		/* Stop blinking */
>    127		led_set_brightness(led_cdev, LED_OFF);
>    128		if (led_cdev->blink_set)
>  > 129			led_cdev->blink_set(led_cdev, 0, 0);
>    130	}
>    131	
> 
> -- 
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

-- 
Lee Jones [李琼斯]
Re: [PATCH] led: trig: timer: stop offloading on deactivation
Posted by Pavel Machek 2 years, 6 months ago
On Fri 2023-07-28 13:30:58, Daniel Golle wrote:
> Stop hardware blinking when switching from 'timer' to another trigger.
> 
> Fixes: 5ada28bf7675 ("led-class: always implement blinking")
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>

ACK.

BR,
								Pavel
-- 
People of Russia, stop Putin before his war on Ukraine escalates.
Re: [PATCH] led: trig: timer: stop offloading on deactivation
Posted by Lee Jones 2 years, 6 months ago
On Fri, 28 Jul 2023, Pavel Machek wrote:

> On Fri 2023-07-28 13:30:58, Daniel Golle wrote:
> > Stop hardware blinking when switching from 'timer' to another trigger.
> > 
> > Fixes: 5ada28bf7675 ("led-class: always implement blinking")
> > Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> 
> ACK.

Could I have that in full please, such that b4 can pick it up?

-- 
Lee Jones [李琼斯]