From mboxrd@z Thu Jan 1 00:00:00 1970 Received: with ECARTIS (v1.0.0; list linux-mips); Tue, 20 Nov 2012 09:11:52 +0100 (CET) Received: from nbd.name ([46.4.11.11]:36134 "EHLO nbd.name" rhost-flags-OK-OK-OK-OK) by eddie.linux-mips.org with ESMTP id S6816668Ab2KTILv2iq0D (ORCPT ); Tue, 20 Nov 2012 09:11:51 +0100 Message-ID: <50AB3AFF.2000001@phrozen.org> Date: Tue, 20 Nov 2012 09:10:39 +0100 From: John Crispin User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.7) Gecko/20120922 Icedove/10.0.7 MIME-Version: 1.0 To: Hauke Mehrtens CC: ralf@linux-mips.org, linux-mips@linux-mips.org, linux-wireless@vger.kernel.org, florian@openwrt.org, zajec5@gmail.com, m@bues.ch Subject: Re: [PATCH 1/8] bcma: add locking around GPIO register accesses References: <1353365877-11131-1-git-send-email-hauke@hauke-m.de> <1353365877-11131-2-git-send-email-hauke@hauke-m.de> In-Reply-To: <1353365877-11131-2-git-send-email-hauke@hauke-m.de> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-archive-position: 35054 X-ecartis-version: Ecartis v1.0.0 Sender: linux-mips-bounce@linux-mips.org Errors-to: linux-mips-bounce@linux-mips.org X-original-sender: john@phrozen.org Precedence: bulk List-help: List-unsubscribe: List-software: Ecartis version 1.0.0 List-Id: linux-mips X-List-ID: linux-mips List-subscribe: List-owner: List-post: List-archive: X-list: linux-mips Return-Path: Hi Hauke > u32 bcma_chipco_gpio_in(struct bcma_drv_cc *cc, u32 mask) > { > - return bcma_cc_read32(cc, BCMA_CC_GPIOIN)& mask; > + unsigned long flags; > + u32 res; > + > + spin_lock_irqsave(&cc->gpio_lock, flags); > + res = bcma_cc_read32(cc, BCMA_CC_GPIOIN)& mask; > + spin_unlock_irqrestore(&cc->gpio_lock, flags); > + > + return res; > } > Hi Hauke, do you need to lock the read access ? if bcma_cc_read32() is a simple memory read wrapper you most likely wont need the lock John