All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@lst.de>
To: Hannes Reinecke <hare@suse.de>
Cc: linux-nvme@lists.infradead.org, Daniel Wagner <dwagner@suse.de>,
	Christoph Hellwig <hch@lst.de>, Keith Busch <keith.busch@wdc.com>,
	Sagi Grimberg <sagi@grimberg.me>
Subject: Re: [PATCH 2/2] nvme: sanitize KATO setting
Date: Wed, 24 Feb 2021 17:23:50 +0100	[thread overview]
Message-ID: <20210224162350.GB9780@lst.de> (raw)
In-Reply-To: <20210223120728.104699-3-hare@suse.de>

> +		unsigned long kato_delay = ctrl->kato >> 1;
> +
> +		queue_delayed_work(nvme_wq, &ctrl->ka_work, kato_delay * HZ);

> +		unsigned long kato_delay = ctrl->kato >> 1;
> +
> +		queue_delayed_work(nvme_wq, &ctrl->ka_work, kato_delay * HZ);

> +	unsigned long kato_delay = ctrl->kato >> 1;

> +	queue_delayed_work(nvme_wq, &ctrl->ka_work, kato_delay * HZ);

I think we need a properly documented helper for

	(ctrl->kato / 2) * HZ

instead of all this open coded magic.

>  	cmd.connect.kato = ctrl->kato ?
> -		cpu_to_le32((ctrl->kato + NVME_KATO_GRACE) * 1000) : 0;
> +		cpu_to_le32(ctrl->kato * 1000) : 0;

cpu_to_le32(0 * 1000) is still 0, so we can remove the branch here now.

_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  reply	other threads:[~2021-02-24 16:24 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-23 12:07 [PATCH 0/2] nvme: sanitize KATO handling Hannes Reinecke
2021-02-23 12:07 ` [PATCH 1/2] nvme: fixup kato deadlock Hannes Reinecke
2021-02-24 16:22   ` Christoph Hellwig
2021-02-23 12:07 ` [PATCH 2/2] nvme: sanitize KATO setting Hannes Reinecke
2021-02-24 16:23   ` Christoph Hellwig [this message]
2021-02-24  6:42 ` [PATCH 0/2] nvme: sanitize KATO handling Chao Leng
2021-02-24  7:06   ` Hannes Reinecke
2021-02-24  7:20     ` Chao Leng
2021-02-24  7:27       ` Chao Leng
2021-02-24  7:59       ` Hannes Reinecke

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=20210224162350.GB9780@lst.de \
    --to=hch@lst.de \
    --cc=dwagner@suse.de \
    --cc=hare@suse.de \
    --cc=keith.busch@wdc.com \
    --cc=linux-nvme@lists.infradead.org \
    --cc=sagi@grimberg.me \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.