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 D1DEBC64EC7 for ; Wed, 1 Mar 2023 04:36:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229658AbjCAEgs (ORCPT ); Tue, 28 Feb 2023 23:36:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53312 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229481AbjCAEgp (ORCPT ); Tue, 28 Feb 2023 23:36:45 -0500 Received: from mail-pl1-x633.google.com (mail-pl1-x633.google.com [IPv6:2607:f8b0:4864:20::633]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2139437B66 for ; Tue, 28 Feb 2023 20:36:44 -0800 (PST) Received: by mail-pl1-x633.google.com with SMTP id h8so9438701plf.10 for ; Tue, 28 Feb 2023 20:36:44 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; t=1677645403; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=+W9hQB51GTypbp+uatvOUzvRwGcaPVnhPF9GgCO6eqI=; b=AnRY7ccWRsYs3zRIdEKJLQBSCVf0fUPTLiAHT9XmcwNbQkcH9fMM4/cbAOQuVlZlKG 5AqVm6xK/UPy/vjoQUo6l8HjIJQNRytHJ/ERoq9zI+OHpZNddVPpuv1/KHCJXT5bzmmS 7udadIK8zer8L4x8agk+wvLESsQui9n5rxG2aDY7yV/AYyCElgO9m4C+6HAf/bWySF1G P5kptiIyZqdyHejGSAA7BlNQd2BDohPXC8H/0BttdYLY06mboW2II8QO6v+LmftLNujP ItXNxKHY9R9wrkkDuSY7R8NGlJfQFQTch97uCLcSVNjq8RUb/GJqKn4/U5sqjMNx8aCr WNMA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677645403; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+W9hQB51GTypbp+uatvOUzvRwGcaPVnhPF9GgCO6eqI=; b=mx5Pu9TJWvUcKz5LR/6uzw4PAmmh42+lUAXuKqQiLKlh7YlkMBJz/d7EjNluX9Fchb 6d5y8GZAzZb6LsHWpiMJAYnAm5klMQ0fK2j/2D9IlsvvF0mZ7IndJT+zakbGYIS1/aBo g6l5BdTTKCxzOnU8xiDvkivHI907w3WKjtV9ZsNbq2KV1BcoqlduOB5LTPipq/3KQSWv 3P5wwjfr3vWpQFXDPH3VjKxVCksog0mNIS9jNA1m/Ord4NXy0NoZ+qMQJQNXLU/o2C5J 97aonhrRQnnD4QNu2Ycb6r/JpBBoigJ3U8/E5whQc+Pazh+dVBU5Rm1Q9m6eb+c07udt TpBw== X-Gm-Message-State: AO0yUKXBffuOBlTLVtoq4iBsihliXOIm0DisYq5cjojd1x8hRvRXRgEh BM4+IO6DSbzc8tvfDvC+iHk96UFpybbFq3nuVZO6rw== X-Google-Smtp-Source: AK7set+oKzqEVt4NgiziRq+yuTqy6i2IUUU+8AQGvoAw0MZB2Cj+yYzNgM6sZUXMm5wNsHDayS9TZkMZimB5vB0Dn1s= X-Received: by 2002:a17:90b:368e:b0:233:d131:29be with SMTP id mj14-20020a17090b368e00b00233d13129bemr1967203pjb.9.1677645402446; Tue, 28 Feb 2023 20:36:42 -0800 (PST) MIME-Version: 1.0 References: <20230227201340.2087605-1-sdalvi@google.com> In-Reply-To: From: Sajid Dalvi Date: Tue, 28 Feb 2023 22:36:31 -0600 Message-ID: Subject: Re: [PATCH v2] PCI: dwc: Wait for link up only if link is started To: Han Jingoo Cc: Gustavo Pimentel , Lorenzo Pieralisi , =?UTF-8?Q?Krzysztof_Wilczy=C5=84ski?= , Rob Herring , Bjorn Helgaas , kernel-team@android.com, linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Krzysztof Kozlowski Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thanks for your review Jingoo. Sajid On Tue, Feb 28, 2023 at 4:04=E2=80=AFPM Han Jingoo w= rote: > > On Mon, Feb 27, 2023, Sajid Dalvi wrote: > > > > In dw_pcie_host_init() regardless of whether the link has been started > > or not, the code waits for the link to come up. Even in cases where > > start_link() is not defined the code ends up spinning in a loop for 1 > > second. Since in some systems dw_pcie_host_init() gets called during > > probe, this one second loop for each pcie interface instance ends up > > extending the boot time. > > > > Call trace when start_link() is not defined: > > dw_pcie_wait_for_link << spins in a loop for 1 second > > dw_pcie_host_init > > > > Signed-off-by: Sajid Dalvi > > (CC'ed Krzysztof Kozlowski) > > Acked-by: Jingoo Han > > It looks good to me. I also checked the previous thread. > I agree with Krzysztof's opinion that we should include > only hardware-related features into DT. > Thank you. > > Best regards, > Jingoo Han > > > --- > > drivers/pci/controller/dwc/pcie-designware-host.c | 6 +++--- > > 1 file changed, 3 insertions(+), 3 deletions(-) > > > > diff --git a/drivers/pci/controller/dwc/pcie-designware-host.c b/driver= s/pci/controller/dwc/pcie-designware-host.c > > index 9952057c8819..9709f69f173e 100644 > > --- a/drivers/pci/controller/dwc/pcie-designware-host.c > > +++ b/drivers/pci/controller/dwc/pcie-designware-host.c > > @@ -489,10 +489,10 @@ int dw_pcie_host_init(struct dw_pcie_rp *pp) > > ret =3D dw_pcie_start_link(pci); > > if (ret) > > goto err_remove_edma; > > - } > > > > - /* Ignore errors, the link may come up later */ > > - dw_pcie_wait_for_link(pci); > > + /* Ignore errors, the link may come up later */ > > + dw_pcie_wait_for_link(pci); > > + } > > > > bridge->sysdata =3D pp; > > > > -- > > 2.39.2.722.g9855ee24e9-goog > >