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=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,UNPARSEABLE_RELAY autolearn=ham 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 0AA6DC3279B for ; Tue, 10 Jul 2018 19:57:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C7F20208E8 for ; Tue, 10 Jul 2018 19:57:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C7F20208E8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732707AbeGJT6Z (ORCPT ); Tue, 10 Jul 2018 15:58:25 -0400 Received: from bhuna.collabora.co.uk ([46.235.227.227]:46254 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732400AbeGJT6Z (ORCPT ); Tue, 10 Jul 2018 15:58:25 -0400 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: ezequiel) with ESMTPSA id 07CC627DCA7 Message-ID: Subject: Re: [PATCH v5 18/22] media: platform: Add Sunxi-Cedrus VPU decoder driver From: Ezequiel Garcia To: Paul Kocialkowski , linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , Paul Kocialkowski , Marco Franchi , Icenowy Zheng , Hans Verkuil , Keiichi Watanabe , Jonathan Corbet , Smitha T Murthy , Tom Saeger , Andrzej Hajda , "David S . Miller" , Greg Kroah-Hartman , Andrew Morton , Randy Dunlap , Arnd Bergmann , Geert Uytterhoeven , Laurent Pinchart , Jacob Chen , Neil Armstrong , Benoit Parrot , Todor Tomov , Alexandre Courbot , Sakari Ailus , Andy Shevchenko , Pawel Osciak , Ricardo Ribalda Delgado , Hans de Goede , Sami Tolvanen , Niklas =?ISO-8859-1?Q?S=F6derlund?= , linux-sunxi@googlegroups.com, Thomas Petazzoni , Hugues Fruchet , Randy Li Date: Tue, 10 Jul 2018 16:57:34 -0300 In-Reply-To: <20180710080114.31469-19-paul.kocialkowski@bootlin.com> References: <20180710080114.31469-1-paul.kocialkowski@bootlin.com> <20180710080114.31469-19-paul.kocialkowski@bootlin.com> Organization: Collabora Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.2-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hey Paul, My comments on v4 of course apply here as well. One other thing... On Tue, 2018-07-10 at 10:01 +0200, Paul Kocialkowski wrote: > This introduces the Sunxi-Cedrus VPU driver that supports the VPU > found > in Allwinner SoCs, also known as Video Engine. It is implemented > through > a v4l2 m2m decoder device and a media device (used for media > requests). > So far, it only supports MPEG2 decoding. > > Since this VPU is stateless, synchronization with media requests is > required in order to ensure consistency between frame headers that > contain metadata about the frame to process and the raw slice data > that > is used to generate the frame. > > This driver was made possible thanks to the long-standing effort > carried out by the linux-sunxi community in the interest of reverse > engineering, documenting and implementing support for Allwinner VPU. > > Signed-off-by: Paul Kocialkowski > [..] > + > +static irqreturn_t cedrus_bh(int irq, void *data) > +{ > + struct cedrus_dev *dev = data; > + struct cedrus_ctx *ctx; > + > + ctx = v4l2_m2m_get_curr_priv(dev->m2m_dev); > + if (!ctx) { > + v4l2_err(&dev->v4l2_dev, > + "Instance released before the end of > transaction\n"); > + return IRQ_HANDLED; > + } > + > + v4l2_m2m_job_finish(ctx->dev->m2m_dev, ctx->fh.m2m_ctx); > + I don't like the fact that v4l2_m2m_job_finish calls .device_run reentrantly. Let me try to make v4l2_m2m_job_finish() safe to be called in atomic context, so hopefully drivers can just call it in the top- half. You are returning the buffers in the top-half, so this is just a matter or better design, not a performance improvement. Thanks, Eze