From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.7 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7AB4EC433E0 for ; Thu, 11 Mar 2021 12:40:24 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3A1C64F90 for ; Thu, 11 Mar 2021 12:40:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3A1C64F90 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=YcqiHm3GXo3dmrk288G5zq9J4k1g6WAAp0teziju7DE=; b=VrFLJ2u+7ismWJ4X1BR9Y6L2C qiJNK2d37Xy2c/BQX4c/KpmuPEVm5ST+wWfSo8lSJ/ReBs+uTsNeuJoZb/j6h5mbtfBbS6dJ8IbXQ zWs172D0H2ao+bJvSkGxVSsvuRj3QvI0hZ6yCV2rzBNf+58Z3toXTf7zkoiww226UA0gMcrIsPrRs dA83j0BdbJnVKpCYgpY1tqUOMAFwheuSfYju61MLspllofB5ttHiEiHxTVu0a5UhWlnJvmMw9PZtW +4erxBETGvGDyCIZTKwgdK0EZFGCKN+End5GFdbnGBqBYyYjY+sch5TCZd1ddSJ+8iVqDwnk5va4L ahQDH7trQ==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lKKaf-00984j-Rz; Thu, 11 Mar 2021 12:38:59 +0000 Received: from mail.kernel.org ([198.145.29.99]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lKKaX-00982c-PE; Thu, 11 Mar 2021 12:38:52 +0000 Received: by mail.kernel.org (Postfix) with ESMTPSA id E1801601FC; Thu, 11 Mar 2021 12:38:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1615466328; bh=kiZx6X2u4fkLyNZRYPGNjVsvCuNlk6cl7UlHxmmB1sE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=jJgsZKR1DIU5WZLHXgEhCqhcLpQQggquOzflc2nNlTmlTmFe+BkFxqUww+070b3wi j+z0snIPYD2fqtslQ8Xqh69Bsbhy2VdKjKDbYg3I+FeWIrhBzE+REU9ujYj8VLzAh+ hEQbnLNv19tSPP1NcRrClSze0OI8yifmVNc4GfjUKlGc3Mub2axAY0fEVpr4lrfZiG 4FxqF5g/duMRu8+oaSC7+lPoraPURFQjQp5RxQ/qKsB/Ve5DnB4BcfikdP4jsXNzC7 zDk+Fr4WJxIU0bY040HiylXA0evyqD5L0guCEiIIbzise6wtDY/WCwPKCnW7r38KCA XdRVIIQBOl69w== Received: by pali.im (Postfix) id 0C4E18A7; Thu, 11 Mar 2021 13:38:44 +0100 (CET) Date: Thu, 11 Mar 2021 13:38:44 +0100 From: Pali =?utf-8?B?Um9ow6Fy?= To: Jianjun Wang Cc: Bjorn Helgaas , Rob Herring , maz@kernel.org, Lorenzo Pieralisi , Ryder Lee , Philipp Zabel , Matthias Brugger , linux-pci@vger.kernel.org, linux-mediatek@lists.infradead.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Sj Huang , youlin.pei@mediatek.com, chuanjia.liu@mediatek.com, qizhong.cheng@mediatek.com, sin_jieyang@mediatek.com, drinkcat@chromium.org, Rex-BC.Chen@mediatek.com, anson.chuang@mediatek.com Subject: Re: [v8,3/7] PCI: mediatek-gen3: Add MediaTek Gen3 driver for MT8192 Message-ID: <20210311123844.qzl264ungtk7b6xz@pali> References: <20210224061132.26526-1-jianjun.wang@mediatek.com> <20210224061132.26526-4-jianjun.wang@mediatek.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20210224061132.26526-4-jianjun.wang@mediatek.com> User-Agent: NeoMutt/20180716 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210311_123850_203389_DF01088F X-CRM114-Status: GOOD ( 12.73 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wednesday 24 February 2021 14:11:28 Jianjun Wang wrote: > +static int mtk_pcie_startup_port(struct mtk_pcie_port *port) > +{ ... > + > + /* Delay 100ms to wait the reference clocks become stable */ > + msleep(100); > + > + /* De-assert PERST# signal */ > + val &= ~PCIE_PE_RSTB; > + writel_relaxed(val, port->base + PCIE_RST_CTRL_REG); Hello! This is a new driver which introduce yet another custom timeout prior PERST# signal for PCIe card is de-asserted. Timeouts for other drivers I collected in older email [2]. Please look at my email [1] about PCIe Warm Reset if you have any clue about it. Lorenzo and Rob already expressed that this timeout should not be driver specific. But nobody was able to "decode" and "understand" PCIe spec yet about these timeouts. > + > + /* Check if the link is up or not */ > + err = readl_poll_timeout(port->base + PCIE_LINK_STATUS_REG, val, > + !!(val & PCIE_PORT_LINKUP), 20, > + 50 * USEC_PER_MSEC); IIRC, you need to wait at least 100ms after de-asserting PERST# signal as it is required by PCIe specs and also because experiments proved that some Compex wifi cards (e.g. WLE900VX) are not detected if you do not wait this minimal time. > + if (err) { > + val = readl_relaxed(port->base + PCIE_LTSSM_STATUS_REG); > + dev_err(port->dev, "PCIe link down, ltssm reg val: %#x\n", val); > + return err; > + } [1] - https://lore.kernel.org/linux-pci/20210310110535.zh4pnn4vpmvzwl5q@pali/ [2] - https://lore.kernel.org/linux-pci/20200424092546.25p3hdtkehohe3xw@pali/ _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel