Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp935756rdb; Fri, 1 Dec 2023 02:38:39 -0800 (PST) X-Google-Smtp-Source: AGHT+IGz5x6snktMs94Dt9rnavEoydjfYAY+zRMUIFXaeBHV/HDgVYmvBBsmT/52MyFgW2osA0Kj X-Received: by 2002:a05:620a:8f83:b0:77d:751b:29c5 with SMTP id ri3-20020a05620a8f8300b0077d751b29c5mr24866992qkn.57.1701427119745; Fri, 01 Dec 2023 02:38:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701427119; cv=none; d=google.com; s=arc-20160816; b=Xm+mMGu4TH1Ueth7cIS9dHVeIuTMBbml7wL93xyrjvjtaM6+rZeBSkY2ZEQC/OHDqM jreGu+r1JUk/qybucYIgYVC82jIYLzucykDEd/L+Se+9b1SgXItXEhfJ2WRZi+TU2KAI 0ju0at4z+d4cdRGOmGrDCAl51BbBp/x9j+EwRwvfd9O0u5z9avCiBRki5Rq1uC7lqgW5 hhkUvofwO5+uHS5ktR7hshiT09LyKlGxlrgboYmm38RaOnCjN7cWodzsxdiLVvt/7DUl aPXuVQQEIHpYnDyPwFHGy66en2/rEPF3n74Ia3VK4xuCDlpYMH5KVfv5zhrSkiDRee20 snrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=FpU2akT9YCjlPmAxmxEFBhEZh1RIcd4Q9z7AayzrVTA=; fh=Y2dNocNlUzJ4dhjPPhh6s55+T5Yt8NesMHn04sSH8N8=; b=jJrv6cWF+MU/PSzFeooZ4H02RLodXNmK7ecfUTbdjIij6KbXYVgzHNAQWq3zTNVgsr +/Qhtrq0qRIuw3nU8mE++9UWluiM51AQ24YCQwa4JRSup8YQWeA88fX8VGHwRp8Otuta cy3B8nJ1tfQq3MQHhCkKMRB7qlBDteLvI6UAZPAu8rEBMDRnG9VGisJtBBpGLDdMWyjT piyVo//TZesK/Q5xSFyx2SMVVjcfW6TaUUMeN9n4UNe9yVGiFBNHiHMsTJpMjVrFZN/a cTRXrlRwnHXKtVVI8j9tYbQ70D6bg0FuuZb3ipDXRYjonL/klbY6GArMNB4jl5SskWyk gA2Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto+bounces-449-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-449-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v11-20020a05620a440b00b0077d7a493febsi3164129qkp.612.2023.12.01.02.38.39 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 02:38:39 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto+bounces-449-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; spf=pass (google.com: domain of linux-crypto+bounces-449-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-crypto+bounces-449-linux.lists.archive=gmail.com@vger.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 6BCB01C20BCD for ; Fri, 1 Dec 2023 10:38:39 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id D9376210F4 for ; Fri, 1 Dec 2023 10:38:38 +0000 (UTC) X-Original-To: linux-crypto@vger.kernel.org Received: from abb.hmeau.com (abb.hmeau.com [144.6.53.87]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2B17A8 for ; Fri, 1 Dec 2023 02:12:32 -0800 (PST) Received: from loth.rohan.me.apana.org.au ([192.168.167.2]) by formenos.hmeau.com with smtp (Exim 4.94.2 #2 (Debian)) id 1r90VY-005hlK-8c; Fri, 01 Dec 2023 18:12:29 +0800 Received: by loth.rohan.me.apana.org.au (sSMTP sendmail emulation); Fri, 01 Dec 2023 18:12:37 +0800 Date: Fri, 1 Dec 2023 18:12:37 +0800 From: Herbert Xu To: Damian Muszynski Cc: linux-crypto@vger.kernel.org, qat-linux@intel.com, Giovanni Cabiddu , Ahsan Atta Subject: Re: [PATCH] crypto: qat - add sysfs_added flag for rate limiting Message-ID: References: <20231121170252.8263-1-damian.muszynski@intel.com> 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-Disposition: inline In-Reply-To: <20231121170252.8263-1-damian.muszynski@intel.com> On Tue, Nov 21, 2023 at 06:02:23PM +0100, Damian Muszynski wrote: > The qat_rl sysfs attribute group is registered within the adf_dev_start() > function, alongside other driver components. > If any of the functions preceding the group registration fails, > the adf_dev_start() function returns, and the caller, to undo the > operation, invokes adf_dev_stop() followed by adf_dev_shutdown(). > However, the current flow lacks information about whether the > registration of the qat_rl attribute group was successful or not. > > In cases where this condition is encountered, an error similar to > the following might be reported: > > 4xxx 0000:6b:00.0: Starting device qat_dev0 > 4xxx 0000:6b:00.0: qat_dev0 started 9 acceleration engines > 4xxx 0000:6b:00.0: Failed to send init message > 4xxx 0000:6b:00.0: Failed to start device qat_dev0 > sysfs group 'qat_rl' not found for kobject '0000:6b:00.0' > ... > sysfs_remove_groups+0x2d/0x50 > adf_sysfs_rl_rm+0x44/0x70 [intel_qat] > adf_rl_stop+0x2d/0xb0 [intel_qat] > adf_dev_stop+0x33/0x1d0 [intel_qat] > adf_dev_down+0xf1/0x150 [intel_qat] > ... > 4xxx 0000:6b:00.0: qat_dev0 stopped 9 acceleration engines > 4xxx 0000:6b:00.0: Resetting device qat_dev0 > > To prevent attempting to remove attributes from a group that has not > been added yet, a flag named 'sysfs_added' is introduced. This flag > is set to true upon the successful registration of the attribute group. > > Fixes: d9fb8408376e ("crypto: qat - add rate limiting feature to qat_4xxx") > Signed-off-by: Damian Muszynski > Reviewed-by: Giovanni Cabiddu > Reviewed-by: Ahsan Atta > --- > drivers/crypto/intel/qat/qat_common/adf_rl.h | 1 + > drivers/crypto/intel/qat/qat_common/adf_sysfs_rl.c | 8 ++++++++ > 2 files changed, 9 insertions(+) Patch applied. Thanks. -- Email: Herbert Xu Home Page: http://gondor.apana.org.au/~herbert/ PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt