Received: by 2002:a25:1985:0:0:0:0:0 with SMTP id 127csp2579623ybz; Sun, 26 Apr 2020 23:44:00 -0700 (PDT) X-Google-Smtp-Source: APiQypLadnOwOfRDQGSvq6vomstL1Ooqo6x3zVwq2XuKf8MSq7rSdOX36YJILMAwBQY6yrfmsN8j X-Received: by 2002:a17:906:2f8f:: with SMTP id w15mr18729334eji.255.1587969839900; Sun, 26 Apr 2020 23:43:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1587969839; cv=none; d=google.com; s=arc-20160816; b=wFuxcrtjCFHRzDxbUH8ZuqhfEVtNOJwwSe5k6/+03E7L2RrRKDaRc5YbRM7Oz5v8oP G1zqRU/bLs4OaqzsSivxNMAuCYtBQyZxSKGQl2f3R6S9Acblayhy2/KaFCMVBKHx6DNg XW+1hU7fCqucblMlODytJOlejVKIhK8RySyVzNcubnovfK56/oHfirWo9vxiuDUZRPGb T8r8MT9f57P/d5bu/fTlaPt2kTiamaoQ9UYrPA6LdUEBY5fqtMuZWegGea0VKnkNmNgt 9zAyCdPXmbINhClvYaycUtf4OW6qlr9/7EaxoLtGyKFnRqpsGMsLlvknbdFUTQLfgo17 zuBg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature; bh=tCfxJ7AYA01s98UE4V0m7JDke4Id5IZKext6NMmW5s4=; b=gpYNDjcVZ+QhQEmPvxDNZDR+M4V6fUzPo6h9FBvtFT8wC/QRuQzF5tL0AXmkYqkPwU NhsneV2+VYejon+ofviAhQtitWzHCxZnzyaJx77oS1TFXTHcI604MusdHuZHxEsQpskj ShlIfgkE7OctvZXTZHCdV7kArDXT8FlbZQak/IOOVHtucL4oopzyGDwvQKsAfW+LUAWX X3fjE/rhvYiwfaWFexROM+knIfHB27EVIHaOY2XBezicFwtDOKrYvKD76geanEwsY3iG frl2cjr280joi8zKwYb4aUXol8ByhjUHoWUgZiyALkyU5vdksDAIYmNvZv2QKXvpcYe9 FWLQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@st.com header.s=STMicroelectronics header.b=kIGb4VL+; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id i35si7720114edc.308.2020.04.26.23.43.34; Sun, 26 Apr 2020 23:43:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-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=@st.com header.s=STMicroelectronics header.b=kIGb4VL+; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=st.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726246AbgD0GnW (ORCPT + 99 others); Mon, 27 Apr 2020 02:43:22 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:35966 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726537AbgD0GnV (ORCPT ); Mon, 27 Apr 2020 02:43:21 -0400 Received: from pps.filterd (m0046661.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 03R6cFpq024199; Mon, 27 Apr 2020 08:42:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=tCfxJ7AYA01s98UE4V0m7JDke4Id5IZKext6NMmW5s4=; b=kIGb4VL+fyuhhQWMEYWLDDOnc4kVtN9LNk+6HKks+iQb5vaDh1XQhetQ0NkZZVRzzQiS HdkxMrvx+iFBO1Z93KBwZXFRf9cmlfNja7NaaMTlvuiUmMnBIiXwjuG5yGIAIhRw5WaU 4ItH9on/vWyzuhF8eTD4nwTe3F3fkQbep9DEMKg9rp9MXjHwI5CBKTd52T2E2StxZGhV NsGM4SsVdQDyRK7xtMy4X2mRUK/xfv6zDvjyq409TidiDLoS1hxhloZMNmEO2yJGv12b jxK9oRDsfpxM0dRwqzrHv2jlJ743O9Y9gFkJ4F4q2bg9jDYrtQkjEFPTrrVIujmvcCWd lQ== Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 30mhjwg3gr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 27 Apr 2020 08:42:58 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 47134100038; Mon, 27 Apr 2020 08:42:56 +0200 (CEST) Received: from Webmail-eu.st.com (sfhdag7node2.st.com [10.75.127.20]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 34F5921F67A; Mon, 27 Apr 2020 08:42:56 +0200 (CEST) Received: from localhost (10.75.127.45) by SFHDAG7NODE2.st.com (10.75.127.20) with Microsoft SMTP Server (TLS) id 15.0.1473.3; Mon, 27 Apr 2020 08:42:55 +0200 From: Lionel Debieve To: Herbert Xu , "David S . Miller" , Maxime Coquelin , Alexandre Torgue , CC: , , Subject: [PATCH 1/3] crypto: stm32/hash - defer probe for reset controller Date: Mon, 27 Apr 2020 08:42:24 +0200 Message-ID: <20200427064226.6991-2-lionel.debieve@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200427064226.6991-1-lionel.debieve@st.com> References: <20200427064226.6991-1-lionel.debieve@st.com> MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG7NODE2.st.com (10.75.127.20) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.676 definitions=2020-04-27_03:2020-04-24,2020-04-27 signatures=0 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org From: Etienne Carriere Change stm32 HASH driver to defer its probe operation when reset controller device is registered but has not been probed yet. Signed-off-by: Etienne Carriere Reviewed-by: Lionel DEBIEVE --- drivers/crypto/stm32/stm32-hash.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/drivers/crypto/stm32/stm32-hash.c b/drivers/crypto/stm32/stm32-hash.c index 167b80eec437..fad6190be088 100644 --- a/drivers/crypto/stm32/stm32-hash.c +++ b/drivers/crypto/stm32/stm32-hash.c @@ -1482,7 +1482,12 @@ static int stm32_hash_probe(struct platform_device *pdev) pm_runtime_enable(dev); hdev->rst = devm_reset_control_get(&pdev->dev, NULL); - if (!IS_ERR(hdev->rst)) { + if (IS_ERR(hdev->rst)) { + if (PTR_ERR(hdev->rst) == -EPROBE_DEFER) { + ret = -EPROBE_DEFER; + goto err_reset; + } + } else { reset_control_assert(hdev->rst); udelay(2); reset_control_deassert(hdev->rst); @@ -1535,7 +1540,7 @@ static int stm32_hash_probe(struct platform_device *pdev) if (hdev->dma_lch) dma_release_channel(hdev->dma_lch); - +err_reset: pm_runtime_disable(dev); pm_runtime_put_noidle(dev); -- 2.17.1