Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp6112168imm; Wed, 27 Jun 2018 02:23:21 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfO88D3OhgrEBIFFOxnjCSv6a9byhm4PybCraqUZTOSDKm8W27lN7NdLg9b8TrLEIXQ5Rly X-Received: by 2002:a62:718a:: with SMTP id m132-v6mr4908716pfc.249.1530091401370; Wed, 27 Jun 2018 02:23:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530091401; cv=none; d=google.com; s=arc-20160816; b=HHp1zDVkQ17uWQUdeH/WFAYDA8zjEs7hES9w4hRv1ugw2QTCNR8QsCJaTpYypoFM3p 68qlt54z5nQaUp51IMxKAqLsWp1n2X9WjGZPYtEZ2Euzw3h2jS0gBETlsVyi637QxXHE TAfXXC9Gisoxcb7+64O5ZXOHjdGBLLvqwy98ezWWmmh+hoZGv9A0uq0feT1fRWj0BmME hCTVu9ofEVDD7c6524lkbjBCOTptoSENJuJy+3Lx5iN6OquzfjW6OlPjnasSsZywdB45 wcqw0n2wMg7p036FDKSfzVE6ixxTCzoi7FHWY5ys5woYrRvVNEEvo/mnG4LPHhixi6zN XBsA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=Yo7zgxDlfAKcg591MsOTqYEZ1Hxvbqyxl7ffvsGmxzk=; b=ptlAyzOeoIYlnZad8fvcbBkv38ubwtNZe9puXScYFbA2uOmiHUDFD4LhpJrtdzSCRV DlRWmo5IgtK0bvfkP38ee9QcKGuXI08cRU0b15uy4mteDDyiKEBTDPThyFkmj4BAxgXS oXv9WuwoMBOMQE8DecqTgi5yfdi/IROBtqtdenTximmYqxaFSlNn+kkhWztbbbS7qsIz vGK0TCWbdMwJUHkINWE37c3EZ9aZkDQaLhSCdk3GsDkO8AAF+Sp1jPNxAjrSEIIrAbu8 EwC6f8DNUa+zaBHa8ndHzfUzgscXIQGL6pjv9N4Jiqp9DS+gASn3NIMhLO77uCOoVHAj pGzw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@chronox.de header.s=strato-dkim-0002 header.b=ICrp47SP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-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 g2-v6si3575865plp.233.2018.06.27.02.23.04; Wed, 27 Jun 2018 02:23:21 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@chronox.de header.s=strato-dkim-0002 header.b=ICrp47SP; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932979AbeF0Hv6 (ORCPT + 99 others); Wed, 27 Jun 2018 03:51:58 -0400 Received: from mo4-p01-ob.smtp.rzone.de ([85.215.255.53]:10095 "EHLO mo4-p01-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932470AbeF0Hv4 (ORCPT ); Wed, 27 Jun 2018 03:51:56 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1530085914; s=strato-dkim-0002; d=chronox.de; h=References:In-Reply-To:Message-ID:Date:Subject:Cc:To:From: X-RZG-CLASS-ID:X-RZG-AUTH:From:Subject:Sender; bh=Yo7zgxDlfAKcg591MsOTqYEZ1Hxvbqyxl7ffvsGmxzk=; b=ICrp47SPJT0O/PIiQ6xNp3vcQpyWX89UMTR5Ax9CTt+3SohbVIrcc1Pw6OuJZ5znpn yrJcOYnQqQOa65W2OK27LsMJBXO8sAZDzU7IBtEgFEvKpOZesenx0mlaV2/XcgasA/6r kANg158Ib9bo5R6ERiDKSrHvMCCv/XkR9ZgSODxRdrwIvk2ShsRLKLHvoqFzR/QjhPYu OZgwDbcwyfjatqBKxtIyqr+iU816OdrvdQGmiig9RgCQzx7OXuTphZjSzlyOlCGIIa0s zXRF7UCXgJTt4CtK+motdO+pFUhi5cc8YFL9wmKJK7mglFx6QfM2StrTneVcXziSnNH2 +Vtg== X-RZG-AUTH: ":P2ERcEykfu11Y98lp/T7+hdri+uKZK8TKWEqNyiHySGSa9k9zW4DNhHoQE+naq/Tly14H1nAt7oghSPofJc0EJAN2fP8qsY44dqiWA==" X-RZG-CLASS-ID: mo00 Received: from tauon.chronox.de by smtp.strato.de (RZmta 43.10 AUTH) with ESMTPSA id a09e74u5R7pn01B (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (curve secp521r1 with 521 ECDH bits, eq. 15360 bits RSA)) (Client did not present a certificate); Wed, 27 Jun 2018 09:51:49 +0200 (CEST) From: Stephan Mueller To: Vinod Cc: Herbert Xu , Stanimir Varbanov , linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org, Matt Mackall , Arnd Bergmann , Greg Kroah-Hartman , linux-arm-msm@vger.kernel.org Subject: Re: [PATCH 3/3] hwrng: msm - Add support for prng v2 Date: Wed, 27 Jun 2018 09:51:48 +0200 Message-ID: <3762582.fWXRAqm3bE@tauon.chronox.de> In-Reply-To: <20180627070144.GG22377@vkoul-mobl> References: <20180619142853.wgi5easw4zv6ttrb@gondor.apana.org.au> <170012246.0U45yCEtus@tauon.chronox.de> <20180627070144.GG22377@vkoul-mobl> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Mittwoch, 27. Juni 2018, 09:01:44 CEST schrieb Vinod: Hi Vinod, > > > Currently am doing bunch of initialization in .probe (platform driver) > > > and I think recommendation would be to move that to .cra_init, which > > > seem > > > plausible but I don't have pdev to read hw_resource etc.. so would still > > > need to get that. > > > > It seems that your allocation during probe relates to the hardware > > resource > > where you only have one in the system. Thus, doing the allocation here > > makes sense. And, you do not want to perform probe or such resource > > allocation once per crypto API RNG instance allocation. As said, there > > can be multiple or even they can be allocated and deallocated frequently. > > This in particular applies if your driver's "stdrng" has the highest prio > > which means that it will be allocated and deallocated frequently. > > Right, that is how I visualized it. > > Is there a way where we can tweak the register API to pass hw_resource > pointer and get that back? Would that work with the security model in > crypto. I would not see an easy way for that. The core register API of the kernel crypto API would need to be changed. > > I do not like globals and somehow don't feel that we should do it that > way Granted, I concur here. Ciao Stephan