Received: by 2002:a25:b794:0:0:0:0:0 with SMTP id n20csp7538865ybh; Thu, 8 Aug 2019 18:13:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+fmNGuL1BCimArVWJiAyuS/cCYJtwG2W7jF/sMGAUgdxifuKTKhFfuhJESzNBLyep+FZs X-Received: by 2002:a17:902:346:: with SMTP id 64mr8256467pld.151.1565313209169; Thu, 08 Aug 2019 18:13:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565313209; cv=none; d=google.com; s=arc-20160816; b=VyFqlON+6FJal72WRie2woC49EQFdlqCNjqpH3URtrqcUfrX6sxMFR0cVgiDVrav7g nY7fPT/Odfo4A6CdL4iHicY4AOlUU9Gq5cjQt8wIaFv9gEfx0hxvSDlBLWjlkPc4t75M uWHcO+E06TUY7RAI5//hl9X6Z0/RUBHWEnNaPIDlMjOwlArtJAv4l3JpG0hZZtbq6f+m SHhqunK8nCkk2Yf2uRzvd7t1JaYvlkdjzVVLglCFz8bVTyLkDCA1ce8p4t3jcnXWOnZt 15+DRkquENMpbC9bcUmoGfDZZGokHIce8kXPkEfpjW0YctXnTuz/ROYsd/aacfMamAmz /n/w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:from:subject:cc:to:message-id:date; bh=ZdX8oDubfuqlX78yqjV6T0xq0JgKD30QVBabCIYNtvg=; b=uv5ATiOSoj9nk3EmQWvossEg6GlxQEJ3aoVGDf+GEvVkVi6KAzryvreCsHecO1TXI9 XHLlz1xdJFAlWxGGOGObjZM60lctKJi1pSG7LwznW1HEz1x/mfDiYNaDrlGM/r2PDKzu 1LdJfKkfPPmLiYSa55PyLGif6831YVbRcSOwJUsbzRdiFCJH4gIn4arxuGyPMbGdZE39 ibQAgT8kivxcVsNdOXR5szwRJdUN2FpTV9dlC8JkZxpdnoc+FxY75ndei//nIDxWryap WTfOn7yg1y8yEJ5RLxB0B2vXRgcIOwL7v7vJCWw5Qo2tJAsUpeBQUXikBm16wQ7SMs3S +rJw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a1si30820213pgh.570.2019.08.08.18.13.13; Thu, 08 Aug 2019 18:13:29 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2405309AbfHIBMf (ORCPT + 99 others); Thu, 8 Aug 2019 21:12:35 -0400 Received: from shards.monkeyblade.net ([23.128.96.9]:54060 "EHLO shards.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2404550AbfHIBMe (ORCPT ); Thu, 8 Aug 2019 21:12:34 -0400 Received: from localhost (unknown [IPv6:2601:601:9f80:35cd::d71]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) (Authenticated sender: davem-davemloft) by shards.monkeyblade.net (Postfix) with ESMTPSA id 2412814254E0D; Thu, 8 Aug 2019 18:12:34 -0700 (PDT) Date: Thu, 08 Aug 2019 18:12:33 -0700 (PDT) Message-Id: <20190808.181233.1012759145511078443.davem@davemloft.net> To: hslester96@gmail.com Cc: vishal@chelsio.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/2] cxgb4: smt: Add lock for atomic_dec_and_test From: David Miller In-Reply-To: <20190806025846.17022-1-hslester96@gmail.com> References: <20190806025846.17022-1-hslester96@gmail.com> X-Mailer: Mew version 6.8 on Emacs 26.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.5.12 (shards.monkeyblade.net [149.20.54.216]); Thu, 08 Aug 2019 18:12:34 -0700 (PDT) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Chuhong Yuan Date: Tue, 6 Aug 2019 10:58:46 +0800 > The atomic_dec_and_test() is not safe because it is > outside of locks. > Move the locks of t4_smte_free() to its caller, > cxgb4_smt_release() to protect the atomic decrement. > > Fixes: 3bdb376e6944 ("cxgb4: introduce SMT ops to prepare for SMAC rewrite support") > Signed-off-by: Chuhong Yuan Applied.