Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2653122pxa; Mon, 17 Aug 2020 15:35:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxGEqwG9XDg27lAnJAA1J5a6nrpb2bVtUnwTle3GRpBU0xmSkIb/5QnSMuYKyS38KYCjmho X-Received: by 2002:a50:f311:: with SMTP id p17mr17729680edm.37.1597703732713; Mon, 17 Aug 2020 15:35:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597703732; cv=none; d=google.com; s=arc-20160816; b=pkkQubr/s/zen3PHdk9QTtpQExFw4jRcxi/f18N2WiKYou+qmIIGRE9tb6miQ+v63I xLFxYzHRy9QdhPVzIQVG/F1TJXkSsujv0bc+GkDN4fv1428dZQ15unXy94hqYPDKwNtC PNsQIxM8B7xcejFJvMqtj2gRoqLgZJGu2DuVhx/nyGwTyPCUS5zmRRsj1r0njCfNKdS0 EbbeT2nlBDrKaWNgi6FUITREfbRtb31Pq/kUPyPy7BzWlsA8NELsVWWJ23xsG4Ydd2ls WRtx/RMfP2DR+fcNI9M6n4lLegk6diiJLLJEJ488b05lPTDue4lk+1+16nMqqjNgdU4h Miiw== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=kgoncBEOeA9jjshOdLHKEGkewZHQQMm9iBgqK5VYCho=; b=KDv5/f/MH4qFy54tMY+D9oTKQBn/xSk2WRReFBshswjge8ttT8moTxEmNth5/PgpC1 EwSonxso6WIb259vy31iaKyUoRtrr/fK6FTp77IHWBA/RnlqdVv2JcqgJmra0yrFdizW BkkG14KPhDSWIeWRyRLjSYwI56DiFOm9rLInmTf0g2qAbik2Fjp/4PGeEQ3MShJi1jXS pfzwwRQHHAVAsPfr7dw6/kraMweQR3IfFi5VYELo1lICuE++tmcB2j+ZRNS1q5srx63n RXxwGraOqjAg41StDxCrAnX3Jm9aSUhU92sIPIyMln9KgWzTYbl8FAr0IWMkIBgfqOSt 12zQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=FH11BozW; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w6si11411967edq.25.2020.08.17.15.35.09; Mon, 17 Aug 2020 15:35:32 -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; dkim=pass header.i=@kernel.org header.s=default header.b=FH11BozW; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731348AbgHQRTl (ORCPT + 99 others); Mon, 17 Aug 2020 13:19:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:54756 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731071AbgHQQPh (ORCPT ); Mon, 17 Aug 2020 12:15:37 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 B269B22CB3; Mon, 17 Aug 2020 16:15:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597680937; bh=b8dcykdGfMKAbIUCpCxX7tLSFSWEjDh6yo3ccQiiFkc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FH11BozWF7GzfLw7YHCnPRubhjh5cwZ+d7FCSQwZr2EiGRCO4GtD8yfvsGCSL7V4S 124vpyNeOvhvssJAzOTYQ/NA5ozTTe57/4UTF1d6iD2onN46thwRwsZ5E4wHL03k8A 3Whv8ekprg4D8wZVq5M4ACeGQEh6VFqoM2x5Bd+s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Kishon Vijay Abraham I , Lorenzo Pieralisi , Rob Herring , Sasha Levin Subject: [PATCH 4.19 100/168] PCI: cadence: Fix updating Vendor ID and Subsystem Vendor ID register Date: Mon, 17 Aug 2020 17:17:11 +0200 Message-Id: <20200817143738.710505810@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143733.692105228@linuxfoundation.org> References: <20200817143733.692105228@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kishon Vijay Abraham I [ Upstream commit e3bca37d15dca118f2ef1f0a068bb6e07846ea20 ] Commit 1b79c5284439 ("PCI: cadence: Add host driver for Cadence PCIe controller") in order to update Vendor ID, directly wrote to PCI_VENDOR_ID register. However PCI_VENDOR_ID in root port configuration space is read-only register and writing to it will have no effect. Use local management register to configure Vendor ID and Subsystem Vendor ID. Link: https://lore.kernel.org/r/20200722110317.4744-10-kishon@ti.com Fixes: 1b79c5284439 ("PCI: cadence: Add host driver for Cadence PCIe controller") Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Lorenzo Pieralisi Reviewed-by: Rob Herring Signed-off-by: Sasha Levin --- drivers/pci/controller/pcie-cadence-host.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/pcie-cadence-host.c b/drivers/pci/controller/pcie-cadence-host.c index ec394f6a19c8e..ae7affcb1a811 100644 --- a/drivers/pci/controller/pcie-cadence-host.c +++ b/drivers/pci/controller/pcie-cadence-host.c @@ -102,6 +102,7 @@ static int cdns_pcie_host_init_root_port(struct cdns_pcie_rc *rc) { struct cdns_pcie *pcie = &rc->pcie; u32 value, ctrl; + u32 id; /* * Set the root complex BAR configuration register: @@ -121,8 +122,12 @@ static int cdns_pcie_host_init_root_port(struct cdns_pcie_rc *rc) cdns_pcie_writel(pcie, CDNS_PCIE_LM_RC_BAR_CFG, value); /* Set root port configuration space */ - if (rc->vendor_id != 0xffff) - cdns_pcie_rp_writew(pcie, PCI_VENDOR_ID, rc->vendor_id); + if (rc->vendor_id != 0xffff) { + id = CDNS_PCIE_LM_ID_VENDOR(rc->vendor_id) | + CDNS_PCIE_LM_ID_SUBSYS(rc->vendor_id); + cdns_pcie_writel(pcie, CDNS_PCIE_LM_ID, id); + } + if (rc->device_id != 0xffff) cdns_pcie_rp_writew(pcie, PCI_DEVICE_ID, rc->device_id); -- 2.25.1