Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp5939525pxb; Mon, 14 Feb 2022 11:11:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJxvfYz6mK6Zpk3+Tq+fKI0X8IHf4v9kmY+YL4n7kajrVMLD8r2ia2ClMHMmpGtAoCjalhX2 X-Received: by 2002:a62:8f15:: with SMTP id n21mr308402pfd.1.1644865918790; Mon, 14 Feb 2022 11:11:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644865918; cv=none; d=google.com; s=arc-20160816; b=HWDdsa3hDaqJO2BFxVTG0KVKeXVJtlDJkaoIPsXfQyS6AWzMXQX7WXoZZRrX0nK5Rk KTjrnSXdF0x7A2HjsCSuXaQthxj/G73bKqe7ejucI7FsqmBq75gZUzHHzUftXby0NVPv 9I1LqYNZRiTJZsRMkR/5JaIz7kouki5QjTo8qjPkVEQFx+xHFVCv17k9keBnxHMloyHa 1mZE9EuWAqwi6+M28o7smsMV81UX/DZRyhJWHjAhK+EGywotPTuwKHb0m/g29Bhl8rMP UtOLWpF70jp9PTAdIk6naKwBHPMUoUOHKi7HLRCdA5YkdYFA3JcycHy+Pa/CQ1oCT1YK pugw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=gH33y0BG8QvG7M8n1PuMqoa9cDawpn+WE59jlnRasq4=; b=guigeynlmMZnOtul7k7MkMaeBDvssXkRhauHW/E6XBUX0tJy1HfrOMP07BoJKC63mj JQUm5ICGypTpS/YPYEcfqaZtjb5N9ToWAVrNPKrRItHMCxrckXZkVChwD22qDlv9ZVYi Nm4LwGo90cQ48gWKR/1ur6/ZjVaNtEkeLTJ2g1e5iiHiYiH+rO2VqdPwLy+PRGu6JN7v CzoF9BrgRkLmgzHAyJnXps30xUXWcFv80EtxHnmVztWC578WLNaLyYyWIOwu4NIqHO9/ T3D5/ptMJrkYh/PDpnpV3zKO4fe9Nn24mzPDzSt3b3JytC+/UmWGAuGOq+n8NKiztZ+H 34VA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id y13si522536pgu.380.2022.02.14.11.11.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 11:11:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 454EA1033; Mon, 14 Feb 2022 11:06:56 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245611AbiBKSVr (ORCPT + 93 others); Fri, 11 Feb 2022 13:21:47 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:60804 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241157AbiBKSVq (ORCPT ); Fri, 11 Feb 2022 13:21:46 -0500 Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 71E7113A; Fri, 11 Feb 2022 10:21:44 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 1B6911042; Fri, 11 Feb 2022 10:21:44 -0800 (PST) Received: from lpieralisi (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id B72F33F70D; Fri, 11 Feb 2022 10:21:42 -0800 (PST) Date: Fri, 11 Feb 2022 18:21:37 +0000 From: Lorenzo Pieralisi To: Pali =?iso-8859-1?Q?Roh=E1r?= Cc: robh+dt@kernel.org, Bjorn Helgaas , Thomas Petazzoni , Krzysztof =?utf-8?Q?Wilczy=C5=84ski?= , Marek =?iso-8859-1?Q?Beh=FAn?= , Russell King , Marc Zyngier , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v2 10/11] PCI: mvebu: Implement support for legacy INTx interrupts Message-ID: <20220211182137.GA2492@lpieralisi> References: <20220105150239.9628-1-pali@kernel.org> <20220112151814.24361-1-pali@kernel.org> <20220112151814.24361-11-pali@kernel.org> <20220211171917.GA740@lpieralisi> <20220211175202.gku5pkwn5wmjo5al@pali> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20220211175202.gku5pkwn5wmjo5al@pali> User-Agent: Mutt/1.9.4 (2018-02-28) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Feb 11, 2022 at 06:52:02PM +0100, Pali Roh?r wrote: [...] > > > @@ -1121,6 +1247,21 @@ static int mvebu_pcie_parse_port(struct mvebu_pcie *pcie, > > > port->io_attr = -1; > > > } > > > > > > + /* > > > + * Old DT bindings do not contain "intx" interrupt > > > + * so do not fail probing driver when interrupt does not exist. > > > + */ > > > + port->intx_irq = of_irq_get_byname(child, "intx"); > > > + if (port->intx_irq == -EPROBE_DEFER) { > > > + ret = port->intx_irq; > > > + goto err; > > > + } > > > + if (port->intx_irq <= 0) { > > > + dev_warn(dev, "%s: legacy INTx interrupts cannot be masked individually, " > > > + "%pOF does not contain intx interrupt\n", > > > + port->name, child); > > > > Here you end up with a new warning on existing firmware. Is it > > legitimate ? I would remove the dev_warn(). > > I added this warning in v2 because Marc wanted it. > > Should I (again) remove it in v3? No, I asked a question and gave an opinion, I appreciate Marc's concern so leave it (ie not everyone running a new kernel with new warnings on existing firmware would be happy - maybe it is a good way of forcing a firmware upgrade, you will tell me). Lorenzo > > Rob certainly has more insightful advice on this. > > > > Thanks, > > Lorenzo > > > > > + } > > > + > > > reset_gpio = of_get_named_gpio_flags(child, "reset-gpios", 0, &flags); > > > if (reset_gpio == -EPROBE_DEFER) { > > > ret = reset_gpio; > > > @@ -1317,6 +1458,7 @@ static int mvebu_pcie_probe(struct platform_device *pdev) > > > > > > for (i = 0; i < pcie->nports; i++) { > > > struct mvebu_pcie_port *port = &pcie->ports[i]; > > > + int irq = port->intx_irq; > > > > > > child = port->dn; > > > if (!child) > > > @@ -1344,6 +1486,22 @@ static int mvebu_pcie_probe(struct platform_device *pdev) > > > continue; > > > } > > > > > > + if (irq > 0) { > > > + ret = mvebu_pcie_init_irq_domain(port); > > > + if (ret) { > > > + dev_err(dev, "%s: cannot init irq domain\n", > > > + port->name); > > > + pci_bridge_emul_cleanup(&port->bridge); > > > + devm_iounmap(dev, port->base); > > > + port->base = NULL; > > > + mvebu_pcie_powerdown(port); > > > + continue; > > > + } > > > + irq_set_chained_handler_and_data(irq, > > > + mvebu_pcie_irq_handler, > > > + port); > > > + } > > > + > > > /* > > > * PCIe topology exported by mvebu hw is quite complicated. In > > > * reality has something like N fully independent host bridges > > > @@ -1448,6 +1606,7 @@ static int mvebu_pcie_remove(struct platform_device *pdev) > > > > > > for (i = 0; i < pcie->nports; i++) { > > > struct mvebu_pcie_port *port = &pcie->ports[i]; > > > + int irq = port->intx_irq; > > > > > > if (!port->base) > > > continue; > > > @@ -1458,7 +1617,17 @@ static int mvebu_pcie_remove(struct platform_device *pdev) > > > mvebu_writel(port, cmd, PCIE_CMD_OFF); > > > > > > /* Mask all interrupt sources. */ > > > - mvebu_writel(port, 0, PCIE_MASK_OFF); > > > + mvebu_writel(port, ~PCIE_INT_ALL_MASK, PCIE_INT_UNMASK_OFF); > > > + > > > + /* Clear all interrupt causes. */ > > > + mvebu_writel(port, ~PCIE_INT_ALL_MASK, PCIE_INT_CAUSE_OFF); > > > + > > > + if (irq > 0) > > > + irq_set_chained_handler_and_data(irq, NULL, NULL); > > > + > > > + /* Remove IRQ domains. */ > > > + if (port->intx_irq_domain) > > > + irq_domain_remove(port->intx_irq_domain); > > > > > > /* Free config space for emulated root bridge. */ > > > pci_bridge_emul_cleanup(&port->bridge); > > > -- > > > 2.20.1 > > >