From patchwork Sun Nov 27 12:08:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arthur Simchaev X-Patchwork-Id: 13056721 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 908B6C4321E for ; Sun, 27 Nov 2022 12:08:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229627AbiK0MIk (ORCPT ); Sun, 27 Nov 2022 07:08:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229642AbiK0MIh (ORCPT ); Sun, 27 Nov 2022 07:08:37 -0500 Received: from esa4.hgst.iphmx.com (esa4.hgst.iphmx.com [216.71.154.42]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 571A2F589; Sun, 27 Nov 2022 04:08:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1669550916; x=1701086916; h=from:to:cc:subject:date:message-id; bh=WsOMxY+mPL8jQ8iYAIC8w8tkwMDA68IYjaiBaloXufk=; b=d0kdRU7ssy4opxR7tuVZSXThA+doI0fGRtugjDgqwczXBhsSwqsA7wXD unTeTXkGypOAfi1UGEM/rdm9Jeb7f5BPjKukvaWj6Rc7NKN+HuCLipWEN 70bqTAccUJZ+qbjGVAdFldQjbvelcSx+5W3l6c5jzxPeVTEUYpJaNq3cc t/mIXMZUrTPOgrXdhuDp+JAII2WwKuoE7EgeC4qF1Q0WbgaQeF2tFQNhc 1r5UHN8Es1o5ZzR5QFhD0boYrSNkg2P508YFDzgBBxq3BPAxlnfdTsBsj eSC/zpypX+9RNL7SfPOiZPAZM/zeKw7HwiKQmZRhs4JhcmZ/oxKYASBq1 w==; X-IronPort-AV: E=Sophos;i="5.96,198,1665417600"; d="scan'208";a="215510875" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 27 Nov 2022 20:08:35 +0800 IronPort-SDR: iaJd2Nw4Kw7krW7tJnTtai54dvUfJFAahhQlgxE4ozOuihy+ObwMQfgCxteqR+IxlU6DmHyPkb QqExMAb2OcxSQOtHetwqgKafveGlWixs9fTgSIWhd1qer1qHFgrb92mSFIhWbchz/e0/OBfoaG TMBfdGjCvGiMITex+xdTtGYCK7C8obSxwq6x8H88dYh/uFkdDUKLc4kB7jk1TmmLmLM6pytPex 7Ud/aEt543xkD64ZJ7MaDRyTg2YnNcYYrfI1kcPWU5RWBZHpnYz8Vn/F+qP4OSfyW/evp4mTHg NXM= Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Nov 2022 03:27:18 -0800 IronPort-SDR: MUeIfeHbTxG4k+b7YqnOPpFiuVh8xYG4afDViF9r95qFJap4Q4eY890R6nAXJiBdMNfaJJdDGO aykeH8jPjZfsi/ebZ/iUD2UJHia+lj/TL4cEaO+NQS8Hvs5xiUeckM3qB4H7QGk0Xu54CLCOv1 LZtp/4qW2ECRD7LpUiQ0bWFed8kP6PvsNYkJPzeBNrrLfjNzCQ8ZEOubs7hsBLvNX9OKydI0p+ v6BNhMyYsYP0VSGAMZXcdk25jhR15/OiAsLPqFER5fDlNosOPNifQdFqtXLWSCuCxNRZnBsCnC +RM= WDCIronportException: Internal Received: from ilb001078.ad.shared (HELO ilb001078.sdcorp.global.sandisk.com) ([10.45.31.219]) by uls-op-cesaip01.wdc.com with ESMTP; 27 Nov 2022 04:08:33 -0800 From: Arthur Simchaev To: martin.petersen@oracle.com Cc: beanhuo@micron.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Arthur Simchaev Subject: [PATCH v4 0/4] ufs: core: Always read the descriptors with max length Date: Sun, 27 Nov 2022 14:08:26 +0200 Message-Id: <1669550910-9672-1-git-send-email-Arthur.Simchaev@wdc.com> X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org v3--v4: Add "Reviewed-by" to patch's commits Use kzalloc instead of kmalloc in drivers/ufs/core/ufshcd.c - patch 2/4 v2--v3: Based on Bean's comments: 1)Use kzalloc instead of kmalloc in ufshcd_set_active_icc_lvl - patch 2/4 2)Delete UFS_RPMB_UNIT definition - patch 2/4 3)Delete len description - patch 3/4 v1--v2: Fix argument warning in ufshpb.c Read any descriptor with a maximum size of QUERY_DESC_MAX_SIZE. According to the spec the device rerurns the actual size. Thus can improve code readability and save CPU cycles. While at it, cleanup few leftovers around the descriptor size parameter. Suggested-by: Bean Huo Arthur Simchaev (4): ufs:core: Remove redundant wb check ufs:core: Remove redundant desc_size variable from hba ufs: core: Remove len parameter from ufshcd_set_active_icc_lvl ufs: core: Remove ufshcd_map_desc_id_to_length function drivers/ufs/core/ufs_bsg.c | 7 +-- drivers/ufs/core/ufshcd-priv.h | 3 -- drivers/ufs/core/ufshcd.c | 100 ++++++++++------------------------------- drivers/ufs/core/ufshpb.c | 5 +-- include/ufs/ufshcd.h | 1 - 5 files changed, 26 insertions(+), 90 deletions(-)