Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp122953pxb; Tue, 2 Feb 2021 00:32:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyWDlCm7f33mVtHTX8TNGXUO9Jwq5ZEgdCKNFOfhpUUj+XQYzpFttSMTndC3ug8SxjZJ/vp X-Received: by 2002:a17:907:971b:: with SMTP id jg27mr21194307ejc.14.1612254757972; Tue, 02 Feb 2021 00:32:37 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612254757; cv=none; d=google.com; s=arc-20160816; b=dJM6w7fYKkTiJJ3aU4Sdyg9kN/ZEgBuMlfi/BNibiNOxpYAuNHuBII6XCTZQSoEdiO +789/Y6cVf6uk9OxREbAz4DTVFwO+yX2EKklnZjuXAdz0wFz9DC5cXVxjVDzMRVeslT+ FR4k3wlyB8Yy83pTHx5mcszUE2RGk33MI7JTjQwvhoKP4WT7bue5spxJj8HMkTqzINr9 +OiDhp6+XmmumOnF4/lAT/pQN6nNj9XwVx/bVv0HPT38e4H2cIunmsHzO0OmWbMXd8yU RlYnkQK0toSk8TFWSon1vX8GAVRLZjhKeCeS1xybx9q8hDBwXWnn5GGldbid80JVvuOr KL7Q== 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 :message-id:date:subject:cc:to:from:wdcironportexception :ironport-sdr:ironport-sdr:ironport-sdr:dkim-signature; bh=YFdyN1q8QqYjVZwnWOzlAnoNhQbOU101CdWPjy2Zga8=; b=mbi9pkJcnsWjzKwiFxoFQNPFCbKk6ZebvVgNj83qvOEP9iG6sz4y5bXfOWleclqNhi i3MrP8FiAztquP6ujmw0SnAz7G6Wxi+zopJLjpLUAPJ0eBvkD1NaO/Oh0t+Z8pk3SXuQ tHhxpeRtw5OAy2KoKOTsUiv9UK7uLCCkPofKNocqkij89uFTXBhWhOtc5pmW+SLRWqJK ktNSwBduWTh68UuEhHpCLFQRq5ZvDtL6sc3/q8FOhmCGgxb1Xr0slqEjvhiG20GUtxws EsBWA5SAGZnRMVfm5Sr1D/Q+R4hAi9RMs4yuiCJVBqPgMjkllImNBySIkUAePAzW5e1s a0ww== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="j6x7OTz/"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s10si11932600edd.231.2021.02.02.00.32.13; Tue, 02 Feb 2021 00:32:37 -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=fail header.i=@wdc.com header.s=dkim.wdc.com header.b="j6x7OTz/"; 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=fail (p=NONE sp=NONE dis=NONE) header.from=wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232624AbhBBIbe (ORCPT + 99 others); Tue, 2 Feb 2021 03:31:34 -0500 Received: from esa6.hgst.iphmx.com ([216.71.154.45]:42108 "EHLO esa6.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232553AbhBBIba (ORCPT ); Tue, 2 Feb 2021 03:31:30 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1612254690; x=1643790690; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=OCdpwgqTjdpm1vlos+hHl6mfuQuYzHnv5sqBXpqxmSo=; b=j6x7OTz/+E/YU5L412MBW7v97bH/oxZOBsub/uycRJExXa4Cyqt9CLG+ SLwl94Tl9J+46wAfXO+XXXc0FVmpWn78wdL4BqHiZ6pP1fq3jTH6/IcA5 qaH9M800KJw1CBsxP1mSGcbadFXgGJAAGfkGUiCVFLvVvvlQLqXJjzwsB p2EcVTfA8ag9Cq0k+XXVKD824sPJXHji8Ld6qDw9KEkbEnVgOIY5j24ve 3tvjeHSnkxPLvfT20qm7yZMFjpkYP0H1R126wtAl3wyeeisGBmPDhm/0f 2gHauFU07shiuPoQOE+PvyXsNFndHnR8RZ6TEVITx6eHtPlyJhhhnkE4F w==; IronPort-SDR: wqKg/QFIzArnUEoKi8p0fRYhJpnAVRZvACxjMmW9DdOCClARZdmkV1Mu8zQpBx7eAQxsuiGgMW 8Kr4I/R/f+YliWlA2psDf1AMruKySzlYLInbtRInbJc8txOvlKwJn6ibTdEDFn9tii6PcHZ2Ao H1mUbEmj+IVIQ7YYw80pGZrUaotGTKwVLa90j9sNLVq6ZZijGFI6gHSb+b0GIKzby/cet5IuEp yYQRHMqBg76vagH156LCL+cA/rKHIUu/RpJ7HmiGc6P3Wlo/lWAWlCoNasRwkL4Dj3HfVFEAER D+Y= X-IronPort-AV: E=Sophos;i="5.79,394,1602518400"; d="scan'208";a="160083458" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 02 Feb 2021 16:30:20 +0800 IronPort-SDR: KfGVjQcUVVcYlFXGsuizdapaM6AMtG7iEQ2F2F5CjTmWqw/5Jp2tTD10mpUv/uQfJR2vmxRUMC yJ3sD0WKN4PXp1sO4mWlnn5zIehAJEkias02c/5qDHzTgjpEr3LbNbesJR28TifFXo2inVsWRN x/mUOTAAJzbnQB02TKv9G3NZGzoPqk+CAfX30w2nenRrW96/dnO+btXzgyUDQ88GfbR9Q2Bthi P7NDyQ5AJpr8bFdf84+zqXLrm7+WY/BWeL83FtupKDOhJACOZ7mbfvl4RJyDvZdwk281xe2otF hSA3ZP24xVpFNuzlkDAi2lSI Received: from uls-op-cesaip01.wdc.com ([10.248.3.36]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Feb 2021 00:14:29 -0800 IronPort-SDR: gu3FR2BzrMtWzyiw24YhkIMG7b3CBCFYLfyNTfo7AT4m1Xp4slKrm5SC+nOSGH8FH5KF5WG9Jk myjb+32azyYXUzklhENsGHjwYX5U/DBzUpQ0otwFXUNaPh1LFsjRZUYpE3GnBYzIGyDpuzCnuy gogexgC//WM49sP6/8GN1UA1bKplPhewk6WjXyPA5FssxdY5e5g2QJnCCRFqdIGtISx5quGJuA P8pourcFBdeVS4mwlDxwgLhIllGkZ20pMcFu0UO+bP6f+3lQQwgbIvyxQUqmdJRJR31oh1iAZU guY= WDCIronportException: Internal Received: from bxygm33.sdcorp.global.sandisk.com ([10.0.231.247]) by uls-op-cesaip01.wdc.com with ESMTP; 02 Feb 2021 00:30:17 -0800 From: Avri Altman To: "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org Cc: gregkh@linuxfoundation.org, Bart Van Assche , yongmyung lee , Daejun Park , alim.akhtar@samsung.com, asutoshd@codeaurora.org, Zang Leigang , Avi Shchislowski , Bean Huo , cang@codeaurora.org, stanley.chu@mediatek.com, Avri Altman Subject: [PATCH v2 0/9] Add Host control mode to HPB Date: Tue, 2 Feb 2021 10:29:58 +0200 Message-Id: <20210202083007.104050-1-avri.altman@wdc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v1 -> v2: - attend Greg's and Daejun's comments - add patch 9 making host mode parameters configurable - rebase on Daejun's v19 The HPB spec defines 2 control modes - device control mode and host control mode. In oppose to device control mode, in which the host obey to whatever recommendation received from the device - In host control mode, the host uses its own algorithms to decide which regions should be activated or inactivated. We kept the host managed heuristic simple and concise. Aside from adding a by-spec functionality, host control mode entails some further potential benefits: makes the hpb logic transparent and readable, while allow tuning / scaling its various parameters, and utilize system-wide info to optimize HPB potential. This series is based on Samsung's V19 device-control HPB1.0 driver, see msg-id: 20210129052848epcms2p6e5797efd94e6282b76ad9ae6c99e3ab5@epcms2p6 in lore.kernel.org. The patches are also available in wdc ufs repo: https://github.com/westerndigitalcorporation/WDC-UFS-REPO/tree/hpb-v19 This version was tested on Galaxy S20, and Xiaomi Mi10 pro. Your meticulous review and testing is mostly welcome and appreciated. Thanks, Avri Avri Altman (9): scsi: ufshpb: Cache HPB Control mode on init scsi: ufshpb: Add host control mode support to rsp_upiu scsi: ufshpb: Add region's reads counter scsi: ufshpb: Make eviction depends on region's reads scsi: ufshpb: Region inactivation in host mode scsi: ufshpb: Add hpb dev reset response scsi: ufshpb: Add "Cold" regions timer scsi: ufshpb: Add support for host control mode scsi: ufshpb: Make host mode parameters configurable drivers/scsi/ufs/ufshcd.c | 1 + drivers/scsi/ufs/ufshcd.h | 2 + drivers/scsi/ufs/ufshpb.c | 697 +++++++++++++++++++++++++++++++++++--- drivers/scsi/ufs/ufshpb.h | 47 +++ 4 files changed, 697 insertions(+), 50 deletions(-) -- 2.25.1