Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp560362pxb; Fri, 16 Apr 2021 12:11:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxM2tMxAIO+ehkznohzhbS69jXPoLtJHYhehy+7/E/a0Z8Ht+L8GQEhD+yVveqNmTfcMJ13 X-Received: by 2002:a50:ed10:: with SMTP id j16mr11726920eds.29.1618600298790; Fri, 16 Apr 2021 12:11:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618600298; cv=none; d=google.com; s=arc-20160816; b=jTaM4cfcNMBbcGSa69/QJlLTHtVZz1gOs4q/plQXWr7LIAqQZmzwLUlOysnNI9jJbr 0u3W4MLTPmxIGOJkOuokk4Q1yJdPjJtHxr5bg1g41sP6wo24qMPmN7ecIyDh7wrFkU/G E8tXeVPB9bRetpdeHInYT6RV+eFhBL0gMxAvQXDeDfArK/AkCIuvow9Nctp4dEDCVn8k V+6fNQXiM0Z8oIwhgG41PwjtkiXAcG3RwaiqT8ycIJsSukVca7UInWb4axymmsT/4ZZw 71rlk6BXYJSPKMqwb7WlyivfjqRAiBP4WS9xYSf0LdgYSslM0rwXQWo3HyvyxLN7zDjm fVZg== 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:from:references :cc:to:subject:dmarc-filter:sender:dkim-signature; bh=kVxxHWGXgfHGZWYXemFNetuQ9QkDGOKq4KF+Razehig=; b=T5hOZkyen9hMeaS5lx6R4adcQIJ5HH1uFxsqGAIdvw4KAS1Qb8TRSsBCt+nhxij/hQ 9QtcECFlmeBqqL9Qaf8bDU8eZ8iWR+G/c2lMy1b7XoBQ8DG2vAf46EiUE42hwFu1iYx5 8HymaXH4zhfssIBo5wNx973GqH93CPyEVYoqSQvW52b9X5RG3tlja4/bO3NSpUTpTl+A vD+NUk21osWoG/NTxx0JLQhEuCiFbzPbQiOjGvdBvxbM0qx4aYAWPg1XI4UDW2lQJq5o Sjotvwu8skGC9xfCb/AhiGqXOkOznjHxLJbccjeX9loVs8yRKbptn3wXDMJCsKfq4r0f 7YvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=NEGb9PEz; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g17si1956189ejr.16.2021.04.16.12.11.15; Fri, 16 Apr 2021 12:11:38 -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=pass header.i=@mg.codeaurora.org header.s=smtp header.b=NEGb9PEz; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244737AbhDPSWc (ORCPT + 99 others); Fri, 16 Apr 2021 14:22:32 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:56644 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235750AbhDPSWb (ORCPT ); Fri, 16 Apr 2021 14:22:31 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1618597326; h=Content-Transfer-Encoding: Content-Type: In-Reply-To: MIME-Version: Date: Message-ID: From: References: Cc: To: Subject: Sender; bh=kVxxHWGXgfHGZWYXemFNetuQ9QkDGOKq4KF+Razehig=; b=NEGb9PEze03PZExiPy2f4JetVW4CPwrSN8QYmWgx+nHI5YFzM28Hkk++zEa+J7ehCKexEofa 1+Qy83BfPshBsufJm8KyYGG4gT1J6MJVfkJlVrOQEBNvK+gDkX2LHW/dQt3nzrWnXtMT6Rq8 KE755y2UMskBh2XWsnxZTY4b62I= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n07.prod.us-west-2.postgun.com with SMTP id 6079d5c12cc44d3aeadb8f59 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Fri, 16 Apr 2021 18:21:53 GMT Sender: asutoshd=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 2E69BC43465; Fri, 16 Apr 2021 18:21:52 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00, NICE_REPLY_A,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 Received: from [192.168.8.168] (cpe-70-95-149-85.san.res.rr.com [70.95.149.85]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: asutoshd) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3F772C433CA; Fri, 16 Apr 2021 18:21:49 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3F772C433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=asutoshd@codeaurora.org Subject: Re: [PATCH v18 1/2] scsi: ufs: Enable power management for wlun To: Bart Van Assche , cang@codeaurora.org, martin.petersen@oracle.com, adrian.hunter@intel.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 , Lee Jones , Bean Huo , Kiwoong Kim , Yue Hu , Wei Yongjun , "Gustavo A. R. Silva" , Dinghao Liu , 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: "Asutosh Das (asd)" Message-ID: <9ae35c14-f8aa-a181-2259-2d32bd2c1f07@codeaurora.org> Date: Fri, 16 Apr 2021 11:21:48 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.9.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/15/2021 4:11 PM, Bart Van Assche wrote: > On 4/14/21 11:58 AM, Asutosh Das wrote: >> [ ... ] > Hi Bart, Thanks for the comments. I will fix the comments in the next version. > The following code is executed before ufshcd_async_scan() is called: > > dev = hba->dev; > [ ... ] > /* Hold auto suspend until async scan completes */ > pm_runtime_get_sync(dev); > That would only keep the hba runtime resumed. At this point of time the luns are not detected yet. > and the following code occurs in ufshcd_add_lus(): > > pm_runtime_put_sync(hba->dev); > > Isn't that sufficient to postpone enabling of runtime PM until LUN > scanning has finished? Or in other words, is adding a > pm_runtime_get_noresume() call in ufshcd_slave_configure() really necessary? > Yes, because the supplier (device wlun) may be suspended otherwise in scsi_sysfs_add_sdev(). >> @@ -4979,15 +5035,9 @@ ufshcd_transfer_rsp_status(struct ufs_hba *hba, struct ufshcd_lrb *lrbp) >> */ >> if (!hba->pm_op_in_progress && >> !ufshcd_eh_in_progress(hba) && >> - ufshcd_is_exception_event(lrbp->ucd_rsp_ptr) && >> - schedule_work(&hba->eeh_work)) { >> - /* >> - * Prevent suspend once eeh_work is scheduled >> - * to avoid deadlock between ufshcd_suspend >> - * and exception event handler. >> - */ >> - pm_runtime_get_noresume(hba->dev); >> - } >> + ufshcd_is_exception_event(lrbp->ucd_rsp_ptr)) >> + /* Flushed in suspend */ >> + schedule_work(&hba->eeh_work); > > What makes it safe to leave out the above pm_runtime_get_noresume() call? > The __ufshcd_wl_suspend() would flush this work so that it doesn't run after suspend. > Thanks, > > Bart. > -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, Linux Foundation Collaborative Project