Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9939565ybi; Wed, 24 Jul 2019 12:42:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqxFw6fKCm7m6ck6GXpq/bK26wC6gdst3BkgM6JwdxwVnrCWBP/Vva7OtFimnok7sj4kvgW0 X-Received: by 2002:a17:902:383:: with SMTP id d3mr2948474pld.176.1563997322022; Wed, 24 Jul 2019 12:42:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563997322; cv=none; d=google.com; s=arc-20160816; b=C5vXSYUkuucGUIEoBGLPxHs5Mw1WuaUIJfHFhYdiJx0tZdMpeYVaqFU5qQw0EUcj59 hcVhBKIA5ZA++502qjbv5LsHctSuK8AKDMyXtWScTr1NEctjNgoOtlz9wXf8Xd6Y/oXc IN7TVuOo9OGLrPPd78LAwfPnycXpNWrAchCToFLMAfJqzDeWw10GVQuVU6NFkxyiJ1Zv CyZUWJL3BGvuCCdtAwa3ucs4AyuYGmAYsU35/Twra888jbGZOcXrucoLlDT1jWOGtrRk o+sbPhv2QFA/okbr/Now/TgOCJALBD8iZZujbCZMWCyicMocaCmWjSZ4BOm9fqLXC1RU WPQw== 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=mAlfJYEtz0nctbLdVnnaXVIsf01QsiUDvaePgd0326qn/xMzAwwHMafIuoqGyZh5DM gKK1a4diFvff5YEbgHU5g9PfKNWsLjUIwB/JpBl7j41NxqThzlYKPWboa/jyOevhslDb npbVssS/6RlJvbptZMqVKWH+fO1HnTx52ap8zT1HaBQ++V687SHVHB9CE8TKQMO5Kvj4 76kwJo1ekYkLyFjXNcmPbf2ZsozUQADWzgTKp5pJqQ90dqmRsP0zoMxHnf1GFRTMAxcz pyq+vgigFWmMwkOIdidLlKyBM5iv+jxZGXDWTkghEHjAiKUE9Ge71MJVxUeLLam8xAlT mN3w== 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 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 h9si14587940pgp.435.2019.07.24.12.41.47; Wed, 24 Jul 2019 12:42:02 -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=xqwklLOx; 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 S2390024AbfGXTkc (ORCPT + 99 others); Wed, 24 Jul 2019 15:40:32 -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 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); }