From patchwork Sun Jun 24 23:51:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10484935 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8BC1E6019D for ; Sun, 24 Jun 2018 23:51:37 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 80BAF28698 for ; Sun, 24 Jun 2018 23:51:37 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7511F28864; Sun, 24 Jun 2018 23:51:37 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.8 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2674C28698 for ; Sun, 24 Jun 2018 23:51:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752022AbeFXXvW (ORCPT ); Sun, 24 Jun 2018 19:51:22 -0400 Received: from mail-ot0-f194.google.com ([74.125.82.194]:38574 "EHLO mail-ot0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751982AbeFXXvV (ORCPT ); Sun, 24 Jun 2018 19:51:21 -0400 Received: by mail-ot0-f194.google.com with SMTP id w16-v6so4493073otk.5; Sun, 24 Jun 2018 16:51:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=/HBaArMgj9C6KEqAjvjAWzn59kkoG/COp3jOMwoCxns=; b=ffXNIPmKkuB8iQYWnUsznwvRJ3+81NyhNEp4m8AZg0SgoJ3hN7zWjftmsC2/T8tLc2 c/dxhTFQXVFa1FEpFiHhE7/Y+KkNyaCYnNsHM8eoTZLJkICLoF9EUHsw208sLjk/3pf9 tOpP/TKN168RppFgYKx1hxpogUzGcsHrXfjXHy3VFNYCeolvM+YLFf0bW3wJVIVkhFfX c9fY6RhFm4ceyW1YCtNjDhmt+aHqfy8V/iMqkqFpe+w/LvA9ahymQwkhJKcIVICWMnKJ LpvE8n3rdicoRkTPCDZHrkrQM+1OvwyMdroUAtpd612Ocd0JX4mXYHDjGR270giEMuA2 31Bw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=/HBaArMgj9C6KEqAjvjAWzn59kkoG/COp3jOMwoCxns=; b=dl+HJn2Wp0Ur2YRi/szLwzMcNxVSeY88njkZzHMIV6nehJ/0ptWwg7NifZPSCwipPI X39+Lp4itHT7hR5rBY9v6fduq8ZqRjdZbptYIyiucv1BK5W9jlaRHuBtuzJRkPv+Z4x3 iP7ett/7PqwmmW/ZscutgVgb5mBB/Q8texxRYfAngB1k2QtEERgJfnqO/TGxRaKWi/0n k545Kz8AsxikERG+L+2WEOXugZgMxLJhaaau0HAklJdIDnvEyVlyvabBQYPPeIcHb+nn zO2nxn2eieS/MaxcDsabKOwaZY5OBw6wLKF22rSKPHdx2r9GjTs024Ny7dtwYOczdm3I RoSA== X-Gm-Message-State: APt69E2fEGsQo7kwNCZCpXRk1nnrI41ElqfGKomDx5F1GMAVZkKcAVbQ +z8D/mgQ1LHIuwwYXYw1uygTaeBx/PDTgK/wEho= X-Google-Smtp-Source: ADUXVKKmDtdBMqfKEOkLeRvMbS98smSLv701Bb6IjIEpo3VpKPEP/cWnNB0tvcYOsH6tlTouqoz9tnMGWIdLlUCOleo= X-Received: by 2002:a9d:cc8:: with SMTP id o8-v6mr6675449otd.38.1529884280768; Sun, 24 Jun 2018 16:51:20 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a9d:1049:0:0:0:0:0 with HTTP; Sun, 24 Jun 2018 16:51:20 -0700 (PDT) In-Reply-To: References: <20180530173414.6121-1-andrew.smirnov@gmail.com> From: Fabio Estevam Date: Sun, 24 Jun 2018 20:51:20 -0300 Message-ID: Subject: Re: [PATCH] usb: chipidea: Fix ULPI on imx51 To: Andrey Smirnov Cc: Greg Kroah-Hartman , Nikita Yushchenko , Peter Chen , USB list , linux-kernel , linux-arm-kernel , Fabio Estevam , Chris Healy , Lucas Stach , Sebastian Reichel Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Andrey, On Sun, Jun 24, 2018 at 7:40 PM, Andrey Smirnov wrote: > It's definitely the bootloader, or more specifically whether or not it > initialized/used USB before booting the kernel. Some interesting > highlights: > > - On your "good" 4.17.2 based image, if you interrupt U-Boot, do "usb > start" (optionally "usb stop") and then "boot", you'll get the hang > that I was trying to fix with my patch. > > - Things are exact opposite with 4.18-rc1 and doing the above would > _prevent_ the hang and the image would boot fine. > > - Disabling USB in Barebox based boot "stack" gets it to behave the > same way as U-boot from your image (hanging when booting 4.18-rc1) > > Digging more into code it seems that the reason for 4.18-rc1's > behavior is the fact that it's missing a call hw_phymode_configure() > after usb_phy_init() and, AFAICT, the only reason it is not happening > is because default image is being built without > CONFIG_USB_CHIPIDEA_ULPI and CONFIG_USB_ULPI_BUS. Enabling those two > options on 4.18-rc1, seem to fix the problem on both your U-Boot based > image and my "special" Barebox setup. > > So AFAICT, this patch still fixes a valid issue (my use-case was net > booting via USB-Ethernet dongle), but an additional patch enabling > those two configuration options might be needed. Thoughts? Yes, I can confirm that your suggested change avoids the kernel hang: > Also, I don't have any i.MX53 HW, so I wasn't able to test the effects > of enabling those two options there. The imx53 board I have access to does not use ULPI. Maybe Sebastian on Cc may help testing this on his imx53 board as he is the author of: be9cae2479f48 ("usb: chipidea: imx: Fix ULPI on imx53") I am wondering if we need to force some kind of USB reset to put the USB controller into a known state independently of what the bootloader has done previously. Thanks --- To unsubscribe from this list: send the line "unsubscribe linux-usb" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/arch/arm/configs/imx_v6_v7_defconfig b/arch/arm/configs/imx_v6_v7_defconfig index d14de86..2da678c 100644 --- a/arch/arm/configs/imx_v6_v7_defconfig +++ b/arch/arm/configs/imx_v6_v7_defconfig @@ -300,6 +300,7 @@ CONFIG_USB_STORAGE=y CONFIG_USB_CHIPIDEA=y CONFIG_USB_CHIPIDEA_UDC=y CONFIG_USB_CHIPIDEA_HOST=y +CONFIG_USB_CHIPIDEA_ULPI=y CONFIG_USB_SERIAL=m CONFIG_USB_SERIAL_GENERIC=y CONFIG_USB_SERIAL_FTDI_SIO=m @@ -336,6 +337,7 @@ CONFIG_USB_GADGETFS=m CONFIG_USB_FUNCTIONFS=m CONFIG_USB_MASS_STORAGE=m CONFIG_USB_G_SERIAL=m +CONFIG_USB_ULPI_BUS=y CONFIG_MMC=y CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_PLTFM=y