From patchwork Mon Nov 10 12:58:41 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Brice Goglin X-Patchwork-Id: 8007 X-Patchwork-Delegate: jgarzik@pobox.com Return-Path: X-Original-To: patchwork-incoming@ozlabs.org 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 44993DDDF0 for ; Tue, 11 Nov 2008 00:00:08 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754803AbYKJNAF (ORCPT ); Mon, 10 Nov 2008 08:00:05 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754744AbYKJNAF (ORCPT ); Mon, 10 Nov 2008 08:00:05 -0500 Received: from mailbox2.myri.com ([64.172.73.26]:1951 "EHLO myri.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754724AbYKJNAE (ORCPT ); Mon, 10 Nov 2008 08:00:04 -0500 Received: from [172.31.134.203] (brice-ovpn.sw.myri.com [172.31.134.203]) by myri.com (8.13.7+Sun/8.13.7) with ESMTP id mAACxmT2005559; Mon, 10 Nov 2008 04:59:49 -0800 (PST) Message-ID: <49183001.5010405@myri.com> Date: Mon, 10 Nov 2008 13:58:41 +0100 From: Brice Goglin User-Agent: Mozilla-Thunderbird 2.0.0.17 (X11/20081018) MIME-Version: 1.0 To: Jeff Garzik CC: netdev@vger.kernel.org Subject: [PATCH 2.6.28] myri10ge: fix stop/go ordering even more X-Enigmail-Version: 0.95.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org The doorbell writes may be seen out of order by the firmware if they are in WC memory since the tx spin(un)lock does not flush WC writes. Hence if the "stop" is written on a different CPU than the "go", it is possible that the stop will arrive after the go unless we add an explicit memory barrier (and mmiowb() is not enough). It fixes transmit hangs in multi tx queue mode. Signed-off-by: Brice Goglin --- To unsubscribe from this list: send the line "unsubscribe netdev" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- linux-git/drivers/net/myri10ge/myri10ge.c 2008-11-07 10:01:32.000000000 +0100 +++ linux-tmp/drivers/net/myri10ge/myri10ge.c 2008-11-07 13:58:07.000000000 +0100 @@ -75,7 +75,7 @@ #include "myri10ge_mcp.h" #include "myri10ge_mcp_gen_header.h" -#define MYRI10GE_VERSION_STR "1.4.3-1.375" +#define MYRI10GE_VERSION_STR "1.4.3-1.378" MODULE_DESCRIPTION("Myricom 10G driver (10GbE)"); MODULE_AUTHOR("Maintainer: help@myri.com"); @@ -1393,6 +1393,7 @@ if (tx->req == tx->done) { tx->queue_active = 0; put_be32(htonl(1), tx->send_stop); + mb(); mmiowb(); } __netif_tx_unlock(dev_queue); @@ -2865,6 +2866,7 @@ if ((mgp->dev->real_num_tx_queues > 1) && tx->queue_active == 0) { tx->queue_active = 1; put_be32(htonl(1), tx->send_go); + mb(); mmiowb(); } tx->pkt_start++;