public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Matthew Wilcox <willy@linux.intel.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [REVIEW] NVM Express driver
Date: Thu, 3 Mar 2011 13:13:36 -0800	[thread overview]
Message-ID: <20110303211336.GA32645@kroah.com> (raw)
In-Reply-To: <20110303204749.GY3663@linux.intel.com>

On Thu, Mar 03, 2011 at 03:47:49PM -0500, Matthew Wilcox wrote:
> 
> Hi everyone,
> 
> You may have seen the recent announcement of the NVM Express spec;
> here's the driver.  I've put a git tree up on kernel.org with
> all the history that's fit to be released (earlier versions
> were full of Intel codenames and are not suited to public
> consumption).  If you'd rather review the history, it's at
> http://git.kernel.org/?p=linux/kernel/git/willy/nvme.git;a=summary
> 
> Jens has already offered to pull my nvme tree into his block tree, so
> that's the route I intend to take into Linus' tree.  Comments appreciated,
> however in a masterpiece of bad timing I am going to be travelling for
> the next week, so please bear with me if I don't respond quickly.
> 
> diff --git a/Documentation/ioctl/ioctl-number.txt b/Documentation/ioctl/ioctl-number.txt
> index 63ffd78..f8159ba 100644
> --- a/Documentation/ioctl/ioctl-number.txt
> +++ b/Documentation/ioctl/ioctl-number.txt
> @@ -148,6 +148,7 @@ Code  Seq#(hex)	Include File		Comments
>  'M'	01-03	drivers/scsi/megaraid/megaraid_sas.h
>  'M'	00-0F	drivers/video/fsl-diu-fb.h	conflict!
>  'N'	00-1F	drivers/usb/scanner.h
> +'N'	40-7F	drivers/block/nvme.c

I hate to ask this, but why do you have ioctls for this?  At first
glance, a number of the ioctls you have should just be sysfs files to
export the information.  What am I misunderstanding here?

> +static int nvme_download_firmware(struct nvme_ns *ns,
> +						struct nvme_dlfw __user *udlfw)
> +{
> +	struct nvme_dev *dev = ns->dev;
> +	struct nvme_dlfw dlfw;
> +	struct nvme_command c;
> +	int nents, status;
> +	struct scatterlist *sg;
> +	struct nvme_prps *prps;
> +
> +	if (copy_from_user(&dlfw, udlfw, sizeof(dlfw)))
> +		return -EFAULT;
> +	if (dlfw.length >= (1 << 30))
> +		return -EINVAL;
> +
> +	nents = nvme_map_user_pages(dev, 1, dlfw.addr, dlfw.length * 4, &sg);
> +	if (nents < 0)
> +		return nents;
> +
> +	memset(&c, 0, sizeof(c));
> +	c.dlfw.opcode = nvme_admin_download_fw;
> +	c.dlfw.numd = cpu_to_le32(dlfw.length);
> +	c.dlfw.offset = cpu_to_le32(dlfw.offset);
> +	prps = nvme_setup_prps(dev, &c.common, sg, dlfw.length * 4);
> +
> +	status = nvme_submit_admin_cmd(dev, &c, NULL);
> +	nvme_unmap_user_pages(dev, 0, dlfw.addr, dlfw.length * 4, sg, nents);
> +	nvme_free_prps(dev, prps);
> +	return status;
> +}

Shouldn't you be using the build-in firmware kernel interface instead of
rolling your own in an ioctl?

thanks,

greg k-h

  reply	other threads:[~2011-03-03 21:13 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-03 20:47 [REVIEW] NVM Express driver Matthew Wilcox
2011-03-03 21:13 ` Greg KH [this message]
2011-03-03 21:41   ` Matthew Wilcox
2011-03-03 21:51     ` Greg KH
2011-03-03 22:07       ` Matthew Wilcox
2011-03-03 22:22         ` Greg KH
2011-03-04  2:25           ` Andy Lutomirski
2011-03-04  9:02             ` el es
2011-03-04 21:29             ` Greg KH
2011-03-04 12:43           ` Alan Cox
2011-03-04 21:28             ` Greg KH
2011-03-04 21:59               ` Alan Cox
2011-03-04 22:10                 ` Greg KH
2011-03-04 22:33                   ` Alan Cox
2011-03-04 23:10                     ` Greg KH
2011-03-05 10:28                       ` Alan Cox
2011-03-04 12:52     ` Mark Brown
2011-03-03 21:33 ` Randy Dunlap
2011-03-04 13:06 ` Christoph Hellwig
2011-03-04 14:46   ` Matthew Wilcox
2011-03-11 22:29 ` Andi Kleen
2011-03-12  5:51   ` Matthew Wilcox
2011-03-13 17:14     ` Andi Kleen
2011-03-13 18:24 ` Arnd Bergmann

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110303211336.GA32645@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=willy@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox