Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752249AbdHHPZt (ORCPT ); Tue, 8 Aug 2017 11:25:49 -0400 Received: from mail-sn1nam02on0083.outbound.protection.outlook.com ([104.47.36.83]:52754 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752059AbdHHPZl (ORCPT ); Tue, 8 Aug 2017 11:25:41 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; Subject: Re: [PATCH v4 02/19] crypto: ccm: use -EAGAIN for transient busy indication To: Gilad Ben-Yossef , Herbert Xu , "David S. Miller" , Jonathan Corbet , David Howells , "Lendacky, Thomas" , Boris Brezillon , Arnaud Ebalard , Matthias Brugger , Alasdair Kergon , Mike Snitzer , "dm-devel@redhat.com" , Shaohua Li , Steve French , "Theodore Y. Ts'o" , Jaegeuk Kim , Mimi Zohar , Dmitry Kasatkin , James Morris , "Serge E. Hallyn" , "linux-crypto@vger.kernel.org" , "linux-doc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "keyrings@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mediatek@lists.infradead.org" , "linux-raid@vger.kernel.org" , "linux-cifs@vger.kernel.org" , "samba-technical@lists.samba.org" , "linux-fscrypt@vger.kernel.org" , "linux-ima-devel@lists.sourceforge.net" , "linux-ima-user@lists.sourceforge.net" , "linux-security-module@vger.kernel.org" References: <1502193834-11289-1-git-send-email-gilad@benyossef.com> <1502193834-11289-3-git-send-email-gilad@benyossef.com> Cc: Ofir Drang From: Gary R Hook Message-ID: <4600c898-a2f2-f95f-15b4-0adcc6acc0b5@amd.com> Date: Tue, 8 Aug 2017 10:24:49 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 In-Reply-To: <1502193834-11289-3-git-send-email-gilad@benyossef.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [165.204.77.1] X-ClientProxiedBy: BN6PR08CA0083.namprd08.prod.outlook.com (10.172.143.149) To DM5PR12MB1323.namprd12.prod.outlook.com (10.168.238.10) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4cd71eac-7e37-4e42-c2a0-08d4de71b977 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(48565401081)(300000503095)(300135400095)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:DM5PR12MB1323; X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1323;3:Nw85kKA1gQCdTlBLnRHnmDvPph1F1enGcT7CIHIoqglo9Rxc//ATTjsa58xNhEpSk+aWAwVJQCtDKpNZ481v23Ui8o/Nsg6ImPnUwXH5bxGmLhWccpvQYOI+TmV8lNBRtkAXpfTAswFkxa50YfT8ccHMYTwzXtr98/nQF8IUDpS3pZvGWJQp+mKquwDJ9qvN4AeVXnUlf08KaPlcPipgwMKmDeCKeyXM5IwYsTqudowB64yuip/Rwubq1XDVCp7J;25:2B5UI35V0bCpIlrqSh6j+UDkjtKwDSbPEVFGOoOqA/NlvvA7a7KwlK8n59LrdHwmKmyuoQKKSOvgY3njfpAGCnbXK9BVnYCtsJcWIpUDCp9GkfQ6uSNLxE7N39TZnCvygv2I4l7V1uVF+R6V+KIHGB5TmDfsN8QJorKyPZl48/5tytW2Pg5YJBKGCDmhDxnZ9vChFOrJ62o0/KCiS3qRP05AmVPCHlqY+3lZvKFjML+3ZQTFYq5IhqmGLYeBAR7Qu138nCl+ZQ2BrQRKNx2Smah7zzVQ5lgcSN1X5B1guy/Ei+Pp34LpnX04ub8NOsxsmeW/DmN+iY0z3gpOw8QBfg==;31:8RBTBDZ2DJu893u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MVo5gG+S/xdX7vK1nODa8dXne/VI1o8lyDorpz9Uvla6h70QpT1XQjSGQ3xP52NfGPQ== X-Exchange-Antispam-Report-Test: UriScan:(788757137089)(211171220733660); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(3002001)(10201501046)(93006095)(93001095)(100000703101)(100105400095)(6055026)(6041248)(20161123564025)(20161123562025)(20161123555025)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:DM5PR12MB1323;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:DM5PR12MB1323; X-Forefront-PRVS: 03932714EB X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(6049001)(39850400002)(39400400002)(39450400003)(39860400002)(39840400002)(39410400002)(377454003)(199003)(24454002)(189002)(53546010)(6666003)(575784001)(86362001)(2950100002)(2201001)(66066001)(65806001)(65956001)(230700001)(6246003)(25786009)(106356001)(53936002)(478600001)(50466002)(105586002)(2171002)(42186005)(31686004)(7350300001)(7736002)(76176999)(54356999)(50986999)(33646002)(47776003)(64126003)(38730400002)(101416001)(3846002)(189998001)(6116002)(31696002)(68736007)(97736004)(81156014)(65826007)(6486002)(90366009)(83506001)(4001350100001)(36756003)(5660300001)(81166006)(305945005)(7416002)(7406005)(2906002)(23746002)(4326008)(8676002)(229853002)(72206003)(2501003)(77096006)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:DM5PR12MB1323;H:[10.236.19.127];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;DM5PR12MB1323;23:Dow9RnjVaywTO4CykJmutO2Y3amwZeMTOqbYm?= =?Windows-1252?Q?UQ0+R4G5jaxgoH6vLdfFwRMIeJcR26Kx7hHDj7XYXRDlTBTf0/dXDiCc?= =?Windows-1252?Q?tHbXOsioUy9Np+rbZh9H7zuhUN5lCjKwVTlF/xPmHdnsl/PRthhv+7g5?= =?Windows-1252?Q?M37vhF77HLYRWUv6YwNyiS+19CeyEmRP/Hyiaw7wbm3lsp1TBXSsvfui?= =?Windows-1252?Q?EwqGVvAu/R55h9GrzMJO7zHKcGP+DHeQ5g9OBGUNDzqymKE292loyJzM?= =?Windows-1252?Q?Ryez/hbls19Dqu5PLaoUCAcYw29ojLAUHMgO6RbSQNSQuuOuUN6PEXhT?= =?Windows-1252?Q?XJ3coG/LzxoPszkycl+V1PrTOREK3reycMaSg8GN8Us8Gu6PCcS9PqIw?= =?Windows-1252?Q?+KaX6QqbznFwpGDXEfDhmBn1HztiitE1yf8yjPis7R7uezuY88DBuwh2?= =?Windows-1252?Q?X3QIPydnhcMsgXi/F5e28K3RVp7CM8UtW0KV9xuoEBwJR/EC4RtPq89/?= =?Windows-1252?Q?Yqk7W9WKK2rT4Tb/Gf7N4qijWxB0q/N+w5rWTUX9m/DSSuAODjjANSGO?= =?Windows-1252?Q?vdNk0ow7j1HqBmqUYASy9rAGaYuZNmPd3WpSagUp1d3bMRuIgY7z2IZ2?= =?Windows-1252?Q?7sGG4YivDL3n56fSeRKvoNYUh60c3c/lqNGWi2/gk13Gig6R3RL/xJUL?= =?Windows-1252?Q?QCj0omQ+ncmq7QsunLTBiZI0RJtt+HxZPDzaFtOyxg+q7GMUaUmnC/eK?= =?Windows-1252?Q?OKWvLrCZHYRFJP662X4YDdENOzerhVIbdsSkFS8XZseE9xj9XxBTms74?= =?Windows-1252?Q?NMKi6IpYTJTayjDSGMYcmR377I583xofWFhXpPWT0UlM/kaJMuCmg5v2?= =?Windows-1252?Q?bSB5nKIez7GP5CuC8fneJdNBM60d+WA/gHyXjlbpcKFGbXysX6wUtyvL?= =?Windows-1252?Q?G52NJs7MhQWVUT2N/4tc25jIlg2IROSSLMlTT+amdyAyl7XkI7LFMM3d?= =?Windows-1252?Q?GLBJlQhQcJZSovBf2ed9N4Vlmr+CGrXysD9YCaoSSO37cA4sB3ZTtPTT?= =?Windows-1252?Q?snTZmPZQ7j2D6sEn2DiAeSLkbjXW9yGhAzAbpOyU2Rl5TLuJN+xPGdBf?= =?Windows-1252?Q?VH5XJqJv5AT5VnXjp93Phl+feJ4Hw02wznj9SpYbidwnfycwEDBj19bh?= =?Windows-1252?Q?FbXx2D4pVSIgpBQilWpxiXkYJCkeDveIBnPQscKcvp2rH9n06XcL8msv?= =?Windows-1252?Q?sQJowDL2zY9f+Uu1GUq3Q7krjgqN0X31p3GVxthjZ403FVlgnvbyP7HU?= =?Windows-1252?Q?BcqxXsCTJtWCJXlfv8dudVZPKFRhrFwfGeZYj5ODkDpfGXgqkPPPU7FK?= =?Windows-1252?Q?dgVZ8to5MLpYde08N8Sxg3FxqZSVvpQ6oisxcX8H6rl++J5f6WsmArfH?= =?Windows-1252?Q?yXq92/6wmNUIJfcK1Ply/K4pMBzXaneJ8+8tSc+PRO8GsYB9TI4MBv8p?= =?Windows-1252?Q?4juaWmJ/aGQ3o0/Imdr58cvDX1YM7XPs2rqjn1uRo+oXEUoEqHpniTiV?= =?Windows-1252?Q?5MOD/O1o8mfb8tUOVQp3HGEx43lubpkh0YCxI2Wh+19RRVUhd0m5vR2g?= =?Windows-1252?Q?5dZTI5UK+TnABWdqI/ZInURqkfA6FfaeITPr86qw9dzxJBBeywwh2rsd?= =?Windows-1252?Q?ZcX9ns7zxhBUIJ3D92vbeBAHmBqLFtRuEe7jUV3Jlj6PfSmK2eLJC9Um?= =?Windows-1252?Q?1jHH3XNTmLXq3ePt9QiIcJfJrtyDms4ehMlsyyfM13363eeFzSqSfdnj?= =?Windows-1252?Q?1aPBwsnf5Em6tuBsmZxpwHvXfzsJTLKol2KTZc1AL930fo=3D?= X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1323;6:IDdzIDpvCxqkx5zH0420apeOYkg011DtSzuLx4TdZogv9lercf5EhgTdiOA/lNzzD6Z0uKJa6siENtxA7g00rlvWXQSar7eKWGODWpDLloTY0d6EeDyITu5UQH9QY0zQ9P5360BWG6rXxv9AavY42LMsGs02uE09B5oY/PZBLPhVD1tm2C4MzDQnyqMvPmr6lMGJB/K18oJQDZULwbirRPOfPJ1SqFyoLR1/HF2mt13yvvt6FO3prEmS7vu6BH6Hzw0JEEIw+r+uxCZIs/3klyoc9jDGes5P1Nk8h4I9/ZyG82rbGLGEke7kHFo1YeHf5wfrqslUtGUmYwXcmtexgQ==;5:W7IbjedAMoSVGpfmmZORtPPeMvCTkA2OZnIVpTUCWjTKq2G6Be7q0qxjmGsknuOBIm7VHh9DgkSWSfrk009Tvx47tkj5jl1K9diiw3Ax++QQ00WHeCIdOuYk9kLNPkCHG/F/1iuIVyD6oEo5Tu0d5g==;24:Vy8NFBIHKdliaULwo1VRJtCRDSt2xRs1VnlqYqH8hUL1Zojbpw6PNa+DOWH3YuDsQmBj1uK8GjAUsrpqP7xu8tqTyHKl+NBSbKpf7XEhouU=;7:vPyNZSX8E01m+bYBgtPCW1yJ3pAMHE3DfteUfnBt4rUa4kER+BgDnwJNoCmJFnOU2Sp9kyPFdYN6jrxH9LQE7Q08d87hoOKmklLWzev0pr4Cotfsk64K0rYoVZtmEuD/h40bPyUVPGMPfHcYxBrUUSs+JmA+3BxBRHLLIUk0PzmuyN5ZJgNhAlR2FdJJkDAzgkwzfEPL6FOzYPYDmMnPDyn9QWGPEYxB6rP5DYCHy4Q= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;DM5PR12MB1323;20:o1w/LdpxowEEMyv+J/kECzksv9QKTHp1S6Az4ln20EV3JoRkF3TCd1Draw+zChzWdivFP2ubDYlF1E+m/7Yi1K4IVUSLdmwO478mqhaMy0w+oBqgaQRIYuUNRt1A5hns5kZoyhzQGyDcx0p8df0a6J26ph6FPaJGms+GPcDl2zA8d92lZiHwxFX8wl+FYXuNyr1ZIo4vbWjW8BZyMtr5lAokjHy2Su4aBKUsQMzNZ/Fk5Dj7PLtCDy+KAZlB0Kcb X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Aug 2017 15:25:36.1949 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR12MB1323 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2104 Lines: 60 On 08/08/2017 07:03 AM, Gilad Ben-Yossef wrote: > Replace -EBUSY with -EAGAIN when reporting transient busy > indication in the absence of backlog. > > Signed-off-by: Gilad Ben-Yossef Could we use "ccp" in the subject line, please? > --- > drivers/crypto/ccp/ccp-crypto-main.c | 8 +++----- > drivers/crypto/ccp/ccp-dev.c | 7 +++++-- > 2 files changed, 8 insertions(+), 7 deletions(-) > > diff --git a/drivers/crypto/ccp/ccp-crypto-main.c b/drivers/crypto/ccp/ccp-crypto-main.c > index 35a9de7..403ff0a 100644 > --- a/drivers/crypto/ccp/ccp-crypto-main.c > +++ b/drivers/crypto/ccp/ccp-crypto-main.c > @@ -222,9 +222,10 @@ static int ccp_crypto_enqueue_cmd(struct ccp_crypto_cmd *crypto_cmd) > > /* Check if the cmd can/should be queued */ > if (req_queue.cmd_count >= CCP_CRYPTO_MAX_QLEN) { > - ret = -EBUSY; > - if (!(crypto_cmd->cmd->flags & CCP_CMD_MAY_BACKLOG)) > + if (!(crypto_cmd->cmd->flags & CCP_CMD_MAY_BACKLOG)) { > + ret = -EAGAIN; > goto e_lock; > + } > } > > /* Look for an entry with the same tfm. If there is a cmd > @@ -243,9 +244,6 @@ static int ccp_crypto_enqueue_cmd(struct ccp_crypto_cmd *crypto_cmd) > ret = ccp_enqueue_cmd(crypto_cmd->cmd); > if (!ccp_crypto_success(ret)) > goto e_lock; /* Error, don't queue it */ > - if ((ret == -EBUSY) && > - !(crypto_cmd->cmd->flags & CCP_CMD_MAY_BACKLOG)) > - goto e_lock; /* Not backlogging, don't queue it */ > } > > if (req_queue.cmd_count >= CCP_CRYPTO_MAX_QLEN) { > diff --git a/drivers/crypto/ccp/ccp-dev.c b/drivers/crypto/ccp/ccp-dev.c > index 4e029b1..3d637e3 100644 > --- a/drivers/crypto/ccp/ccp-dev.c > +++ b/drivers/crypto/ccp/ccp-dev.c > @@ -292,9 +292,12 @@ int ccp_enqueue_cmd(struct ccp_cmd *cmd) > i = ccp->cmd_q_count; > > if (ccp->cmd_count >= MAX_CMD_QLEN) { > - ret = -EBUSY; > - if (cmd->flags & CCP_CMD_MAY_BACKLOG) > + if (cmd->flags & CCP_CMD_MAY_BACKLOG) { > + ret = -EBUSY; > list_add_tail(&cmd->entry, &ccp->backlog); > + } else { > + ret = -EAGAIN; > + } > } else { > ret = -EINPROGRESS; > ccp->cmd_count++; >