From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=198.175.65.21 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796417411; b=4Sj0NYgd9iD4W1exwngVYS68g8v104V6MUfFEtHHwhK2zmARPv4bqiGO8KyIp59c3sIC ZS0SyORiEPtHvbvN4cRqhyTyohpS2hhhSxosvrpilxtnwX4XTKCpVZmY53v1pMoQ/hoZK 37IBC6CSA1akfkoeEjInLK3+nBl/rWFVe4oNe1C0nQfPiy+w4drt1E7srE9oSQsufJAgx 34q7cY9cec8cxLNRDtqFwHF7fb6oRclzyPC17Aa1zfgXdfdSfBKoICduNJbLHMPdf+CbL dayGxU7Rmepot2osAUdja9yaKIfCtQtlOS/08c3fIga03BVQjcCpJwHxOo+DcvH12ew== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796417411; h=DMARC-Filter:DKIM-Signature:X-CSE-ConnectionGUID:X-CSE-MsgGUID: X-IronPort-AV:X-IronPort-AV:Received:X-CSE-ConnectionGUID: X-CSE-MsgGUID:X-ExtLoop1:X-IronPort-AV:Received:From:To:Cc:Subject: Date:Message-ID:X-Mailer:In-Reply-To:References:MIME-Version: Content-Transfer-Encoding; bh=AUiQF6HBXn7PeQsVUS8ditZzWBKqgTovwtXLpa/dysg=; b=vPgvrJNv/U1x5JXpr5bNDUMWyanXI4f7XCE4jlsYF90ZD9VpEI0DAj+pTFnVL5QTcQY1 0ro0ek3P3XL25G3tHK71Av2pZ1CyLa/NiYu9FR/pjiKcfCe0b+hhxAWHiKtVE6tQLTrdB v2M7Lmduq+GW3+Yngs59A8n0iVGt0ONctauKCwfFJ/eU04pwUUMYp1QlkMlKj+nkegnq9 QANIu1JbPoEKbRkL28iqANB+WMrSwk8XIURVi2jLEfibXK92FnQVE6bFe8THqglMmL/YT CkJ41JbpxyXpnJBu3+l39x/S4zQJygVYSvUqwtMdCUrMi18d/sOv6AF4r26KP8NH0IA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=IJRp2A93; arc=none smtp.remote-ip=198.175.65.21 Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.21]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AD0AF606A322; Fri, 4 Dec 2026 20:50:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org AD0AF606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.a=rsa-sha256 header.s=Intel header.b=IJRp2A93 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1796417411; x=1827953411; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=AUiQF6HBXn7PeQsVUS8ditZzWBKqgTovwtXLpa/dysg=; b=IJRp2A93jlwKQ+LcRybhIG9rDmVl5lfa1rdwmItUgNNf5PcgDMBq0wwC vppyAZ+639Fr81OPicMKrPGjEAe/z8yhB15F+TENB/fenAY1PFb/lkvre 6X29GRVJ5K3T5iu90oeQQ7L31xCW2sE/MkHNo5KexpgAHOwpMSaTtEMhC gW4SwRuLRig/Ab9nCIbn6Pyem7zhgIyOJjdr0sOkRZSxqUuMU1ft9xLEJ PYw+VTWpDF9drTLMxAS3zZLOGGhfKPsDt+iHbZRjO64SE1w1lLhlZlnB3 O5sGuaBf8vWmi5QL9a/TseyMWs5heTKucEYXVOAkJT2LCezShoiynOyf4 w==; X-CSE-ConnectionGUID: xUKHr5skQ5+S1Lxf3CAXig== X-CSE-MsgGUID: hvXW+d/gS3mVjWykWrX+iw== X-IronPort-AV: E=McAfee;i="6800,10657,11986"; a="5511496" X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="5511496" Received: from fmviesa003.fm.intel.com ([10.60.135.143]) by orvoesa113.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 04 Dec 2026 12:50:10 -0800 X-CSE-ConnectionGUID: vVWdrFiHREunGRAAlIt+3w== X-CSE-MsgGUID: UDPUoPDXRg+3FjEv+gafcg== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.29,79,1794902400"; d="scan'208";a="14369105" Received: from jf5300-15a101203tc.jf.intel.com (HELO meta-crater2c.jf.intel.com) ([10.54.113.49]) by fmviesa003.fm.intel.com with ESMTP; 04 Dec 2026 12:50:10 -0800 From: Daniel Byrne To: Frank Li Cc: Daniel Byrne , Vinod Koul , dmaengine@vger.kernel.org, Vinicius Costa Gomes , Dave Jiang , Frank Li , Fenghua Yu , Dan Williams , linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: Re: [PATCH v2 09/10] dmaengine: idxd: free the queue interrupt when the percpu_ref setup fails Date: Fri, 4 Dec 2026 12:44:01 -0800 Message-ID: <20261204204401.3137997-1-daniel1.byrne@intel.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: References: <20261130194721.1900266-1-daniel1.byrne@intel.com> <20261130194721.1900266-10-daniel1.byrne@intel.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Transfer-Encoding: 8bit On Thu, 3 Dec 2026 17:44:01 +0000, Frank Li wrote: > > + idxd_wq_free_irq(wq); > > idxd_wq_free_resources(wq); > > + goto err_irq; > > why need go to here. avoid goto again at error path. Hi Frank, Thanks for the review. The goto was there because the interrupt has to be freed before the resources on this path. idxd_wq_free_resources() clears the queue's type, and idxd_wq_free_irq() returns right away for a queue that is not a kernel queue. So I could not just let it fall through to the label below, which frees the interrupt after the resources. I will fix this in v3. I think a better way is to allocate the resources before the interrupt is requested. Then the unwind frees the interrupt first and falls straight through to err_irq label (and below): err_ref: idxd_wq_free_irq(wq); err_irq: idxd_wq_free_resources(wq); err_res_alloc: idxd_wq_unmap_portal(wq); idxd_drv_disable_wq() also frees the interrupt before the resources. I tested it and it leaves no interrupt or allocation behind. Thanks, Daniel