1. 28 6月, 2017 1 次提交
  2. 07 6月, 2017 7 次提交
    • K
      nvme: relax APST default max latency to 100ms · 9947d6a0
      Kai-Heng Feng 提交于
      Christoph Hellwig suggests we should to make APST work out of the box.
      Hence relax the the default max latency to make them able to enter
      deepest power state on default.
      
      Here are id-ctrl excerpts from two high latency NVMes:
      
      vid     : 0x14a4
      ssvid   : 0x1b4b
      mn      : CX2-GB1024-Q11 NVMe LITEON 1024GB
      ps    3 : mp:0.1000W non-operational enlat:5000 exlat:5000 rrt:3 rrl:3
                rwt:3 rwl:3 idle_power:- active_power:-
      ps    4 : mp:0.0100W non-operational enlat:50000 exlat:100000 rrt:4 rrl:4
                rwt:4 rwl:4 idle_power:- active_power:-
      
      vid     : 0x15b7
      ssvid   : 0x1b4b
      mn      : A400 NVMe SanDisk 512GB
      ps    3 : mp:0.0500W non-operational enlat:51000 exlat:10000 rrt:0 rrl:0
                rwt:0 rwl:0 idle_power:- active_power:-
      ps    4 : mp:0.0055W non-operational enlat:1000000 exlat:100000 rrt:0 rrl:0
                rwt:0 rwl:0 idle_power:- active_power:-
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      9947d6a0
    • K
      nvme: only consider exit latency when choosing useful non-op power states · da87591b
      Kai-Heng Feng 提交于
      When a NVMe is in non-op states, the latency is exlat.
      The latency will be enlat + exlat only when the NVMe tries to transit
      from operational state right atfer it begins to transit to
      non-operational state, which should be a rare case.
      
      Therefore, as Andy Lutomirski suggests, use exlat only when deciding power
      states to trainsit to.
      Signed-off-by: NKai-Heng Feng <kai.heng.feng@canonical.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      da87591b
    • J
      nvme-fc: fix missing put reference on controller create failure · 24b7f059
      James Smart 提交于
      The failure case, of a create controller request, called
      nvme_uninit_ctrl() but didn't do a put to allow the nvme
      controller to be deleted.
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      24b7f059
    • J
      nvme-fc: on lldd/transport io error, terminate association · f874d5d0
      James Smart 提交于
      Per FC-NVME, when lldd or transport detects an i/o error, the
      connection must be terminated, which in turn requires the association
      to be termianted.  Currently the transport simply creates a nvme
      completion status of transport error and returns the io. The FC-NVME
      spec makes the mandate as initiator and host, depending on the error,
      can get out of sync on outstanding io counts (sqhd/sqtail).
      
      Implement the association teardown on lldd or transport detected
      errors.
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      f874d5d0
    • S
      nvme-rdma: fast fail incoming requests while we reconnect · e818a5b4
      Sagi Grimberg 提交于
      When we encounter an transport/controller errors, error recovery
      kicks in which performs:
      1. stops io/admin queues
      2. moves transport queues out of LIVE state
      3. fast fail pending io
      4. schedule periodic reconnects.
      
      But we also need to fast fail incoming IO taht enters after we
      already scheduled. Given that our queue is not LIVE anymore, simply
      restart the request queues to fail in .queue_rq
      Reported-by: NAlex Turin <alex@vastdata.com>
      Reported-by: Nshahar.salzman <shahar.salzman@gmail.com>
      Signed-off-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Cc: stable@vger.kernel.org
      e818a5b4
    • R
      nvme-pci: fix multiple ctrl removal scheduling · 82b057ca
      Rakesh Pandit 提交于
      Commit c5f6ce97 tries to address multiple resets but fails as
      work_busy doesn't involve any synchronization and can fail.  This is
      reproducible easily as can be seen by WARNING below which is triggered
      with line:
      
      WARN_ON(dev->ctrl.state == NVME_CTRL_RESETTING)
      
      Allowing multiple resets can result in multiple controller removal as
      well if different conditions inside nvme_reset_work fail and which
      might deadlock on device_release_driver.
      
      [  480.327007] WARNING: CPU: 3 PID: 150 at drivers/nvme/host/pci.c:1900 nvme_reset_work+0x36c/0xec0
      [  480.327008] Modules linked in: rfcomm fuse nf_conntrack_netbios_ns nf_conntrack_broadcast...
      [  480.327044]  btusb videobuf2_core ghash_clmulni_intel snd_hwdep cfg80211 acer_wmi hci_uart..
      [  480.327065] CPU: 3 PID: 150 Comm: kworker/u16:2 Not tainted 4.12.0-rc1+ #13
      [  480.327065] Hardware name: Acer Predator G9-591/Mustang_SLS, BIOS V1.10 03/03/2016
      [  480.327066] Workqueue: nvme nvme_reset_work
      [  480.327067] task: ffff880498ad8000 task.stack: ffffc90002218000
      [  480.327068] RIP: 0010:nvme_reset_work+0x36c/0xec0
      [  480.327069] RSP: 0018:ffffc9000221bdb8 EFLAGS: 00010246
      [  480.327070] RAX: 0000000000460000 RBX: ffff880498a98128 RCX: dead000000000200
      [  480.327070] RDX: 0000000000000001 RSI: ffff8804b1028020 RDI: ffff880498a98128
      [  480.327071] RBP: ffffc9000221be50 R08: 0000000000000000 R09: 0000000000000000
      [  480.327071] R10: ffffc90001963ce8 R11: 000000000000020d R12: ffff880498a98000
      [  480.327072] R13: ffff880498a53500 R14: ffff880498a98130 R15: ffff880498a98128
      [  480.327072] FS:  0000000000000000(0000) GS:ffff8804c1cc0000(0000) knlGS:0000000000000000
      [  480.327073] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
      [  480.327074] CR2: 00007ffcf3c37f78 CR3: 0000000001e09000 CR4: 00000000003406e0
      [  480.327074] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
      [  480.327075] DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400
      [  480.327075] Call Trace:
      [  480.327079]  ? __switch_to+0x227/0x400
      [  480.327081]  process_one_work+0x18c/0x3a0
      [  480.327082]  worker_thread+0x4e/0x3b0
      [  480.327084]  kthread+0x109/0x140
      [  480.327085]  ? process_one_work+0x3a0/0x3a0
      [  480.327087]  ? kthread_park+0x60/0x60
      [  480.327102]  ret_from_fork+0x2c/0x40
      [  480.327103] Code: e8 5a dc ff ff 85 c0 41 89 c1 0f.....
      
      This patch addresses the problem by using state of controller to
      decide whether reset should be queued or not as state change is
      synchronizated using controller spinlock.  Also cancel_work_sync is
      used to make sure remove cancels the reset_work and waits for it to
      finish.  This patch also changes return value from -ENODEV to more
      appropriate -EBUSY if nvme_reset fails to change state.
      
      Fixes: c5f6ce97 ("nvme: don't schedule multiple resets")
      Signed-off-by: NRakesh Pandit <rakesh@tuxera.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      82b057ca
    • M
      nvme: fix hang in remove path · 82654b6b
      Ming Lei 提交于
      We need to start admin queues too in nvme_kill_queues()
      for avoiding hang in remove path[1].
      
      This patch is very similar with 806f026f(nvme: use
      blk_mq_start_hw_queues() in nvme_kill_queues()).
      
      [1] hang stack trace
      [<ffffffff813c9716>] blk_execute_rq+0x56/0x80
      [<ffffffff815cb6e9>] __nvme_submit_sync_cmd+0x89/0xf0
      [<ffffffff815ce7be>] nvme_set_features+0x5e/0x90
      [<ffffffff815ce9f6>] nvme_configure_apst+0x166/0x200
      [<ffffffff815cef45>] nvme_set_latency_tolerance+0x35/0x50
      [<ffffffff8157bd11>] apply_constraint+0xb1/0xc0
      [<ffffffff8157cbb4>] dev_pm_qos_constraints_destroy+0xf4/0x1f0
      [<ffffffff8157b44a>] dpm_sysfs_remove+0x2a/0x60
      [<ffffffff8156d951>] device_del+0x101/0x320
      [<ffffffff8156db8a>] device_unregister+0x1a/0x60
      [<ffffffff8156dc4c>] device_destroy+0x3c/0x50
      [<ffffffff815cd295>] nvme_uninit_ctrl+0x45/0xa0
      [<ffffffff815d4858>] nvme_remove+0x78/0x110
      [<ffffffff81452b69>] pci_device_remove+0x39/0xb0
      [<ffffffff81572935>] device_release_driver_internal+0x155/0x210
      [<ffffffff81572a02>] device_release_driver+0x12/0x20
      [<ffffffff815d36fb>] nvme_remove_dead_ctrl_work+0x6b/0x70
      [<ffffffff810bf3bc>] process_one_work+0x18c/0x3a0
      [<ffffffff810bf61e>] worker_thread+0x4e/0x3b0
      [<ffffffff810c5ac9>] kthread+0x109/0x140
      [<ffffffff8185800c>] ret_from_fork+0x2c/0x40
      [<ffffffffffffffff>] 0xffffffffffffffff
      
      Fixes: c5552fde("nvme: Enable autonomous power state transitions")
      Reported-by: NRakesh Pandit <rakesh@tuxera.com>
      Tested-by: NRakesh Pandit <rakesh@tuxera.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NMing Lei <ming.lei@redhat.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      82654b6b
  3. 26 5月, 2017 4 次提交
  4. 23 5月, 2017 9 次提交
  5. 21 5月, 2017 3 次提交
  6. 10 5月, 2017 1 次提交
  7. 08 5月, 2017 1 次提交
    • G
      lightnvm: remove unused rq parameter of nvme_nvm_rqtocmd() to kill warning · 629b1b2e
      Geert Uytterhoeven 提交于
      With gcc 4.1.2:
      
          drivers/nvme/host/lightnvm.c: In function ‘nvme_nvm_submit_io’:
          drivers/nvme/host/lightnvm.c:498: warning: ‘rq’ is used uninitialized in this function
      
      Indeed, since commit 2e13f33a ("lightnvm: create cmd before
      allocating request"), the request is passed to nvme_nvm_rqtocmd() before
      it is allocated.
      
      Fortunately, as of commit 91276162 ("lightnvm: refactor end_io
      functions for sync"), nvme_nvm_rqtocmd () no longer uses the passed
      request, so this warning is a false positive.
      
      Drop the unused parameter to clean up the code and kill the warning.
      
      Fixes: 2e13f33a ("lightnvm: create cmd before allocating request")
      Fixes: 91276162 ("lightnvm: refactor end_io functions for sync")
      Signed-off-by: NGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: NJens Axboe <axboe@fb.com>
      629b1b2e
  8. 04 5月, 2017 1 次提交
  9. 02 5月, 2017 1 次提交
  10. 27 4月, 2017 1 次提交
  11. 26 4月, 2017 3 次提交
  12. 25 4月, 2017 3 次提交
  13. 24 4月, 2017 4 次提交
    • C
      nvme-fc: mark two symbols static · baee29ac
      Christoph Hellwig 提交于
      Found by sparse.
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      Reviewed-by: NJames Smart <james.smart@broadcom.com>
      Reviewed-by: NJohannes Thumshirn <jthumshirn@suse.de>
      baee29ac
    • J
      nvme_fc: add controller reset support · 61bff8ef
      James Smart 提交于
      This patch actually does quite a few things.  When looking to add
      controller reset support, the organization modeled after rdma was
      very fragmented. rdma duplicates the reset and teardown paths and does
      different things to the block layer on the two paths. The code to build
      up the controller is also duplicated between the initial creation and
      the reset/error recovery paths. So I decided to make this sane.
      
      I reorganized the controller creation and teardown so that there is a
      connect path and a disconnect path.  Initial creation obviously uses
      the connect path.  Controller teardown will use the disconnect path,
      followed last access code. Controller reset will use the disconnect
      path to stop operation, and then the connect path to re-establish
      the controller.
      
      Along the way, several things were fixed
      - aens were not properly set up. They are allocated differently from
        the per-request structure on the blk queues.
      - aens were oddly torn down. the prior patch corrected to abort, but
        we still need to dma unmap and free relative elements.
      - missed a few ref counting points: in aen completion and on i/o's
        that fail
      - controller initial create failure paths were still confused vs teardown
        before converting to ref counting vs after we convert to refcounting.
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      61bff8ef
    • J
      nvme_fc: add aen abort to teardown · 78a7ac26
      James Smart 提交于
      Add abort support for aens. Commonized the op abort to apply to aen or
      real ios (caused some reorg/routine movement). Abort path sets termination
      flag in prep for next patch that will be watching i/o abort completion
      before proceeding with controller teardown.
      
      Now that we're aborting aens, the "exit" code that simply cleared out
      their context no longer applies.
      
      Also clarified how we detect an AEN vs a normal io - by a flag, not
      by whether a rq exists or the a rqno is out of range.
      
      Note: saw some interesting cases where if the queues are stopped and
      we're waiting for the aborts, the core layer can call the complete_rq
      callback for the io. So the io completion synchronizes link side completion
      with possible blk layer completion under error.
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      78a7ac26
    • J
      nvme_fc: fix command id check · 458f280d
      James Smart 提交于
      The code validates the command_id in the response to the original
      sqe command. But prior code was using the rq->rqno as the sqe command
      id. The core layer overwrites what the transport set there originally.
      
      Use the actual sqe content.
      Signed-off-by: NJames Smart <james.smart@broadcom.com>
      Reviewed-by: NSagi Grimberg <sagi@grimberg.me>
      Signed-off-by: NChristoph Hellwig <hch@lst.de>
      458f280d
  14. 21 4月, 2017 1 次提交