Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3089211lqt; Tue, 23 Apr 2024 09:59:50 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXnXLoblwAXrELQJdbP8xNk82uBr+gMNg3efMWnUCTwtzj7uCrsUxYU/TE7hT8XKCcA1vZLlTZkmsQGgCBJ1MkDVlj9mjd4AW9X53JDbw== X-Google-Smtp-Source: AGHT+IGQiGoe9ubpKBP9Lth1id/QXiofXSQXEyRpwVIPPYyZc1iGnqgAX3rWFN1ntPf1BFdfv9ac X-Received: by 2002:a17:902:c947:b0:1e4:59a2:d7c1 with SMTP id i7-20020a170902c94700b001e459a2d7c1mr3994053pla.33.1713891589905; Tue, 23 Apr 2024 09:59:49 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713891589; cv=pass; d=google.com; s=arc-20160816; b=Z16gcDcaxUeYnd+2NMFi6Ug4FRLOldTJJD3o4L8WvGEd2FPwRp/UWchYhJtmUeOPdR 2Oe8e3h5hbZieHM3P3ms/Bxwkan3/E1ZgYBgQhURcHMS01sjGYVcMdXmXplTWU5KyaFd fo2B0Bc4/tzUNRcaeiCQTVJsN2YcFV1yA55XfYC/v8nWZvuIUH26wgGoIgNdSUDh1DdS /wGBZBS4qkYG/ayDHM1zrngSSqPpmfzaHZ8CFprtffJpiSkbz5mocet4e1+dcDdG2GY0 iwx5hP9oE7E4ELGPokI4dB/WnSIRcMRR+tNRkrnMX9q8JyABnSdaA9i98wcjHakIWcfh KxHQ== 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=An2NM9eh+Mfn6PFtvA/1UXoFl1QCApFc6TZ1ZMzXtU0=; fh=wG/ILwxjGyE+NGrPKvVIAv82Yw3KPjve/pPehta3peg=; b=AgTIyM5UXCQJ2yrzSGo0H55EZdYbIroB8JAOlX/THb2oJ6W+AXhpxIatap7sQdo+iJ lEwrB2PEuka+48NiQawseF41f3nYWD2A7g9a+mz8rMRkzzwKMVTCHC+E4o4L+3QMxxFP yu7h3WztP/+s11zGxXFb515ddhMWUo4D4xYSVapco6jiLw5V9Fxv0M9V7tGIbhltvzys 7dqMkZaza33CfuFez/VfwVWiB293CQhF8FcQI7PDNV4dPjBCK5bAUPZblNnWLQOgATb4 5PWZ19nRhZfbJTF7o5qt0NKLaEck8mSV1jyMlMPDimsOG632PKLKAXxczsUCDQ4d8PRn xSbw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=WL6OFmV2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3807-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id k4-20020a636f04000000b005fd6ec933cbsi4955570pgc.436.2024.04.23.09.59.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 09:59:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=WL6OFmV2; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-3807-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3807-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 160AD2812F6 for ; Tue, 23 Apr 2024 16:57:24 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2625A13D62A; Tue, 23 Apr 2024 16:57:20 +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="WL6OFmV2" 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 DA8AD208A9 for ; Tue, 23 Apr 2024 16:57:19 +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=1713891439; cv=none; b=U4lyiBlWhWAsZFzHqbSUJBTpC2b+bvdOxXHuk437S8Tjd/dDQvc5W+G10RMvcX/4Enxr8EC4mMi5KJnrG7GzUAa/StIlaqBqjXFg6lBfvDExqAz+t8isX4RI0vFVoNOtvl7HLfFyO5zWWG28P/OOq+3t1YMVlvim++HVdbnzMkM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713891439; c=relaxed/simple; bh=wRXkZL3Vk3FOwKk4hkbiS0cu2M9QuAIKg6wsi1/ladw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tMNuzz1HciTeFY/mOGH7PaQ6JV5nYGnRpJX348n6P8alz/sz+xRS3C4NwhM8tnRtfYn3/scTBSC+ijJzHb+hc3WRSYykJTkdOw3DJCPauVzvKvpMWI+mqvxaA+2OWDxwqmrbsAg68pULs19E8wRrjKTHoqjJBftl5KVbwth8u4k= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=WL6OFmV2; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 53FC0C116B1; Tue, 23 Apr 2024 16:57:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713891439; bh=wRXkZL3Vk3FOwKk4hkbiS0cu2M9QuAIKg6wsi1/ladw=; h=Date:From:To:List-Id:Cc:Subject:In-Reply-To:References:From; b=WL6OFmV2VP5pqJw4cLZUBEmamiIYpcQ3EkvB5eDTgmqILGMD/2eHaXogCObBgI6U9 xJL8tUX+V/+bJ/5T8HtFOiekXmj9tWF2a4FFT/gncIJ0zpF22elmRp2YjkmN6FIkc5 0EpqIbXVDfat4n+nLNSz58up6wbJuQDsi0HsNrsk1ITgmmPw3VWHp4oCmcQxCDX7XA 4uza1ivbouHCHEuuBPssgBMOv19J4pLIlgEapFjSR+/xfCNjKioNRzexbYlAMNmrZu JTqvP6h/5yrMpiZVBfgwgWpiTgdsOh7HERgL44U0XkYYGx7PdUe8ENLJHuX1wWWIH7 +9GVjptW+PQyw== Date: Tue, 23 Apr 2024 18:57:04 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Andy Shevchenko Cc: Andy Shevchenko , 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: <20240423185704.2237bc65@thinkpad> In-Reply-To: References: <20240418121116.22184-1-kabel@kernel.org> <20240418121116.22184-8-kabel@kernel.org> <20240423183225.6e4f90a7@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 19:43:41 +0300 Andy Shevchenko wrote: > On Tue, Apr 23, 2024 at 7:32=E2=80=AFPM Marek Beh=C3=BAn wrote: > > 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, irq_id= x); > > > > + 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 member 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. The GPIO line validity is not enforced. The IRQ line validity is enforced in the gpiochip_to_irq() method. > > Is this semantically right to do even in spite of the fact that the > > line is not a valid GPIO line? =20 >=20 > Yes. It's orthogonal to that. >=20