Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2951716pxu; Mon, 14 Dec 2020 15:40:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJyr3dMg7xCeU+iz5/Xc/WfXQNvXBLy7at9q/GU20oLCzZUJ6m5Zqtrcy8JljHZilUL5Ex+m X-Received: by 2002:a05:6402:1765:: with SMTP id da5mr27653291edb.27.1607989228273; Mon, 14 Dec 2020 15:40:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607989228; cv=none; d=google.com; s=arc-20160816; b=sDvrSLoDI8TJEZXfFxbb7DYIP9BxNXVL2iIG90k8cKFZt2gSFnZRlwe4rlmNCGHZmj 1jtpKeHB7yvmVKTOkqFB6A5QFLLjW0hVreVJ7+/nSKqOHtvmxcMXWNqXYMpMC9QFk6WY VMG8Jy5q1tYgt2TH7X+vp2c7MmEIFV8TOl7tsNpfjktrjcY54o+foBL/TdddxpKE882e q77IqZPvxZ4mpTifgIFz9aKXK6ST3Opx+5bscmEuMTbvxmwdBZs2Bpfehwf8SEyiGGGr 2TWO33wFUPvUB/4r9DKDWOKj+1rlGrATpbwsUnlSxJtX5dbDL16dXBJ2L9C9sPa+YisP J6Sg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=XN2z8/Tfl1Xi8IB7BwinKSQQAcePsN0vQO8EQZh2uQ0=; b=Fvcp69aaY2v/ZlAEzUWrhCIcdhiiTUDHGdKHxRwff0a8mTRw6/ZDLgmEOudYinn1A0 WuE6zaGWBHSNhnOyj8AkNBGw9OnxeHBwgUy62SxSurshWp5CNN+0yuVwYIdxZvPiyme0 J60+ChW/di99JQBivoNA87MHNYZVzC91uDweXUtaZyjivDlBFTZONMc5xl8ofwt/jkGy lI+QsborxkwapEkuuWZiVx0MaYU2FAJ7n/08Ig1pobYv4EIXNwInODBPhxW4aF+ud9xd eedTf8+D/yhqcl0Yf3TyQirYCAaWa2c/PcpP0iCGNQhfarYD7ItNJYbkmqNXVCUgOnrU BKNw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E338AB4T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a7si4569ejc.733.2020.12.14.15.40.05; Mon, 14 Dec 2020 15:40:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=E338AB4T; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S2408293AbgLNO6w (ORCPT + 99 others); Mon, 14 Dec 2020 09:58:52 -0500 Received: from mail.kernel.org ([198.145.29.99]:46380 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407905AbgLNO6c (ORCPT ); Mon, 14 Dec 2020 09:58:32 -0500 X-Gm-Message-State: AOAM531xvQIO47hW+9J+BOisfG3zlGs+k1M4P6s5hQAsBe/xHa5qvY0+ yTRiJ9VJNIqV4JGq/hhLPHq+KvOLR+wKwSY8JQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1607957870; bh=YjqfvjSV9lpOWWw1+HWGyAfGe7Q5uZpQr/FuGmIm8vk=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=E338AB4Tg40+60Asw0fBlGJ4Z4Ibb4OwsmIqeAEmrBh6BxZ9sifmmPx0EG1wdoP2A FEXMPIoh5+e0aDyaT2hqsftFKBJ2vaiUHv0gbnTSQtE87xcSFbqNXZzAFxI9/7bP5o LaL6VGdUgV+ur7ZrBgvTvedPGU6gDep4Yd0iNyUSbxaVE5Ytf1yc84a92owqvw3Rq4 qJX95mj8Aw2wFwlx2uiKwaehcV7og3BGBUeL2TlGoohHPBwF23o6aLQCR9H11Mpdmk kW8wpCrlnYXsVargOW3zvZ9j8Z10gLWL1HWhRg+2KVGlDQcAWe5wmo9NCkkkhkkzXE BZaTQK2NovtQw== X-Received: by 2002:a05:6402:1841:: with SMTP id v1mr25750693edy.194.1607957868199; Mon, 14 Dec 2020 06:57:48 -0800 (PST) MIME-Version: 1.0 References: <20201211121507.28166-1-daniel.thompson@linaro.org> <20201211170558.clfazgoetmery6u3@holly.lan> <20201214104337.wbvq2gvj3wi6bvzc@holly.lan> In-Reply-To: <20201214104337.wbvq2gvj3wi6bvzc@holly.lan> From: Rob Herring Date: Mon, 14 Dec 2020 08:57:36 -0600 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC HACK PATCH] PCI: dwc: layerscape: Hack around enumeration problems with Honeycomb LX2K To: Daniel Thompson Cc: Minghuan Lian , Mingkai Hu , Roy Zang , Lorenzo Pieralisi , Bjorn Helgaas , Jon Nettleton , linuxppc-dev , PCI , linux-arm-kernel , "linux-kernel@vger.kernel.org" , Linaro Patches Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 14, 2020 at 4:43 AM Daniel Thompson wrote: > > On Fri, Dec 11, 2020 at 05:05:58PM +0000, Daniel Thompson wrote: > > On Fri, Dec 11, 2020 at 08:37:40AM -0600, Rob Herring wrote: > > > On Fri, Dec 11, 2020 at 6:15 AM Daniel Thompson > > > > BTW I noticed many other pcie-designware drivers take advantage > > > > of a function called dw_pcie_wait_for_link() in their init paths... > > > > but my naive attempts to add it to the layerscape driver results > > > > in non-booting systems so I haven't embarrassed myself by including > > > > that in the patch! > > > > > > You need to look at what's pending for v5.11, because I reworked this > > > to be more unified. The ordering of init is also possibly changed. The > > > sequence is now like this: > > > > > > dw_pcie_setup_rc(pp); > > > dw_pcie_msi_init(pp); > > > > > > if (!dw_pcie_link_up(pci) && pci->ops->start_link) { > > > ret = pci->ops->start_link(pci); > > > if (ret) > > > goto err_free_msi; > > > } > > > > > > /* Ignore errors, the link may come up later */ > > > dw_pcie_wait_for_link(pci); > > > > Thanks. That looks likely to fix it since IIUC dw_pcie_wait_for_link() > > will end up waiting somewhat like the double check I added to > > ls_pcie_link_up(). > > > > I'll take a look at let you know. > > Yes. These changes have fixed the enumeration problems for me. > > I tested pci/next and I cherry picked your patch series onto v5.10 and > both are working well. > > Given this fixes a bug for me, do you think there is any scope for me > to whittle down your series into patches for the stable kernels or am > I likely to find too many extra bits being pulled in? I think I'd just go the adding a delay route. It's a fairly big series and depends on my other clean-up done in 5.10. And there's at least some possibility it regresses some platform given the limited testing linux-next gets. Rob