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 X-Spam-Level: X-Spam-Status: No, score=-9.0 required=3.0 tests=BAYES_00,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 3882BC43461 for ; Thu, 1 Apr 2021 10:39:23 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F1126108B for ; Thu, 1 Apr 2021 10:39:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233553AbhDAKit (ORCPT ); Thu, 1 Apr 2021 06:38:49 -0400 Received: from mail.kernel.org ([198.145.29.99]:47576 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234000AbhDAKid (ORCPT ); Thu, 1 Apr 2021 06:38:33 -0400 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 52DDB60FEA; Thu, 1 Apr 2021 10:38:22 +0000 (UTC) Received: from 78.163-31-62.static.virginmediabusiness.co.uk ([62.31.163.78] helo=why.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 1lRuiS-0055RO-9t; Thu, 01 Apr 2021 11:38:20 +0100 Date: Thu, 01 Apr 2021 11:38:19 +0100 Message-ID: <87y2e2p9wk.wl-maz@kernel.org> From: Marc Zyngier To: Lorenzo Pieralisi Cc: Bjorn Helgaas , Frank Wunderlich , Thierry Reding , Thomas Gleixner , Rob Herring , Will Deacon , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Michael Kelley , Wei Liu , Thierry Reding , Jonathan Hunter , Ryder Lee , Marek Vasut , Yoshihiro Shimoda , Michal Simek , Paul Walmsley , Bharat Kumar Gogada , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, kernel-team@android.com Subject: Re: [PATCH v3 03/14] PCI: rcar: Convert to MSI domains In-Reply-To: <20210401101957.GA30653@lpieralisi> References: <20210330151145.997953-1-maz@kernel.org> <20210330151145.997953-4-maz@kernel.org> <20210401101957.GA30653@lpieralisi> 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=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: lorenzo.pieralisi@arm.com, bhelgaas@google.com, frank-w@public-files.de, treding@nvidia.com, tglx@linutronix.de, robh@kernel.org, will@kernel.org, kys@microsoft.com, haiyangz@microsoft.com, sthemmin@microsoft.com, mikelley@microsoft.com, wei.liu@kernel.org, thierry.reding@gmail.com, jonathanh@nvidia.com, ryder.lee@mediatek.com, marek.vasut+renesas@gmail.com, yoshihiro.shimoda.uh@renesas.com, michal.simek@xilinx.com, paul.walmsley@sifive.com, bharatku@xilinx.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-hyperv@vger.kernel.org, linux-tegra@vger.kernel.org, linux-mediatek@lists.infradead.org, linux-renesas-soc@vger.kernel.org, kernel-team@android.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-hyperv@vger.kernel.org On Thu, 01 Apr 2021 11:19:57 +0100, Lorenzo Pieralisi wrote: > > On Tue, Mar 30, 2021 at 04:11:34PM +0100, Marc Zyngier wrote: > > [...] > > > +static void rcar_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) > > +{ > > + struct rcar_msi *msi = irq_data_get_irq_chip_data(data); > > + unsigned long pa = virt_to_phys(msi); > > > > - hwirq = rcar_msi_alloc_region(msi, nvec); > > - if (hwirq < 0) > > - return -ENOSPC; > > + /* Use the msi structure as the PA for the MSI doorbell */ > > + msg->address_lo = lower_32_bits(pa); > > + msg->address_hi = upper_32_bits(pa); > > I don't think this change is aligned with the previous patch (is it ?), > the PA address we are using here is different from the one programmed > into the controller registers - either that or I am missing something, > please let me know. Err. You are right. This looks like a bad case of broken conflict resolution on my part. The following snippet should fix it. Let me know if you want me to resend the whole thing or whether you are OK with applying this by hand. Thanks, M. diff --git a/drivers/pci/controller/pcie-rcar-host.c b/drivers/pci/controller/pcie-rcar-host.c index f7331ad0d6dc..765cf2b45e24 100644 --- a/drivers/pci/controller/pcie-rcar-host.c +++ b/drivers/pci/controller/pcie-rcar-host.c @@ -573,11 +573,10 @@ static int rcar_msi_set_affinity(struct irq_data *d, const struct cpumask *mask, static void rcar_compose_msi_msg(struct irq_data *data, struct msi_msg *msg) { struct rcar_msi *msi = irq_data_get_irq_chip_data(data); - unsigned long pa = virt_to_phys(msi); + struct rcar_pcie *pcie = &msi_to_host(msi)->pcie; - /* Use the msi structure as the PA for the MSI doorbell */ - msg->address_lo = lower_32_bits(pa); - msg->address_hi = upper_32_bits(pa); + msg->address_lo = rcar_pci_read_reg(pcie, PCIEMSIALR) & ~MSIFE; + msg->address_hi = rcar_pci_read_reg(pcie, PCIEMSIAUR); msg->data = data->hwirq; } -- Without deviation from the norm, progress is not possible.