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 8E6ACC433EF for ; Sat, 18 Dec 2021 05:40:22 +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:In-Reply-To:MIME-Version:Date: Message-ID:From:References:Cc:To:Subject:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=x+Y6v8ZfLpSntQZiQkUSAm0HPJtwGu9a6HCBSSs9lSE=; b=WzPHMGcn7VhAJzlOqZ6Ady/l5O efU8+n3c3H4tIETqtHzaBfVsd59PQsnoT13gGSRBK+kSBexqBlNAXGvhduAD4TCknkOApDOWiUkPW oof6WqgS+n5Uf9kdhIs3lMwfirByfrYA6XPY81noVygvP7aQCvco6fidnESD1U6bES+bE1AHD4NLF wkER52y5jC/IPd7943ZuRvaauNb+eFtBCGpNL95MTOsPkkAmHcEnso2pq7wbLxhVtRZpP3sQ7k4uy Yu+Ufi9VIFHyo2MGrOEiEdf6+G6GgcQOtGHI6waChKoUEDGtpoSUkTFCIKPbPhlAufK9HkjsRbpzp MVKsohFg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mySRC-00D1G2-5l; Sat, 18 Dec 2021 05:39:18 +0000 Received: from marcansoft.com ([212.63.210.85] helo=mail.marcansoft.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1mySR5-00D1Ev-0A for linux-arm-kernel@lists.infradead.org; Sat, 18 Dec 2021 05:39:12 +0000 Received: from [127.0.0.1] (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: marcan@marcan.st) by mail.marcansoft.com (Postfix) with ESMTPSA id E09AA41E96; Sat, 18 Dec 2021 05:39:06 +0000 (UTC) Subject: Re: [PATCH 5/6] irqchip/apple-aic: Support multiple dies To: Marc Zyngier Cc: Thomas Gleixner , Rob Herring , Sven Peter , Alyssa Rosenzweig , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org References: <20211209043249.65474-1-marcan@marcan.st> <20211209043249.65474-6-marcan@marcan.st> <87mtl4jxjt.wl-maz@kernel.org> From: Hector Martin Message-ID: Date: Sat, 18 Dec 2021 14:39:04 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: <87mtl4jxjt.wl-maz@kernel.org> Content-Language: es-ES X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211217_213911_230428_897497DC X-CRM114-Status: GOOD ( 17.71 ) 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: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 14/12/2021 01.10, Marc Zyngier wrote: >> switch (fwspec->param[0]) { >> case AIC_IRQ: >> - if (fwspec->param[1] >= ic->nr_irq) >> + if (die >= ic->nr_die) >> + return -EINVAL; >> + if (args[0] >= ic->nr_irq) >> return -EINVAL; >> - *hwirq = (FIELD_PREP(AIC_EVENT_TYPE, AIC_EVENT_TYPE_HW) | >> - FIELD_PREP(AIC_EVENT_NUM, fwspec->param[1])); >> + *hwirq = AIC_IRQ_HWIRQ(die, args[0]); >> break; > > A side issue with this is that it breaks MSIs, due to the way we > construct the intspec (I did hit that when upgrading the M1 intspec to > 4 cells for the PMU). I have the following hack locally: > > diff --git a/drivers/pci/controller/pcie-apple.c b/drivers/pci/controller/pcie-apple.c > index b090924b41fe..f7b4a67b13cf 100644 > --- a/drivers/pci/controller/pcie-apple.c > +++ b/drivers/pci/controller/pcie-apple.c > @@ -218,7 +218,7 @@ static int apple_msi_domain_alloc(struct irq_domain *domain, unsigned int virq, > if (hwirq < 0) > return -ENOSPC; > > - fwspec.param[1] += hwirq; > + fwspec.param[1 + (fwspec.param_count == 4)] += hwirq; > > ret = irq_domain_alloc_irqs_parent(domain, virq, nr_irqs, &fwspec); > if (ret) > Heh, I never noticed; probably because I guess the SD card reader on the machine I've been testing this on doesn't use MSIs, and I haven't tried WiFi yet. Perhaps (fwspec.param_count - 2)? It's probably a safer long-term assumption that the last two cells will always be leaf IRQ number and type. -- Hector Martin (marcan@marcan.st) Public Key: https://mrcn.st/pub _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel