Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp627090lqd; Wed, 24 Apr 2024 11:52:43 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXmHVuA29YtEFk2wNYKcutmzsfitwPiQW6mBzlBx5qWZJK0Judefa+YUyqjSG6j64YUHixfbpgQBZVKnyLvcIe9ZvY+5AhtkHiuxqWI7g== X-Google-Smtp-Source: AGHT+IHsxD0S4BjdkAeOi6TyrGQiiJyLB22BRYEd/FmGOM7wddQTXQLwDBcyNv/trg1qCt0+TcA/ X-Received: by 2002:a05:690c:6c91:b0:617:d864:7e0b with SMTP id is17-20020a05690c6c9100b00617d8647e0bmr3480197ywb.47.1713984762800; Wed, 24 Apr 2024 11:52:42 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713984762; cv=pass; d=google.com; s=arc-20160816; b=GZuAtab+KEZXZFyajs3J5n/YX9f7nObqurVIFTJJy1fMGp4KLPSZ6mP+D91wlu6IMR SmJEd+F7xOwo6FKULvB9AwIqlOO/FDHqQzLsI4iXGcPfle2QEliWm9jUbdp3CBmhjSSj wPImWwlpWPXmYoHplLo/uOZRF+A0f9o5Gjyiqwiq1/ybdIuyamcsi5C+y8obHzcnpRN8 6E+PABs2Gwgg0SjPqlofBcZKlgCdaJnuFNXlma5ccNdOlZLuOTURrzf4AO55FQCEOseZ PhIjR/HXGw1tgx0gLcKbMgc7MDLkzZFC+uVpEKOpxFKnRWg1GHVeQ4lURjrAciPI8Q0O JZqA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=CArBMSkkQhfr3Md53+flZBAVH1a9TVuQaxu+mQYQs4Q=; fh=PBvZ5hIMtHrD9IVPN/STVEv6qBsgtMgLCrMq4/xYE7I=; b=DjuVSRiG/gVokS6VyOr+b+i5H8NjqyX392Sj1H66xZJOFl3Cnw8rOHMVSHdH5S8P+d B9X1kNt46eoeo1KD99a6mamW0KZdhjECaqi5Sc4E3h0MXdAHtFFDgbUsrYXhFTP5ZKnf pONRhMSvZkNAXIVUX3yijwhREFNyLKRsA9ey1iFwsmPn1wZwCQw848p7YYcXKGgzkjUq WWD+QrFumZtWzKesqjMRSWveRXshm3sxhfMdMVuMGdJjUI2Yw9f51jBrfp+koZ+VhfGN oTO2oW71KzbQWZETzhWoVo5YVGwRcgoxAIKAJfsTFyBBSnsi7aDfmfYFe7y2Q6BgSTtO ac1Q==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=pRQvg9jF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3828-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3828-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id 13-20020ac8570d000000b0043689471632si15898874qtw.321.2024.04.24.11.52.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 11:52:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3828-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=pRQvg9jF; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3828-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3828-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ny.mirrors.kernel.org (Postfix) with ESMTPS id 390461C24683 for ; Wed, 24 Apr 2024 18:52:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 127471BF2F; Wed, 24 Apr 2024 18:51:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="pRQvg9jF" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C612A199B0 for ; Wed, 24 Apr 2024 18:51:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713984688; cv=none; b=koHQeyOdjTl/2eyDbp2ByAP0MLTyl3b+U9V1jme6/SFBFBEfkzwKq4BPA4zS0k7KrrdmNukkQxItQGDv0nt7QVHl5nFE/qWWR9pI/5Kffao0j1Vm6STJrTz9s1Mv1pDy9XNoSdmlH/wVVRNcDT8fIP8vPfO95CrJFKcSIjLrpkw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713984688; c=relaxed/simple; bh=wuqoVsKfWk0PSe/Fq3OPqV5+lTblj3Bvn4lqt7+ZabE=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=o/3+5YjZlajnCBo42xc7dRItY6T4qXYNDplFZZsGuhMTNxBbMuhoVoFYynj3ijfJoL3rS3p9jW+usNvjkebZIBSuzQ00ZoQUK2N9FbfrBfNW0Sq/C9Qaeaj7aeGN+IAPpwAFQPxASNFXmPe9To0XleIuUq/53/dd/xm4YQvD4mI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=pRQvg9jF; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 30D1CC113CD; Wed, 24 Apr 2024 18:51:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713984688; bh=wuqoVsKfWk0PSe/Fq3OPqV5+lTblj3Bvn4lqt7+ZabE=; h=Date:From:To:List-Id:Cc:Subject:In-Reply-To:References:From; b=pRQvg9jFGkEV/0NmQFWrf0bV6sz+HAw5nWzEzjS0sYAjHn51GRAa8ItDkRNWzc5H1 c5Qh7pPtXiltOdVP52TgDbYpXxvl6zma0cOxjj2gooNedBzL7p+Nei1AjXWTffiaKQ UayoaqtgdFNBfXjQpYG9YQYnwauSZLmuEa5UQlxC62FlKPy87wVy8MgLiia7x3g2YN PH/9CYCPFM3AtAvdFxfLoB7SKPoj/QNSYP3SJOnmUtUr04wS7y9cEFs4t3DDQ5D61z Y+1RuMusGsQ9un/1XMpZ8YPfoS3HE717YVTVtuzk/2eDJZG3oEiHUdjgSF7Z/PtyiS 6xLFQKeyeMYwA== Date: Wed, 24 Apr 2024 20:51:23 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Andy Shevchenko Cc: Gregory CLEMENT , Arnd Bergmann , soc@kernel.org, arm@kernel.org, Hans de Goede , Ilpo =?UTF-8?B?SsOkcnZpbmVu?= , Olivia Mackall , Herbert Xu , Greg Kroah-Hartman , linux-crypto@vger.kernel.org Subject: Re: [PATCH v7 6/9] platform: cznic: turris-omnia-mcu: Add support for MCU provided TRNG Message-ID: <20240424205123.5fc82a1a@dellmb> In-Reply-To: References: <20240424173809.7214-1-kabel@kernel.org> <20240424173809.7214-7-kabel@kernel.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.41; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Wed, 24 Apr 2024 21:33:44 +0300 Andy Shevchenko wrote: > On Wed, Apr 24, 2024 at 07:38:05PM +0200, Marek Beh=C3=BAn wrote: > > Add support for true random number generator provided by the MCU. > > New Omnia boards come without the Atmel SHA204-A chip. Instead the > > crypto functionality is provided by new microcontroller, which has > > a TRNG peripheral. =20 >=20 > ... >=20 > > +static void omnia_irq_mapping_drop(void *res) > > +{ > > + irq_dispose_mapping((unsigned int)(unsigned long)res); > > +} =20 >=20 > Leftover? What do you mean? I dropped the devm-helpers.h changes, now I do devm_add_action_or_reset() manually, with this function as the action. > > +int omnia_mcu_register_trng(struct omnia_mcu *mcu) > > +{ > > + struct device *dev =3D &mcu->client->dev; > > + u8 irq_idx, dummy; > > + int irq, err; > > + > > + if (!(mcu->features & FEAT_TRNG)) > > + return 0; > > + > > + irq_idx =3D omnia_int_to_gpio_idx[__bf_shf(INT_TRNG)]; > > + irq =3D gpiod_to_irq(gpiochip_get_desc(&mcu->gc, irq_idx)); > > + if (irq < 0) > > + return dev_err_probe(dev, irq, "Cannot get TRNG IRQ\n"); =20 >=20 > > + err =3D devm_add_action_or_reset(dev, omnia_irq_mapping_drop, > > + (void *)(unsigned long)irq); > > + if (err) > > + return err; =20 >=20 > Are you sure it's correct now? Yes, why wouldn't it?