Received: by 2002:a05:6500:2018:b0:1fb:9675:f89d with SMTP id t24csp687185lqh; Fri, 31 May 2024 13:14:04 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWgwzBhknl3vumryafCYa59BRej8NaKJmGLlOG1SNGhZD5XFzR+z6py8EeJBL1WTsDYv+qA1S772YKBKPc+TBLSyV3yyPf34CxbEyxHfA== X-Google-Smtp-Source: AGHT+IFDwYlO2xWIvUF3AuGlYjE2HgxyQm7wMXKE/ExXEjr6LLQRe3F+fcfm7efhCor/m37yAndl X-Received: by 2002:a0d:d104:0:b0:61b:1de0:4546 with SMTP id 00721157ae682-62c7982afcfmr28366197b3.49.1717186444570; Fri, 31 May 2024 13:14:04 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1717186444; cv=pass; d=google.com; s=arc-20160816; b=0IprAZfnOfWn6/CvMP17m8PzhnbfKeXL0p4sUdh402t/ZG8PSXxW5NeQ6db4Vxeow5 ixalxSIU1rNAEnncIaR9s8UA7RSkimS90xjbs2H6PqrfQpLiNOFxnrOVQgSHWXu4lrkT mZ+NlB3kwQY21dDeCJAfulILzgg9bVi2pVjI7LApwbMMpSk7KcjEZM2gSeeSePNYX8Dv bqHdHNa6g0YgTa1ecbZSGWgCqEaDDQR8laAD7lDz8mAxJ97eBm5byZ72rYdGqfokLAlg Nr9QQMFVWjLn9BsXdWElTsi5f1QsDerAfttrN5qpa2S1nimA5Q3mNissiLjsMTlqW2Km bOIw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=IMWkqEz3tcT2fpRarPXYT4LJHuLYonGiraVHDo/QMJA=; fh=T1CnmOGzne1jMIFnuaKK3rIuzgRrIpSUKc8rp88+MWQ=; b=Dm6/vqdMtz9CdjHnCxdM2fDL77miJ5em+WSNlfrHpE2I6lAxTbPX60lRTbO2OqEyaM MQ+oSuWvBCOzBkkJTSDvRmLYl9KEhQuAEM5C7kBpbhuxUUyPLjXiaRL54gDjmlcEyedo epLaAouuJfBNDZ0lkSk3ThufrfTFzc3X/UuRWttI/3roXkp3ybsG/3olLlc3Cw7hBi6z 7/YVFpjKmJEZP4PPykyULbK1XE4zkFMplWRNxz6LNdZ2QqI+RIvMCaFTlRdeiN8lPW+p oljzWOaAEbcwmfgANNKnxJwFQFBmOFvhSEawtgTmrM6ExoL7vkPB15RArP3Un/1+gHNF CZuA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Up9l4fE+; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-crypto+bounces-4626-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4626-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id af79cd13be357-794f2f04ffbsi275407385a.87.2024.05.31.13.14.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 31 May 2024 13:14:04 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto+bounces-4626-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@wanadoo.fr header.s=t20230301 header.b=Up9l4fE+; arc=pass (i=1 spf=pass spfdomain=wanadoo.fr dkim=pass dkdomain=wanadoo.fr dmarc=pass fromdomain=wanadoo.fr); spf=pass (google.com: domain of linux-crypto+bounces-4626-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-4626-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=wanadoo.fr 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 87C601C20D95 for ; Fri, 31 May 2024 20:14:00 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 31E6417D88A; Fri, 31 May 2024 20:13:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="Up9l4fE+" X-Original-To: linux-crypto@vger.kernel.org Received: from smtp.smtpout.orange.fr (smtp-24.smtpout.orange.fr [80.12.242.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B3E571946F; Fri, 31 May 2024 20:13:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717186434; cv=none; b=ER4qO4XcdzAROO+kn3NzqA7dKbet/mE0VgTVizkmwiHsm4Nhtkx8sYVM+PcjwXuHiXMpNSKfLh8YZZZupZpDLWYGtW6JlM8sDP9TQFiHFvbtnMiN8dz3jwmPciOmx5zEGWVTWpRgofMRqZMYqwXctX8xUR5+0o2oiiZcf3u0HnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1717186434; c=relaxed/simple; bh=w6X6T/ksufCsAz4gKWToTB/1NUfx2HyXeF6R64j7EVQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=CjS2ik28eY+E1TNPbJoOJDEfl6hEVVSkxpz20Qf2Nam9LD0p1Z482UA+c0mvyLvDVT6SPemfLfUVaG6y+rGbiWFG6G5s6nHj5lHS9xLKYAOqp2P4TJaeU/s6YqCdNY55rApouyYaAj8bJ74FPbfCCHR3W+VVPoNHndJebn67wjM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=Up9l4fE+; arc=none smtp.client-ip=80.12.242.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Received: from [192.168.1.37] ([86.243.17.157]) by smtp.orange.fr with ESMTPA id D8UfsaUbIp3DQD8UfsPBfT; Fri, 31 May 2024 22:04:56 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1717185896; bh=IMWkqEz3tcT2fpRarPXYT4LJHuLYonGiraVHDo/QMJA=; h=Message-ID:Date:MIME-Version:Subject:To:From; b=Up9l4fE+1Acu5z0JyIgdduw8EDNsBJpvZBzn+1QGM8ZH+B1vhLvhfrbHVYkCl7ele oxCAPYYjwh+PvWEKKWurdX8Gs8d7BmbEDWRsm2Lqw3XqIsusbpNhaZAfXl3/YX5vMx eVxjnXtmSuWftN0V56LBawSd2aXq6XQENGC+13UYvIAXU8YqN/a9fdobJOeLsXGyGG x37iBNUR0Bj3g+zjyoTMJaaxL1HSpkjLJgItZCgL1zG3ZJn4fVqO1eF3eaUQT3bpkr YXm8efQ+aFxsTFdtcdGVh+3XyGBI7tX98vTi+pMUJTaDY4c0n9Uis1pYXhiqtKFVK4 4afmwchI27h6w== X-ME-Helo: [192.168.1.37] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Fri, 31 May 2024 22:04:56 +0200 X-ME-IP: 86.243.17.157 Message-ID: <95572851-8750-4a1f-8034-443e0bc9c6b8@wanadoo.fr> Date: Fri, 31 May 2024 22:04:52 +0200 Precedence: bulk X-Mailing-List: linux-crypto@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] crypto: tegra - Remove an incorrect iommu_fwspec_free() call in tegra_se_remove() To: Akhil R , Herbert Xu Cc: "David S. Miller" , Thierry Reding , Jon Hunter , "linux-kernel@vger.kernel.org" , "kernel-janitors@vger.kernel.org" , "linux-crypto@vger.kernel.org" , "linux-tegra@vger.kernel.org" References: Content-Language: en-MW From: Marion & Christophe JAILLET In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Le 31/05/2024 à 07:36, Akhil R a écrit : >> -----Original Message----- >> From: Herbert Xu >> Sent: Friday, May 31, 2024 10:53 AM >> To: Akhil R >> Cc: Christophe JAILLET ; David S. Miller >> ; Thierry Reding ; Jon >> Hunter ; linux-kernel@vger.kernel.org; kernel- >> janitors@vger.kernel.org; linux-crypto@vger.kernel.org; linux- >> tegra@vger.kernel.org >> Subject: Re: [PATCH] crypto: tegra - Remove an incorrect iommu_fwspec_free() >> call in tegra_se_remove() >> >> External email: Use caution opening links or attachments >> >> >> On Wed, May 29, 2024 at 06:53:42AM +0000, Akhil R wrote: >>>> The only iommu function call in this driver is a >>>> tegra_dev_iommu_get_stream_id() which does not allocate anything and >> does >>>> not take any reference. >>>> >>>> More-over, what is freed is "se->dev" which has been devm_kzalloc()'ed in the >>>> probe. >>> I did not completely understand what is being tried to convey here. >>> If I understand it right, iommu_fwspec_free() does not do anything >>> with the "devm_kzalloc"ed variable. >>> >>> It would probably be a good idea to remove this line from the commit message. >> I think he means that as the memory was allocated via devm, it will >> be automatically freed by the kernel and the driver does not need >> to (and should not) free the memory by hand. Yes, that is my point. > Ya. But iommu_fwspec_free() does not free the memory allocated via devm. > > I think iommu_fwspec_free() is expected to be called in symmetry with > iommu_fwspec_init(). So, I do agree that the SE driver does not allocate > what is freed by iommu_fwspec_free(), but I feel this line is a bit misleading. > Yes, I spoke too fast. What is freed is dev_iommu_fwspec_get(dev);, not dev. So the sentence I wrote makes no sense and should be removed :( CJ