From patchwork Sun Sep 14 20:20:19 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 4902391 Return-Path: X-Original-To: patchwork-linux-sh@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 074A4BEEA5 for ; Sun, 14 Sep 2014 21:15:50 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2CCD120220 for ; Sun, 14 Sep 2014 21:15:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 57CA4201FB for ; Sun, 14 Sep 2014 21:15:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752854AbaINVPs (ORCPT ); Sun, 14 Sep 2014 17:15:48 -0400 Received: from mail-we0-f182.google.com ([74.125.82.182]:45060 "EHLO mail-we0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752811AbaINVPr (ORCPT ); Sun, 14 Sep 2014 17:15:47 -0400 Received: by mail-we0-f182.google.com with SMTP id k48so3063962wev.27 for ; Sun, 14 Sep 2014 14:15:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:mime-version:content-transfer-encoding:content-type; bh=I4Umie5bjaqm1pqvVNqzdWGwj188Grfpkmd81pHNn9A=; b=hAbPsn26VRJp/qppBzWYU3dkbGGmkRYpdciNPR2BXbzw5b9IiT2Ct5di7oQjog/zAw Enx+VfpWA4AjIWt+sPEGH7ofSjwu58aPCehZtKHc1ojgu0BEzw4RKLKSIgHIhO59sDBe NzDNwc4autjousTOiema/vqNXmt927WpyptTSSL6/3UqxHZf2qFz3gb6rYt+9FtIXJrU vUYRctiyzFM2blXXiOtznXdQH54voMtLL2caKTaTVz2Rc9UuNfoMmp1gjsa2bQgDRfFP 6j7W7wHjF/Frw498etmqnZ0yeKVE+hQiqdHrDCeqvmPi8YaZ0hck5VXqQg2jbBi/j8b6 v09A== X-Gm-Message-State: ALoCoQn1Qn/DhCFjdoX2mKzLqrVBA5e+C3vcdmX+yIpb5sL7dwFqBaRzcsW4+uZfGmaAvSSric3z X-Received: by 10.180.103.234 with SMTP id fz10mr18893612wib.76.1410729346128; Sun, 14 Sep 2014 14:15:46 -0700 (PDT) Received: from wasted.cogentembedded.com (80.178.206.101.adsl.012.net.il. [80.178.206.101]) by mx.google.com with ESMTPSA id p1sm12498593wjy.22.2014.09.14.14.15.45 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Sep 2014 14:15:45 -0700 (PDT) From: Sergei Shtylyov To: wsa@the-dreams.de, linux-i2c@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH] i2c-rcar: check for no IRQ in rcar_i2c_irq() Date: Mon, 15 Sep 2014 00:20:19 +0400 Message-ID: <3921243.2t7X6eKC2i@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.13.3 (Linux/3.15.10-201.fc20.x86_64; KDE/4.13.3; x86_64; ; ) MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Check if the ICMSR register (masked with the ICMIER register) evaluates to 0 in the driver's interrupt handler and return IRQ_NONE in that case, like many other drivers do. Signed-off-by: Sergei Shtylyov --- The patch is against Wolfram Sang's 'linux.git' repo's 'i2c/for-next' branch plus 3 cleanup patches just re-posted. drivers/i2c/busses/i2c-rcar.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) -- 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 Index: renesas/drivers/i2c/busses/i2c-rcar.c =================================================================== --- renesas.orig/drivers/i2c/busses/i2c-rcar.c +++ renesas/drivers/i2c/busses/i2c-rcar.c @@ -361,6 +361,7 @@ static void rcar_i2c_irq_recv(struct rca static irqreturn_t rcar_i2c_irq(int irq, void *ptr) { struct rcar_i2c_priv *priv = ptr; + irqreturn_t result = IRQ_HANDLED; u32 msr; /*-------------- spin lock -----------------*/ @@ -370,6 +371,10 @@ static irqreturn_t rcar_i2c_irq(int irq, /* Only handle interrupts that are currently enabled */ msr &= rcar_i2c_read(priv, ICMIER); + if (!msr) { + result = IRQ_NONE; + goto exit; + } /* Arbitration lost */ if (msr & MAL) { @@ -404,10 +409,11 @@ out: wake_up(&priv->wait); } +exit: spin_unlock(&priv->lock); /*-------------- spin unlock -----------------*/ - return IRQ_HANDLED; + return result; } static int rcar_i2c_master_xfer(struct i2c_adapter *adap,