[PATCH 11/15] nvme: add Clang context annotations for nvme_queue::sq_lock

Bart Van Assche bvanassche at acm.org
Wed Jun 10 09:33:50 PDT 2026


On 6/10/26 7:27 AM, Nilay Shroff wrote:
>   static void nvme_free_queue(struct nvme_queue *nvmeq)
> +	__context_unsafe(/* frees queue which is no longer in use */)
>   {
>   	dma_free_coherent(nvmeq->dev->dev, CQ_SIZE(nvmeq),
>   				(void *)nvmeq->cqes, nvmeq->cq_dma_addr);
> @@ -2176,6 +2182,7 @@ static int queue_request_irq(struct nvme_queue *nvmeq)
>   }
>   
>   static void nvme_init_queue(struct nvme_queue *nvmeq, u16 qid)
> +	__context_unsafe(/* safe to init queue without any protection */)
>   {
>   	struct nvme_dev *dev = nvmeq->dev;

__context_unsafe() is a big hammer that disables context analysis
for the entire function body. Has it been considered to use
guard(..._init)(...) instead?

Thanks,

Bart.




More information about the Linux-nvme mailing list