From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755348AbbJGR2O (ORCPT ); Wed, 7 Oct 2015 13:28:14 -0400 Received: from mail-wi0-f170.google.com ([209.85.212.170]:35787 "EHLO mail-wi0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755022AbbJGR2N (ORCPT ); Wed, 7 Oct 2015 13:28:13 -0400 Subject: Re: [PATCH v5 1/4] uio: add ioctl support To: Greg KH References: <1444151859-10217-1-git-send-email-vladz@cloudius-systems.com> <1444151859-10217-2-git-send-email-vladz@cloudius-systems.com> <20151007084627.GA4270@kroah.com> <5614DDE5.1050100@cloudius-systems.com> <20151007172112.GC9702@kroah.com> 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 From: Vlad Zolotarov Message-ID: <5615562A.1070105@cloudius-systems.com> Date: Wed, 7 Oct 2015 20:28:10 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20151007172112.GC9702@kroah.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/07/15 20:21, Greg KH wrote: > On Wed, Oct 07, 2015 at 11:55:01AM +0300, Vlad Zolotarov wrote: >> >> On 10/07/15 11:46, Greg KH wrote: >>> 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. >> Ok. Another alternative could be to add new sysfs attributes for the MSI-X >> functionality similarly to what is done with "maps". >> Would it be acceptable? > If you get everyone else here to agree that this is the interface you > all are going to be using, sure. All I care is that you not add ioctl > to the UIO interface. Ok then. Thanks. > > greg k-h