From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,FSL_HELO_FAKE,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1215EC433DF for ; Wed, 12 Aug 2020 00:31:22 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id D3C5A20768 for ; Wed, 12 Aug 2020 00:31:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="miiSI8VS"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="MkCAIemX" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D3C5A20768 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=Ez8I9dvbwio0sTmR3phQudyT7lDDoEyBo/5karnu/c0=; b=miiSI8VSwG2FMBFI9CQfZDN5q +pYJTts2WDq9skozoHF3b4kP6g1LdfNWNHYeLB3WeZ30JiYT4ke6usfNE+C0BfQFP27v8nbXMnyQq t19STn91/F8XIvLz1VJAkG1O79qNtRl8/2ghRv0RwRBv4sMcmyzIPukmUbvm/n0vhoUn0e+qxk66l bimmojb8tLWZbcxP4ofJQMdlLJfNVrbtv/FthL6IsZAs/fJeezScGoYFACwKHzg1X8UWigIdx5b/b UiMEHmqZ3L/191JNtFf4KAEeVx7pPe7fmjd9hScHUYJEgWJT2TvgR/ADsbGt/JQyF/Qv2h2s65j7j 4Hr7CvLrQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5ee0-0006Kb-Ru; Wed, 12 Aug 2020 00:29:28 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1k5edx-0006Jo-EJ for linux-arm-kernel@lists.infradead.org; Wed, 12 Aug 2020 00:29:26 +0000 Received: from gmail.com (unknown [104.132.1.76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 1F3D1206F2; Wed, 12 Aug 2020 00:29:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597192162; bh=kiXRkDKP4hQ4jadvGyuR/t2yeuUqrE4Jh9tgwknMefU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=MkCAIemXaUr7Ue6tLTjfClBz/vamOZ9wT2HtpItC+40tqpL99lUoPAOO4Yx8F7UCB 0YahAcYceYu9k+uHFL9bpeZwpUo8qHGXGUEA1A38fB+4ZSkJyYa/8S0H39/VrwHqei mPQE6cYbHPHhdx/QraxdBXTjM2GsHHe5knls0rxo= Date: Tue, 11 Aug 2020 17:29:20 -0700 From: Eric Biggers To: Alim Akhtar Subject: Re: [RESEND PATCH v10 04/10] scsi: ufs: introduce UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk Message-ID: <20200812002920.GA1352011@gmail.com> References: <20200613024706.27975-1-alim.akhtar@samsung.com> <20200613024706.27975-5-alim.akhtar@samsung.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20200613024706.27975-5-alim.akhtar@samsung.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200811_202925_714038_77156C32 X-CRM114-Status: GOOD ( 19.13 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: robh@kernel.org, linux-samsung-soc@vger.kernel.org, linux-scsi@vger.kernel.org, martin.petersen@oracle.com, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, krzk@kernel.org, kwmad.kim@samsung.com, kishon@ti.com, avri.altman@wdc.com, cang@codeaurora.org, stanley.chu@mediatek.com, linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Alim, On Sat, Jun 13, 2020 at 08:17:00AM +0530, Alim Akhtar wrote: > Some UFS host controllers like Exynos uses granularities of PRDT length and > offset as bytes, whereas others uses actual segment count. > > Reviewed-by: Avri Altman > Signed-off-by: Kiwoong Kim > Signed-off-by: Alim Akhtar > --- > drivers/scsi/ufs/ufshcd.c | 30 +++++++++++++++++++++++------- > drivers/scsi/ufs/ufshcd.h | 6 ++++++ > 2 files changed, 29 insertions(+), 7 deletions(-) > > diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c > index ee30ed6cc805..ba093d0d0942 100644 > --- a/drivers/scsi/ufs/ufshcd.c > +++ b/drivers/scsi/ufs/ufshcd.c > @@ -2151,8 +2151,14 @@ static int ufshcd_map_sg(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) > return sg_segments; > > if (sg_segments) { > - lrbp->utr_descriptor_ptr->prd_table_length = > - cpu_to_le16((u16)sg_segments); > + > + if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN) > + lrbp->utr_descriptor_ptr->prd_table_length = > + cpu_to_le16((sg_segments * > + sizeof(struct ufshcd_sg_entry))); > + else > + lrbp->utr_descriptor_ptr->prd_table_length = > + cpu_to_le16((u16) (sg_segments)); > > prd_table = (struct ufshcd_sg_entry *)lrbp->ucd_prdt_ptr; > > @@ -3500,11 +3506,21 @@ static void ufshcd_host_memory_configure(struct ufs_hba *hba) > cpu_to_le32(upper_32_bits(cmd_desc_element_addr)); > > /* Response upiu and prdt offset should be in double words */ > - utrdlp[i].response_upiu_offset = > - cpu_to_le16(response_offset >> 2); > - utrdlp[i].prd_table_offset = cpu_to_le16(prdt_offset >> 2); > - utrdlp[i].response_upiu_length = > - cpu_to_le16(ALIGNED_UPIU_SIZE >> 2); > + if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN) { > + utrdlp[i].response_upiu_offset = > + cpu_to_le16(response_offset); > + utrdlp[i].prd_table_offset = > + cpu_to_le16(prdt_offset); > + utrdlp[i].response_upiu_length = > + cpu_to_le16(ALIGNED_UPIU_SIZE); > + } else { > + utrdlp[i].response_upiu_offset = > + cpu_to_le16(response_offset >> 2); > + utrdlp[i].prd_table_offset = > + cpu_to_le16(prdt_offset >> 2); > + utrdlp[i].response_upiu_length = > + cpu_to_le16(ALIGNED_UPIU_SIZE >> 2); > + } > > ufshcd_init_lrb(hba, &hba->lrb[i], i); > } Isn't this patch missing an update to ufshcd_print_trs()? It uses ->prd_table_length as the number of segments, not the number of bytes. - Eric _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel