[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID:
<CY4PR03MB3399960604BF0CAAA108231F9B732@CY4PR03MB3399.namprd03.prod.outlook.com>
Date: Tue, 16 Jan 2024 10:47:04 +0000
From: "Miclaus, Antoniu" <Antoniu.Miclaus@...log.com>
To: "alexandre.belloni@...tlin.com" <alexandre.belloni@...tlin.com>
CC: "linux-rtc@...r.kernel.org" <linux-rtc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH 1/2] rtc: max31335: remove unecessary locking
> From: Alexandre Belloni <alexandre.belloni@...tlin.com>
>
> There is no race condition when accessing MAX31335_STATUS1 because it is
> always about clearing the alarm interrupt bit.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@...tlin.com>
Reviewed-by: Antoniu Miclaus <antoniu.miclaus@...log.com>
> ---
> drivers/rtc/rtc-max31335.c | 14 +++-----------
> 1 file changed, 3 insertions(+), 11 deletions(-)
>
> diff --git a/drivers/rtc/rtc-max31335.c b/drivers/rtc/rtc-max31335.c
> index 3ddfe71bbb56..2ce23f60a7f3 100644
> --- a/drivers/rtc/rtc-max31335.c
> +++ b/drivers/rtc/rtc-max31335.c
> @@ -348,27 +348,19 @@ static int max31335_alarm_irq_enable(struct device
> *dev, unsigned int enabled)
> static irqreturn_t max31335_handle_irq(int irq, void *dev_id)
> {
> struct max31335_data *max31335 = dev_id;
> - struct mutex *lock = &max31335->rtc->ops_lock;
> int ret, status;
>
> - mutex_lock(lock);
> -
> ret = regmap_read(max31335->regmap, MAX31335_STATUS1,
> &status);
> if (ret)
> - goto exit;
> + return IRQ_HANDLED;
>
> if (FIELD_GET(MAX31335_STATUS1_A1F, status)) {
> - ret = regmap_update_bits(max31335->regmap,
> MAX31335_STATUS1,
> - MAX31335_STATUS1_A1F, 0);
> - if (ret)
> - goto exit;
> + regmap_update_bits(max31335->regmap,
> MAX31335_STATUS1,
> + MAX31335_STATUS1_A1F, 0);
>
> rtc_update_irq(max31335->rtc, 1, RTC_AF | RTC_IRQF);
> }
>
> -exit:
> - mutex_unlock(lock);
> -
> return IRQ_HANDLED;
> }
>
> --
> 2.43.0
Powered by blists - more mailing lists