From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751772AbdIMOYN (ORCPT ); Wed, 13 Sep 2017 10:24:13 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:48123 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750993AbdIMOYK (ORCPT ); Wed, 13 Sep 2017 10:24:10 -0400 X-AuditID: cbfec7ef-f79ee6d000003120-6a-59b93f86065e Subject: Re: [PATCH] crypto: s5p-sss: Add HASH support for Exynos To: Krzysztof Kozlowski Cc: linux-crypto@vger.kernel.org, Herbert Xu , Vladimir Zapolskiy , linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Bartlomiej Zolnierkiewicz From: Kamil Konieczny Message-id: <77dbef9a-a648-8380-ca08-e6874b4d27fb@partner.samsung.com> Date: Wed, 13 Sep 2017 16:24:05 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-version: 1.0 In-reply-to: Content-type: text/plain; charset="utf-8" Content-language: en-US Content-transfer-encoding: 7bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFprHKsWRmVeSWpSXmKPExsWy7djPc7pt9jsjDa4tUbHYOGM9q0X3KxmL 8+c3sFvcv/eTyeLyrjlsFjPO72Oy+P+rmdmB3WPbAVWPTas62Tz+LZzC4tG3ZRWjx+dNcgGs UVw2Kak5mWWpRfp2CVwZC9/fZyy4KFrR9/MyWwNjt2AXIyeHhICJRGdHNxOELSZx4d56ti5G Lg4hgWWMEjO6J7JCOJ8ZJT5ca2WB6ej70M4MV3Vg8wWoqmeMEitX/gGrEhZwlJiy9RM7iC0i oClx/e93sCJmgVeMEu92zQQrYhMwl3i0/QzYcl4BN4mpffvBGlgEVCUeLXvKCGKLCkRIbPs+ gw2iRlDix+R7QL0cHJwCwRJ7TqmAhJmB5r/4MokFwhaXaG69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U4mJVEePeZ7IwU4k1JrKxKLcqPLyrNSS0+xCjNwaIkztu7Z3WkkEB6Yklq dmpqQWoRTJaJg1OqgTGlZ9+x1Rs+XtkuHm9xwXL2nte+6ydfLvl571ZKp9TWma2GBxl5+/hW 7Nfbnzrj+wUl3Z0zV0lqiH27z/KvZC3L49wtm/u+xfX5qm06d7+at2cXo+sVy7sr178s0TeJ dwv59vjBhE/3ty1Sm6d+P7GKTWJidJ7rzH4pg2kdK2zO3JvCZ9L7wNlXiaU4I9FQi7moOBEA hNK3eYQCAAA= X-CMS-MailID: 20170913142406eucas1p1601531785a7ef076a1ed6a43e2660ee1 X-Msg-Generator: CA X-Sender-IP: 182.198.249.179 X-Local-Sender: =?UTF-8?B?S2FtaWwgS29uaWVjem55G1NSUE9MLUtlcm5lbCAoVFApGw==?= =?UTF-8?B?7IK87ISx7KCE7J6QG1NlbmlvciBTb2Z0d2FyZSBFbmdpbmVlcg==?= X-Global-Sender: =?UTF-8?B?S2FtaWwgS29uaWVjem55G1NSUE9MLUtlcm5lbCAoVFApG1Nh?= =?UTF-8?B?bXN1bmcgRWxlY3Ryb25pY3MbU2VuaW9yIFNvZnR3YXJlIEVuZ2luZWVy?= X-Sender-Code: =?UTF-8?B?QzEwG0VIURtDMTBDRDAyQ0QwMjczOTI=?= CMS-TYPE: 201P X-CMS-RootMailID: 20170913124433eucas1p11ac46af1676151477000f8952b0ca654 X-RootMTR: 20170913124433eucas1p11ac46af1676151477000f8952b0ca654 References: <51b3b386-22c0-7663-6f54-d166ebebd332@partner.samsung.com> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Krzysztof, On 13.09.2017 15:18, Krzysztof Kozlowski wrote: > On Wed, Sep 13, 2017 at 2:44 PM, Kamil Konieczny > wrote: >> Add support for MD5, SHA1, SHA256 hash algorithms for Exynos HW. >> It uses the crypto framework asynchronous hash api. >> It is based on omap-sham.c driver. >> S5P has some HW differencies and is not implemented. >> >> Modifications in s5p-sss: >> >> - Add hash supporting structures and functions. >> >> - Modify irq handler to handle both aes and hash signals. >> >> - Disable HASH in probe if Exynos PRNG is enabled. >> >> - Add new copyright line and new author. >> >> - Tested on Odroid-U3 with Exynos 4412 CPU, kernel 4.13-rc6 >> with crypto run-time self test testmgr >> and with tcrypt module with: modprobe tcrypt sec=1 mode=N >> where N=402, 403, 404 (MD5, SHA1, SHA256). >> >> Modifications in drivers/crypto/Kconfig: >> >> - Select sw algorithms MD5, SHA1 and SHA256 in S5P >> as they are nedded for fallback. >> >> Signed-off-by: Kamil Konieczny >> --- >> drivers/crypto/Kconfig | 6 + >> drivers/crypto/s5p-sss.c | 2062 +++++++++++++++++++++++++++++++++++++++++++--- >> 2 files changed, 1939 insertions(+), 129 deletions(-) >> > > Nice work, thanks! > > You need to split the patch, it is just too huge making it very > difficult to review. Please split it per logically sensible > improvements. Can you suggest how to break it up ? It is now big update, added working functionallity in one piece, but I agree it can be hard to read as git did some strange things, like delete few aes functions (and mixing this delete with '+' lines) and then adding the same aes without any change. > I see some cleanups mixed with new features - this > definitely must be split out. What cleanups do you see ? You mean this one "#if 0" ? > This looks more or less like an early work or RFC... because I see > things like "#if 0", You are right, I will remove it. > "HACK" or "CONFIG_....". If so, ask the question > about your problems directly. Do not force readers to find them out... The problem is in dts there are described only AES registers (the range is too small), and HASH and PRNG uses the same HASH_CONTROL_1 register (setting SecSS engine). Both AES and HASH must use FC control registers for irq and flow setting. So this 'hack' prevents using both exynos-prng and s5p-sss HASH, and in presence of exynos-prng it will load only s5p-sss aes part. This will disable exynos-prng in scenario: remove exynos-prng remove s5p-sss load s5p-sss now exynos-prng module will not load. -- Best regards, Kamil Konieczny Samsung R&D Institute Poland