Linux block layer
 help / color / mirror / Atom feed
* [PATCH 6.6.y v2 1/1] block: Fix bounce check logic in blk_queue_may_bounce()
@ 2025-08-14  6:36 Hardeep Sharma
  2025-08-14  9:03 ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Hardeep Sharma @ 2025-08-14  6:36 UTC (permalink / raw)
  To: Jens Axboe, Hannes Reinecke, Martin K . Petersen
  Cc: linux-block, linux-kernel, stable, Hardeep Sharma

Buffer bouncing is needed only when memory exists above the lowmem region,
i.e., when max_low_pfn < max_pfn. The previous check (max_low_pfn >=
max_pfn) was inverted and prevented bouncing when it could actually be
required.

Note that bouncing depends on CONFIG_HIGHMEM, which is typically enabled
on 32-bit ARM where not all memory is permanently mapped into the kernel’s
lowmem region.

Branch-Specific Note:

This fix is specific to this branch (6.6.y) only.
In the upstream “tip” kernel, bounce buffer support for highmem pages
was completely removed after kernel version 6.12. Therefore, this
modification is not possible or relevant in the tip branch.

Fixes: 9bb33f24abbd0 ("block: refactor the bounce buffering code")
Cc: stable@vger.kernel.org
Signed-off-by: Hardeep Sharma <quic_hardshar@quicinc.com>
---
 block/blk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk.h b/block/blk.h
index 67915b04b3c1..f8a1d64be5a2 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -383,7 +383,7 @@ static inline bool blk_queue_may_bounce(struct request_queue *q)
 {
 	return IS_ENABLED(CONFIG_BOUNCE) &&
 		q->limits.bounce == BLK_BOUNCE_HIGH &&
-		max_low_pfn >= max_pfn;
+		max_low_pfn < max_pfn;
 }
 
 static inline struct bio *blk_queue_bounce(struct bio *bio,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread
* [PATCH 6.6.y v2 1/1] block: Fix bounce check logic in blk_queue_may_bounce()
@ 2025-07-25 11:27 Hardeep Sharma
  2025-07-25 12:04 ` Greg KH
  0 siblings, 1 reply; 9+ messages in thread
From: Hardeep Sharma @ 2025-07-25 11:27 UTC (permalink / raw)
  To: Jens Axboe, Hannes Reinecke, Martin K . Petersen
  Cc: linux-block, linux-kernel, stable, Hardeep Sharma

Buffer bouncing is needed only when memory exists above the lowmem region,
i.e., when max_low_pfn < max_pfn. The previous check (max_low_pfn >=
max_pfn) was inverted and prevented bouncing when it could actually be
required.

Note that bouncing depends on CONFIG_HIGHMEM, which is typically enabled
on 32-bit ARM where not all memory is permanently mapped into the kernel’s
lowmem region.

Fixes: 9bb33f24abbd0 ("block: refactor the bounce buffering code")
Cc: stable@vger.kernel.org
Signed-off-by: Hardeep Sharma <quic_hardshar@quicinc.com>
---
Changelog v1..v2:

* Updated subject line

 block/blk.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/block/blk.h b/block/blk.h
index 67915b04b3c1..f8a1d64be5a2 100644
--- a/block/blk.h
+++ b/block/blk.h
@@ -383,7 +383,7 @@ static inline bool blk_queue_may_bounce(struct request_queue *q)
 {
 	return IS_ENABLED(CONFIG_BOUNCE) &&
 		q->limits.bounce == BLK_BOUNCE_HIGH &&
-		max_low_pfn >= max_pfn;
+		max_low_pfn < max_pfn;
 }
 
 static inline struct bio *blk_queue_bounce(struct bio *bio,
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-08-14 13:54 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-08-14  6:36 [PATCH 6.6.y v2 1/1] block: Fix bounce check logic in blk_queue_may_bounce() Hardeep Sharma
2025-08-14  9:03 ` Greg KH
2025-08-14 10:54   ` Hardeep Sharma
2025-08-14 11:36     ` Greg KH
2025-08-14 13:06       ` Hardeep Sharma
2025-08-14 13:54         ` Greg KH
2025-08-14 13:11       ` Hardeep Sharma
  -- strict thread matches above, loose matches on Subject: below --
2025-07-25 11:27 Hardeep Sharma
2025-07-25 12:04 ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox