Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp135351imu; Wed, 2 Jan 2019 03:55:00 -0800 (PST) X-Google-Smtp-Source: ALg8bN4kypAqURqjAR+eFsmABbrWE8GHQXkNKMHq4d42hUDTj1+tH4gG0rJw1b5U6NPmlFlZV51h X-Received: by 2002:a63:111c:: with SMTP id g28mr13126254pgl.85.1546430100924; Wed, 02 Jan 2019 03:55:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546430100; cv=none; d=google.com; s=arc-20160816; b=NefKn2u+9f4Y9kIa9Sl+LRWfMRYU5oWxVbwAZyzzc+JVYrU6qVaeH+mQoBKG8eBx9G XbE8+/xBZOXNC+981k7ZMdR4BHO21xu9WOjiMWPsCX2zC/er9ndG846/sVw0y89c6c9/ K/HhwLx551sR+LnCdy2GvG2qq+VtdkSF3oSAYgJOMep1DET9cykz/MY8/G9QLZU4Z24R gQVnRZ8vdq3zL/rIwIbj7PKkly0HPnGunoBj9HXBnrJLOJL+cq1NS/9Ec8F0thaqrpb0 zCjeIG1sInqJqeLtz+gX9An8F/JWsKmV9OCmIcynvP4pXt8w2z/8lwAvbMsT87cH9zdn Ehjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=7b1Hn0Xfk3VV5kAXuRPU9ybWexz/CkgWLfJFPFxseBQ=; b=MuomBhV9nCrYSt8HzRdLk/n1wXbkDBSbI6wiSkwQD5CQ7OBZ9jb8EHeQuEWaX42YxO BFxu6+zjv3vKrNb625abd1HKn1C8R2D67txbGFKkfDfW1GPHfCt9E62LDP72mnVHsZcb 3ASTrrh2QJ0Cgd/A1SFdp8YpHkeeIQ2Y7efL4RUn497EeHtpjbPpQRXBg3Cq0NVqLpVA x8iwwe0F1n6Pfo2R9/4X8QoCmYbuIEBwUmsYCZIMhYGscqkY1NQxoHxEs8FqD2ln6sUJ 95hpX9XWnjOpktaFBIXtncljMWgu8+HjjL3903CE+K72vt5RhpxK25YEsS9/zIJGlCQA B9Sw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@synopsys.com header.s=mail header.b=ewJa0WoK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z5si30701712pgu.19.2019.01.02.03.54.20; Wed, 02 Jan 2019 03:55:00 -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; dkim=pass header.i=@synopsys.com header.s=mail header.b=ewJa0WoK; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729323AbfABKRi (ORCPT + 99 others); Wed, 2 Jan 2019 05:17:38 -0500 Received: from smtprelay4.synopsys.com ([198.182.47.9]:34402 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727294AbfABKRi (ORCPT ); Wed, 2 Jan 2019 05:17:38 -0500 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id D8F4B24E11ED; Wed, 2 Jan 2019 02:17:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=synopsys.com; s=mail; t=1546424258; bh=dVn8PzrY2tVGmJLGmwNOrof8PMvNIVBdLsSpBWH5zF4=; h=Subject:To:CC:References:From:Date:In-Reply-To:From; b=ewJa0WoKMc7VbHFWH0YHGE7gjktu8QgfYosap5huL7SgI1DP8qXoKYjSvv2OkZdbb 8TABp3Hyora7lTktjDfgC2wdyQ0wJKT0DbqtD8X8v6L4xr/p+zZGvSKMnlxihKWyBI kwO6cnyaHt/LIQcV75bCb4vyG0Sk5RwDMNLW4lVZXusei1L5OE7DIuQmimmiOO4LWj +8G/yh4nyKvpszrmLTTOfU1EHkiztyRcj6EqBKKaIgcx4/xfSqgOsCCcB7IPns7pOt 7/1tjrd8i2kxYq1H/po6N0ouYT7HZy4e4r7o3jgivD0Hi8lZKjptXANazK5d26gUqN +WYc0T0H05uZQ== Received: from us01wehtc1.internal.synopsys.com (us01wehtc1-vip.internal.synopsys.com [10.12.239.236]) by mailhost.synopsys.com (Postfix) with ESMTP id EDEC83CC2; Wed, 2 Jan 2019 02:17:36 -0800 (PST) Received: from DE02WEHTCB.internal.synopsys.com (10.225.19.94) by us01wehtc1.internal.synopsys.com (10.12.239.231) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 2 Jan 2019 02:17:37 -0800 Received: from DE02WEHTCA.internal.synopsys.com (10.225.19.92) by DE02WEHTCB.internal.synopsys.com (10.225.19.94) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 2 Jan 2019 11:17:34 +0100 Received: from [10.107.25.131] (10.107.25.131) by DE02WEHTCA.internal.synopsys.com (10.225.19.80) with Microsoft SMTP Server (TLS) id 14.3.408.0; Wed, 2 Jan 2019 11:17:34 +0100 Subject: Re: [PATCH 10/10] PCI: dwc: Do not write to MSI control registers if the platform doesn't use it To: Kishon Vijay Abraham I , Murali Karicheri , Lorenzo Pieralisi , Gustavo Pimentel , Marc Zyngier CC: Bjorn Helgaas , Jingoo Han , "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" References: <20181219124207.13479-1-kishon@ti.com> <20181219124207.13479-11-kishon@ti.com> From: Gustavo Pimentel Message-ID: <96242503-4727-be68-84d2-4d340c7b3f5c@synopsys.com> Date: Wed, 2 Jan 2019 10:13:03 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.3.3 MIME-Version: 1.0 In-Reply-To: <20181219124207.13479-11-kishon@ti.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.107.25.131] Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, On 19/12/2018 12:42, Kishon Vijay Abraham I wrote: > Platforms which populate msi_host_init, has it's own MSI controller > logic. Writing to MSI control registers on platforms which doesn't use > Designware's MSI controller logic might have side effects. To > be safe, do not write to MSI control registers if the platform uses > it's own MSI controller logic instead of Designware's MSI controller > logic. > > Signed-off-by: Kishon Vijay Abraham I > --- > .../pci/controller/dwc/pcie-designware-host.c | 24 ++++++++++--------- > 1 file changed, 13 insertions(+), 11 deletions(-) > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c > index dbc94f3be3d5..6644a5683b2b 100644 > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > @@ -647,17 +647,19 @@ void dw_pcie_setup_rc(struct pcie_port *pp) > > dw_pcie_setup(pci); > > - num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL; > - > - /* Initialize IRQ Status array */ > - for (ctrl = 0; ctrl < num_ctrls; ctrl++) { > - dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_MASK + > - (ctrl * MSI_REG_CTRL_BLOCK_SIZE), > - 4, ~0); > - dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + > - (ctrl * MSI_REG_CTRL_BLOCK_SIZE), > - 4, ~0); > - pp->irq_status[ctrl] = 0; > + if (!pp->ops->msi_host_init) { > + num_ctrls = pp->num_vectors / MAX_MSI_IRQS_PER_CTRL; > + > + /* Initialize IRQ Status array */ > + for (ctrl = 0; ctrl < num_ctrls; ctrl++) { > + dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_MASK + > + (ctrl * MSI_REG_CTRL_BLOCK_SIZE), > + 4, ~0); > + dw_pcie_wr_own_conf(pp, PCIE_MSI_INTR0_ENABLE + > + (ctrl * MSI_REG_CTRL_BLOCK_SIZE), > + 4, ~0); > + pp->irq_status[ctrl] = 0; > + } > } > > /* Setup RC BARs */ > Acked-by: Gustavo Pimentel Regards, Gustavo