Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp3438443imm; Fri, 25 May 2018 05:51:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpuznUiFLmIbAs7QGPbT1LL9rdQUGdbSeDtOcQCqzYKWWO60wQQyZJkcu26Bvr88pplNPxh X-Received: by 2002:a17:902:7d94:: with SMTP id a20-v6mr2523160plm.123.1527252672073; Fri, 25 May 2018 05:51:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527252672; cv=none; d=google.com; s=arc-20160816; b=em9tebsY6VGfK8hFtHGVxoP/0NYYYHE9dqJRreB53hrIBGtIhymQ4G9CIHgxE+YYKB JGmaMGdkmiBKPsRHvs9qWHOw0m9/wnC+Fc+UXS04WZRAPzv22jlLn42Jlc0fPnmE6d2O RaIwx72XdV3wi0VJijkXhSP4CFX6mNgifoalMSU3N7nRN9IiuQNK5kS4GBaO3+GOwhku 1HZcYfSDJe+IbAjhsRGh+HQn8Ng3u8uDwWCv8YoVqzI7XhPU/hxQ1corIcZD9UQGg+AE 0G0qukU1nFYJNrqSxGwT96T51+tf5EFDhopAKsWu+aeI//32gQKWZIDubKN/uHWtcb7p xsdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=rzWLX8oCu+/4AHijWiEk/rB+JIAaY7Ujri2HIEFPwy0=; b=nj4Be33A3hyUpvmjTZODpq7m3XLLAKNVpP9HKjqiwpP9ut1lmzGip+FtnEqFosPT86 VmlxFE9cmNUZVjhSLR/UNlihwbbqDjyXtB3h3WQqLm7t4ktJATKUFZjf1EqbPH+O0Bxz iST6EtFemjoQtzPypD2+SukYRR06GOlDBaiEICgkVQNlopWsCKfGN3RKrNxdTmalMysZ cHt0s/ItkJCi/MWQ0RQ11tQogOPSGAL4qANLXuwRR4vq+o1he5ITrKIMWdRUTy96lgj9 2Z4RJCLfw8c5/Ss3ojMJyRC4LqFn2xwvQy/sSykKHRyXbc/AXeX4mLmModz7q66IuQgW eTfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bobcopeland-com.20150623.gappssmtp.com header.s=20150623 header.b=gbyFLEn3; 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 l63-v6si22863102plb.49.2018.05.25.05.50.57; Fri, 25 May 2018 05:51:12 -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; dkim=pass header.i=@bobcopeland-com.20150623.gappssmtp.com header.s=20150623 header.b=gbyFLEn3; 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 S935679AbeEYMu3 (ORCPT + 99 others); Fri, 25 May 2018 08:50:29 -0400 Received: from mail-io0-f195.google.com ([209.85.223.195]:43843 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935375AbeEYMuZ (ORCPT ); Fri, 25 May 2018 08:50:25 -0400 Received: by mail-io0-f195.google.com with SMTP id t23-v6so6239389ioc.10 for ; Fri, 25 May 2018 05:50:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bobcopeland-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=rzWLX8oCu+/4AHijWiEk/rB+JIAaY7Ujri2HIEFPwy0=; b=gbyFLEn39l8uqo1BzKnSm8VIeJNairbWc1+AK4cIMGzwNWhRBoKO3uVbRsovqT3tYz rTyDEr11aX64pNbD0YgjWb+/9wySl/LfNxlfA1fmyaI6OUYK0CmeeTLImCJqEFL2lfU8 1gGQaNrI7V5K2Lj9MCZpDXnbXQTRPDqwEp3BsZzmPVgtGHlczr6Rl4Mw5nzEtGYyoVVC 5vEc1xRrfJ7hkISFtJ/egR8/qpjrFwfeXPPbTfIbjISStpHUWS6kaxLG4ZmF4YciJEiI nrYj2kfmWI01ty1ZKH5SZc+wwwykEmlZZGldqOEdW31gnOBxKynrdME6Cq3h1eX9IUl4 G66g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=rzWLX8oCu+/4AHijWiEk/rB+JIAaY7Ujri2HIEFPwy0=; b=sATRoayUYghHfF8V8YppgHnuwXmO7NWgVtpJ1q8wexG+lAfW7SffiQCqXu2A+l6T8V iURoE2RU0dq3t4Rk4YL1kge8Fpw/vRj+pTfem/z3JZxi1iwbQOhnYEN65g8rJOg8jbTV wgQU0lTV6oXBeKe1eCAMJC9q8ndU70xWXy7nJ6mY5povmB7kX5TgKVEBKt2P2WB3WTI3 fgB87VlBOlDLDEg+mIfHG9hJXJdQrZIXMtQX+663Zlu95oGBhnIP6wz9UJxYQk7QkTT+ wgEnAqu3A+pTPZNPhtA4HMAkxT7ik0cv+4L7FWtcQvaYyDF/PvHJ3VEPW4X/i587aoAi mpbA== X-Gm-Message-State: ALKqPwd/DbFbDtcgIbX8iwa6z5HgmU/JRXsEU3Tj+Htd6DMdW0B1RjgW 1Dw8hSSHFKTSrO/hs6jpolz85A== X-Received: by 2002:a6b:d90e:: with SMTP id r14-v6mr1982314ioc.240.1527252624650; Fri, 25 May 2018 05:50:24 -0700 (PDT) Received: from hash (CPE30b5c2fb365b-CM18593342f28f.cpe.net.cable.rogers.com. [99.232.51.173]) by smtp.gmail.com with ESMTPSA id a187-v6sm3500565itd.41.2018.05.25.05.50.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 25 May 2018 05:50:24 -0700 (PDT) Received: from bob by hash with local (Exim 4.89) (envelope-from ) id 1fMCAp-0007Hx-AZ; Fri, 25 May 2018 08:50:23 -0400 Date: Fri, 25 May 2018 08:50:23 -0400 From: Bob Copeland To: Niklas Cassel Cc: Adrian Chadd , Kalle Valo , David Miller , ath10k@lists.infradead.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, Linux Kernel Mailing List Subject: Re: [PATCH] ath10k: transmit queued frames after waking queues Message-ID: <20180525125023.alc42lkgehc6iodg@localhost> References: <20180517231512.13085-1-niklas.cassel@linaro.org> <20180521203701.GA7619@localhost.localdomain> <20180524155034.xse7cfm5figfktuj@localhost> <20180525123656.GB8780@localhost.localdomain> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180525123656.GB8780@localhost.localdomain> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 25, 2018 at 02:36:56PM +0200, Niklas Cassel wrote: > A spin lock does have the advantage of ordering: memory operations issued > before the spin_unlock_bh() will be completed before the spin_unlock_bh() > operation has completed. > > However, ath10k_htt_tx_dec_pending() was called earlier in the same function, > which decreases htt->num_pending_tx, so that write will be completed before > our read. That is the only ordering we care about here (if we should call > ath10k_mac_tx_push_pending() or not). Sure. I also understand that reading inside a lock and operating on the value outside the lock isn't really the definition of synchronization (doesn't really matter in this case though). I was just suggesting that the implicit memory barrier in the spin unlock that we are already paying for would be sufficient here too, and it matches the semantic of "tx fields under tx_lock." On the other hand, maybe it's just me, but I tend to look askance at just-in-case READ_ONCEs sprinkled about. -- Bob Copeland %% https://bobcopeland.com/