Return-path: Received: from mail-ot0-f179.google.com ([74.125.82.179]:41823 "EHLO mail-ot0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751589AbeDLMqY (ORCPT ); Thu, 12 Apr 2018 08:46:24 -0400 Received: by mail-ot0-f179.google.com with SMTP id m22-v6so5798304otf.8 for ; Thu, 12 Apr 2018 05:46:24 -0700 (PDT) MIME-Version: 1.0 In-Reply-To: References: <20180410174245.1116-1-daniel@zonque.org> <20180410174245.1116-2-daniel@zonque.org> From: Loic Poulain Date: Thu, 12 Apr 2018 14:45:43 +0200 Message-ID: (sfid-20180412_144628_164656_7E14E291) Subject: Re: [PATCH 1/1 RFC] wcn36xx: fix buffer commit logic on TX path To: Daniel Mack Cc: linux-wireless@vger.kernel.org, wcn36xx@lists.infradead.org, Kalle Valo , Ramon Fried , Bjorn Andersson Content-Type: text/plain; charset="UTF-8" Sender: linux-wireless-owner@vger.kernel.org List-ID: On 11 April 2018 at 15:37, Daniel Mack wrote: > Hi Loic, > > On Wednesday, April 11, 2018 03:30 PM, Loic Poulain wrote: >>> /* Move the head of the ring to the next empty descriptor */ >>> - ch->head_blk_ctl = ctl->next; >>> + ch->head_blk_ctl = ctl_skb->next; >>> + >>> + /* Commit all previous writes and set descriptors to VALID */ >>> + wmb(); >> >> Is this first memory barrier really needed? from what I understand, we >> only need to ensure that the control descriptor is marked valid at the >> end of the procedure and we don't really care about the paylod one. > > Well, without documentation or the firmware sources, that's just > guesswork at this point. My assumption is only based on the weird > comments and workarounds in the downstream driver. > > I added the second barrier to ensure that no descriptor is ever marked > valid unless all other bits are definitely in sync. Fair enough!