[PATCH] nvme: free sq/cq dbbuf pointers when dbbuf set fails

Minwoo Im minwoo.im.dev at gmail.com
Fri Nov 6 04:02:15 EST 2020


On Fri, Nov 6, 2020 at 1:13 AM Keith Busch <kbusch at kernel.org> wrote:
>
> On Thu, Nov 05, 2020 at 11:28:47PM +0900, Minwoo Im wrote:
> > If Doorbell Buffer Config command fails even 'dev->dbbuf_dbs != NULL'
> > which means OACS indicates that NVME_CTRL_OACS_DBBUF_SUPP is set,
> > nvme_dbbuf_update_and_check_event() will check event even it's not been
> > successfully set.
> >
> > This patch fixes mismatch among dbbuf for sq/cqs in case that dbbuf
> > command fails.
>
> This fixes if host dbbuf was successfully configured at one point, but
> fails on a subsequent reset, correct? Otherwise, I don't see how the
> queue's dbbuf values would have been set to non-NULL.

Yes. reset_work() checks OACS with DBBUF_SUPP and if it's reported as
supported, then it will alloc dev->dbbuf_dbs.  After that, However, if
nvme_dbbuf_set() fails with sc != 0 then it should free for each queue's
dbbuf pointer to prevent being checked for events when updating the doorbell.



More information about the Linux-nvme mailing list