From patchwork Sun Aug 9 11:37:19 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike McCormack X-Patchwork-Id: 31017 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@bilbo.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from ozlabs.org (ozlabs.org [203.10.76.45]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mx.ozlabs.org", Issuer "CA Cert Signing Authority" (verified OK)) by bilbo.ozlabs.org (Postfix) with ESMTPS id CBA20B7080 for ; Sun, 9 Aug 2009 21:40:48 +1000 (EST) Received: by ozlabs.org (Postfix) id 9D42ADDDA0; Sun, 9 Aug 2009 21:40:48 +1000 (EST) Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by ozlabs.org (Postfix) with ESMTP id 036F0DDD1B for ; Sun, 9 Aug 2009 21:40:48 +1000 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751310AbZHILkb (ORCPT ); Sun, 9 Aug 2009 07:40:31 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750899AbZHILka (ORCPT ); Sun, 9 Aug 2009 07:40:30 -0400 Received: from rv-out-0506.google.com ([209.85.198.228]:28146 "EHLO rv-out-0506.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750833AbZHILka (ORCPT ); Sun, 9 Aug 2009 07:40:30 -0400 Received: by rv-out-0506.google.com with SMTP id f6so768687rvb.1 for ; Sun, 09 Aug 2009 04:40:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:sender:message-id:date:from :user-agent:mime-version:to:cc:subject:content-type :content-transfer-encoding; bh=Hn2Waf3cB8aFHhQHrNVTq6Kw9tS8xpYezw7fUy7ocr4=; b=H9KZ21Q6zf6wAK6JnKeUsF1to7AhDg8MFklOXc/9c1RtzWyBOQh3JL6oQwn/z9cWKC ttOD0xcFdFT5DpDLw576r/LOhkZi9BwWHhF9NSSwYOq8b4fN7hQHIuawGOOfoor1rdIP esmzO6w9oXdNATlqiucNbHyVaUyoPI8k2pZNs= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; b=lVb5iRUMNoZm0iq/8o+/Vukh5rzmXOyT7UAtw0jUiANh/WbDIAtNcKjYILkSTChxOh Jntc7rC190jPd+mY5F8jet4VOiqoKPwAtze1SVBFxxvczZNWRxKOhTWxS6ex3UH7Qeyw +cgZeKMDkpqKwGCiuhPhkrejTqotkCEA8yaN8= Received: by 10.140.125.1 with SMTP id x1mr149918rvc.261.1249818030631; Sun, 09 Aug 2009 04:40:30 -0700 (PDT) Received: from ?192.168.0.102? ([121.143.39.14]) by mx.google.com with ESMTPS id g14sm18022454rvb.0.2009.08.09.04.40.28 (version=SSLv3 cipher=RC4-MD5); Sun, 09 Aug 2009 04:40:29 -0700 (PDT) Message-ID: <4A7EB4EF.3030106@ring3k.org> Date: Sun, 09 Aug 2009 20:37:19 +0900 From: Mike McCormack User-Agent: Mozilla-Thunderbird 2.0.0.22 (X11/20090706) MIME-Version: 1.0 To: Stephen Hemminger CC: netdev@vger.kernel.org Subject: [PATCH] sky2: Serialize access to PCI config space Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Disable NAPI when powering up or down the phy, as sky2_err_intr may also access the PCI config space. Signed-off-by: Mike McCormack --- drivers/net/sky2.c | 7 ++++++- 1 files changed, 6 insertions(+), 1 deletions(-) diff --git a/drivers/net/sky2.c b/drivers/net/sky2.c index 8e05d29..824a319 100644 --- a/drivers/net/sky2.c +++ b/drivers/net/sky2.c @@ -1448,7 +1448,9 @@ static int sky2_up(struct net_device *dev) if (!sky2->rx_ring) goto err_out; + napi_disable(&hw->napi); sky2_mac_init(hw, port); + napi_enable(&hw->napi); /* Register is number of 4K blocks on internal RAM buffer. */ ramsize = sky2_read8(hw, B2_E_0) * 4; @@ -1880,13 +1882,16 @@ static int sky2_down(struct net_device *dev) sky2_write32(hw, B0_IMSK, imask); sky2_read32(hw, B0_IMSK); + /* after this, there should be no more interrupts for this port */ synchronize_irq(hw->pdev->irq); - napi_synchronize(&hw->napi); + napi_disable(&hw->napi); spin_lock_bh(&sky2->phy_lock); sky2_phy_power_down(hw, port); spin_unlock_bh(&sky2->phy_lock); + napi_enable(&hw->napi); + /* turn off LED's */ sky2_write16(hw, B0_Y2LED, LED_STAT_OFF);