Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2380079pxu; Mon, 7 Dec 2020 05:15:12 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9YjFt+6Waagrw/Sj2WQWfdbAyM1RyfvFTIKd4gvcc3cLIXsX0rliSWPSOeHwX1U5nsyz8 X-Received: by 2002:a17:906:3ad5:: with SMTP id z21mr18463296ejd.35.1607346912179; Mon, 07 Dec 2020 05:15:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607346912; cv=none; d=google.com; s=arc-20160816; b=DAPZ/m9CHS5gISx8IrZjGulKvlsFYTACTNNZiK7TS9Vuz4Y0QwtKBCrlFiTeogbnKO zmeL2Q6UghJjWyC8BZcivaSn89XgCv8R9+CIM1f8FaBrsFoNHDY/8N1AsJC/+eX5ASSi YDBWToPS4G2mgGmEEAE7Qe+6zvdY3Dy2jxoTOBe3utikQcHBjVwFEmxsX30WJzad/0Co 8ZRJKdHP5b72KkmW6g3upMYTZooJHNPzUkWGh71332vNJTrmVdXOB+o5UmSSjD2RsNfr fu6sY7W32neKQyk5BYY85rsc9Faa1os3qbe1nL58Q4mQUA0Isbvvxzz0kMlfzwO2SqaP kwaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=XFISQhZxWhpKdzABmKZaUXh4gdDHVr5KbOWmD4vOHaM=; b=sHY+0UxE/nq8SruJm7FsMFKqhtfFlph2yYb4TMtYqN12dhU21fWNU1fCxLhjRu45AG CpTW+qHSdKcKy53xEDrQ/vtskjP+K5vBxv97m3s5hbV7wCprclSSJIg11Ws/v+S65imQ xIBDEI++bq7p4BA/gHL2vku/OnBj8Dgyqqhe1b4G6Vg57pOmxDYUAnTjW+aLovZFHFcz 8DA73enqAW2X0Z/S3hJdYc9Dy9asd21FVdPDPl1CvrVOtjxAi+HZcMW5Y7/vINmOidyX j6VXA6SkF+Jitj6lgGZJlUYsfdHizG667T2kOO+dO1iHKvHh+ZDCbO1gZET3hzaSkipb HMOg== 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 q4si2519851eji.204.2020.12.07.05.14.49; Mon, 07 Dec 2020 05:15:12 -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 S1725804AbgLGNLQ (ORCPT + 99 others); Mon, 7 Dec 2020 08:11:16 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:9125 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725550AbgLGNLQ (ORCPT ); Mon, 7 Dec 2020 08:11:16 -0500 Received: from DGGEMS409-HUB.china.huawei.com (unknown [172.30.72.60]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4CqNvY6v4wz15Mkc; Mon, 7 Dec 2020 21:10:01 +0800 (CST) Received: from [127.0.0.1] (10.57.22.126) by DGGEMS409-HUB.china.huawei.com (10.3.19.209) with Microsoft SMTP Server id 14.3.487.0; Mon, 7 Dec 2020 21:10:24 +0800 Subject: Re: [PATCH v1] gpio: dwapb: mask/unmask IRQ when disable/enable it To: Marc Zyngier , Linus Walleij CC: Serge Semin , Thomas Gleixner , Andy Shevchenko , "Bartosz Golaszewski" , "open list:GPIO SUBSYSTEM" , , Linuxarm References: <1606728979-44259-1-git-send-email-luojiaxing@huawei.com> <20201130112250.GK4077@smile.fi.intel.com> <63f7dcc4-a924-515a-2fea-31ec80f3353e@huawei.com> <20201205221522.ifjravnir5bzmjff@mobilestation> From: luojiaxing Message-ID: <1cc78cf1-edfb-4327-c99c-b3603dc0b3be@huawei.com> Date: Mon, 7 Dec 2020 21:10:24 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-Originating-IP: [10.57.22.126] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/12/7 2:50, Marc Zyngier wrote: > On 2020-12-06 15:02, Linus Walleij wrote: >> On Sat, Dec 5, 2020 at 11:15 PM Serge Semin >> wrote: >> >>> Hmm, that sounds like a problem, but the explanation is a bit unclear >>> to me. AFAICS you are saying that the only callbacks which are >>> called during the IRQ request/release are the irq_enable(), right? If >>> so then the only reason why we haven't got a problem reported due to >>> that so far is that the IRQs actually unmasked by default. >> >> What we usually do in cases like that (and I have discussed this >> with tglx in the past I think) is to simply mask off all IRQs in >> probe(). >> Then they will be unmasked when requested by drivers. >> >> See e.g. gpio-pl061 that has this line in probe(): >> writeb(0, pl061->base + GPIOIE); /* disable irqs */ > > This should definitely be the default behaviour. The code code > expects all interrupt sources to be masked until actively enabled, > usually with the IRQ being requested. I think this patch is used for that purpose. I do two things in irq_enable(): unmask irq and then enable IRQ; and for irq_disable(), it's similar; mask IRQ then disable it. Thanks Jiaxing > > Thanks, > >         M.