From patchwork Thu Feb 3 10:39:27 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anders Berggren X-Patchwork-Id: 81636 X-Patchwork-Delegate: davem@davemloft.net 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.180.67]) by ozlabs.org (Postfix) with ESMTP id 389B3B7128 for ; Thu, 3 Feb 2011 23:21:30 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932082Ab1BCMVW (ORCPT ); Thu, 3 Feb 2011 07:21:22 -0500 Received: from vsp.halon.se ([212.37.18.222]:57101 "EHLO vsp.halon.se" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S932073Ab1BCMVV convert rfc822-to-8bit (ORCPT ); Thu, 3 Feb 2011 07:21:21 -0500 X-Greylist: delayed 6108 seconds by postgrey-1.27 at vger.kernel.org; Thu, 03 Feb 2011 07:21:21 EST DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=halon.se; s=spaceship; h=received:received:subject:content-transfer-encoding:from:content-type: message-id:date:cc:to:mime-version:x-mailer; bh=YMuW2zEqI9hHPGrq01JxMdWWda0YFtnV0FdF5Bi/TWE=; b=VCY74yUx5Scz3B7ERusLIqgS5ltcrCgFuqfOqTHWY2URL3oAL/zZ1PnlQ3GSBx+/bjAJnqBOkcmDI 62bdCcsp2uZdlcrpX1tgXru+4SRYJs2jgzzxfV99zFfXIJoqFYkGiophWsUDV6sFKEkUZ1zbxhCAcb PerXxKIFHLoT4eE8= Received: from zimbra.halon.se (unknown [213.80.29.55]) by vsp.halon.se (Halon Mail Gateway) with ESMTP; Thu, 3 Feb 2011 11:39:28 +0100 (CET) Received: from pob37492.t2sthlm.corp.tele2.com (workstation.tele2.se [192.71.219.253]) by zimbra.halon.se (Postfix) with ESMTPSA id 72A023407C; Thu, 3 Feb 2011 11:39:28 +0100 (CET) Subject: [PATCH] fixing hw timestamping in igb From: Anders Berggren Message-Id: <9D02360A-8016-4BCB-B14A-DAFE22EF558E@halon.se> Date: Thu, 3 Feb 2011 11:39:27 +0100 Cc: e1000-devel@lists.sourceforge.net, netdev@vger.kernel.org, Patrick Ohly To: John Ronciak Mime-Version: 1.0 (Apple Message framework v1082) X-Mailer: Apple Mail (2.1082) Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hardware timestamping for Intel 82580 didn't work in either 2.6.36 or 2.6.37. Comparing it to Intel's igb-2.4.12 I found that the timecounter_init clock/counter initialization was done too early. Anders Berggren Halon Security lab-slang-1:~# diff -u linux-2.6.37/drivers/net/igb/igb_main.c linux/drivers/net/igb/igb_main.c --- 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-2.6.37/drivers/net/igb/igb_main.c 2011-02-03 10:02:53.000000000 +0100 +++ linux/drivers/net/igb/igb_main.c 2011-02-03 10:12:40.000000000 +0100 @@ -98,6 +98,7 @@ static void igb_setup_mrqc(struct igb_adapter *); static int igb_probe(struct pci_dev *, const struct pci_device_id *); static void __devexit igb_remove(struct pci_dev *pdev); +static void igb_init_hw_timer(struct igb_adapter *adapter); static int igb_sw_init(struct igb_adapter *); static int igb_open(struct net_device *); static int igb_close(struct net_device *); @@ -1987,6 +1988,10 @@ } #endif + + /* do hw tstamp init after resetting */ + igb_init_hw_timer(adapter); + dev_info(&pdev->dev, "Intel(R) Gigabit Ethernet Network Connection\n"); /* print bus type/speed/width info */ dev_info(&pdev->dev, "%s: (PCIe:%s:%s) %pM\n", @@ -2301,7 +2306,6 @@ return -ENOMEM; } - igb_init_hw_timer(adapter); igb_probe_vfs(adapter); /* Explicitly disable IRQ since the NIC can be in any state. */