From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f49.google.com (mail-wm1-f49.google.com [209.85.128.49]) (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 098EC15442C for ; Thu, 16 Jan 2025 17:12:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737047571; cv=none; b=d336qzurUXGHSPaHynocuL2eqd91uvK7Z7EWfHYPuNdcK3crHj7v2CI58cq3jP3jzJwEHL1ydWe5y9//0B68oxw3BSTGxVDVZsrcD68s7uvOGKHZfXK6eXRjtiTnxzM+gxhpc4/IY0aqf6hQOlg65mLv0P5lFbFWNHcJaG4+Vlw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737047571; c=relaxed/simple; bh=Dmj790GXtrBJeTd8Gnje57n46TNqgWZMvXnZSHnMs3s=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=uxZ0bSNQIdSiLWovkNkRmvYHyYMkTL76CdHP1jfXh7tsCbBmlHOos/XX2D601tywBqgbzZ/UB0pt4vslxxgHTqm59LA8Ngzg2clHxaC7lbA003QxcTJM9gOYFCD5G4r40OyOQCorRkuUkY1DWd6OwrOWmc5poBOZlvwstxHNO/Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=Qz3beMja; arc=none smtp.client-ip=209.85.128.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="Qz3beMja" Received: by mail-wm1-f49.google.com with SMTP id 5b1f17b1804b1-435f8f29f8aso7806155e9.2 for ; Thu, 16 Jan 2025 09:12:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737047568; x=1737652368; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=Cw8bDVhWC4DZ7iFBTJuoMnPRKeQXkQkpwuO4pmzE3V0=; b=Qz3beMjaQONZLeqP3s3SLoHAM32J34KDNuw5MqNy6vbo3d7xwQpWeFAA1OQ3dbD+vy htoeqqhm3AQ86aL7hHSG7+0gH4fYRR4/rVtQLR1/qE+jNhmVfcocVfGTwWgZ7kwPc/71 BC4cHnhe8Wnit2+TIl50+kkKnyLWEHlAqtkbJLN4yWNBdDkkakzgm0aTJTrPyuo6Qydk CaCSWh0+6zmcpwRQypqO3HxBwMfWy/2wCKZQcwQL2DQulWBjWt2/P60xyj0Mq+5D8u+V Vboq+AMgfAVSnhlRciJ9GjWCOt68u623DIelkcC8CWsFR7HsQev+SQbsMm31yZaALON4 keXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737047568; x=1737652368; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Cw8bDVhWC4DZ7iFBTJuoMnPRKeQXkQkpwuO4pmzE3V0=; b=OLGuXwwXGHHjRmIyfZIY6b7Bi/pYcxBQHCxZM8BJAg1zthJIIDtix0JBV1J4+PIpAq 56GL+p8PXs80KnjZriVqdGfH8tzKHlKiR3LQd7k3gcpZn28PpO0DVjXTBNPQBVegk3bj 6bIlL1B5V1pYKROVTLCCtG8mtuEWtVBBz4B0e0l/aQI7mrvP+khVITSaxEBH075c4+4N 3ST+cjk/sg4Oa6wc6wLOMkrMfMNd6m0jSniq7BQRVFgRB5Po3TMqDKgoyOjBgwfslsb+ UOXKgjpuxMhc9FQv0oFwyLiQHVEsA8iAg29iQYTR1MbQmTiPcb/JRBb1bx5GubqbvnNd v3Rw== X-Forwarded-Encrypted: i=1; AJvYcCWJLi19H0n1m/YcrVumMsLoXMg1cGNUzAvMjDbuEq+fRYn3sZ9UE3GHgV5dk6EwQQ6dKOX++ZlT8yE4geA=@vger.kernel.org X-Gm-Message-State: AOJu0YxxGCGFgPgAOPiguBVnXUR5iSgZqx7iqxsVR9z+Re+lVFTRfROj oz4WkN6vFa8/MqGarTICOT1fdopZKqYNNoyLEmO/urHfMfGTsF4j X-Gm-Gg: ASbGncvQMA8nJuJCwPOXpL8BcYe7vHkOVooZo+xplUq7wwbgSPtC8uApnER0QfPLIO7 XrGRePOK5Cu2tgGVD473O9VIo94eCARfUvjAKLO7X7KbOqkUH6VtIRnjH/sY6j1zD5ZMzQ51z00 lCrbc6khpIzNuy1VtI+Q+pPzpPg4BYLBNmwJqXyrBOWeisIX+7YgKK2bm9ZVMHXDUbrVthBWtqM FN749qmKxwVCZhHfqZ1lS5RwUH8xDoiD4Ty384KFmd8dbE1V4ZyXymG X-Google-Smtp-Source: AGHT+IGtLGwyml6Hx0in5ut9hFjk73RQS7czX4FZAK2dgjkWdVTUUYWRBke716qnI3YVynil/kPGPA== X-Received: by 2002:a05:600c:138e:b0:431:55c1:f440 with SMTP id 5b1f17b1804b1-436e26f5f3fmr348174505e9.30.1737047567988; Thu, 16 Jan 2025 09:12:47 -0800 (PST) Received: from eichest-laptop ([2a02:168:af72:0:6c4e:8d77:c1b7:309e]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-437c7540ae7sm64609915e9.33.2025.01.16.09.12.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 16 Jan 2025 09:12:47 -0800 (PST) Date: Thu, 16 Jan 2025 18:12:46 +0100 From: Stefan Eichenberger To: Thomas Gleixner Cc: andrew@lunn.ch, gregory.clement@bootlin.com, sebastian.hesselbarth@gmail.com, shivamurthy.shastri@linutronix.de, anna-maria@linutronix.de, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1] irqchip/irq-mvebu-icu: Fix irq_set_type for sei and nsr Message-ID: References: <20241217111623.92625-1-eichest@gmail.com> <87frlkcx2b.ffs@tglx> 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=us-ascii Content-Disposition: inline In-Reply-To: <87frlkcx2b.ffs@tglx> Hi Thomas, On Wed, Jan 15, 2025 at 09:15:24AM +0100, Thomas Gleixner wrote: > On Tue, Dec 17 2024 at 12:15, Stefan Eichenberger wrote: > > A regression was introduced in commit d929e4db22b6 > > ("irqchip/irq-mvebu-icu: Prepare for real per device MSI") that causes > > the Armada thermal driver to fail during probe with the following error: > > genirq: Setting trigger mode 4 for irq 85 failed (irq_chip_set_type_parent+0x0/0x34) > > armada_thermal f2400000.system-controller:thermal-sensor@70: Cannot request threaded IRQ 85 > > armada_thermal f2400000.system-controller:thermal-sensor@70: probe with driver armada_thermal failed with error -22 > > > > The issue occurs because irq_set_type is assigned to > > irq_chip_set_type_parent, but the parent IRQ chip does not implement the > > irq_set_type operation. This causes the trigger mode configuration to > > fail. > > > > This patch resolves the issue by removing the irq_set_type assignment. > > With no irq_set_type, __irq_set_trigger safely skips the trigger > > configuration, restoring functionality to the thermal driver. > > I'm not convinced that this is correct. > > The original code had irq_chip_set_type_parent() for the NSR/SEI chips > too and all what d929e4db22b6 does is to convert those chips over to the > new platform MSI mechanism. Here are the original chips: > > static struct irq_chip mvebu_icu_nsr_chip = { > .name = "ICU-NSR", > ... > .irq_set_type = irq_chip_set_type_parent, > ... > }; > > static struct irq_chip mvebu_icu_sei_chip = { > .name = "ICU-SEI", > ... > .irq_set_type = irq_chip_set_type_parent, > ... > }; > > And looking at the potential platform MSI providers for MVEBU, then it > turns out that GICP and SEI both have the irq_set_type() callback > populated, though ODMI has not. So either this has never worked or there > is something else fishy. > > Can you please enable CONFIG_GENERIC_IRQ_DEBUGFS, build/boot a 6.10 > kernel and provide the output of > > cat /sys/kernel/debug/irq/irq/$N > > where $N is the interrupt number of the thermal sensor. > > Then provide the same information for a current kernel with your patch > applied. You are right I somehow didn't look back far enough. I tested once with kernel 6.12.5 and my patch applied: root@localhost:~# uname -a Linux localhost.localdomain 6.12.5+ #157 SMP PREEMPT Thu Jan 16 17:32:21 CET 2025 aarch64 GNU/Linux root@localhost:~# cat /proc/interrupts |grep thermal 35: 0 0 0 0 AP SEI 18 Level f06f8000.system-controller:thermal-sensor@80 90: 0 0 0 0 SEI-ICU-SEI-f21e0000.interrupt-controller:inter 116 Edge f2400000.system-controller:thermal-sensor@70 91: 0 0 0 0 SEI-ICU-SEI-f61e0000.interrupt-controller:inter 116 Edge f6400000.system-controller:thermal-sensor@70 root@localhost:~# cat /sys/kernel/debug/irq/irqs/90 handler: handle_edge_irq device: f21e0000.interrupt-controller:interrupt-controller@50 status: 0x00000000 istate: 0x00004000 ddepth: 0 wdepth: 0 dstate: 0x02400204 IRQ_TYPE_LEVEL_HIGH IRQD_ACTIVATED IRQD_IRQ_STARTED IRQD_DEFAULT_TRIGGER_SET node: -1 affinity: 0-3 effectiv: domain: :cp0:config-space@f2000000:interrupt-controller@1e0000:interrupt-controller@50-16 hwirq: 0x74 chip: SEI-ICU-SEI-f21e0000.interrupt-controller:inter flags: 0x80 IRQCHIP_SUPPORTS_LEVEL_MSI parent: domain: :ap807:config-space@f0000000:interrupt-controller@3f0200-2 hwirq: 0x0 chip: CP SEI flags: 0x0 parent: domain: :ap807:config-space@f0000000:interrupt-controller@3f0200-5 hwirq: 0x15 chip: SEI flags: 0x0 And then with kernel 6.10.14 without any patches: root@localhost:~# uname -a Linux localhost.localdomain 6.10.14 #1 SMP PREEMPT Thu Jan 16 17:52:59 CET 2025 aarch64 GNU/Linux root@localhost:~# cat /proc/interrupts |grep thermal 35: 0 0 0 0 AP SEI 18 Level f06f8000.system-controller:thermal-sensor@80 90: 0 0 0 0 ICU-SEI 116 Edge f2400000.system-controller:thermal-sensor@70 91: 0 0 0 0 ICU-SEI 116 Edge f6400000.system-controller:thermal-sensor@70 root@localhost:~# cat /sys/kernel/debug/irq/irqs/90 handler: handle_edge_irq device: (null) status: 0x00000001 istate: 0x00004000 ddepth: 0 wdepth: 0 dstate: 0x02400201 IRQ_TYPE_EDGE_RISING IRQD_ACTIVATED IRQD_IRQ_STARTED IRQD_DEFAULT_TRIGGER_SET node: -1 affinity: 0-3 effectiv: domain: :cp0:config-space@f2000000:interrupt-controller@1e0000:interrupt-controller@50 hwirq: 0x74 chip: ICU-SEI flags: 0x0 parent: domain: :ap807:config-space@f0000000:interrupt-controller@3f0200-4 hwirq: 0x505a chip: SEI pMSI flags: 0x0 parent: domain: :ap807:config-space@f0000000:interrupt-controller@3f0200-2 hwirq: 0x0 chip: CP SEI flags: 0x0 parent: domain: :ap807:config-space@f0000000:interrupt-controller@3f0200-5 hwirq: 0x15 chip: SEI flags: 0x0 It seems with kernel 6.10 the controller device was not set correctly, probably it was ignoring irq_set_type because of this. Do you by chance have an idea how to properly fix this or should I do some more research? Thanks and regards, Stefan