Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1007395pxa; Wed, 12 Aug 2020 20:22:14 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw5xzH632rxRlWOomHoMFlAcmbfHhanoH0mjnsaHGNqZby9wcC60WRk1xoaFnIF7kkddCE/ X-Received: by 2002:a17:906:37d1:: with SMTP id o17mr2955593ejc.98.1597288934103; Wed, 12 Aug 2020 20:22:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597288934; cv=none; d=google.com; s=arc-20160816; b=jm3Ajhoo0PcaSiVp5SgWD/FR8h4/T7TzxEd2r3HxoiGSCAcrfSx9B8fMLmJs/rn7f+ KetkK3U/sXVq1763IvEFGBaWKzKTRPbFB9Mnyb0KYjexEtCLPYq4tI4SSU5pAdFZhS2I zBJwpgPXKqYzba8+NTmYcfw7VRHxOXcg5w9J6nLonHeGeDpDTFQu7zOr3uJepogIF/df ltL3wjJZkSkll06y2W0w8T5PmHtB63AL7Ykmt6+bACr5zKJdkRSeamo6jw0wH0EaZh6U XPoVvqjl8I6OeC95w6VnshU1DmMbmVmNugUVs5Pk15osonrBNP+4PGbi6RS34HshYqc8 j8QQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:content-transfer-encoding:date :message-id:in-reply-to:cc:to:from:reply-to:subject:mime-version :dkim-signature:dkim-filter; bh=HLhlMCrzJldkYU0pohTAFN2CsR5VsqyD7Nzjck6qsfs=; b=QSW0lNteH2s9D5mGN+Ja/U8dbLBgPszHFJ7HGexiTgHLAeP4DEfvyJ6wzvSoUzPnAH QSLXjCgCWtLdbwBQqKdpZwILCS6PWxncUL6oqzVWd82Ic3kHNYZP9GJPljU7SM1wjmpF USU+g+IJbhLElSV+l/82qMF4f4TvROUy/uN3VQZz6G8+Be+KKXJ1KdVi96IGKi7n+Yek oKtt+Aa4dpqYmD8lM+HLUPllnaft3PwXZT90meWeJufwNGYlJbG2zelErwzECJuCvO5f WaGL9/5wupFtuoB5zOoXKUp3KhdZOEktmNDvhLsedsYQTpLOTMH+RlUvQ/s2ZY5ZgX2M sgOQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=N1re7Zin; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si2964528ede.331.2020.08.12.20.21.51; Wed, 12 Aug 2020 20:22:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=N1re7Zin; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726699AbgHMDSM (ORCPT + 99 others); Wed, 12 Aug 2020 23:18:12 -0400 Received: from mailout4.samsung.com ([203.254.224.34]:51699 "EHLO mailout4.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726667AbgHMDSM (ORCPT ); Wed, 12 Aug 2020 23:18:12 -0400 Received: from epcas1p2.samsung.com (unknown [182.195.41.46]) by mailout4.samsung.com (KnoxPortal) with ESMTP id 20200813031803epoutp045a847351f3216f578737e20ae645210f~qtZhiJZ260563405634epoutp04c for ; Thu, 13 Aug 2020 03:18:03 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout4.samsung.com 20200813031803epoutp045a847351f3216f578737e20ae645210f~qtZhiJZ260563405634epoutp04c DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597288683; bh=HLhlMCrzJldkYU0pohTAFN2CsR5VsqyD7Nzjck6qsfs=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=N1re7ZinjFx7TNcq5w/zX2dUiw0FVncK65LwtCf+huXtzaY9QSyafEgJhRTg+j/hA PbvQR2KNke1r6ZBOlPzAypCeFs2YRqR69NKXmKFW/zlWMYwmTMIOBXW8Y5be0S2RHr F7y284za+YdZwLeb4eWKf7Va3HLjUwbIsioVQvdA= Received: from epcpadp2 (unknown [182.195.40.12]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20200813031803epcas1p38673e33d4c6fdc05398577e525a77161~qtZhKun-71816918169epcas1p3j; Thu, 13 Aug 2020 03:18:03 +0000 (GMT) Mime-Version: 1.0 Subject: Re: [PATCH v8 3/4] scsi: ufs: L2P map management for HPB read Reply-To: daejun7.park@samsung.com From: Daejun Park To: Bart Van Assche , Daejun Park , "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "asutoshd@codeaurora.org" , "beanhuo@micron.com" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "tomas.winkler@intel.com" , ALIM AKHTAR CC: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Sang-yoon Oh , Sung-Jun Park , yongmyung lee , Jinyoung CHOI , Adel Choi , BoRam Shin X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <86a04d4f-bb6f-9bc8-cb64-a50b0ed2fdb7@acm.org> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <336371513.41597288683542.JavaMail.epsvc@epcpadp2> Date: Thu, 13 Aug 2020 12:13:43 +0900 X-CMS-MailID: 20200813031343epcms2p2dfe9192d11110a80454c6daac69ecdc7 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y X-Hop-Count: 3 X-CMS-RootMailID: 20200806073257epcms2p61564ed62e02fc42fc3c2b18fa92a038d References: <86a04d4f-bb6f-9bc8-cb64-a50b0ed2fdb7@acm.org> <231786897.01596705302142.JavaMail.epsvc@epcpadp1> <231786897.01596705001840.JavaMail.epsvc@epcpadp1> <231786897.01596704281715.JavaMail.epsvc@epcpadp2> <336371513.41596705485601.JavaMail.epsvc@epcpadp2> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-08-06 02:15, Daejun Park wrote: > > + req->end_io_data = (void *)map_req; > > Please leave the (void *) cast out since explicit casts from a non-void > to a void pointer are not necessary in C. OK, I will fix it. > > +static inline struct > > +ufshpb_rsp_field *ufshpb_get_hpb_rsp(struct ufshcd_lrb *lrbp) > > +{ > > + return (struct ufshpb_rsp_field *)&lrbp->ucd_rsp_ptr->sr.sense_data_len; > > +} > > Please introduce a union in struct utp_cmd_rsp instead of using casts > to reinterpret a part of a data structure. OK. I will introduce a union in struct utp_cmd_rsp and use it. > > +/* routine : isr (ufs) */ > > The above comment looks very cryptic. Should it perhaps be expanded? > > > +struct ufshpb_active_field { > > + __be16 active_rgn; > > + __be16 active_srgn; > > +} __packed; > > Since "__packed" is not necessary for the above data structure, please > remove it. Note: a typical approach in the Linux kernel to verify that > the compiler has not inserted any padding bytes is to add a BUILD_BUG_ON() > statement in an initialization function that verifies the size of ABI data > structures. See also the output of the following command: > > git grep -nH 'BUILD_BUG_ON.sizeof.*!=' OK, I didn't know about it. Thanks. > > +struct ufshpb_rsp_field { > > + __be16 sense_data_len; > > + u8 desc_type; > > + u8 additional_len; > > + u8 hpb_type; > > + u8 reserved; > > + u8 active_rgn_cnt; > > + u8 inactive_rgn_cnt; > > + struct ufshpb_active_field hpb_active_field[2]; > > + __be16 hpb_inactive_field[2]; > > +} __packed; > > I think the above __packed statement should also be left out. OK, I will remove it. Thanks, Daejun