From: james_p_freyensee@linux.intel.com (J Freyensee)
Subject: [PATCH v4 2/6] block: Add Sed-opal library
Date: Mon, 23 Jan 2017 16:20:03 -0800 [thread overview]
Message-ID: <1485217203.2574.4.camel@linux.intel.com> (raw)
In-Reply-To: <20170119182839.GB9228@sbauer-Z170X-UD5>
On Thu, 2017-01-19@11:28 -0700, Scott Bauer wrote:
> >
> > +struct opal_dev *alloc_opal_dev(struct request_queue *q)
> > +{
> > + struct opal_dev *opal_dev;
> > + unsigned long dma_align;
> > + struct opal_cmd *cmd;
> > +
> > + opal_dev = kzalloc(sizeof(*opal_dev), GFP_KERNEL);
> > + if (!opal_dev)
> > + return opal_dev;
> > +
> > + cmd = &opal_dev->cmd;
> > + cmd->cmd = cmd->cmd_buf;
> > + cmd->resp = cmd->resp_buf;
> > +
> > + dma_align = (queue_dma_alignment(q) | q->dma_pad_mask) + 1;
> > + cmd->cmd = (u8 *)round_up((uintptr_t)cmd->cmd, dma_align);
> > + cmd->resp = (u8 *)round_up((uintptr_t)cmd->resp, dma_align);
> > +
> > + INIT_LIST_HEAD(&opal_dev->unlk_lst);
> > + opal_dev->state = 0;
> > +
> > + mutex_init(&opal_dev->dev_lock);
> > +
> > + return opal_dev;
> > +
> > +}
> > +EXPORT_SYMBOL(alloc_opal_dev);
>
> Internally we've been discussing this function. We don't like the requirement
> that we have to pass in a request_queue just to allocate an opal dev.
>
> We have a few ideas and wanted to toss them out here and see if anyone has
> one they love or one they hate.
>
> So Idea one:
>
> Pass in the alignment insetead of the request_queue. This pushes the burden
> onto the driver calling alloc_opal_dev instead of the opal core. It also
> removes
> the requirement of passing in a request_queue to something we think should be
> agnostic to any blocklayer/lower level structures/knowledge.
>
>
I would think it would be easier to support and validate and guarantee working
operation of opal if the driver controlled the alignment instead relying on
someone else in the kernel to make sure it's aligned. ?Plus wouldn't this also
supply a more optimized solution?
> Idea two:
>
> Just let alloc_opal_dev kzalloc normally and do no alignment. It would then
> be up to the drivers to move the data from the buffer to a bounce buffer,
> that is aligned, in the send/recv functions before sending down to the
> controller.
>
> Both are easy to implement but we wanted to see if anyone had other ideas or
> liked
> one over the other.
>
>
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme at lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme
next prev parent reply other threads:[~2017-01-24 0:20 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-12-29 19:26 [PATCH v4 0/6] SED OPAL Library Scott Bauer
2016-12-29 19:26 ` [PATCH v4 1/6] Include: Uapi: Add user ABI for Sed/Opal Scott Bauer
2016-12-29 19:26 ` [PATCH v4 2/6] block: Add Sed-opal library Scott Bauer
2016-12-30 21:02 ` Jon Derrick
2017-01-08 13:32 ` Christoph Hellwig
2017-01-08 14:05 ` Christoph Hellwig
2017-01-11 17:47 ` J Freyensee
2017-01-30 17:08 ` Scott Bauer
2017-01-19 18:28 ` Scott Bauer
2017-01-24 0:20 ` J Freyensee [this message]
2017-01-24 7:46 ` Christoph Hellwig
2016-12-29 19:26 ` [PATCH v4 3/6] block: add ioctl interface for interfacing with Opal library Scott Bauer
2017-01-08 14:06 ` Christoph Hellwig
2016-12-29 19:26 ` [PATCH v4 4/6] block: Add Opal Files to Makefile & add config option to Kconfig Scott Bauer
2017-01-08 14:09 ` Christoph Hellwig
2016-12-29 19:26 ` [PATCH v4 5/6] nvme: Add Support for Opal: Unlock from S3 & Opal Allocation/Ioctls Scott Bauer
2017-01-08 14:20 ` Christoph Hellwig
2017-01-18 18:45 ` Keith Busch
2017-01-24 8:14 ` Christoph Hellwig
2017-01-19 19:32 ` Jon Derrick
2016-12-29 19:26 ` [PATCH v4 6/6] Maintainers: Add maintainer info for SED/Opal library Scott Bauer
2016-12-29 21:00 ` [PATCH v4 0/6] SED OPAL Library Scott Bauer
2016-12-30 8:28 ` Christoph Hellwig
2016-12-30 22:52 ` Scott Bauer
2016-12-31 3:51 ` Christoph Hellwig
2016-12-31 5:41 ` Scott Bauer
2016-12-31 5:47 ` Christoph Hellwig
2017-01-03 22:09 ` Scott Bauer
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=1485217203.2574.4.camel@linux.intel.com \
--to=james_p_freyensee@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.