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=-0.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,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 2EAA4C433DF for ; Wed, 10 Jun 2020 19:04:04 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id F263B2072E for ; Wed, 10 Jun 2020 19:04:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="NRyxjj2B"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="A5UREhW8" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org F263B2072E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=OnZzUwmW2VN+EZGZ3/utH9mDMHm/LZ73OR/LeblFL5Y=; b=NRyxjj2BiOBTq7 Il0IYPwp4KkXLqBFmqyVJ7M1GyaAqfRHnwOTniDOknFnkasga6Ys2AzcbNotJr2grdSJbW6eDIdi3 ThPeBdUXjI9S1uDddsaTwpu/HSpAbwlp8qqpClSEzNxFQbVaXFLYLLY13J7vtbGhEAKLaAYnG2ItN PxFbAU8ctzsS//FgtRJRYPpmFHiVjiJz0pBLtEaRGjjLYEQMfH6ECJjvNw2sm/pnQwxXUeLfD3ou7 ldJ2/MD4sGBUomtbWeQ3K75EgBTb7NhqBKi4ZG7iIlXWq5hbawn4Xe+oYUr+UE1A/V1U85VDv5xAb dzwhBGXHVitRRVXOIAFw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jj614-0003gB-Lu; Wed, 10 Jun 2020 19:04:02 +0000 Received: from mail-wm1-x341.google.com ([2a00:1450:4864:20::341]) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jj611-0003ea-Dp for linux-arm-kernel@lists.infradead.org; Wed, 10 Jun 2020 19:04:00 +0000 Received: by mail-wm1-x341.google.com with SMTP id l26so2830313wme.3 for ; Wed, 10 Jun 2020 12:03:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=NSUIdscZFTvAj/KAnkXmeLO33H1QImBmP7nNAatzF4E=; b=A5UREhW8Zimz/lgVsX6YJceKyEcTDjGffoiiTJOFdDh2MS8Wxd5Ju72jDNEe03+VwF mVZ3B2461XaZq/JxobIkPo8zWcoju/Yn/0yxVkOeKJtCgUkiqKoSrFTT2OuKrMCeaeFn nXsSEcazn3q3aNRxaP6pf9xhar75XQ1iFYbaA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=NSUIdscZFTvAj/KAnkXmeLO33H1QImBmP7nNAatzF4E=; b=gJtbWk+R6CVo67X63Y6cof1k3apOZPqgIhsG1BueFQAheqBPWAM3RHew7iuZ2NGIg5 TCfFTRA4gSVW2a6L53bj2yrCxa8affIk+EDIQ+Jv69ib1I0NhVDcg07G/Fc26Q5SZDTc VUGXsR816Kxs35StiobF2Tgz+gPdmRGkM8h05Mcw0hpycpQY99ZdEwnWQBt3gq+qQ3cH TA4d8QusYnm4YSpuI4dWPywTJbxoAr43wXSmO2rqss2rHY7eZiyX8xD5J+VYDikNLh8r 6IjWw9at1fqZApN4W1PBHh6Qg2KzZ8cq6jXT1if+TmABnqeMK2roU+Y6VHwASdi+f0Ok SZ1w== X-Gm-Message-State: AOAM531j72C1NJrRBVDSRMTITMKsy9kQbvsn1+O//EYnI6UGLfkhqGkO yEflbOGw2B6mURaBJEhDS/ANlw== X-Google-Smtp-Source: ABdhPJzTRfYPcTj3IRS5BINNXpxwdDXmbXJOisFqkC0CCPcDchPYcvzcaAwcf6hmVi/W346PEWyYcw== X-Received: by 2002:a1c:f301:: with SMTP id q1mr4562383wmq.110.1591815838119; Wed, 10 Jun 2020 12:03:58 -0700 (PDT) Received: from chromium.org (205.215.190.35.bc.googleusercontent.com. [35.190.215.205]) by smtp.gmail.com with ESMTPSA id d2sm1039640wrs.95.2020.06.10.12.03.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 10 Jun 2020 12:03:57 -0700 (PDT) Date: Wed, 10 Jun 2020 19:03:56 +0000 From: Tomasz Figa To: Ezequiel Garcia Subject: Re: [RFC PATCH V4 1/4] media: v4l2-mem2mem: add v4l2_m2m_suspend, v4l2_m2m_resume Message-ID: <20200610190356.GJ201868@chromium.org> References: <20191204124732.10932-1-Jerry-Ch.chen@mediatek.com> <20191204124732.10932-2-Jerry-Ch.chen@mediatek.com> <20200521171101.GA243874@chromium.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200610_120359_483097_FC16DA08 X-CRM114-Status: GOOD ( 24.98 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-devicetree , Sean Cheng =?utf-8?B?KOmEreaYh+W8mCk=?= , Laurent Pinchart , Rynn Wu =?utf-8?B?KOWQs+iCsuaBqSk=?= , zwisler@chromium.org, srv_heupstream , Jerry-ch Chen , Jerry-ch Chen , Hans Verkuil , Jungo Lin =?utf-8?B?KOael+aYjuS/iik=?= , Sj Huang , yuzhao@chromium.org, "moderated list:ARM/Mediatek SoC support" , Pi-Hsun Shih , Frederic Chen =?utf-8?B?KOmZs+S/iuWFgyk=?= , Matthias Brugger , Christie Yu =?utf-8?B?KOa4uOmbheaDoCk=?= , Mauro Carvalho Chehab , "list@263.net:IOMMU DRIVERS , Joerg Roedel , " , Linux Media Mailing List Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Jun 10, 2020 at 03:52:39PM -0300, Ezequiel Garcia wrote: > Hi everyone, > > Thanks for the patch. > > On Wed, 10 Jun 2020 at 07:33, Tomasz Figa wrote: > > > > On Wed, Jun 10, 2020 at 12:29 PM Hans Verkuil wrote: > > > > > > On 21/05/2020 19:11, Tomasz Figa wrote: > > > > Hi Jerry, > > > > > > > > On Wed, Dec 04, 2019 at 08:47:29PM +0800, Jerry-ch Chen wrote: > > > >> From: Pi-Hsun Shih > > > >> > > > >> Add two functions that can be used to stop new jobs from being queued / > > > >> continue running queued job. This can be used while a driver using m2m > > > >> helper is going to suspend / wake up from resume, and can ensure that > > > >> there's no job running in suspend process. [snip] > > > > > > I assume this will be part of a future patch series that calls these new functions? > > > > The mtk-jpeg encoder series depends on this patch as well, so I guess > > it would go together with whichever is ready first. > > > > I would also envision someone changing the other existing drivers to > > use the helpers, as I'm pretty much sure some of them don't handle > > suspend/resume correctly. > > > > This indeed looks very good. If I understood the issue properly, > the change would be useful for both stateless (e.g. hantro, et al) > and stateful (e.g. coda) codecs. > > Hantro uses pm_runtime_force_suspend, and I believe that > could is enough for proper suspend/resume operation. Unfortunately, no. :( If the decoder is already decoding a frame, that would forcefully power off the hardware and possibly even cause a system lockup if we are unlucky to gate a clock in the middle of a bus transaction. I just inspected the code now and actually found one more bug in its power management handling. device_run() calls clk_bulk_enable() before pm_runtime_get_sync(), but only the latter is guaranteed to actually power on the relevant power domains, so we end up clocking unpowered hardware. > > I'm not seeing any code in CODA to handle this, so not sure > how it's handling suspend/resume. > > Maybe we can have CODA as the first user, given it's a well-maintained > driver and should be fairly easy to test. I remember checking a number of drivers using the m2m helpers randomly and none of them implemented suspend/resume correctly. I suppose that was not discovered because normally the userspace itself would stop the operation before the system is suspended, although it's not an API guarantee. Best regards, Tomasz _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel