Received: by 2002:a25:683:0:0:0:0:0 with SMTP id 125csp115252ybg; Mon, 8 Jun 2020 18:02:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyZvreKoiwLTgs7wLN6CX0IjKkYQIfqSINnFbZbgX9u9xSEQVcpvwaFkiodkhWGSXyq0vkT X-Received: by 2002:a17:906:8699:: with SMTP id g25mr24355590ejx.217.1591664545396; Mon, 08 Jun 2020 18:02:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1591664545; cv=none; d=google.com; s=arc-20160816; b=KdEal/sOA/gnPvPOTMBIvvzbKmep3VMChzoxvXrUTYgmXPa2d5dvSxPGEwNvgs32Lz Y6BNOHZU8T0JImcpkY3ulyMGDjKQSEIkTq0PbtWfNjfsBujtomNIGOWq/hVvcKTP5WD0 lu6cfpcTNaXrAQfvX8ZjiO+az4hKrCkylLMLxDrxA3Y3h2sou6hsk4TykRa5t6lSik/A HYmXQneEwTv9bke8+uYPJG5AIT2zWm5MmTuXNEJ6DUMMMmYv4x58gMrT4WUV4XP1V0Hq aWbZTwz9TaAFCeu73GYU2XpEw2WOBCPta4k0SRitZ+sjt0jxNpU3ViPYOgQTVlf9dwHI I8wQ== 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=xQIM7MZu5rkVLLuLjtH34XJl9WWZWOuTSNhekNgHTIs=; b=zHsqg7OkgHHEAm4PxycSOkZNptqtOw+ipWeXfphAenaZgDc7sWwjhIXzwoao8SinGN OYLL0Ov7vnWDF8zm1Apw2kKdUPRhrjHD+E4tqGh4+CibTEVX8apx+4m3/nbT7y3z0eEQ PCbGCAtxqYf6W26j4h33OJ02EaQA788pU96zBbzHSYp4mFGVnJTVTttkkZ3azT7bnWhN N07/3C1oy2Xsv2qDCNCARByEW//+xmDC9idNhOn/7fgAptOT48yERkQykIjcXa6SlhLM n3h7dLZJdGY+XbwKzerZo/gzcIUh4tpxZksM7JmsXgEye2osXqBFyQmBeuImYlGlRRTo vUWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=W1kn2UwW; 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 g32si10627886edd.124.2020.06.08.18.02.02; Mon, 08 Jun 2020 18:02:25 -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=W1kn2UwW; 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 S1729965AbgFIA6T (ORCPT + 99 others); Mon, 8 Jun 2020 20:58:19 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:27085 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728820AbgFIA6J (ORCPT ); Mon, 8 Jun 2020 20:58:09 -0400 Received: from epcas1p4.samsung.com (unknown [182.195.41.48]) by mailout2.samsung.com (KnoxPortal) with ESMTP id 20200609005804epoutp02a0a9223caa72e1d24f8add80e1f0ae28~WujvGT-7E0374203742epoutp02E for ; Tue, 9 Jun 2020 00:58:04 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.samsung.com 20200609005804epoutp02a0a9223caa72e1d24f8add80e1f0ae28~WujvGT-7E0374203742epoutp02E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1591664284; bh=xQIM7MZu5rkVLLuLjtH34XJl9WWZWOuTSNhekNgHTIs=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=W1kn2UwWvaMdtAt/NaV8GBzKD+oFvbXxquXQswrjk/uPv5VjuoprSYuRpIuJQuEK4 8LLkwHPDJxk5As5rZy0IBr811Ep0aJnc7YT6GNmVs2iihT5Kyhc5fzlTTGp2YbhkY5 MjZRkGybZxvh7pWWoZ6gxbhiHT3GMUYRGECraBXU= Received: from epcpadp2 (unknown [182.195.40.12]) by epcas1p3.samsung.com (KnoxPortal) with ESMTP id 20200609005803epcas1p3732150bf2f70194f0f2b77ba8be08e68~WujufXFER1119911199epcas1p3f; Tue, 9 Jun 2020 00:58:03 +0000 (GMT) Mime-Version: 1.0 Subject: RE: [RFC PATCH 5/5] scsi: ufs: Prepare HPB read for cached sub-region Reply-To: daejun7.park@samsung.com From: Daejun Park To: Avri Altman , Daejun Park , ALIM AKHTAR , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , "asutoshd@codeaurora.org" , "beanhuo@micron.com" , "stanley.chu@mediatek.com" , "cang@codeaurora.org" , "bvanassche@acm.org" , "tomas.winkler@intel.com" 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: 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: <1402433372.121591664283543.JavaMail.epsvc@epcpadp2> Date: Tue, 09 Jun 2020 09:53:23 +0900 X-CMS-MailID: 20200609005323epcms2p2e91ce8525a6a5ca7b9f71cbaab2d25a2 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: 20200605011604epcms2p8bec8ef6682583d7248dc7d9dc1bfc882 References: <963815509.21591323002276.JavaMail.epsvc@epcpadp1> <231786897.01591322101492.JavaMail.epsvc@epcpadp1> <336371513.41591320902369.JavaMail.epsvc@epcpadp1> <963815509.21591320301642.JavaMail.epsvc@epcpadp1> <231786897.01591320001492.JavaMail.epsvc@epcpadp1> <336371513.41591323603173.JavaMail.epsvc@epcpadp1> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > > +static bool ufshpb_test_ppn_dirty(struct ufshpb_lu *hpb, int rgn_idx, > > + int srgn_idx, int srgn_offset, int cnt) > > + > > + for (i = 0; i < bit_len; i++) { > > + if (test_bit(srgn_offset + i, srgn->mctx->ppn_dirty)) > Maybe use a mask or hweight instead of testing bit by bit? There is no problem in this HPB vesion because it only supports 4KB sized read IO. However, this code is not as efficient as you pointed out. So I will change this in HPB version 2.0. > > +static void > > +ufshpb_set_hpb_read_to_upiu(struct ufshpb_lu *hpb, struct ufshcd_lrb > > *lrbp, > > + u32 lpn, u64 ppn, unsigned int transfer_len) > > +{ > > + unsigned char *cdb = lrbp->ucd_req_ptr->sc.cdb; > > + > > + cdb[0] = UFSHPB_READ; > > + > > + put_unaligned_be32(lpn, &cdb[2]); > Is this needed? The lba is already occupying bytes 2..5 The needless code will be deleted on next patch. Thanks, Daejun