From patchwork Fri Feb 24 19:57:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sajid Dalvi X-Patchwork-Id: 13151756 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E142CC6FA8E for ; Fri, 24 Feb 2023 19:58:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229724AbjBXT6R (ORCPT ); Fri, 24 Feb 2023 14:58:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48366 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229712AbjBXT6Q (ORCPT ); Fri, 24 Feb 2023 14:58:16 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AE82A193F7 for ; Fri, 24 Feb 2023 11:58:08 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-536d63d17dbso4559167b3.22 for ; Fri, 24 Feb 2023 11:58:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1677268688; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=a5ozTt3+xQs6+7ogbKaGsgcnydK5zFBxlpY+OKLh75k=; b=YcHnei0sgU7WOBbwBcC7bYeBQfgTTWPvFHN1cEwg309Bo29+1Jx1Q0KA0jAAG9dXfC BW/r+PmCY9a1ZuL6cO8dLH8xvNEqVek3VWt/wDEh39fqa4+sEFP66cyAwTSwl4SpiIx0 QinhZSelVJ60nB+HoFFY66n5Km/2O15ZLohjdU31tx7+FPEJRd2bgYwoXd4SmHapSCHA APm579m23p3/j/nSqcOqjB/z5LbkfPkxCzAEJYTFsvHrOgrBbuPKrB/EbR0zdWqxSD7u eKEldJWXt+tWjZuGz9MQzY/kMURuHmutEmkQRt1mNB2l8Y41YUP5yKz3OGTm2ehIrcq0 QTtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677268688; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=a5ozTt3+xQs6+7ogbKaGsgcnydK5zFBxlpY+OKLh75k=; b=gypdDzGUgllSgSMdwnGrn4Zb3s+Qe8VDwF0HXC5KSVBYZFfJttoNaDnxEzroVIvnE9 DqlzDXeYB3k+AccbeejBSnQJaD8hW7GEzuf5E2alWyxJtV0jDmoSUKrjBI0rQlcxbq1o CSUQkPnzfmVSGeHz1fg44gj3oZBQZnCdqkOVr/UFsKUo1hn/B+GecuypIemv+14HfCik 7VksQMhoEbX52LoSsFTlnMAisMaoc0j19cjegviWER6JvFYLd+s77IEi/RfVLCTEHc25 30G1xO4orJ3FBVE+zMbSsg9ufX36U28aK4SGj60lLHMtc2ctPY1ADWCNNZHSdkj7Lhh9 ZE/Q== X-Gm-Message-State: AO0yUKWXaXDZBEgOv8X7sBZoq3YsvUy2e8AhPCRCLtmoRJT4NcOABjG4 QGddGqnr/7JfPxOgjL+lY9TO6Ut7B2A= X-Google-Smtp-Source: AK7set+btwFgubuHZ/Rb4MNnccdpV/hP9fK6leiIOl8RXG+/oNxNWwAZcOBowLTFIYv5GMhm2C+RP7jXmRM= X-Received: from sdalvi-android.chi.corp.google.com ([2620:15c:2:a:1808:5921:faf8:7a68]) (user=sdalvi job=sendgmr) by 2002:a05:690c:583:b0:538:49a4:b1e0 with SMTP id bo3-20020a05690c058300b0053849a4b1e0mr720665ywb.2.1677268687916; Fri, 24 Feb 2023 11:58:07 -0800 (PST) Date: Fri, 24 Feb 2023 13:57:46 -0600 In-Reply-To: <20230224195749.818282-1-sdalvi@google.com> Mime-Version: 1.0 References: <20230224195749.818282-1-sdalvi@google.com> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog Message-ID: <20230224195749.818282-2-sdalvi@google.com> Subject: [PATCH v1 1/2] dt-bindings: PCI: dwc: Add snps,skip-wait-link-up From: Sajid Dalvi To: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , " =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= " , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski Cc: Sajid Dalvi , kernel-team@android.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org When the Root Complex is probed, the default behavior is to spin in a loop waiting for the link to come up. In some systems the link is not brought up during probe, but later in the context of an end-point turning on. This property will allow the loop to be skipped. Signed-off-by: Sajid Dalvi --- Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml b/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml index 1a83f0f65f19..0b8950a73b7e 100644 --- a/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml +++ b/Documentation/devicetree/bindings/pci/snps,dw-pcie.yaml @@ -197,6 +197,14 @@ properties: - contains: const: msi + snps,skip-wait-link-up: + $ref: /schemas/types.yaml#/definitions/flag + description: + When the Root Complex is probed, the default behavior is to spin in a + loop waiting for the link to come up. In some systems the link is not + brought up during probe, but later in the context of an end-point turning + on. This property will allow the loop to be skipped. + additionalProperties: true required: From patchwork Fri Feb 24 19:57:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sajid Dalvi X-Patchwork-Id: 13151757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id AAE12C7EE23 for ; Fri, 24 Feb 2023 19:58:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229736AbjBXT61 (ORCPT ); Fri, 24 Feb 2023 14:58:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229737AbjBXT60 (ORCPT ); Fri, 24 Feb 2023 14:58:26 -0500 Received: from mail-yw1-x114a.google.com (mail-yw1-x114a.google.com [IPv6:2607:f8b0:4864:20::114a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 440C76A794 for ; Fri, 24 Feb 2023 11:58:14 -0800 (PST) Received: by mail-yw1-x114a.google.com with SMTP id 00721157ae682-536a5a0b6e3so5635697b3.10 for ; Fri, 24 Feb 2023 11:58:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1677268693; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=HItKTiGQPlQYCMjDtIoBxaJw1Pu4dDmMmJ8dk4P8cQE=; b=cFXgXNHH0TIBYGBXQK+NGFbDWGGG9gu153NQeVh/+J0c8SNKdNfW9Q60AuZrfAsX48 vjEPsPHHbMFib+HOiDp9vjK/qwSKx+iN67T8D7ZEQRGrsREGiEf6JIeaqPpjTMEyQUW0 hsTDPHU2y91qXxeXfzzrKDe0Kc8PVVGcr6IaejwzYWj2WnrYEwsai79jb4TqJGOBlecf EqE+L6RaLt4syuvJhi7XYIKkreiRdvv9+zNqfcyWAr643l8IG9xnrxi/Fsm3v0i4gRQY fGrzB+2ajlUMh2fMPxiGJOzHqNQkGMQrrJ/bQz2LblBj9kY4auTbcLMLdJsagYmi4XkQ DYow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677268693; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=HItKTiGQPlQYCMjDtIoBxaJw1Pu4dDmMmJ8dk4P8cQE=; b=B9hqlAZCJm5cJvZ8okh6LcLllWhxvDDeEGCoHx2zT54dDukAqJyr7gN77Kno5v3pCv PuaikVRsd+uw4L5ZIntapyg+tzvP9sCR+ZqCwedkUWEk+v7OcGtq5sRMrOGiJZXuV+Nv nltIbeGW544Hi6Jm+7Rw+ILrECUjvObaMKPJ0vKfWEcClKisY9kT+ip8gzqgAXsfjv2/ vd6Jb8NExcrQIuL34JkUBtcjxX4n39l2Bh1vqgXX1QV9k472YxqAU8v3DoddlM9oi7wO o6cDaZpSWHZMxCSN0AJOR2GWItKamgTWbcI+Jk+75CvzwdHRwo3eQtA1m6en3buSWwyi k5FQ== X-Gm-Message-State: AO0yUKWjiw1ljSO3wsw4qgRA/vKmVI8XFke56YUKRrWMcRhB7H49zbdF msbB47vU1d1xeuvgeGI10Js2wug1ecI= X-Google-Smtp-Source: AK7set+7KRAGVWv7u53lisKdJmZK7YsbzkRyOXJGQLoTktPLlGhyHTGqkcO/nEkhJUG7EkhdP4V77f40yrY= X-Received: from sdalvi-android.chi.corp.google.com ([2620:15c:2:a:1808:5921:faf8:7a68]) (user=sdalvi job=sendgmr) by 2002:a05:6902:4d4:b0:855:fa17:4f66 with SMTP id v20-20020a05690204d400b00855fa174f66mr4840916ybs.8.1677268693379; Fri, 24 Feb 2023 11:58:13 -0800 (PST) Date: Fri, 24 Feb 2023 13:57:47 -0600 In-Reply-To: <20230224195749.818282-1-sdalvi@google.com> Mime-Version: 1.0 References: <20230224195749.818282-1-sdalvi@google.com> X-Mailer: git-send-email 2.39.2.637.g21b0678d19-goog Message-ID: <20230224195749.818282-3-sdalvi@google.com> Subject: [PATCH v1 2/2] PCI: dwc: Skip waiting for link up on probe From: Sajid Dalvi To: Jingoo Han , Gustavo Pimentel , Lorenzo Pieralisi , " =?utf-8?q?Krzysztof_Wilczy?= =?utf-8?q?=C5=84ski?= " , Rob Herring , Bjorn Helgaas , Krzysztof Kozlowski Cc: Sajid Dalvi , kernel-team@android.com, linux-pci@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Andrew Chant Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org When the Root Complex is probed, the default behavior is to spin in a loop waiting for the link to come up. In some systems the link is not brought up during probe, but later in the context of an end-point turning on. Call trace: dw_pcie_wait_for_link << spins in a loop for 1 second dw_pcie_host_init Adding the snps,skip-wait-link-up property in the pcie device tree node will skip this loop and save 1 second per interface on pcie probe for systems that do not need to bring up the link this early in the boot sequence. Signed-off-by: Sajid Dalvi Signed-off-by: Andrew Chant --- drivers/pci/controller/dwc/pcie-designware-host.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/drivers/pci/controller/dwc/pcie-designware-host.c index 3ab6ae3712c4..f5cba44ebf39 100644 --- a/drivers/pci/controller/dwc/pcie-designware-host.c +++ b/drivers/pci/controller/dwc/pcie-designware-host.c @@ -477,8 +477,9 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) goto err_free_msi; } - /* Ignore errors, the link may come up later */ - dw_pcie_wait_for_link(pci); + if (!of_property_read_bool(np, "snps,skip-wait-link-up")) + /* Ignore errors, the link may come up later */ + dw_pcie_wait_for_link(pci); bridge->sysdata = pp;