From patchwork Mon Nov 24 14:44:22 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Joseph Barrow X-Patchwork-Id: 10417 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.176.167]) by ozlabs.org (Postfix) with ESMTP id D5573DDDEF for ; Tue, 25 Nov 2008 01:44:49 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752710AbYKXOop (ORCPT ); Mon, 24 Nov 2008 09:44:45 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1752697AbYKXOoo (ORCPT ); Mon, 24 Nov 2008 09:44:44 -0500 Received: from mailer1.option.com ([81.246.70.162]:37167 "EHLO mailer1.option.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752687AbYKXOon (ORCPT ); Mon, 24 Nov 2008 09:44:43 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvIAAIBMKkkKAAAZ/2dsb2JhbAAI0GWCfA Received: from unknown (HELO smtp3.option.com) ([10.0.0.25]) by mailer1.option.local with ESMTP; 24 Nov 2008 15:44:24 +0100 Received: from [10.30.1.46] ([10.30.1.46]) by smtp3.option.com with Microsoft SMTPSVC(6.0.3790.3959); Mon, 24 Nov 2008 15:44:22 +0100 Message-ID: <492ABDC6.90208@option.com> Date: Mon, 24 Nov 2008 15:44:22 +0100 From: Denis Joseph Barrow User-Agent: Thunderbird 2.0.0.16 (X11/20080724) MIME-Version: 1.0 To: Linux USB kernel mailing list , Linux netdev Mailing list Subject: respin of patches for linux-2.6.28-rc6 hso_einval.patch [patch 3/6] X-OriginalArrivalTime: 24 Nov 2008 14:44:22.0467 (UTC) FILETIME=[23A6A930:01C94E43] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Added check for IFF_UP in hso_resume, this should eliminate -EINVAL (-22) errors caused from urb's being submitted twice, once by hso_resume & once in hso_net_open, if suspend/resume USB power saving mode is enabled Signed-off-by: Denis Joseph Barrow Added check for IFF_UP in hso_resume, this should eliminate -EINVAL (-22) errors caused from urb's being submitted twice, once by hso_resume & once in hso_net_open, if suspend/resume USB power saving mode is enabled Signed-off-by: Denis Joseph Barrow --- Index: linux-2.6.28-rc6.patches/drivers/net/usb/hso.c =================================================================== --- linux-2.6.28-rc6.patches.orig/drivers/net/usb/hso.c 2008-11-24 14:10:15.000000000 +0100 +++ linux-2.6.28-rc6.patches/drivers/net/usb/hso.c 2008-11-24 14:19:17.000000000 +0100 @@ -2762,18 +2762,21 @@ if (network_table[i] && (network_table[i]->interface == iface)) { hso_net = dev2net(network_table[i]); - /* First transmit any lingering data, then restart the - * device. */ - if (hso_net->skb_tx_buf) { - dev_dbg(&iface->dev, - "Transmitting lingering data\n"); - hso_net_start_xmit(hso_net->skb_tx_buf, - hso_net->net); - hso_net->skb_tx_buf = NULL; + if (hso_net->flags & IFF_UP) { + /* First transmit any lingering data, + then restart the device. */ + if (hso_net->skb_tx_buf) { + dev_dbg(&iface->dev, + "Transmitting" + " lingering data\n"); + hso_net_start_xmit(hso_net->skb_tx_buf, + hso_net->net); + hso_net->skb_tx_buf = NULL; + } + result = hso_start_net_device(network_table[i]); + if (result) + goto out; } - result = hso_start_net_device(network_table[i]); - if (result) - goto out; } }