Received: by 2002:a05:7208:1509:b0:82:bbfa:f723 with SMTP id o9csp524589rbf; Wed, 24 Apr 2024 09:56:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgT7M4XP1//x7OhDMgJQ6769GyHAdz3rJwjNMSC2ERljOTkg8tA5vpDm4pz4T24VcDX1UfA6FOefItQ5DjYdpUMm+zzEqPS0aVjVygQQ== X-Google-Smtp-Source: AGHT+IHgokcLUZXK/scD2qJzRUzQqFQ0fbWwKfMRElDbqKliRYRfnggrD1W9FkusGqZ8ngmZfjMn X-Received: by 2002:a25:b948:0:b0:dc6:4b66:2636 with SMTP id s8-20020a25b948000000b00dc64b662636mr2894852ybm.19.1713977772426; Wed, 24 Apr 2024 09:56:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713977772; cv=pass; d=google.com; s=arc-20160816; b=ulWwuOdUNG1T8maisPD0lB0vyu8uaFFxbCONMnc/e06RfweP3RVoCoVsuwhjUBDGZK vdUWn+BgIEH3jQ9sElOEmQYSTEVr0QPgAECcLFyuNr3YCsrBeTJVYy7zjmTR1yomTJHb rCQpw8slOzKdrFOCLCIcqQgEtJqkDGBXA/xXdB/zs9O3q16eymvQ78ijMC1JKE8yd0hZ b9vDS7F+a0QlwHI/T40o2Y8FDtcNJ35lCh6o9eeNm8yPnhZaEIlGjoRfy7lcqHXwaBKM S7Cwbg8E4bWx0N1w8uq+6YGt7C90qfPGWbnTR+g2LkOSVdgAXIYfjdNkyLo/JxPeL5gm 8MMg== 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=/jkL68+mJV0lcHV5O/FBi0x7B1lZzVAifqCRX9YTJ/w=; fh=2/02ZXifYswuTslpNvWZ0ey60J931Upg0twh0J5a/FI=; b=HcN31uqzb/H6yaaYUM/f6NevTWrRwLu+6UVjbDV3OrIdtg10qo3kli1UIcFzK/inSU bRhIESgR5/KyFX9w38LuykbN8uS+O6NDVtC+dwHLc+MHlpqMup7rdDyNeE7nHnGyeWDO TzsnVg9twpdNIvzm1XuyMbrZ9jwOY0oeyW4v7yAc2SaSMm3U46E0TXQvwNPbtVYyr3s0 eyfWinDMt28ov3CiRxFLi2uGbM0pVhHtJFlqAEojNI9/+C51681jlngJa3Zt/0P+3eVi yYnyLUqQPgBlfWJL2YV3rhifwPq4rxOhy0oxIaZUp9uR/0B5dJv04iQ56qoSkopTvWuL hyeg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=feJRYweR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3820-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. [147.75.199.223]) by mx.google.com with ESMTPS id ke15-20020a056214300f00b0069eb97cafb0si15706175qvb.88.2024.04.24.09.56.12 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 09:56:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=feJRYweR; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3820-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3820-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 2716E1C23C89 for ; Wed, 24 Apr 2024 16:56:12 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 821A916C450; Wed, 24 Apr 2024 16:55:53 +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="feJRYweR" 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 4143D16D332 for ; Wed, 24 Apr 2024 16:55:52 +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=1713977753; cv=none; b=sSTZpyQlgh3h9XcvLhEqeNeSIZyWScxqsHjMw8pHlcfsvjX8iFuEqsjQWJfhslC8QOGZST96Q6p15KZwoT8hJ4f4INP5AzXEDAf4dfBKGXO0O/TRSHVM4n3+31wYgsyN/EERW1KZXzL4b3F6A1qDfiTQfqV3k+eA2/zDophGuyY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713977753; c=relaxed/simple; bh=RArGbTjywJoapBjOn9e2Rdum0BFmx8tdgHzlyAoGPLY=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=EF+0gdgR+UofyJ/thwu+6uh4iSEulmugzdnR42dVBawLtHXqlVUU1IdHqGi9XLUGfRRDPuIzgCmrU9JPt2Uu+mLWQkA0NTKwpJt9iDnnP9RcaMEVolmgBRZraCNEA0jelx1zBFbsL0HLGY6lbfQO7bAlvzd0iot7njKq2zxr0aE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=feJRYweR; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DD803C2BD10; Wed, 24 Apr 2024 16:55:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713977752; bh=RArGbTjywJoapBjOn9e2Rdum0BFmx8tdgHzlyAoGPLY=; h=Date:From:To:List-Id:Cc:Subject:In-Reply-To:References:From; b=feJRYweRIJNAtCLDEBPRIx3Mo5wBq2K4oJepu0wNdVpoJJBfmjeIA2mbOGsy1H7gG GMkx0jQZWBpv6G/kJLJDhXNJP8FXU6hJB9KoNFBUlm++wnD53gGjJSArlMtfIiHdx2 /74sfrJ/snFjnz2ENHf+pXK/+kvgBfMjlWr6HbVnDf+7+jB73/t+yTa49yEFYUHT+R 9PmWT57QCCEQi5D4V25zkXhHzDATNpg8NXNV9Ch3rR+9B8lEykVxPdLg1nGS0x6lEn LdhBoxyhTVfyXv1hnZO7H05WtMTppgIUTtHNyX4K+QpY+JxkVTDPqgQcvNvV/wbr8r 8w0d31RQuJxSg== Date: Wed, 24 Apr 2024 18:55:47 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Andy Shevchenko Cc: Gregory CLEMENT , Arnd Bergmann , soc@kernel.org, Olivia Mackall , Herbert Xu , Greg Kroah-Hartman , linux-crypto@vger.kernel.org, arm@kernel.org Subject: Re: [PATCH v6 07/11] platform: cznic: turris-omnia-mcu: Add support for MCU provided TRNG Message-ID: <20240424185547.4cf20408@dellmb> In-Reply-To: References: <20240418121116.22184-1-kabel@kernel.org> <20240418121116.22184-8-kabel@kernel.org> <20240423183225.6e4f90a7@thinkpad> <20240423185704.2237bc65@thinkpad> 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 Tue, 23 Apr 2024 20:25:14 +0300 Andy Shevchenko wrote: > On Tue, Apr 23, 2024 at 06:57:04PM +0200, Marek Beh=C3=BAn wrote: > > On Tue, 23 Apr 2024 19:43:41 +0300 > > Andy Shevchenko wrote: =20 > > > On Tue, Apr 23, 2024 at 7:32=E2=80=AFPM Marek Beh=C3=BAn wrote: =20 > > > > On Tue, 23 Apr 2024 18:58:19 +0300 > > > > Andy Shevchenko wrote: =20 > > > > > On Thu, Apr 18, 2024 at 02:11:12PM +0200, Marek Beh=C3=BAn wrote:= =20 >=20 > ... >=20 > > > > > > + irq_idx =3D omnia_int_to_gpio_idx[__bf_shf(INT_TRNG)]; > > > > > > + irq =3D devm_irq_create_mapping(dev, mcu->gc.irq.domain, ir= q_idx); > > > > > > + if (irq < 0) > > > > > > + return dev_err_probe(dev, irq, "Cannot map TRNG IRQ= \n"); =20 > > > > > > > > > > This looks like some workaround against existing gpiod_to_irq(). = Why do you > > > > > need this? =20 > > > > > > > > Hmmm, I thought that would not work because that line is only valid > > > > as an IRQ, not as a GPIO (this is enforced via the valid_mask membe= r of > > > > gpio_chip and gpio_irq_chip). > > > > > > > > But looking at the code of gpiolib, if I do > > > > irq =3D gpiod_to_irq(gpiochip_get_desc(gc, irq_idx)); > > > > the valid_mask is not enforced anywhere. =20 > > >=20 > > > Which one? GPIO has two: one per GPIO realm and one for IRQ domain. = =20 > >=20 > > The GPIO line validity is not enforced. The IRQ line validity is > > enforced in the gpiochip_to_irq() method. =20 >=20 > Okay, but does it work for you as expected then? >=20 > If not, we should fix GPIO library to have gpiod_to_irq() to work as expe= cted. Yes, it does. I am going to send a new version in a few minutes. Marek