From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751342AbdALLAg (ORCPT ); Thu, 12 Jan 2017 06:00:36 -0500 Received: from wolverine01.qualcomm.com ([199.106.114.254]:34457 "EHLO wolverine01.qualcomm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750838AbdALLAe (ORCPT ); Thu, 12 Jan 2017 06:00:34 -0500 X-IronPort-AV: E=Sophos;i="5.33,349,1477983600"; d="scan'208";a="254964159" X-IronPort-AV: E=McAfee;i="5700,7163,8405"; a="1289445168" Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: Re: [1/2] ath9k: ar9002_mac: kill off ACCESS_ONCE() From: Kalle Valo In-Reply-To: <1482864599-19995-2-git-send-email-mark.rutland@arm.com> References: <1482864599-19995-2-git-send-email-mark.rutland@arm.com> To: Mark Rutland CC: , , , , , , Mark Rutland User-Agent: pwcli/0.0.0-git (https://github.com/kvalo/pwcli/) Python/2.7.12 Message-ID: <35e1ad24f23d41c7956d82b5ca9fc0e6@euamsexm01a.eu.qualcomm.com> Date: Thu, 12 Jan 2017 12:00:25 +0100 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: NASANEXM01E.na.qualcomm.com (10.85.0.31) To euamsexm01a.eu.qualcomm.com (10.251.127.40) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Mark Rutland wrote: > For several reasons, it is desirable to use {READ,WRITE}_ONCE() in > preference to ACCESS_ONCE(), and new code is expected to use one of the > former. So far, there's been no reason to change most existing uses of > ACCESS_ONCE(), as these aren't currently harmful. > > However, for some new features (e.g. KTSAN / Kernel Thread Sanitizer), > it is necessary to instrument reads and writes separately, which is not > possible with ACCESS_ONCE(). This distinction is critical to correct > operation. > > It's possible to transform the bulk of kernel code using the Coccinelle > script below. However, for some files (including the ath9k ar9002 mac > driver), this mangles the formatting. As a preparatory step, this patch > converts the driver to use {READ,WRITE}_ONCE() without said mangling. > > ---- > virtual patch > > @ depends on patch @ > expression E1, E2; > @@ > > - ACCESS_ONCE(E1) = E2 > + WRITE_ONCE(E1, E2) > > @ depends on patch @ > expression E; > @@ > > - ACCESS_ONCE(E) > + READ_ONCE(E) > ---- > > Signed-off-by: Mark Rutland > Cc: ath9k-devel@qca.qualcomm.com > Cc: Kalle Valo > Cc: linux-wireless@vger.kernel.org > Cc: ath9k-devel@lists.ath9k.org > Cc: netdev@vger.kernel.org 2 patches applied to ath-next branch of ath.git, thanks. d5a3a76a9cb8 ath9k: ar9002_mac: kill off ACCESS_ONCE() 50f3818196f5 ath9k: ar9003_mac: kill off ACCESS_ONCE() -- https://patchwork.kernel.org/patch/9489799/ Documentation about submitting wireless patches and checking status from patchwork: https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches