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,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED autolearn=ham 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 74242C433ED for ; Thu, 1 Apr 2021 10:38:47 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 0DC17610CA for ; Thu, 1 Apr 2021 10:38:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 0DC17610CA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Subject:Cc:To: From:Message-ID:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=yOwb6fMlFHnS/0I0HtSoI8n8JrFoRd0NcMgsrqF8t8I=; b=NcYyuIP8lASP0Zl6cTaE8MmSC fkqqPGJuHnEXOcpOA2DX7fIalK7JkcH1qQen3P6z+SS9DMnjrlsnKo5oryCOt2ldoU0B7F9ePQVqE Q5sqnPHAXIAxoJhMupfGvUjlE7O++j9f80xAdjENrKHaBvDzSLEqbsAAFTlJugcKwhsGpJi6VbI79 HRnahYdpf/ZXIIGvrH+j0nKwsU/1zMtAGxwP85ZI/nDFHdcBoGYMx0vwS9g3vFsFbeI2X3uWaO0LI CL8nG7dKEnmdSyxSw1HlB9HhYpvrMgmWdYsiddJS98YZXKBtY6tJmTqquo5+yJUAK4fSJ5f1GmCAh oGTTCn6kA==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lRuii-009GOk-UT; Thu, 01 Apr 2021 10:38:37 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lRuiV-009GLq-Tx; Thu, 01 Apr 2021 10:38:26 +0000 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") 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210401_113824_547150_A367A6C1 X-CRM114-Status: GOOD ( 26.05 ) X-BeenThere: linux-mediatek@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-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.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. _______________________________________________ Linux-mediatek mailing list Linux-mediatek@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-mediatek