Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2833428pxb; Fri, 12 Feb 2021 02:31:26 -0800 (PST) X-Google-Smtp-Source: ABdhPJzV4fkQCdGP5N6AZrh9kWG1/Rv7jNKClBNxgAtswRc2ZenaFW1hr1x0HuhNe3b0dlk3pysB X-Received: by 2002:a17:906:380c:: with SMTP id v12mr2283815ejc.65.1613125885945; Fri, 12 Feb 2021 02:31:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1613125885; cv=none; d=google.com; s=arc-20160816; b=Jw6sB/B9psqq5xaXFgn0hxsvyx88S8rA9W92Jjb83mtuoY86CtcyI7IAMAz1mylLMi uIMX5zUTOKKmn889Hdu+MlTHGsnUchR3w2P/bekGEQL1ft6fBFFx4WVWo6vst/5Bq9Cw 40MP3nohxHPaavf/NiFeQ1Qj2BUT1y0gQ0Fo4e7L1wsEIbupPA9/nLUiygMJNYrVq4dg EXiSTTClrQKBYISWWUXIZ5NwaQq1x6hj63C4zXvVSS6xeqaUDa8bE/N+kyaDoOz5MtV2 GMoPLV4PtlNr8vv0SYjUd3LTMZjZxdzxCcOhxWYT4sXOXUR8Ps/Uwiek0FDPQ0FAxY/N qxbA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=SqBeUtT5NjBGreoJPsxd+PxgBYN94+X5BvsJ9ZR/Lrk=; b=c65k56t6sPY1mX54IkglHR+upt1bVuKwfZKAXaEs6aMkPughqxohHPIv71jHbmenIo Jby+afu2ZfPAb1l/XWiQvhWpikinHQHl3ch1k+gjXo/WWOvM16YXNiFRKXBSNONSi7VQ 9F6xzFHefHbdONzj+I4ofjsY/eQ4YZkabpDoZzJZWew3uzX+mVE4vEAec9utaQo08JL/ tT3iSUR2hoSZZvCAuSpBFNgx+oNEN2XyiaybErHuJU6jvAcdbOaL509nF2d9crJnoy/9 Nm1QMBTtFuu+Skm06Kp6LpIGNMUQtqEFe09fnEd5PJoBKVLcjgpsy1AFK4oLmnBmf8Fb V2yg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BUKtM0a+; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y90si7089093edy.314.2021.02.12.02.31.01; Fri, 12 Feb 2021 02:31:25 -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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=BUKtM0a+; 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; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230046AbhBLK3N (ORCPT + 99 others); Fri, 12 Feb 2021 05:29:13 -0500 Received: from fllv0016.ext.ti.com ([198.47.19.142]:55478 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229650AbhBLK3M (ORCPT ); Fri, 12 Feb 2021 05:29:12 -0500 Received: from lelv0265.itg.ti.com ([10.180.67.224]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id 11CARo41022623; Fri, 12 Feb 2021 04:27:50 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1613125670; bh=SqBeUtT5NjBGreoJPsxd+PxgBYN94+X5BvsJ9ZR/Lrk=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=BUKtM0a+ZoGDD2/bzv2vABaebPQr58uoBVPnngwVDxZqS/KRiBd18u1gI8hIppnjw gW8mEE6wdgDn2+OJjiLMl5GdTgcH8uOg9auiK0NpkE4oTJFd3J0MvvQnXwsEH8YWTN rkPuLR7e14vZtVcOxFTvcMFXqgWYdDgL5WYc/YUA= Received: from DLEE115.ent.ti.com (dlee115.ent.ti.com [157.170.170.26]) by lelv0265.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 11CARoCp123925 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 12 Feb 2021 04:27:50 -0600 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE115.ent.ti.com (157.170.170.26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3; Fri, 12 Feb 2021 04:27:50 -0600 Received: from fllv0039.itg.ti.com (10.64.41.19) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1979.3 via Frontend Transport; Fri, 12 Feb 2021 04:27:50 -0600 Received: from [10.250.100.73] (ileax41-snat.itg.ti.com [10.172.224.153]) by fllv0039.itg.ti.com (8.15.2/8.15.2) with ESMTP id 11CARlhr129287; Fri, 12 Feb 2021 04:27:47 -0600 Subject: Re: [Linuxarm] Re: [PATCH for next v1 1/2] gpio: omap: Replace raw_spin_lock_irqsave with raw_spin_lock in omap_gpio_irq_handler() To: Arnd Bergmann , "Song Bao Hua (Barry Song)" CC: luojiaxing , Linus Walleij , Andy Shevchenko , Andy Shevchenko , Santosh Shilimkar , Kevin Hilman , "open list:GPIO SUBSYSTEM" , "linux-kernel@vger.kernel.org" , "linuxarm@openeuler.org" References: <1612774577-55943-1-git-send-email-luojiaxing@huawei.com> <1612774577-55943-2-git-send-email-luojiaxing@huawei.com> From: Grygorii Strashko Message-ID: Date: Fri, 12 Feb 2021 12:27:47 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Arnd, On 12/02/2021 11:45, Arnd Bergmann wrote: > On Fri, Feb 12, 2021 at 6:05 AM Song Bao Hua (Barry Song) > wrote: >>> -----Original Message----- > >>> >>> Note. there is also generic_handle_irq() call inside. >> >> So generic_handle_irq() is not safe to run in thread thus requires >> an interrupt-disabled environment to run? If so, I'd rather this >> irqsave moved into generic_handle_irq() rather than asking everyone >> calling it to do irqsave. > > In a preempt-rt kernel, interrupts are run in task context, so they clearly > should not be called with interrupts disabled, that would defeat the > purpose of making them preemptible. > > generic_handle_irq() does need to run with in_irq()==true though, > but this should be set by the caller of the gpiochip's handler, and > it is not set by raw_spin_lock_irqsave(). It will produce warning from __handle_irq_event_percpu(), as this is IRQ dispatcher and generic_handle_irq() will call one of handle_level_irq or handle_edge_irq. The history behind this is commit 450fa54cfd66 ("gpio: omap: convert to use generic irq handler"). The resent related discussion: https://lkml.org/lkml/2020/12/5/208 -- Best regards, grygorii