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 61BC1CD13CF for ; Mon, 2 Sep 2024 09:53:19 +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-Transfer-Encoding: Content-Type:MIME-Version:Message-ID:Date:References:In-Reply-To:Subject:Cc: To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=cXX4b4vx9EXt2rVqBKrcCvfB/iNzSmFwnGSb8EDwvdg=; b=g8uzlxG6NUJVyOUEEfD/KQ8mz/ 8r6ouMizaVzwDejJMHYzOoCY4sYVczbsjN+f+LaOh4OjeNPhpTBulSxYgBod8SK3IhXy1aX/kqHH6 zSbzCRHS9uAxFlzpyC9go1O/Gjv64hJpuwJo9gmpJir8cZlbJIL0055e31qkibXYXzM89ml+Z/VG5 wkoibCnh0WQsN2EiA1mfWoY2deYAhLN/o/kdLr7bJ9T4bGsHHBk+wl7om4E9hW9cfdclJiucVl3fY 5UoitiHbMKETDKsah35GJVykVxMTldwDDJovDM1Z1AUxdslLghseLnG0ZDudCZmdXPJLGORoTj5Qh QpTAjsUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1sl3kE-0000000DmVQ-33s7; Mon, 02 Sep 2024 09:53:10 +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 1sl3ih-0000000Dlu2-3jtE for linux-arm-kernel@lists.infradead.org; Mon, 02 Sep 2024 09:51:41 +0000 From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1725270694; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cXX4b4vx9EXt2rVqBKrcCvfB/iNzSmFwnGSb8EDwvdg=; b=aU2ghH6feVl3O5RfBJsp+YEYGPJ2aP4HNzYELwrdneEvKaac75fForahyPtHE9CjqviWRD 4r2BqAmgi0m8q9f2FORGBk/f3BwHbwyxF4/d0qcH16CG9VADvQMXfTa0wgICshu+SyvwcF UMaqtST9B1tua5/UnAJ0Kc8jCG2LEDZvl8m9krpkOrkG50bNNV7h8HptXfiKoS4THTvE6Q cjODwfjDaOenaQwvkiXBMhx0ycfHCRmNfAndVoj508H7t6KT1wOSTjSDfVfPliLoefzCW9 qB3HAtRW1HU7XaJ3oRmbZO1WWHrUbniaab/O48VpZ8otZ0AggazGnhjC+afGfg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1725270694; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cXX4b4vx9EXt2rVqBKrcCvfB/iNzSmFwnGSb8EDwvdg=; b=/PkPtDEeywcHg1PNLIjOYlvNlCRANsnfVPpWvrolgEZB9/ou157cVI3DI13JOlvHied7Na 0+yZpbcI1QXaKhDg== To: richard clark Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, torvalds@linux-foundation.org Subject: Re: [PATCH] irq: fix the interrupt trigger type override issue In-Reply-To: References: <87r0a27blv.ffs@tglx> Date: Mon, 02 Sep 2024 11:51:33 +0200 Message-ID: <877cbu7596.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240902_025136_161504_A4787974 X-CRM114-Status: GOOD ( 19.77 ) 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 16:42, richard clark wrote: > On Mon, Sep 2, 2024 at 3:34=E2=80=AFPM Thomas Gleixner wrote: >> 1) insmod() >> irq_create_fwspec_mapping(fwspec) >> irq_domain_translate(fwspec, ... &type); <- Sets type to the FW v= alue >> >> virq =3D irq_find_mapping(domain, hwirq); >> if (virq) { >> // Path not taken >> } >> >> // Map interrupt >> ... >> >> irqd_set_trigger_type(..., type); >> >> 2) rmmod() >> tears down mapping >> > This just tears down the action allocated and installed by > request_irq(...), but does not teardown the irq's node inserted in the > revmap_tree. So what creates the mapping? If the driver creates it then why doesn't it unmap it when it exits? >> 3) insmod() >> >> Should be exactly the same as #1 because the previous mapping was >> torn down by rmmod() >> > Not the same exactly, the {irq, irq_data} will still be in the > revmap_tree, so it will enter another path in this case: That's exactly the question. Why does the mapping persist? >> So how exactly does that happen what you describe? >> > The logic is if the trigger type specified by request_irq(...) is not > consistent with the firmware one, the request_irq will override the > FW. We need to keep this logic the same as when we insmod the same > kmod next time -- override the FW's too instead of returning a > mismatch type error. I can see how that can happen, but what's missing is the information why this mapping persists and why it's tried to be set up again. Thanks, tglx