Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp663244pxf; Thu, 18 Mar 2021 08:54:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz27anYaZqDsaqab5jAtB7cIn3+AxYE2QU9sT733UpiAEfm3Tk0bD9yzw73/hoKP+DluagA X-Received: by 2002:a05:6402:168c:: with SMTP id a12mr4546470edv.344.1616082876761; Thu, 18 Mar 2021 08:54:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1616082876; cv=none; d=google.com; s=arc-20160816; b=jE5UgvKnLAQL+uk/y3LF2cZPkBjuLkomOCltQqolSI2wD4FUih+z+vht/DpvsuijT5 vG9XqeZU52G6Io1XYJDgq5whaQWmFyQDwy9y+IptsJLs8Aqc8YMVjyTi53nYWlPDd/X3 oKXYwnMnkkrqjsGPXlFOz0HQlF7DaPX4y/GN+4G5L/PWM7bjCXHUx08qm2QQ6nUxxQeh yE3c1DDjup2k4XS9VR/W8lOaT3ppnGq15T05xuX+ThpU9hpILuRcBwP9Q+PmC//0ppJs kiTcx5qzZ+anIztP/vVhPT3EtRlOPqUB6imr6UzJHJrL3A2Cj/Y2kqVR+9JiGBSV3mKp mbFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=NxOq6PipN2ILMIhsqJXRTk98B9EgAjKQgjKmszlblh8=; b=Bwvarbp8V26auriKlgOlUKNxe47QPdayk7EwsswjC57plOivagH1q80dyW+Sh702RV Ag81zscsipl0Nuqv2T0UtocwFnfUT6+3jZMmd1bgyHaqH9z8t5nHXI0igKBLSNFwX8jC xiF2HfFhHlqER32jkbqNWZq0/ifb7goFQTylIq6InDs6oxQMGpTWp9s0U2vvekM1O5zp /qbA9G4k/gj8wvJK2suMsLpk3rlZD23NOv7PwS+zBEhuLqW3chLq9ZpIMBqUQPM/4Qn0 DaLT/w0eAqUHOqbeRF+SjkbpjJ91x6WH3vZ8CSh5TUileGuFG/tCwkG1/v1jAzaNVXq+ jwxA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id w5si1741562ejz.607.2021.03.18.08.54.04; Thu, 18 Mar 2021 08:54:36 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231596AbhCRPxY (ORCPT + 99 others); Thu, 18 Mar 2021 11:53:24 -0400 Received: from mga03.intel.com ([134.134.136.65]:43307 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232080AbhCRPxN (ORCPT ); Thu, 18 Mar 2021 11:53:13 -0400 IronPort-SDR: nOBe3Y3Xf8lM3IbsuxPsRz6QlOh3jEgo+y+s+taQMa6gTsF0wwGIMb+2OlgpLSw+BkH7KHKBOK arTP79aEdfOw== X-IronPort-AV: E=McAfee;i="6000,8403,9927"; a="189750718" X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="189750718" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 08:53:13 -0700 IronPort-SDR: uQ86AuMPb1Evn73ZqS2y10PMl5tuwOGD5Cmv6ypUv/3hQh3ZYoO/1gzFw6dUW9AVvX3tjQLanw u2rHoSOmAlKw== X-IronPort-AV: E=Sophos;i="5.81,259,1610438400"; d="scan'208";a="439783034" Received: from silpixa00400314.ir.intel.com (HELO silpixa00400314) ([10.237.222.51]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Mar 2021 08:53:10 -0700 Date: Thu, 18 Mar 2021 15:53:03 +0000 From: Giovanni Cabiddu To: Tong Zhang Cc: Herbert Xu , "David S. Miller" , Andy Shevchenko , Wojciech Ziemba , Fiona Trahe , qat-linux@intel.com, linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v3 1/2] crypto: qat - dont release uninitialized resources Message-ID: References: <20210312162203.2416149-1-ztong0001@gmail.com> <20210312162203.2416149-2-ztong0001@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20210312162203.2416149-2-ztong0001@gmail.com> Organization: Intel Research and Development Ireland Ltd - Co. Reg. #308263 - Collinstown Industrial Park, Leixlip, County Kildare - Ireland Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Fri, Mar 12, 2021 at 11:22:02AM -0500, Tong Zhang wrote: > adf_vf_isr_resource_alloc() is not unwinding correctly when error > happens and it trys to release uninitialized resources. > To fix this, only release initialized resources. > > [ 1.792845] Trying to free already-free IRQ 11 > [ 1.793091] WARNING: CPU: 0 PID: 182 at kernel/irq/manage.c:1821 free_irq+0x202/0x380 > [ 1.801340] Call Trace: > [ 1.801477] adf_vf_isr_resource_free+0x32/0xb0 [intel_qat] > [ 1.801785] adf_vf_isr_resource_alloc+0x14d/0x150 [intel_qat] > [ 1.802105] adf_dev_init+0xba/0x140 [intel_qat] > > Signed-off-by: Tong Zhang > Reviewed-by: Andy Shevchenko I would add also a Fixes tag: Fixes: dd0f368398ea ("crypto: qat - Add qat dh895xcc VF driver") Minor nit, typo in commit message: dont --> don't/do not Apart from that Acked-by: Giovanni Cabiddu -- Giovanni > --- > drivers/crypto/qat/qat_common/adf_vf_isr.c | 17 +++++++++++++---- > 1 file changed, 13 insertions(+), 4 deletions(-) > > diff --git a/drivers/crypto/qat/qat_common/adf_vf_isr.c b/drivers/crypto/qat/qat_common/adf_vf_isr.c > index 38d316a42ba6..888388acb6bd 100644 > --- a/drivers/crypto/qat/qat_common/adf_vf_isr.c > +++ b/drivers/crypto/qat/qat_common/adf_vf_isr.c > @@ -261,17 +261,26 @@ int adf_vf_isr_resource_alloc(struct adf_accel_dev *accel_dev) > goto err_out; > > if (adf_setup_pf2vf_bh(accel_dev)) > - goto err_out; > + goto err_disable_msi; > > if (adf_setup_bh(accel_dev)) > - goto err_out; > + goto err_cleanup_pf2vf_bh; > > if (adf_request_msi_irq(accel_dev)) > - goto err_out; > + goto err_cleanup_bh; > > return 0; > + > +err_cleanup_bh: > + adf_cleanup_bh(accel_dev); > + > +err_cleanup_pf2vf_bh: > + adf_cleanup_pf2vf_bh(accel_dev); > + > +err_disable_msi: > + adf_disable_msi(accel_dev); > + > err_out: > - adf_vf_isr_resource_free(accel_dev); > return -EFAULT; > } > EXPORT_SYMBOL_GPL(adf_vf_isr_resource_alloc); > -- > 2.25.1 >