stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Keith Busch <keith.busch@intel.com>
To: "Holger Hoffstätte" <holger@applied-asynchrony.com>
Cc: Christoph Hellwig <hch@lst.de>,
	sagi@grimberg.me, Akinobu Mita <akinobu.mita@gmail.com>,
	linux-nvme@lists.infradead.org, stable@vger.kernel.org
Subject: Re: [PATCH 3/4] nvme-pci: propagate (some) errors from host memory buffer setup
Date: Wed, 6 Sep 2017 16:27:24 -0400	[thread overview]
Message-ID: <20170906202724.GH17331@localhost.localdomain> (raw)
In-Reply-To: <a1eec558-51ee-4512-1ab1-16ae05bf598b@applied-asynchrony.com>

On Wed, Sep 06, 2017 at 04:19:43PM +0200, Holger Hoffst�tte wrote:
> On 09/06/17 15:55, Christoph Hellwig wrote:
> > We want to catch command execution errors when resetting the device, so
> > propagate errors from the Set Features when setting up the host memory
> > buffer.  We keep ignoring memory allocation failures, as the spec
> > clearly says that the controller must work without a host memory buffer.
> 
> Maybe I'm missing something but I think you forgot to update a bunch of
> function signatures in terms of return type. Changing "return" to "return 0"
> IMHO makes little sense otherwise.
> 
> -h

The sig is updated:

 -static void nvme_setup_host_mem(struct nvme_dev *dev)
 +static int nvme_setup_host_mem(struct nvme_dev *dev)

The diff is just showing the old sig.

> > @@ -1706,7 +1707,7 @@ static void nvme_setup_host_mem(struct nvme_dev *dev)
> >  			"min host memory (%lld MiB) above limit (%d MiB).\n",
> >  			min >> ilog2(SZ_1M), max_host_mem_size_mb);
> >  		nvme_free_host_mem(dev);
> > -		return;
> > +		return 0;
> 
> [..]
> 
> > @@ -1723,7 +1724,7 @@ static void nvme_setup_host_mem(struct nvme_dev *dev)
> >  		if (nvme_alloc_host_mem(dev, min, preferred)) {
> >  			dev_warn(dev->ctrl.device,
> >  				"failed to allocate host memory buffer.\n");
> > -			return;
> > +			return 0; /* controller must work without HMB */
> 
> [..]
> 
> > @@ -1731,8 +1732,10 @@ static void nvme_setup_host_mem(struct nvme_dev *dev)
> >  			dev->host_mem_size >> ilog2(SZ_1M));
> >  	}
> >  
> > -	if (nvme_set_host_mem(dev, enable_bits))
> > +	ret = nvme_set_host_mem(dev, enable_bits);
> > +	if (ret)
> >  		nvme_free_host_mem(dev);
> > +	return ret;

  reply	other threads:[~2017-09-06 20:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20170906135532.21358-1-hch@lst.de>
2017-09-06 13:55 ` [PATCH 1/4] nvme-pci: fix host memory buffer allocation fallback Christoph Hellwig
2017-09-06 20:12   ` Keith Busch
2017-09-06 13:55 ` [PATCH 2/4] nvme-pci: use appropriate initial chunk size for HMB allocation Christoph Hellwig
2017-09-06 20:13   ` Keith Busch
2017-09-06 13:55 ` [PATCH 3/4] nvme-pci: propagate (some) errors from host memory buffer setup Christoph Hellwig
2017-09-06 14:19   ` Holger Hoffstätte
2017-09-06 20:27     ` Keith Busch [this message]
2017-09-06 21:49   ` Keith Busch

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=20170906202724.GH17331@localhost.localdomain \
    --to=keith.busch@intel.com \
    --cc=akinobu.mita@gmail.com \
    --cc=hch@lst.de \
    --cc=holger@applied-asynchrony.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    --cc=stable@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).