Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7156908rwr; Wed, 10 May 2023 04:52:16 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ59rQn/mpJJPXRy6PBUUKMkenAHsc18qbYhutmr9yaN38AuAPq+QeyVzoda0URx/aIKKMy0 X-Received: by 2002:a05:6a21:6318:b0:ef:95ee:895a with SMTP id wu24-20020a056a21631800b000ef95ee895amr18088810pzb.30.1683719536646; Wed, 10 May 2023 04:52:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683719536; cv=none; d=google.com; s=arc-20160816; b=LLDogF860gqeGDsAe0V/FGMjCA6l+eyMn3UtSwdr9kuo/PkYxMScp8EWY3Ao9cA4Il 9czPUdeIFpDIwvvB+nM5/VOkRitDioa9IWEby2lDUJbetDtIyEGe5nrT0PaD5hSTu85L 3j46K0k03REvJAKt6Xpa9EFPNYjxB7xjzhTP+DYKwjaonCa5MSDdEty2ZnxW9a1OmnXI DOfx3zEP3so1l3CkNfmdp6B6X9zjt+DjOYv5KR/9R0UnvXKACGAoqNT/S90I9wPZkZnS KjbXPgCLzXZQcWIpJPAJ59kKYpYWKF9mgZcV+waWjXkGA2RnRNNDTO/mt3nOw0aiNjkl AwcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:references:cc:to:from:subject :message-id:date:content-transfer-encoding:mime-version :dkim-signature; bh=tvApClf6Vwq7pYYq456swXVsLdXe4Yk/kHkfI1zIbf0=; b=JkLKlcVTynG5Gp82bm4nZse0Zwx6BX3h1K0/lpCO3GuWjzYTp0OM/xgDzoSasw2s9M Wh3UhMaeRXxMee1LEZO4l6v8hpEfFNnz8ce7Lb5XgP6vP2ORzUeEW5gpoSDgLVL4AfAw DXCPaNv/DPW+tFV/TMLxpvyzd1MtA+bbjhB3fwocJRyEoe/GePwM7Wxs0A7857aXB+/l suXdovu0O9qpBBQNntFKu8aqyJ4+qypQC8X5/lgjQXx2g3y09NE3aP6WTP/sOmReXo3+ rLS+wnEbi+hax/K0xPY7zrAJ2Gv1SHkrA+Lyd3ESpdF2r3RYvv89NuvrVsKDT6LWoF5L pHTQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=A7JK7Aa8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j5-20020a637a45000000b005133c334fe0si3887628pgn.192.2023.05.10.04.52.04; Wed, 10 May 2023 04:52:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=A7JK7Aa8; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236928AbjEJLf4 (ORCPT + 99 others); Wed, 10 May 2023 07:35:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236926AbjEJLfu (ORCPT ); Wed, 10 May 2023 07:35:50 -0400 Received: from mail-wm1-x333.google.com (mail-wm1-x333.google.com [IPv6:2a00:1450:4864:20::333]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4A476173D; Wed, 10 May 2023 04:35:47 -0700 (PDT) Received: by mail-wm1-x333.google.com with SMTP id 5b1f17b1804b1-3f420618d5bso28677235e9.1; Wed, 10 May 2023 04:35:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1683718546; x=1686310546; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tvApClf6Vwq7pYYq456swXVsLdXe4Yk/kHkfI1zIbf0=; b=A7JK7Aa8+cE+lTIOQPBBguTGx4LVhzygAywBRaxRWDXJpKHRJStUaUY0rPCDStOCSq GBOwjR+1YuWTe1dVqZQcobgsVkrlYymiSSrIgo+y0ASEPz75m0AzfCcw0fQzFPjjjYS7 d6bzOGfAsvxNKXSfg0xZdsHy5GLoUdan879eDcH7YNC+L+C7ZB2Q+noqlVV1W1Pk56KR 7bEuYPaKJmyf9WpoT0p220LaMblPNU6x98SZYeR65vem9VFLS+ZxqbhOETZtq+tXPA5r PVytCKL5HNhUazNOxTgiBgva7e24kHjSXwKigglEJI+dTeP4GBSTvCjnBOWyCxdAaAqP 0bFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683718546; x=1686310546; h=in-reply-to:references:cc:to:from:subject:message-id:date :content-transfer-encoding:mime-version:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=tvApClf6Vwq7pYYq456swXVsLdXe4Yk/kHkfI1zIbf0=; b=Q8Fi6pjE1JQgGsYixguCQow2hYw3XPspzSk/WbnLT3LihHNjuVT6HzvksKmiz0qYbb 2Hc9DwaYfZehq5EgLQASNzsbaPk3SovUBwIjjIA2GRQBSPil3PvYQgbU3CppSLMxIUUa 2HLn5hRHk3VrwUPkrRyg458kTLfhGbZTldeq4TCUyqTa998QnJRyhoEPtO9rsODz+egf 3MOxW0t46z4lmsoox+os73uylfA8eKr/VQcavHPX3NmCnYTPxuNb2VWbLOsokVggWYve 7K08BDyC81V/G5rfuo4vOJhGnU6bz8imQev0YuLX0ftaFr92Scrs3YMRvI0CcObDg1ca 27og== X-Gm-Message-State: AC+VfDzleigypY4qzTaWzLNdvxG7hNVvIaycZoW9DUZwZOSm9upXLNyc 7tH/b2E1RRBbqzHrbQnGL9s= X-Received: by 2002:a05:600c:2298:b0:3f4:2bce:eeff with SMTP id 24-20020a05600c229800b003f42bceeeffmr3624831wmf.25.1683718545727; Wed, 10 May 2023 04:35:45 -0700 (PDT) Received: from localhost ([146.70.133.78]) by smtp.gmail.com with ESMTPSA id y10-20020a7bcd8a000000b003f16fc33fbesm22321946wmj.17.2023.05.10.04.35.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 10 May 2023 04:35:45 -0700 (PDT) Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 10 May 2023 13:35:43 +0200 Message-Id: Subject: Re: [PATCH v1] drivers: pci: introduce configurable delay for Rockchip PCIe bus scan From: "Vincenzo Palazzo" To: "Bjorn Helgaas" Cc: , , , , , , , , , , , , , "Dan Johansen" X-Mailer: aerc 0.15.1 References: <20230509153912.515218-1-vincenzopalazzodev@gmail.com> <20230509211902.GA1270901@bhelgaas> In-Reply-To: <20230509211902.GA1270901@bhelgaas> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Hi Vincenzo, Hi :) > Thanks for raising this issue. Let's see what we can do to address > it. Yeah, as I said in my cover letter, I am not happy with my solution, but we should start somewhere to discuss it. > > Add a configurable delay to the Rockchip PCIe driver to address > > crashes that occur on some old devices, such as the Pine64 RockPro64. > >=20 > > This issue is affecting the ARM community, but there is no > > upstream solution for it yet. > > It sounds like this happens with several endpoints, right? And I > assume the endpoints work fine in other non-Rockchip systems? If > that's the case, my guess is the problem is with the Rockchip host > controller and how it's initialized, not with the endpoints. Yeah, the crash is only reproducible with the Rockchip system, or better,= =20 the crash is reproducible only in some modern devices that use the old=20 Rockchip driver mentioned in this patch. > The only delays and timeouts I see in the driver now are in > rockchip_pcie_host_init_port(), where it waits for link training to > complete. I assume the link training did completely successfully > since you don't mention either a gen1 or gen2 timeout (although the > gen2 message is a dev_dbg() that normally wouldn't go to the console). > > I don't know that the spec contains a retrain timeout value. Several > other drivers use 1 second, while rockchip uses 500ms (for example, > see LINK_RETRAIN_TIMEOUT and LINK_UP_TIMEOUT). > > I think we need to understand the issue better before adding a DT > property and a module parameter. Those are hard for users to deal > with. If we can figure out a value that works for everybody, it would > be better to just hard-code it in the driver and use that all the > time. Yeah, I see, I see. This makes sense. Is there any path that I can follow i= n=20 order to better understand what's going on at the hardware level? In other= =20 words, how can I help to understand this issue better and provide a unique solution for everybody? Thanks for the nits in the patch, I will take a look with a fresh mind later in the day. Cheers! Vincent.