Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp6426441rwb; Wed, 18 Jan 2023 05:10:33 -0800 (PST) X-Google-Smtp-Source: AMrXdXtL/hpVYP0YNs3HBEMbrW4IJ8A2mG0QU6n3AHFuWWcROyzzlr74czIvw76HpQKlaccI2Olw X-Received: by 2002:a17:906:e13:b0:870:f0c8:8187 with SMTP id l19-20020a1709060e1300b00870f0c88187mr6400108eji.24.1674047433181; Wed, 18 Jan 2023 05:10:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674047433; cv=none; d=google.com; s=arc-20160816; b=ENsf+9MBaBeZLgXHIqRHGVomOXNt45TMB2G0nJwJqBEmYo+mF34Et5awhqJsYcoZFe Ogj1peudeJycLnMhm+DXKZPfonL0g4tNIp0zMrd0PQ42OOXFVvejauyIc+a7gVYk8d6r zzSowoSoYN9m2f3cmaoy+I6y3YClj/aTF9uE85xLjtpBO1PPK9w+WMozZt6g0+XsfhDC t0ZoBO+Gc1NK8dhcNYIqLDHKJXOm16fi1GUmVILR+60VzEvgGNbXGr+u0pICaqX6k4sA s15wDiG1FCvUjLWuLHtBSPc9OZ4Wc1uRjBI2x+yLJtQxLCH6DTIuQ6PKhfLFT7bSla6o RrQQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=D1NDLPXX6eIS8DQJU4leWz1UJ9ycCL4KR93UYR43oRA=; b=WVv1PQHVVi3uvqHxJ+bwQQoRdRQ17nNMllLxy7K29PuHTxU+zojTQQhYzISua5sY1J zSkq41I4fZ2Yes0+wS7vlO0JAuqZyo9J0N5Z1IgXFSZRGvp80n8sK5x/Po+N6KV5jOYn xluIRZsntGN9l730bY7MyYThgWOXV1uolAKSWL1Dfj8+cJ2CEVK42jM0+7RxABbiHQ36 YOvbOZX6SWRgw5ZVz0asW3p0LrFIsiSJwDAQUInaPSj1iRoe7dQvRxLUWcabyutXoDZD mv9RU4HulEsM8JE+IK2W9d8pgoxPwyyZlWU7jw+5ivSuAlOg4Yt5mDuwNbhbQEa4phs9 pUSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pl89mAnb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dd3-20020a1709069b8300b008775fc70972si1363968ejc.186.2023.01.18.05.10.21; Wed, 18 Jan 2023 05:10:33 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=pl89mAnb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229966AbjARMpK (ORCPT + 45 others); Wed, 18 Jan 2023 07:45:10 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43778 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229887AbjARMm6 (ORCPT ); Wed, 18 Jan 2023 07:42:58 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1598659C9; Wed, 18 Jan 2023 04:07:04 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 72671615CE; Wed, 18 Jan 2023 12:07:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 12B98C433EF; Wed, 18 Jan 2023 12:07:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674043623; bh=e9Wxc55fI7ZbFULfL7bxEE4idKgMyLXHupx2KDWNs3c=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pl89mAnbxEPV7q155R0vxt+UvOffs9p2DQhqxn+3c2od2Hj3XeRpTb7ExSZyxUmcC K5+UcAQGxZmoD5/6wGv36X2U8aMtHVeeK9uYifo06TVhWc/gVKt6OY9iDMrgnWlf4Y cjl3kp5ckTdluTrvjTr/RsVZhudpewtn0+iPhrYUTkP/dV2jhbQ1s07NQY5mnrEeeQ Sdg8xyEU4SyO5Z2d1ggw8Jru4toJJsBU4qkFWb6WDO+4EqHbVvn8GNIY5fEcqa+ZQU Dxh6b/zgd756WM171fkzmhDcxpo/qM4aEsGT2SrXzfwe38nwqgBn4p99BbwaAZQVpg 6uEll/ZZfxTDw== Date: Wed, 18 Jan 2023 17:36:59 +0530 From: Vinod Koul To: Koba Ko Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, Jerry Snitselaar , Jie Hai , Dave Jiang , Joel Savitz Subject: Re: [PATCH V3] dmaengine: Fix double increment of client_count in dma_chan_get() Message-ID: References: <20221201030050.978595-1-koba.ko@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20221201030050.978595-1-koba.ko@canonical.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 01-12-22, 11:00, Koba Ko wrote: > The first time dma_chan_get() is called for a channel the channel > client_count is incorrectly incremented twice for public channels, > first in balance_ref_count(), and again prior to returning. This > results in an incorrect client count which will lead to the > channel resources not being freed when they should be. A simple > test of repeated module load and unload of async_tx on a Dell > Power Edge R7425 also shows this resulting in a kref underflow > warning. Applied, thanks -- ~Vinod