Received: by 2002:a05:6a10:9e8c:0:0:0:0 with SMTP id y12csp2600223pxx; Sun, 1 Nov 2020 03:45:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJwsynl5NmhbyW/S2GQz/x/jTSe77/ISDXWVfbvD9GZvlQpQT3zVZ4GRF30iYdnV6IjRNw+h X-Received: by 2002:a17:906:cec2:: with SMTP id si2mr9832968ejb.34.1604231144749; Sun, 01 Nov 2020 03:45:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604231144; cv=none; d=google.com; s=arc-20160816; b=iF/OzplJoDTQjSZkXaKyEUcSL3FPboYti8J06+maWUH73kB9TSqGHecbYlC+TBS4bT lSUPFOiF10Ibb9zbrH/I4vTVLoCwZFPwPY+avh4FmWEAqZpa2dpICZLAkadMagbgfFo9 XcXkcD1GrcyTChvcKULQx2r1K4OwKhbNgzJNWtgKElniyi+JA5e91so+Fuo2bhlZu+0B ELvUTRnT0ZAAJ9WrMh0kGjS/kUNbckUgvRKbpinEdyzr+fsZpj+JIOm/zRpOWj8VvgO1 IkqtwVuG8nHy++22Y37EKfbuEhAFlds2NP5MHy95WHx9ZEtJskWFYBaA9TMywuFOp6HI P0Uw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent:references:in-reply-to :subject:cc:to:from:message-id:date:dkim-signature; bh=HKsphi5ebpL7v+roQhfTg3dRUvEo9u8MmMXyajgDAWQ=; b=vZNFQ736adjBvr3YAggRy19l9En9kvmHntWADZQUK1y1+4YXO6akrAo9GK//tF0GmY VO3bQf09POqR2kLnx4+PIlSBZlyOWyCSBYI/wulNQ1CCCsWAuWGYXE5kFDi6FDvBXtLQ wblErN9MuZ7lRP22goNHSAhNCetECc44gjYjIz/rKRILHvOZcP9q+Ox7W0S3zXo+rOcC Ul1dRBXBSOqX0gazGoFe7xt4HI+bjy9oly8ArZA8xR+m/8ViOhoB2JjpqOzx2fRTTm04 iY7G9kogFsVlGQiUJEppP/DEi6nUUkRNm94SbRVwyVouEJssKyWBAp0rBU/YD6uNk9VD rXYg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zj9Y9Vpr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r6si3031710ejs.731.2020.11.01.03.45.22; Sun, 01 Nov 2020 03:45:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Zj9Y9Vpr; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726488AbgKALnn (ORCPT + 99 others); Sun, 1 Nov 2020 06:43:43 -0500 Received: from mail.kernel.org ([198.145.29.99]:40488 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726159AbgKALnl (ORCPT ); Sun, 1 Nov 2020 06:43:41 -0500 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E317C2084C; Sun, 1 Nov 2020 11:43:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1604231021; bh=PhpQNQy+XASsokS0LS3hOuKswcWgDRgGPvFPoeNTMvM=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Zj9Y9VprsvvS+btUkl87m1PqXpA7QJAe0IAQZhZr2fFJQj6K/eRsJxYMAO81id8bD wI1bhj8kmbPzA0Ljc3kKPuSLFbQAfdCZct3Q6zNlIOW2CfL8L5lvpuNhyL6nLN01RW CvYehVhTky4kpLi+/saB++2fPBhFXjB1dD7WnwVY= Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] 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.94) (envelope-from ) id 1kZBlq-006PGE-Q5; Sun, 01 Nov 2020 11:43:38 +0000 Date: Sun, 01 Nov 2020 11:43:33 +0000 Message-ID: <87lfflti8q.wl-maz@kernel.org> From: Marc Zyngier To: frank-w@public-files.de Cc: linux-mediatek@lists.infradead.org, Thomas Gleixner , Frank Wunderlich , linux-kernel@vger.kernel.org, Ryder Lee , Matthias Brugger , linux-pci@vger.kernel.org, Bjorn Helgaas Subject: Re: [PATCH] pci: mediatek: fix warning in msi.h In-Reply-To: References: <20201031140330.83768-1-linux@fw-web.de> <878sbm9icl.fsf@nanos.tec.linutronix.de> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26.3 (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=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: frank-w@public-files.de, linux-mediatek@lists.infradead.org, tglx@linutronix.de, linux@fw-web.de, linux-kernel@vger.kernel.org, ryder.lee@mediatek.com, matthias.bgg@gmail.com, linux-pci@vger.kernel.org, bhelgaas@google.com 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 Sun, 01 Nov 2020 09:25:04 +0000, Frank Wunderlich wrote: > > Am 31. Oktober 2020 22:49:14 MEZ schrieb Thomas Gleixner : > > >That's not a fix. It's just supressing the warning. > > Ok sorry > > >So it needs to be figured out why the domain association is not there. > > It looks like for mt7623 there is no msi domain setup (done via > mtk_pcie_setup_irq callback + mtk_pcie_init_irq_domain) in mtk pcie > driver. Does this mean that this SoC never handled MSIs the first place? Which would explain the warning, as there is no MSI domain registered for the device, and we end-up falling back to arch_setup_msi_irqs(). If this system truly is unable to handle MSIs, one potential workaround would be to register a PCI-MSI domain that would always fail its allocation with -ENOSPC. It is really ugly, but would keep the horror localised. See the patchlet below, which I can't test. If this situation is more common than we expect, we may need something in core code instead. M. diff --git a/drivers/pci/controller/pcie-mediatek.c b/drivers/pci/controller/pcie-mediatek.c index cf4c18f0c25a..52758b546d40 100644 --- a/drivers/pci/controller/pcie-mediatek.c +++ b/drivers/pci/controller/pcie-mediatek.c @@ -151,6 +151,7 @@ struct mtk_pcie_port; struct mtk_pcie_soc { bool need_fix_class_id; bool need_fix_device_id; + bool no_msi; unsigned int device_id; struct pci_ops *ops; int (*startup)(struct mtk_pcie_port *port); @@ -435,6 +436,9 @@ static int mtk_pcie_irq_domain_alloc(struct irq_domain *domain, unsigned int vir struct mtk_pcie_port *port = domain->host_data; unsigned long bit; + if (port->pcie->soc->no_msi) + return -ENOSPC; + WARN_ON(nr_irqs != 1); mutex_lock(&port->lock); @@ -966,11 +970,13 @@ static int mtk_pcie_parse_port(struct mtk_pcie *pcie, port->slot = slot; port->pcie = pcie; - if (pcie->soc->setup_irq) { + if (pcie->soc->setup_irq) err = pcie->soc->setup_irq(port, node); - if (err) - return err; - } + else + err = mtk_pcie_allocate_msi_domains(port); + + if (err) + return err; INIT_LIST_HEAD(&port->list); list_add_tail(&port->list, &pcie->ports); @@ -1173,6 +1179,7 @@ static const struct dev_pm_ops mtk_pcie_pm_ops = { }; static const struct mtk_pcie_soc mtk_pcie_soc_v1 = { + .no_msi = true, .ops = &mtk_pcie_ops, .startup = mtk_pcie_startup_port, }; -- Without deviation from the norm, progress is not possible.