From patchwork Mon Apr 8 11:06:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Buddhabhatti, Jay" X-Patchwork-Id: 13620994 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 72D9BCD128A for ; Mon, 8 Apr 2024 11:06:45 +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:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:CC :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=WB4oHiO3ec78M7BcLakKTMbvbIQp0HSNP/vVnMNTZKo=; b=InVJKVNK5+4ct0 HrZOdneFx9INGU8isOObxdcd6dWAkTih8DvI/ZQdkv/UQ1a/MoaTJlo+k5VLQqMYz+TbAX6qg6xSY zUheLuRWaYFgzhs4i/NcdBvSOleEVPBKhQDveeO6bjPpwch9k3pPr2GVKGrOer0rzUiaHu9+JLMUk 7VLvVA7CYIhQD11QDYgWU+QD9XZ/R/SZPKs8vmXlSNjRLbA4pARl92U7GNSfbqoG73NHbmVsYXkhL tQweJ5M1uMkH9VKAeNKoQk5HXj+ySo2dSwE1lUrJRj+4sY3woWdKgLDRdJT64QBCqFTwnM4qlUSbv gsXGoYwhEveOJTJraaeQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtmpb-0000000FL1t-2Bvh; Mon, 08 Apr 2024 11:06:31 +0000 Received: from mail-mw2nam10on20600.outbound.protection.outlook.com ([2a01:111:f403:2412::600] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rtmpY-0000000FL1P-2DvK for linux-arm-kernel@lists.infradead.org; Mon, 08 Apr 2024 11:06:30 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PA6udrud+7FAFGkKeM9ACnt1nm0oCjKcz9NeQe99Y5mGv3wprik3zKIlFBOrwoCQBeU7ax3qg4ioRzzeOEs9lC/tffAu9bSOVcj4oLDn6ZOH+UEeMa7GFH5k9P7WMn5L6vBbuaCposuRzDXXoyjyPJLnumeo2I98mrE8m64LqXn7JnfbwivlgdLpNfVHkqV3PlB0G5UbGu9DVwjlvbTJQ/INcF6X9YcPMeV5YxP/HZhU052YCe2oerB0XqQ2SDJABfFwH97IZtAgPLhTTMsutisEa/6vky8FAfU7wYBH0sMTb6Dn5DhwNg+xJFxN9DKl2/eMOuhsdGD15XWiKUF8ew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=NAj4Hl4Ej3ikJtQd+WA0hhpE8n5LNgIJcXfYekN7Jx8=; b=mt8i5vSi5Xq1MkGjpTbcb7vg4qT3IaWZzYslbMWMK9+xNAdY3+M3Kh+FiFa5Uo9iwRZZ4bLcfSKP3QNmYxy+etnXecwXOAT4HYMiJmbgOvJOaEelYane5kZCZvPdAtIx67o0D1Y37YLS0457d/Pe1yRc13rxzO5M8lmJkwWlON0zELkoG82JWt3W+0amPz9FTENWoH4GhtoimLEGa8bVZ3YrsiiWW4Dd7hgF5bS6Fc3+Y5WFFhZGLf1dxxQewcOYZdTL9x9szOl57/xGIRlql9OrJqd49sqcRkR5vZjCgiB7r3MmFJi4Wat0ap759207sFW6jWUJpuGk9sEbXSh1FA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 165.204.84.17) smtp.rcpttodomain=lists.infradead.org smtp.mailfrom=amd.com; dmarc=pass (p=quarantine sp=quarantine pct=100) action=none header.from=amd.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=NAj4Hl4Ej3ikJtQd+WA0hhpE8n5LNgIJcXfYekN7Jx8=; b=YnJqrUVM2Ovglvjn7ekkXH4dIlr37HYu5E9NfTzM+z3STGjmvss5zOG9sYaxKF8oFByUhjbv8aiw9Mgy5cL5NUDI90lYYPhjrSszGqX7EER5PlQaY9vfKSsZN7W9NrTOT71vZ5KEYbjfzxjMlOCpzFXyu5CEK24SBwbxGEKo5fQ= Received: from DS7PR03CA0136.namprd03.prod.outlook.com (2603:10b6:5:3b4::21) by PH7PR12MB6833.namprd12.prod.outlook.com (2603:10b6:510:1af::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7409.46; Mon, 8 Apr 2024 11:06:21 +0000 Received: from DS3PEPF000099D3.namprd04.prod.outlook.com (2603:10b6:5:3b4:cafe::c0) by DS7PR03CA0136.outlook.office365.com (2603:10b6:5:3b4::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7452.35 via Frontend Transport; Mon, 8 Apr 2024 11:06:21 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=amd.com; Received-SPF: Pass (protection.outlook.com: domain of amd.com designates 165.204.84.17 as permitted sender) receiver=protection.outlook.com; client-ip=165.204.84.17; helo=SATLEXMB04.amd.com; pr=C Received: from SATLEXMB04.amd.com (165.204.84.17) by DS3PEPF000099D3.mail.protection.outlook.com (10.167.17.4) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.7452.22 via Frontend Transport; Mon, 8 Apr 2024 11:06:20 +0000 Received: from SATLEXMB05.amd.com (10.181.40.146) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 8 Apr 2024 06:06:20 -0500 Received: from SATLEXMB04.amd.com (10.181.40.145) by SATLEXMB05.amd.com (10.181.40.146) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.35; Mon, 8 Apr 2024 06:06:19 -0500 Received: from xsjarunbala50.xilinx.com (10.180.168.240) by SATLEXMB04.amd.com (10.181.40.145) with Microsoft SMTP Server id 15.1.2507.35 via Frontend Transport; Mon, 8 Apr 2024 06:06:19 -0500 From: Jay Buddhabhatti To: CC: , , Jay Buddhabhatti Subject: [PATCH] soc: xilinx: rename cpu_number1 to dummy_cpu_number Date: Mon, 8 Apr 2024 04:06:10 -0700 Message-ID: <20240408110610.15676-1-jay.buddhabhatti@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Received-SPF: None (SATLEXMB05.amd.com: jay.buddhabhatti@amd.com does not designate permitted sender hosts) X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DS3PEPF000099D3:EE_|PH7PR12MB6833:EE_ X-MS-Office365-Filtering-Correlation-Id: 2ad92258-5f86-447f-d26a-08dc57bbebe6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: HD7RJdwkG/2mnvujyQCQjlOKyoTzYytJUxqdBoC/vabAlK6OSF/Kxh+M1MMcJbCBaQjVuHFV7Pw7fuEKwdBFUi1lWEP9lYs1h+rXg1AthpOHhv4YI0AVG893vj8uA0jn++qQe69ez/ZxNwoDPd2in3InMoET9rd2StQNIoD/bodE4pPQKz1iSs36xM8Dy2qttjF86Mcg5Cv5mhDOEiyCxgRKjNAjNaB0VsbTlC9d6fIw7TTIMsemU2VOyvnzS6f/z+zkR3BPkgHV+8Bw/rXFH2TpI+vkZxO3DWRTkePUOqQZxGSpYe6Ao1t09d3kT1feGe+SIoKkN6zAcKc6FeKFdlCsMcN4+vb5Eak1t15WxihVGCrOJ7+iuULaqipIUa6tLZab8LpXaTNWuA+Y3jE58oVGsDa0c9OaaRTuvyY2J0Iql623m/zbyO82/RbedL6xDOwZOrB9ZAiHYtCsn6Kn5TodyzNJt6OzuS/EbQKnpXeC/3cHtCD7O46rCKrK26kgajfXBKSLb+wxUu9cmbMZgaeo/n+AU7oQhVEgTcjaeiVG/JhavKCI881uHkgWzArOG96dVlAYlViD+aKXELS7jmlSzMCegGqgApVk8v+ptxKjUwgdSARaP/X9RYpJScsOg+nryitbmwnX6uZkSVRo2uzsXuTCK6Ul8Sr+MEcSMbj5mKdvTCYnnHNWigxeSRLqiUbpv7jC7r7BmkX/u9kRTIjq34sM2To9iLxhfFaM4XHKpV5I/QDmqYCZzFPrSRhi X-Forefront-Antispam-Report: CIP:165.204.84.17;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:SATLEXMB04.amd.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230031)(376005)(36860700004)(82310400014)(1800799015);DIR:OUT;SFP:1101; X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Apr 2024 11:06:20.7260 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2ad92258-5f86-447f-d26a-08dc57bbebe6 X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d;Ip=[165.204.84.17];Helo=[SATLEXMB04.amd.com] X-MS-Exchange-CrossTenant-AuthSource: DS3PEPF000099D3.namprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH7PR12MB6833 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240408_040628_662551_5C8690E0 X-CRM114-Status: GOOD ( 16.90 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org The per cpu variable cpu_number1 is passed to xlnx_event_handler as argument "dev_id", but it is not used in this function. So drop the initialization of this variable and rename it to dummy_cpu_number. This patch is to fix the following call trace when the kernel option CONFIG_DEBUG_ATOMIC_SLEEP is enabled: BUG: sleeping function called from invalid context at include/linux/sched/mm.h:274 in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 1, name: swapper/0 preempt_count: 1, expected: 0 CPU: 0 PID: 1 Comm: swapper/0 Not tainted 6.1.0 #53 Hardware name: Xilinx Versal vmk180 Eval board rev1.1 (QSPI) (DT) Call trace: dump_backtrace+0xd0/0xe0 show_stack+0x18/0x40 dump_stack_lvl+0x7c/0xa0 dump_stack+0x18/0x34 __might_resched+0x10c/0x140 __might_sleep+0x4c/0xa0 __kmem_cache_alloc_node+0xf4/0x168 kmalloc_trace+0x28/0x38 __request_percpu_irq+0x74/0x138 xlnx_event_manager_probe+0xf8/0x298 platform_probe+0x68/0xd8 Fixes: daed80ed0758 ("soc: xilinx: Fix for call trace due to the usage of smp_processor_id()") Signed-off-by: Jay Buddhabhatti --- drivers/soc/xilinx/xlnx_event_manager.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/soc/xilinx/xlnx_event_manager.c b/drivers/soc/xilinx/xlnx_event_manager.c index 253299e4214d..366018f6a0ee 100644 --- a/drivers/soc/xilinx/xlnx_event_manager.c +++ b/drivers/soc/xilinx/xlnx_event_manager.c @@ -3,6 +3,7 @@ * Xilinx Event Management Driver * * Copyright (C) 2021 Xilinx, Inc. + * Copyright (C) 2024 Advanced Micro Devices, Inc. * * Abhyuday Godhasara */ @@ -19,7 +20,7 @@ #include #include -static DEFINE_PER_CPU_READ_MOSTLY(int, cpu_number1); +static DEFINE_PER_CPU_READ_MOSTLY(int, dummy_cpu_number); static int virq_sgi; static int event_manager_availability = -EACCES; @@ -570,7 +571,6 @@ static void xlnx_disable_percpu_irq(void *data) static int xlnx_event_init_sgi(struct platform_device *pdev) { int ret = 0; - int cpu; /* * IRQ related structures are used for the following: * for each SGI interrupt ensure its mapped by GIC IRQ domain @@ -607,11 +607,8 @@ static int xlnx_event_init_sgi(struct platform_device *pdev) sgi_fwspec.param[0] = sgi_num; virq_sgi = irq_create_fwspec_mapping(&sgi_fwspec); - cpu = get_cpu(); - per_cpu(cpu_number1, cpu) = cpu; ret = request_percpu_irq(virq_sgi, xlnx_event_handler, "xlnx_event_mgmt", - &cpu_number1); - put_cpu(); + &dummy_cpu_number); WARN_ON(ret); if (ret) { @@ -627,16 +624,12 @@ static int xlnx_event_init_sgi(struct platform_device *pdev) static void xlnx_event_cleanup_sgi(struct platform_device *pdev) { - int cpu = smp_processor_id(); - - per_cpu(cpu_number1, cpu) = cpu; - cpuhp_remove_state(CPUHP_AP_ONLINE_DYN); on_each_cpu(xlnx_disable_percpu_irq, NULL, 1); irq_clear_status_flags(virq_sgi, IRQ_PER_CPU); - free_percpu_irq(virq_sgi, &cpu_number1); + free_percpu_irq(virq_sgi, &dummy_cpu_number); irq_dispose_mapping(virq_sgi); }