From patchwork Fri May 12 19:27:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Soeren Moch X-Patchwork-Id: 761832 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3wPg3S6vTDz9s7B for ; Sat, 13 May 2017 05:27:32 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id C5429C21E8A; Fri, 12 May 2017 19:27:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=FREEMAIL_FROM, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id AD8ECC21DEC; Fri, 12 May 2017 19:27:26 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id EF784C21DEC; Fri, 12 May 2017 19:27:24 +0000 (UTC) Received: from mout.web.de (mout.web.de [212.227.15.14]) by lists.denx.de (Postfix) with ESMTPS id 8C20FC21D0E for ; Fri, 12 May 2017 19:27:24 +0000 (UTC) Received: from [192.168.43.108] ([89.15.237.101]) by smtp.web.de (mrweb001 [213.165.67.108]) with ESMTPSA (Nemesis) id 0MgOQQ-1dKtTw39Lq-00Ng96; Fri, 12 May 2017 21:27:23 +0200 From: Soeren Moch To: Tim Harvey In-Reply-To: Message-ID: <4fbcb9d8-6e5b-064f-8628-1784bc757f10@web.de> Date: Fri, 12 May 2017 21:27:20 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 X-Provags-ID: V03:K0:xk0BI4NDX7Bx5jgJgrLH77ySEQg09RUoOIe0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peter Senna Tschudin , Lucas Stach Subject: Re: [U-Boot] [RFC] drivers: pci: imx: add imx_pcie_remove function X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" > Date: Thu, 11 May 2017 07:02:52 -0700 > From: Tim Harvey > To: Stefano Babic > Cc: Marek Vasut , U-Boot-Denx , > Peter Senna Tschudin , Lucas Stach > > Subject: Re: [U-Boot] [RFC] drivers: pci: imx: add imx_pcie_remove > function > Message-ID: > > Content-Type: text/plain; charset="UTF-8" > > On Thu, May 11, 2017 at 6:18 AM, Stefano Babic wrote: > > Hi Fabio, > > > > On 11/05/2017 13:06, Fabio Estevam wrote: > >> On Thu, May 11, 2017 at 6:01 AM, Peter Senna Tschudin > >> wrote: > >> > >>> Thank you for working on this! Your patch worked for me, but I needed to > >>> add an "extern void imx_pcie_remove(void);" before calling the function, > >>> which probably means I'm missing something. > >> The extern should be added into a header file. > >> > >>> After applying this patch to u-boot, u-boot can initialize PCI and > >>> 4.11.0-next-20170510 will boot. Without your patch 4.11.0-next-20170510 > >>> do not boot if u-boot initialize the PCI bus. > >>> > >>> Thanks a lot! > >>> > >>> Here is the patch I'm using for our board: > >> Stefano, > >> > >> The patches that Tim/Peter posted solve a kernel hang with kernel 4.11 > >> on mx6q when U-Boot has PCI support. > >> > >> Could you please take a look and let us know if there is a more > >> generic way to fix this issue, like fixing it for all mx6qdl boards > >> that have PCI support? > >> > >> I understand that ideally the imx6 pci driver should be converted to > >> driver model and then we add the .remove hook, like Lucas did for > >> Barebox: > >> https://git.pengutronix.de/cgit/barebox/commit/?id=f1da98da2760c21487bbba8f7fb957c843a22896 > >> > >> While the imx pci driver is not converted to device model, would you > >> be willing to accept such per board patches for the time being? > >> > >> Please advise. > > > > Ok - let wait for Tim's answer, if he has enough time to work on this to > > move to DM. If not, it will be ok for now to fix it in this way, hoping > > to move soon to DM. > > > > Regards, > > Stefano > Stefano, > > I don't have enough time to work on the DM conversion currently but it > sounds like this would be a welcomed 'fix' that we should get in > sooner than later. > > I know the include is missing from a header but I didn't bother as I > though there would be a better arch-specific place to put the call to > the remove. I don't think putting it in ft_board_setup made sense. Do > you have any suggestions where it should go? > > Tim Tim, this patch in addition to your original drivers/pci/pcie_imx.c changes works for me on a tbs2910 board. Since I did not touch board-specific code, this should also work for all affected boards. Regards, Soeren diff --git a/arch/arm/imx-common/cpu.c b/arch/arm/imx-common/cpu.c index 40fe813..7ed9ca0 100644 --- a/arch/arm/imx-common/cpu.c +++ b/arch/arm/imx-common/cpu.c @@ -273,8 +273,13 @@ u32 get_ahb_clk(void) } #endif +extern void imx_pcie_remove(void); + void arch_preboot_os(void) { +#if defined(CONFIG_PCIE_IMX) + imx_pcie_remove(); +#endif #if defined(CONFIG_CMD_SATA) sata_stop(); #if defined(CONFIG_MX6)