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 9DC6ACD13CF for ; Mon, 2 Sep 2024 07:35:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type:MIME-Version: Message-ID:Date:References:In-Reply-To:Subject:Cc:To:From:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yXVxKmdLptWcQCY4ZWfrhM8giQpKNSqHBQPRe6/X2nE=; b=ObDqpFexTQMapsI/TUEP8ZQnM8 Ak22qR5TOvYLncYjZioRUHCTymRSz0aXerH12W2i+8Be5cDNv7I02Cv7/hDoC33i+hFMdKC/8Ez1D flt6FD2t5SpDUMNBvIeWp8F1VSew0U6E1GAc1AfMhZGp+rgvzTTTMqQViwP6AY9SjmCAnzDu23Hlm eueSzLMkZpZ9dp/WhbuNhxZWlMarBVGdg2ipB4BsFGlf+XSg1Hc0k9dIdO1PReilZ4FXmxC6KqcEU v4SyO8JC18sg2ZO3qQG3IaHGKQwGG6eAFGibcWGXSjfsJ4pj4bzMPsV4cF3Wx1iulCZuK8Gb/oBDp dI1CuKdA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl1b8-0000000DKYs-0llN; Mon, 02 Sep 2024 07:35:38 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl1Zv-0000000DK9y-0950 for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 07:34:27 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1725262461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yXVxKmdLptWcQCY4ZWfrhM8giQpKNSqHBQPRe6/X2nE=; b=XqlsMWPC7CLr2RYrAhq7Nu29wOJ5AGzNSm0TFkoIXLyPUuCB2AkiLyLqD+vMHvW9TCuAom rNJ3umU5liB/m71EjbTvRW+S0c8qh15pGNWtmExZFRkrT2QPcbbrsjaitsvnybJjfm5vBz QI7cmN/nV7FwufKxOvdxm8yg3j7ymt8xoewju9nPkU/xwz7YidTuR7TA4ZkjWv9qYHw+ub r+7L9HWYxbzpL/zDTl8+yTuoRDYzWft3M/cXsEITUo1NJ+Blqoutmr201GS+6W4K8hp7E0 BYi14yi6EXLupC4EVWPs8GJxX/SGAT4Lr0Ijnm/e8OLRjmd3KDha1IbV3/x4DQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1725262461; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=yXVxKmdLptWcQCY4ZWfrhM8giQpKNSqHBQPRe6/X2nE=; b=0XqcNPHhfwpydVQFoeKRjjSPGdESjrglZ/PFBsSp+pE/BkTDuY25FKIjOmbSvBHQsBuOVQ jPPC2UriM1sjLoAA== To: Richard Clark Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, torvalds@linux-foundation.org, richard.xnu.clark@gmail.com Subject: Re: [PATCH] irq: fix the interrupt trigger type override issue In-Reply-To: References: Date: Mon, 02 Sep 2024 09:34:20 +0200 Message-ID: <87r0a27blv.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_003423_236740_7B3800BA X-CRM114-Status: GOOD ( 16.76 ) 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 Richard! On Mon, Sep 02 2024 at 11:17, Richard Clark wrote: The subsystem prefix is 'irqdomain' not 'irq' # git log --online $FILE gives you a decent hint. > In current implementation, the trigger type in 'flags' when calling request_irq > will override the type value get from the firmware(dt/acpi node) if they are > not consistent, and the overrided trigger type value will be retained by irq_data, > consequently the type value get from the firmware will not match the retained one > next time in case the virq is available. > > Thus below error message will be observed by the __2nd__ 'insmod' within the > 'insmod - rmmod - insmod' operation sequence for the same device driver kernel > module, in which request_irq(..., IRQ_TYPE_LEVEL_HIGH, ...) is used: > > irq: type mismatch, failed to map hwirq-182 for interrupt-controller! How so? 1) insmod() irq_create_fwspec_mapping(fwspec) irq_domain_translate(fwspec, ... &type); <- Sets type to the FW value virq = irq_find_mapping(domain, hwirq); if (virq) { // Path not taken } // Map interrupt ... irqd_set_trigger_type(..., type); 2) rmmod() tears down mapping 3) insmod() Should be exactly the same as #1 because the previous mapping was torn down by rmmod() Even if the first mapping is not torn down by rmmod(), which is a bug in itself, then the type is exactly the same as the firmware describes it, no? So how exactly does that happen what you describe? > The corresponding 'interrupts' property of that device node is: > interrupts = <0 150 1>; > > This commit fixes the above issue by adding a new checker - > irqd_trigger_type_was_set: This commit is equaly redundant as 'This patch' # git grep 'This patch' Documentation/process/ Also 'new checker' is not really a technical term. Thanks, tglx