Re: omap_hsmmc + gta04 + sdio irq + runtime_suspend + 4 bit = trouble

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Andreas Kemnade <andreas@xxxxxxxxxxxx> [181108 18:40]:
> On Thu, 8 Nov 2018 09:06:37 -0800
> Tony Lindgren <tony@xxxxxxxxxxx> wrote:
> 
> > * Andreas Kemnade <andreas@xxxxxxxxxxxx> [181106 21:37]:
> > > Hi Tony,
> > > 
> > > On Tue, 6 Nov 2018 12:39:14 -0800
> > > Tony Lindgren <tony@xxxxxxxxxxx> wrote:
> > >   
> > > > * Andreas Kemnade <andreas@xxxxxxxxxxxx> [181106 20:24]:  
> > > > > Mainline kernel gives only about 100KByte/s, with sdio irqs I get >
> > > > > 1000KByte/s.    
> > > > 
> > > > That does not sound right at all. To me it sounds like the SDIO
> > > > irq is not working at all during runtime for your SoC? Is that  
> > > 
> > > no wakeirq, no sdio irq:
> Maybe this could be misunderstood:
> If you do not specify a wakeirq, sdio irq handling is not enabled at all:
> 
> > >         ret = omap_hsmmc_configure_wake_irq(host);
> > >         if (!ret)
> > >                 mmc->caps |= MMC_CAP_SDIO_IRQ;  
> > 
> 
> We are using this here to have at least decent performance, low latency and reliable
> 802.11 psmode (and therefore dramatically reduced power consumption of wifi module):
> http://git.goldelico.com/?p=letux-kernel.git;a=blobdiff;f=drivers/mmc/host/omap_hsmmc.c;h=bbfcef54b88cb534a49b1542e60c99e545a9e8a0;hp=68760d4a5d3da1a53c655d1b33f1c2237273d136;hb=44c8fc73ad8291c821855eaa88c13d5f9f2920f7;hpb=b48b43ee804e840de2e666873675d158b8219473

Looking at the commit above, looks like the sdio irq handling is
missing runtime PM calls.. So I wonder if we can just do the
following?

In theory setting the wlan mmc instance autosuspend_timeout_ms to -1
in sysfs should then do what your patch is doing except for enabling
sdio irq even without a wakeirq configured.

Regards,

Tony

8< -------------------
--- a/drivers/mmc/host/omap_hsmmc.c
+++ b/drivers/mmc/host/omap_hsmmc.c
@@ -1668,6 +1668,14 @@ static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
 	struct omap_hsmmc_host *host = mmc_priv(mmc);
 	u32 irq_mask, con;
 	unsigned long flags;
+	int error;
+
+	error = pm_runtime_get_sync(host->dev);
+	if (error < 0) {
+		pm_runtime_put_noidle(host->dev);
+
+		return;
+	}
 
 	spin_lock_irqsave(&host->irq_lock, flags);
 
@@ -1696,6 +1704,9 @@ static void omap_hsmmc_enable_sdio_irq(struct mmc_host *mmc, int enable)
 	OMAP_HSMMC_READ(host->base, IE);
 
 	spin_unlock_irqrestore(&host->irq_lock, flags);
+
+	pm_runtime_mark_last_busy(host->dev);
+	pm_runtime_put_autosuspend(host->dev);
 }
 
 static int omap_hsmmc_configure_wake_irq(struct omap_hsmmc_host *host)
-- 
2.19.1



[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux