Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp29311pxu; Thu, 22 Oct 2020 14:26:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzlI5s7YnsUvIP+s7EhDxSag95hmlVkeiqdDEMzhhG4wK+HXBVxBrLoiwFvZbbA8pHkeoJ/ X-Received: by 2002:aa7:cb82:: with SMTP id r2mr4101735edt.306.1603402006660; Thu, 22 Oct 2020 14:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603402006; cv=none; d=google.com; s=arc-20160816; b=Huh4wCj8Xqy9AKvvqsWNFcTsmXIsjwS4NU02KFkth227mVM4YjOvlat2rdQJ5EWjy/ vHQM54QuZwCNAeqaQkrBdo68nA1fRmWSuCeCRyw0370dh1m/THvBhR9Q9ihVWKm4jN5l 6CaQDYMeAQFkhSFbiwXahlp/0f0vkbfYxwshQEPm3UrRTGaZEZlOS5DiLAkhit+ZPLXC U5GDUfsCR7mFzwl0SMumWYCQyqiDWRDxDZsJfZ0yghKZNZuKIaM+BekTWvzKghwm+S2O ZDphstlZyq+ye5XUn0R5Poesb1hLyap/GJ5Qf7eO+XskPYhqM//SDB1lsX2+wLqLi7E7 gJXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=lZvF70TonM5MSbQF+AKqyJMMY9TXMCxpwYzE0jaz0hE=; b=lxc5bij+7l3TbwGEhIblRTT+ZgrJm0GD+BhC66T3qTJ3Y++nL0ktUdbAG/ubrVXCS/ U8Q96TYE0Zesl0Pqu25hW28+hBU7sQ2DspRe3ZaZrYL3sM49hRzJqZ9PlmR57SlNRpzK WRsPxwizjRI1/C3Feb/ZGQjv5JDCssN8NxlwP9ATol1nX4FplwvO4kBSZ6HkqPkmbVRo 4Uycr75fK0Eubx2D8LBUG2x+s+NUgKSxWBKKowZfqBRM7E4x4HeSS8IAk4QAoPgsjemB vQ0AfQix5rt6g1EWZ9J+da/igGMifwXEuAugQ8EdfuBI0kJaYCeYbhFa9n8osH8kgsCQ 8gUg== 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 d19si1746638ejp.485.2020.10.22.14.26.15; Thu, 22 Oct 2020 14:26:46 -0700 (PDT) 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 S2898979AbgJVMwL (ORCPT + 99 others); Thu, 22 Oct 2020 08:52:11 -0400 Received: from mail-oi1-f194.google.com ([209.85.167.194]:44731 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2442856AbgJVMwK (ORCPT ); Thu, 22 Oct 2020 08:52:10 -0400 Received: by mail-oi1-f194.google.com with SMTP id k27so1555740oij.11; Thu, 22 Oct 2020 05:52:08 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=lZvF70TonM5MSbQF+AKqyJMMY9TXMCxpwYzE0jaz0hE=; b=hJWsDN4EsTOFrX+1Z6P8g6QugvVSgW2is9phjdsFK3Vva2e5O5rAYd5c0zFYz0w/F1 8jOD9lI5mQ/l1kDZ3EJe+S2ELMl0euZjgZt5/kMgGYdNcGt+2dznlELxrT2e+VBsKX32 6IOhvAgWQE8XXNs8UDdEqhAzJHct2t1A2KanCEXJP34RwS4g1aM1yr32BkCgfz10bXoZ jrwt/yrimd44awlh32uP1SPvz2jpzfIxi4IDmlf+p5wdzyLFcNNeENk/Mu1V3uIwpTSo n3uWguLg5B1vDUcOgInXL6Kz3sNfaIV0AU2Jr1R1CeZshDjDJkEomzqcalP8VDNj0Iqa 0n4g== X-Gm-Message-State: AOAM5312zj/qg3w/DvGirEm/FT3lw7VuAM1bFYrCf1BUjBhs1MA0QRQI q/r1QwT/26G9lBx28zLdpGOOZDmzlWty1UC+0pIbJ97vCTk= X-Received: by 2002:aca:c490:: with SMTP id u138mr1505068oif.54.1603371127905; Thu, 22 Oct 2020 05:52:07 -0700 (PDT) MIME-Version: 1.0 References: <1603249530-25218-1-git-send-email-tiantao6@hisilicon.com> In-Reply-To: <1603249530-25218-1-git-send-email-tiantao6@hisilicon.com> From: Geert Uytterhoeven Date: Thu, 22 Oct 2020 14:51:56 +0200 Message-ID: Subject: Re: [PATCH] thermal: replace spin_lock_irqsave by spin_lock in hard IRQ To: Tian Tao Cc: =?UTF-8?Q?Niklas_S=C3=B6derlund?= , Zhang Rui , Daniel Lezcano , amitk@kernel.org, Linux-Renesas , Linux PM list , Linux Kernel Mailing List , Thomas Gleixner Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tian, CC tglx On Wed, Oct 21, 2020 at 2:15 PM Tian Tao wrote: > The code has been in a irq-disabled context since it is hard IRQ. There > is no necessity to do it again. > > Signed-off-by: Tian Tao Thanks for your patch! Is this also true if CONFIG_PREEMPT_RT=y, and all irq handlers execute in the context of special tasks? > --- a/drivers/thermal/rcar_thermal.c > +++ b/drivers/thermal/rcar_thermal.c > @@ -409,16 +409,15 @@ static irqreturn_t rcar_thermal_irq(int irq, void *data) > { > struct rcar_thermal_common *common = data; > struct rcar_thermal_priv *priv; > - unsigned long flags; > u32 status, mask; > > - spin_lock_irqsave(&common->lock, flags); > + spin_lock(&common->lock); > > mask = rcar_thermal_common_read(common, INTMSK); > status = rcar_thermal_common_read(common, STR); > rcar_thermal_common_write(common, STR, 0x000F0F0F & mask); > > - spin_unlock_irqrestore(&common->lock, flags); > + spin_unlock(&common->lock); > > status = status & ~mask; Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds