Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp3427062pxu; Mon, 19 Oct 2020 11:46:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwTHLZlaiRgnvqIC2ET4+282FE7gu7P9kPs5JU/U1XNT7dPigTC46YYFeg37Q2wE7UMTPCk X-Received: by 2002:a17:906:234d:: with SMTP id m13mr1253587eja.497.1603133176049; Mon, 19 Oct 2020 11:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603133176; cv=none; d=google.com; s=arc-20160816; b=03w/70fCdkiLNvVHJGFZ6JeeChI2UWBCeWMRD9v8gHzvnbF5U5Pt8PoxnfbtJ+r1Hx ale65c+brOd4nYT+0iJqnKydchG5LVHU+T4Ch1stbufJmT4B8h2zaawmSulku6JMVrTE 35NkosZh/YF1WOXc5BBOzDaYnheGREwknakKr+BOlqUVg/rzDCpeQzJoXrCjI0MnYQV3 QpcyYWosvSQb0vudNJHhNDl+Qixh0zOOnGrBF6k14+j8UIgBDLX1HHbnTjUksNyy6zUB dhlAqbGoL2VCPxN2aFw46+cVaxSl5PSMtHtPJYG0O6RV1xk+ITus0ho21U0hsbHz5F9c cgTw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=2xl33sDAJ8tIciAAwtJ1IZApPXC+pKBw98rAtfPjIUQ=; b=MH6Cfzrvcq70lr356O8mx2MFvtI7Kh6wDznNGqbXCS46HKSN4ZOHkeHmbzJCHlyYlL ORD3MnIkqVwQyUY6a4nU+qMnldjOYtDJ3aCEH109NMTb5gTqUFUQX9nsofQ+E+gTFvrE MuYSETWzyleSfRV3bi7W3h4XRQ44R0uSqDZOLoWCx6coiAxJ0eho9Evgdht7xAswajXd sAmbfNnaEi8Rf+9c6lBsPr/pFgsGUWlWfkAkPI2H6nwcF5c4RgvjyjUrCywDis9LKxbP JO9FBi7ffbRPpJj5awqlgJUw+AdYcnD3MMCMpbgNBzEKmFruBU8tF9jAVwDyLTfJtnBD 2/RQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OAyygtJS; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l6si362732eds.406.2020.10.19.11.45.35; Mon, 19 Oct 2020 11:46:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=OAyygtJS; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-wireless-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 S1730842AbgJSSnW (ORCPT + 99 others); Mon, 19 Oct 2020 14:43:22 -0400 Received: from mail.kernel.org ([198.145.29.99]:59526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730710AbgJSSnW (ORCPT ); Mon, 19 Oct 2020 14:43:22 -0400 Received: from kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com (c-67-180-217-166.hsd1.ca.comcast.net [67.180.217.166]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 895C0222E9; Mon, 19 Oct 2020 18:43:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603133002; bh=b2QJk34z+3ifQSCj/0BnigPQn31Jz5SJrS4DHmzD/vk=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OAyygtJSOw+Yi89YFc+Vm0nHE25PALgzP9u5e0/nmkuS+ux1ygPQDB0+ZXkeixSWP Veh8reTviWp6TvT2wvjeBbVXuALTYFsUBwIXmTGenH/5U0OnHRZx/b2fPugHCqqIzw N5MgRga6PmDZB0iaBMFysPi1rrWma/ugYLEYG7gk= Date: Mon, 19 Oct 2020 11:43:19 -0700 From: Jakub Kicinski To: Jia-Ju Bai Cc: kvalo@codeaurora.org, davem@davemloft.net, vaibhavgupta40@gmail.com, christophe.jaillet@wanadoo.fr, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] rtl8180: avoid accessing the data mapped to streaming DMA Message-ID: <20201019114319.1b699ffa@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com> In-Reply-To: <20201019025420.3789-1-baijiaju1990@gmail.com> References: <20201019025420.3789-1-baijiaju1990@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org On Mon, 19 Oct 2020 10:54:20 +0800 Jia-Ju Bai wrote: > + if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { > + if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) > + priv->seqno += 0x10; > + hdr->seq_ctrl &= cpu_to_le16(IEEE80211_SCTL_FRAG); > + hdr->seq_ctrl |= cpu_to_le16(priv->seqno); > + } > + > mapping = dma_map_single(&priv->pdev->dev, skb->data, skb->len, > DMA_TO_DEVICE); > > @@ -534,13 +541,6 @@ static void rtl8180_tx(struct ieee80211_hw *dev, > > spin_lock_irqsave(&priv->lock, flags); > > - if (info->flags & IEEE80211_TX_CTL_ASSIGN_SEQ) { > - if (info->flags & IEEE80211_TX_CTL_FIRST_FRAGMENT) > - priv->seqno += 0x10; You're taking the priv->seqno access and modification from under priv->lock. Is that okay?