[{"id":4269,"web_url":"https://patchwork.libcamera.org/comment/4269/","msgid":"<CAPY8ntCM7MyP6xt-Bqg5pMLdqGSR=GW3mi3grEBn94nqhbLuRA@mail.gmail.com>","date":"2020-03-24T22:25:59","subject":"Re: [libcamera-devel] [PATCH 0/4] media: Register read-only sub-dev\n\tdevnode","submitter":{"id":27,"url":"https://patchwork.libcamera.org/api/people/27/","name":"Dave Stevenson","email":"dave.stevenson@raspberrypi.com"},"content":"Hi Jacopo\n\nOn Tue, 24 Mar 2020 at 20:25, Jacopo Mondi <jacopo@jmondi.org> wrote:\n>\n> Add new functio v4l2_device_register_ro_subdev_nodes() to pair with\n> v4l2_device_register_subdev_nodes() that allows a bridge driver to register the\n> device node for its subdevices in read-only mode.\n>\n> devnode-centric (aka non-MC) bridge drivers control their subdevices through\n> direct calls to v4l2 subdev operations and do not want userspace to be able\n> to control the subdevice configuration by calling ioctls on the sub-device\n> devnode. For this reason, they mostly refrain from registering any devnode at\n> all for their subdevices.\n>\n> However it is sometimes required for userspace to access the sub-dev device\n> nodes to collect information on the actual configuration, without changing\n> the one currently applied to the device.\n>\n> This requirement became pressing while working on libcamera on devnode-centric\n> platforms that do not expose any sub-device for their camera sensor to prevent\n> userspace from changing their configuration. To allow them to register device\n> node and being guaranteed to retain control of the subdevice configuration this\n> series proposes a way to register device nodes in read-only to restrict\n> access to all ioctls that could potentially affect the sub-dev configuration.\n>\n> Thanks\n>    j\n>\n> Jacopo Mondi (4):\n>   Documentation: media: Document read-only subdevice\n>   media: v4l2-dev: Add v4l2_device_register_ro_subdev_node()\n>   media: bcm2835: Register sensor devnode as read-only\n>   media: bcm2835: Fix trivial whitespace error\n\nMinor point - you've sent this to linux-media. We (Raspberry Pi)\nhaven't pushed the bcm2835-unicam driver to mainline as yet (it's\nstill on the to-do list).\nYes, we need the core functionality that is in the first two patches,\nbut the last two aren't going to apply to any mainline tree.\n\n  Dave\n\n>  Documentation/media/kapi/v4l2-subdev.rst      | 38 +++++++++++++++++++\n>  .../media/uapi/v4l/vidioc-g-dv-timings.rst    |  6 +++\n>  Documentation/media/uapi/v4l/vidioc-g-std.rst |  6 +++\n>  .../media/uapi/v4l/vidioc-subdev-g-crop.rst   |  9 +++++\n>  .../media/uapi/v4l/vidioc-subdev-g-fmt.rst    |  8 ++++\n>  .../v4l/vidioc-subdev-g-frame-interval.rst    |  8 ++++\n>  .../uapi/v4l/vidioc-subdev-g-selection.rst    |  8 ++++\n>  .../media/platform/bcm2835/bcm2835-unicam.c   |  4 +-\n>  drivers/media/v4l2-core/v4l2-device.c         | 16 +++++++-\n>  drivers/media/v4l2-core/v4l2-subdev.c         | 19 ++++++++++\n>  include/media/v4l2-dev.h                      |  7 ++++\n>  include/media/v4l2-device.h                   | 10 +++++\n>  12 files changed, 136 insertions(+), 3 deletions(-)\n>\n> --\n> 2.25.1\n>\n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<dave.stevenson@raspberrypi.com>","Received":["from mail-wm1-x341.google.com (mail-wm1-x341.google.com\n\t[IPv6:2a00:1450:4864:20::341])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id B323860411\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Mar 2020 23:26:17 +0100 (CET)","by mail-wm1-x341.google.com with SMTP id a81so403380wmf.5\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 24 Mar 2020 15:26:17 -0700 (PDT)"],"Authentication-Results":"lancelot.ideasonboard.com; dkim=pass (2048-bit key; \n\tunprotected) header.d=raspberrypi.com\n\theader.i=@raspberrypi.com\n\theader.b=\"kaxx88Vz\"; dkim-atps=neutral","DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=raspberrypi.com; s=google;\n\th=mime-version:references:in-reply-to:from:date:message-id:subject:to\n\t:cc; bh=llbNcbnPT+61B/q3/YSUbviN8jvQBWSqV94t0dwrgSQ=;\n\tb=kaxx88Vzk39Hy1CNo216C7Bs94n3sZmU/l5PsOsVs4VIVgrv2ZaiUROMzhdl/UpLG2\n\tQN1ybjQ57d10zZyB/tvjwKiY9ZcbNNtDxk57Low4uQDNIeizPzeTqk3sPYU931E6BSlP\n\tZ2Xu0bxsBXpSDph5+ymtxpsOAdtMj19vX6g+5owFQdshyU8bWHq/FpykmlAAp6lRiZbM\n\tCLd8nu2ycbU7mW+fQwwAKT2RR1YbxzLRj7auzwsQ0Sy20FV/xg2iRi6+x18bPaB80wp3\n\tTwW4sDHwgy59qL5iV6lFdIZOvrpp07Bz3UhmzTFUjc6ZtiqDbfewwZOk9RlLkKE6rvXr\n\tI+ew==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:mime-version:references:in-reply-to:from:date\n\t:message-id:subject:to:cc;\n\tbh=llbNcbnPT+61B/q3/YSUbviN8jvQBWSqV94t0dwrgSQ=;\n\tb=cEFxnM93mkXNLF3iqItfPF3K7W9k37r54+hKVx3sbpiHGsU93L2uavva5ovfV+lR9q\n\tI4JvkIw/DIvHI84AiprfMULgOJ6Ht2/QY+D5IzszBHuGA8kQaLIg1RcCEi6PZGvEEknq\n\tDgK10pMVsmRarYSVAf6mJCKkwChmFLdqwet0A4eMCxi2BSnkFG3OnUB6aVpIIMSUZK8p\n\tcx3bMYx5WzV9yJEPjMseu088qmq7KuAr4VKPXni9zbDT276hEJ5ET7GICmbatLax55ZH\n\t0RxEpZLKRdg3aw6hqIjwUXqN/2neM4MLbVzqGgItm4W9rhmMmtbdyZuWfya7+ui5iDtV\n\tj0oQ==","X-Gm-Message-State":"ANhLgQ2DUV1ORXgP/6lam7nDAae8uhd1fQP8QxEBH2azuVAMkrh8mKf8\n\t/RuFvtjo+m56BLroIfxhPi7cwLe4qKidJfoF44ZHkg==","X-Google-Smtp-Source":"ADFU+vsG0nj44395z/UAObak79rRPUUYHl/3xZDq2WUC/z5Ac57Y6oHMkMzVCGmQsm+nwh4PxkOyxA/qp/kygUVXWw8=","X-Received":"by 2002:a7b:c3cf:: with SMTP id t15mr176622wmj.183.1585088777147;\n\tTue, 24 Mar 2020 15:26:17 -0700 (PDT)","MIME-Version":"1.0","References":"<20200324202844.1518292-1-jacopo@jmondi.org>","In-Reply-To":"<20200324202844.1518292-1-jacopo@jmondi.org>","From":"Dave Stevenson <dave.stevenson@raspberrypi.com>","Date":"Tue, 24 Mar 2020 22:25:59 +0000","Message-ID":"<CAPY8ntCM7MyP6xt-Bqg5pMLdqGSR=GW3mi3grEBn94nqhbLuRA@mail.gmail.com>","To":"Jacopo Mondi <jacopo@jmondi.org>","Cc":"Linux Media Mailing List <linux-media@vger.kernel.org>,\n\tlibcamera-devel@lists.libcamera.org, \n\tHans Verkuil <hverkuil-cisco@xs4all.nl>,\n\tMauro Carvalho Chehab <mchehab@kernel.org>, \n\tSakari Ailus <sakari.ailus@linux.intel.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Subject":"Re: [libcamera-devel] [PATCH 0/4] media: Register read-only sub-dev\n\tdevnode","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 24 Mar 2020 22:26:18 -0000"}},{"id":4270,"web_url":"https://patchwork.libcamera.org/comment/4270/","msgid":"<20200324233747.jwt2ph5r2etxw6wj@uno.localdomain>","date":"2020-03-24T23:37:47","subject":"Re: [libcamera-devel] [PATCH 0/4] media: Register read-only sub-dev\n\tdevnode","submitter":{"id":3,"url":"https://patchwork.libcamera.org/api/people/3/","name":"Jacopo Mondi","email":"jacopo@jmondi.org"},"content":"Hi Dave,\n\nOn Tue, Mar 24, 2020 at 10:25:59PM +0000, Dave Stevenson wrote:\n> Hi Jacopo\n>\n> On Tue, 24 Mar 2020 at 20:25, Jacopo Mondi <jacopo@jmondi.org> wrote:\n> >\n> > Add new functio v4l2_device_register_ro_subdev_nodes() to pair with\n> > v4l2_device_register_subdev_nodes() that allows a bridge driver to register the\n> > device node for its subdevices in read-only mode.\n> >\n> > devnode-centric (aka non-MC) bridge drivers control their subdevices through\n> > direct calls to v4l2 subdev operations and do not want userspace to be able\n> > to control the subdevice configuration by calling ioctls on the sub-device\n> > devnode. For this reason, they mostly refrain from registering any devnode at\n> > all for their subdevices.\n> >\n> > However it is sometimes required for userspace to access the sub-dev device\n> > nodes to collect information on the actual configuration, without changing\n> > the one currently applied to the device.\n> >\n> > This requirement became pressing while working on libcamera on devnode-centric\n> > platforms that do not expose any sub-device for their camera sensor to prevent\n> > userspace from changing their configuration. To allow them to register device\n> > node and being guaranteed to retain control of the subdevice configuration this\n> > series proposes a way to register device nodes in read-only to restrict\n> > access to all ioctls that could potentially affect the sub-dev configuration.\n> >\n> > Thanks\n> >    j\n> >\n> > Jacopo Mondi (4):\n> >   Documentation: media: Document read-only subdevice\n> >   media: v4l2-dev: Add v4l2_device_register_ro_subdev_node()\n> >   media: bcm2835: Register sensor devnode as read-only\n> >   media: bcm2835: Fix trivial whitespace error\n>\n> Minor point - you've sent this to linux-media. We (Raspberry Pi)\n> haven't pushed the bcm2835-unicam driver to mainline as yet (it's\n> still on the to-do list).\n> Yes, we need the core functionality that is in the first two patches,\n> but the last two aren't going to apply to any mainline tree.\n\nYou are very right!\n\nOnly the first 2 are relevant for linux-media, I should have reported\nit here.\n\n\n>\n>   Dave\n>\n> >  Documentation/media/kapi/v4l2-subdev.rst      | 38 +++++++++++++++++++\n> >  .../media/uapi/v4l/vidioc-g-dv-timings.rst    |  6 +++\n> >  Documentation/media/uapi/v4l/vidioc-g-std.rst |  6 +++\n> >  .../media/uapi/v4l/vidioc-subdev-g-crop.rst   |  9 +++++\n> >  .../media/uapi/v4l/vidioc-subdev-g-fmt.rst    |  8 ++++\n> >  .../v4l/vidioc-subdev-g-frame-interval.rst    |  8 ++++\n> >  .../uapi/v4l/vidioc-subdev-g-selection.rst    |  8 ++++\n> >  .../media/platform/bcm2835/bcm2835-unicam.c   |  4 +-\n> >  drivers/media/v4l2-core/v4l2-device.c         | 16 +++++++-\n> >  drivers/media/v4l2-core/v4l2-subdev.c         | 19 ++++++++++\n> >  include/media/v4l2-dev.h                      |  7 ++++\n> >  include/media/v4l2-device.h                   | 10 +++++\n> >  12 files changed, 136 insertions(+), 3 deletions(-)\n> >\n> > --\n> > 2.25.1\n> >\n> > _______________________________________________\n> > libcamera-devel mailing list\n> > libcamera-devel@lists.libcamera.org\n> > https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<jacopo@jmondi.org>","Received":["from relay9-d.mail.gandi.net (relay9-d.mail.gandi.net\n\t[217.70.183.199])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id DA5DD60429\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tWed, 25 Mar 2020 00:34:51 +0100 (CET)","from uno.localdomain (2-224-242-101.ip172.fastwebnet.it\n\t[2.224.242.101]) (Authenticated sender: jacopo@jmondi.org)\n\tby relay9-d.mail.gandi.net (Postfix) with ESMTPSA id 129AEFF809;\n\tTue, 24 Mar 2020 23:34:49 +0000 (UTC)"],"X-Originating-IP":"2.224.242.101","Date":"Wed, 25 Mar 2020 00:37:47 +0100","From":"Jacopo Mondi <jacopo@jmondi.org>","To":"Dave Stevenson <dave.stevenson@raspberrypi.com>","Cc":"Linux Media Mailing List <linux-media@vger.kernel.org>,\n\tlibcamera-devel@lists.libcamera.org,\n\tHans Verkuil <hverkuil-cisco@xs4all.nl>,\n\tMauro Carvalho Chehab <mchehab@kernel.org>,\n\tSakari Ailus <sakari.ailus@linux.intel.com>","Message-ID":"<20200324233747.jwt2ph5r2etxw6wj@uno.localdomain>","References":"<20200324202844.1518292-1-jacopo@jmondi.org>\n\t<CAPY8ntCM7MyP6xt-Bqg5pMLdqGSR=GW3mi3grEBn94nqhbLuRA@mail.gmail.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=utf-8","Content-Disposition":"inline","In-Reply-To":"<CAPY8ntCM7MyP6xt-Bqg5pMLdqGSR=GW3mi3grEBn94nqhbLuRA@mail.gmail.com>","Subject":"Re: [libcamera-devel] [PATCH 0/4] media: Register read-only sub-dev\n\tdevnode","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Tue, 24 Mar 2020 23:34:52 -0000"}}]