From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jacek Anaszewski Subject: Re: [PATCH/RFC RESEND] leds: Use set_brightness_work for brightness_set ops that can sleep Date: Tue, 30 Jun 2015 10:27:24 +0200 Message-ID: <559252EC.2050906@samsung.com> References: <1435651268-9657-1-git-send-email-j.anaszewski@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mailout1.w1.samsung.com ([210.118.77.11]:34278 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750952AbbF3I1a (ORCPT ); Tue, 30 Jun 2015 04:27:30 -0400 In-reply-to: <1435651268-9657-1-git-send-email-j.anaszewski@samsung.com> Sender: linux-leds-owner@vger.kernel.org List-Id: linux-leds@vger.kernel.org To: Stas Sergeev Cc: Jacek Anaszewski , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, Bryan Wu , Richard Purdie , Pavel Machek , Sakari Ailus , Andreas Werner , Andrew Lunn , Antonio Ospite , Atsushi Nemoto , Ben Dooks , Chris Boot , Dan Murphy , Daniel Jeong , Daniel Mack , "David S. Miller" , Fabio Baltieri , Felipe Balbi , Florian Fainelli , "G.Shark Jeong" , Guennadi Liakhovetski , Ingi Kim , Jan-Simon Moeller , Johan On 06/29/2015 05:17 PM, Stas Sergeev wrote:> 29.06.2015 17:05, Jacek=20 Anaszewski =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> + * If need to disable soft blinking delegate this to the >> + * work queue task to avoid problems in case we are >> + * called from hard irq context. >> + */ >> + led_cdev->flags |=3D LED_BLINK_DISABLE; > Wouldn't it be better to just enforce the callers > to explicitly disable software blink, so that it to > never happen from irq context? Something like in this > patch: > https://lkml.org/lkml/2015/5/13/491 > Blinking can be disabled not only by removing trigger explicitly, but also by setting brightness to 0 and led_set_brightness can be called from hard irq context. set_brightness_work was originally introduced exactly for this use case. --=20 Best Regards, Jacek Anaszewski