[PATCH] hw/ufs: Fix incorrect register fields

Jeuk Kim posted 1 patch 7 months, 1 week ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/99bfcf6de904357e6b07084b99193bb16309d46a.1696914208.git.jeuk20.kim@gmail.com
Maintainers: Jeuk Kim <jeuk20.kim@samsung.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>
include/block/ufs.h | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
[PATCH] hw/ufs: Fix incorrect register fields
Posted by Jeuk Kim 7 months, 1 week ago
From: Jeuk Kim <jeuk20.kim@samsung.com>

This patch fixes invalid ufs register fields.
This fixes an issue reported by Bin Meng that
caused ufs to fail over riscv.

Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com>
---
 include/block/ufs.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/block/ufs.h b/include/block/ufs.h
index fd884eb8ce..7631a5af10 100644
--- a/include/block/ufs.h
+++ b/include/block/ufs.h
@@ -111,14 +111,14 @@ REG32(UECT, offsetof(UfsReg, uect))
 REG32(UECDME, offsetof(UfsReg, uecdme))
 REG32(UTRIACR, offsetof(UfsReg, utriacr))
 REG32(UTRLBA, offsetof(UfsReg, utrlba))
-    FIELD(UTRLBA, UTRLBA, 9, 22)
+    FIELD(UTRLBA, UTRLBA, 10, 22)
 REG32(UTRLBAU, offsetof(UfsReg, utrlbau))
 REG32(UTRLDBR, offsetof(UfsReg, utrldbr))
 REG32(UTRLCLR, offsetof(UfsReg, utrlclr))
 REG32(UTRLRSR, offsetof(UfsReg, utrlrsr))
 REG32(UTRLCNR, offsetof(UfsReg, utrlcnr))
 REG32(UTMRLBA, offsetof(UfsReg, utmrlba))
-    FIELD(UTMRLBA, UTMRLBA, 9, 22)
+    FIELD(UTMRLBA, UTMRLBA, 10, 22)
 REG32(UTMRLBAU, offsetof(UfsReg, utmrlbau))
 REG32(UTMRLDBR, offsetof(UfsReg, utmrldbr))
 REG32(UTMRLCLR, offsetof(UfsReg, utmrlclr))
-- 
2.34.1
Re: [PATCH] hw/ufs: Fix incorrect register fields
Posted by Stefan Hajnoczi 7 months, 1 week ago
On Tue, Oct 10, 2023 at 02:11:13PM +0900, Jeuk Kim wrote:
> From: Jeuk Kim <jeuk20.kim@samsung.com>
> 
> This patch fixes invalid ufs register fields.
> This fixes an issue reported by Bin Meng that
> caused ufs to fail over riscv.
> 
> Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com>
> ---
>  include/block/ufs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)

Hi,
Please feel free to send a pull request with your unreviewed Coverity fixes and
this reviewed fix.

Enough time has passed for the community to review the Coverity fixes
and since no one did, you can submit them.

I am confident in your work and will not review future UFS patches due
to time constraints.

Thanks,
Stefan

> 
> diff --git a/include/block/ufs.h b/include/block/ufs.h
> index fd884eb8ce..7631a5af10 100644
> --- a/include/block/ufs.h
> +++ b/include/block/ufs.h
> @@ -111,14 +111,14 @@ REG32(UECT, offsetof(UfsReg, uect))
>  REG32(UECDME, offsetof(UfsReg, uecdme))
>  REG32(UTRIACR, offsetof(UfsReg, utriacr))
>  REG32(UTRLBA, offsetof(UfsReg, utrlba))
> -    FIELD(UTRLBA, UTRLBA, 9, 22)
> +    FIELD(UTRLBA, UTRLBA, 10, 22)
>  REG32(UTRLBAU, offsetof(UfsReg, utrlbau))
>  REG32(UTRLDBR, offsetof(UfsReg, utrldbr))
>  REG32(UTRLCLR, offsetof(UfsReg, utrlclr))
>  REG32(UTRLRSR, offsetof(UfsReg, utrlrsr))
>  REG32(UTRLCNR, offsetof(UfsReg, utrlcnr))
>  REG32(UTMRLBA, offsetof(UfsReg, utmrlba))
> -    FIELD(UTMRLBA, UTMRLBA, 9, 22)
> +    FIELD(UTMRLBA, UTMRLBA, 10, 22)
>  REG32(UTMRLBAU, offsetof(UfsReg, utmrlbau))
>  REG32(UTMRLDBR, offsetof(UfsReg, utmrldbr))
>  REG32(UTMRLCLR, offsetof(UfsReg, utmrlclr))
> -- 
> 2.34.1
> 
Re: [PATCH] hw/ufs: Fix incorrect register fields
Posted by Bin Meng 7 months, 1 week ago
On Tue, Oct 10, 2023 at 1:11 PM Jeuk Kim <jeuk20.kim@gmail.com> wrote:
>
> From: Jeuk Kim <jeuk20.kim@samsung.com>
>
> This patch fixes invalid ufs register fields.
> This fixes an issue reported by Bin Meng that
> caused ufs to fail over riscv.
>

Fixes: bc4e68d362ec ("hw/ufs: Initial commit for emulated
Universal-Flash-Storage")
Reported-by: Bin Meng <bmeng@tinylab.org>

> Signed-off-by: Jeuk Kim <jeuk20.kim@samsung.com>
> ---
>  include/block/ufs.h | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>

Reviewed-by: Bin Meng <bmeng@tinylab.org>
Tested-by: Bin Meng <bmeng@tinylab.org>