Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp655783lqd; Wed, 24 Apr 2024 12:47:24 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWOvICcNjtolN7ImOq9GGFl+A4YY3DYatCwk4lm/ktrk4pC5A6AhWsjUcnyjMXRYq/xeCTRarbcK1dZ6JBMEdh0Pp4gEZuO+xSQ4uueHA== X-Google-Smtp-Source: AGHT+IGuuX+meXhFTWm1/ovs+of0GDuUxWgCkX6WiX6VO64bfFEUtPVFJGXZRpLaqOt/AiMlFYKZ X-Received: by 2002:a05:6808:1450:b0:3c7:c13:e67c with SMTP id x16-20020a056808145000b003c70c13e67cmr4403293oiv.7.1713988043736; Wed, 24 Apr 2024 12:47:23 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713988043; cv=pass; d=google.com; s=arc-20160816; b=w1Z2TZ1XtItxgMNykKuKhncFee9eWPeL0w3t0l490sYPSYVVsYalloiWGrFVIx20mA CMn/9eW5fYJOv3B10EG9/qq1mvPlmEcz67xPAkgqJuGo8JbV+zpmMKb27kWeFSR87dmJ vn8QhsXrFtPEyI6iwliRaROD2I8OrJJUbRB3LvN4lkg1JbpIbccbQfwLeTgaDiweCx5X YdjYr8MFw3W99zVaK657/vN8QHuivkFkS6G7wZBQcnrSKCFSW3b3fGyyBa0bYVu68zt9 Jv0+Qp0/e4QRoYouGl2OsUWYtbCFdf/Y2uMRCDeCt1CSokCxAMda998da2YkrtbffluL a7Lg== 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=LZZ5tGBgjVqZtgBp6FXfqDDhG97Is1xF5RPdiJ0/FX4=; fh=+xMXiYvvyxWnylPpvGJGHxO5AdE0tqn17q7/q2XRASo=; b=W9YKkzCiijm/6J+D5gqmSVJq0HD6xA5sngGqQ83bFG2fHMZ4RZkAbIf7Xh3VupuVE3 oSHvUskynOC6vxHj3aBCFFBePhzdK4Hir03QZ5rOBwm+6fo9d0MTeTMC/ay1AJWqK1qm tQTgkm9EyAWE7hVeA2CTTFX5Od6GQpOk+tucv+L3jgqWbKWdS0MYsJHRfBeCsYPf8IBg 3Eqz5d2HjIb8A5O3BKZJT3dYI8f5URzc/lB4iZZkweg/zex5/kmgQ/Oxkx6raGzS7CaC I+Idy+I35rpxnNgwKCZuJLOcj1zFkqxpHo+V1blutwxTf4eEb7bt2GpriswyzecvL9jP NQyg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1); spf=pass (google.com: domain of linux-crypto+bounces-3829-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3829-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 vy15-20020a05620a490f00b0078ef8c97619si15455158qkn.626.2024.04.24.12.47.23 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 12:47:23 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-3829-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; arc=pass (i=1); spf=pass (google.com: domain of linux-crypto+bounces-3829-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-crypto+bounces-3829-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 349731C226A7 for ; Wed, 24 Apr 2024 19:47:23 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 871E713A897; Wed, 24 Apr 2024 19:47:18 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.12]) (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 2184A139CEE for ; Wed, 24 Apr 2024 19:47:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713988038; cv=none; b=IqiVsbZK5vEDlpG7zh6fMCOoV5Rxq7h8DzIVipAnldDmNpPpsfhbxQg1pq/H8gL23saS/iQuSeek0BY+xCqyQwT6iibpzGuhxjx4xn8YqPJLI09YkAZHuYS6616LbTM0+IseciTwm612tCi9NUgSh0zLitWAxAv4Fv1O4L5NwgA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713988038; c=relaxed/simple; bh=anKJU1S6467DK3ZoCW+YdxBrzunV/vU7DiZjbbARUHE=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=BVi9np8aTj5lS6htLZj/tffukGDea8R444sDhkY+vv/mvhDAKAPEhStRertLGRaEJXXBQaTGE/S04bTmQF/jVaBCFcJR5ap3RJJG90+Bbc+hOizFaDK7c6W3y5wns0Y7WLOU6OGf+ZBUk91C7JemFtsNREd0h1HdSzpwWj8OtTE= 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.12 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: cxziHAcWRaSL7fp7vkhehw== X-CSE-MsgGUID: PpKk98ZzSi+GQpLEQeX13w== X-IronPort-AV: E=McAfee;i="6600,9927,11054"; a="21066124" X-IronPort-AV: E=Sophos;i="6.07,227,1708416000"; d="scan'208";a="21066124" Received: from fmviesa007.fm.intel.com ([10.60.135.147]) by orvoesa104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 12:47:16 -0700 X-CSE-ConnectionGUID: rPj+xjYvTNa9M//QHhquJw== X-CSE-MsgGUID: T2yKAZHXTGSHqHYD+k4zNA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.07,227,1708416000"; d="scan'208";a="24863622" Received: from smile.fi.intel.com ([10.237.72.54]) by fmviesa007.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Apr 2024 12:47:14 -0700 Received: from andy by smile.fi.intel.com with local (Exim 4.97) (envelope-from ) id 1rziaF-00000000mFg-02Ei; Wed, 24 Apr 2024 22:47:11 +0300 Date: Wed, 24 Apr 2024 22:47:10 +0300 From: Andy Shevchenko To: Marek =?iso-8859-1?Q?Beh=FAn?= Cc: Gregory CLEMENT , Arnd Bergmann , soc@kernel.org, arm@kernel.org, Hans de Goede , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Olivia Mackall , Herbert Xu , Greg Kroah-Hartman , linux-crypto@vger.kernel.org Subject: Re: [PATCH v7 6/9] platform: cznic: turris-omnia-mcu: Add support for MCU provided TRNG Message-ID: References: <20240424173809.7214-1-kabel@kernel.org> <20240424173809.7214-7-kabel@kernel.org> <20240424205123.5fc82a1a@dellmb> 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: <20240424205123.5fc82a1a@dellmb> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo On Wed, Apr 24, 2024 at 08:51:23PM +0200, Marek Beh?n wrote: > On Wed, 24 Apr 2024 21:33:44 +0300 > Andy Shevchenko wrote: > > On Wed, Apr 24, 2024 at 07:38:05PM +0200, Marek Beh?n wrote: ... > > > +static void omnia_irq_mapping_drop(void *res) > > > +{ > > > + irq_dispose_mapping((unsigned int)(unsigned long)res); > > > +} > > > > Leftover? > > What do you mean? I dropped the devm-helpers.h changes, now I do > devm_add_action_or_reset() manually, with this function as the action. But why? ... > > > + irq_idx = omnia_int_to_gpio_idx[__bf_shf(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"); > > > + err = devm_add_action_or_reset(dev, omnia_irq_mapping_drop, > > > + (void *)(unsigned long)irq); > > > + if (err) > > > + return err; > > > > Are you sure it's correct now? > > Yes, why wouldn't it? For what purpose? I don't see drivers doing that. Are you expecting that the same IRQ mapping will be reused for something else? Can you elaborate how? (I can imagine one theoretical / weird case how to achieve that, but impractical.) Besides above, this is asymmetrical call to gpiod_to_irq(). If we really care about this, it should be provided by GPIO library. -- With Best Regards, Andy Shevchenko