Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1411928

Re: [PATCH v7 1/6] mfd: max8997: Use regmap to access registers

From Jacek Anaszewski <j.anaszewski@samsung.com>
Newsgroups linux.kernel
Subject Re: [PATCH v7 1/6] mfd: max8997: Use regmap to access registers
Date 2016-06-02 09:10 +0200
Message-ID <rFuVr-2PO-1@gated-at.bofh.it> (permalink)
References <rFaDo-6Ci-29@gated-at.bofh.it> <rFb6q-6Mh-5@gated-at.bofh.it> <rFcFc-7Qb-47@gated-at.bofh.it> <rFsJX-1jX-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On 06/02/2016 06:43 AM, Krzysztof Kozlowski wrote:
> On 06/01/2016 01:37 PM, Jacek Anaszewski wrote:
>> Hi Krzysztof,
>>
>> One thing drew my attention while reviewing this again:
>> max8997_led_brightness_set() can sleep, but the brightness_set
>> op it is assigned to must not sleep. At the time when this driver was
>> merged we were delegating brightness setting to workqueues task
>> in LED class drivers that can sleep during this call.
>> This must have been overlooked, which is even more likely, taking into
>> account that the initial patch doesn't have LED maintainer's ack.
>>
>> The non-sleeping requirement is motivated by the fact that brightness
>> can be set from softirq context, e.g. when timer trigger is enabled.
>>
>> Currently LED class drivers don't have to use workqueue on their own,
>> but are required to use brightness_set_blocking op instead of
>> brightness_set if they can sleep while setting brightness.
>>
>> Apart of that, I think that operations in max8997_led_brightness_set()
>> should be protected with mutex to assure leaving the device in
>> a consistent state in case of concurrent calls.
>>
>> I am aware that this is out of this patch scope, but I'd be grateful
>> if you could apply those changes and test them on hardware if you have
>> an access to.
>
> The problem you mention existed before the patch. It was using sleeping
> primitives (mutex) before adding regmap so I understand you don't have
> anything against this patch, right?

Right, I just wanted to indicate the problem. The patch itself is ok.

> I can fix the issue but it will be a little bit trickier because I don't
> have the hardware. Other guys in the team tested the patchset for me so
> I rely on them in that matter. Anyway I'll work on it.

Ack.

-- 
Best regards,
Jacek Anaszewski

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v7 0/6] mfd: (multiple trees): max8997: Add regmap Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-01 11:30 +0200
  Re: [PATCH v7 1/6] mfd: max8997: Use regmap to access registers Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-06-01 13:40 +0200
    Re: [PATCH v7 1/6] mfd: max8997: Use regmap to access registers Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-02 06:50 +0200
      Re: [PATCH v7 1/6] mfd: max8997: Use regmap to access registers Jacek Anaszewski <j.anaszewski@samsung.com> - 2016-06-02 09:10 +0200
  Re: [PATCH v7 1/6] mfd: max8997: Use regmap to access registers Krzysztof Kozlowski <k.kozlowski@samsung.com> - 2016-06-08 16:40 +0200

csiph-web