From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752096AbbJGIqi (ORCPT ); Wed, 7 Oct 2015 04:46:38 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:34650 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750963AbbJGIqf (ORCPT ); Wed, 7 Oct 2015 04:46:35 -0400 Date: Wed, 7 Oct 2015 09:46:27 +0100 From: Greg KH To: Vlad Zolotarov Cc: linux-kernel@vger.kernel.org, mst@redhat.com, hjk@hansjkoch.de, corbet@lwn.net, bruce.richardson@intel.com, avi@cloudius-systems.com, gleb@cloudius-systems.com, stephen@networkplumber.org, alexander.duyck@gmail.com Subject: Re: [PATCH v5 1/4] uio: add ioctl support Message-ID: <20151007084627.GA4270@kroah.com> References: <1444151859-10217-1-git-send-email-vladz@cloudius-systems.com> <1444151859-10217-2-git-send-email-vladz@cloudius-systems.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1444151859-10217-2-git-send-email-vladz@cloudius-systems.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 06, 2015 at 08:17:36PM +0300, Vlad Zolotarov wrote: > Add the ability for underlying device drivers to register the ioctl > commands. This is useful when some interaction with the user space > beyond sysfs capabilities is required, e.g. query the interrupt mode > or bind eventfd to interrupt notifications (similarly to vfio ioctl > VFIO_DEVICE_SET_IRQS). > > Signed-off-by: Vlad Zolotarov > --- > drivers/uio/uio.c | 15 +++++++++++++++ > include/linux/uio_driver.h | 3 +++ > 2 files changed, 18 insertions(+) > > diff --git a/drivers/uio/uio.c b/drivers/uio/uio.c > index 8196581..714b0e5 100644 > --- a/drivers/uio/uio.c > +++ b/drivers/uio/uio.c > @@ -704,6 +704,20 @@ static int uio_mmap(struct file *filep, struct vm_area_struct *vma) > } > } > > +static long uio_ioctl(struct file *filep, unsigned int cmd, unsigned long arg) > +{ > + struct uio_listener *listener = filep->private_data; > + struct uio_device *idev = listener->dev; > + > + if (!idev->info) > + return -EIO; > + > + if (!idev->info->ioctl) > + return -ENOTTY; > + > + return idev->info->ioctl(idev->info, cmd, arg); > +} As Stephen said, I will not take this, sorry. It opens up the ability to add "new system calls" to a huge range of crappy drivers, it's something that vendors have been trying to push for years and is something that I will not allow. greg k-h