Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp392265pxf; Thu, 1 Apr 2021 04:05:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjTq2Z+Z2CRkihDZQ+HJDxijzc5XMbilUmwEncd7o/Czbv6AGagYfSkV7766/fwUofpo/8 X-Received: by 2002:a05:6402:510b:: with SMTP id m11mr9261710edd.103.1617275107714; Thu, 01 Apr 2021 04:05:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617275107; cv=none; d=google.com; s=arc-20160816; b=BBcrIWPpLfcE9tzJIStH47ALoshx0Ck1vQkSh/n9Hh2FauA+ah3hj1Hi4kyI9ITacC 9jet8GPR7R/vwckxBlzpz/rddLAvyfS4ZkFPvHSvh2ha//SBpOJ8jVLYNm5TatI2p1So DWGVDIcKPv22RsMaXk289TUS4bcGzMdfAMgUfmvIsSOD/PNld3Rs1Pc582EqofiVIrJH wOrxQqmvxs/HWQ1geyksIIoFLd48lviKRiavZ60MLQYR33X4DphhorW1waYwlPkWEgGI RPESEPQehbVNamQv7pnypgKjaW+lwFe9KutxuuM3DCb8+KCH+1DZQ2z4+5895XD4db8s 4ZEQ== 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-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=md6Mpmpc9tZF49tuxfMy/47eNy6wXCIMrxGmBfcQyiE=; b=rtMnzVqZQAdT7M87zkTrPymwT/nw6ITUYun6+0L1gIk5xfZKdFBOwF3eS4xUbfB7m5 n1Jlx0wbCP9HmbJzQTcc1u19mjRkX9AKonyqSQfZ1q//tz85vjLniMK1KdFyD8zVtkU+ sWXd7afJqObQGtnLnDVAfcRwCW3MYggy04Nebl+2ciTJ0dE+X77lL+8Flo9ahAeHOH+t pDIlfWOQC8NtrD8Wq7S7/1IXgTZx12cNteK+SZGgXslJWemFgSFb0boG+CDZBZSOJavh I7RDGDpiJOxMKFRUuOm7+KFo+/gsT/KruAr/He0cGCBTjw5/WFwJLgEasCEXtOJbglw+ B/uA== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du6si4020965ejc.393.2021.04.01.04.04.44; Thu, 01 Apr 2021 04:05:07 -0700 (PDT) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=arm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233844AbhDALDi (ORCPT + 99 others); Thu, 1 Apr 2021 07:03:38 -0400 Received: from foss.arm.com ([217.140.110.172]:36788 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229612AbhDALDL (ORCPT ); Thu, 1 Apr 2021 07:03:11 -0400 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 0A88BD6E; Thu, 1 Apr 2021 04:03:10 -0700 (PDT) Received: from lpieralisi (e121166-lin.cambridge.arm.com [10.1.196.255]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A619F3F694; Thu, 1 Apr 2021 04:03:06 -0700 (PDT) Date: Thu, 1 Apr 2021 12:03:01 +0100 From: Lorenzo Pieralisi To: Marc Zyngier 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 Message-ID: <20210401110301.GA31407@lpieralisi> References: <20210330151145.997953-1-maz@kernel.org> <20210330151145.997953-4-maz@kernel.org> <20210401101957.GA30653@lpieralisi> <87y2e2p9wk.wl-maz@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <87y2e2p9wk.wl-maz@kernel.org> User-Agent: Mutt/1.9.4 (2018-02-28) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 01, 2021 at 11:38:19AM +0100, Marc Zyngier wrote: > 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. I will apply it and merge the whole series into -next, thanks for implementing it ! Lorenzo > 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.