Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10433474ybi; Wed, 24 Jul 2019 23:07:53 -0700 (PDT) X-Google-Smtp-Source: APXvYqzQmHdG7wL4KUJpMGY48N9vcGG3tR7zghdvT3QJIfYRXUt6INUNgYKXn24FZ5GcsRIRluwC X-Received: by 2002:a62:8f91:: with SMTP id n139mr15327935pfd.48.1564034873528; Wed, 24 Jul 2019 23:07:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564034873; cv=none; d=google.com; s=arc-20160816; b=bbGNhQ16gUZVnanOP5EUarGwoEocwGGtTNSd2v9A8l07r2XCv6hU3EVzOh7B9cPSWP fThqdVVFKDvE03XHQOZ2YOu7n60NTSN/xbMQZ38s+ebWc0eZccjkhkPv1n6HI7zsRL0y 7TusYs2cbUOBlZjnfUUDnrlg8/JDgIVNCckUAdctkAhYM5CHORHD2qUAh0f/e2GC/VD1 MNN/hrxGH4y1CVzmCQJPCy25rEV7bHBTZf1uUkVfkRGQt1EraUHX/dzXnGSISFCwWTQv ckHmvFgdr7kuZwWfy4BLTNlo1T3VRlBIZto32IiwVYR6uQp0YWY/0KWjW5WULJP52SkX 91KQ== 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 c13si15413055pfr.36.2019.07.24.23.07.39; Wed, 24 Jul 2019 23:07:53 -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 S2405099AbfGYFpG (ORCPT + 99 others); Thu, 25 Jul 2019 01:45:06 -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 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: 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); }