From patchwork Mon Aug 17 15:15:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 247852 Delivered-To: patch@linaro.org Received: by 2002:a92:cc90:0:0:0:0:0 with SMTP id x16csp2879364ilo; Mon, 17 Aug 2020 11:52:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxwS0+kKSfegvQsA38Mvj04d1zA8UihKtaDwnzZUHKsUzVj8CxZidpJv7wus/kdbP3uhDZC X-Received: by 2002:a17:907:20e1:: with SMTP id rh1mr15904971ejb.106.1597690339795; Mon, 17 Aug 2020 11:52:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597690339; cv=none; d=google.com; s=arc-20160816; b=zzcwrUQHHiHZRr1kbCkCC8cndYuSXTpCx8ddO6ulW74J9GkVLPcl2ldbVfdjGL0bG0 vPb6Kg449ab+JDWOMMusL+nHJPRk5Z5srEeyYuaKCrhuwwQEp7adgNX6FZQf1h0dnDhU XUam7eC5Y/UFKoYmJ9lpFGOrShL1mua5c+kBya+s2rneWTm+WhbJ97UIR4cNdcXBFCNB +CDQEWqGerZrnp4YyHrs7WTMURJvfx1V4qiw4i3vsdLyyBMxtWErkpAKf+XknNw7W2jI rECpUvtL4fe5YEEiNqHwemxYXRnabvvM+tUKtPW27GCG4+cnjK8LAbd7HnwTSNwB7gTV Kb4Q== 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=FmNDfMy4c2xiOmFloGqMwwayxGJu+BgMHodx4h132Js=; b=tpEpGgvE2/71mXiSsO4P6OeAcdy1NVcs4DYsOyfwTFw2bo+9Dr4/6ME2CW8TwIzcV/ M94z/uAlKh6tqXi2pS+RSUq50m2HqTXpw68Mfa8PD4SpJG85Cm5UPkRdfdinU0UKOVqj BtD2rrkuSeRv20EAMkcY3EudhX68Mlmb09tePcfNQGrDBC2pGcHhrWv24J8z9cFDB+GZ no5OZZozz99sIrrZBMY00GHvjxtKmC6uimaJiMv/y447/BaeY2B3cZtH8L6Q1TWRpk4D WC2qS8+2KVGyymWzwodXE1/BqbaxsG9r5sztiZSu8rSnMajeaJFC6aKmV3M1TNc60LGp 9iCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qR97DEas; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 rs7si12267875ejb.195.2020.08.17.11.52.19; Mon, 17 Aug 2020 11:52:19 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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=qR97DEas; spf=pass (google.com: domain of stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S2388722AbgHQSwK (ORCPT + 15 others); Mon, 17 Aug 2020 14:52:10 -0400 Received: from mail.kernel.org ([198.145.29.99]:38660 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387855AbgHQPwc (ORCPT ); Mon, 17 Aug 2020 11:52:32 -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 BA1152072E; Mon, 17 Aug 2020 15:52:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597679551; bh=4B9M30yOczoJmUUUKtSnieioAmo0+n5FXfVoWuaIk7U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qR97DEasD6S/6QFHuQwMxI3NHc1rcz0oSD6Se3iOpRYwxUmOfWZbdWreHEPis4X6O nxSzK9wUZfJgFnKx9FdZ7M/K3Q+3cr5eJQY/CBUXwKADGTcFpSbdXqezSr0wLOK88y NAm2yAwwp1Z1WwsL2fe+uSf5IGJ0sc9AI6yAZw+8= 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 5.7 251/393] PCI: cadence: Fix updating Vendor ID and Subsystem Vendor ID register Date: Mon, 17 Aug 2020 17:15:01 +0200 Message-Id: <20200817143831.796275839@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200817143819.579311991@linuxfoundation.org> References: <20200817143819.579311991@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@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/cadence/pcie-cadence-host.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) -- 2.25.1 diff --git a/drivers/pci/controller/cadence/pcie-cadence-host.c b/drivers/pci/controller/cadence/pcie-cadence-host.c index 11eb81da0233f..aa18fb724d2ed 100644 --- a/drivers/pci/controller/cadence/pcie-cadence-host.c +++ b/drivers/pci/controller/cadence/pcie-cadence-host.c @@ -69,6 +69,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: @@ -88,8 +89,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);