Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp738486ybl; Tue, 28 Jan 2020 11:09:44 -0800 (PST) X-Google-Smtp-Source: APXvYqyLldyOIAW2V2uzs3BPHvyQHNfbaEw37Dg7md9xGq79Gh7JVJ3c7Kx0gp/NdOU2o35/U4PT X-Received: by 2002:a05:6830:1094:: with SMTP id y20mr9952400oto.12.1580238584242; Tue, 28 Jan 2020 11:09:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580238584; cv=none; d=google.com; s=arc-20160816; b=h3713o9A42xSrQG5Gf38XSzfCMHT/GTmN09+szzHHqgZXgCKR+UFTF//4S9jay/Pac K+PEo0n8qo4mAqj/cSaK9OudH2h1UTaT2Wjvyou+dq+m9axN0Pjo1sH+heCmbTrcTaON 8GH/MF93iaBhM9qDYDOjkUmECaw5r23MV/ncNto7MS/iv3K5qqyydwYGW1iChTsCS9Dj IJ5sXkZWhPhsxYZtEHbBEc8e7GI62onK5+iEg8xKWftd2DPJ7vJyQEqeDdO6W79tHlAM uGzl/VzTNEJKTGGWl2PVb+Ew76l6k8hMgT1BNe0K0Wr2RGTFXQ6HFISTbQEQ4J6PBEui ZcyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=QIqxp0JJN7STfxqkuk3sNUeRmu59kyRMEQagUozWKAI=; b=P/sK8FdIZt0V7bayARZOaGrEbZZLSySt/zpELr4bfe3WQqGJD2/5ANoT9Uygo6PFky abukhXgEpeaPNYHV3LdT5KLizCzsQIYih9YECN/TSi0H7/mavMD7KICwXXbW+3B7197S gdOVhh/AVQmcGimCjcOxZ02ZFj3nDlMeYmoIOtBrVj3Qiptug2kgRFWSWJZaeAXo85Hd YCeqzj2XTazbZ3ehxEurH41l3z7/wMdroV+qe6MfgdTAiEyk+iloK2iq3cTazGEI7Nh5 inOWX2F7GdbgxSesoKXFQbTojWbwFWNGNiKGp5URgSLt4QGRoxVGWnIwT/Z7OBRRF+MV /IAA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-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 i15si9655198otk.120.2020.01.28.11.09.26; Tue, 28 Jan 2020 11:09:44 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-crypto-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726320AbgA1TJU (ORCPT + 99 others); Tue, 28 Jan 2020 14:09:20 -0500 Received: from albert.telenet-ops.be ([195.130.137.90]:42530 "EHLO albert.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726002AbgA1TJT (ORCPT ); Tue, 28 Jan 2020 14:09:19 -0500 Received: from ramsan ([84.195.182.253]) by albert.telenet-ops.be with bizsmtp id vv9G2100D5USYZQ06v9G3A; Tue, 28 Jan 2020 20:09:17 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1iwWEe-0008Ot-3V; Tue, 28 Jan 2020 20:09:16 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1iwWEe-000616-1A; Tue, 28 Jan 2020 20:09:16 +0100 From: Geert Uytterhoeven To: Gilad Ben-Yossef Cc: Herbert Xu , "David S . Miller" , linux-crypto@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] [RFC] crypto: ccree - fix retry handling in cc_send_sync_request() Date: Tue, 28 Jan 2020 20:09:13 +0100 Message-Id: <20200128190913.23086-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 Sender: linux-crypto-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org If cc_queues_status() indicates that the queue is full, cc_send_sync_request() should loop and retry. However, cc_queues_status() returns either 0 (for success), or -ENOSPC (for queue full), while cc_send_sync_request() checks for real errors by comparing with -EAGAIN. Hence -ENOSPC is always considered a real error, and the code never retries the operation. Fix this by just removing the check, as cc_queues_status() never returns any other error value than -ENOSPC. Signed-off-by: Geert Uytterhoeven --- I am not 100% sure what was intended originally. Perhaps the second -ENOSPC error in cc_queues_status() should have been -EAGAIN? --- drivers/crypto/ccree/cc_request_mgr.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/crypto/ccree/cc_request_mgr.c b/drivers/crypto/ccree/cc_request_mgr.c index 9d61e6f1247819e2..b2a18122f320b7b2 100644 --- a/drivers/crypto/ccree/cc_request_mgr.c +++ b/drivers/crypto/ccree/cc_request_mgr.c @@ -476,10 +476,6 @@ int cc_send_sync_request(struct cc_drvdata *drvdata, break; spin_unlock_bh(&mgr->hw_lock); - if (rc != -EAGAIN) { - cc_pm_put_suspend(dev); - return rc; - } wait_for_completion_interruptible(&drvdata->hw_queue_avail); reinit_completion(&drvdata->hw_queue_avail); } -- 2.17.1