From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1D947C433EF for ; Wed, 6 Apr 2022 13:07:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231720AbiDFNJJ (ORCPT ); Wed, 6 Apr 2022 09:09:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57562 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232977AbiDFNHu (ORCPT ); Wed, 6 Apr 2022 09:07:50 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 90CCD4DF8AA; Wed, 6 Apr 2022 02:42:07 -0700 (PDT) X-UUID: f38cdd16a5934c02bb76974fe8781fa9-20220406 X-UUID: f38cdd16a5934c02bb76974fe8781fa9-20220406 Received: from mtkcas11.mediatek.inc [(172.21.101.40)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 475865710; Wed, 06 Apr 2022 17:41:37 +0800 Received: from mtkcas10.mediatek.inc (172.21.101.39) by mtkmbs07n1.mediatek.inc (172.21.101.16) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Wed, 6 Apr 2022 17:41:36 +0800 Received: from mhfsdcap04 (10.17.3.154) by mtkcas10.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Wed, 6 Apr 2022 17:41:34 +0800 Message-ID: <174a42437212ed26ecc08d1a35d20717d0346158.camel@mediatek.com> Subject: Re: [PATCH v9 2/3] mmc: core: Add support for SDIO wakeup interrupt From: Axe Yang To: Ulf Hansson CC: Rob Herring , Chaotian Jing , Matthias Brugger , Adrian Hunter , Yoshihiro Shimoda , Satya Tangirala , Andy Shevchenko , Wolfram Sang , Lucas Stach , "Eric Biggers" , Andrew Jeffery , "Stephen Boyd" , Kiwoong Kim , Yue Hu , Tian Tao , , , , , , Date: Wed, 6 Apr 2022 17:41:34 +0800 In-Reply-To: References: <20220329032913.8750-1-axe.yang@mediatek.com> <20220329032913.8750-3-axe.yang@mediatek.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-MTK: N Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 2022-04-01 at 14:42 +0200, Ulf Hansson wrote: > On Tue, 29 Mar 2022 at 05:29, Axe Yang wrote: > > > > If wakeup-source flag is set in host dts node, parse EAI > > information > > from SDIO CCCR interrupt externsion segment for in-band wakeup. If > > async interrupt is supported by SDIO card then enable it and set > > enable_async_irq flag in sdio_cccr structure to 1. The parse flow > > is > > implemented in sdio_read_cccr(). > > > > Acked-by: AngeloGioacchino Del Regno < > > angelogioacchino.delregno@collabora.com> > > Signed-off-by: Axe Yang > > --- > > drivers/mmc/core/sdio.c | 17 +++++++++++++++++ > > include/linux/mmc/card.h | 8 +++++++- > > include/linux/mmc/sdio.h | 5 +++++ > > 3 files changed, 29 insertions(+), 1 deletion(-) > > > > diff --git a/drivers/mmc/core/sdio.c b/drivers/mmc/core/sdio.c > > index 25799accf8a0..4898c5e9a299 100644 > > --- a/drivers/mmc/core/sdio.c > > +++ b/drivers/mmc/core/sdio.c > > @@ -226,6 +226,23 @@ static int sdio_read_cccr(struct mmc_card > > *card, u32 ocr) > > card->sw_caps.sd3_drv_type |= > > SD_DRIVER_TYPE_C; > > if (data & SDIO_DRIVE_SDTD) > > card->sw_caps.sd3_drv_type |= > > SD_DRIVER_TYPE_D; > > + > > + if (card->host->pm_caps & > > MMC_PM_WAKE_SDIO_IRQ) { > > After a second thought, I think we can just skip this check. The > MMC_PM_WAKE_SDIO_IRQ indicates that the host supports SDIO IRQs as > *system wakeups*. > > But, in fact, I think we want this feature to be enabled to allow > waking up for runtime_suspend (RPM_SUSPENDED) too. > > > + ret = mmc_io_rw_direct(card, 0, 0, > > SDIO_CCCR_INTERRUPT_EXT, 0, > > + &data); > > + if (ret) > > + goto out; > > + > > + if (data & SDIO_INTERRUPT_EXT_SAI) > > { > > + data |= > > SDIO_INTERRUPT_EXT_EAI; > > + ret = > > mmc_io_rw_direct(card, 1, 0, SDIO_CCCR_INTERRUPT_EXT, > > + data > > , NULL); > > + if (ret) > > + goto out; > > + > > + card->cccr.enable_async_irq > > = 1; > > + } > > + } > > } > > Will skip this check in next version. Thanks. Regards, Axe