Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3109407lqt; Tue, 23 Apr 2024 10:29:40 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWGUVIZ6+BfyS7rde68sFG6LsGKx6evWyqlw7CEeaPjytmjsu0oO5qBd5HKucP1x4slFJ+1+wmYnEZ/0dCtMdf1HjXK1c/5EeNTxMiaKA== X-Google-Smtp-Source: AGHT+IF1Hmrn7EmCN+Lhambx3Z2kEKV0rmz/FwCWxSrkTuMPh7uD/PN/mcJBzynZsSqt3CZdMYV+ X-Received: by 2002:a05:6a00:ad1:b0:6ec:f28b:659f with SMTP id c17-20020a056a000ad100b006ecf28b659fmr305106pfl.3.1713893380088; Tue, 23 Apr 2024 10:29:40 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713893380; cv=pass; d=google.com; s=arc-20160816; b=xpNIJVBfO4GpE+tAzdWNYOwPOL7EEW6vUrjj2q2cBPOg5Cc6rwnmrTe0KUqEZbLyCH O4kzL2EYgsCWhW3b32yeZVtFmv3SihlkHiAT55PkZNenSVpN4tbBM0XZkNC+hY8MlqZl YwAqzoZPq46HERQgh48HYQt5Bziq9+yX3INV0rLNWE/8vEfi7j7pkDm51Lq3LT74OzoI VzW29pmYkj47OHPo1SHXH/wG7851k8pOF2OzSYuQYeS+u7ZBXUMU1x1nOzwyd3WV8SXq ClZLgIGOm/4MJcwfHVH/47fVND0Rgu1NOt6IDr4aMiaW1iksshYMf5YjLOsfhIwnvKiD 30lw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=organization:in-reply-to:content-transfer-encoding :content-disposition:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:references:message-id:subject:cc:to:from:date; bh=6uo2isyE6xUqXE8fxpaMVdZlj6IijnwQJxpULQWCP5s=; fh=/UPF87YNNpA3jdyv6qOd8aOx9QfivjY8vWd9JXuBV6I=; b=HbRdn9YjorgXZHLplPcOFxai3sktFtZOxHwaPiJDt9RUOJj+t5VBmkR0SKRpRFhIlJ TkSy27pXrtYXrSSQSutF8UTsBxHfzqChUx2NmnR7GvmvWALmVtVTeWjVB2lW6LH4x8Kb /WXgxWPh/lTmQvwdxgMHW2Nt6eG1UAb6nBoIOQznVMbUyLkTDeamwTrs3y1H+uExaxgZ ZTQghnseb5THJJ+zYJwya6cHS3hWUHm5uf36zNTVWx0wWhRPxYIUB8OeUTRzoJtbIq+s +MIX8PuUneLwwXcQosZswfCCI4udyCKnb+IO/6iwL5JzzzD1CMKigBAIye46UvwEHS1O QE3A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-crypto+bounces-3808-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3808-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id g21-20020a056a000b9500b006ea8c975ef0si10133644pfj.398.2024.04.23.10.29.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 10:29:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3808-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-crypto+bounces-3808-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3808-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com 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 0CCA6282712 for ; Tue, 23 Apr 2024 17:25:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 28EB413D287; Tue, 23 Apr 2024 17:25:22 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.16]) (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 AB2571BC23 for ; Tue, 23 Apr 2024 17:25:20 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.16 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713893122; cv=none; b=JTx0naOT0VEj7LfRI0sdf0hbSMf04TFmiaQo/COMZgNP0oSwyVi+gQ/5R8bqG8Zgfz/NVINUesSM9nL4FMno51NunMhPb5tTC2E3D5J/m5FvDPo7hwSVb5dSIgV1+rlqkxhOrr5bWeUzeaPPEYgw6reZwtL/DmvbEUC+2F+j5QQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713893122; c=relaxed/simple; bh=FajkJ2QvLktLkuWIAFJilqfX2YAMOTvTp7HdHkduzPY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WyUf2KYa1oiOiUf4BuAmr3e1zwovhoYOsxm0mKRNgzmECGJrsquPSofgYBdtsrkKly8Yd9nZJCXU3Dc2TkHUYj9U4EhgkaiWZYumNLAz6RvXX3DFQTzYD+yNol6WEOUPnp8G+XlEzsVv1gS00UCjuX3xq04+iTK01inPrcKgRZI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com; spf=fail smtp.mailfrom=gmail.com; arc=none smtp.client-ip=198.175.65.16 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=gmail.com X-CSE-ConnectionGUID: OplrNeh8TpGW5XdbYSWQFg== X-CSE-MsgGUID: YS50gbWvSi6PJNvZJQn7Hw== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="9612053" X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="9612053" Received: from orviesa005.jf.intel.com ([10.64.159.145]) by orvoesa108.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 10:25:20 -0700 X-CSE-ConnectionGUID: 9oqRrADpQuS4WG3/3jUS0g== X-CSE-MsgGUID: 0WW+7nchRlKiYyH22DhnKw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="29246863" Received: from smile.fi.intel.com ([10.237.72.54]) by orviesa005.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 10:25:18 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rzJtK-00000000PZ0-3jQ9; Tue, 23 Apr 2024 20:25:14 +0300 Date: Tue, 23 Apr 2024 20:25:14 +0300 From: Andy Shevchenko To: Marek =?iso-8859-1?Q?Beh=FAn?= 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: References: <20240418121116.22184-1-kabel@kernel.org> <20240418121116.22184-8-kabel@kernel.org> <20240423183225.6e4f90a7@thinkpad> <20240423185704.2237bc65@thinkpad> 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-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240423185704.2237bc65@thinkpad> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Tue, Apr 23, 2024 at 06:57:04PM +0200, Marek Behún wrote: > On Tue, 23 Apr 2024 19:43:41 +0300 > Andy Shevchenko wrote: > > On Tue, Apr 23, 2024 at 7:32 PM Marek Behún wrote: > > > On Tue, 23 Apr 2024 18:58:19 +0300 > > > Andy Shevchenko wrote: > > > > On Thu, Apr 18, 2024 at 02:11:12PM +0200, Marek Behún wrote: ... > > > > > + irq_idx = omnia_int_to_gpio_idx[__bf_shf(INT_TRNG)]; > > > > > + irq = devm_irq_create_mapping(dev, mcu->gc.irq.domain, irq_idx); > > > > > + if (irq < 0) > > > > > + return dev_err_probe(dev, irq, "Cannot map TRNG IRQ\n"); > > > > > > > > This looks like some workaround against existing gpiod_to_irq(). Why do you > > > > need this? > > > > > > 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 = gpiod_to_irq(gpiochip_get_desc(gc, irq_idx)); > > > the valid_mask is not enforced anywhere. > > > > 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. Okay, but does it work for you as expected then? If not, we should fix GPIO library to have gpiod_to_irq() to work as expected. > > > Is this semantically right to do even in spite of the fact that the > > > line is not a valid GPIO line? > > > > Yes. It's orthogonal to that. -- With Best Regards, Andy Shevchenko