Received: by 2002:ac0:aed5:0:0:0:0:0 with SMTP id t21csp5725973imb; Fri, 8 Mar 2019 00:32:22 -0800 (PST) X-Google-Smtp-Source: APXvYqx+WzJZC21SvnemR0KjB+yTyD0v/ruEprN7xC49AyB4ZgqRkk84G+DHnmGyPh4+N97WQwgT X-Received: by 2002:a63:2bd5:: with SMTP id r204mr15832331pgr.48.1552033941917; Fri, 08 Mar 2019 00:32:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1552033941; cv=none; d=google.com; s=arc-20160816; b=VI9OTRGRNPcVTlmt8WB1LJN8LBzW+cDt+i67Q9UIAbyxpvDk5wa5XgsC152BmcGqSo JFKP4JZ5imzuYmdFG8FgkKUvKITg4zBGhcgukFy1oa/T/MtgFy3cWAZUQnS7xbqsVIDn KN7+a7k98n+iSL0dnFK3bsmUSNAT93pB6itc12L0CuDtuCAsBqZ7kAR4+6f25l8tcGKo z7t04WSCH6Sc6WJe/kPTjL4/P0uB2Zj8LdClKolzCa+gUjyOigGFxLnZh0SEqS4aZzJG 65CH+0a1IsJQX5qr5bz/Sw7TqfgoAnPq3ig151xOhpTEDCWOD8pVuWFSblvL9O23kgsq KB6g== 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=tQzGf6eDVPAhgIdJqjvLAkutth18DaShowyqu6UzxeE=; b=bt0hR/OYv5iimYeVl1ISp1IvjQF1KUvXTXZRB0lE8/j8kkTKG2JEH+STovvFhHG7x3 wqnEzCoeia06vPG+WI2yTEk9lDZa7EtrKNu5L7woTqYIYCJIk2mbnkf4wZcN8wFlMByu wNttF651if0TAZjF4N7mwlOH5HfqRMDFWTEUsMGdMwauHCox8/Vic7iwH8vvHIf7u2UF fncFOyjUNmUdV5nk+YjQgRVxqDApHUvlhUGQ1oaxUpAXe1VlyYFnDmV01h58qVJAjbR9 gV9xMZgLOAm+TPJp1xQeBzovhdlVBzgDisl2WgRd0vULp0FBvEhLxQidx8sauSqPTubR CyVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=KnFYCLJW; dkim=pass header.i=@codeaurora.org header.s=default header.b=QNhzKf7I; 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 u14si6058334pgh.561.2019.03.08.00.32.05; Fri, 08 Mar 2019 00:32:21 -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=KnFYCLJW; dkim=pass header.i=@codeaurora.org header.s=default header.b=QNhzKf7I; 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 S1726463AbfCHIbh (ORCPT + 99 others); Fri, 8 Mar 2019 03:31:37 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:35688 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726323AbfCHIbg (ORCPT ); Fri, 8 Mar 2019 03:31:36 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5EF6D60386; Fri, 8 Mar 2019 08:31:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552033895; bh=b8MtlD+7/yGM3Lr8HhhhyH/yYBErhCRMJVXsCSAyx0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KnFYCLJWnb5yFdO0Why/MTY2vTdUWsC3oVCO0wIaCDgYLM48Z2ZZzbbeEXQQWbpxu g0NaTPBJ1VZ3RZjjPPBMffDr/Gju9wiKBrNt6/h5RJCRXbPtMebwnl5Gcw/cAkCe2j Cr+ra7iQs1GZmqM5XY9Khz3Z6mJ3h9VpWeysVkMk= 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 1E29260386; Fri, 8 Mar 2019 08:31:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1552033894; bh=b8MtlD+7/yGM3Lr8HhhhyH/yYBErhCRMJVXsCSAyx0k=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=QNhzKf7I8Heq3AHUlsH//wjoQhlUbA+Ecg+liLAO3Jg0XGCuxW2ZeUwgVcy95wplX /y0pL43n8wjWlYOO5aTDBViJ4ClX95iGURJa8M2QxmZ30LTr/lAUggmglmZ3Q4kfU2 iSPXc3ehtHELBWMBcjSHjnKYE4OYCuQFw+S4BU50= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 1E29260386 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 2/3] scsi: ufs: Add error checks for pm_runtime_get_sync() Date: Fri, 8 Mar 2019 14:00:52 +0530 Message-Id: <20190308083053.30631-3-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 Add an error check for pm_runtime_get_sync(), ignoring this can hide issues with the runtime pm handling in the driver. Signed-off-by: Rajendra Nayak --- drivers/scsi/ufs/ufshcd.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufshcd.c b/drivers/scsi/ufs/ufshcd.c index 2ddf24466a62..060dc38cc582 100644 --- a/drivers/scsi/ufs/ufshcd.c +++ b/drivers/scsi/ufs/ufshcd.c @@ -8357,7 +8357,10 @@ int ufshcd_init(struct ufs_hba *hba, void __iomem *mmio_base, unsigned int irq) } /* Hold auto suspend until async scan completes */ - pm_runtime_get_sync(dev); + err = pm_runtime_get_sync(dev); + if (err < 0) + goto out_remove_scsi_host; + atomic_set(&hba->scsi_block_reqs_cnt, 0); /* * We are assuming that device wasn't put in sleep/power-down -- QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation