From patchwork Wed Jul 24 19:20:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 169640 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp10656980ilk; Wed, 24 Jul 2019 12:40:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqyvniNMBSoMpNNKlSSjOJn7xVL3R6pn9aJY46ZGc+VVIIOZsf5DHOOjy6XYiF3iyp8p47OY X-Received: by 2002:a62:584:: with SMTP id 126mr12996468pff.73.1563997232674; Wed, 24 Jul 2019 12:40:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997232; cv=none; d=google.com; s=arc-20160816; b=Hplur358Bpzn/v+aLZXRCxN3GgQt3DC6gb7FvemzNu9g8x7jdy7T/ayEqKXmaD54yB AZIOfS/SUPT/HA685faPIzf70L6b3psxx4EiE6PoOFgu7k1oxzceL9jtYJLrCtiuyKQy 04iFnzM26jtB2VyaMgDf/5bLZ9vFpwmZ39b1momZQr9XKkVL8FU/qwR5nzxtKTsA7+3T +SnawCfaPr53vaeemj30LiHNp/mUTOIrAgKA0i5ivMs0P/CcvoOSjnwoGk65MiJ3M7Yw r0XrgeNuoMHUwqKcxS/L5ozU4UdwmE3R25KN1Bf+CVfXebkWCK22KOxU/pQ7HHZ3Uv7Y nTiA== 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=Hurc776JhXumUf4vtUvAMuxYCpI9Lj3YWDLOTR43FXquiNVBo+ciFOJKsE71wloU+y tVTuWycnr9ijHj5vdLypqYgHyx3YGYxXorC1Fw2zi4l8qZNosbKQTXki0HyivF0NoshD 00NRkfV/7qWFA8rdlyU/5u+Tu6POHF6oPRriXcmGwILdw08V0a06XU26FKluLEXJFIL0 W+/ols4bp3LSGmJTZK5LFIDO5ePAdi3u+CPP1vAW7mBbwc0S/yUzk1M7z3PhCJ3Qbvfi rr0eockgY9kGXJgeFJxqIsZjRP7Yi92m2KQMvUx5/TU/gsuc07myNp7370BbLiPK4bfw zcSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=xqwklLOx; 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 r18si35326736pgl.173.2019.07.24.12.40.32; Wed, 24 Jul 2019 12:40:32 -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=xqwklLOx; 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 S2387921AbfGXTkb (ORCPT + 14 others); Wed, 24 Jul 2019 15:40:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:41740 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390010AbfGXTka (ORCPT ); Wed, 24 Jul 2019 15:40:30 -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 BDD1B20665; Wed, 24 Jul 2019 19:40:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563997229; bh=hdPiwWOIh86sapnLw0u7XiSoH7Kj3zi5jtTPZLDP9H0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xqwklLOxfDDk/iHBwunCY4qXfr5pSJ5H8U4s08P2JE5j5ObzASVNwKDQcQE/WGGa0 KjY/AzSP2AhpRO2+LnFJEckupQx2u0TDXCECH5asUCLKUTy3A/VBOoNnLGo9v76TF4 zH7FrK/Sykg3rcEVC8fDrFPcnkG7Img8DXvbdAOg= 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.2 366/413] PCI: qcom: Ensure that PERST is asserted for at least 100 ms Date: Wed, 24 Jul 2019 21:20:57 +0200 Message-Id: <20190724191801.598390481@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190724191735.096702571@linuxfoundation.org> References: <20190724191735.096702571@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); }