[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <02d965f9-d465-6e6f-b113-5f6f7e327afb@grimberg.me>
Date: Fri, 14 Aug 2020 11:00:08 -0700
From: Sagi Grimberg <sagi@...mberg.me>
To: Keith Busch <kbusch@...nel.org>, Tong Zhang <ztong0001@...il.com>
Cc: linux-kernel@...r.kernel.org, linux-nvme@...ts.infradead.org,
axboe@...com, Christoph Hellwig <hch@....de>
Subject: Re: [PATCH] nvme-pci: cancel nvme device request before disabling
>>>> diff --git a/drivers/nvme/host/pci.c b/drivers/nvme/host/pci.c
>>>> index ba725ae47305..c4f1ce0ee1e3 100644
>>>> --- a/drivers/nvme/host/pci.c
>>>> +++ b/drivers/nvme/host/pci.c
>>>> @@ -1249,8 +1249,8 @@ static enum blk_eh_timer_return nvme_timeout(struct request *req, bool reserved)
>>>> dev_warn_ratelimited(dev->ctrl.device,
>>>> "I/O %d QID %d timeout, disable controller\n",
>>>> req->tag, nvmeq->qid);
>>>> - nvme_dev_disable(dev, true);
>>>> nvme_req(req)->flags |= NVME_REQ_CANCELLED;
>>>> + nvme_dev_disable(dev, true);
>>>> return BLK_EH_DONE;
>>>
>>> Shouldn't this flag have been set in nvme_cancel_request()?
>>
>> nvme_cancel_request() is not setting this flag to cancelled and this is causing
>
> Right, I see that it doesn't, but I'm saying that it should. We used to
> do something like that, and I'm struggling to recall why we're not
> anymore.
I also don't recall why, but I know that we rely on the status
propagating back from submit_sync_cmd which won't happen because
it converts the status into -ENODEV.
> The driver is not reporting non-response back for all
> cancelled requests, and that is probably not what we should be doing.
I'd think that we should modify our callers to handle nvme status
codes as well rather than rely on nvme_submit_sync_cmd to return a
negative codes under some conditions.
Powered by blists - more mailing lists