Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp3052266lqt; Tue, 23 Apr 2024 09:06:12 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUJWjFTzswtn6tRTfnTiJ/sljOcH+ytYI+X2Ey1UVAhwZ3eLxKjCOXNWTLmatKfYx1RQaE3+tPZHt9ao32vQ9+bBHttTf/0nFH0hagmgQ== X-Google-Smtp-Source: AGHT+IF3nRnYCX7GEuXxSjyfZPDWXL5KGsPMZmHzibsRD6jvmBuwJ2V9IFstm3NGM/TuVv7mEF9Z X-Received: by 2002:a05:6a20:9e4b:b0:1ad:6c36:ee82 with SMTP id mt11-20020a056a209e4b00b001ad6c36ee82mr1577035pzb.13.1713888371981; Tue, 23 Apr 2024 09:06:11 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713888371; cv=pass; d=google.com; s=arc-20160816; b=pFCFAO1WWcJk7XdkVscnNqJiJAPgQeewcYEkhloZLOHaQrghi7ijHDnBdPkKQaZtn8 F962MdjXbQ6EayHw04noI4RoLaQkldxSpu6rqisv1UNpWtpU6y0TIov51clpzRUkD2ov ez/5yNMbkz/Ks3euo52PU1Rk1Ut0krfUZy0s3y9WaWB6h6A3l1zYJkXSyitT27KISSeR +N+CNN5VEo8a18dzcUqO08WqOTM/W1i6+AxVzAZ/xyQ/eFgbe+hW651YJBbJ5ma9TEbY tnD5bxU8dNzIYLJhOgDZZjWwuDhyTTSrKarYSyDUPPbLE+JIXxEEks8HunVyOBCsSdzh NxZg== 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=b8Z67CJ/8sJfvYp5Ij1W94hNnzZc25ea5hYD3jsl/9g=; fh=/UPF87YNNpA3jdyv6qOd8aOx9QfivjY8vWd9JXuBV6I=; b=sZbG069zljzeatVf15dnq+Ik3oy3wfHriZVTAeAxnPErVz1Y6UXhRDPdKQrRj+v5Dy RpNibLvl1pZqZ2MVeUh489zQ8XcfxteEUFec1RfQpQJDmhB84WbB/N6eDZEqc8RhO0lc yji4/qlU+dA7VBsVvfFWKXuCcC1EP3/kYPH/vBbC3Jf5B2kqKRABbYMkZcFIWT7cbVnF usP2qoPoApgk3dh7UGqztNKzymOZX2XxJnTfBXi8SMDTGEyOaQ/JLW7tdF5pdUbqPDJB XGmNMOrT2j4Mw57e0Llh5kIa5AAY/W1AcCabM9ARuD/Lwnt5ohVlifESyo+tC4uBgxq/ OFsA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-crypto+bounces-3795-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3795-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id q26-20020a65685a000000b005f7fe38bbcasi7703887pgt.274.2024.04.23.09.06.11 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Apr 2024 09:06:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3795-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-crypto+bounces-3795-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3795-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 6201BB23739 for ; Tue, 23 Apr 2024 15:58:31 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E28E913C9DA; Tue, 23 Apr 2024 15:58:26 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.20]) (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 86A061BC23 for ; Tue, 23 Apr 2024 15:58:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.20 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713887906; cv=none; b=nxuiPuiMQByEo2myrT2l3oU0NPu7LChbnvivQNQLCjy0kHcSiyLF7IlJyfKRU6NBO8TR/tJNeZQ/zfImr1lx7Mk0Ab9bKW8QkVtG4kZNkdkSeAzokyoUlMAGHJLYPv5ctHibs1itGfJKdVTRz/y4RPGaLU7ctxux12pwM19tykM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713887906; c=relaxed/simple; bh=TG1xu07oOJCkKY/sPT2Q5iJLW4Z8NGwCN6sv2WM7eLQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=CVeRTgtdQJajOaReYnDD9Mym038R+nbw6YI81AqXAD1uEOSmt4vbTjj/rCkgkfmzV20BDScKZETBXcnIeGs8rTBKVLCjYOe24+Sg/YVcj2TotSBYgEBEpk5rei9iggNOvdd8Fg4SkvyPyjdhyfGk8GrWKJ/meXrHlgus62/CUwo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org; spf=fail smtp.mailfrom=kernel.org; arc=none smtp.client-ip=198.175.65.20 Authentication-Results: smtp.subspace.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=kernel.org X-CSE-ConnectionGUID: Gtj46e3sSjCpfwY8wQyFAg== X-CSE-MsgGUID: K5BGc2aoTOaCpz4RtHF2zA== X-IronPort-AV: E=McAfee;i="6600,9927,11053"; a="9311519" X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="9311519" Received: from orviesa003.jf.intel.com ([10.64.159.143]) by orvoesa112.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 08:58:25 -0700 X-CSE-ConnectionGUID: jb5PWMliRAyzLdwsje6RGQ== X-CSE-MsgGUID: x+L3d3BNQmiNpWsuwaQtOQ== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,222,1708416000"; d="scan'208";a="29054596" Received: from smile.fi.intel.com ([10.237.72.54]) by orviesa003.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Apr 2024 08:58:23 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rzIXD-00000000Nra-3Tyz; Tue, 23 Apr 2024 18:58:19 +0300 Date: Tue, 23 Apr 2024 18:58:19 +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> 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=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20240418121116.22184-8-kabel@kernel.org> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Thu, Apr 18, 2024 at 02:11:12PM +0200, Marek Beh?n 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. ... > +int omnia_mcu_register_trng(struct omnia_mcu *mcu) > +{ > + struct device *dev = &mcu->client->dev; > + int irq, err; > + u8 irq_idx; > + > + if (!(mcu->features & FEAT_TRNG)) > + return 0; > + 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? > + init_completion(&mcu->trng_completion); > + > + err = devm_request_threaded_irq(dev, irq, NULL, omnia_trng_irq_handler, > + IRQF_ONESHOT, "turris-omnia-mcu-trng", > + mcu); > + if (err) > + return dev_err_probe(dev, err, "Cannot request TRNG IRQ\n"); > + > + mcu->trng.name = "turris-omnia-mcu-trng"; > + mcu->trng.read = omnia_trng_read; > + mcu->trng.priv = (unsigned long)mcu; > + > + err = devm_hwrng_register(dev, &mcu->trng); > + if (err) > + return dev_err_probe(dev, err, "Cannot register TRNG\n"); > + > + return 0; > +} -- With Best Regards, Andy Shevchenko