Re: [PATCH RESEND for-next] RDMA/hns: Solve the problem that dma_pool is used during the reset
From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2021-06-21 23:25:03
From: Jason Gunthorpe <jgg@nvidia.com>
Date: 2021-06-21 23:25:03
On Fri, Jun 11, 2021 at 05:35:56PM +0800, Weihang Li wrote:
From: Jiaran Zhang <redacted> During the reset, the driver calls dma_pool_destroy() to release the dma_pool resources. If the dma_pool_free interface is called during the modify_qp operation, an exception will occur. The completion synchronization mechanism is used to ensure that dma_pool_destroy() is executed after the dma_pool_free operation is complete.
This should probably be a simple rwsem instead of faking one up with a refcount and completion. The only time you need this pattern is if the code is returning to userspace, which didn't look like was happening here. Jason