Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933015AbbENLw7 (ORCPT ); Thu, 14 May 2015 07:52:59 -0400 Received: from smtp34.i.mail.ru ([94.100.177.94]:59759 "EHLO smtp34.i.mail.ru" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932410AbbENLw4 (ORCPT ); Thu, 14 May 2015 07:52:56 -0400 Message-ID: <55548C8A.9060607@list.ru> Date: Thu, 14 May 2015 14:52:42 +0300 From: Stas Sergeev User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Jacek Anaszewski CC: linux-leds@vger.kernel.org, Linux kernel , Bryan Wu , Richard Purdie , Kyungmin Park , Stas Sergeev Subject: Re: [PATCH] leds: fix brightness changing when software blinking is active References: <55535DA4.2010509@list.ru> <55546084.9050704@samsung.com> <55546EAC.70408@list.ru> <55547A0C.3060103@samsung.com> <555480FD.3020301@list.ru> In-Reply-To: <555480FD.3020301@list.ru> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Spam: Not detected X-Mras: Ok Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1677 Lines: 35 14.05.2015 14:03, Stas Sergeev пишет: > 14.05.2015 13:33, Jacek Anaszewski пишет: >>> Indeed, but with these changes there should be no requirement >>> for disabling a soft-blink from hard-irq context, which is what >>> I really wanted to have. What am I missing? >> Please look at this [1]. Author mentions setting brightness >> from sound-card irq handler. >> >> [1] http://www.spinics.net/lists/linux-leds/msg00006.html > He points to the following (out-of-tree??) code: > --- > if ((jiffies / HZ / 2) & 1) > led_trigger_blink_oneshot(ledtrig_ide, > &ide_blink_delay, &ide_blink_delay, 0); > if ((jiffies / HZ / 4) & 1) > led_trigger_event(ledtrig_ide, 100); > if ((jiffies / HZ / 8) & 1) > led_trigger_event(ledtrig_ide, 0); > --- > I think the problem was that oneshot_trig_deactivate() was > not doing led_stop_software_blink(led_cdev), and so he needed > a work-queue for switching out from oneshot trigger. > My patch fixes exactly that: now oneshot trigger does the > proper cleanup itself. > Do you think my patch is not enough to handle this case? Likely not, if he switches triggers in hard-irq context. Though I wonder if it is important to care about the out-of-tree code that could use the work-queue itself? Anyway, I think I should split the patch to the fix and the cleanup, to make the life easier. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/