Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion drivers/nvme/host/core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4903,7 +4903,7 @@ static void nvme_fw_act_work(struct work_struct *work)
if (ctrl->mtfa)
fw_act_timeout = jiffies + msecs_to_jiffies(ctrl->mtfa * 100);
else
fw_act_timeout = jiffies + secs_to_jiffies(admin_timeout);
fw_act_timeout = jiffies + NVME_ADMIN_TIMEOUT;

nvme_quiesce_io_queues(ctrl);
while (nvme_ctrl_pp_status(ctrl)) {
Expand Down
13 changes: 11 additions & 2 deletions drivers/nvme/host/nvme.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,20 @@

extern const struct pr_ops nvme_pr_ops;

/* Seconds to jiffies, capped for the u32 timeouts and timer delays */
static inline unsigned int nvme_timeout_to_jiffies(unsigned int timeout)
{
unsigned long max_secs;

max_secs = min_t(unsigned long, UINT_MAX, MAX_JIFFY_OFFSET) / HZ;
return min_t(unsigned long, timeout, max_secs) * HZ;
}

extern unsigned int nvme_io_timeout;
#define NVME_IO_TIMEOUT (nvme_io_timeout * HZ)
#define NVME_IO_TIMEOUT nvme_timeout_to_jiffies(nvme_io_timeout)

extern unsigned int admin_timeout;
#define NVME_ADMIN_TIMEOUT (admin_timeout * HZ)
#define NVME_ADMIN_TIMEOUT nvme_timeout_to_jiffies(admin_timeout)

#define NVME_DEFAULT_KATO 5

Expand Down
Loading