From patchwork Wed Jan 14 09:54:51 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Denis Joseph Barrow X-Patchwork-Id: 18412 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 17656DE114 for ; Wed, 14 Jan 2009 20:55:11 +1100 (EST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758340AbZANJzG (ORCPT ); Wed, 14 Jan 2009 04:55:06 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1758059AbZANJzE (ORCPT ); Wed, 14 Jan 2009 04:55:04 -0500 Received: from mailer2.option.com ([81.246.70.163]:2591 "EHLO mailer2.option.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757431AbZANJzB (ORCPT ); Wed, 14 Jan 2009 04:55:01 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Aj4BAFhFbUkKAAAZ/2dsb2JhbAAIzT+Fbw Received: from unknown (HELO smtp3.option.com) ([10.0.0.25]) by mailer2.option.local with ESMTP; 14 Jan 2009 10:54:59 +0100 Received: from [10.30.1.59] ([10.30.1.59]) by smtp3.option.com with Microsoft SMTPSVC(6.0.3790.3959); Wed, 14 Jan 2009 10:54:51 +0100 Message-ID: <496DB66B.4070306@option.com> Date: Wed, 14 Jan 2009 10:54:51 +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: [PATCH] hso_spinlockfix.patch X-OriginalArrivalTime: 14 Jan 2009 09:54:51.0226 (UTC) FILETIME=[24A6E3A0:01C9762E] Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Hi, This is a really important fix it fixes a consistent kernel deadlock when the hso driver starts going. It's against 2.6.29-rc1, 2.6.29-rc6 worked fine. This patch obviously wasn't tested & I neither I or Filip was subscribed to the tty mailing list to catch it. Even with this patch the driver is still broken. opening the serial port on the driver a second time causes a -EIO, I've yet to figure out what but it is not returned from hso_serial_open but a parent function. This patch fixes a double grabbing of a spinlock all functions which call put_rxbuf_data already have serial->serial_lock grabbed. Signed-off-by: Denis Joseph Barrow This patch fixes a double grabbing of a spinlock all functions which call put_rxbuf_data already have serial->serial_lock grabbed. Signed-off-by: Denis Joseph Barrow Index: linux-2.6/drivers/net/usb/hso.c =================================================================== --- linux-2.6.orig/drivers/net/usb/hso.c 2009-01-13 17:39:15.000000000 +0100 +++ linux-2.6/drivers/net/usb/hso.c 2009-01-13 17:40:42.000000000 +0100 @@ -2043,9 +2043,7 @@ return -2; } - spin_lock(&serial->serial_lock); tty = tty_kref_get(serial->tty); - spin_unlock(&serial->serial_lock); /* Push data to tty */ if (tty) {