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.2 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,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 79A39CA9EBC for ; Thu, 24 Oct 2019 14:00:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4F8222084C for ; Thu, 24 Oct 2019 14:00:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732660AbfJXOAv (ORCPT ); Thu, 24 Oct 2019 10:00:51 -0400 Received: from muru.com ([72.249.23.125]:39740 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727811AbfJXOAv (ORCPT ); Thu, 24 Oct 2019 10:00:51 -0400 Received: from atomide.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTPS id 71C7680C5; Thu, 24 Oct 2019 14:01:23 +0000 (UTC) Date: Thu, 24 Oct 2019 07:00:45 -0700 From: Tony Lindgren To: Andy Shevchenko Cc: Peter Ujfalusi , Dan Williams , Vinod Koul , Alexandre Bailon , Bin Liu , Daniel Mack , Felipe Balbi , Grygorii Strashko , Johan Hovold , Sekhar Nori , Sebastian Andrzej Siewior , Sergei Shtylyov , dmaengine , USB , Linux OMAP Mailing List , giulio.benetti@benettiengineering.com, Sebastian Reichel , Skvortsov , Yegor Yefremov Subject: Re: [PATCH] dmaengine: cppi41: Fix cppi41_dma_prep_slave_sg() when idle Message-ID: <20191024140045.GX5610@atomide.com> References: <20191023153138.23442-1-tony@atomide.com> <245e1e8f-7933-bae1-b779-239f33d4d449@ti.com> <20191023171628.GO5610@atomide.com> <5deab8a9-5796-5367-213e-90c5961b8498@ti.com> <20191023191859.GQ5610@atomide.com> <7d578fe1-2d60-4a6e-48b0-73d66c39f783@ti.com> <20191023201829.GR5610@atomide.com> <4bcd75d8-b7c5-5006-d80f-c5bda0cdf011@ti.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: 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 * Andy Shevchenko [191024 11:23]: > On Thu, Oct 24, 2019 at 11:51 AM Peter Ujfalusi wrote: > > On 23/10/2019 23.18, Tony Lindgren wrote: > > > And the USB cable connect/disconnect is handled in interrupt -> you need > > to call pm_runtime_get_sync(dmadev) from interrupt context and need to > > mark the dmadev to pm_runtime_irq_safe() > > Side note: and please don't spread the pm_runtime_irq_safe() hack more... > I think Tony is quite aware of this. I agree, let's not add any more pm_runtime_irq_safe() at all. And let's get rid of all the existing users of it. Using pm_runtime_irq_safe() causes a problem for implementing genpd because of the permanent use count on the parent device. And then there is the serial driver issue with console use. In the musb case, we should be able to enable/disable cppi41 dma from musb_pm_runtime_check_session() without a need for pm_runtime_irq_safe(). We probably still want to keep the $subject patch for the state check and return NULL if cppi41 is not active. But should be able to remove the PM runtime calls in the $subject patch. Regards, Tony