Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 555E2CCD192 for ; Tue, 14 Oct 2025 15:44:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=0Tox6MpU56E4xIhuSJ4vcLZJh0J1bS1miy44nAOIuEQ=; b=SavL0CjQxkBZFrMlipvmvHu1gf HNOr0Y0bRrYy3ivVRM0eNCfUrRziOHqY/R8b8FGZEz/Sfzhlo5dq8bREOoT+Bl2NXvEDuRe1E1y1V 9OFXkVp9XNDGhf/ESRUvhqJcACU0+GGxPwFyOaYnikjv13nBzOkB6fLm0fzeOT9chIJ8j60vRtcxv SnJHT4USAOGk1Chr0pXlrKtdTWW0n7dKpexmr8ySmwfYOE6XNMIT1fjFlu3kjWlp4aHjamf6q1rbB HU2Ng31y97Ocm0Ug/O0FCcXcdikfboO35eVVpySlEGHj81YfsGXl6KAtH+Um2V90+vjTwcQSaiDmd AT8Fk+Bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8hCT-0000000GtVc-4BmT; Tue, 14 Oct 2025 15:44:34 +0000 Received: from 003.mia.mailroute.net ([199.89.3.6]) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1v8hCR-0000000GtUk-3L1Q for linux-mediatek@lists.infradead.org; Tue, 14 Oct 2025 15:44:33 +0000 Received: from localhost (localhost [127.0.0.1]) by 003.mia.mailroute.net (Postfix) with ESMTP id 4cmJRy4x4vzlgqVQ; Tue, 14 Oct 2025 15:44:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=acm.org; h= content-transfer-encoding:content-type:content-type:in-reply-to :from:from:content-language:references:subject:subject :user-agent:mime-version:date:date:message-id:received:received; s=mr01; t=1760456668; x=1763048669; bh=0Tox6MpU56E4xIhuSJ4vcLZJ h0J1bS1miy44nAOIuEQ=; b=MwaFPdITk9vqDQOYnTmj+I0E2Sb5xHNRN6BTGvo6 Xs3k4d4StyuHD4z6VXCgVS/LRVpEPBXPoe/M/YnaKTEmEk3qCL1p9aV+eLGazYqx Kf3V5pWT1afEM3O4yRYpBQR+4jYEPQ6LiLrqEN5s0KHE0seHkIsbfebEbVmLM5la oCXzNkbZA/2XwPg0ENus5oEXVBYYyfiC8J1Jsu4lj2A1iP6fthe+03fiyzZnp8bO UjAKtvmj8VoDc/eSfbNs4z33tBUra9n9nGyxEJPoZIJ8ImCaUyba1BYwCjxf4i94 jvHJymVbiEsDxERwjG064HdcED7romvvcVi1+TU4ihkVKQ== X-Virus-Scanned: by MailRoute Received: from 003.mia.mailroute.net ([127.0.0.1]) by localhost (003.mia [127.0.0.1]) (mroute_mailscanner, port 10029) with LMTP id 760Exn8CY8uq; Tue, 14 Oct 2025 15:44:28 +0000 (UTC) Received: from [100.119.48.131] (unknown [104.135.180.219]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: bvanassche@acm.org) by 003.mia.mailroute.net (Postfix) with ESMTPSA id 4cmJRh1Gz7zlgqyn; Tue, 14 Oct 2025 15:44:15 +0000 (UTC) Message-ID: Date: Tue, 14 Oct 2025 08:44:14 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 1/2] ufs: core: update CQ Entry to UFS 4.1 format To: peter.wang@mediatek.com, linux-scsi@vger.kernel.org, martin.petersen@oracle.com Cc: wsd_upstream@mediatek.com, linux-mediatek@lists.infradead.org, chun-hung.wu@mediatek.com, alice.chao@mediatek.com, cc.chou@mediatek.com, chaotian.jing@mediatek.com, jiajie.hao@mediatek.com, qilin.tan@mediatek.com, lin.gui@mediatek.com, tun-yu.yu@mediatek.com, eddie.huang@mediatek.com, naomi.chu@mediatek.com, ed.tsai@mediatek.com References: <20251014131758.270324-1-peter.wang@mediatek.com> <20251014131758.270324-2-peter.wang@mediatek.com> Content-Language: en-US From: Bart Van Assche In-Reply-To: <20251014131758.270324-2-peter.wang@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20251014_084431_940309_35EA5E6A X-CRM114-Status: UNSURE ( 9.77 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-mediatek@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "Linux-mediatek" Errors-To: linux-mediatek-bounces+linux-mediatek=archiver.kernel.org@lists.infradead.org On 10/14/25 6:15 AM, peter.wang@mediatek.com wrote: > diff --git a/include/ufs/ufshci.h b/include/ufs/ufshci.h > index 612500a7088f..8b14f6e5e6f5 100644 > --- a/include/ufs/ufshci.h > +++ b/include/ufs/ufshci.h > @@ -567,10 +567,19 @@ struct cq_entry { > __le16 prd_table_offset; > > /* DW 4 */ > - __le32 status; > - > - /* DW 5-7 */ > - __le32 reserved[3]; > + u8 overall_status; > + u8 extended_error_code; > + __le16 reserved_1; > + > + /* DW 5 */ > + u8 task_tag; > + u8 lun; > + u8 iid:4; > + u8 ext_iid:4; > + u8 reserved_2; > + > + /* DW 6-7 */ > + __le32 reserved_3[2]; > }; The above definition is only correct for little endian CPUs. If you really want to use bitfields, please take a look at struct request_desc_header for making bitfield definitions work for both little and big endian CPUs. Bart.