From patchwork Sun Dec 13 13:25:25 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Marjan Fojkar X-Patchwork-Id: 67020 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nBDDVik4009389 for ; Sun, 13 Dec 2009 13:31:44 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751099AbZLMNbo (ORCPT ); Sun, 13 Dec 2009 08:31:44 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751215AbZLMNbn (ORCPT ); Sun, 13 Dec 2009 08:31:43 -0500 Received: from md2.t-2.net ([84.255.209.81]:8353 "HELO md2.t-2.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751099AbZLMNbm (ORCPT ); Sun, 13 Dec 2009 08:31:42 -0500 X-Greylist: delayed 364 seconds by postgrey-1.27 at vger.kernel.org; Sun, 13 Dec 2009 08:31:42 EST Received: from pajcevina.pajkc.eu (93-103-48-29.dynamic.dsl.t-2.net [93.103.48.29]) by md2.t-2.net (MOS 3.10.8-GA) with ESMTP id FHX76653; Sun, 13 Dec 2009 14:25:26 +0100 (CET) Received: from hornet.pajkc.eu (hornet.pajkc.eu [192.168.0.10]) by pajcevina.pajkc.eu (Postfix) with ESMTP id B0BBD5227E; Sun, 29 Nov 2009 17:15:29 +0100 (CET) Message-ID: <4B24EB45.2020708@pajkc.eu> Date: Sun, 13 Dec 2009 14:25:25 +0100 From: Marjan Fojkar Reply-To: marjan@pajkc.eu User-Agent: Thunderbird 2.0.0.23 (X11/20090825) MIME-Version: 1.0 To: linux-input@vger.kernel.org CC: kernel@avr32linux.org, hans-christian.egtvedt@atmel.com Subject: [PATCH] AT32AP700X PS/2 controller (PSIF): remove msleep call from atomic context X-Junkmail-Status: score=10/150, host=md2.t-2.net X-Junkmail-SD-Raw: score=unknown, refid=str=0001.0A0B0205.4B24EB46.01FE,ss=1,fgs=0, ip=0.0.0.0, so=2009-09-21 22:56:10, dmn=5.7.1/2009-08-27, mode=single engine X-Junkmail-IWF: false Sender: linux-input-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-input@vger.kernel.org diff -up linux-2.6.32/drivers/input/serio/at32psif.c{.orig,} --- linux-2.6.32/drivers/input/serio/at32psif.c.orig 2009-12-03 04:51:21.000000000 +0100 +++ linux-2.6.32/drivers/input/serio/at32psif.c 2009-12-13 13:08:39.000000000 +0100 @@ -135,9 +135,12 @@ static int psif_write(struct serio *io, int retval = 0; spin_lock_irqsave(&psif->lock, flags); - - while (!(psif_readl(psif, SR) & PSIF_BIT(TXEMPTY)) && timeout--) - msleep(10); + while (!(psif_readl(psif, SR) & PSIF_BIT(TXEMPTY)) && timeout) { + spin_unlock_irqrestore(&psif->lock, flags); + while (!(psif_readl(psif, SR) & PSIF_BIT(TXEMPTY)) && timeout--) + msleep(10); + spin_lock_irqsave(&psif->lock, flags); + } if (timeout >= 0) { psif_writel(psif, THR, val);