From: Jens Axboe Date: Wed, 13 Nov 2019 02:11:30 +0000 (-0700) Subject: Merge branch 'for-5.5/drivers' into for-5.5/zoned X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=d29510d3524200f4591d1aac58b4b8fa375bd20a;p=linux.git Merge branch 'for-5.5/drivers' into for-5.5/zoned * for-5.5/drivers: (38 commits) null_blk: add zone open, close, and finish support dm: add zone open, close and finish support nvme: Fix parsing of ANA log page nvmet: stop using bio_set_op_attrs nvmet: add plugging for read/write when ns is bdev nvmet: clean up command parsing a bit nvme-pci: Spelling s/resdicovered/rediscovered/ nvmet: fill discovery controller sn, fr and mn correctly nvmet: Open code nvmet_req_execute() nvmet: Remove the data_len field from the nvmet_req struct nvmet: Introduce nvmet_dsm_len() helper nvmet: Cleanup discovery execute handlers nvmet: Introduce common execute function for get_log_page and identify nvmet-tcp: Don't set the request's data_len nvmet-tcp: Don't check data_len in nvmet_tcp_map_data() nvme: Introduce nvme_lba_to_sect() nvme: Cleanup and rename nvme_block_nr() nvme: resync include/linux/nvme.h with nvmecli nvme: move common call to nvme_cleanup_cmd to core layer nvme: introduce "Command Aborted By host" status code ... --- d29510d3524200f4591d1aac58b4b8fa375bd20a diff --cc drivers/block/null_blk_zoned.c index 3d7fdea872f88,be7646205b8c4..02f41a3bc4cb3 --- a/drivers/block/null_blk_zoned.c +++ b/drivers/block/null_blk_zoned.c @@@ -141,8 -159,32 +159,31 @@@ static blk_status_t null_zone_mgmt(stru zone->cond = BLK_ZONE_COND_EMPTY; zone->wp = zone->start; break; + case REQ_OP_ZONE_OPEN: + if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL) + return BLK_STS_IOERR; + if (zone->cond == BLK_ZONE_COND_FULL) + return BLK_STS_IOERR; + + zone->cond = BLK_ZONE_COND_EXP_OPEN; + break; + case REQ_OP_ZONE_CLOSE: + if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL) + return BLK_STS_IOERR; + if (zone->cond == BLK_ZONE_COND_FULL) + return BLK_STS_IOERR; + + zone->cond = BLK_ZONE_COND_CLOSED; + break; + case REQ_OP_ZONE_FINISH: + if (zone->type == BLK_ZONE_TYPE_CONVENTIONAL) + return BLK_STS_IOERR; + + zone->cond = BLK_ZONE_COND_FULL; + zone->wp = zone->start + zone->len; + break; default: - cmd->error = BLK_STS_NOTSUPP; - break; + return BLK_STS_NOTSUPP; } return BLK_STS_OK; } diff --cc drivers/nvme/host/pci.c index 869f462e6b6ea,1b1b0db455674..3aab92bd22638 --- a/drivers/nvme/host/pci.c +++ b/drivers/nvme/host/pci.c @@@ -2982,10 -2961,11 +2980,10 @@@ static int nvme_suspend(struct device * /* * Clearing npss forces a controller reset on resume. The - * correct value will be resdicovered then. + * correct value will be rediscovered then. */ - nvme_dev_disable(ndev, true); + ret = nvme_disable_prepare_reset(ndev, true); ctrl->npss = 0; - ret = 0; } unfreeze: nvme_unfreeze(ctrl);