From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.5 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9A916C32792 for ; Mon, 30 Sep 2019 15:23:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 792252190F for ; Mon, 30 Sep 2019 15:23:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731870AbfI3PXf (ORCPT ); Mon, 30 Sep 2019 11:23:35 -0400 Received: from muru.com ([72.249.23.125]:34912 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731276AbfI3PXf (ORCPT ); Mon, 30 Sep 2019 11:23:35 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 706DB80FA; Mon, 30 Sep 2019 15:24:06 +0000 (UTC) Date: Mon, 30 Sep 2019 08:23:30 -0700 From: Tony Lindgren To: Yegor Yefremov Cc: linux-omap@vger.kernel.org, vkoul@kernel.org, Bin Liu , linux-usb , Andrey Skvortsov , giulio.benetti@benettiengineering.com, Sebastian Andrzej Siewior Subject: Re: musb: cppi41: broken high speed FTDI functionality when connected to musb directly Message-ID: <20190930152330.GH5610@atomide.com> References: <20190927151935.GD5610@atomide.com> <20190927155738.GF5610@atomide.com> <20190930145711.GG5610@atomide.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190930145711.GG5610@atomide.com> User-Agent: Mutt/1.12.1 (2019-06-15) Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org * Tony Lindgren [190930 14:57]: > * Yegor Yefremov [190930 08:20]: > > On Mon, Sep 30, 2019 at 8:59 AM Yegor Yefremov > > wrote: > > > > > > On Sat, Sep 28, 2019 at 6:09 PM Yegor Yefremov > > > wrote: > > > > > > > > On Fri, Sep 27, 2019 at 5:57 PM Tony Lindgren wrote: > > > > > Looks like I'm unable to reproduce this with bbb and FT232R > > > > > USB UART. > > > > > > > > > > I tried v5.3 with omap2plus_defconfig, then boot, load musb > > > > > and ftdi-sio modules, then connect ftdi directly to bbb, > > > > > and then run "minicom -D /dev/ttyUSB0" on bbb and it works > > > > > just fine for me. > > > > > > > > > > I tried also rebooting the device inbetween in case it only > > > > > happens on the first connect after boot but still no luck > > > > > reproducing. > > > > > > > > Strange. I've used a loopback to check whether the characters will be echoed. > > > > FTDI cable was connected all the time so that I could check RX right after boot. > > > > Both Buildroot and OpenWrt rootfs's showed this behaviour. > > > > > > > > > Maybe try adding some debug prints to cppi41_runtime_suspend() > > > > > and cppi41_runtime_resume() to see if gets runtime suspended > > > > > too early? > > > > > > > > Will do on Mo. > > > > > > I've added the printks to both routines and the result is quite > > > interesting. On the system with a directly attached FTDI both routines > > > will be always invoked before (resume) and after (suspend) the > > > test/minicom i.e. during the USB initialization. > > > > > > On the systems with a USB hub, these routines will be invoked only > > > during the USB initialization and the last invocation is resume. > > > During the test, there are no invocations. > > Hmm OK thanks. Hard to say still based on that what might be missing. > > I just tried also musb and phy built-in with FTDI connected on > boot, but still no luck reproducing the issue here. > > > Removing PM routines workarounds the issue. Quick and dirty. > > > > static struct platform_driver cpp41_dma_driver = { > > .probe = cppi41_dma_probe, > > .remove = cppi41_dma_remove, > > .driver = { > > .name = "cppi41-dma-engine", > > /*.pm = &cppi41_pm_ops,*/ > > .of_match_table = of_match_ptr(cppi41_dma_ids), > > }, > > }; > > Well doing something like this to disable autosuspend might > be less intrusive until this one is fixed: > > # echo on > /sys/bus/platform/drivers/musb-hdrc/musb-hdrc.1/power/control > > But before that, maybe try with control set to auto, and increase the > autosuspend_delay_ms from 500 ms to let's say 2500 ms: > > # echo 2500 > /sys/bus/platform/drivers/musb-hdrc/musb-hdrc.1/power/autosuspend_delay_ms > > That is assuming the musb instance is 1 on your board, replace > with musb-hdrc.0 if a different interface from bbb. Actually playing with the cppi41 timeout might be more suitable here, they use the same module clock from what I remember though. So maybe increase the cppi41 autosuspend_timeout from 100 ms to 500 ms or higher: # echo 500 > /sys/bus/platform/drivers/cppi41-dma-engine/47400000.dma-controller/power/autosuspend_delay_ms If changing the autosuspend_timeout_ms value does not help, then try setting control to on there. Regards, Tony