Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp56112rwd; Wed, 24 May 2023 14:05:53 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ69ZLtqxWLvI+3eJ78Wj8HLrE+iIjI0Q/NwtFOTn0CHWSCyXmmEgT0f2uN9xGS3n6qg6bLT X-Received: by 2002:a17:90a:af96:b0:253:5375:bf57 with SMTP id w22-20020a17090aaf9600b002535375bf57mr17985225pjq.26.1684962352950; Wed, 24 May 2023 14:05:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684962352; cv=none; d=google.com; s=arc-20160816; b=zLL93sINI6ZARoWD2UYYtoyxITW8ILauDOauxfDBOy5uDbCtnLwtdhhSv2NEvfZA5k Zh236sOy0/A0UJ0WtkQumQuyUoA9zyYpOU2sOsbvkdGLWNOl+3fB2ehUPYJhqa5iJs8Q 8msh33vbEDEmSb925dCQZzi928Ci6XIGI6b3M08N2xDwyuCfP4WnPOWVhg7ZI1YCfdv+ goVEV4vEKwA0iGYmYhN7Qv53SuqfkWKnQamyBKSXrkPPr71Xf0rRQWTdcMd7rq1VIrq5 EzBH3SDuTJ08X7P8qxltXTghiGD6t2wixD2xrk+P5Qav3benLq84wkEk/1X28Gnkg/PY ohug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:ui-outboundreport:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature; bh=sQppQ4JQ59Sfs35qSYrAPZqh5+t44SyiJWzmgwherSs=; b=OT+aaBu6IRrWbQfHvGqFFao6bIEHpiqyoMgd1oQ+hbaFDhsQvKFmWzKkKjAcNbvnTE bIe0lC3J3e2ltuJNfKyqlG8iPztMHAgOPGQsJS6MRFzlxW/wpVsfCG/Z/8Wd1e0TeljM 3Lgkch6f4U0jmJgoi2TRGBlMbPYHeSSC4rNZDlYybfNx++a9PNvfWToC0d9U3JznHKw/ mmVNMMo6VodKaM5tB7a2HtNx8rxvya3S0rY7fe+CJdZNHue3d+0yWxPCo2MVKyKemxjJ zv+AVkLA/hARl+7r6uXSg7of6ntriJqISmjg2JHUdt1AbkKIMnq8AFfIGEfSLHBY0TBw KqXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=axf4bK2R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m19-20020a17090aab1300b00252fc82b3afsi1935761pjq.128.2023.05.24.14.05.37; Wed, 24 May 2023 14:05:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmx.de header.s=s31663417 header.b=axf4bK2R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=gmx.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231658AbjEXU47 (ORCPT + 99 others); Wed, 24 May 2023 16:56:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48698 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229646AbjEXU46 (ORCPT ); Wed, 24 May 2023 16:56:58 -0400 Received: from mout.gmx.net (mout.gmx.net [212.227.15.19]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA11812E; Wed, 24 May 2023 13:56:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de; s=s31663417; t=1684961802; i=deller@gmx.de; bh=RuuhT55mt/C93pVbMB7MjnuUe2g516L6GXgAlvUtRiU=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=axf4bK2RwknNKEo9wlfHGam2vXSUuNWZ9HB/E3JM/oKf6SZhG1+sPs4aCFvUkN8yY xqfHxoIaB2X+Ej9TvB3POBXUIAaMpXIhrbekBCElDKfebvtTpNz/ILs07IwxBXm/Ti +8J6SZA1hsAdq5g1OmnoAy8aTCsBLlwc+fSOY8PFe9/e9tcJwnGBtCm4Jv0Vtfg6eW uxmaFjrTs+UU/mOAgCA8ujBkEwTk58bkB3H77DK6sYEhJXmrc7GwfpW6g+wFmwIUq1 FFbyaoIkG7xgAzHOx0ugj0vD1OBEJFTPNwsyHLWI1emkyVhnMKVji0Ri8Rlg8r1ORi D/Ie7ZZNAJYOw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from [192.168.20.60] ([94.134.145.4]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MNbkv-1pm9q502x9-00P4JO; Wed, 24 May 2023 22:56:42 +0200 Message-ID: Date: Wed, 24 May 2023 22:56:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH 1/3] arm: Fix flush_dcache_page() for usage from irq context Content-Language: en-US To: Arnd Bergmann , Russell King , Dinh Nguyen , linux-kernel@vger.kernel.org, linux-parisc@vger.kernel.org Cc: linux-arm-kernel@lists.infradead.org References: <20230524152633.203927-1-deller@gmx.de> <20230524152633.203927-2-deller@gmx.de> <3e131821-7665-47f0-a8a6-44b3e4d7a88a@app.fastmail.com> From: Helge Deller In-Reply-To: <3e131821-7665-47f0-a8a6-44b3e4d7a88a@app.fastmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:NzLqJJsu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V PgDfFLH1w2e/B2uBRiHlIaD52ntZk3rEj8VrSYp+fPXte9tE60PmnSARrriOyY9UCY7UqGYhX JgB+DLn4zzHf+WR5I52GzqEXMFCqRWaLVyInZYliPua4SA/VGb7ojYTi7ojmMVzqyP4nDFLwu 1QmtAQ== X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/24/23 22:00, Arnd Bergmann wrote: > On Wed, May 24, 2023, at 17:26, Helge Deller wrote: >> Since at least kernel 6.1, flush_dcache_page() is called with IRQs >> disabled, e.g. from aio_complete(). >> >> But the current implementation for flush_dcache_page() on ARM >> unintentionally re-enables IRQs, which may lead to deadlocks. >> >> Fix it by using xa_lock_irqsave() and xa_unlock_irqrestore() >> for the flush_dcache_mmap_*lock() macros instead. >> >> Cc: Russell King (Oracle) >> Cc: Arnd Bergmann >> Cc: linux-arm-kernel@lists.infradead.org >> Signed-off-by: Helge Deller > > Cc: stable@vger.kernel.org > Reviewed-by: Arnd Bergmann Thanks! I assume it's picked up in the arm git tree then. > From what I can tell, the behavior in aio_complete has been > there for over 10 years, since 21b40200cfe96 ("aio: use > flush_dcache_page()"). Oh, then those arches are broken since then. > Others may have done the same already back then. > > I also see you sent patches for nios2 and parisc, but not > for csky, which appears to need the same thing. csky doesn't use flush_dcache_mmap_lock() inside it's flush_dcache_page() function, so I think it's not affected. Helge