Re: [PATCH 1/9] mfd: Add driver for Photonicat power management MCU

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



…
> +++ 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





[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux