Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752408AbdHNQ4z (ORCPT ); Mon, 14 Aug 2017 12:56:55 -0400 Received: from mail-co1nam03on0042.outbound.protection.outlook.com ([104.47.40.42]:1048 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752147AbdHNQ4s (ORCPT ); Mon, 14 Aug 2017 12:56:48 -0400 Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Gary.Hook@amd.com; Subject: Re: [PATCH v5 02/19] crypto: ccp: 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: <1502724094-23305-1-git-send-email-gilad@benyossef.com> <1502724094-23305-3-git-send-email-gilad@benyossef.com> Cc: Ofir Drang From: Gary R Hook Message-ID: <28b9a7d4-d329-bb1e-d4eb-6530795eaa0b@amd.com> Date: Mon, 14 Aug 2017 11:55:44 -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: <1502724094-23305-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: MWHPR14CA0015.namprd14.prod.outlook.com (10.173.227.25) To BN6PR12MB1313.namprd12.prod.outlook.com (10.168.228.7) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c9f87944-a177-48f6-818c-08d4e335701b X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(300000502095)(300135100095)(22001)(2017030254152)(300000503095)(300135400095)(48565401081)(201703131423075)(201703031133081)(201702281549075)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095);SRVR:BN6PR12MB1313; X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1313;3:KvYhH5RfCKaOIdAnmFnDLPvNNChavKjdKHPYyTweWrfJEQL2BDjwBP3qOhLe7cPvCwBIgOAr5kMJqL/oV6FidRl/4l8IvpI7Y9QeEgEfONgl3VAWRb+Btlk9zN553bkUByH5j8btD15eHWKv85yHM9ck4fiVJnbvg2UI2PhiwOKoqoxv8XGwMgSyrwc9T0KmSumCteo0yGxpYmB91eybuPfBTHANv/GBLwaWKzuTHEIMxOOZroKkm0oDbN1tvBlg;25:0Mx7wikvUZ3yxieLBwpRzoiCUQQ2gUGvmmxYDf6JeYJvpNSkdF4rV5v6BSmp/DQtmiSIIGo3AVGyeDSkPSGBfAXvaJvyTy1b1VGtwayrnvsR8ri40iiUyKmtfb0DnKNGllQOGCpZIVzKWG842atocdMT9eh9p7zSR2PlMY75eZn3q9wp2vBtezZGS591oTONJFBA+vZqcYqZXZOs2aCX+wfB9NLWihbWuHYPRI1HiPDZM/p4JswSPrnm9++xhPW0AAxnC52qGnMtIoGvwG7pROYGmsW/jJi9+lihO5oM3lEby6l4IRIfGnOqwYv7njmvEaXpcgvWqhudcoBC479Uqg==;31:L/72qRx6tJD7cC6jhJCfPxXN2VBR5FUlZlg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evk3M9EdzcHFVL3nW5pZ3i2zA6X0Pb2VZY12nOY5dyEnb6m1x737rWgkytLVpxIdce+HVDaM= X-Exchange-Antispam-Report-Test: UriScan:(767451399110)(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)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(3002001)(6055026)(6041248)(20161123564025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123560025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095);SRVR:BN6PR12MB1313;BCL:0;PCL:0;RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095);SRVR:BN6PR12MB1313; X-Forefront-PRVS: 039975700A X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(4630300001)(7370300001)(6009001)(6049001)(39860400002)(199003)(377454003)(189002)(24454002)(86362001)(6116002)(2950100002)(575784001)(3846002)(7406005)(101416001)(229853002)(7416002)(23746002)(4326008)(76176999)(68736007)(6486002)(90366009)(33646002)(50466002)(77096006)(478600001)(106356001)(7350300001)(50986999)(65826007)(105586002)(2906002)(54356999)(6666003)(64126003)(31696002)(65806001)(66066001)(47776003)(230700001)(8676002)(65956001)(42186005)(81166006)(5660300001)(81156014)(97736004)(305945005)(53546010)(25786009)(2201001)(189998001)(2171002)(31686004)(83506001)(7736002)(53936002)(2501003)(72206003)(36756003)(4001350100001)(6246003)(921003)(1121003);DIR:OUT;SFP:1101;SCL:1;SRVR:BN6PR12MB1313;H:[10.236.19.127];FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: =?Windows-1252?Q?1;BN6PR12MB1313;23:/6fjZi1J/QkNCFpAssY7zdJXQmJ3zpr3hMCYk?= =?Windows-1252?Q?AJtm2rb2Z90bKCIZDebuBN18Bdeko5saDsiild6ww+ieNOMfJqRFujqa?= =?Windows-1252?Q?8tL4+Sc4ECFK+CC/dEy2kX5HTwR8ZUW3HODk5d7fy/IirjCKcdMFJ1hY?= =?Windows-1252?Q?7y1HswkL0SBsqFiQ4qC3ZhHMCvg9rdZo5ggeHRdakozfjw5eifOXQsUf?= =?Windows-1252?Q?NWDxHxaGIPByzJeADrcXg80fu2l5nSvPBpCvUvG0QOq2kGvYE7/tJodj?= =?Windows-1252?Q?jj8Sd4OhG0aOedKHHaa+Y7bjPBvnEKWv35xrPVFnWqKYPKmc5Lk2YIe0?= =?Windows-1252?Q?F5TcE51DYoqCD+ihj8WefpAMO5irLdJaQBK95MreHgsrXOb5tU3+qJqL?= =?Windows-1252?Q?n+NAfCcBP+GJZdr+1XwJOKjCQ9oZ+porYBxCUPjl4ZLPOc1Di97/n0VO?= =?Windows-1252?Q?WLJSISdY9C0VhShnv+4C0Vh6wonm0pEzdMeyLwUrM76g+zcrlEyhBWdN?= =?Windows-1252?Q?/Rpv6VkGMneeHQv06j9n4b2toSTkN+iYssJVe3wR2tKrmBBfs67I7YZ8?= =?Windows-1252?Q?A0ROFKNa6YesQaxm0zWiTCubxA4Blu+fNNMbtCLHRQFv1XgKgwa2P1Pi?= =?Windows-1252?Q?wB9SHtEmo9kXVXpLRwqimM+1P9C+ZfodGy7GKcygqlWAifCOQsTd9083?= =?Windows-1252?Q?LWwdFiClk7NMlhQLSw8CKoTu+2FfgDAY8v3Hi/47DnC6RyA13k273IYB?= =?Windows-1252?Q?hYwyocKrf+FvvMGhGdLwuXURJGnig9cA7W0qdyk/rJMNp51wfP4ZMQ85?= =?Windows-1252?Q?Nw+iB3LgR4jzlXeuIcTbDJ/CXrXfOSJEQEmxmDhTS2XCIAlgIoUAIkT5?= =?Windows-1252?Q?0f4zAjRQtqrjGDcILxmIp039Ph0U+LP405Lha7qUspnTnf/71EH2JlQT?= =?Windows-1252?Q?dBC9ui+wyteZr9G7D0IRiWh/Q96bx4DvF1MtHvkrDVr250xg/AOzhRa9?= =?Windows-1252?Q?mQCeBTkuZsGII0jiKFaOgv6f83haMcplkwynw//0QZPBT37VRjdlneFr?= =?Windows-1252?Q?wY4dVLYNNqs/HBcBUzVVkN1PA1J09lZNEIZpTkgmqj0phPOvs1P0a+dX?= =?Windows-1252?Q?LQr9kUPo22sAt56UDZ1Xxs3dSUv5cBnx/O8FUNiMajY3GHhTrBa/VT1z?= =?Windows-1252?Q?yBwLEiTWFatRmxRVYwjcrz1+NgzbuGVu7PMo/ybaDNTZ1dOgHbfuxEFr?= =?Windows-1252?Q?FvyTeaJtViiWAT/ygKoGHmHMxCjLy1CUSDwan+n1CXuFof6iAb6/3Jaz?= =?Windows-1252?Q?4T/PkIkBsYXz9YjZPPVzJ9B2srURzEHQkHvcT/1NS1N8E5cCyoFmWfyy?= =?Windows-1252?Q?fvsJ1MaUtkQrRyCTyGl9Mww/lkSDKdtTrR+an47q3PYZPCpY30ZpaAl/?= =?Windows-1252?Q?zuRuGxRIxGtNiJ64q/GOTKBMaWozs5cyyXK5ivZr51k465Oui89TQgBD?= =?Windows-1252?Q?qIBQLWgI7jvadhINlDs46M8VHZSF4nrpt2dM9ZHhgnEWc4DAa39PpyjT?= =?Windows-1252?Q?0N8kvbfN4//lZbQrrBBTSnwG+ZgE15HdWy5QEsisTtDbMox7vrqZ+jRf?= =?Windows-1252?Q?/GALZ/nS2cBQO9eH499NfZwMPfpla5Zmo2Imy1F30d4+46JHk7WPQNte?= =?Windows-1252?Q?YJdckPcrw=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1313;6:UwmJ1dqFNieNr49qDsZ7vA+PMTLs4vJEoT2FUHY1HlhB0LM+oW6tRG+lqECatHLZzV/mjpMpoM6MNy4R5O/B8kzxlVFKCX8GARztS54GCa2x9roa8MGIiqBO5WaKn5s1Qw38PSyzYaTGsA5c7IJ/hq+LSbWKeeOJ/wjcnP5FFu4olK3PLUNPBRuyAAifeNaagpoHFMX1869dChENV0ESetSCCYsNRMxyOxyJZxdEoKMuITs41dqtfZVeYKkRtWOOOzDzz8Fs6gtkdVviABwvRk3H6uylK5/y4V57XFxNB130dzN0sUyTZbdsKLItQS+Wh/xBjFv/epV82QOiYAkR4A==;5:xY7Lwun38s6fWz9IMKNDw8PqD8hM2agvs76umIp53kIW95QJO0A8eC4lq+5BruGcWrdj2yNoq6W6kU7Cj7+c2CwzBYUYCFeVMZdI8AdKcf9JFM2FcCoSDlZCJtvSJOocb9rq7C5UUCIK7YullEi5PQ==;24:SuXXitnCs23IFDdvqi0VjVeSpD8bqvstb52ohAfBjM0mtQ1w+Na/gHcFe2sFutEcTWqk1BYO5nAztPCnesPs1u/hjtMnFBKblV/qP1H+0c0=;7:uVBmujTC5ufu/sGU0CXzN8ypEwv6DyYKUbKg4w9EZXwZs0GyY38bJL8AoI8wzQHAVe83ztVY11vjxzvCcA3esaTaboCQekfvhkitLObbkcZsUGSuTu0Ec7l9hwg1hqUJRr/5slCBG3WRbs49slEzzTbwMsAe7dvt3pBz6yWJHlPbmaZfW7xrKslzOnhxORN/ViwE65sW0BtHXuMiY2czUuz82zPbr0DhPCsRxq4TEdg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1;BN6PR12MB1313;20:8y9GFFHwVrVhTojxGeise5YEmua3eo2SpK8gzldJ9FBPucmbcwAqhYd2s3VyQCh/QE7A225YiFBvoSvQ3itNmOv5tMcRvcT/mGshFHhAIaozO3dG6FTDXca4Fa1PXIJpOPBTURQze47U9weLSzyftio2VUNyDIKsxCiuS9govWZSZDucnndsFcPQnCKJbUFvjCLTkNfRAi1e+OcW3UqEAIUwp7BQ7hhyI+d5Z8v13LgrMM1cV67hzs/xDvj5mq+J X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Aug 2017 16:56:37.5486 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1313 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2101 Lines: 60 On 08/14/2017 10:21 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 Reviewed-by: Gary R Hook > --- > 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++; >