Received: by 2002:a5b:505:0:0:0:0:0 with SMTP id o5csp2072869ybp; Thu, 10 Oct 2019 01:41:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqy5gV5pKlgGc5odvQlyhhhQHNAZ9xb58AkieV01OlpzC9NCB1R6DHv9ukjpFsGiSqvW4McO X-Received: by 2002:a50:ace1:: with SMTP id x88mr7096537edc.132.1570696879411; Thu, 10 Oct 2019 01:41:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1570696879; cv=none; d=google.com; s=arc-20160816; b=JEYdk/HtYZ1hoYGAXXCx8Pg9y0VtTc+NTqsaZjFFu2MuDDddAIIHoQwDk507Yh59Rm mxiSjbB8AeCkPazbzxjUTgkJ5Dhqc7CVpHyELLwZ9Lk8JRSFx/aDqwACMhS/sLm4Ftfi NSwneJgri2NIqzV/876VyLKz6tK4r5Jum0sgDsPyoFfQ8NJIlKRser4udrfHqB08mpOr +4jssFRR9uu8MRmMJ/22/NGQ9ZhRl/Co1fl7Naj/jHhOX//o4rxK/8wmmXAqOyiA54z/ g+UorrzOnIN5kKWQOIUCFX5sUldugkGlO2xCIi54wgdI9iSon6bnYT+wn4WTXdQh/WR9 Shfw== 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=7tqDhyKhm4AYqgECj3VYi4+O/Dnpo0iFILwkZh7XXoY=; b=eLM3gdLUlOJo2FXcmFsxGz3YRIaNY5A1AmX+Lm2hJPNDzmrNtEu4GlbxYGP0y3KMp1 H7n/xtoJRus7/vxyU0f0Uapx3gkFehcsuv9vvPNUDMcDRubSzqCZfQhKVWQsLkhUFFE3 PPaOu9peSAf02VqF2nMTxdFS7rq9PjzxDglgp2JuIkyHsvKPKphL0zS5yVWhpEC36iOt PSumVR8cWWg39PRKni8tgkQCb27DG0rHQtG7UdXVCGTo2+DaHgwdtjvO6qR2pBxRa5fg z5D56vu46I0+ZXVQtMAQTp85x0Uucglm9EDXNVWm/6N1gUEw4g7mtPyvDl/vhBds6zJX P4Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=s60ug3Bl; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ns21si2569659ejb.167.2019.10.10.01.40.56; Thu, 10 Oct 2019 01:41:19 -0700 (PDT) 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=@kernel.org header.s=default header.b=s60ug3Bl; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388005AbfJJIj4 (ORCPT + 99 others); Thu, 10 Oct 2019 04:39:56 -0400 Received: from mail.kernel.org ([198.145.29.99]:43774 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387995AbfJJIjz (ORCPT ); Thu, 10 Oct 2019 04:39:55 -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 568502190F; Thu, 10 Oct 2019 08:39:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1570696794; bh=64kjopHHDGcUZ+tsArg6NpuzNCg62nqj6+KYCnkP7rA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s60ug3Bl6RXAEikoJiaf2HuOdOmAmgfzHauvKJJlEiZdlpNQ1JMzmPB0zExsSTlUD muQIRQTO74228PSmqF2FFTfbXy3n9P/g6vmKdjFQSZoUiiM6eXLvQWn0KXOI8vRUKI 93mf0uqzjl3RnHEZG2+vIWMU8bLHeV1TGv4cgT9s= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jon Derrick , Lorenzo Pieralisi Subject: [PATCH 5.3 055/148] PCI: vmd: Fix shadow offsets to reflect spec changes Date: Thu, 10 Oct 2019 10:35:16 +0200 Message-Id: <20191010083614.481390762@linuxfoundation.org> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20191010083609.660878383@linuxfoundation.org> References: <20191010083609.660878383@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: Jon Derrick commit a1a30170138c9c5157bd514ccd4d76b47060f29b upstream. The shadow offset scratchpad was moved to 0x2000-0x2010. Update the location to get the correct shadow offset. Fixes: 6788958e4f3c ("PCI: vmd: Assign membar addresses from shadow registers") Signed-off-by: Jon Derrick Signed-off-by: Lorenzo Pieralisi Cc: stable@vger.kernel.org # v5.2+ Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/vmd.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) --- a/drivers/pci/controller/vmd.c +++ b/drivers/pci/controller/vmd.c @@ -31,6 +31,9 @@ #define PCI_REG_VMLOCK 0x70 #define MB2_SHADOW_EN(vmlock) (vmlock & 0x2) +#define MB2_SHADOW_OFFSET 0x2000 +#define MB2_SHADOW_SIZE 16 + enum vmd_features { /* * Device may contain registers which hint the physical location of the @@ -578,7 +581,7 @@ static int vmd_enable_domain(struct vmd_ u32 vmlock; int ret; - membar2_offset = 0x2018; + membar2_offset = MB2_SHADOW_OFFSET + MB2_SHADOW_SIZE; ret = pci_read_config_dword(vmd->dev, PCI_REG_VMLOCK, &vmlock); if (ret || vmlock == ~0) return -ENODEV; @@ -590,9 +593,9 @@ static int vmd_enable_domain(struct vmd_ if (!membar2) return -ENOMEM; offset[0] = vmd->dev->resource[VMD_MEMBAR1].start - - readq(membar2 + 0x2008); + readq(membar2 + MB2_SHADOW_OFFSET); offset[1] = vmd->dev->resource[VMD_MEMBAR2].start - - readq(membar2 + 0x2010); + readq(membar2 + MB2_SHADOW_OFFSET + 8); pci_iounmap(vmd->dev, membar2); } }