From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f170.google.com (mail-pl1-f170.google.com [209.85.214.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5243F194C85 for ; Sat, 14 Dec 2024 17:26:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.170 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734197208; cv=none; b=aNk60qNDiJQCL1bzdX+G0iD1U9hXsfhTxvvVaNMRW/EIBLsJHEadEM4oRDoTKesx3ZrrwrKkE+DGhLQhye3DWOkdH26nfbKjYNDV07qU6GWnLnNrRvkpzOzZNRtvS4585F7C0E0hmTJRkEf2iVEhg9cAxDAHJHxHbvdktSWFr/o= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734197208; c=relaxed/simple; bh=KQvgHMf4mn/NJ5Xhw6rUHo6j+G4++aBmhNInEZUS85A=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=RSNXVP+v2NqgZyjQLLNote34tuL/3uYjAoJQTvbS+9CeAYBMJQkng3bg9VxyuUc+y5U0rhexTnwFFoNFunxA5rrYjad/aAJxtYziA1DRK9t02zAqMXpSPKzWx7rRBNxwJOwKR3VIjFt3OcKGioWMzZr5A8pWob/tb9Tqp08YhXE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com; spf=pass smtp.mailfrom=ventanamicro.com; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b=LPkOXNDk; arc=none smtp.client-ip=209.85.214.170 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ventanamicro.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ventanamicro.com header.i=@ventanamicro.com header.b="LPkOXNDk" Received: by mail-pl1-f170.google.com with SMTP id d9443c01a7336-2164b1f05caso26267375ad.3 for ; Sat, 14 Dec 2024 09:26:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1734197207; x=1734802007; darn=lists.linux.dev; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nBJthI+mqNYzorludLEAXvfiuDja+LCnD6djvnBek6Y=; b=LPkOXNDkKTPGM6GU2f1BylKoeJAFEScKcgivcR8ta6Pk2dMmuDaPU4zM0L9QHraQW9 dmmSvhyS65zuzbzvyHqgfkkFNFXd3YLZq/UDGL9Wa1d9e1y/PXt1p3W46SIDWq5q6Pwz GwMtGK8hq2UR5eyTW+9XGYvmzsMk9Ji1dyEmIqu8XFwnR7Kk3v6Vblt7t6hCGRbx0IYC q9hSRiEK5QTahX1ShOEnLULtqKCOZMuEyfTWkj+572pXZDPq284uXVQAL4vjbHRYplKA csjKj3mUxlELKiSST87Uht4qeIaxlKMjf8AkoL3vJF48DehoigOgDSFVMHO5oYPlJKTg z+9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734197207; x=1734802007; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nBJthI+mqNYzorludLEAXvfiuDja+LCnD6djvnBek6Y=; b=nuGEjvUAY8pEB02406Dy0G4Q0oM5NC4qnQGnXxJsYFe//r9DLdbD9Y3voc72QvWg3I AoGXi3HskHxT6tOI9T/xu5vZ9DCp0OTX49E1BrrsmZ0grVmbDF44ZXTfIMo7i7tZw4W/ WetKbKzLJ713FuwV++BSRe9/XWsEM3RPAfT0CoXi6Z7IowgXIwlOAJqBUAYjS5mrmq6z fzPAwJGbffiDMETjbKY8F/3GJVveK1usQ2qksCom/ZJolk6POkiWzb8QswxRlk/fZr1O PLMIiD+FYlut11lMimPq9Ix7ETuBUZH3p6gjg/I5HF47AsrHrLMXoUMPwDCc7Sm3i570 R7gQ== X-Forwarded-Encrypted: i=1; AJvYcCWBH92uctfWfQWVVq4RLjjEfrX37UAEnwColBQjOX1+XbmT2/eJqc7Zep18Y2sWNOJ7U3s=@lists.linux.dev X-Gm-Message-State: AOJu0Yw5kITQ8yBPamFGURekDAj1sIMfE4qmBwvm/h9OZkdetXQ6bJrN walYoIvqQA7CPIEDGvPBqzBiJLljzSKyqgH8A6C4/fr5aeITiQqdb2f3Jcni5ek= X-Gm-Gg: ASbGncuDvkJBbgY7tnhiddLfRpFPFN9d01LB8GyYEW+HWQH2xCPtUfyAOsxlixMIt16 o0/SdRv5AWO5wevWWP2bTmJaCLLhT4VKPIl4q6faaxLQdCkXIcCrO6hBOxOc53vnHLXEN/cnQDq JiqzwZeo2YTYYn0YVo4wLbHHU6dvRAAoZat2ajT4nZS6L6yMe8fE0Q+oPWdWbLcxUkliSYuYNvp /EH3glx0OG4AnnCCNiVaxD5aXb1+xcxGF11epLFtU4YeQl1y2K/U12vu3gXQR8PfYYb/lIAi4b9 NzMITJm+yNZZ9wk= X-Google-Smtp-Source: AGHT+IHWMVLk7VAHEJKffclkR/GgfiztR1cE76mj+f0onDTerIF7KBl2vajNkAVkEerHi9sn/JzVIA== X-Received: by 2002:a17:902:ccd0:b0:216:3466:7414 with SMTP id d9443c01a7336-21892a41a9dmr113376145ad.44.1734197206669; Sat, 14 Dec 2024 09:26:46 -0800 (PST) Received: from localhost.localdomain ([223.185.132.246]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142f9e186sm5049811a91.41.2024.12.14.09.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2024 09:26:46 -0800 (PST) From: Anup Patel To: Thomas Gleixner Cc: Marc Zyngier , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Andrew Lunn , Gregory Clement , Sebastian Hesselbarth , Palmer Dabbelt , Paul Walmsley , Atish Patra , Andrew Jones , Sunil V L , Anup Patel , linux-riscv@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, imx@lists.linux.dev, Anup Patel Subject: [PATCH v2 06/11] genirq: Introduce common irq_force_complete_move() implementation Date: Sat, 14 Dec 2024 22:55:44 +0530 Message-ID: <20241214172549.8842-7-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241214172549.8842-1-apatel@ventanamicro.com> References: <20241214172549.8842-1-apatel@ventanamicro.com> Precedence: bulk X-Mailing-List: imx@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit The GENERIC_PENDING_IRQ requires an arch specific implementation of irq_force_complete_move(). At the moment, only x86 implements this but for RISC-V the irq_force_complete_move() is only needed when RISC-V IMSIC driver is in use and not needed otherwise. To address the above, introduce common weak implementation of the irq_force_complete_move() which lets irqchip do the actual irq_force_complete_move(). Signed-off-by: Anup Patel --- include/linux/irq.h | 5 +++++ kernel/irq/migration.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/include/linux/irq.h b/include/linux/irq.h index b689c8fe8d60..509c0ee4ef38 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -496,6 +496,7 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) * @ipi_send_mask: send an IPI to destination cpus in cpumask * @irq_nmi_setup: function called from core code before enabling an NMI * @irq_nmi_teardown: function called from core code after disabling an NMI + * @irq_force_complete_move: optional function to force complete pending irq move * @flags: chip specific flags */ struct irq_chip { @@ -547,6 +548,10 @@ struct irq_chip { int (*irq_nmi_setup)(struct irq_data *data); void (*irq_nmi_teardown)(struct irq_data *data); +#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ) + void (*irq_force_complete_move)(struct irq_data *data); +#endif + unsigned long flags; }; diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c index eb150afd671f..2920024475a3 100644 --- a/kernel/irq/migration.c +++ b/kernel/irq/migration.c @@ -5,6 +5,15 @@ #include "internals.h" +void __weak irq_force_complete_move(struct irq_desc *desc) +{ + struct irq_data *d = irq_desc_get_irq_data(desc); + struct irq_chip *chip = irq_data_get_irq_chip(d); + + if (chip && chip->irq_force_complete_move) + chip->irq_force_complete_move(d); +} + /** * irq_fixup_move_pending - Cleanup irq move pending from a dying CPU * @desc: Interrupt descriptor to clean up -- 2.43.0 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B6E90E7716A for ; Sat, 14 Dec 2024 17:33:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=AIhQbkKMsggENuXCldM3e+TFKDOO/AK14bSwFlRsaGg=; b=W9PGgj30pCt8mI GThXhDi5WtIaR9W8v2eU3WDSuhuzcwAFbMdF4LNN7WW+P89oLLanEL89QnY1B312gQsYdpGYpIyoP IV4rsfvjw2eYg29EMHqV/4oJhqjeEp9G6U2Xj+hhSwks2zwRgH+GL6M91VuJVkmlmZiQzyW9wPyFO an456HyjJjykuSeyjYl4bzw6R8D7foIuJgcq8hqB0I5RzalEDFLTBd3Ooxh5kKWPHY6P0tOXU9smf 9f86nHtbGVKgpGlm3Iix1XB840er+NtkWOayuitceoSBG+Uk4O6RJD0aST5BZ5RKQ8YpZCXon24S5 ElT9zD4TJjEivg6xh+qQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tMW1a-00000006hwo-1B1A; Sat, 14 Dec 2024 17:33:54 +0000 Received: from mail-pl1-x62b.google.com ([2607:f8b0:4864:20::62b]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tMVuh-00000006gSW-3ePB for linux-riscv@lists.infradead.org; Sat, 14 Dec 2024 17:26:49 +0000 Received: by mail-pl1-x62b.google.com with SMTP id d9443c01a7336-2161eb94cceso18955645ad.2 for ; Sat, 14 Dec 2024 09:26:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ventanamicro.com; s=google; t=1734197207; x=1734802007; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=nBJthI+mqNYzorludLEAXvfiuDja+LCnD6djvnBek6Y=; b=XwD75bzjtZC0hcFt552Ed3Cwu2pjC74+4d2/k2A4NzxeKzmUaqnHjUAyEB31QZVDfe 3eEMLwyqjFqN/AFGGwcW8/ZWE5u7OQDLxsN9U8zt8PFIpWLQ0xxBlFeMHU+tInxEzXqV MVVkhGBi5PqoMOLTrpDZVnWVmF0R3096yQuRuJeRr0m/ZeaFoGhPaWj487SxbPN4g0fG 7oja0C2imIloG30z+vXbjb7w0NhaPmgkCkvdPpt13SBGMzMVDoopT2a5qKZMRcWpqJVe YKMLwMBZ2tHLrreVHPyPZcCBMtb730aIse06wHLyM7Jak6eOiIkiaw+vTODEXvmM8JrW 75wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1734197207; x=1734802007; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=nBJthI+mqNYzorludLEAXvfiuDja+LCnD6djvnBek6Y=; b=oQXoqD63FbAcmqEZmnMPBAgJqFOJEgfIRizIJ90zfugqZblrewD+3hwGq9VGcYSKp2 HdFDPMXK9Bdc6dkv3LWfJxCAftB1DR9tRLVnCe8z+QWp4PDJ7Sjkb+Tkap9dkBq/MKQb 43/IJ6TPvz+5H+IIxETOWczVGSQ+fWGjGgmMO2RAuEmumMJxUBKM45r0YPS0W+BIu1oT snT+cecOgxylbgvC0nwE0ahkluHK8WrVamqqRvQsohS0/xE2FVSW6CB9qUVTkXp09SCu zBM4tuQjXj8dLuWPBaXU5P2yEK1rfQu3pd2j335J48jm2DDXhE9LdJIUDE6UwNzhTc+8 yjZw== X-Forwarded-Encrypted: i=1; AJvYcCUYSwXt1rEe8Ghk/DgmTLlwJASC19DBqJc0snS+Z+J2lUICyeF9AAaOlUJ+rzbVcXrlPKWKonslCAxFWA==@lists.infradead.org X-Gm-Message-State: AOJu0YzNBvd2lU723o+tU2JPC6aMWpQfw3WgMAc9OY9mxx5v2cU7Beyx FstpXrmrHnwHpQU+9OXF/Nu8RF0Aq7lEfERy+DH7G17tVzt2hUPI8rP+Vmes/+s= X-Gm-Gg: ASbGncvmy01z5j7aV6lJFTs7jVUS0BWEmSq/XonX+Eg7H0HpCmgDm/XSBEHTqSpeNjN 8ntC4nRUS+OPirnM8S5hyswvRwR4Q9ADDGEMBQgGz+wv+d33aMqjUKW/H57uWvmXiyS84Aj35v9 O2ZpXR1DUOEyXz2QebU4KM/qZQKJ3/yG0vaG33E5zh4RvTQG8JkdzyiEWhXJYRZ9YwnNLeExnY2 I3k7XlpBOKZBW8EfM6k5dRs9ak0FD+ms9y/dDH3bai9IKNr7i4f8BD4wiPJhSeAX5eyCMbZa+3J 2MVAV9cgID0xvnQ= X-Google-Smtp-Source: AGHT+IHWMVLk7VAHEJKffclkR/GgfiztR1cE76mj+f0onDTerIF7KBl2vajNkAVkEerHi9sn/JzVIA== X-Received: by 2002:a17:902:ccd0:b0:216:3466:7414 with SMTP id d9443c01a7336-21892a41a9dmr113376145ad.44.1734197206669; Sat, 14 Dec 2024 09:26:46 -0800 (PST) Received: from localhost.localdomain ([223.185.132.246]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2f142f9e186sm5049811a91.41.2024.12.14.09.26.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Dec 2024 09:26:46 -0800 (PST) From: Anup Patel To: Thomas Gleixner Subject: [PATCH v2 06/11] genirq: Introduce common irq_force_complete_move() implementation Date: Sat, 14 Dec 2024 22:55:44 +0530 Message-ID: <20241214172549.8842-7-apatel@ventanamicro.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241214172549.8842-1-apatel@ventanamicro.com> References: <20241214172549.8842-1-apatel@ventanamicro.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241214_092647_958083_59BE1B90 X-CRM114-Status: GOOD ( 11.38 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anup Patel , Andrew Lunn , imx@lists.linux.dev, Marc Zyngier , Sascha Hauer , Atish Patra , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, Palmer Dabbelt , Pengutronix Kernel Team , Paul Walmsley , Anup Patel , Andrew Jones , Shawn Guo , Gregory Clement , linux-arm-kernel@lists.infradead.org, Sebastian Hesselbarth Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org The GENERIC_PENDING_IRQ requires an arch specific implementation of irq_force_complete_move(). At the moment, only x86 implements this but for RISC-V the irq_force_complete_move() is only needed when RISC-V IMSIC driver is in use and not needed otherwise. To address the above, introduce common weak implementation of the irq_force_complete_move() which lets irqchip do the actual irq_force_complete_move(). Signed-off-by: Anup Patel --- include/linux/irq.h | 5 +++++ kernel/irq/migration.c | 9 +++++++++ 2 files changed, 14 insertions(+) diff --git a/include/linux/irq.h b/include/linux/irq.h index b689c8fe8d60..509c0ee4ef38 100644 --- a/include/linux/irq.h +++ b/include/linux/irq.h @@ -496,6 +496,7 @@ static inline irq_hw_number_t irqd_to_hwirq(struct irq_data *d) * @ipi_send_mask: send an IPI to destination cpus in cpumask * @irq_nmi_setup: function called from core code before enabling an NMI * @irq_nmi_teardown: function called from core code after disabling an NMI + * @irq_force_complete_move: optional function to force complete pending irq move * @flags: chip specific flags */ struct irq_chip { @@ -547,6 +548,10 @@ struct irq_chip { int (*irq_nmi_setup)(struct irq_data *data); void (*irq_nmi_teardown)(struct irq_data *data); +#if defined(CONFIG_SMP) && defined(CONFIG_GENERIC_PENDING_IRQ) + void (*irq_force_complete_move)(struct irq_data *data); +#endif + unsigned long flags; }; diff --git a/kernel/irq/migration.c b/kernel/irq/migration.c index eb150afd671f..2920024475a3 100644 --- a/kernel/irq/migration.c +++ b/kernel/irq/migration.c @@ -5,6 +5,15 @@ #include "internals.h" +void __weak irq_force_complete_move(struct irq_desc *desc) +{ + struct irq_data *d = irq_desc_get_irq_data(desc); + struct irq_chip *chip = irq_data_get_irq_chip(d); + + if (chip && chip->irq_force_complete_move) + chip->irq_force_complete_move(d); +} + /** * irq_fixup_move_pending - Cleanup irq move pending from a dying CPU * @desc: Interrupt descriptor to clean up -- 2.43.0 _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv