From: Chaitanya Kulkarni Date: Wed, 13 May 2026 18:51:51 +0000 (-0700) Subject: block: clear BLK_FEAT_PCI_P2PDMA in blk_stack_limits() for non-supporting devices X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7882834048f110931275357db60dccff906dc96a;p=thirdparty%2Fkernel%2Flinux.git block: clear BLK_FEAT_PCI_P2PDMA in blk_stack_limits() for non-supporting devices BLK_FEAT_NOWAIT and BLK_FEAT_POLL are cleared in blk_stack_limits() when an underlying device does not support them. Apply the same treatment to BLK_FEAT_PCI_P2PDMA: stacking drivers set it unconditionally and rely on the core to clear it whenever a non-supporting member device is stacked. Tested-by: Pranjal Shrivastava Reviewed-by: Christoph Hellwig Reviewed-by: Sagi Grimberg Reviewed-by: Nitesh Shetty Signed-off-by: Chaitanya Kulkarni Tested=by: Pranjal Shrivastava Link: https://patch.msgid.link/20260513185153.95552-2-kch@nvidia.com Signed-off-by: Jens Axboe --- diff --git a/block/blk-settings.c b/block/blk-settings.c index 78c83817b9d36..8274631290dbf 100644 --- a/block/blk-settings.c +++ b/block/blk-settings.c @@ -795,6 +795,8 @@ int blk_stack_limits(struct queue_limits *t, struct queue_limits *b, t->features &= ~BLK_FEAT_NOWAIT; if (!(b->features & BLK_FEAT_POLL)) t->features &= ~BLK_FEAT_POLL; + if (!(b->features & BLK_FEAT_PCI_P2PDMA)) + t->features &= ~BLK_FEAT_PCI_P2PDMA; t->flags |= (b->flags & BLK_FLAG_MISALIGNED);