From c5ee8588bf9a36075723e5aacceefa93fd2de8c9 Mon Sep 17 00:00:00 2001 From: Wing Li Date: Thu, 23 Dec 2021 11:32:08 -0800 Subject: [PATCH] fix(ufs): delete call to inv_dcache_range for utrd The utrd struct is allocated on the stack by ufs_check_resp's caller. Invalidating the utrd struct is unnecessary since it's only read from, and can cause other values stored on the stack (e.g. link register) to be inadvertently invalidated. Change-Id: Icd455b52beb2677fafc083d68d0bfa0645b7194b Signed-off-by: Wing Li --- drivers/ufs/ufs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/ufs/ufs.c b/drivers/ufs/ufs.c index ae42e326f..edac46ab1 100644 --- a/drivers/ufs/ufs.c +++ b/drivers/ufs/ufs.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2017, ARM Limited and Contributors. All rights reserved. + * Copyright (c) 2017-2021, ARM Limited and Contributors. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause */ @@ -474,7 +474,6 @@ static int ufs_check_resp(utp_utrd_t *utrd, int trans_type) hd = (utrd_header_t *)utrd->header; resp = (resp_upiu_t *)utrd->resp_upiu; inv_dcache_range((uintptr_t)hd, UFS_DESC_SIZE); - inv_dcache_range((uintptr_t)utrd, sizeof(utp_utrd_t)); do { data = mmio_read_32(ufs_params.reg_base + IS); if ((data & ~(UFS_INT_UCCS | UFS_INT_UTRCS)) != 0)