Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hch@lst.de (Christoph Hellwig)
Subject: [PATCH V3 2/2] nvme: Add support for FW activation without reset
Date: Sat, 24 Jun 2017 09:11:05 +0200	[thread overview]
Message-ID: <20170624071105.GC14437@lst.de> (raw)
In-Reply-To: <7c382f8a-12cc-566b-f461-1bc40ccf751c@samsung.com>

On Fri, Jun 23, 2017@05:41:21PM +0530, Arnav Dawn wrote:
> 
> On Wednesday 21 June 2017 07:07 PM, Keith Busch wrote:
> > On Wed, Jun 21, 2017@01:06:31PM +0530, Arnav Dawn wrote:
> >> On Monday 19 June 2017 10:35 PM, Keith Busch wrote:
> >>> On Sat, Jun 10, 2017@12:38:42PM +0530, Arnav Dawn wrote:
> >>>
> >>>> +				ctrl->fw_act_timeout = jiffies +
> >>>> +					msecs_to_jiffies(ctrl->mtfa * 100);
> >>> Instead of adding another field to the nvme_ctrl structure, just
> >>> calculate the timeout in your nvme_fw_act_work function.
> >> intention was to  set fw_act_timeout as soon as the AER is received.
> >> Since work could be scheduled after some time, setting timeout in
> >> work function would add that delay to it.
> > This feature doesn't require such tight constraints. The 100ms sleep
> > granularity in your CSTS.PP polling already exceeds the amount of time
> > it takes for work to schedule.
> i agree, i will update it in next version.
> >>>> +			else
> >>>> +				ctrl->fw_act_timeout = jiffies +
> >>>> +					msecs_to_jiffies(admin_timeout * 1000);
> >>>> +
> >>>> +			schedule_delayed_work(&ctrl->fw_act_work, 0);
> >>> If scheduling with 0 delay, why is this delayed work?
> >> I used delayed work so i could use cancel_delayed_work, as cancel_work
> >> was not available.
> > If you really have a use for cancel_work, you could send a patch to
> > export the symbol.
> >
> > In any case, that's probably not going to do what you want. The work can
> > only be cancelled if it hasn't started, and since you start it without
> > delay, the work will likely be running. Maybe you want to add some other
> > criteria for the nvme_fw_act_work to end early, though I expect CSTS.PP
> > to clear if f/w load failed.
> you are right, if the device sends Firmware image load error AER,
> CSTS.PP is probably cleared, and the nvme_fw_act_work will end.
> so i think nothing needs to be done on FW Image load error AER.

please make sure you do a cancel_work_sync there and in the controller
removal path to make sure we don't have a work item lingering around.

      parent reply	other threads:[~2017-06-24  7:11 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CGME20170610070549epcas1p4fae7273b007148b52d31bf62cbb07b74@epcas1p4.samsung.com>
2017-06-10  7:05 ` [PATCH V3 0/2] Support for FW activation without reset Arnav Dawn
2017-06-10  7:06   ` [PATCH V3 1/2] nvme: Rename and move get_log_page to nvme/scsi Arnav Dawn
2017-06-13  6:43     ` Christoph Hellwig
2017-06-10  7:08   ` [PATCH V3 2/2] nvme: Add support for FW activation without reset Arnav Dawn
2017-06-19 17:05     ` Keith Busch
2017-06-21  7:36       ` Arnav Dawn
2017-06-21 13:37         ` Keith Busch
2017-06-23 12:11           ` Arnav Dawn
2017-06-23 15:25             ` Keith Busch
2017-06-25  9:19               ` Arnav Dawn
2017-06-29 13:09                 ` Arnav Dawn
2017-06-24  7:11             ` Christoph Hellwig [this message]

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=20170624071105.GC14437@lst.de \
    --to=hch@lst.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox