qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] hw/ufs: Fix incorrect comment for segment_size and allocation_unit_size
       [not found] <CGME20250403092140epcms2p355a7f039871b3e5b409754ef450b9158@epcms2p3>
@ 2025-04-03  9:21 ` Keoseong Park
  2025-04-03 11:03   ` Jeuk Kim
  0 siblings, 1 reply; 2+ messages in thread
From: Keoseong Park @ 2025-04-03  9:21 UTC (permalink / raw)
  To: Jeuk Kim; +Cc: qemu-devel@nongnu.org

The comments for segment_size and allocation_unit_size incorrectly
described them as 4KB. According to the UFS specification,
segment_size is expressed in units of 512 bytes.
Given segment_size = 0x2000 (8192), the actual size is 4MB.
Similarly, allocation_unit_size = 1 means 1 segment = 4MB.

This patch updates the comments to reflect the correct size.

Signed-off-by: Keoseong Park <keosung.park@samsung.com>
---
 hw/ufs/ufs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c
index ee13edacd8..542f13b10e 100644
--- a/hw/ufs/ufs.c
+++ b/hw/ufs/ufs.c
@@ -1753,8 +1753,8 @@ static void ufs_init_hc(UfsHc *u)
     u->geometry_desc.length = sizeof(GeometryDescriptor);
     u->geometry_desc.descriptor_idn = UFS_QUERY_DESC_IDN_GEOMETRY;
     u->geometry_desc.max_number_lu = (UFS_MAX_LUS == 32) ? 0x1 : 0x0;
-    u->geometry_desc.segment_size = cpu_to_be32(0x2000); /* 4KB */
-    u->geometry_desc.allocation_unit_size = 0x1; /* 4KB */
+    u->geometry_desc.segment_size = cpu_to_be32(0x2000); /* 4MB: 8192 * 512B */
+    u->geometry_desc.allocation_unit_size = 0x1; /* 4MB: 1 segment */
     u->geometry_desc.min_addr_block_size = 0x8; /* 4KB */
     u->geometry_desc.max_in_buffer_size = 0x8;
     u->geometry_desc.max_out_buffer_size = 0x8;
-- 
2.25.1



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

* Re: [PATCH] hw/ufs: Fix incorrect comment for segment_size and allocation_unit_size
  2025-04-03  9:21 ` [PATCH] hw/ufs: Fix incorrect comment for segment_size and allocation_unit_size Keoseong Park
@ 2025-04-03 11:03   ` Jeuk Kim
  0 siblings, 0 replies; 2+ messages in thread
From: Jeuk Kim @ 2025-04-03 11:03 UTC (permalink / raw)
  To: keosung.park, Jeuk Kim; +Cc: qemu-devel@nongnu.org


2025-04-03 오후 6:21에 Keoseong Park 이(가) 쓴 글:
> The comments for segment_size and allocation_unit_size incorrectly
> described them as 4KB. According to the UFS specification,
> segment_size is expressed in units of 512 bytes.
> Given segment_size = 0x2000 (8192), the actual size is 4MB.
> Similarly, allocation_unit_size = 1 means 1 segment = 4MB.
>
> This patch updates the comments to reflect the correct size.
>
> Signed-off-by: Keoseong Park <keosung.park@samsung.com>
> ---
>   hw/ufs/ufs.c | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/hw/ufs/ufs.c b/hw/ufs/ufs.c
> index ee13edacd8..542f13b10e 100644
> --- a/hw/ufs/ufs.c
> +++ b/hw/ufs/ufs.c
> @@ -1753,8 +1753,8 @@ static void ufs_init_hc(UfsHc *u)
>       u->geometry_desc.length = sizeof(GeometryDescriptor);
>       u->geometry_desc.descriptor_idn = UFS_QUERY_DESC_IDN_GEOMETRY;
>       u->geometry_desc.max_number_lu = (UFS_MAX_LUS == 32) ? 0x1 : 0x0;
> -    u->geometry_desc.segment_size = cpu_to_be32(0x2000); /* 4KB */
> -    u->geometry_desc.allocation_unit_size = 0x1; /* 4KB */
> +    u->geometry_desc.segment_size = cpu_to_be32(0x2000); /* 4MB: 8192 * 512B */
> +    u->geometry_desc.allocation_unit_size = 0x1; /* 4MB: 1 segment */
>       u->geometry_desc.min_addr_block_size = 0x8; /* 4KB */
>       u->geometry_desc.max_in_buffer_size = 0x8;
>       u->geometry_desc.max_out_buffer_size = 0x8;


Thank you for the commit!

Reviewed-by: Jeuk Kim <jeuk20.kim@samsung.com>



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

end of thread, other threads:[~2025-04-03 11:04 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <CGME20250403092140epcms2p355a7f039871b3e5b409754ef450b9158@epcms2p3>
2025-04-03  9:21 ` [PATCH] hw/ufs: Fix incorrect comment for segment_size and allocation_unit_size Keoseong Park
2025-04-03 11:03   ` Jeuk Kim

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).