Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp254332pxb; Wed, 3 Feb 2021 04:56:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJzKrCHZ0MKTxRwPlWkSHtBSpF0C1xw0Y8L2NawQR+tj4+SF5x5U0+WoWCclfz2Yxzh0wB1/ X-Received: by 2002:a05:6402:1291:: with SMTP id w17mr2825569edv.112.1612357016679; Wed, 03 Feb 2021 04:56:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612357016; cv=none; d=google.com; s=arc-20160816; b=HfP45kd2aioqhYe6J9tgRxehOAZK9AuRRGCXj4k7BZ4zObFvty2uNUIstBRFBAktWf YX45PlahAbamRO4nAHcocIOj6yf1R/FHbce3MLqmsBgXetn/mCfcMWzvHfkt+o8BeTqk bzWhJ7Yc67iB7d7MgfcWUCb7bSEFKaL3V0EkwfC5HHoC3vtArNG2O+P/jS4OPCNyINZk b7TubrAG+G6dHvka7uMd533Idz1Vjk9zLFmvigqYV0aYkCAEIPQ/fU0XdWCvIMNAL0Gl Av9fh+VUuNE7P9paE045jU9A1fvKXUis9eBRa/bC+vcMd7mnRb61/Gyb1LIMYNbZYJiD NITw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from; bh=fAEvfGJblWGVxJ//uX1Z8mfnEA2IzCJNdzjrgfsrfxk=; b=vhICfpVjWiYrme72oJikhh1SedpNFomdnUgELh85LPbXJ3WGYLop8B3CDNZj73xl2M IXT3QElQcuXg3lpn+unjdVeFZWsgmeCvcFksitgbylSaJh47vTiZsdfvSlwcUuXGFI7s mdRHdVcwSDKcmp4a5tC5i5whxhrZ5M5b5bOh3qV3HeN3hdouvX2ZaPNop+fNz+G768M8 EAn7h3oGwjHHvv7Mklb4X96VwzpawBXOOMdCumfntL/skmwcvGTs3oISgOOlJG7xhlgF v2TE0EXET29sD2132ZmLkoPzXUNUGhRRKV4RTYlJStEf0EHebMvBJsp1U0yeChL1u81K 3iuQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n23si626583edw.585.2021.02.03.04.56.32; Wed, 03 Feb 2021 04:56:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230365AbhBCMxE (ORCPT + 99 others); Wed, 3 Feb 2021 07:53:04 -0500 Received: from szxga06-in.huawei.com ([45.249.212.32]:12410 "EHLO szxga06-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230499AbhBCMnT (ORCPT ); Wed, 3 Feb 2021 07:43:19 -0500 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga06-in.huawei.com (SkyGuard) with ESMTP id 4DW1Wt0wmjzjHD2; Wed, 3 Feb 2021 20:41:30 +0800 (CST) Received: from localhost.localdomain (10.67.165.24) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.498.0; Wed, 3 Feb 2021 20:42:27 +0800 From: Xiaofei Tan To: , CC: Xiaofei Tan , , , Subject: [PATCH 2/6] rtc: pm8xxx: Replace spin_lock_irqsave with spin_lock in hard IRQ Date: Wed, 3 Feb 2021 20:39:37 +0800 Message-ID: <1612355981-6764-3-git-send-email-tanxiaofei@huawei.com> X-Mailer: git-send-email 2.8.1 In-Reply-To: <1612355981-6764-1-git-send-email-tanxiaofei@huawei.com> References: <1612355981-6764-1-git-send-email-tanxiaofei@huawei.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.67.165.24] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is redundant to do irqsave and irqrestore in hardIRQ context, where it has been in a irq-disabled context. Signed-off-by: Xiaofei Tan --- drivers/rtc/rtc-pm8xxx.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/rtc/rtc-pm8xxx.c b/drivers/rtc/rtc-pm8xxx.c index 0d9dd6f..92642aa 100644 --- a/drivers/rtc/rtc-pm8xxx.c +++ b/drivers/rtc/rtc-pm8xxx.c @@ -343,16 +343,15 @@ static irqreturn_t pm8xxx_alarm_trigger(int irq, void *dev_id) const struct pm8xxx_rtc_regs *regs = rtc_dd->regs; unsigned int ctrl_reg; int rc; - unsigned long irq_flags; rtc_update_irq(rtc_dd->rtc, 1, RTC_IRQF | RTC_AF); - spin_lock_irqsave(&rtc_dd->ctrl_reg_lock, irq_flags); + spin_lock(&rtc_dd->ctrl_reg_lock); /* Clear the alarm enable bit */ rc = regmap_read(rtc_dd->regmap, regs->alarm_ctrl, &ctrl_reg); if (rc) { - spin_unlock_irqrestore(&rtc_dd->ctrl_reg_lock, irq_flags); + spin_unlock(&rtc_dd->ctrl_reg_lock); goto rtc_alarm_handled; } @@ -360,13 +359,13 @@ static irqreturn_t pm8xxx_alarm_trigger(int irq, void *dev_id) rc = regmap_write(rtc_dd->regmap, regs->alarm_ctrl, ctrl_reg); if (rc) { - spin_unlock_irqrestore(&rtc_dd->ctrl_reg_lock, irq_flags); + spin_unlock(&rtc_dd->ctrl_reg_lock); dev_err(rtc_dd->rtc_dev, "Write to alarm control register failed\n"); goto rtc_alarm_handled; } - spin_unlock_irqrestore(&rtc_dd->ctrl_reg_lock, irq_flags); + spin_unlock(&rtc_dd->ctrl_reg_lock); /* Clear RTC alarm register */ rc = regmap_read(rtc_dd->regmap, regs->alarm_ctrl2, &ctrl_reg); -- 2.8.1