From patchwork Wed Jul 24 19:21:40 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 169671 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp11169314ilk; Wed, 24 Jul 2019 22:45:09 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhAHCzZo+fQZL2jdsWgcz7kghuCJTZYp6dKLLyGkx7wXbkZE4OC8mwDXqJYkZGVY3GOoeZ X-Received: by 2002:a62:ae02:: with SMTP id q2mr14544108pff.1.1564033509126; Wed, 24 Jul 2019 22:45:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564033509; cv=none; d=google.com; s=arc-20160816; b=TwtdL/miJplaZZlgh/jWpKLbMHMb7iT3StlUA8gX9lln8w0joMGm9WQ2JTMpG+Gs0r zLg6QUR049vKdSaSISx/QPp+ioB5biP8VV4Ngb4A136XX0i0XX2yGOyEtxDDw5V4Gutc Rgtht1FGfFOOPKMsdY4DFeQPBZohxF2H5HMzewZU7eUN2EpJK2RrYItKKZiR+iDfoMHG vMolBJSI8qZTFuMWgCBIgti8Ci8DA3YW1OC4QdWrkddKHr8WhM0/T3IztOanZRYoFnGO gEr5enuJxrS1hkhCUc8cutGKKHj+m4D5uPWCzo8RgKiGoKTNS3PVZZqQGAqmEF1Of/ZN CUuA== 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=MyeLadvrTwHIOwmJYsretngMqlUWnBgzijathQx0zd6W0lA/bSMSNqc81iYlOeU3r7 Ja/ZuP7MH5OdqIUC+Q7gNwn6FKVU2mk/zxDgZYANkNkwrG9SYJNsP3tin95k837ht09x fX8q7zq1y/k8fbZJAesrhNARjpuE6PqUoUjZhzxrdCmumiBYah60WtItexSnRRAH0ggl U2WAWm8gaT905z3Ux18SCEU9JB9ja/epkQukzELtOzjNESEb5HY1od/DbwiMTaXclIH6 sBzGYQbYM1h1d5W5NPr121l7HTU6xA4Aw9fYstO0oHsycgNumOSnl2ICc7EgzXkZ1jHW AbLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=1t6jvnpV; 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 6si16647262pgt.13.2019.07.24.22.45.08; Wed, 24 Jul 2019 22:45:09 -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=1t6jvnpV; 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 S2405103AbfGYFpH (ORCPT + 29 others); Thu, 25 Jul 2019 01:45:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:60452 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2405083AbfGYFpD (ORCPT ); Thu, 25 Jul 2019 01:45:03 -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 7866922CB8; Thu, 25 Jul 2019 05:45:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564033503; bh=hdPiwWOIh86sapnLw0u7XiSoH7Kj3zi5jtTPZLDP9H0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=1t6jvnpVxzGIRwt2wJYbSmBcqdB0wPhGqZudihKryKeEKUD8/vVY2JFXlr/jPecYM ZgfiUCIZAEPDHTO9/EFJILfnaVcD9nnrV6nBarxVj1kh/enCb7nw/47NzTtg94alAd SbIfGFn5yScJ0tmXOoH7GokS29aZ4CH2WE1yO/9Q= 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 4.19 231/271] PCI: qcom: Ensure that PERST is asserted for at least 100 ms Date: Wed, 24 Jul 2019 21:21:40 +0200 Message-Id: <20190724191714.957798561@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191655.268628197@linuxfoundation.org> References: <20190724191655.268628197@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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); }