Received: by 10.192.165.148 with SMTP id m20csp487473imm; Fri, 4 May 2018 01:05:14 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrALG32i/9E6WESuAIavvGhlKubuUNh8c7Cqm7XDlYjhKmQ8BzB2qjForm7VNIAD2PzG2QF X-Received: by 2002:a17:902:14cb:: with SMTP id y11-v6mr1749552plg.229.1525421114229; Fri, 04 May 2018 01:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525421114; cv=none; d=google.com; s=arc-20160816; b=d7GYblHYpbx+Z2RjY9/V31yt2oChl/R6yG3CkomoZ51F9dW5sdtiCuYqIErZq1By5h d7H0bFqXZMUXKfy+rdeCMB4R+f4jA0DreFVzUcCxa7JTTgAhuoC4LY0mfp0gjHU6vkAF o8aSUaxhsV0rCVFK5YlqpGaaAtkimoTn3nC3G+DBwUu3a/r4YxeJdypXMv6orioC6rlm PlloSPva34mG0A0A2Xp20kpNXER2nTs/MXosw3HelznlrNAdTo2d5/xR2FV+5gwwdYAH YPI0muS3qd/wUag18sFG64zX6s/2a3Dzhb8SIIkL2x9fCfrfYjtJd+ywk0oN/AF4fZmh P/Pw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:organization:references :in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=O308fsWl6uqwaww6Ydv/k8SCXFlEalCaXaDx3JNs9rY=; b=Lz76DH/Aez03DUacQlYMWtlQJkc5ZjpEpHTJx714MMKnyU3sKiv9MlLbUbja3fwM/v 8NRx7/0gjmw6HiQmjthCP/xnedb0o8MpIMqOchxvHEU+Yf7y5VWh9e+ydvioOMVWbEJ5 8lHTPxQ6YamIjz6wTeobIAT7xvlLr3dVDcd7sLdTXTLqGssmknQXNQ/A83KY1yqr+zpp gbspOD9eEodhJETeHjbfNycaPahwLtMHb0KxymEQFRVWLDk4uDJvUAikUsfHK9z1DrLn HOVBqUqkkDcnCYnDW20EH3WWA3rCtAUa7U6ymDWd20FNYTlBJR9g64ruCYoyQewmG/Oq Graw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a23-v6si7345909pls.571.2018.05.04.01.04.59; Fri, 04 May 2018 01:05:14 -0700 (PDT) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751533AbeEDIEj (ORCPT + 99 others); Fri, 4 May 2018 04:04:39 -0400 Received: from mail.bootlin.com ([62.4.15.54]:50488 "EHLO mail.bootlin.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750709AbeEDIEg (ORCPT ); Fri, 4 May 2018 04:04:36 -0400 Received: by mail.bootlin.com (Postfix, from userid 110) id 4FB86207D4; Fri, 4 May 2018 10:04:34 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mail.bootlin.com X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=ALL_TRUSTED,SHORTCIRCUIT shortcircuit=ham autolearn=disabled version=3.4.0 Received: from aptenodytes (LStLambert-657-1-97-87.w90-63.abo.wanadoo.fr [90.63.216.87]) by mail.bootlin.com (Postfix) with ESMTPSA id D797720730; Fri, 4 May 2018 10:04:23 +0200 (CEST) Message-ID: Subject: Re: [PATCH v2 02/10] media-request: Add a request complete operation to allow m2m scheduling From: Paul Kocialkowski To: linux-media@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com Cc: Mauro Carvalho Chehab , Rob Herring , Mark Rutland , Maxime Ripard , Chen-Yu Tsai , Pawel Osciak , Marek Szyprowski , Kyungmin Park , Hans Verkuil , Sakari Ailus , Philipp Zabel , Arnd Bergmann , Alexandre Courbot , Tomasz Figa Date: Fri, 04 May 2018 10:03:05 +0200 In-Reply-To: <20180419154124.17512-3-paul.kocialkowski@bootlin.com> References: <20180419154124.17512-1-paul.kocialkowski@bootlin.com> <20180419154124.17512-3-paul.kocialkowski@bootlin.com> Organization: Bootlin Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-7ElAg6Ux7kGsIjD5tVrd" X-Mailer: Evolution 3.28.1 Mime-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-7ElAg6Ux7kGsIjD5tVrd Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi, On Thu, 2018-04-19 at 17:41 +0200, Paul Kocialkowski wrote: > When using the request API in the context of a m2m driver, the > operations that come with a m2m run scheduling call in their > (m2m-specific) ioctl handler are delayed until the request is queued > (for instance, this includes queuing buffers and streamon). >=20 > Thus, the m2m run scheduling calls are not called in due time since > the > request AP's internal plumbing will (rightfully) use the relevant core > functions directly instead of the ioctl handler. >=20 > This ends up in a situation where nothing happens if there is no > run-scheduling ioctl called after queuing the request. >=20 > In order to circumvent the issue, a new media operation is introduced, > called at the time of handling the media request queue ioctl. It gives > m2m drivers a chance to schedule a m2m device run at that time. >=20 > The existing req_queue operation cannot be used for this purpose, > since > it is called with the request queue mutex held, that is eventually > needed > in the device_run call to apply relevant controls. This patch will be dropped since it's no longer useful with the latest version of the request API. > Signed-off-by: Paul Kocialkowski > --- > drivers/media/media-request.c | 3 +++ > include/media/media-device.h | 2 ++ > 2 files changed, 5 insertions(+) >=20 > diff --git a/drivers/media/media-request.c b/drivers/media/media- > request.c > index 415f7e31019d..28ac5ccfe6a2 100644 > --- a/drivers/media/media-request.c > +++ b/drivers/media/media-request.c > @@ -157,6 +157,9 @@ static long media_request_ioctl_queue(struct > media_request *req) > media_request_get(req); > } > =20 > + if (mdev->ops->req_complete) > + mdev->ops->req_complete(req); > + > return ret; > } > =20 > diff --git a/include/media/media-device.h b/include/media/media- > device.h > index 07e323c57202..c7dcf2079cc9 100644 > --- a/include/media/media-device.h > +++ b/include/media/media-device.h > @@ -55,6 +55,7 @@ struct media_entity_notify { > * @req_alloc: Allocate a request > * @req_free: Free a request > * @req_queue: Queue a request > + * @req_complete: Complete a request > */ > struct media_device_ops { > int (*link_notify)(struct media_link *link, u32 flags, > @@ -62,6 +63,7 @@ struct media_device_ops { > struct media_request *(*req_alloc)(struct media_device > *mdev); > void (*req_free)(struct media_request *req); > int (*req_queue)(struct media_request *req); > + void (*req_complete)(struct media_request *req); > }; > =20 > /** --=20 Paul Kocialkowski, Bootlin (formerly Free Electrons) Embedded Linux and kernel engineering https://bootlin.com --=-7ElAg6Ux7kGsIjD5tVrd Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEJZpWjZeIetVBefti3cLmz3+fv9EFAlrsE7kACgkQ3cLmz3+f v9HomAf/U5gnx6ZprY8K3VbK3hDNSCzIPHXorx02poTTlLsTDO/H5j+5Woi/y9BF kV/Y6TdvZVyoR6mkXUrqxA+zAjr68cMsvtNwcoWODVtVGzmmgtqfQmlhvzzs8sIv RdTIxHaWDbHTMn39MS40xQjGrFkEZ5haPLjnDh9ziVisr7gftvWmwawhB0JkRsqm /XKucxJVj5UPucPGfAVBBLJmnOxOsXNjOWq7IEPnaUWIJktKzSuYHWLiRikXsoPF W8tJLWQNRt8xJFHaJHEZeKz/9Hao1jm0+x1x/zL7DViUje2KUaw4mrY2n2RHLq5P NTxR6xAHKKJTzFzl1ZkAA53Ab+OZbg== =3zgR -----END PGP SIGNATURE----- --=-7ElAg6Ux7kGsIjD5tVrd--