From nobody Tue Oct 10 18:21:21 2023 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4S4kkC3ryzz4x7gb; Tue, 10 Oct 2023 18:21:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [96.47.72.83]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4S4kkC3Mh5z3Kmf; Tue, 10 Oct 2023 18:21:23 +0000 (UTC) (envelope-from jhb@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696962083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v+EHfmpnmIXXKYjJMlxtwOSmQc9oHXcLqEZ//VKu7rY=; b=FsDfm74cd9110z8MUEOk3iTpMvks4HzX/35RFCEG0e4upZtJrbe6iqGXPrc/BpWw9sIxtE iz8gE7+Xx2NyVu3bihTS6ncEDeCAy8zgHqVBJH7CiX2Xqw9CFqrDNsMJGHcWx0dwVvr/Hg kL9yaITuMZTmVSKOjr1dFWrTDC/kZrG5iYjszHAct8IQxXrGZtgJnX/Xg/E7IS1X0mm6jb 3UwoRW3m8gex8dhvVHKwH8TmXQExLIShHc47S1+TTHw0QGIhuQE4TjCBlbsafN7iaBCII4 aUd9h+eh3W76N8jsDFlwueJ3iWfBKDPrd0FbJy9y3kea5Gi+YsEmoYJmnKnEgA== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1696962083; a=rsa-sha256; cv=none; b=prAYnha5DSKggB6iq4soWtOKLAXDJFAYNzMMfBU59eTRswnrPe/9EVJyiALLP9v1ral51Z Sce8pa/snlGIu0mCDjXxn3V8e3hNNnlJa0fjGoP1ZL1cA3v4V+1LfwxXjvIB0cctNjW+TW FEpG4HnywQteABMEP5OTSIULF/1NGvFaLEvn+iJ381FSh+1md93yQlZJiuj3z8bsQg2IXk 4dCH7qnSlnqELsb57CP/f79/mJsZUisVm5pE5Wwq1j8vYAtOvNvwGunY2hC+HrU23RbDOy H32RWYNB4sA0n+kKOM55lCxuPbob6HopHQxZ0JrtZKGNWVlNhZh5CqIYqtUujg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1696962083; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=v+EHfmpnmIXXKYjJMlxtwOSmQc9oHXcLqEZ//VKu7rY=; b=uRlBJ7TLjREqLybdRZgn8k75Lh964bUEc8T/asK3KVy/oVMqJId5Wdr7J3LXUFv5yh9Jyt jQawojBI1S/LC/Kl33awG5HFRf89k/25ipZ0/Efg/RT5fMFwEkujgVc0Vh1Pa4yFCRkhTn GaMd0cAm5gZOTpGdyHUVpY0mo3w/OOngrLpRLNQZ4qzmFbNs17L1wiMBLSRfSv8cYtNwYQ 1uXUPk2ums94Jfm+gL69yocgZ4IsHXwyGS2s3J0TD8S1CcmcrZGINompEkR5UG2dcUOTa4 IgR5LznBjHx6HM40U8l7MSjTX1fEs+WYXVjnWPAM5ARlleiNJEAf1+BvVzENYw== Received: from [IPV6:2601:648:8683:39a0:d860:2ca3:b5b:8955] (unknown [IPv6:2601:648:8683:39a0:d860:2ca3:b5b:8955]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: jhb) by smtp.freebsd.org (Postfix) with ESMTPSA id 4S4kkB6JTyz1FPJ; Tue, 10 Oct 2023 18:21:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Message-ID: <0d8a9a3f-d1d0-b5ee-b50f-49eb3888f68e@FreeBSD.org> Date: Tue, 10 Oct 2023 11:21:21 -0700 List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.15.1 Content-Language: en-US To: Emmanuel Vadot , src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org References: <202310061706.396H63in060807@gitrepo.freebsd.org> From: John Baldwin Subject: Re: git: 38cbdae33b7c - main - dwc: Rewrite barrier part In-Reply-To: <202310061706.396H63in060807@gitrepo.freebsd.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 10/6/23 1:06 PM, Emmanuel Vadot wrote: > The branch main has been updated by manu: > > URL: https://cgit.FreeBSD.org/src/commit/?id=38cbdae33b7c3f772845c06f52b86c0ddeab6a17 > > commit 38cbdae33b7c3f772845c06f52b86c0ddeab6a17 > Author: Emmanuel Vadot > AuthorDate: 2023-10-06 16:04:49 +0000 > Commit: Emmanuel Vadot > CommitDate: 2023-10-06 17:05:45 +0000 > > dwc: Rewrite barrier part > > We only need a barrier after writing the OWN bit so everything is > coherent for the DMA engine. > --- > sys/dev/dwc/dwc1000_dma.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/sys/dev/dwc/dwc1000_dma.c b/sys/dev/dwc/dwc1000_dma.c > index f6baa0bd3e45..4f8ae088305a 100644 > --- a/sys/dev/dwc/dwc1000_dma.c > +++ b/sys/dev/dwc/dwc1000_dma.c > @@ -216,7 +216,6 @@ txdesc_setup(struct dwc_softc *sc, int idx, bus_addr_t paddr, > sc->txdesc_ring[idx].addr1 = (uint32_t)(paddr); > sc->txdesc_ring[idx].desc0 = desc0; > sc->txdesc_ring[idx].desc1 = desc1; > - wmb(); > sc->txdesc_ring[idx].desc0 |= TDESC0_OWN; > wmb(); > } > @@ -237,7 +236,6 @@ rxdesc_setup(struct dwc_softc *sc, int idx, bus_addr_t paddr) > sc->rxdesc_ring[idx].desc1 = ERDESC1_RCH | > MIN(MCLBYTES, ERDESC1_RBS1_MASK); > > - wmb(); > sc->rxdesc_ring[idx].desc0 = RDESC0_OWN; > wmb(); > return (nidx); > @@ -524,7 +522,6 @@ dma1000_rxfinish_locked(struct dwc_softc *sc) > > m = dwc_rxfinish_one(sc, desc, sc->rxbuf_map + idx); > if (m == NULL) { > - wmb(); > desc->desc0 = RDESC0_OWN; > wmb(); > } else { Hmm, are you sure? I suspect you removed the wrong barrier here. You want the other writes to update other fields in the desc to post before the write that sets TDESC0_OWN. The barrier after TDESC0_OWN is useless, but the one you removed is probably the one that matters. In particular you don't want TDESC0_OWN to be set when other writes (e.g. setting desc1) are not yet visible. -- John Baldwin