Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp3953981rdb; Mon, 11 Dec 2023 05:06:53 -0800 (PST) X-Google-Smtp-Source: AGHT+IFAcXcZk/Vcru+JsgH7tLIqfEfjrSYa1afCY26uvktf08R66b6wLDzl4Q4ft5VdE7uOU8aR X-Received: by 2002:a05:6a20:918b:b0:18c:8afc:cdd2 with SMTP id v11-20020a056a20918b00b0018c8afccdd2mr2079112pzd.17.1702300013417; Mon, 11 Dec 2023 05:06:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702300013; cv=none; d=google.com; s=arc-20160816; b=xzVA1ySBTJ2gHfZKVmnS83oaBC7viqlAFw/L8RAGxteU8USdBwKwRC1M5sQtEPGvZK D9UEPI8ALbAW+6N7DGDz18BP86i7KGANKczPO5tMwqH1suIw7PpyRm4co/K7gI+enLEu ELgF9OmH5xV/oXKdLuZGUAO7r+grSUHBqb4rWXHj7Ga5/CUvdpsSAHru9OfqRfRuK/Z6 wMwhK1DNTBMLUr22t7E8X4MxSJT8cAuGodDWbIBG+hGs6dGeMZ5LxIs53BJE38/lG55O 8zhtzjvutGV5WjtXQa/lUvy17TBk01rRylyslm6cPpRANq3NlVpkfmWGhOGMXug1S7ez ZHGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:to:subject:message-id:date:from:mime-version :dkim-signature; bh=l2+BcaWaIdH2EhxOu9pCW0GPZ5AXB4G6Yke84Ayjtgk=; fh=BDRYN1K/BTasOPw0adnSO58mQFPzEyeZNk/8JRxA8R0=; b=gguWimBTrPLv+aUoZ4JnvPJT7NzoD92EFxJoRYIH92Ik5SAqfG/0T0br1TmSwzWwMH E+bo0m3P7gY7mTY5utfPiHGvbVtNjwlYwAGyJjrhB2LFqOUth0zcZPGmWzoT9hO++A1B lx3wHG3d/sU4/9pLTk/OX5uRg/6cqY5v7CYfemC1XPlDJUFZWCvnlRhamLpmdJDJKbXa L7EXP0KBk9xjvdniEbJXNLGepFMe1Ak3qc386iOgapaho2Y+QrsBc4TwIQECJfe4YDrH 4XWWVKeJcNURA40ybTVMoCcwGbSpmZvnhIrdB8z0CniucQ5b8e71YM8Efcvmrq+J2gW1 162w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ACPPhBIk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id m5-20020a63ed45000000b005b918d9a3c2si6011628pgk.868.2023.12.11.05.06.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Dec 2023 05:06:53 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=ACPPhBIk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 39E368067600; Mon, 11 Dec 2023 05:06:51 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343569AbjLKNGg (ORCPT + 99 others); Mon, 11 Dec 2023 08:06:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234350AbjLKNGf (ORCPT ); Mon, 11 Dec 2023 08:06:35 -0500 Received: from mail-lj1-x235.google.com (mail-lj1-x235.google.com [IPv6:2a00:1450:4864:20::235]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68F5983 for ; Mon, 11 Dec 2023 05:06:41 -0800 (PST) Received: by mail-lj1-x235.google.com with SMTP id 38308e7fff4ca-2ca0c36f5beso56673221fa.1 for ; Mon, 11 Dec 2023 05:06:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702299999; x=1702904799; darn=vger.kernel.org; h=to:subject:message-id:date:from:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=l2+BcaWaIdH2EhxOu9pCW0GPZ5AXB4G6Yke84Ayjtgk=; b=ACPPhBIk+smwBpZpkSFoaJi0+u1sSOSMJBy6vDo0A642P3CwQ5zrJ9HVBbhBruDI1k 9xLXNWjDJ+oGTproZ/+aCD2rDAL5+0VxUD/sMHnw1fbMt7Amx/OpTM5x97UTsUmwQYNo s93lPc/zjklPzDi/DgBCiRGs/kp9OKFgEDRCbD3pB9NLCWflynAEkrV5dRd86HMkl61J UJg+aA3NMvEYpmpBkjZIGBgdYMt6PenkHJkl6vO3mM4AqdHCJGV7EyFZ9JODSRAtmbxB WJvlVzHnv0DLUCQNMKHzoeTPYKDr3ux+TjWWlPgZbVAB9lm/kx8HIGplbvD9qkUVz3hx Lumw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702299999; x=1702904799; h=to:subject:message-id:date:from:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=l2+BcaWaIdH2EhxOu9pCW0GPZ5AXB4G6Yke84Ayjtgk=; b=Pjme2xMUkvCkuuf6Luo4e3fo63tAADpzYshx5x2/ommtbC015BQ4Bx1aFuXBk40myP vDdT3RtyeP972dhD6XDP3xImq3nFz3VyS24j4eAK67CAsOJesv9e6ax3uQZUMTzAj5eY q1vPPVwzDA7+Y7qbccrb09FGMhX4e4WPCHlsk+SU0U3BL0mIr6h3krJjAMBo0R+RgZIe 56xB53AO7SsPDH4yEdvU9srWMVenFMs5GXkk5N1L5DGL+ZQV7FmUEOZdKsuO86WiQvoh JYxWUkBAgvoIk6k++Q6F6k64IWstfUE3+G/zAfYXnPQ0e6JZBlbo0egnawYGpz+SUxdv s/mQ== X-Gm-Message-State: AOJu0YzguE6/2OmVnMCCAMsuJ4+s9XRkpUEm1cHmRbyebqek0sOgAK1A nSJVjpbyEZ8TF9h5LWFDc35W/BKh57i+iNjw22aj91nn3G78xg== X-Received: by 2002:a2e:a103:0:b0:2cc:1dc8:4e96 with SMTP id s3-20020a2ea103000000b002cc1dc84e96mr1531207ljl.24.1702299999354; Mon, 11 Dec 2023 05:06:39 -0800 (PST) MIME-Version: 1.0 From: Ajay Garg Date: Mon, 11 Dec 2023 18:36:26 +0530 Message-ID: Subject: Query on a rare simultaneous processing of interrupts from GIC/NVIC To: linux-arm-kernel@lists.infradead.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 11 Dec 2023 05:06:51 -0800 (PST) Hi everyone. Let's say the following code is shared by multiple ISRs : spin_lock_irqsave spin_lock_irqrestore Also, following sequencing happens : * Low-priority interrupt comes in, and GIC/NVIC causes it jump to ISR. * Low-priority interrupt starts executing "spin_lock_irqsave". * Before preemption and interrupts could be disabled (by the executing low-priority interrupt). high-priority interrupt comes in. Since a higher priority interrupt has come in, the GIC/NVIC causes it to start executing the "spin_lock_irqsave" statement. * Through the low-priority interrupt executing, "spin_lock_irqsave" has completed. Preemption and interrupts are disabled, and low-priority interrupt grabs the spin lock. * High-priority interrupt spins on the spin-lock. Is the above sequencing possible? In other words, although the first interrupt did its best to disable all preemption and interrupts before it could enter the critical section, yet above sequencing *will* cause the high-priority interrupt to spin? Many thanks in advance for your time for help ! Thanks and Regards, Ajay