From patchwork Thu Jun 29 15:34:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Srinivas Kandagatla X-Patchwork-Id: 106650 Delivered-To: patch@linaro.org Received: by 10.182.135.102 with SMTP id pr6csp4846107obb; Thu, 29 Jun 2017 08:35:12 -0700 (PDT) X-Received: by 10.98.96.66 with SMTP id u63mr16948786pfb.13.1498750512504; Thu, 29 Jun 2017 08:35:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1498750512; cv=none; d=google.com; s=arc-20160816; b=mRPKoibkEl8D16qWpAaAhTeR+oKKQs8RHr304Ik+gs2DkxauN7s2xU2A4Xjwjnibss Q1dApYaSQ3NgsKW1vgsUBdg7JW6RrgIxb1SPavFf+sUhW2hszcF3m1MtNMBmV66Krqo0 +PSuSNe0wny0rwbc8kbnyFf43ZPOFj+idJLCxDRmA+hOT97uRxb9EzVN4Nh9p0jaat47 Ccr7XTzq6lflgsbiRsjn5oVXb6LtpWORbNAMgxgLW24HUNBtJNtEmknCd7EbIyAZn4Pk fPwRcYqkwbVaw5YyjuuibsrdxwCOKt5HwUH71Bqt8VN7eg/tnFfyPPlcm5k29SaeRc/D oPBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=nvkw3crcD9ex+amX6uRtj3cuglDuROE+BiXF2+VPBQs=; b=vD62qjpSr3XjIrysILc3kAtICzhJUSS4kqyygNQnLxiZ0yRcPlEXEUxGW2nWdB7ysV LFHc2X6+WfD3voDdaK47gY14qXyVXgXBiZsbxVIxtPBXPktMQ5PpDMFHrDeuPGi5PgNu kkXKRJIWtZuQeove5RPq4eITqkTJLiFOTZA1MsZFzU7dybtX3OAMeL6QizFFo7rSgBkq mdZAe78rwAq6fqwBYKuj1mdmNC4hDd45V1J9J3gWWThZM8Y7AkwoRsjW5zpaZ+jUvTPm 11s5GIGUYVDKncXWx+BPCQeMq0oMI2oVHCnRNphjUv94b2GD28BiQLEJI7WHaOkSFa03 qBHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=iIXa2j9d; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g126si3783831pgc.266.2017.06.29.08.35.12; Thu, 29 Jun 2017 08:35:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.b=iIXa2j9d; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753426AbdF2PfK (ORCPT + 10 others); Thu, 29 Jun 2017 11:35:10 -0400 Received: from mail-io0-f179.google.com ([209.85.223.179]:34331 "EHLO mail-io0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753384AbdF2PfJ (ORCPT ); Thu, 29 Jun 2017 11:35:09 -0400 Received: by mail-io0-f179.google.com with SMTP id r36so9198930ioi.1 for ; Thu, 29 Jun 2017 08:35:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=AkEOfhjveguLz/Yt0ycXiUnfHFgsPlHh+qkURUcJ9A8=; b=iIXa2j9d4eQwXEyddWllzRrsxsdSIFVEL1qXk27LnvfVKaAeOa+wyxFey2zh3DSLZ7 mi8ClQc+0SGkY9YU3dpHsIun2+UXbrar65KisiMkAi51Yw/5TZqxbv5y+RGRxrDZHPm+ dSRaxiCAVnXl4lOMP8tqfycPdAacWggV3vEDk= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=AkEOfhjveguLz/Yt0ycXiUnfHFgsPlHh+qkURUcJ9A8=; b=hGyMhaIuSSd5jf1cSZmLoQtpAmYcM06YxWYTSXIZKqZxdC1+ZGFI1saR0NUgUxQf8A geILegZeRuPsJXFdYxbqEYjugMg+ZHn8YpPhdckPiU+BFFAyUx5DHs+xyqaeuHfaYXiM CdQUZtKwkPJ7brJ34zdnfX6uSvPqnTkiYoKz6yQepi98y2dfq+q0YzunLQsMy53Rym17 9hu6t5Xqbor5D5RCwao4Xd1iVrimU6qsITfDK602ehCChGVFofsVHN9A+phcBFwu/SIn R1qV2gcoFVSpEqEt51mNd0ZEZiz53CRsGB5OEdP4cXWS72okAt5BqtfXeRJAVWszfOks 8OJg== X-Gm-Message-State: AKS2vOyrXIRfJHyEP0uUr8syWd+rXfYkNEmpcs5NYv+YWl0rmIwmHY35 lDPFlsYuPoz+hwmi X-Received: by 10.107.131.229 with SMTP id n98mr19253552ioi.97.1498750508078; Thu, 29 Jun 2017 08:35:08 -0700 (PDT) Received: from localhost.localdomain (static.8.26.4.46.clients.your-server.de. [46.4.26.8]) by smtp.gmail.com with ESMTPSA id b17sm4541079itd.0.2017.06.29.08.35.05 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jun 2017 08:35:06 -0700 (PDT) From: srinivas.kandagatla@linaro.org To: Stanimir Varbanov , Bjorn Helgaas Cc: linux-pci@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Kandagatla Subject: [PATCH] PCI: dwc: qcom: limit TPL size to 2K to fix hw issue Date: Thu, 29 Jun 2017 17:34:55 +0200 Message-Id: <20170629153455.11995-1-srinivas.kandagatla@linaro.org> X-Mailer: git-send-email 2.11.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org From: Srinivas Kandagatla This patch limits TPL size to 2K from default 4K size as a workaround for a HW bug in v0 version of pcie IP. When using default TPL size of 4K the internal buffer gets corrupted due to this HW bug. This bug was originally noticed during ssh session between APQ8064 based board and PC. Network packets got corrupted randomly and terminated the ssh session due to this bug. Signed-off-by: Srinivas Kandagatla --- drivers/pci/dwc/pcie-qcom.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/pci/dwc/pcie-qcom.c b/drivers/pci/dwc/pcie-qcom.c index 5bf23d432fdb..28ba5192a21d 100644 --- a/drivers/pci/dwc/pcie-qcom.c +++ b/drivers/pci/dwc/pcie-qcom.c @@ -51,6 +51,12 @@ #define PCIE20_ELBI_SYS_CTRL 0x04 #define PCIE20_ELBI_SYS_CTRL_LT_ENABLE BIT(0) +#define PCIE20_AXI_MSTR_RESP_COMP_CTRL0 0x818 +#define CFG_REMOTE_RD_REQ_BRIDGE_SIZE_2K 0x4 +#define CFG_REMOTE_RD_REQ_BRIDGE_SIZE_4K 0x5 +#define PCIE20_AXI_MSTR_RESP_COMP_CTRL1 0x81c +#define CFG_BRIDGE_SB_INIT BIT(0) + #define PCIE20_CAP 0x70 #define PERST_DELAY_US 1000 @@ -357,6 +363,13 @@ static int qcom_pcie_init_v0(struct qcom_pcie *pcie) /* wait for clock acquisition */ usleep_range(1000, 1500); + + /* Set the Max TLP size to 2K, instead of using default of 4K */ + writel(CFG_REMOTE_RD_REQ_BRIDGE_SIZE_2K, + pci->dbi_base + PCIE20_AXI_MSTR_RESP_COMP_CTRL0); + writel(CFG_BRIDGE_SB_INIT, + pci->dbi_base + PCIE20_AXI_MSTR_RESP_COMP_CTRL1); + return 0; err_deassert_ahb: