All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] block: set default max segment size in case of virt_boundary
@ 2024-04-24 13:47 Ming Lei
  2024-05-07  1:41 ` Ming Lei
  2024-05-07  2:28 ` Jens Axboe
  0 siblings, 2 replies; 4+ messages in thread
From: Ming Lei @ 2024-04-24 13:47 UTC (permalink / raw)
  To: Jens Axboe, linux-block
  Cc: Ming Lei, Christoph Hellwig, Mike Snitzer, Geert Uytterhoeven

For devices with virt_boundary limit, the driver may provide zero max
segment size, we have to set it as UINT_MAX at default. Otherwise, it
may cause warning in driver when handling sglist.

Fix it by setting default max segment size as UINT_MAX.

Cc: Christoph Hellwig <hch@lst.de>
Cc: Mike Snitzer <snitzer@kernel.org>
Fixes: b561ea56a264 ("block: allow device to have both virt_boundary_mask and max segment size")
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Closes: https://lore.kernel.org/linux-block/7e38b67c-9372-a42d-41eb-abdce33d3372@linux-m68k.org/
Signed-off-by: Ming Lei <ming.lei@redhat.com>
---
 block/blk-settings.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/block/blk-settings.c b/block/blk-settings.c
index d2731843f2fc..9d6033e01f2e 100644
--- a/block/blk-settings.c
+++ b/block/blk-settings.c
@@ -188,7 +188,10 @@ static int blk_validate_limits(struct queue_limits *lim)
 	 * bvec and lower layer bio splitting is supposed to handle the two
 	 * correctly.
 	 */
-	if (!lim->virt_boundary_mask) {
+	if (lim->virt_boundary_mask) {
+		if (!lim->max_segment_size)
+			lim->max_segment_size = UINT_MAX;
+	} else {
 		/*
 		 * The maximum segment size has an odd historic 64k default that
 		 * drivers probably should override.  Just like the I/O size we
-- 
2.42.0


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

* Re: [PATCH] block: set default max segment size in case of virt_boundary
  2024-04-24 13:47 [PATCH] block: set default max segment size in case of virt_boundary Ming Lei
@ 2024-05-07  1:41 ` Ming Lei
  2024-05-07  2:28   ` Jens Axboe
  2024-05-07  2:28 ` Jens Axboe
  1 sibling, 1 reply; 4+ messages in thread
From: Ming Lei @ 2024-05-07  1:41 UTC (permalink / raw)
  To: Jens Axboe, linux-block
  Cc: Christoph Hellwig, Mike Snitzer, Geert Uytterhoeven

On Wed, Apr 24, 2024 at 09:47:22PM +0800, Ming Lei wrote:
> For devices with virt_boundary limit, the driver may provide zero max
> segment size, we have to set it as UINT_MAX at default. Otherwise, it
> may cause warning in driver when handling sglist.
> 
> Fix it by setting default max segment size as UINT_MAX.
> 
> Cc: Christoph Hellwig <hch@lst.de>
> Cc: Mike Snitzer <snitzer@kernel.org>
> Fixes: b561ea56a264 ("block: allow device to have both virt_boundary_mask and max segment size")
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Closes: https://lore.kernel.org/linux-block/7e38b67c-9372-a42d-41eb-abdce33d3372@linux-m68k.org/
> Signed-off-by: Ming Lei <ming.lei@redhat.com>
> ---
>  block/blk-settings.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/block/blk-settings.c b/block/blk-settings.c
> index d2731843f2fc..9d6033e01f2e 100644
> --- a/block/blk-settings.c
> +++ b/block/blk-settings.c
> @@ -188,7 +188,10 @@ static int blk_validate_limits(struct queue_limits *lim)
>  	 * bvec and lower layer bio splitting is supposed to handle the two
>  	 * correctly.
>  	 */
> -	if (!lim->virt_boundary_mask) {
> +	if (lim->virt_boundary_mask) {
> +		if (!lim->max_segment_size)
> +			lim->max_segment_size = UINT_MAX;
> +	} else {
>  		/*
>  		 * The maximum segment size has an odd historic 64k default that
>  		 * drivers probably should override.  Just like the I/O size we

Hello Jens,

Looks this fix is missed, can you make it to v6.9?


Thanks,
Ming


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

* Re: [PATCH] block: set default max segment size in case of virt_boundary
  2024-05-07  1:41 ` Ming Lei
@ 2024-05-07  2:28   ` Jens Axboe
  0 siblings, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2024-05-07  2:28 UTC (permalink / raw)
  To: Ming Lei, linux-block; +Cc: Christoph Hellwig, Mike Snitzer, Geert Uytterhoeven

On 5/6/24 7:41 PM, Ming Lei wrote:
> On Wed, Apr 24, 2024 at 09:47:22PM +0800, Ming Lei wrote:
>> For devices with virt_boundary limit, the driver may provide zero max
>> segment size, we have to set it as UINT_MAX at default. Otherwise, it
>> may cause warning in driver when handling sglist.
>>
>> Fix it by setting default max segment size as UINT_MAX.
>>
>> Cc: Christoph Hellwig <hch@lst.de>
>> Cc: Mike Snitzer <snitzer@kernel.org>
>> Fixes: b561ea56a264 ("block: allow device to have both virt_boundary_mask and max segment size")
>> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
>> Closes: https://lore.kernel.org/linux-block/7e38b67c-9372-a42d-41eb-abdce33d3372@linux-m68k.org/
>> Signed-off-by: Ming Lei <ming.lei@redhat.com>
>> ---
>>  block/blk-settings.c | 5 ++++-
>>  1 file changed, 4 insertions(+), 1 deletion(-)
>>
>> diff --git a/block/blk-settings.c b/block/blk-settings.c
>> index d2731843f2fc..9d6033e01f2e 100644
>> --- a/block/blk-settings.c
>> +++ b/block/blk-settings.c
>> @@ -188,7 +188,10 @@ static int blk_validate_limits(struct queue_limits *lim)
>>  	 * bvec and lower layer bio splitting is supposed to handle the two
>>  	 * correctly.
>>  	 */
>> -	if (!lim->virt_boundary_mask) {
>> +	if (lim->virt_boundary_mask) {
>> +		if (!lim->max_segment_size)
>> +			lim->max_segment_size = UINT_MAX;
>> +	} else {
>>  		/*
>>  		 * The maximum segment size has an odd historic 64k default that
>>  		 * drivers probably should override.  Just like the I/O size we
> 
> Hello Jens,
> 
> Looks this fix is missed, can you make it to v6.9?

Oops yes, thanks for the reminder.

-- 
Jens Axboe


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

* Re: [PATCH] block: set default max segment size in case of virt_boundary
  2024-04-24 13:47 [PATCH] block: set default max segment size in case of virt_boundary Ming Lei
  2024-05-07  1:41 ` Ming Lei
@ 2024-05-07  2:28 ` Jens Axboe
  1 sibling, 0 replies; 4+ messages in thread
From: Jens Axboe @ 2024-05-07  2:28 UTC (permalink / raw)
  To: linux-block, Ming Lei; +Cc: Christoph Hellwig, Mike Snitzer, Geert Uytterhoeven


On Wed, 24 Apr 2024 21:47:22 +0800, Ming Lei wrote:
> For devices with virt_boundary limit, the driver may provide zero max
> segment size, we have to set it as UINT_MAX at default. Otherwise, it
> may cause warning in driver when handling sglist.
> 
> Fix it by setting default max segment size as UINT_MAX.
> 
> 
> [...]

Applied, thanks!

[1/1] block: set default max segment size in case of virt_boundary
      commit: ffd379c13fc0ab2c7c4313e7a01c71d9d202cc88

Best regards,
-- 
Jens Axboe




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

end of thread, other threads:[~2024-05-07  2:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-24 13:47 [PATCH] block: set default max segment size in case of virt_boundary Ming Lei
2024-05-07  1:41 ` Ming Lei
2024-05-07  2:28   ` Jens Axboe
2024-05-07  2:28 ` Jens Axboe

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.