Received: by 2002:a05:6358:111d:b0:dc:6189:e246 with SMTP id f29csp1023373rwi; Mon, 31 Oct 2022 10:14:09 -0700 (PDT) X-Google-Smtp-Source: AMsMyM522+Qh08ANalZ8gs2lHewmv9LyP/Kqvs8QK+wd/MJF1hwqw8KPCg6Mr4g9jBC9RbNgA8om X-Received: by 2002:a17:907:3e02:b0:782:1267:f2c8 with SMTP id hp2-20020a1709073e0200b007821267f2c8mr13948478ejc.585.1667236449426; Mon, 31 Oct 2022 10:14:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667236449; cv=none; d=google.com; s=arc-20160816; b=U8FBg0o3liUyPF4wHrFq5TPoKMJ3bzq8iKvgW1+n9/NUqJTUSWzqojPelggBM+35aC UH422jySlOvPK28hh9LDxO1aOEVMGOfrlcvlEyQ15gxVtMS7EKWdRy/OEiKGqh3GngUe wfoRiWpMNQIsOCJGbU4zZjBpuZcEnTmGVT7m+I6UipSm7QSdspgyHMTG3oCCYpy4YcBG GpyoSz6ULL/zpB2vh2/U+Ii7dxMV6w1cWspolu/Sssv1OdpQjEx+QDGZvzZfMTb8vQhy ZbzNxUVoB+hMgFW6fJSSzjOYoDVAVGrTtqopy4xUkf59OoZRI034EfDVIvOq0eFcbTcw HGAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from :wdcironportexception:ironport-sdr:ironport-sdr:dkim-signature; bh=4gzMA/2RYgY0IZyz/ff4dgBZcbCmOhyfLDacUQcJ1Hg=; b=nIkM58d4tO3fIpNrslpLAOFOuAtXl+z6Tl3s0nHEUHyYTcIYTzhc+WWbz9W7BeDlQ8 yk1JKHLK3lb4jOWaBdRkruXrlB3nl6A5pzaPP4hOaHp6TBcqypajVkBlwvbjqCBn+QVo xkGWi0fVBrd0gp0cAFsG46Hah9aFbc7ltWiie/Keejk21++ohxt6UrOpARFccdWaMwUD eVk5KYCJJRBoW6Vjpo9Xa52ys88aDRR2Bj5B7+rJ7zyd8wtOOQqioKRSUaXc13CUzfNz b2xCmAKZmh/ArUX4mN/QBAqClshZLNcPIZICCWV4+Y022tnDgljqDOZgE6JPzcz6oKnt ibGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=Cf3zsKkJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z20-20020a05640240d400b00462e7873c19si8667571edb.490.2022.10.31.10.13.45; Mon, 31 Oct 2022 10:14:09 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=Cf3zsKkJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231586AbiJaQZe (ORCPT + 98 others); Mon, 31 Oct 2022 12:25:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43970 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230197AbiJaQZc (ORCPT ); Mon, 31 Oct 2022 12:25:32 -0400 Received: from esa5.hgst.iphmx.com (esa5.hgst.iphmx.com [216.71.153.144]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3150610549; Mon, 31 Oct 2022 09:25:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1667233531; x=1698769531; h=from:to:cc:subject:date:message-id; bh=8ZkqY2fkQzp7wMp62ktaXg2E2J6EJ0M2jxbxpAiqLwU=; b=Cf3zsKkJHjkbifoy+toj6OTviE/YoMV6rRjrE+8iPi2HCBsutWWewCJ+ C/VtSiiFapSGJynkHswrL3r6zJOgWdDeZuDsfbMlVGnlAU/Oo3zMJTs9G FktuROENto+mYNTmRUJkS1a7kSZqq0+fIjmnx6M4zOeIg5ULXsH9WQ8Lo eEqMeZA8BT4MM9GbTTuTwgEke/INavT2kS4ZVHcV3xUWR2cl4QmzPSPO/ stNYh1UtVtPZ2diftHrMC8oQ8H55ekLaMoTGv9unb7s7PDpYDk87Tws4E xJWPVKSR0QveiJroh5ouM9JJvfj3qHJGpxP3CDd0G3Juv57g5hVaHz/G4 Q==; X-IronPort-AV: E=Sophos;i="5.95,228,1661788800"; d="scan'208";a="215149684" Received: from h199-255-45-14.hgst.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 01 Nov 2022 00:25:30 +0800 IronPort-SDR: De11Si936dnF+6Gupziir88gJO7WdQTuP4+70VV4hqMZgdKMp4SDNqSwgvBznJKLzPqag7mw0f TOuXMTBOyjnCjw+R/YbI0r9gFxLkCLUYGpZVMc5wd55avWiOxdvjYe0CDnmXqTjVrI4oC6RMHO KCGCSAIo9zuB24Ezn3Uw5+fMqNiUrRgF9dBjpEw1YbAS/bmcQJGp52f5M1MSVKXMmHpjvVVHaG cbIAxAimlOD5B7LguLwaaTD2DhfmBFD21jV7ysD4Z2yjLpyxeZwSFVWNc3ADKT0jlH5mNpDdHE A4QPW/vFlICyD1+1pIb/HHXI Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 31 Oct 2022 08:44:45 -0700 IronPort-SDR: Fc8Rsal29PfocnsngXPozZTra2FILDVFI/ElPYdMpSdsUh52nSvfu3O0j8PWYY83Ar+69NIlyu aLw2zzkcqS+iXqaQxyYp/lkhm446jFUX7Pa6rDRwoVWPcU1B/0rfZ9wfTiFaYvaZlaN5eKcZQI z1Z3M3Jw3Oqfa06deNZfScaf6m9X/QcwJDwxLGLrdjgpCSn+CpRQs7dYAXFJDqbrepzMCBLLOv kkZnQS+Qj4/44Pgcx8IVKZyPfrCus6WTP+3pAOu26WLr+jhmFjJqRLaN8kVE+pSEmEuXNX3exc nMQ= WDCIronportException: Internal Received: from ilb001078.ad.shared (HELO ilb001078.sdcorp.global.sandisk.com) ([10.45.31.219]) by uls-op-cesaip02.wdc.com with ESMTP; 31 Oct 2022 09:25:27 -0700 From: Arthur Simchaev To: martin.petersen@oracle.com Cc: avri.altman@wdc.com, Avi.Shchislowski@wdc.com, beanhuo@micron.com, linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org, Arthur Simchaev Subject: [PATCH 0/4] ufs: core: Always read the descriptors with max length Date: Mon, 31 Oct 2022 18:25:20 +0200 Message-Id: <1667233524-13715-1-git-send-email-Arthur.Simchaev@wdc.com> X-Mailer: git-send-email 2.7.4 X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_PASS, SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.7.4