Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5725932imb; Fri, 8 Mar 2019 00:32:19 -0800 (PST) X-Google-Smtp-Source: APXvYqyA6qiy26Pylnqq59wSe4eVaIWjtzcuVCdonNb99tw9yYz75iOBKJZD3IBcJb4+TxRBM6KL X-Received: by 2002:a65:4542:: with SMTP id x2mr703359pgr.65.1552033938890; Fri, 08 Mar 2019 00:32:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552033938; cv=none; d=google.com; s=arc-20160816; b=KLFdX6i3aWSY36UxRVU6QBBPOJkprPPfqPeGz/kMNZW5GqzrYjJfLuACTLnfvtsV86 NeKYm4zR89vvdg31ID8e3AwLxSanBL9ckIJjDIUzFWkC9CMMTd+ft+UauLU+6m1vWPGt QEWE8ggYWJBZiyGBTdtaYAlYO9PPBLARPDYCtmTa3tE2Yc+eiyR6WjTetkDwZZ35ywKk bgKgH3ZKoczbhUlpnAgcYm/+BpvxuVep2c/J+pHEU3ja06WbhoTua3fZDitwXj43vv03 pA2cVsi0ZdCXtW/QkSRz/2O8GcPMJaJPidMrjfj1m+FFKzmF8AEKFfyAo2M7UZ4VWrqv B+gw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature:dkim-signature; bh=BCD6HfWp6nUIYULDxT51l/twKUrq6gm4teh4lyxCYaE=; b=XZmaMIGs7Qtah02VM860hEC4G1QThjw/itxF5tyAEPLWC4sOQd0kxOhFSBWSPHbR0f r200i7P14sX1bqYtna4Tlqnyg4avGidG+NOKIYT11ao6smPmrozVgxiH9kvjFqy7hK8W 0/dzqRjAEsKVB1gEe+3rCxQseMF4AKBRhgsH6PZxmdK8PAi/bsla3jWEhjKEYjg2sS0o udMEIzHz/okaUZ7tPRP3VrkPlWqlHlqwWcwnFFy61f9exS272ipHPvlFQygoxSJ+di81 hTuL/wMziJM149vFqxDFFU+eYZQPU8BfhTf8qVxc4DqNiEPbZlp2Eyfj0mBTeyq8HWPe 6VbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=N8IwpfFg; dkim=pass header.i=@codeaurora.org header.s=default header.b=EX9fb90B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bf6si6323452plb.106.2019.03.08.00.32.03; Fri, 08 Mar 2019 00:32:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=N8IwpfFg; dkim=pass header.i=@codeaurora.org header.s=default header.b=EX9fb90B; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726428AbfCHIbe (ORCPT + 99 others); Fri, 8 Mar 2019 03:31:34 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:35498 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbfCHIbc (ORCPT ); Fri, 8 Mar 2019 03:31:32 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 241AF6115D; Fri, 8 Mar 2019 08:31:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552033892; bh=j1iOA04Ibk3v4AjlnxxPfgJEJJzv6dGyDzSn6fvInw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=N8IwpfFgApnZTkY/feOyX7NUSHh6WJ6EtFwUWsJXubE6RTQOOTdjBh7ARyakf5FKH ZxHSpVQG9jTtKTa0+zaAdP5z1RjDsOUfBNPmJPo5uDdImW7/UEfvIK/NAczipjWBrQ RputmITJIUedq/6DTA4KO9nwNM4ei2m/MLm0zfJs= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_INVALID,DKIM_SIGNED autolearn=no autolearn_force=no version=3.4.0 Received: from blr-ubuntu-173.qualcomm.com (blr-bdr-fw-01_globalnat_allzones-outside.qualcomm.com [103.229.18.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: rnayak@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 01BE061155; Fri, 8 Mar 2019 08:31:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552033891; bh=j1iOA04Ibk3v4AjlnxxPfgJEJJzv6dGyDzSn6fvInw0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EX9fb90BIN4TSlTo3AJ9bqbXn4EQDaikr3yBZ7ql6lHCx63UGTeoXtnZ929kWaLvK G1IuTWmU/RZOUeUNWamOgF4XxOd9rWaoiQhUskODvIAlKYc3QNisKDi8xwU6vXZ22i PgWsiRWTiSjXZzCMerIPF0Qb6JY8c44e7P7ItW9s= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 01BE061155 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=rnayak@codeaurora.org From: Rajendra Nayak To: vinholikatti@gmail.com, alim.akhtar@samsung.com, pedrom.Sousa@synopsys.com Cc: subhashj@codeaurora.org, asutoshd@codeaurora.org, linux-scsi@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org, Rajendra Nayak Subject: [PATCH 1/3] scsi: ufs: Fix runtime pm handling in ufshcd-pltfrm Date: Fri, 8 Mar 2019 14:00:51 +0530 Message-Id: <20190308083053.30631-2-rnayak@codeaurora.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190308083053.30631-1-rnayak@codeaurora.org> References: <20190308083053.30631-1-rnayak@codeaurora.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org runtime pm calls as part of ufshcd_init() can trigger a ufshcd_runtime_suspend() which always fails until the point we do a platform_set_drvdata(), setting the devices 'power.runtime_error' Use pm_runtime_get_noresume()/pm_runtime_put_noidle() to prevent this from happening. Signed-off-by: Rajendra Nayak --- drivers/scsi/ufs/ufshcd-pltfrm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c index 895a9b5ac989..974441fa4e75 100644 --- a/drivers/scsi/ufs/ufshcd-pltfrm.c +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c @@ -340,6 +340,7 @@ int ufshcd_pltfrm_init(struct platform_device *pdev, goto dealloc_host; } + pm_runtime_get_noresume(&pdev->dev); pm_runtime_set_active(&pdev->dev); pm_runtime_enable(&pdev->dev); @@ -352,12 +353,14 @@ int ufshcd_pltfrm_init(struct platform_device *pdev, } platform_set_drvdata(pdev, hba); + pm_runtime_put_noidle(&pdev->dev); return 0; out_disable_rpm: pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); + pm_runtime_put_noidle(&pdev->dev); dealloc_host: ufshcd_dealloc_host(hba); out: -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation