Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp550812pxj; Thu, 3 Jun 2021 13:15:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxmPSBfrS8lcIUi+rSgbj1kw/PZkfP7r+ZbBDXoF+rx42b1voLRneoeqpLBQV6yZ3st/pm0 X-Received: by 2002:a05:6402:487:: with SMTP id k7mr1097210edv.315.1622751336889; Thu, 03 Jun 2021 13:15:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622751336; cv=none; d=google.com; s=arc-20160816; b=fI5/gOrCWD4hXmUbGZZYGPBWektKai9zCGfYZQzRPBvbp6hYa16O89igfFUR9Hbtvt UAP4wYkBJrwYKViSL8b52pAPHeXU5/ZUufoI6Y8FqYJqypNmig2l1AA1VCPIEi8f3mnQ V8wOkV01JtssQRQNjicalTniadWHhk0YUJTh+9JBLHb6fDbcwTAVlCJOObw5TV9s/fnE Redrpoyk/ROGPtdRpYXBSHJkfU60uv5WjjQfjYBoj7t510fsn3I2WHt/k1EC9Sx3zSH5 HyGLDmNA9VeQ8XzrNX/TmgaKdCpfPSvs2idOVKIDJgHQKCJUQSBwfDlEBLNJk/Rwat2I 6rsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=szgPeL3ERm4PNP/mSl1tO41AkC982Wgrr8TI/ZTijv0=; b=rf4lwC03qItUli0JEHvvseyWjfh3CGVtP5wPC3UdoLUc/iHGKrDQxJP4/X7O52ZQTI f7bHb6IP7f4/xk7s/Gp7Q6l43U3dOEumOYBZuGHMUU+MADlvEQpeXvuv1O9MA4wSpkJW Wf4wbZ6hz39SuFwKiygbMUFPvmg1VAgyBizqhRBhd847BCum65PV6F3bj8IPWuue07Jn /2en3EGSg+xUxL6yJj1AjibHZ9JGmKhGAnTd0GdVkih/Z6UmbXEtMDprBY1BMt/TuNkQ gOiRKai9Nd4mAEopfbSCKgnkFyXgJEXolKhDd7/8Iws6u7bzQkca2ZvNg1ohK4XJw599 uFDw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f18si2806832ejk.304.2021.06.03.13.15.13; Thu, 03 Jun 2021 13:15:36 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230109AbhFCUOZ (ORCPT + 99 others); Thu, 3 Jun 2021 16:14:25 -0400 Received: from mail-pj1-f44.google.com ([209.85.216.44]:46978 "EHLO mail-pj1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbhFCUOY (ORCPT ); Thu, 3 Jun 2021 16:14:24 -0400 Received: by mail-pj1-f44.google.com with SMTP id pi6-20020a17090b1e46b029015cec51d7cdso4536165pjb.5; Thu, 03 Jun 2021 13:12:29 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=szgPeL3ERm4PNP/mSl1tO41AkC982Wgrr8TI/ZTijv0=; b=KFCXliSGqXOiakGfRsRJqDe1SgrwjcJFCrutRxPsANzCPjkdnzEWgQH3gpwmYpeHGz JhakKdjdDnJ6zC1H9BPfVRNO7LOAVZi5Y/G1vh4e1w8U8QKBcOnaV1OmlZylFbhl1/Rv o/G3Rg/+4g3VmgjDexETBAoLa4/4r/GPApoDMN8WtiOPukSjr8TftqnhYDEKv7ogr8PV zhEulGoSjsArFAzsRBs0JyF99enLYP1v0xDDVqxZ6/N0Kgp4BYfRkb0OpfRYckDB2tqP Cz1jTLAo8oxEPMIo/HikTRW7GkYZVNfesDuvq3iOBKf7il99Y2eES8dtFAM0zqQhwgmJ ulOw== X-Gm-Message-State: AOAM531I5vWvZNJxciRQOdmEsCHiT4zpoAhXsrM/gQQqV5AkfdWX77W/ Rv3kjPdbAWUjCOCKXdbtw/Q= X-Received: by 2002:a17:902:8307:b029:103:c733:e5e0 with SMTP id bd7-20020a1709028307b0290103c733e5e0mr815054plb.8.1622751149192; Thu, 03 Jun 2021 13:12:29 -0700 (PDT) Received: from [192.168.3.217] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id y27sm1204800pff.202.2021.06.03.13.12.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 03 Jun 2021 13:12:28 -0700 (PDT) Subject: Re: [PATCH v35 3/4] scsi: ufs: Prepare HPB read for cached sub-region To: daejun7.park@samsung.com, Greg KH , "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "asutoshd@codeaurora.org" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "huobean@gmail.com" , ALIM AKHTAR Cc: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , JinHwan Park , Javier Gonzalez , Sung-Jun Park , Jinyoung CHOI , Dukhyun Kwon , Keoseong Park , Jaemyung Lee , Jieon Seol References: <20210524084345epcms2p63dde85f3fdc127c29d25ada7d7f539cb@epcms2p6> <20210524084546epcms2p2c91dc1df482fd593307892825532c6dd@epcms2p2> From: Bart Van Assche Message-ID: <12392bef-e018-8260-5279-16b7b43f5a8f@acm.org> Date: Thu, 3 Jun 2021 13:12:26 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: <20210524084546epcms2p2c91dc1df482fd593307892825532c6dd@epcms2p2> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/24/21 1:45 AM, Daejun Park wrote: > +static void > +ufshpb_set_hpb_read_to_upiu(struct ufshpb_lu *hpb, struct ufshcd_lrb *lrbp, > + u32 lpn, u64 ppn, u8 transfer_len) > +{ > + unsigned char *cdb = lrbp->cmd->cmnd; > + > + cdb[0] = UFSHPB_READ; > + > + /* ppn value is stored as big-endian in the host memory */ I think that that comment means that the type of the 'ppn' argument should be changed from 'u64' into __be64. > + memcpy(&cdb[6], &ppn, sizeof(__be64)); > + cdb[14] = transfer_len; > + > + lrbp->cmd->cmd_len = UFS_CDB_SIZE; > +} > + > +/* > + * This function will set up HPB read command using host-side L2P map data. > + * In HPB v1.0, maximum size of HPB read command is 4KB. > + */ > +void ufshpb_prep(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) > +{ [ ... ] > + > + ufshpb_set_hpb_read_to_upiu(hpb, lrbp, lpn, ppn, transfer_len); 'transfer_len' has type int and is truncated to type 'u8' when passed as an argument to ufshpb_set_hpb_read_to_upiu(). Please handle transfer_len values >= 256 properly. Thanks, Bart.