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=-3.8 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 D15A1C32792 for ; Thu, 3 Oct 2019 08:39:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A757B21783 for ; Thu, 3 Oct 2019 08:39:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=googlemail.com header.i=@googlemail.com header.b="vZTYtcQT" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728767AbfJCIjf (ORCPT ); Thu, 3 Oct 2019 04:39:35 -0400 Received: from mail-vs1-f66.google.com ([209.85.217.66]:33929 "EHLO mail-vs1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726039AbfJCIjf (ORCPT ); Thu, 3 Oct 2019 04:39:35 -0400 Received: by mail-vs1-f66.google.com with SMTP id d3so1154777vsr.1; Thu, 03 Oct 2019 01:39:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EDL0K7bu+EaFhDHsKjQKMN9nqMYxFXTuN9RZq2K0XLs=; b=vZTYtcQT9HDCFCD+QfZYvhzvJqlBBT4f5/Wih2yrcVyVZbjsZF7kRWu43SnCLzGD58 muuTu3HnQmK7Fa08HI4dbD3tRIOVXtBgDeCL26fqfTI2muFaV7/4foWz7ke+gq14n0I6 CdtMMXE0JoeomYzFroPc9bw6+nT68Rqf6sZKmu6MHFFPDUaIIMflFEPRXvDJSCRb2SKB IwBPDTFGfawz4xydN4Uaqa2moAHlQf6e3pdWUSQ4JjcmXhTRTMrpvFTu4Bd3FBn31p0V /aOdkegg0NlNo89Z0CcM2PiISU4w89PtLMqYav14GdC+WTMo5VYhR3qoID16qO0uPkok hL5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EDL0K7bu+EaFhDHsKjQKMN9nqMYxFXTuN9RZq2K0XLs=; b=LwGaTeAYVB9VG3tZvsHdTrU0iCcMcFTw408Th0ePzXVzQExlpBWPbAT6Yr6bdlgtX8 h6kFIL6BSLO0isoFWoArS584A3e5x/2GmOuJYiou09xcKZJLB3lG78N1dEAhmdUcMaC7 kkWLpR8kuTOi4rmhJAgf+7TIzqjsohHk3wPTWq2ziMeGb1ooOJEi8O8BZ2n3JXoJ2G7M /3+7Hie88xUh5SeTzTSYUvPQpCdKMRMPJyfPIHK2qKxfMnMyB2TXHLsKu7/KW8d9Ddg7 +b3I9CY8AQGChn/aJR91bs0BOleARgHPbt74bjo5ZGihMJ5BGz4r9caKGwdAnCpTT6ut 9RGQ== X-Gm-Message-State: APjAAAWytKYESzRLixkXVSoGIjiw+VqDCGsAz4Lad8rSIKdT8DsSg/jJ hQR4xLru2UzwtCPaId2AL83TrDl8mWzldKCiWuc= X-Google-Smtp-Source: APXvYqyzlaOkmJgrW2R8dTFnOKgdbLZPSAQXVW3o+oNw2ZgL40mHMHZq1tNU8jP/qM4X1maCnDqpPtoeE3WTQdpg6s0= X-Received: by 2002:a67:dc95:: with SMTP id g21mr4505650vsk.164.1570091974256; Thu, 03 Oct 2019 01:39:34 -0700 (PDT) MIME-Version: 1.0 References: <20190930145711.GG5610@atomide.com> <20190930152330.GH5610@atomide.com> <20190930195411.6porqtm7tlokgel3@earth.universe> <20191001080339.GF13531@localhost> <20191001164351.GJ5610@atomide.com> <20191001220321.GK5610@atomide.com> <20191002165219.GL5610@atomide.com> In-Reply-To: <20191002165219.GL5610@atomide.com> From: Yegor Yefremov Date: Thu, 3 Oct 2019 10:39:22 +0200 Message-ID: Subject: Re: musb: cppi41: broken high speed FTDI functionality when connected to musb directly To: Tony Lindgren Cc: Johan Hovold , Sebastian Reichel , linux-omap@vger.kernel.org, vkoul@kernel.org, Bin Liu , linux-usb , Andrey Skvortsov , giulio.benetti@benettiengineering.com, Sebastian Andrzej Siewior , Peter Ujfalusi Content-Type: text/plain; charset="UTF-8" Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Hi Tony, On Wed, Oct 2, 2019 at 6:52 PM Tony Lindgren wrote: > > * Yegor Yefremov [191002 06:57]: > > On Wed, Oct 2, 2019 at 12:03 AM Tony Lindgren wrote: > > > The other way to fix this would be to just wake up cpp41 in > > > cppi41_dma_prep_slave_sg() and return NULL so that we can > > > have musb_ep_program() continue with PIO while cppi41 is > > > asleep. > > > > > > Anyways, care to try it out and see if it fixes your issue? > > > > The fix is working but on the first invocation, I get this output > > (minicom provokes the same output): > > > # serialtest.py -c 2 /dev/ttyUSB0 /dev/ttyUSB0 > ... > > [ 210.940612] [] (__rpm_callback) from [] > > (rpm_callback+0x20/0x80) > > [ 210.948402] [] (rpm_callback) from [] > > (rpm_resume+0x468/0x7a0) > > [ 210.956018] [] (rpm_resume) from [] > > (__pm_runtime_resume+0x4c/0x64) > > [ 210.964086] [] (__pm_runtime_resume) from [] > > (cppi41_dma_prep_slave_sg+0x20/0xfc [cppi41]) > > OK so that won't work, thanks for testing. Here's the alternative > patch to try along the lines described above that just wakes up > cppi41 and returns NULL so musb_ep_program() can continue with PIO > until cppi41 is awake. I'm out of the office for some weeks and don't have access to my hw. I'll make the test as soon as I'm back. Thanks. Yegor > 8< ----------------------- > diff --git a/drivers/dma/ti/cppi41.c b/drivers/dma/ti/cppi41.c > --- a/drivers/dma/ti/cppi41.c > +++ b/drivers/dma/ti/cppi41.c > @@ -586,9 +586,22 @@ static struct dma_async_tx_descriptor *cppi41_dma_prep_slave_sg( > enum dma_transfer_direction dir, unsigned long tx_flags, void *context) > { > struct cppi41_channel *c = to_cpp41_chan(chan); > + struct dma_async_tx_descriptor *txd = NULL; > + struct cppi41_dd *cdd = c->cdd; > struct cppi41_desc *d; > struct scatterlist *sg; > unsigned int i; > + int error; > + > + error = pm_runtime_get(cdd->ddev.dev); > + if (error < 0) { > + pm_runtime_put_noidle(cdd->ddev.dev); > + > + return NULL; > + } > + > + if (cdd->is_suspended) > + goto err_out_not_ready; > > d = c->desc; > for_each_sg(sgl, sg, sg_len, i) { > @@ -611,7 +624,13 @@ static struct dma_async_tx_descriptor *cppi41_dma_prep_slave_sg( > d++; > } > > - return &c->txd; > + txd = &c->txd; > + > +err_out_not_ready: > + pm_runtime_mark_last_busy(cdd->ddev.dev); > + pm_runtime_put_autosuspend(cdd->ddev.dev); > + > + return txd; > } > > static void cppi41_compute_td_desc(struct cppi41_desc *d) > -- > 2.23.0