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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ADFA1C04A95 for ; Sat, 22 Oct 2022 10:48:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230436AbiJVKsC (ORCPT ); Sat, 22 Oct 2022 06:48:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60252 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230182AbiJVKrl (ORCPT ); Sat, 22 Oct 2022 06:47:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4B0C92B733A for ; Sat, 22 Oct 2022 03:05:24 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 7647AB81B13 for ; Sat, 22 Oct 2022 10:05:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1F629C433D6; Sat, 22 Oct 2022 10:05:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1666433121; bh=ut45MV8KXe9yyX4ipKBkMLHt+qSDahGglY9awia2Me8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vJzh8ShR4wyxdfcjASi+UWKzdzX6+nl++AMPqLvTjjrNOU+9mnXcU8DqCtT+RjXwY kQfh188GKVgihNi9QWtoYOOwKdIFipBNlvSUh7IBPXVW8+oKTtuUhodutI9XbIBSr3 Yyq6FK7ymQdLpfxQhYN6fRIaeahervEAEsyqgKaUjoc3Xb50tBcxPnH0ZJWFSgMja2 UDUbrD4qwAVqXzs9vkm4uKQK9tC/PylbQSItEyFSk/kBg3lNM6Q76lz5h9kCFECYf2 5pqbt6q/Xbqjj3oEEzqqR/cAhMmH6ZsIuh7PksP6gu4DK2SbHE7CX+jo/LNPjsA92Y 3hQVE2YfHN62g== Received: from sofa.misterjones.org ([185.219.108.64] helo=wait-a-minute.misterjones.org) by disco-boy.misterjones.org with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.95) (envelope-from ) id 1omBNW-000keI-S6; Sat, 22 Oct 2022 11:05:18 +0100 Date: Sat, 22 Oct 2022 11:04:37 +0100 Message-ID: <87fsfggone.wl-maz@kernel.org> From: Marc Zyngier To: firas ashkar Cc: alex@digriz.org.uk, tglx@linutronix.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2] irqchip: add TS7800v1 fpga based controller driver In-Reply-To: <118f1bcc4583612423aa0dca0421c4eea3cd648d.camel@savoirfairelinux.com> References: <20221020141351.14829-1-firas.ashkar@savoirfairelinux.com> <861qr1fs55.wl-maz@kernel.org> <7b2ac9ae5f18e5272e52478c73da53a76cf9f2a2.camel@savoirfairelinux.com> <86zgdpdrj3.wl-maz@kernel.org> <118f1bcc4583612423aa0dca0421c4eea3cd648d.camel@savoirfairelinux.com> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM-LB/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL-LB/10.8 EasyPG/1.0.0 Emacs/27.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-SA-Exim-Connect-IP: 185.219.108.64 X-SA-Exim-Rcpt-To: firas.ashkar@savoirfairelinux.com, alex@digriz.org.uk, tglx@linutronix.de, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 21 Oct 2022 19:14:48 +0100, firas ashkar wrote: > > > > > +static void ts7800_ic_chained_handle_irq(struct irq_desc > > > > > *desc) > > > > > +{ > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct ts7800_irq_data= *data =3D > > > > > irq_desc_get_handler_data(desc); > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0struct irq_chip *chip = =3D irq_desc_get_chip(desc); > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0u32 mask_bits =3D read= l(data->base + IRQ_MASK_REG); > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0u32 status =3D readl(d= ata->bridge); > > > > > + > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0chained_irq_enter(chip= , desc); > > > > > + > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0if (unlikely(status = =3D=3D 0)) { > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0handle_bad_irq(desc); > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0goto out; > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0} > > > > > + > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0do { > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0unsigned int bit =3D __ffs(status); > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0int irq =3D irq_find_mapping(data->domain, bit); > > > > > + > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0if (irq && (mask_bits & BIT(bit))) > > > > > +=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2= =A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0=C2=A0= generic_handle_irq(irq); > > > >=20 > > > > Again, this is not appropriate. I've pointed you to the right API > > > > in > > > > my previous review of this patch. > > > 'generic_handle_domain_irq' causing some issues > >=20 > > Which issue? > # insmod /tmp/virt-dma.ko=20 > # insmod /tmp/ts-dmac.ko=20 > generic_handle_domain_irq failed, error -22 > irq 2, desc: a285c39f, depth: 0, count: 0, unhandled: 0 > ->handle_irq(): e7046ee9, ts7800_ic_chained_handle_irq+0x0/0x1ec > [irq_ts7800] > ->irq_data.chip(): 70d81143, 0xc14db44c > ->action(): f799c8dd > ->action->handler(): dcf07981, bad_chained_irq+0x0/0x64 > IRQ_LEVEL set > IRQ_NOPROBE set > IRQ_NOREQUEST set > IRQ_NOTHREAD set > unexpected IRQ trap at vector 02 > generic_handle_domain_irq failed, error -22 [...] News flash, your code is buggy. How about you debug it? The domain name you use definitely indicates that you "know how" to do it... M. --=20 Without deviation from the norm, progress is not possible.