Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp8068415ybl; Thu, 16 Jan 2020 10:05:27 -0800 (PST) X-Google-Smtp-Source: APXvYqwJPDn7Qc6coHVD1CAMx2ufVOCKwlDN8cNO+nh0bvMv/NZF+xKSAXwI4Vx8crTEoE0Xipy5 X-Received: by 2002:aca:dd87:: with SMTP id u129mr266548oig.14.1579197926965; Thu, 16 Jan 2020 10:05:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579197926; cv=none; d=google.com; s=arc-20160816; b=Y9SEXgecGmuIwXveo54IpJ4N7LNdfg4Cs8GRKqesVl3EkWISuAlPkzmIG8primGh0q LebwgsMB4FyNNfJ8fhw63dOAwyBKRtQOKH2vpVi4p5Ri+JpXO+ZV/7pQWDy3V1uADJKY 8qdFkAe5hcWSwmC8JSnZCeW81PeNylL41v3vxqGGGaN8YXlfyhrudCV8l5J4d+vi8vfr 0I9kJOMY3B9TLKijseFrdNbawYp+CcIfJKcmXit5J4A/fBUFWxbrwzkqUPPOZtxCuH0J EpB5ghzpEIHVctXNT0EOG30jltvcHfmV5l8V+8hi5c4SZ32Uw4PdinS+mIBhf16OOoLO 1u6w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ktEQvSENJlgdZ/QmGAhlcqNW0THBiqgXrMr/Di0O1q4=; b=Ku0+LR8IB7H07JvBgteIG+HKXevU3yard87HCe9l9acs/mc7VDeAn+7m3VccG6OuSI QxrXsGu5x5UxbW3PVCsQr9yUWvON5s+79PQXGrMT5o8dGhYKC4lo3ENkl5Zo+FAYlNVa 2+zLOaoVtwifUy6HNAre8JDOCmvR0PvG3c4gzylQwcDJPLpGxnUrIWESm8bDfzerI6Yp QZOUoLTVUNlrAMZq3G8lX2lE8Ur8pOSXp5MNGY4mg5/nc+VHGbOLjblINq9wWmn/SAei BQyy5KMWAjH6beiblA9Lg+uxEOd26+VQ9awEMB1CDS4zgLriNQ2vhAi7B7lkKWnyGMIg ZNPA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="GvQ/IypK"; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v6si13306854ota.19.2020.01.16.10.05.14; Thu, 16 Jan 2020 10:05:26 -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=@kernel.org header.s=default header.b="GvQ/IypK"; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2393742AbgAPSDe (ORCPT + 99 others); Thu, 16 Jan 2020 13:03:34 -0500 Received: from mail.kernel.org ([198.145.29.99]:58150 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2393686AbgAPRks (ORCPT ); Thu, 16 Jan 2020 12:40:48 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id CBF5C217F4; Thu, 16 Jan 2020 17:40:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579196447; bh=/gTnbs5dM7uA8O+BlS4BLa17DHcgz+gruW6s5dE6BkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GvQ/IypKtdf15fJuVu7BM6327RwEbdW7bnmpwTRbpdgHP5Z62Fh08CPNmoJH5htBV jf7oi2F3V0mC0R4iq4o1/znWS9m5/sTaelIek212y1YPXN+xrIXk/0DZTnR8YJ5x6y IKTKrScW1PlC7FiiuouRCx2boi6TuCLiiSrK7tS4= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Ard Biesheuvel , Sagi Grimberg , Sasha Levin , linux-nvme@lists.infradead.org Subject: [PATCH AUTOSEL 4.9 209/251] nvme: retain split access workaround for capability reads Date: Thu, 16 Jan 2020 12:35:58 -0500 Message-Id: <20200116173641.22137-169-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200116173641.22137-1-sashal@kernel.org> References: <20200116173641.22137-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ard Biesheuvel [ Upstream commit 3a8ecc935efabdad106b5e06d07b150c394b4465 ] Commit 7fd8930f26be4 "nvme: add a common helper to read Identify Controller data" has re-introduced an issue that we have attempted to work around in the past, in commit a310acd7a7ea ("NVMe: use split lo_hi_{read,write}q"). The problem is that some PCIe NVMe controllers do not implement 64-bit outbound accesses correctly, which is why the commit above switched to using lo_hi_[read|write]q for all 64-bit BAR accesses occuring in the code. In the mean time, the NVMe subsystem has been refactored, and now calls into the PCIe support layer for NVMe via a .reg_read64() method, which fails to use lo_hi_readq(), and thus reintroduces the problem that the workaround above aimed to address. Given that, at the moment, .reg_read64() is only used to read the capability register [which is known to tolerate split reads], let's switch .reg_read64() to lo_hi_readq() as well. This fixes a boot issue on some ARM boxes with NVMe behind a Synopsys DesignWare PCIe host controller. Fixes: 7fd8930f26be4 ("nvme: add a common helper to read Identify Controller data") Signed-off-by: Ard Biesheuvel Signed-off-by: Sagi Grimberg Signed-off-by: Sasha Levin --- drivers/nvme/host/pci.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c index 1ac4cec5f4f7..e2bce9385eda 100644 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@ -1863,7 +1863,7 @@ static int nvme_pci_reg_write32(struct nvme_ctrl *ctrl, u32 off, u32 val) static int nvme_pci_reg_read64(struct nvme_ctrl *ctrl, u32 off, u64 *val) { - *val = readq(to_nvme_dev(ctrl)->bar + off); + *val = lo_hi_readq(to_nvme_dev(ctrl)->bar + off); return 0; } -- 2.20.1