Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2101025ybl; Thu, 30 Jan 2020 11:22:18 -0800 (PST) X-Google-Smtp-Source: APXvYqyVPQ2T7IcQKLyqTb6XFZ/Qi54m7pFXA/RGaQnRgXfq6Ihtd2GlREKB5vckyKgyaEbg1wx9 X-Received: by 2002:a9d:7696:: with SMTP id j22mr4967533otl.188.1580412137935; Thu, 30 Jan 2020 11:22:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580412137; cv=none; d=google.com; s=arc-20160816; b=u7xQ9FaixxQwtyW+gPUP3CtRjBOLSYVResxrvV5ThQJl5nxKpadufTeK/YnGFbJWrN VCoCseSfFA3AHg6Id4lXlT/e4Qp3w9ewnvxUaUDdTCZ0Sh1kAQZ8yDu7/T2rRYcSsGZ9 9Q7YgW/daIVZxXAe9nBAnD3qL44TLtHxovjHwaCgQm3HGAqowKKf5TEsY63YypwoBR4O XRMWQ6Sa1qBAIbcFBpCkPYzru1di2Pf0mK7gx7DMT5BD15RU4HBCDLruYx2i+UYjqgPP 52Lgnsedz3vgLScQX3+W10FydLNCS0xnL8nnuK/+SFKuGXE7MCJVbQWEILRxUbHKnKcE Rudw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:dkim-signature:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=uuoNO3MXCVy5v51r78aV++s6e2wrHYCAZeI4MlBHlZU=; b=RFU2fUHo2qtbEov3SbKNZCZ44ZhAi7M32s08CpQywLGIivj48HMS+Xr7/zrAnBVLyB LPvrn2Jk9iCl5zJYhesV1v8uCugTTo6mmbfo4v68K0f38CF/MxwRQLreEqWuvSXbQwg2 a/vAjDqwR0bzsF5/NKcB2wT7AYc906qygvP7vk2ioUESVq1b8hiqPajl5Me7O3FXDIDR 2x14ze46DJ9VvVE6DBKZqvci7KPR2oBoNSILwFEL0YxWNeagjlEtJlBqavI+I7RO5oxA S1jmc2sg4klTo+3AxmqPcCz5Sftn/3zwu1idX2VCB0+uOlqVESBeRv9e1YbUE+kkqGCk ohlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=d5XnP8rb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e24si3760440oti.247.2020.01.30.11.22.06; Thu, 30 Jan 2020 11:22:17 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@nvidia.com header.s=n1 header.b=d5XnP8rb; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=nvidia.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727960AbgA3S6n (ORCPT + 99 others); Thu, 30 Jan 2020 13:58:43 -0500 Received: from hqnvemgate26.nvidia.com ([216.228.121.65]:4738 "EHLO hqnvemgate26.nvidia.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727285AbgA3S6n (ORCPT ); Thu, 30 Jan 2020 13:58:43 -0500 Received: from hqpgpgate101.nvidia.com (Not Verified[216.228.121.13]) by hqnvemgate26.nvidia.com (using TLS: TLSv1.2, DES-CBC3-SHA) id ; Thu, 30 Jan 2020 10:58:28 -0800 Received: from hqmail.nvidia.com ([172.20.161.6]) by hqpgpgate101.nvidia.com (PGP Universal service); Thu, 30 Jan 2020 10:58:42 -0800 X-PGP-Universal: processed; by hqpgpgate101.nvidia.com on Thu, 30 Jan 2020 10:58:42 -0800 Received: from [10.26.11.91] (10.124.1.5) by HQMAIL107.nvidia.com (172.20.187.13) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Thu, 30 Jan 2020 18:58:39 +0000 Subject: Re: [PATCH v6 12/16] dmaengine: tegra-apb: Clean up suspend-resume To: Dmitry Osipenko , Laxman Dewangan , Vinod Koul , Dan Williams , Thierry Reding , =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= CC: , , References: <20200130043804.32243-1-digetx@gmail.com> <20200130043804.32243-13-digetx@gmail.com> <394014f3-011a-d6b6-b5f2-f8c86834ec70@gmail.com> <3d8f599d-a46f-a7e5-8816-e0c44e2aceff@gmail.com> From: Jon Hunter Message-ID: <08b6a1f7-3c4d-ce6a-0d00-450f7bd4eeb3@nvidia.com> Date: Thu, 30 Jan 2020 18:58:37 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <3d8f599d-a46f-a7e5-8816-e0c44e2aceff@gmail.com> X-Originating-IP: [10.124.1.5] X-ClientProxiedBy: HQMAIL111.nvidia.com (172.20.187.18) To HQMAIL107.nvidia.com (172.20.187.13) Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nvidia.com; s=n1; t=1580410708; bh=uuoNO3MXCVy5v51r78aV++s6e2wrHYCAZeI4MlBHlZU=; h=X-PGP-Universal:Subject:To:CC:References:From:Message-ID:Date: User-Agent:MIME-Version:In-Reply-To:X-Originating-IP: X-ClientProxiedBy:Content-Type:Content-Language: Content-Transfer-Encoding; b=d5XnP8rbMyzgDwPK1HuueIvdvgFMwQkyaoyx4vv+ApUC9rbyZs1jNDNFcV8hbXQll zli8m0ljzOQmd3FFVwbMZGB6fEYPRjG87K4pgQ1rxHNYX7F5vuZQ+vWcQ8l7qAWeFa 7L5vs8WtB17ZT5TtsFkqA0eR5sHCQxcuryPB0OIIDjKKr2SOYr2YSuJo1WQRWU7wnF E25HgsnI3ztx4QLHPQatWe79tfDugVuJixyZH1cp/Tb2gxAa360sxjtpx46fQ0DCGp diQRsyWbP9eUkOUleVu9qIS4O3wSolNAQSMrqfE68cxPtYn0MhOwpuNGoQENAc+lMG Dnt1I6UuLR6/g== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 30/01/2020 18:26, Dmitry Osipenko wrote: > 30.01.2020 21:06, Dmitry Osipenko =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >> 30.01.2020 19:08, Dmitry Osipenko =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>> 30.01.2020 17:09, Jon Hunter =D0=BF=D0=B8=D1=88=D0=B5=D1=82: >>>> >>>> On 30/01/2020 04:38, Dmitry Osipenko wrote: >>>>> It is enough to check whether hardware is busy on suspend and to rese= t >>>>> it across of suspend-resume because channel's configuration is fully >>>>> re-programmed on each DMA transaction anyways and because save-restor= e >>>>> of an active channel won't end up well without pausing transfer prior= to >>>>> saving of the state (note that all channels shall be idling at the ti= me of >>>>> suspend, so save-restore is not needed at all). >>>> >>>> I guess if we ever wanted to support SNDRV_PCM_INFO_PAUSE for audio an= d >>>> support the pause callback, then saving and restoring the channels cou= ld >>>> be needed. Right now I believe that it will just terminate_all transfe= rs >>>> for audio on entering suspend. Any value in keeping this? >>> >>> Indeed, looks like [1] pauses DMA during suspend if SNDRV_PCM_INFO_PAUS= E >>> is supported. >>> >>> [1] >>> https://elixir.bootlin.com/linux/v5.5/source/sound/core/pcm_dmaengine.c= #L199 >>> >>> So we'll need to save-restore context only if DMA is in a paused state >>> during suspend, I'll adjust this patch to do that and will see if >>> enabling SNDRV_PCM_INFO_PAUSE works. >> >> I started to look at it and found that the .device_pause() hook isn't >> implemented by the driver. So, it's fine to remove the context's >> save-restore for now. >> >> Jon, what about to keep this patch as-is? Later on I'll take a look at >> implementing the proper pausing functionality and try to cleanup code a >> bit further (remove the free list usage, etc). >=20 > Ah, only T114+ supports the per-channel pausing. So, I won't care about > implementing the device_pause(), let's leave it to somebody else :) That's fine. We have lived with out it for this long. Jon --=20 nvpublic