Commit 323264ee authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'for-5.5/drivers-post-20191122' of git://git.kernel.dk/linux-block

Pull additional block driver updates from Jens Axboe:
 "Here's another block driver update, done to avoid conflicts with the
  zoned changes coming next.

  This contains:

   - Prepare SCSI sd for zone open/close/finish support

   - Small NVMe pull request
        - hwmon support (Akinobu)
        - add new co-maintainer (Christoph)
        - work-around for a discard issue on non-conformant drives
          (Eduard)

   - Small nbd leak fix"

* tag 'for-5.5/drivers-post-20191122' of git://git.kernel.dk/linux-block:
  nbd: prevent memory leak
  nvme: hwmon: add quirk to avoid changing temperature threshold
  nvme: hwmon: provide temperature min and max values for each sensor
  nvmet: add another maintainer
  nvme: Discard workaround for non-conformant devices
  nvme: Add hardware monitoring support
  scsi: sd_zbc: add zone open, close, and finish support
parents 2d539430 03bf73c3
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -11638,6 +11638,7 @@ F: drivers/nvme/target/fcloop.c
NVM EXPRESS TARGET DRIVER
M:	Christoph Hellwig <hch@lst.de>
M:	Sagi Grimberg <sagi@grimberg.me>
M:	Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
L:	linux-nvme@lists.infradead.org
T:	git://git.infradead.org/nvme.git
W:	http://git.infradead.org/nvme.git
+3 −2
Original line number Diff line number Diff line
@@ -1032,14 +1032,15 @@ static int nbd_add_socket(struct nbd_device *nbd, unsigned long arg,
		sockfd_put(sock);
		return -ENOMEM;
	}

	config->socks = socks;

	nsock = kzalloc(sizeof(struct nbd_sock), GFP_KERNEL);
	if (!nsock) {
		sockfd_put(sock);
		return -ENOMEM;
	}

	config->socks = socks;

	nsock->fallback_index = -1;
	nsock->dead = false;
	mutex_init(&nsock->tx_lock);
+10 −0
Original line number Diff line number Diff line
@@ -23,6 +23,16 @@ config NVME_MULTIPATH
	   /dev/nvmeXnY device will show up for each NVMe namespaces,
	   even if it is accessible through multiple controllers.

config NVME_HWMON
	bool "NVMe hardware monitoring"
	depends on (NVME_CORE=y && HWMON=y) || (NVME_CORE=m && HWMON)
	help
	  This provides support for NVMe hardware monitoring. If enabled,
	  a hardware monitoring device will be created for each NVMe drive
	  in the system.

	  If unsure, say N.

config NVME_FABRICS
	tristate

+1 −0
Original line number Diff line number Diff line
@@ -14,6 +14,7 @@ nvme-core-$(CONFIG_TRACING) += trace.o
nvme-core-$(CONFIG_NVME_MULTIPATH)	+= multipath.o
nvme-core-$(CONFIG_NVM)			+= lightnvm.o
nvme-core-$(CONFIG_FAULT_INJECTION_DEBUG_FS)	+= fault_inject.o
nvme-core-$(CONFIG_NVME_HWMON)		+= hwmon.o

nvme-y					+= pci.o

+15 −3
Original line number Diff line number Diff line
@@ -613,8 +613,14 @@ static blk_status_t nvme_setup_discard(struct nvme_ns *ns, struct request *req,
	struct nvme_dsm_range *range;
	struct bio *bio;

	range = kmalloc_array(segments, sizeof(*range),
				GFP_ATOMIC | __GFP_NOWARN);
	/*
	 * Some devices do not consider the DSM 'Number of Ranges' field when
	 * determining how much data to DMA. Always allocate memory for maximum
	 * number of segments to prevent device reading beyond end of buffer.
	 */
	static const size_t alloc_size = sizeof(*range) * NVME_DSM_MAX_RANGES;

	range = kzalloc(alloc_size, GFP_ATOMIC | __GFP_NOWARN);
	if (!range) {
		/*
		 * If we fail allocation our range, fallback to the controller
@@ -654,7 +660,7 @@ static blk_status_t nvme_setup_discard(struct nvme_ns *ns, struct request *req,

	req->special_vec.bv_page = virt_to_page(range);
	req->special_vec.bv_offset = offset_in_page(range);
	req->special_vec.bv_len = sizeof(*range) * segments;
	req->special_vec.bv_len = alloc_size;
	req->rq_flags |= RQF_SPECIAL_PAYLOAD;

	return BLK_STS_OK;
@@ -2798,6 +2804,9 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
	ctrl->oncs = le16_to_cpu(id->oncs);
	ctrl->mtfa = le16_to_cpu(id->mtfa);
	ctrl->oaes = le32_to_cpu(id->oaes);
	ctrl->wctemp = le16_to_cpu(id->wctemp);
	ctrl->cctemp = le16_to_cpu(id->cctemp);

	atomic_set(&ctrl->abort_limit, id->acl + 1);
	ctrl->vwc = id->vwc;
	if (id->mdts)
@@ -2897,6 +2906,9 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
	if (ret < 0)
		return ret;

	if (!ctrl->identified)
		nvme_hwmon_init(ctrl);

	ctrl->identified = true;

	return 0;
Loading