From patchwork Tue Oct 27 13:48:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 312105 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=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable 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 A9F38C6369E for ; Tue, 27 Oct 2020 17:16:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5A2B520809 for ; Tue, 27 Oct 2020 17:16:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603819007; bh=TM6rdoP0IptLbKUARf7en7FhUxRfd6eGQNCDCGAePBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BXcGQAPce9pfhvk4phy9PkkCyj2rKeriJvFSufhl8sgJBJbPdPqrzSEnTlELcF2yg PzzStYGhtIYIMA2howCdo7IPdpsD3rOmASOR7Aiyb4JVc1hMz/6F00GkRuc3ptm5W1 UU90hwZE2DAyDn38QYrZDGu3GQJORVn4qVzGyUXg= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1782032AbgJ0O42 (ORCPT ); Tue, 27 Oct 2020 10:56:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:57104 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1781964AbgJ0O41 (ORCPT ); Tue, 27 Oct 2020 10:56:27 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (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 C8D1A22281; Tue, 27 Oct 2020 14:56:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603810586; bh=TM6rdoP0IptLbKUARf7en7FhUxRfd6eGQNCDCGAePBg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=wXA/qkU8JCMoD1pZ1hbfIqusmGYBNhtBztMAbe1nfFTy0YI50IY+5O3V1rGrVo5go UU0gmpyBCbTH2VW3BGw0LhzySn7Jagf6OsNYHfWhFzxf2uOIrr4wzlpBrKb2HWo4mw /v2hmRRhwtpEtdEtsmCnGyt8MKEeJ+Fei/e+Zwbc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Alim Akhtar , Kiwoong Kim , Eric Biggers , "Martin K. Petersen" , Sasha Levin Subject: [PATCH 5.8 192/633] scsi: ufs: Make ufshcd_print_trs() consider UFSHCD_QUIRK_PRDT_BYTE_GRAN Date: Tue, 27 Oct 2020 14:48:55 +0100 Message-Id: <20201027135531.690092350@linuxfoundation.org> X-Mailer: git-send-email 2.29.1 In-Reply-To: <20201027135522.655719020@linuxfoundation.org> References: <20201027135522.655719020@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Eric Biggers [ Upstream commit cc770ce34aeeff21991f162f0db1a758ea672727 ] Fix ufshcd_print_trs() to consider UFSHCD_QUIRK_PRDT_BYTE_GRAN when using utp_transfer_req_desc::prd_table_length, so that it doesn't treat the number of bytes as the number of entries. Originally from Kiwoong Kim (https://lkml.kernel.org/r/20200218233115.8185-1-kwmad.kim@samsung.com). Link: https://lore.kernel.org/r/20200826021040.152148-1-ebiggers@kernel.org Fixes: 26f968d7de82 ("scsi: ufs: Introduce UFSHCD_QUIRK_PRDT_BYTE_GRAN quirk") Cc: Alim Akhtar Cc: Kiwoong Kim Signed-off-by: Eric Biggers Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/ufs/ufshcd.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 8bc8e4e62c045..e5f75b2e07e2c 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -484,6 +484,9 @@ void ufshcd_print_trs(struct ufs_hba *hba, unsigned long bitmap, bool pr_prdt) prdt_length = le16_to_cpu( lrbp->utr_descriptor_ptr->prd_table_length); + if (hba->quirks & UFSHCD_QUIRK_PRDT_BYTE_GRAN) + prdt_length /= sizeof(struct ufshcd_sg_entry); + dev_err(hba->dev, "UPIU[%d] - PRDT - %d entries phys@0x%llx\n", tag, prdt_length,