From patchwork Sat Sep 12 09:03:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Robert Jarzmik X-Patchwork-Id: 7166201 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id E2B839F380 for ; Sat, 12 Sep 2015 09:16:21 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 132FF2081E for ; Sat, 12 Sep 2015 09:16:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2E72B2082B for ; Sat, 12 Sep 2015 09:16:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754483AbbILJQT (ORCPT ); Sat, 12 Sep 2015 05:16:19 -0400 Received: from smtp12.smtpout.orange.fr ([80.12.242.134]:44850 "EHLO smtp.smtpout.orange.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754023AbbILJQS (ORCPT ); Sat, 12 Sep 2015 05:16:18 -0400 X-Greylist: delayed 450 seconds by postgrey-1.27 at vger.kernel.org; Sat, 12 Sep 2015 05:16:18 EDT Received: from belgarion.home ([109.220.179.182]) by mwinf5d35 with ME id G98k1r0043wWvkl0398kkJ; Sat, 12 Sep 2015 11:08:46 +0200 X-ME-Helo: belgarion.home X-ME-Date: Sat, 12 Sep 2015 11:08:46 +0200 X-ME-IP: 109.220.179.182 From: Robert Jarzmik To: Ulf Hansson Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Robert Jarzmik , Petr Cvek Subject: [PATCH] mmc: pxamci: fix card detect threaded interrupt Date: Sat, 12 Sep 2015 11:03:31 +0200 Message-Id: <1442048611-23314-1-git-send-email-robert.jarzmik@free.fr> X-Mailer: git-send-email 2.1.4 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM, RCVD_IN_DNSWL_HI,T_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 Change the interrupt flavor of the card detection, from a hard interrupt to a threaded interrupt. There is no strong requirement for a hard interrupt. It fixes the case where the card detection is on a gpio expander, on I2C for example on zylonite board. In this case, the card detect netsted interrupt is called from a threaded interrupt. The request_irq() fails, because a hard irq cannot be a nested interrupt from a threaded interrupt (set __setup_irq()). This was tested on zylonite and mioa701 boards. Signed-off-by: Robert Jarzmik Cc: Petr Cvek --- drivers/mmc/host/pxamci.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/host/pxamci.c b/drivers/mmc/host/pxamci.c index 1420f29628c7..67c9d1443597 100644 --- a/drivers/mmc/host/pxamci.c +++ b/drivers/mmc/host/pxamci.c @@ -814,8 +814,10 @@ static int pxamci_probe(struct platform_device *pdev) } gpio_direction_input(gpio_cd); - ret = request_irq(gpio_to_irq(gpio_cd), pxamci_detect_irq, - IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING, + ret = request_threaded_irq(gpio_to_irq(gpio_cd), NULL, + pxamci_detect_irq, + IRQF_TRIGGER_RISING | IRQF_TRIGGER_FALLING | + IRQF_ONESHOT, "mmc card detect", mmc); if (ret) { dev_err(&pdev->dev, "failed to request card detect IRQ\n");