Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp130346ybk; Tue, 12 May 2020 17:38:55 -0700 (PDT) X-Google-Smtp-Source: APiQypIdYzCINNSj2FeJG8l668lK4Fg/jbu132UBmTZPPDRbVIhcCLC8TH6n6/d1QFKCiN+JHQPu X-Received: by 2002:a17:906:328f:: with SMTP id 15mr21330054ejw.33.1589330335146; Tue, 12 May 2020 17:38:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589330335; cv=none; d=google.com; s=arc-20160816; b=Utk5d+Q9EHeeJyWCu9wkFFpg1I7kmzCSkvePop0ar38W82tyn0nCTT0Mlqy5BCAkGU 0SSJRQUnBSjEBqxm6N1RfoFmBrSdiXjF+ZvcgyC+zRix3qWpir1K8djL2SsuIVKJRRf+ gNCNhHlUlE4ss+5q0IzLYvy0oV4xT8MRLboWRKl9/AAlgIrMD5YR+aged0GNz8UQjl7w GfC6VYTvpgWuhP5vgtlmiRohTLkREcqiEnKWW87d8ha6APLuQwnuOlDiu/hLgEqG7Zap vIHG354iMREpxAnYX3IiYiIUZDSAk+RIe1RxvTt9Z91sbRb+0pu6dZBJNTwcSyPxtkf8 By8g== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=3b7cXzUOwV7k5MdxilVeud6NPCnUSm8k2Dup6VE1hOo=; b=lO5AP0Ds+bnoaOvnpL0SnaRq0tFd9p2RvvwkG2y1jsMP4OhYRuwURJNoSR66BPj5Bq DEmv9Qf1FJBuuEb1ykeq6V4wiZXdY3tbg4nUTKv7jrqYnQtPg6ytGS1UAFru/mxc1usW /rRtToLvrnwc4DeLmmEjH/PHqsyi5J0TSnd5XDrTVuqrUlQ1vhvfUnEbur2C/YXWVeKI Yflo+0Slr4yqwzLiImhDJuMruyQI+T8lZjUoCERV0A4TBMsuFl1Ozg3O1wfFcFRiVJ0D J6PqW/Vm5L4sE+WRjD4rPNAI/W4L0VD+t+4egV0VegQWQLXRCDL727WlVa9FHd5FPP3Q W2sA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="YJ3SZjp/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id du1si877353ejc.474.2020.05.12.17.38.23; Tue, 12 May 2020 17:38:55 -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=@gmail.com header.s=20161025 header.b="YJ3SZjp/"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731604AbgEMAef (ORCPT + 99 others); Tue, 12 May 2020 20:34:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47788 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726031AbgEMAef (ORCPT ); Tue, 12 May 2020 20:34:35 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ECF0BC061A0C for ; Tue, 12 May 2020 17:34:34 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id v5so8019407lfp.13 for ; Tue, 12 May 2020 17:34:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3b7cXzUOwV7k5MdxilVeud6NPCnUSm8k2Dup6VE1hOo=; b=YJ3SZjp/PvbbbZvzZyzfmQsW9Y53kPUVFsP5VkvI0THSYWlfoRjUF59amVO5tKSmel Yv+MtcelqebcIlruvQeBFzA2HDinVU/4d79Ii8Is47Wv8anNXrGeDvWjMoplIQMSLy8C rt5P70fnQk378GfTjGjRsKDUu0Zzp7qBrovdjPwXsjY4Dog0hOkErTm9kPHY6/dx/01m 0MTuMnFtygm8tX5Jb/oeAiRuSaG+R5kfUotEK17HQTxBnRU+cQrcjfXhPdLvkBnS5Wth Di0JX9Z08s7ufZcM3FPwn/dTJiYy/uqdiWDaPNWseSqHbhdFQdfC94W0p6Gejq8Z+v9G pPgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=3b7cXzUOwV7k5MdxilVeud6NPCnUSm8k2Dup6VE1hOo=; b=QwPyAA7v/xgFotpX/AH71ND4WBuEfnKM+zA+MRwcu4Utwzf5VFf9J84mKH82qXf4k3 Enq95MEVp0Y1gt2wkhoCLNZtt8GC6OTM6qKG6sj66i9uVt4aeI9+OQHXupIVcb6p+UHu bZxzakGrc4lg0BREE/DMcAsVzxPi99dwEgyLeDOxGRJSgbMEojKgu0qgD8Wnb4dSndOp ofVapMG/Aeb0mw2z9+M7O2zOeL6NWodn4wqEnnr6UzHXkTFgqeSe0JknSFz7vQPTzqR8 HbRwLfNn21+EDLdZ8eujWkU7KkseFyq6HnVFOH2CN4SKjZqYHrLozBUM6taFBmyXR4Gk 6RXQ== X-Gm-Message-State: AOAM5308tpqqbcnl8teYKxH4a7Vs7n/vj7oJh1SRszNE+Anos+bArquo NnLyKiYo+a8qYSOXHd4BcGmVQQWb X-Received: by 2002:ac2:5f73:: with SMTP id c19mr15949805lfc.135.1589330073465; Tue, 12 May 2020 17:34:33 -0700 (PDT) Received: from EPUAKYIW2556.kyiv.epam.com (ll-74.141.223.85.sovam.net.ua. [85.223.141.74]) by smtp.gmail.com with ESMTPSA id s7sm14236871ljm.58.2020.05.12.17.34.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 May 2020 17:34:32 -0700 (PDT) From: Volodymyr Babchuk To: Jens Wiklander , linux-kernel@vger.kernel.org (open list) Cc: Volodymyr Babchuk , Volodymyr Babchuk Subject: [PATCH] optee: don't fail on unsuccessful device enumeration Date: Wed, 13 May 2020 03:34:30 +0300 Message-Id: <20200513003430.651232-1-vlad.babchuk@gmail.com> X-Mailer: git-send-email 2.26.2 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 optee_enumerate_devices() can fail for multiple of reasons. For example, I encountered issue when Xen OP-TEE mediator NACKed PTA_CMD_GET_DEVICES call. This should not result in driver initialization error because this is an optional feature. Thus, it is better to print warning, instead of termination driver initialization. Signed-off-by: Volodymyr Babchuk --- drivers/tee/optee/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/tee/optee/core.c b/drivers/tee/optee/core.c index 34409c916882..a053930032f2 100644 --- a/drivers/tee/optee/core.c +++ b/drivers/tee/optee/core.c @@ -728,10 +728,8 @@ static int __init optee_driver_init(void) return PTR_ERR(optee); rc = optee_enumerate_devices(); - if (rc) { - optee_remove(optee); - return rc; - } + if (rc) + pr_warn("can't enumerate optee devices: %d\n", rc); pr_info("initialized driver\n"); -- 2.26.2