Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp954721pxb; Wed, 3 Mar 2021 22:23:32 -0800 (PST) X-Google-Smtp-Source: ABdhPJxKZI13wDnZUxwrEU5galYcCX3Chx7/czXPA6m/fQhDzRbdUMDzmR8XZ2POoTrVJk4ttBpp X-Received: by 2002:a17:906:5607:: with SMTP id f7mr2500299ejq.262.1614839012539; Wed, 03 Mar 2021 22:23:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614839012; cv=none; d=google.com; s=arc-20160816; b=jO75eY8tMdf5qbhWJs13Jwqq1YFenwjwJq0RCcOt/EQ3CUwRiKaMEWM7kG1Bzd4Iqo 2lNNfLnQ2++ZX6YDGhSKbk92rmK6LKjUODK3Y2sjOF2MfQmyIuDCqYSyihppZGg9jZZ2 KEUGo7nkEb6CmG8uVkDbyud4+5OXNUa1cKIpY2uXRG66Yx1gtc1brTIQhNBpxs2CD/jO t9j84yh5uE/5JYk8gt02OhhE2wceDCRE059cHTFD0qrYK4UVzC7Mgy6L4VTiN5qs1u+T 3tgkB0LiWHvy585lOFKsB3GYSPXLpBElKFffR/CDNj1ESNTPHrsaq0ojCd4MLzZSu4py rJ5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=QLU9bSmbJly6ESDXXMGZpe5ejk+FdLMiYAyttQ2v9vQ=; b=zFuQaVYEzEe6boYZiL70U4NYu9YV9RBN4FJtJpGstnv6SZAnfU/vNolrybL2GRfiX6 IWhVYcPOsWSDfcWiFYQPdrGGlzkFH8QUGN3VE6dsHue/IMrijsDvbd9HsGrlNcuw1YMA bqBUQtlyc5TKYGIY0aLnY49pPQ0h2UBai7LoXu30zFOdY1d3tvCx8fg+KnrY5lVRPQj4 p9x4dQBzP/X8i+RJDHkDvt448NEseZnsggYU6spoi61vONn6frpMf6PcS1oQHVU6c52v /PD0f7QzVISY4V3DE0b0LDba3RjquDLkOsAzoA7d5XbYRwhFfH22JYyERnsUcJWOQq5w 1d0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Jd7+gtNV; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cx12si16388524edb.460.2021.03.03.22.23.09; Wed, 03 Mar 2021 22:23:32 -0800 (PST) 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=@gmail.com header.s=20161025 header.b=Jd7+gtNV; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1448598AbhCBPGJ (ORCPT + 99 others); Tue, 2 Mar 2021 10:06:09 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44722 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350810AbhCBMue (ORCPT ); Tue, 2 Mar 2021 07:50:34 -0500 Received: from mail-ed1-x52e.google.com (mail-ed1-x52e.google.com [IPv6:2a00:1450:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 09DADC06178C; Tue, 2 Mar 2021 04:49:51 -0800 (PST) Received: by mail-ed1-x52e.google.com with SMTP id w21so25019018edc.7; Tue, 02 Mar 2021 04:49:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=QLU9bSmbJly6ESDXXMGZpe5ejk+FdLMiYAyttQ2v9vQ=; b=Jd7+gtNV675ZKYR0E2HjtgZkxCvAyvArpx74jdtbV/8lpnr8URroZayAKCS03MuZZx r1W3whOsl7kTqWCoYmTx8EBQNTBH2KzbAWsDRgXUmVUz8TnDOj547U4rspsWzZCNgoq/ WMmNcAti1t/fbE717yG1RXxRt8CufkD9L7zwV/B7mXyn2TF2SwnhoN67FeyaTP8iTR1q CnVNlkUJtI0hfcX8/NSl7gw74evK4Wm2sPpSCR9bpwR0zRJ9sLK6sjgvnYxD8oXuYVCw b1Hp1aN7Q1Rdp/IqgJUhOylvKysl8kzVtFBLOAvM1yBO8qmKotPb7BsSDrj9dfdAAJVu 6pOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=QLU9bSmbJly6ESDXXMGZpe5ejk+FdLMiYAyttQ2v9vQ=; b=lTlft1eiNSuAlOz2obRG+/wzyakpZy6J6nrr8ot4CkRJomJqsvuNf/mXn6Zu4DXK16 jBvxQSdHx5i0KRnkbPtGzHI68cSCWDFgDq7H4lfeMrFXYWPwP+TW8u5LEajBTKMfp1Ki RRFqOIRxlXmwWKoGjCGdnQYC65Xw0Ywf0ZBeg2maEXCgnGK6MMnxF3vcdaO2zG2HrZD9 tpxjisel1npJ8amxX1htF+Z/S8OMpgyWGJeYfe1/4sFungbIqFJZ97J4cW7G8gg5UYK9 c9n+SH52bwjyuRpIZbHh9y3yIBhYZimk3wfo0MG3DW/DZbVSjseNXR8/FreVtJAGi9kI bEUg== X-Gm-Message-State: AOAM532hFup/ZN/2PWNLd6ZjV3lfRjQGlYbNEHlo+XhX4qp/1n4V7IWa UV6P8TIsKXyW+MgtB49L147j14gRN0R+hA== X-Received: by 2002:a05:6402:4d3:: with SMTP id n19mr20449431edw.2.1614689389814; Tue, 02 Mar 2021 04:49:49 -0800 (PST) Received: from ubuntu-laptop (ip5f5bec5d.dynamic.kabel-deutschland.de. [95.91.236.93]) by smtp.googlemail.com with ESMTPSA id a12sm5543437edx.91.2021.03.02.04.49.47 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 02 Mar 2021 04:49:49 -0800 (PST) Message-ID: Subject: Re: [PATCH v25 4/4] scsi: ufs: Add HPB 2.0 support From: Bean Huo 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" , "bvanassche@acm.org" , ALIM AKHTAR , Javier Gonzalez Cc: "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , JinHwan Park , SEUNGUK SHIN , Sung-Jun Park , yongmyung lee , Jinyoung CHOI , BoRam Shin Date: Tue, 02 Mar 2021 13:49:47 +0100 In-Reply-To: <20210226073525epcms2p5e7ddd6e92b2f76b2b3dcded49f8ff256@epcms2p5> References: <20210226073233epcms2p80fca2dffabea03143a9414838f757633@epcms2p8> <20210226073525epcms2p5e7ddd6e92b2f76b2b3dcded49f8ff256@epcms2p5> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2021-02-26 at 16:35 +0900, Daejun Park wrote: > +static void ufshpb_set_unmap_cmd(unsigned char *cdb, struct > ufshpb_region *rgn) > +{ > + cdb[0] = UFSHPB_WRITE_BUFFER; > + cdb[1] = rgn ? UFSHPB_WRITE_BUFFER_INACT_SINGLE_ID : > + UFSHPB_WRITE_BUFFER_INACT_ALL_ID; Here is wrong, Valid HPB Region is (0 ~ (Ceiling( Region size calculated by bHPBRegionSize )- 1) ). how do you know the region==0 is not a single normal region? Bean > + if (rgn) > + put_unaligned_be16(rgn->rgn_idx, &cdb[2]); > + cdb[9] = 0x00; > +}