Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp958163pxb; Wed, 3 Mar 2021 22:31:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJyf8RWaWDvWgHCBrbwI7wazhjwKmY/V5LIhLKcaoBtGLdpGMra7bqmSPVi8snH7buE83aLK X-Received: by 2002:aa7:d3d8:: with SMTP id o24mr2643591edr.165.1614839477224; Wed, 03 Mar 2021 22:31:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614839477; cv=none; d=google.com; s=arc-20160816; b=ri1nb+5hQmaOcv7X3V2QR2qadwMx9Vu0zqnFdjlrqIV0T5UTCC9O5Bn/US1dFXkWqg MsEcubDBwl1zL28TKk+8d+OwMaG1KJQUycLDFQQ0uSobZA8BPbzs7QRi8DRihzYwFNYi y2ySWiZsX5U4ismpviZkeHVq07fpRqppOHxxeOmJt087D/ogeqSEujaMSHs/4k6SFd8a +w23++5cFwH2ftObdNWqrjdJsl49rw62CkEoPnBXq2svYmOVGyAO4Ptu42+W0ibVZCcR qmRdyMwGeuiQiYK288rKlIybDqe3Yr5JrLrSrNFnsQMuLL1adb89+FQIw6sMcTj/Cmqd Cvtw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:ironport-sdr:ironport-sdr; bh=uafthGO0eBeU1ZJtN8FFliWS6JCZkjYq6BkJ5HY1omI=; b=VAKpuNgIE7qMlEuBU6q77VIEKYD9VoWY/QuHO5LwoWsgJuoFeLBUiuQGYWaDUZCkW4 6Db48/0uZDcvFn8jlkxANygKNvCpAnu0+5zZ4luOLWJwIEC0XILfxJbZnVpEOZ86Llg+ hMql4eHtQMV59L7aG1e3RwPbi8ZeKkyVITsekX4J1AlL6yOHURjYkKrcsJdUPGd+z3Uj LFhjXRfMwO2qpLD6QmCU+eo29c1Zgp7xMcN65pB0XH5MofUrSM7WWTdWFoFnhDg1pask 23D0/Jbbsww3i3iPh0+FceFWXcRhJgi9kUeKUXo1p+o2JVB+zQA66DolcprKKfG2HGWJ 2yHQ== ARC-Authentication-Results: i=1; mx.google.com; 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=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id y8si5532977edc.279.2021.03.03.22.30.54; Wed, 03 Mar 2021 22:31:17 -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; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1839781AbhCBQic (ORCPT + 99 others); Tue, 2 Mar 2021 11:38:32 -0500 Received: from mga02.intel.com ([134.134.136.20]:44613 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1448250AbhCBOTC (ORCPT ); Tue, 2 Mar 2021 09:19:02 -0500 IronPort-SDR: pMHKt0AAko+IUB3LODBkcdV1Kj17ZuZz3QB2U6Q/VlxuZy+MyFW16N8jRhTKWlUo/Kfb1Eaht7 PJEbDI915WSQ== X-IronPort-AV: E=McAfee;i="6000,8403,9910"; a="173964363" X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="173964363" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 02 Mar 2021 06:14:19 -0800 IronPort-SDR: XsTTl1bvinkrhr7HkvJW8Mx35RMJU4Z9LNHPZV1ptjWnpLJg2E517DX3NDo03/LbzpRIqg94RZ tEFORZFpH4ZA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.81,216,1610438400"; d="scan'208";a="399037378" Received: from ahunter-desktop.fi.intel.com (HELO [10.237.72.76]) ([10.237.72.76]) by fmsmga008.fm.intel.com with ESMTP; 02 Mar 2021 06:14:10 -0800 Subject: Re: [PATCH v9 1/2] scsi: ufs: Enable power management for wlun To: Asutosh Das , cang@codeaurora.org, martin.petersen@oracle.com, linux-scsi@vger.kernel.org Cc: linux-arm-msm@vger.kernel.org, Alim Akhtar , Avri Altman , "James E.J. Bottomley" , Pedro Sousa , Krzysztof Kozlowski , Stanley Chu , Andy Gross , Bjorn Andersson , Steven Rostedt , Ingo Molnar , Matthias Brugger , Kiwoong Kim , Bean Huo , Wei Yongjun , Dan Carpenter , Jaegeuk Kim , Satya Tangirala , open list , "moderated list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES" , "open list:ARM/SAMSUNG S3C, S5P AND EXYNOS ARM ARCHITECTURES" , "moderated list:UNIVERSAL FLASH STORAGE HOST CONTROLLER DRIVER..." References: From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: Date: Tue, 2 Mar 2021 16:14:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/03/21 5:21 am, Asutosh Das wrote: > During runtime-suspend of ufs host, the scsi devices are > already suspended and so are the queues associated with them. > But the ufs host sends SSU to wlun during its runtime-suspend. > During the process blk_queue_enter checks if the queue is not in > suspended state. If so, it waits for the queue to resume, and never > comes out of it. > The commit > (d55d15a33: scsi: block: Do not accept any requests while suspended) > adds the check if the queue is in suspended state in blk_queue_enter(). > > Call trace: > __switch_to+0x174/0x2c4 > __schedule+0x478/0x764 > schedule+0x9c/0xe0 > blk_queue_enter+0x158/0x228 > blk_mq_alloc_request+0x40/0xa4 > blk_get_request+0x2c/0x70 > __scsi_execute+0x60/0x1c4 > ufshcd_set_dev_pwr_mode+0x124/0x1e4 > ufshcd_suspend+0x208/0x83c > ufshcd_runtime_suspend+0x40/0x154 > ufshcd_pltfrm_runtime_suspend+0x14/0x20 > pm_generic_runtime_suspend+0x28/0x3c > __rpm_callback+0x80/0x2a4 > rpm_suspend+0x308/0x614 > rpm_idle+0x158/0x228 > pm_runtime_work+0x84/0xac > process_one_work+0x1f0/0x470 > worker_thread+0x26c/0x4c8 > kthread+0x13c/0x320 > ret_from_fork+0x10/0x18 > > Fix this by registering ufs device wlun as a scsi driver and > registering it for block runtime-pm. Also make this as a > supplier for all other luns. That way, this device wlun > suspends after all the consumers and resumes after > hba resumes. > > Co-developed-by: Can Guo > Signed-off-by: Can Guo > Signed-off-by: Asutosh Das > --- Now we need either to move the suspend/resume vops from ufshcd_suspend/resume to __ufshcd_wl_suspend/resume, assuming that would work for existing implementations of those callbacks, or otherwise create new vops ->wl_suspend() / ->wl_resume(), and then split the existing implementations of those callbacks. ufs_intel_resume() now needs to be invoked from __ufshcd_wl_resume(). I am not sure about the others: exynos_ufs_suspend() exynos_ufs_resume() ufs_hisi_suspend() ufs_hisi_resume() ufs_mtk_suspend() ufs_mtk_resume() ufs_qcom_suspend() ufs_qcom_resume()