Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp8263904ybc; Fri, 29 Nov 2019 07:51:16 -0800 (PST) X-Google-Smtp-Source: APXvYqxJHLS0j+I+gn/vXR8aK6Yc1p8XYbJyzETjWJxb5RYmGR111woqt1furn9O0EToG6vaSqyz X-Received: by 2002:aa7:c613:: with SMTP id h19mr3417496edq.184.1575042676684; Fri, 29 Nov 2019 07:51:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575042676; cv=none; d=google.com; s=arc-20160816; b=y2EU2Xc+t1A+fBWC+e9KXCZyGnsDwNFGuOUaL6lIPBVZwtDvhhfAaUaUT4bqRTqr8H Zreeo88PviB/1Zi/YKZkN8pAp0VMo5U+FPPqYwzuu9EatZbX04g7asfpjtIWo+hUzW8d wPwx4c41aIVO3THLJ45qxuKbuxM7nTZ/qKYMxpIY8KFqKrD+Y62PmN5vdva5POgW21G8 53Nh80sCrbgv7J4nURTYTpPlOyA2RPoGAGd6ednl1IHWKPfPGd+mZPnF3ErvHNVGP/rs hrigURqAGYHrov1CY00IHGdZSy1UB8BP0gl2ubIDeMMZ0rgpFDolzJdk4tlG8zluTZSS Ps2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=M+OaYrKZeZz4mrhxJCFSDHSrx3dJrsIh/UCe6F7kSXE=; b=l92qTWcibzAvaImwAQHcupl0Ih610fVc6JbK77xXcJca9HX5DlwaSWKTXJ44J9cUP9 yvBpDAmk/BXBBXEOHm6McZ3bG3X2l2jO0JU4VYofsX4v8V2hntoEeuShyHaYp840/OA9 mSSBQJhDd6BiL/4AVS8K/9utmhgFNtDaZUR2ZwxFGDALyCZMNwxGtt5q7C36QbqfUZ6F riNzfxwD25pif2RPDmXiqme4R0GFJRpAFifEQT+8LWHZq09nnakggyNCdKkMxhv3voLe pvHSQ9NfSZaB2AD1IA+NdiFNX9DPslTPX/yw83zE17qbAmAVsagDK5+2Xvnjvv90U7kR 6V0g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id nw21si13847914ejb.222.2019.11.29.07.50.51; Fri, 29 Nov 2019 07:51:16 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727133AbfK2Pqd (ORCPT + 99 others); Fri, 29 Nov 2019 10:46:33 -0500 Received: from foss.arm.com ([217.140.110.172]:49556 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726808AbfK2Pqd (ORCPT ); Fri, 29 Nov 2019 10:46:33 -0500 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 A832C30E; Fri, 29 Nov 2019 07:46:32 -0800 (PST) Received: from localhost (unknown [10.37.6.20]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 214B93F68E; Fri, 29 Nov 2019 07:46:31 -0800 (PST) Date: Fri, 29 Nov 2019 15:46:30 +0000 From: Andrew Murray To: Nicolas Saenz Julienne Cc: maz@kernel.org, linux-kernel@vger.kernel.org, Lorenzo Pieralisi , Eric Anholt , Stefan Wahren , Florian Fainelli , bcm-kernel-feedback-list@broadcom.com, james.quinlan@broadcom.com, mbrugger@suse.com, phil@raspberrypi.org, jeremy.linton@arm.com, linux-pci@vger.kernel.org, linux-rpi-kernel@lists.infradead.org, Bjorn Helgaas , linux-arm-kernel@lists.infradead.org Subject: Re: [PATCH v3 5/7] PCI: brcmstb: add MSI capability Message-ID: <20191129154629.GF43905@e119886-lin.cambridge.arm.com> References: <20191126091946.7970-1-nsaenzjulienne@suse.de> <20191126091946.7970-6-nsaenzjulienne@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191126091946.7970-6-nsaenzjulienne@suse.de> User-Agent: Mutt/1.10.1+81 (426a6c1) (2018-08-26) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 26, 2019 at 10:19:43AM +0100, Nicolas Saenz Julienne wrote: > From: Jim Quinlan > > This adds MSI support to the Broadcom STB PCIe host controller. The MSI > controller is physically located within the PCIe block, however, there > is no reason why the MSI controller could not be moved elsewhere in the > future. MSIX is not supported by the HW. > > Since the internal Brcmstb MSI controller is intertwined with the PCIe > controller, it is not its own platform device but rather part of the > PCIe platform device. > > Signed-off-by: Jim Quinlan > Co-developed-by: Nicolas Saenz Julienne > Signed-off-by: Nicolas Saenz Julienne > Reviewed-by: Marc Zyngier > > --- > > Changes since v2 (kept Marc's Reviewed-by as changes didn't affect irq > subsystem stuff or seem petty enough): > - Use standard APIs on register operations > - Get rid of revision code Do any RPI4's have a HW revision of less than 33? > - Update rules to msi_target_addr selection > - Remove unwarranted MSI_FLAG_PCI_MSIX > - Small cosmetic changes > > Changes since v1: > - Move revision code and some registers to this patch > - Use PCIE_MSI_IRQ_DOMAIN in Kconfig > - Remove redundant register read from ISR > - Fail probe on MSI init error > - Get rid of msi_internal > - Use bitmap family of functions > - Use edge triggered setup > - Add comment regarding MultiMSI > - Simplify compose_msi_msg to avoid reg read > > This is based on Jim's original submission[1] with some slight changes > regarding how pcie->msi_target_addr is decided. > > [1] https://patchwork.kernel.org/patch/10605955/ > > drivers/pci/controller/Kconfig | 1 + > drivers/pci/controller/pcie-brcmstb.c | 261 +++++++++++++++++++++++++- > 2 files changed, 261 insertions(+), 1 deletion(-) > > diff --git a/drivers/pci/controller/Kconfig b/drivers/pci/controller/Kconfig > index 27504f108ee5..918e283bbff1 100644 > + > +static void brcm_msi_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) > +{ > + struct brcm_msi *msi = irq_data_get_irq_chip_data(data); > + > + msg->address_lo = lower_32_bits(msi->target_addr); > + msg->address_hi = upper_32_bits(msi->target_addr); > + msg->data = 0x6540 | data->hwirq; NIT: Perhaps this 0x6540 can be a define - just in the same way we have a define for PCIE_MISC_MSI_DATA_CONFIG_VAL. Thanks, Andrew Murray > +} > + > -- > 2.24.0 >