Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932516AbbENMJW (ORCPT ); Thu, 14 May 2015 08:09:22 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:45829 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932091AbbENMJU (ORCPT ); Thu, 14 May 2015 08:09:20 -0400 MIME-version: 1.0 Content-type: text/plain; charset=UTF-8; format=flowed X-AuditID: cbfec7f4-f79c56d0000012ee-82-5554906d08c5 Content-transfer-encoding: 8BIT Message-id: <5554906C.9060405@samsung.com> Date: Thu, 14 May 2015 14:09:16 +0200 From: Jacek Anaszewski User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130804 Thunderbird/17.0.8 To: Stas Sergeev 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> X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFrrPLMWRmVeSWpSXmKPExsVy+t/xq7q5E0JCDZb2ylsc3TmRyeJs0xt2 i8u75rBZbH2zjtFi966nrBatmxqYLTr7prE4sHvsnHWX3ePelsvMHnvm/2D16NuyitGj6VQ7 q8fnTXIBbFFcNimpOZllqUX6dglcGa39F5gLenkrfjx3aWDs4+pi5OSQEDCRaO1+xQJhi0lc uLeerYuRi0NIYCmjxLmLT9hAErwCghI/Jt8DKuLgYBaQlzhyKRskzCxgJvGoZR0zRP0zRokd ax+yQtRrSeyYuYQZxGYRUJW49PAnE4jNJmAo8fPFazBbVCBC4s/pfawgM0WAZm5oLAOZwyzw ilHi5auHjCA1wgKhEr9nfmWHWDCHUWLZymlgB3EKqEv0brnKMoFRYBaS+2Yh3DcLyX0LGJlX MYqmliYXFCel5xrqFSfmFpfmpesl5+duYoQE+5cdjIuPWR1iFOBgVOLhXaEeHCrEmlhWXJl7 iFGCg1lJhPd2T0ioEG9KYmVValF+fFFpTmrxIUZpDhYlcd65u96HCAmkJ5akZqemFqQWwWSZ ODilGhi3NE248b7koCRfdXDQzVUhGZNu97M0i0ifjrj8PeKF94UYSSuPW/eefOzem86nbOCy jdXmaWak1rOXyQecbrxq43YI1Tv/d7chj+/S/fefCM42eDx7ZeOfVy+DBYXmHXplmX4p/sPB A03WzK/i/X57Wzax2mz5amv+8kR8tvXxDd49fKeWz3dRYinOSDTUYi4qTgQAYygpZXICAAA= Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1882 Lines: 45 On 05/14/2015 01:03 PM, Stas Sergeev wrote: > 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? > This problem is related to the issue of locking between hard IRQ and Softirqs [1]. I've just discovered also that there had been already an attempt [2] of using work queue internally in led_set_brightness, but it wouldn't have found its way to the mainline. Probably for a reason. [1] https://www.kernel.org/pub/linux/kernel/people/rusty/kernel-locking/c188.html [2] http://www.serverphorums.com/read.php?12,563432 -- Best Regards, Jacek Anaszewski -- 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/