dm-devel.redhat.com archive mirror
 help / color / mirror / Atom feed
* [PATCH] dm-table:remove the restriction on zone sector being align to pow2
@ 2024-04-29  2:50 Liao Yuanhong
  2024-04-29 18:51 ` Benjamin Marzinski
  0 siblings, 1 reply; 4+ messages in thread
From: Liao Yuanhong @ 2024-04-29  2:50 UTC (permalink / raw)
  To: Mike Snitzer; +Cc: dm-devel, bo.wu, Liao Yuanhong

For zoned-UFS, sector size may not aligned to pow2, so we need to remove 
the pow2 limitation.

Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
---
 drivers/md/dm-table.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
index 41f1d731ae5a..823f2f6a2d53 100644
--- a/drivers/md/dm-table.c
+++ b/drivers/md/dm-table.c
@@ -1663,10 +1663,6 @@ static int validate_hardware_zoned(struct dm_table *t, bool zoned,
 		return -EINVAL;
 	}
 
-	/* Check zone size validity and compatibility */
-	if (!zone_sectors || !is_power_of_2(zone_sectors))
-		return -EINVAL;
-
 	if (dm_table_any_dev_attr(t, device_not_matches_zone_sectors, &zone_sectors)) {
 		DMERR("%s: zone sectors is not consistent across all zoned devices",
 		      dm_device_name(t->md));
-- 
2.25.1


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

* Re: [PATCH] dm-table:remove the restriction on zone sector being align to pow2
  2024-04-29  2:50 [PATCH] dm-table:remove the restriction on zone sector being align to pow2 Liao Yuanhong
@ 2024-04-29 18:51 ` Benjamin Marzinski
  2024-04-30  3:32   ` Liao Yuanhong
  0 siblings, 1 reply; 4+ messages in thread
From: Benjamin Marzinski @ 2024-04-29 18:51 UTC (permalink / raw)
  To: Liao Yuanhong; +Cc: Mike Snitzer, dm-devel, bo.wu

On Mon, Apr 29, 2024 at 10:50:29AM +0800, Liao Yuanhong wrote:
> For zoned-UFS, sector size may not aligned to pow2, so we need to remove 
> the pow2 limitation.

When was non-power-of-2 support added to zone devices? AFAIK, the last
attempt to add support for it was:

https://lore.kernel.org/dm-devel/20220923173618.6899-2-p.raghav@samsung.com/

Which was not merged. See that email thread for other necessary dm
changes to support this.

-Ben

> 
> Signed-off-by: Liao Yuanhong <liaoyuanhong@vivo.com>
> ---
>  drivers/md/dm-table.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/drivers/md/dm-table.c b/drivers/md/dm-table.c
> index 41f1d731ae5a..823f2f6a2d53 100644
> --- a/drivers/md/dm-table.c
> +++ b/drivers/md/dm-table.c
> @@ -1663,10 +1663,6 @@ static int validate_hardware_zoned(struct dm_table *t, bool zoned,
>  		return -EINVAL;
>  	}
>  
> -	/* Check zone size validity and compatibility */
> -	if (!zone_sectors || !is_power_of_2(zone_sectors))
> -		return -EINVAL;
> -
>  	if (dm_table_any_dev_attr(t, device_not_matches_zone_sectors, &zone_sectors)) {
>  		DMERR("%s: zone sectors is not consistent across all zoned devices",
>  		      dm_device_name(t->md));
> -- 
> 2.25.1
> 


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

* Re: [PATCH] dm-table:remove the restriction on zone sector being align to pow2
  2024-04-29 18:51 ` Benjamin Marzinski
@ 2024-04-30  3:32   ` Liao Yuanhong
  2024-04-30 22:35     ` Benjamin Marzinski
  0 siblings, 1 reply; 4+ messages in thread
From: Liao Yuanhong @ 2024-04-30  3:32 UTC (permalink / raw)
  To: bmarzins; +Cc: bo.wu, dm-devel, liaoyuanhong, snitzer

Currently, the zone size of the ZoneUFS provided by Hynix is not aligned
to pow2. After testing on the mobile platform with this fix, we found 
that basic functionality can be executed. May we merge this patch first?

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

* Re: [PATCH] dm-table:remove the restriction on zone sector being align to pow2
  2024-04-30  3:32   ` Liao Yuanhong
@ 2024-04-30 22:35     ` Benjamin Marzinski
  0 siblings, 0 replies; 4+ messages in thread
From: Benjamin Marzinski @ 2024-04-30 22:35 UTC (permalink / raw)
  To: Liao Yuanhong
  Cc: bo.wu, dm-devel, snitzer, Pankaj Raghav, damien.lemoal,
	Bart Van Assche, Jens Axboe

On Tue, Apr 30, 2024 at 11:32:07AM +0800, Liao Yuanhong wrote:
> Currently, the zone size of the ZoneUFS provided by Hynix is not aligned
> to pow2. After testing on the mobile platform with this fix, we found 
> that basic functionality can be executed. May we merge this patch first?

The issue is that device-mapper makes assumptions in multiple places
that zones are power of 2 sized. Simply removing this check will allow
users to create broken device-mapper devices on top of non-power-of-2
devices.

A better solution would be to see if Pankaj Raghav's non-power-of-2 zone
size patchset can be revisited.

-Ben 


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

end of thread, other threads:[~2024-04-30 22:35 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-04-29  2:50 [PATCH] dm-table:remove the restriction on zone sector being align to pow2 Liao Yuanhong
2024-04-29 18:51 ` Benjamin Marzinski
2024-04-30  3:32   ` Liao Yuanhong
2024-04-30 22:35     ` Benjamin Marzinski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).