From patchwork Wed Aug 19 14:26:10 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Magnus Damm X-Patchwork-Id: 42711 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id n7JESaZk032510 for ; Wed, 19 Aug 2009 14:30:54 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751529AbZHSOav (ORCPT ); Wed, 19 Aug 2009 10:30:51 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751696AbZHSOav (ORCPT ); Wed, 19 Aug 2009 10:30:51 -0400 Received: from mail-px0-f196.google.com ([209.85.216.196]:60939 "EHLO mail-px0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751529AbZHSOav (ORCPT ); Wed, 19 Aug 2009 10:30:51 -0400 Received: by pxi34 with SMTP id 34so2513704pxi.4 for ; Wed, 19 Aug 2009 07:30:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:from:to:cc:date:message-id :subject; bh=+1NF4iX2c/zayaYpFcxMDOM00eq7Tby4kwyh17/2Sf0=; b=nB7EOkZqeMu5417h6JDZxYy7FVYW+wK1CHYDF4GLjkg8BO3txmWiq5ZCbHucTsPyjB tOpQsWixHslvmwu6SIm8PgH2E2q84+sScpAS3LOQRqc9VcQhyiJF+Kp0B2fPiFq/MTx7 +8lVnYqouTfRBUFZcEr/iR3dWWgUJFR/6H8m8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:date:message-id:subject; b=jrMtIXl9XI3uygpuIWfeHzBTtNLYK0gFq1cTv+E4fu+k83V3hPVQnb0qceGs1+bVY2 3aBChe2sWxInkUZhhkbHsnhHnfQD/nxDYOPLempwnq1Sovl7IheAFHFj6FupQrxVtXi5 FiQnTXY/lGbHA6ZgC5oLAxgeL4QX5bkrR7tXw= Received: by 10.115.112.28 with SMTP id p28mr7353095wam.59.1250692251820; Wed, 19 Aug 2009 07:30:51 -0700 (PDT) Received: from rx1.opensource.se (210.5.32.202.bf.2iij.net [202.32.5.210]) by mx.google.com with ESMTPS id n40sm15683796wag.65.2009.08.19.07.30.44 (version=TLSv1/SSLv3 cipher=RC4-MD5); Wed, 19 Aug 2009 07:30:48 -0700 (PDT) From: Magnus Damm To: linux-sh@vger.kernel.org Cc: Magnus Damm , lethal@linux-sh.org, shimoda.yoshihiro@renesas.com, linux-usb@vger.kernel.org, gregkh@suse.de Date: Wed, 19 Aug 2009 23:26:10 +0900 Message-Id: <20090819142610.23156.17157.sendpatchset@rx1.opensource.se> Subject: [PATCH] usb: r8a66597-udc disable interrupts on shutdown fix Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org From: Magnus Damm This patch improves the disable_controller() function in the r8a66597-udc driver to disable all interrupts and also clear status flags. With this patch in place the driver survives kexec. Signed-off-by: Magnus Damm --- drivers/usb/gadget/r8a66597-udc.c | 9 +++++++++ 1 file changed, 9 insertions(+) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html --- 0005/drivers/usb/gadget/r8a66597-udc.c +++ work/drivers/usb/gadget/r8a66597-udc.c 2009-08-19 22:04:26.000000000 +0900 @@ -614,8 +614,17 @@ static void disable_controller(struct r8 if (r8a66597->pdata->on_chip) { r8a66597_bset(r8a66597, SCKE, SYSCFG0); + /* disable interrupts */ r8a66597_write(r8a66597, 0, INTENB0); r8a66597_write(r8a66597, 0, INTENB1); + r8a66597_write(r8a66597, 0, BRDYENB); + r8a66597_write(r8a66597, 0, BEMPENB); + r8a66597_write(r8a66597, 0, NRDYENB); + + /* clear status */ + r8a66597_write(r8a66597, 0, BRDYSTS); + r8a66597_write(r8a66597, 0, NRDYSTS); + r8a66597_write(r8a66597, 0, BEMPSTS); r8a66597_bclr(r8a66597, USBE, SYSCFG0); r8a66597_bclr(r8a66597, SCKE, SYSCFG0);