Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp1589691pxb; Sun, 18 Apr 2021 00:27:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzQBHrINwiGwbqduDj1K7WpqmdakSYvNTqfQWRW3btlDeZpUxYYQfMQFkZg16LB/E07p6x8 X-Received: by 2002:a05:6402:4415:: with SMTP id y21mr18946960eda.70.1618730837165; Sun, 18 Apr 2021 00:27:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618730837; cv=none; d=google.com; s=arc-20160816; b=AAhuV4WS8uX2WhUD7v9NFb0V1YE8kL8maWBJasftTh+hZfASaVW5PBtDUwdWJu/qGh blfc1a6OA0XRw7T2fgrH6ymPw6I9ytiRYUo9aGqdqbXDUs42AgT4y0xkbiBcTUI0h75e L0d6rdf68pyqZgViBbcWI9sesjEBjqQR+LRE+sNeQWopd3Wxr75FUonCIYBOjvxCjpVK 1XzMnptwHlfLnbfvy7EyRm/NASDGqTsEt6SlmlBa2VaqlB+mrBPM4VfH9op/fP/+yW3d dKR0sEPZRzEbgJm9QgIaJC/4vIbD9B20eCUQsUgayFVohhQxIj3l0TArbgKODPqXyGTi pujQ== 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=PiYHTnOeo2ZYm+h1W+zGR9eYlN+6QC+6Xb11hoZ9+/w=; b=LT2s3D1tEnL4uzk4/JNisHE8ij0UX+EIZTGPEW8Q44BthO5uf14aZinLQ0Qn32/3OP tupn9oykEW8owvUlLGBnOSAJ0SkLnfB+SMuHS9GOJrUU07U2W/fJe5ulZSm6ZAWouzob Cb3B96WvkD9VbDdLNTdZ4joJnSbpCXsxqUiCJemlLUijx0f2ONZYo6lJ34sUZ/sSkxwm qy3Z0LPWs+En8oQrcg4CeFW3Cbsa2ph4QvLP54Lh2LFshja8HyyoF+3N5/PkyiCePPiD jjX7S7lfPGukA6PxCbD22fNMQiKRVUuMIyxL9TYB6j2VWH5a44xwkdJF56HHZ4wBtITD ZRiA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=Q6jBqubF; 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 p18si9020299ejg.216.2021.04.18.00.26.39; Sun, 18 Apr 2021 00:27:17 -0700 (PDT) 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=Q6jBqubF; 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 S230041AbhDRHWt (ORCPT + 99 others); Sun, 18 Apr 2021 03:22:49 -0400 Received: from esa1.hgst.iphmx.com ([68.232.141.245]:26689 "EHLO esa1.hgst.iphmx.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229671AbhDRHWp (ORCPT ); Sun, 18 Apr 2021 03:22:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1618730537; x=1650266537; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=IgziuC7NqjHVuW+40lWSUPp9sVUBlCXbGfxYLFmYcZ4=; b=Q6jBqubFkI2kOyc3TKt4ahQOVdGVtvboHaBCABi3t7Z6FQ4VhnCwqj/L SW2YxTzqyR4OpKIlpWjdz9LlQa1ArzMjRWDsdU4bguj4BZkPYaRxHwiMB TsV1dS3amjg+wY49TbJSQAXJketku4Fyi0LY+A4pu5jC302Y9MzglJhFR RxLW8t+XzijGlfsx2EBSrkf5SBbQkf7W6BfE6YbqxARicO48NRHhDNSQ8 f4/RxiY6lADBPwFH3jYk+ZjV/O3qt/QUTh470CbJLXav31tnzzaK9MRjt Audrqzspcp5Qjj5GXZlfUSeYAzg4zPb6C1PPS/RdXkudr/M3fb28TfLtn g==; IronPort-SDR: iRTJHoZ/W4xLGUfSARfR7toyosmjvCXN8qw5J86d0D61YjI9adQ32TtxAohzqlWkN7oneINXEl niNxmMFIQ0mxgR4uQjT8Xb2nF+m8NBGwcmoh8e/DKKgXYEnZigO9R2BCvdiqyWbsL5oz1gKT4z qjkdv4Y+FADBK80vfArSS+ktdoUaUdsLMfjCxkwAUtwcxJ1OOA96f0ddD0OK8duQOo6tKj1ZjP qIKzuQEGCARkDampqtruYha1C5xf+uGL5351au4QYMUGf4sYy3+K7mZbmQRvo6B00csCPXDPxu hko= X-IronPort-AV: E=Sophos;i="5.82,231,1613404800"; d="scan'208";a="276267663" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 18 Apr 2021 15:22:17 +0800 IronPort-SDR: 4D0ZExdbv/LjFpmI0stICE3JUgslQ/jVgljbpgChdX4cMtVeBQ2ujIdzG/6zuPJcGxGe/mZ7xf 0l7VGtrQWikWiNHWHuTOQeojg1l1RiGJIsjf5qWJk0cm3WAmXYtvUAeMAfP+ILpqDvRpVhbqYG qGdJMwIlvsSOBJlCrX5bq1Hi7Q8eIL9xPyBpq5p1azSVeUyNE/XoI1YXIz04H5hDdd2KS7TlwY 4nhiTqV9R1QZKoqZ4SFvMYxMxuPr5k9ZOVHELBCmYMlKHEYIyjJZTBFB85r/GdemExICaQOYme GE1xXBF1p4f5rXXq5OM55Mpf 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; 18 Apr 2021 00:03:03 -0700 IronPort-SDR: IRSLbvLKgH2VOlJ7Oci00Hk4NPrXuNy4SA3I1kaZ61OeLVz5cp6dTUa97qlvFdTASQ5DJpye96 pshpfF2Fo3/dZT4FChnIskf7SEtW3iiRofp2T9osl5xA0xO8QfKtNCBlO9K36BCKOhVxXAlSVV 5Tg6zzg4rzyAiusdEhf6/e2yl+OfAli4y+eLjJt3jLxIucSuja/5XSyth9kP9K0I4nPZ6kpyD4 LGnhod48ItgrWM6TykS1wZAy9af8av2utUAO/5e/M80MSWnOhMMDlDEOI+nEgCJE9yzDgw5rM/ BF0= WDCIronportException: Internal Received: from bxygm33.sdcorp.global.sandisk.com ([10.0.231.247]) by uls-op-cesaip01.wdc.com with ESMTP; 18 Apr 2021 00:22:15 -0700 From: Avri Altman To: "James E . J . Bottomley" , "Martin K . Petersen" , linux-scsi@vger.kernel.org, Adrian Hunter Cc: linux-kernel@vger.kernel.org, Avri Altman , Alex Lemberg Subject: [PATCH] scsi: ufs: Check for bkops in runtime suspend Date: Sun, 18 Apr 2021 10:21:50 +0300 Message-Id: <20210418072150.3288-1-avri.altman@wdc.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The UFS driver allowed BKOPS and WB Flush operations to be completed on Runtime suspend. Adding the DeepSleep support, this is no longer true: the driver will ignore BKOPS and WB Flush states, and force a link state transition to UIC_LINK_OFF_STATE. Do not ignore BKOPS and WB Flush on runtme suspend flow. fixes: fe1d4c2ebcae (scsi: ufs: Add DeepSleep feature) Suggested-by: Alex Lemberg Signed-off-by: Avri Altman --- drivers/scsi/ufs/ufshcd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 58d7f264c664..1a0cac670aba 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8755,7 +8755,8 @@ static int ufshcd_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) * In the case of DeepSleep, the device is expected to remain powered * with the link off, so do not check for bkops. */ - check_for_bkops = !ufshcd_is_ufs_dev_deepsleep(hba); + check_for_bkops = !ufshcd_is_ufs_dev_deepsleep(hba) || + hba->dev_info.b_rpm_dev_flush_capable; ret = ufshcd_link_state_transition(hba, req_link_state, check_for_bkops); if (ret) goto set_dev_active; -- 2.25.1