From patchwork Mon Feb 12 22:03:52 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 10214585 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2579C6055C for ; Mon, 12 Feb 2018 22:04:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0380B26538 for ; Mon, 12 Feb 2018 22:04:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EC424289C9; Mon, 12 Feb 2018 22:04:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1ACD8289C2 for ; Mon, 12 Feb 2018 22:04:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932839AbeBLWEP (ORCPT ); Mon, 12 Feb 2018 17:04:15 -0500 Received: from bin-mail-out-06.binero.net ([195.74.38.229]:60467 "EHLO bin-vsp-out-02.atm.binero.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932836AbeBLWEN (ORCPT ); Mon, 12 Feb 2018 17:04:13 -0500 X-Halon-ID: 9cb9ac46-1040-11e8-9bc0-005056917f90 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA id 9cb9ac46-1040-11e8-9bc0-005056917f90; Mon, 12 Feb 2018 23:04:08 +0100 (CET) From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: Sakari Ailus , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH] v4l: subdev: compat: update handling for VIDIOC_SUBDEV_[GS]_ROUTING Date: Mon, 12 Feb 2018 23:03:52 +0100 Message-Id: <20180212220352.21629-1-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.16.1 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Implement compat IOCTL handling for VIDIOC_SUBDEV_G_ROUTING and VIDIOC_SUBDEV_S_ROUTING IOCTLs. Signed-off-by: Niklas Söderlund --- drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) Hi Sakari, With this fix on-top of your vc branch I get it work with v4.16-rc1, feel free to squash it into your branch where appropriate. I tested this with a ARM64 kernel and a ARM user-land with v4l2-ctl + my --{get,set}-routing patches for v4l-utils. // Niklas diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index a1f71a83ac076d7f..30700658963d3227 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -1124,7 +1124,10 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar case VIDIOC_SUBDEV_G_ROUTING: case VIDIOC_SUBDEV_S_ROUTING: - err = get_v4l2_subdev_routing(&karg.subdev_routing, up); + err = alloc_userspace(sizeof(struct v4l2_subdev_routing), + 0, &up_native); + if (!err) + err = get_v4l2_subdev_routing(up_native, up); compatible_arg = 0; break; @@ -1257,7 +1260,7 @@ static long do_video_ioctl(struct file *file, unsigned int cmd, unsigned long ar break; case VIDIOC_SUBDEV_G_ROUTING: case VIDIOC_SUBDEV_S_ROUTING: - err = put_v4l2_subdev_routing(&karg.subdev_routing, up); + err = put_v4l2_subdev_routing(up_native, up); break; } if (err)