From patchwork Tue Dec 6 03:25:15 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: subhashj@codeaurora.org X-Patchwork-Id: 9461951 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 8B0C960236 for ; Tue, 6 Dec 2016 03:25:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7A483282F5 for ; Tue, 6 Dec 2016 03:25:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6DE0828306; Tue, 6 Dec 2016 03:25:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C4BB628304 for ; Tue, 6 Dec 2016 03:25:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752016AbcLFDZX (ORCPT ); Mon, 5 Dec 2016 22:25:23 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:42302 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751932AbcLFDZV (ORCPT ); Mon, 5 Dec 2016 22:25:21 -0500 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 391CB61664; Tue, 6 Dec 2016 03:25:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1480994721; bh=eSFiKvHrI1mmCfPTYlN2rJNeQ7XOhzvytw+FUapLi7w=; h=From:To:Cc:Subject:Date:From; b=GQFYOc0oXBtIpXADXmn9Jcqr9EyBY47QDNbfCJSyLDyMU3HLcLZjhwok/A5weeDBL GARW3jViloZ2Zb3t4WHya6WWgv/wfrHsyr98jz2spd8Az+QxJ+ckHMuZ3tgV+H3Zlk FgSH5YGnmjkJyylyBfRyYg/IdyIuhTyvVX/LIwRY= Received: from pacamara-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: subhashj@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 2E74C61653; Tue, 6 Dec 2016 03:25:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1480994720; bh=eSFiKvHrI1mmCfPTYlN2rJNeQ7XOhzvytw+FUapLi7w=; h=From:To:Cc:Subject:Date:From; b=TJ5Mg0MFQm/vKV7jJUF75yhy7aqWoClHxFQTr+3vCW1xGiL+HU7I2UfP0u0Z9nDZg R5bBzIhzUq/oz8TpYdw+eoh0MzCmJLARAfEjIEpTYsDzk+efT5cYj8YKWnYmXYCgIF ZRgrK3GlW19p/4ZucLVm/sKmMaVwJFT2gttlEoow= DMARC-Filter: OpenDMARC Filter v1.3.1 smtp.codeaurora.org 2E74C61653 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=pass smtp.mailfrom=subhashj@codeaurora.org From: Subhash Jadavani To: vinholikatti@gmail.com, jejb@linux.vnet.ibm.com, martin.petersen@oracle.com Cc: linux-scsi@vger.kernel.org, Yaniv Gardi , Subhash Jadavani , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v1 2/4] scsi: ufs-qcom: add probe_defer in case phy driver not probed yet Date: Mon, 5 Dec 2016 19:25:15 -0800 Message-Id: <1480994715-19658-1-git-send-email-subhashj@codeaurora.org> X-Mailer: git-send-email 1.9.1 Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Yaniv Gardi In case UFS driver is probed before the phy driver does, the UFS driver should return a PROBE_DEFER code. Signed-off-by: Yaniv Gardi Signed-off-by: Subhash Jadavani --- drivers/scsi/ufs/ufs-qcom.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/ufs/ufs-qcom.c b/drivers/scsi/ufs/ufs-qcom.c index aa43bfe..ff61461 100644 --- a/drivers/scsi/ufs/ufs-qcom.c +++ b/drivers/scsi/ufs/ufs-qcom.c @@ -1194,7 +1194,16 @@ static int ufs_qcom_init(struct ufs_hba *hba) */ host->generic_phy = devm_phy_get(dev, "ufsphy"); - if (IS_ERR(host->generic_phy)) { + if (host->generic_phy == ERR_PTR(-EPROBE_DEFER)) { + /* + * UFS driver might be probed before the phy driver does. + * In that case we would like to return EPROBE_DEFER code. + */ + err = -EPROBE_DEFER; + dev_warn(dev, "%s: required phy device. hasn't probed yet. err = %d\n", + __func__, err); + goto out_variant_clear; + } else if (IS_ERR(host->generic_phy)) { err = PTR_ERR(host->generic_phy); dev_err(dev, "%s: PHY get failed %d\n", __func__, err); goto out_variant_clear;