From patchwork Wed Jul 24 19:21:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 169648 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10685232ilk; Wed, 24 Jul 2019 13:10:28 -0700 (PDT) X-Google-Smtp-Source: APXvYqw0ggtg+nZOppYcgZqAqUStPjrBRRlVX8CyatGzRJqL2AzgTs74NpmYrAjVL6LNIad3eeul X-Received: by 2002:a17:902:9041:: with SMTP id w1mr89147847plz.132.1563999028027; Wed, 24 Jul 2019 13:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563999028; cv=none; d=google.com; s=arc-20160816; b=WVQS6PxWqbHiqaCiMtzKH39M06eqQm9UCa3ZKGKjz6k3JtS6YaH4iOETJ4bI+v/4JC nSjV1IigSsj9q+F3IEi7oR0OHYUWEc0kFAYfOOPFvzlhcfeONk+PPsTBC4+C862Uh6K3 77B9YeTURtrSbV7Ron0hpGZxro9oih/y988tmJek7AhHeLIjnAqoM6S7w16787mWWv9+ iCAOiGN/q8pQhWQRIKwAqOwjma4imiDHuoSYL/eQAPUX33PWN8dJhWEi2CDTdrQysI/y DR7x58ibtIMfqOGQzRtxDEsioDp2WBIHi0IFcO0UQGu3USPxLpDIw88u1Y7k9O7cuZf7 ySjQ== 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=Ki+0q5T6jfoMGjMnsQGlnJ7pr0iqH5Nxbna9Rfk6Y7o=; b=rS7bwc37nX0qyB0bRzJxSAaF6DWPIwLEUx1AbiEETjtCeTW8+m7Upwb9NliDEXhR8C bGJm3Peo2mc3wi//7UD+SA0XHLEJo14XWjSkXsGB6KD9H49V0UX0s37X+lucYngrY8fd X6RuCCjjdoNmW4V/N2t+QT+/sP7wEoeuw0pV7mgC88oc7PxYOVJwY33C6fwAC9txtgJj s8uSmAGnqq4F9V/snd6bWvrojVEBNEQktqEVGyQYpdrwTzT2Bgra5syfi5YHQy1h2ZaK N+EU9DVpQ3QKa9smLvN36fswkAuODFZyi5JEmvzAj7e7pAiZ7Ts7Ef6CW/wCEpzAxabs ETzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="oLTX/wyZ"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-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 m15si17976121pgt.495.2019.07.24.13.10.27; Wed, 24 Jul 2019 13:10:28 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of stable-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="oLTX/wyZ"; spf=pass (google.com: best guess record for domain of stable-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=stable-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388835AbfGXUK0 (ORCPT + 14 others); Wed, 24 Jul 2019 16:10:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:46190 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405070AbfGXT7G (ORCPT ); Wed, 24 Jul 2019 15:59:06 -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 31F7720665; Wed, 24 Jul 2019 19:59:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563998345; bh=hdPiwWOIh86sapnLw0u7XiSoH7Kj3zi5jtTPZLDP9H0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oLTX/wyZUnX+SOh7kulxi2vGuIK8ceBgLNsYU9zc851QF9X0ydaVfoYUdU0QSg6nj uUBcmE/bIQ6CqJibAaygbwqmU6z08FHqdRVlhni1snDh+hz8R4fr3zcw1iXu/TvQWH q9lMAa9BZdkmVzBfJNXK/NkOiOQXpVxYJRHAuve8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Niklas Cassel , Lorenzo Pieralisi , Stanimir Varbanov Subject: [PATCH 5.1 332/371] PCI: qcom: Ensure that PERST is asserted for at least 100 ms Date: Wed, 24 Jul 2019 21:21:24 +0200 Message-Id: <20190724191748.756382478@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191724.382593077@linuxfoundation.org> References: <20190724191724.382593077@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: Niklas Cassel commit 64adde31c8e996a6db6f7a1a4131180e363aa9f2 upstream. Currently, there is only a 1 ms sleep after asserting PERST. Reading the datasheets for different endpoints, some require PERST to be asserted for 10 ms in order for the endpoint to perform a reset, others require it to be asserted for 50 ms. Several SoCs using this driver uses PCIe Mini Card, where we don't know what endpoint will be plugged in. The PCI Express Card Electromechanical Specification r2.0, section 2.2, "PERST# Signal" specifies: "On power up, the deassertion of PERST# is delayed 100 ms (TPVPERL) from the power rails achieving specified operating limits." Add a sleep of 100 ms before deasserting PERST, in order to ensure that we are compliant with the spec. Fixes: 82a823833f4e ("PCI: qcom: Add Qualcomm PCIe controller driver") Signed-off-by: Niklas Cassel Signed-off-by: Lorenzo Pieralisi Acked-by: Stanimir Varbanov Cc: stable@vger.kernel.org # 4.5+ Signed-off-by: Greg Kroah-Hartman --- drivers/pci/controller/dwc/pcie-qcom.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/pci/controller/dwc/pcie-qcom.c +++ b/drivers/pci/controller/dwc/pcie-qcom.c @@ -178,6 +178,8 @@ static void qcom_ep_reset_assert(struct static void qcom_ep_reset_deassert(struct qcom_pcie *pcie) { + /* Ensure that PERST has been asserted for at least 100 ms */ + msleep(100); gpiod_set_value_cansleep(pcie->reset, 0); usleep_range(PERST_DELAY_US, PERST_DELAY_US + 500); }