[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <9051dba0-0483-43dc-9e5d-d19500c019b9@classfun.cn>
Date: Sat, 7 Sep 2024 22:46:29 +0800
From: Junhao Xie <bigfoot@...ssfun.cn>
To: Markus Elfring <Markus.Elfring@....de>, devicetree@...r.kernel.org,
linux-hwmon@...r.kernel.org, linux-leds@...r.kernel.org,
linux-pm@...r.kernel.org, linux-rtc@...r.kernel.org,
linux-watchdog@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
linux-rockchip@...ts.infradead.org
Cc: LKML <linux-kernel@...r.kernel.org>,
Alexandre Belloni <alexandre.belloni@...tlin.com>,
Chukun Pan <amadeus@....edu.cn>, Conor Dooley <conor+dt@...nel.org>,
Günter Röck <linux@...ck-us.net>,
Heiko Stübner <heiko@...ech.de>,
Jean Delvare <jdelvare@...e.com>, Krzysztof Kozlowski <krzk+dt@...nel.org>,
Lee Jones <lee@...nel.org>, Pavel Machek <pavel@....cz>,
Rob Herring <robh@...nel.org>, Sebastian Reichel <sre@...nel.org>,
Wim Van Sebroeck <wim@...ux-watchdog.org>, Junhao Xie <bigfoot@...ssfun.cn>
Subject: Re: [PATCH 1/9] mfd: Add driver for Photonicat power management MCU
On 2024/9/7 16:10, Markus Elfring wrote:
> …
>> +++ b/drivers/mfd/photonicat-pmu.c
>> @@ -0,0 +1,501 @@
> …
>> +int pcat_pmu_execute(struct pcat_request *request)
>> +{
> …
>
> Under which circumstances would you become interested to apply statements
> like the following?
>
>
>> + mutex_lock(&pmu->reply_lock);
>> + if (request->frame_id == 0)
>> + request->frame_id = atomic_inc_return(&pmu->frame);
>> + pmu->reply = request;
>> + mutex_unlock(&pmu->reply_lock);
> …
>
> A) guard(mutex)(&pmu->reply_lock);
> https://elixir.bootlin.com/linux/v6.11-rc6/source/include/linux/mutex.h#L196
>
>
>
>> + spin_lock_irqsave(&pmu->bus_lock, flags);
>> + ret = pcat_pmu_raw_write(pmu, request->frame_id, req->cmd,
>> + true, req->data, req->size);
>> + spin_unlock_irqrestore(&pmu->bus_lock, flags);
> …
>
> B) guard(spinlock_irqsave)(&pmu->bus_lock);
> https://elixir.bootlin.com/linux/v6.11-rc6/source/include/linux/spinlock.h#L572
>
>
> Regards,
> Markus
Thanks for your suggestions, I will try these statements.
Best regards,
Junhao
Powered by blists - more mailing lists