Received: by 2002:ab2:6309:0:b0:1fb:d597:ff75 with SMTP id s9csp236626lqt; Thu, 6 Jun 2024 01:55:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVzh1jZoM7uqLY9DGxNoJSatcjBguES08th8n8Mjo5twHVSvesZl6ONrmm+raAxTM+NW2/03t+JPmDK7n+kKnrgbbnWkrTBK/wSo/73g== X-Google-Smtp-Source: AGHT+IERBECoW0Ur49Ko3qLinGuF4a+YKOEHCl5uVGWfLWL92Vaqhff0JG8j9zPm3OEoePQYWlMO X-Received: by 2002:a50:ab58:0:b0:57a:2f7c:c779 with SMTP id 4fb4d7f45d1cf-57a8bcc8b31mr3102886a12.37.1717664145272; Thu, 06 Jun 2024 01:55:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717664145; cv=pass; d=google.com; s=arc-20160816; b=KjJ91Kn4CviA8wzR/XhvWmtzMBWjdSool7mG7rxzpA3H9CiYxfFWgi6EBqJQ3GYU+x REgxPw7KVgbtixwi/L6LC+d5XiBP5IDbBHNEQyL+T4/jk6onVb/OI7oGKlDXB6GGgOSb H0JLKZPI8DXgZ2cq+yiXBL+5LxdqD3NUejhn8jWJElPonc93fRzD/Mqu6FQyvF+rxV0a mXwJ//AvlMJEGtVOkV1tjgntlOrfKRAZqbjthIxx5e3yMQ5bJO0lwAioPq0G1A+E9zqN d6GSHwpvCg9649qWW5kPfl2L322Rg9YsVuLkjuml5gIm6qegw9I7Qn2K4yAE6JZIVwMb GB4Q== 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=aKwVPgtxbCRq+0sMJHWEVQe87RyuQA/DKt9lfEELfUo=; fh=33ei4XVyzTFYjU70FQGOUkq18HODiXeXtV8Phz70i7U=; b=x5fTTzwf7Z15jdgLVoV853k+AQFzXUbc2M58DP3Ybs3VApXbC2Q7ymEMmT6sefhIcy Rj4D3iDt3Yw3hJiFatm+8HdqUVL2TGEHzdp/m3xNv4+Qdb7OQXNZfnllafaE0b7CPxNY bcVCV7GjfKs9gmZ/6rf1gp7GVGcApNAixUho1D/fKvacJyndbaNya9Ym3bxXkEHxaGy8 ey/W3oODz77cNn+VHvSC4vkrjAtifcMkdr7uX3/lO+NAVsqc6u8ym/eLr6L1rRAUFKi4 GYKWIHQsiOqbW+MAMgbF3LKaErtYWP2rike7DBlKRirSmtFgHz6jU2Eulj8b/KFHyI9K LeTA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=NA4HszPb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4782-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-57aae26724fsi467037a12.588.2024.06.06.01.55.45 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 06 Jun 2024 01:55:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=fail header.i=@kernel.org header.s=k20201202 header.b=NA4HszPb; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-crypto+bounces-4782-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4782-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 00EA51F236BD for ; Thu, 6 Jun 2024 08:55:45 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E041413E03F; Thu, 6 Jun 2024 08:53:14 +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="NA4HszPb" 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 A190213BC2F for ; Thu, 6 Jun 2024 08:53:14 +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=1717663994; cv=none; b=lUKQTacRuxXvCnU1fJ4w7oh7/0iqMKFvPX5EGQb9w6bv62+4sIDnPM0d6MqJG21S+CJ7ecFLhpisj2NxyGrQbKN4KrGzPgbVTBiazl9lPmBnI9E37N4w3N2ikI0R11GZGXE5ABYo0k5Ar8e8LDOGvkmWzs4dIUPegof8JZt0faQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717663994; c=relaxed/simple; bh=H197RQMx9DAWtYCyrDDhy9rTc/ukhFaiZ582/lFZeJM=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=mEEFt1QY1UjiZGSL3VR5He0FN2f4HYifi8DoK3BJ6kp8Hci6X+4Jf5tC23IaKrLC0xLbpiMaTO17z8u7MKUSKHT4EP0I/HCh1ICKV16/p4bnoQiTYXH33cnqetfjU8eQQdPeKihv+oBBG7kZMsEz4G2M8X/PSUmNOLYHl1LJiIM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=NA4HszPb; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id A2B7DC4AF19; Thu, 6 Jun 2024 08:53:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1717663994; bh=H197RQMx9DAWtYCyrDDhy9rTc/ukhFaiZ582/lFZeJM=; h=Date:From:To:List-Id:Cc:Subject:In-Reply-To:References:From; b=NA4HszPbpXETy9L8mVgyHtQ3buYcLEcjph861/+CYdUn9UnBMcGGSpOxxXYoCvfHr w1Aw1ASyaGz5Qs2kmdiy0+lF8cQWp2laRfjfTSTPdAhHbtKuRdd2YcsmZQgDR2IK6Y /g0RUTu5HQx5z2X5Np0r7ge+1OSLPKq3i7FbvVmxu0U0C0d+wPXXyYl6ad/8SXc7BT ovxOibyJOPPIs7U9F2y6xbtcll5P+P5ur7ExdfSGPHgs+gGqHUsGb5OnZZ/HLahKjJ 07SRDuMoGhtwdX4/7xaPfutCus43FElZ3P8FMJdlS1Pt3ov2oyR9ms85irx5waUR2i Pvr3mwPaNwu9Q== Date: Thu, 6 Jun 2024 10:53:08 +0200 From: Marek =?UTF-8?B?QmVow7pu?= To: Andy Shevchenko , Bartosz Golaszewski Cc: Gregory CLEMENT , Arnd Bergmann , soc@kernel.org, arm@kernel.org, Andy Shevchenko , Hans de Goede , Ilpo =?UTF-8?B?SsOkcnZpbmVu?= , Olivia Mackall , Herbert Xu , Greg Kroah-Hartman , linux-crypto@vger.kernel.org Subject: Re: [PATCH v11 6/8] platform: cznic: turris-omnia-mcu: Add support for MCU provided TRNG Message-ID: <20240606105308.3e02cf1e@dellmb> In-Reply-To: References: <20240605161851.13911-1-kabel@kernel.org> <20240605161851.13911-7-kabel@kernel.org> X-Mailer: Claws Mail 4.2.0 (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=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 5 Jun 2024 22:00:20 +0300 Andy Shevchenko wrote: > > + irq_idx = omnia_int_to_gpio_idx[__bf_shf(OMNIA_INT_TRNG)]; > > + irq = gpiod_to_irq(gpiochip_get_desc(&mcu->gc, irq_idx)); > > + if (irq < 0) > > + return dev_err_probe(dev, irq, "Cannot get TRNG IRQ\n"); > > Okay, it's a bit more complicated than that. The gpiochip_get_desc() > shouldn't be used. Bart, what can you suggest to do here? Opencoding > it doesn't sound to me a (fully) correct approach in a long term. Note that I can't use gpiochip_request_own_desc(), nor any other function that calls gpio_request_commit() (like gpiod_get()), because that checks for gpiochip_line_is_valid(), and this returns false for the TRNG line, cause that line is not a GPIO line, but interrupt only line. That is why I used irq = irq_create_mapping(dev, mcu->gc.irq.domain, irq_idx); until v7, with no reference to gpio descriptors, since this line is not a GPIO line. We have discussed this back in April, in the thread https://lore.kernel.org/soc/20240418121116.22184-8-kabel@kernel.org/ where we concluded that irq = gpiod_to_irq(gpiochip_get_desc(gc, irq_idx)); is better... Marek