Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp7890604rwr; Wed, 10 May 2023 14:18:34 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4Djn+npair+cuGTi83N6JXWhbSCN7LQxQYEW+k6Gav6zrXxaXnjaR4AEodBWKh50LS1dK8 X-Received: by 2002:a05:6a00:1828:b0:643:9b40:103e with SMTP id y40-20020a056a00182800b006439b40103emr24090250pfa.30.1683753514132; Wed, 10 May 2023 14:18:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683753514; cv=none; d=google.com; s=arc-20160816; b=cPQp8G88VEZQaRVRmpQBF/qGp/KmFu9dfaJ4Ohnbhx1p1JKMeLguqgB7ewHR/G3G0N Ja5fcG30ngp/G8oazvOhi9CRQvM4A8YbDB9uZS14cyR6e5PiVLmUMkXE8tQKk57thc0K DwV8lqiFxtwqrZ78TFXFWYhWqWnSA/8abzfiOLwCTtQgHCz+B0a+oz+d6YQZvlVlAS3u No8E27UjEq+vkreUEOdjSlpzDKFm07ZHNVe5JeTE85cr0geNcIXq0nzdiz0IA3xmDx60 rOsMMZHeLC0hqWPBWdXCsROR4DraSb0scOJiaBFrXTpZIKoa83A8tc3P6JYP/Zc0moaz TclQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:message-id:subject:cc:to:from:date :dkim-signature; bh=n7KXj8aIzYof2A17BYl4cR0Oj2/WUv6DvgafdXcJCLc=; b=x27KZSxgq40+xhfPWVvoryLfEmX50T28fUN0wPJleB/TcrJiyfUO5f6CrWMEt0pV6B 5PDT+pubJfrFOB+tqu4kcqfftTv9Pn6hI/xnOdbz7L57CrHygNOSlsbglNITpPR3G62D T9uJNwhbGPa+IOmvVMRzGU5FT0w5fCNyrP5Rn2NBXQq5oseDKKkg/WQGmdQsYQkJVbhA accMLmbYmsjfu/cpfLOkPw9fPdvR1vK45BCXbakGGp6QrulBkygXAZ6fXBRVgwIZK18D DiheZnJobl6xLkOmKxcdEnI7e7JpUVjOjoumIJJXDowfjxUEGu1SDEnDnTNm3RSxXZrt 7y4g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=jWrc2Fp4; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f26-20020a63755a000000b0051b48085aaasi4934586pgn.858.2023.05.10.14.18.22; Wed, 10 May 2023 14:18:34 -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=@kernel.org header.s=k20201202 header.b=jWrc2Fp4; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229610AbjEJUsE (ORCPT + 99 others); Wed, 10 May 2023 16:48:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230004AbjEJUsC (ORCPT ); Wed, 10 May 2023 16:48:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2100C10FA; Wed, 10 May 2023 13:48:01 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9DCFC64043; Wed, 10 May 2023 20:48:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8B46C433D2; Wed, 10 May 2023 20:47:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1683751680; bh=p1v9BgVQxNA6CFzcqYCk9q5zJL82xRDoaqm5OkM6CLg=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=jWrc2Fp4/sCVBp6UHKhYlkrY8SgsyIV1wgvS1fT/r2/D0jxYgQ0LsGjy8CTO+dRSV MeUtgW5MbckP8PH4JKRXRc2HjkiksoEE+2fvebpIt2/1WRl8MWeoLKYXwK2XbGJ8eq h3Vd9/7EDn8otCnP42jgnCokGb7J0bGy4j4y7UzVVQliiTs67fxCcRGNhGh/BNxwuv jj7lz8nAhxCjQ7EwG34CFIavsuOrEysWMXjda8d/QAscgTcZ7z6olL/VpTZgyK8CNG oMqpOAQC2uHVa5owxMaThE5Yj2W2Ph8LeLMN4Ksy4njspZ996Tb4XTOdzB6x2YbGQ+ 1jzhTYmToHSdA== Date: Wed, 10 May 2023 15:47:58 -0500 From: Bjorn Helgaas To: Peter Geis Cc: Vincenzo Palazzo , linux-pci@vger.kernel.org, robh@kernel.org, heiko@sntech.de, kw@linux.com, shawn.lin@rock-chips.com, linux-kernel@vger.kernel.org, lgirdwood@gmail.com, linux-rockchip@lists.infradead.org, broonie@kernel.org, bhelgaas@google.com, linux-kernel-mentees@lists.linuxfoundation.org, lpieralisi@kernel.org, linux-arm-kernel@lists.infradead.org, Dan Johansen Subject: Re: [PATCH v1] drivers: pci: introduce configurable delay for Rockchip PCIe bus scan Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, 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 On Tue, May 09, 2023 at 08:11:29PM -0400, Peter Geis wrote: > On Tue, May 9, 2023 at 5:19 PM Bjorn Helgaas wrote: > > On Tue, May 09, 2023 at 05:39:12PM +0200, Vincenzo Palazzo wrote: > > > Add a configurable delay to the Rockchip PCIe driver to address > > > crashes that occur on some old devices, such as the Pine64 RockPro64. > > > > > > 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. > > ... > The main issue with the rk3399 is the PCIe controller is buggy and > triggers a SoC panic when certain error conditions occur that should > be handled gracefully. One of those conditions is when an endpoint > requests an access to wait and retry later. I assume this refers to a Completion with Request Retry Status (RRS)? > Many years ago we ran that issue to ground and with Robin Murphy's > help we found that while it's possible to gracefully handle that > condition it required hijacking the entire arm64 error handling > routine. Not exactly scalable for just one SoC. Do you have a pointer to that discussion? The URL might save repeating the whole exercise and could be useful for the commit log when we try to resolve this. > The configurable waits allow us to program reasonable times for > 90% of the endpoints that come up in the normal amount of time, while > being able to adjust it for the other 10% that do not. Some require > multiple seconds before they return without error. Part of the reason > we don't want to hardcode the wait time is because the probe isn't > handled asynchronously, so the kernel appears to hang while waiting > for the timeout. Is there some way for users to figure out that they would need this property? Or is it just "if your kernel panics on boot, try adding or increasing "bus-scan-delay-ms" in your DT? Bjorn