From patchwork Thu Feb 18 21:31:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andreas Fenkart X-Patchwork-Id: 8354721 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 272AF9F727 for ; Thu, 18 Feb 2016 21:31:10 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8070920220 for ; Thu, 18 Feb 2016 21:31:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 9D851203A0 for ; Thu, 18 Feb 2016 21:31:08 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757211AbcBRVbH (ORCPT ); Thu, 18 Feb 2016 16:31:07 -0500 Received: from mail-yk0-f179.google.com ([209.85.160.179]:35295 "EHLO mail-yk0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757146AbcBRVbG (ORCPT ); Thu, 18 Feb 2016 16:31:06 -0500 Received: by mail-yk0-f179.google.com with SMTP id r207so27239185ykd.2 for ; Thu, 18 Feb 2016 13:31:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=lkciThXHAGpTpTBPop3eEc3Rx52Z9tcGsskKA36KASE=; b=uRKhL06T4+KEI6yZPy10mOHnLaUbe0jLtrQzk8bXJcGRoXeq8wD668XCQLlbL+abgC aw/9ZcGd/siSHYLy5FDv4nNEKAD7cdIAM/3+Ejx1BLkTjndzb470uQv08M9VVsSgUU7A przkiqtZhIOw6H9ptN6RwdwZslvpZtR25DEe1wGEtwJbzuSO2o0ibnL3xhpbJEGSWeaG K9lVGCKviijD5H3egroFwZESh/byPxlga7nx5RndRoHEaa1Ulcbkd3Cn/Rsvx/gUayfx BGep346roSikJnj/tPwxktF65y/uvoi3bW0ltXeJBszrsidO1n2XNFTZPbeux09vzmOq BaLw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=lkciThXHAGpTpTBPop3eEc3Rx52Z9tcGsskKA36KASE=; b=P/+GggFFtdC2t+2Lw8LsYdvQUFbnIHhpH+Ro97f78E/fj+G2Utx55OaSu90OMV4arX YOekVGp2AY7C5pzgnkkmQRE6VJNsD2bD1s5G4Ge7zQqhv/WyVH4NBOw39rdDFYbeXD3n KCxvce3EeZFjuMB5CkN85BWhK5g1XSNID1mXnQnIZ3Fdj6t8WwwbVKO1ZrgsnwTPcA7e KRjfysAWtBwLVWPtdWY7zz56pyQx0/kekK1mmL0fmmXTxj/I+3uW56fBLYfrXCASFrjV wEYcNzLhn//6MkYw0lZqiOQ8JlSEUb7T2uPnOcPSPQxGvMQ2J5hyaKlBx5G1ZPQNqG5g Z66Q== X-Gm-Message-State: AG10YOSQXtGOcIf2aRgj78DA9jdHAXWAXlMMXEbLYwNM/GiNHoP91rTnVkXME+vEZuwbfiRykqaUGDKqJlj6pA== MIME-Version: 1.0 X-Received: by 10.37.47.76 with SMTP id v73mr6076303ybv.42.1455831064728; Thu, 18 Feb 2016 13:31:04 -0800 (PST) Received: by 10.37.116.8 with HTTP; Thu, 18 Feb 2016 13:31:04 -0800 (PST) In-Reply-To: <20160218182750.GA5948@c50.bag.software> References: <20160218182750.GA5948@c50.bag.software> Date: Thu, 18 Feb 2016 22:31:04 +0100 Message-ID: Subject: Re: omap_hsmmc: sdio: issue with generic wakeup IRQ handling From: Andreas Fenkart To: Vishal Thanki Cc: linux-mmc , Ulf Hansson 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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 Hi Vishal, I remember there was a problem with IRQ, but can't remember on top of my head. Meanwhile this might be some pointer: 2016-02-18 19:27 GMT+01:00 Vishal Thanki : > Hi, > > On a custom built am335x based board, I am facing an issue mwifiex wifi > module which is connected to host via SDIO interface. I am using kernel > version 4.4. > > The problem is related to the wifi "ext_scan" command getting timed out > over SDIO. This was working with old kernel (v4.0), but does not work on > kernel v4.4. I found the following commit is responsible for this > behavior. > > ================================= > 5b83b2234be6733cfe22036c38031b2c890b3db8 > > mmc: omap_hsmmc: Change wake-up interrupt to use generic wakeirq > > We can now use generic wakeirq handling and remove the custom handling > for the wake-up interrupts. > ================================= > > There is no wifi issue if I revert the above mentioned commit on kernel > v4.4. > > I see that before this commit, the wakeup IRQ handler was registered > within the omap_hsmmc.c itself with additional IRQF_TRIGGER_LOW flag. > But with the introduction to dev_pm_set_dedicated_wake_irq(), the > generic wakeup IRQ handler is registered which does not take the > IRQF_TRIGGER flag. I am not sure if that is the issue, but I added that > IRQF_TRIGGER_LOW flag in dev_pm_set_dedicated_wake_irq() while > registering a threaded IRQ handler, I could see the problem disappears. > However, this change is causing the infinite interrupts because the of > level triggered interrupt is not handled in generic wakeup IRQ handling > code (as it was done specially in omap_hsmmc.c code earlier). > > I am not much familiar with MMC/SDIO driver and I am not sure how to fix > this behavior. So any guidance would be really helpful. > > Thanks, > Vishal --- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/net/wireless/mwifiex/sta_ioctl.c b/drivers/net/wireless/mwifiex/sta_ioctl.c index a6c8a4f..67587c2 100644 --- a/drivers/net/wireless/mwifiex/sta_ioctl.c +++ b/drivers/net/wireless/mwifiex/sta_ioctl.c @@ -517,6 +517,17 @@ int mwifiex_enable_hs(struct mwifiex_adapter *adapter) adapter->hs_enabling = true; mwifiex_cancel_all_pending_cmd(adapter); + /* if the MMC host is already in suspend it will not detect SDIO irq + * and we might run into response timeout. By claiming the MMC host we + * wake it up, which is sufficient to detect a pending IRQ + */ + { + struct sdio_mmc_card *card = adapter->card; + sdio_claim_host(card->func); + printk("+++ poll mmc host for IRQ +++\n"); + sdio_release_host(card->func); + } + if (mwifiex_set_hs_params(mwifiex_get_priv(adapter, MWIFIEX_BSS_ROLE_STA), HostCmd_ACT_GEN_SET, MWIFIEX_SYNC_CMD,