Received: by 2002:ab2:7b86:0:b0:1f7:5705:b850 with SMTP id q6csp1293555lqh; Mon, 6 May 2024 03:22:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXk440AK1hl0DvtEN+pUkLbU/lT2vKslFBJRon0EiFE72ePhlN348EmfHq6sNfRTQE9LFwNPuCM5ZzEN88mcKe4sM32krrrBSbNdA8Fhw== X-Google-Smtp-Source: AGHT+IE52QLbnBZtlky5XSPwZxYo9NJWvOshz+ptmv0RnJPxxGO2RdytDs4Wu5uYP7dXH9qlH7UM X-Received: by 2002:a05:6a00:2391:b0:6ea:f392:bce9 with SMTP id f17-20020a056a00239100b006eaf392bce9mr11045397pfc.15.1714990965276; Mon, 06 May 2024 03:22:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714990965; cv=pass; d=google.com; s=arc-20160816; b=0dj9lSS3S59RhZfYytBjz6JgO0A086BQnVM1DPq092ldHPZ6jEgdGU/oPa4KDZTZoh YIwxxhDhstoxox+0sBFExcuvgU358JWO1mPYShTldqxhUHsquicjjJvCdXUsceqVMuGR dlJO2sR1xaWso2JcggN8/s+OgzSK8llgbVjpStC2Xu/imunHyUXmD34CqO+5EZhC/S2m vINGYLPQ1yfuKlm7ch2WSbHrQ8IPA5jPDudAs+5b8aTay+oUevbmUKGu8+hF/FZebAKs 5wM2efAw73yGpX3a6e5Xe4KH9DfkDPUqS3p7J6oh8l9UWI//gp18gGhkgo0J2civyk42 J5Gw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=odPYvvukVUIG4z0+MLciC4/SrbCeCrd+21yQf+cBaO8=; fh=hWkJ2M6PIbBR6j9OXVgFUd4/GBbBzFUf0mcuXVvH2u4=; b=BJj1T/fbBttvFMwhwAxXmd7knvqYOGRNUVYsgBbT1vD7110qU4WEbXvwNnC3rcWWyu x5EHv3as4zQzzWAvR+Ms6hXAMAlaY6FQO0onGGVeING1FWJznwUTWY4A68v0xi74fklb ZGRkscIzJxGgBH1z7NaBYF/vsHA8S6zDPKXte2OV4nSUmyf47I+XqIZZwtdsen0WPftQ VnLRhbnoZFmntCj0O/FjQ7Y/MYqRgHPQbPTHUjOvJcKurEWRdpRg8278GGFOjd5+gTp9 41NBGJ/X+Gxmgz+XVqXd8qoTmuWB4cq0t6RPAGAD0m92f4zFV0V/dUtDxqD8HU8eVwgW QrSQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=gY0DU4cb; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-169662-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169662-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id c66-20020a633545000000b0061c2f4c8265si6999868pga.784.2024.05.06.03.22.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 May 2024 03:22:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-169662-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=alien8 header.b=gY0DU4cb; arc=pass (i=1 spf=pass spfdomain=alien8.de dkim=pass dkdomain=alien8.de dmarc=pass fromdomain=alien8.de); spf=pass (google.com: domain of linux-kernel+bounces-169662-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-169662-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 807F4281324 for ; Mon, 6 May 2024 10:22:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 473AA142E74; Mon, 6 May 2024 10:21:00 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b="gY0DU4cb" Received: from mail.alien8.de (mail.alien8.de [65.109.113.108]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 342BE142E84; Mon, 6 May 2024 10:20:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=65.109.113.108 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714990859; cv=none; b=OAXeUf2xHbUGk0p67sQHw2IJe/3iRQC8y6ZTFLiz+c8JcjckPc1DeTa+OI48VLh+exYY48m3s5AwpAKzhaYhql7ed0rPRjnc+0DvU2n4tIW63hFHISdPJvWdSu/Ivmm7u+N5LNC+yJ0N8OCcmwPOC0+9h+KhQoSofO4HJL/rTUY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714990859; c=relaxed/simple; bh=8Wao3gYt+CEW0SQpRQ9Ae4PaD9ogSMaZly8/ad2PMEw=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Esjbqf16EvaJwO2oWPkuhnRuBoXnkIaOxaC2Y5Vpe2eE8GyCExuQZSQzmFCbesyCOXj0EtWT1AunXN1eT0zirhSWtzSRaGlWxWcJ1lEAavmgWDufO4pfbjY5Drr2TRXfxhEFbPu9El5FAbHRUSanFXlbOxyhbOUHvfr1nPKJN0Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de; spf=pass smtp.mailfrom=alien8.de; dkim=pass (4096-bit key) header.d=alien8.de header.i=@alien8.de header.b=gY0DU4cb; arc=none smtp.client-ip=65.109.113.108 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=alien8.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=alien8.de Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTP id BD8BC40E0244; Mon, 6 May 2024 10:20:54 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at mail.alien8.de Authentication-Results: mail.alien8.de (amavisd-new); dkim=pass (4096-bit key) header.d=alien8.de Received: from mail.alien8.de ([127.0.0.1]) by localhost (mail.alien8.de [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id I9DzhHUcwK8X; Mon, 6 May 2024 10:20:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=alien8; t=1714990851; bh=odPYvvukVUIG4z0+MLciC4/SrbCeCrd+21yQf+cBaO8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=gY0DU4cbRvFTSoxpiTlfTVOTkP+9+SH8Tyh9lzAouNZOYkQSFzbyYkYUSgMUtMXWX 35RXTvCuYMsgpfsmoL+0mU8aVAmvqKJnmSsum74GMZ+Tlrr/Fvga824Rmyi26nrCOq bgkx6mjQG/v4L1MIMq9dLbzzzK49QWyqe0hR6+/wybPZ3RFwgVV018H3zDMUOk/vbZ Q4JEPzaWamPaHCyHNLdLAB2x/jlEoxjStM1AjxFiQnfC96fEewpPZAPM8eX4jx8LTM pCgUvulnBwbtIYimuz0Peye2I0IZmEyFaVlagJAkB7Eop2iBn8o0dazywd4KDnEv5b ABhFhmn2DcgqtdE2yU3bnuZkirsU7f50hStyIM8AsmOfxW+wbianqsd7gVm+3dyjZs 9ZBt9d3QTKSkKYydwSFqbNW0BrJIJD7+PT1YvmwY8GZuEAP6s6nbiGtMBIbPdTW8ax b8sRVLsXsCrHIM1y0mFCklMD4BD5+lrRffNDZ9Xm87o3lg/yJWwnrRLODiRkvYfrUU ScCRTRrl1KBttUtgopsfi3Ut49sbdagHUVlHPCrNBJeHBuqFv/j8SiAS2Psx5Fn/kV 6DFhsTL40tlVOLIhi8o7a7JnnIIw1U4S3MYHE8ir8mONhFPCBvzQJuFZ6UEQw7hBwP ZWH1rXtXq2oPPay4PF9wTrqo= Received: from zn.tnic (pd953020b.dip0.t-ipconnect.de [217.83.2.11]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature ECDSA (P-256) server-digest SHA256) (No client certificate requested) by mail.alien8.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 29AE340E01E8; Mon, 6 May 2024 10:20:35 +0000 (UTC) Date: Mon, 6 May 2024 12:20:29 +0200 From: Borislav Petkov To: Serge Semin Cc: Michal Simek , Alexander Stein , Tony Luck , James Morse , Mauro Carvalho Chehab , Robert Richter , Dinh Nguyen , Punnaiah Choudary Kalluri , Arnd Bergmann , Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org, Sherry Sun , Borislav Petkov Subject: Re: [PATCH v5 01/20] EDAC/synopsys: Fix ECC status data and IRQ disable race condition Message-ID: <20240506102029.GGZjiu7TKP9FVp-2Sb@fat_crate.local> References: <20240222181324.28242-1-fancer.lancer@gmail.com> <20240222181324.28242-2-fancer.lancer@gmail.com> <20240415183616.GDZh1zoFsBzvAEduRo@fat_crate.local> <20240421100712.GAZiTlUOm1hrLQvaMi@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: On Thu, Apr 25, 2024 at 03:52:38PM +0300, Serge Semin wrote: > Even if we get to add the spin-lock serializing the ECCCLR writes it > won't solve the problem since the IRQ-disabler critical section could > be executed a bit before the IRQ-handler critical section so the later > one will just re-enable the IRQs disabled by the former one. > > Here is what is suggested in my patch to fix the problem: > > IRQ-handler | IRQ-disabler > | > zynqmp_get_error_info: | > | lock_irqsave > | ECCCLR = 0; // disable IRQs > | unlock_irqrestore > lock_irqsave; | > tmp = ECCCLR | clear_sts_bits; | > ECCCLR = tmp; | > unlock_irqrestore; | <--- I'm presuming here the IRQ-disabler will reenable interrupts at some point? Otherwise we have the same problem as before when interrupts remain off after the IRQ handler has run. Other than that, yes, I see it, we will need the locking. Thanks for elaborating. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette