On 24 May 2018 at 07:51, Kai Heng Feng <kai.heng.feng@xxxxxxxxxxxxx> wrote: > at 5:55 PM, Ulf Hansson <ulf.hansson@xxxxxxxxxx> wrote: > >> On 23 May 2018 at 11:29, Kai Heng Feng <kai.heng.feng@xxxxxxxxxxxxx> >> wrote: >>> >>> at 4:59 PM, Ulf Hansson <ulf.hansson@xxxxxxxxxx> wrote: >>> >>>> On 23 May 2018 at 10:31, Kai Heng Feng <kai.heng.feng@xxxxxxxxxxxxx> >>>> wrote: >>>>> >>>>> Hi Alan, >>>>> >>>>> I just discussed with Ritesh about commit [1]. >>>>> >>>>> Since it was concluded to be hardware problem, is it okay to revert >>>>> [1]? >>>> >>>> >>>> >>>> I don't think so. >>>> >>>>> The end goal is to keep the card reader runtime suspended to reduce >>>>> power >>>>> consumption. >>>> >>>> >>>> >>>> Sounds like a call to pm_suspend_ignore_children() should be called >>>> for the USB parent device, conditionally, when the HW works as you >>>> suggest. >>> >>> >>> >>> Does your "conditionally" mean CONFIG_PM enabled/disabled? >> >> >> Nope. Depending on how the HW works. >> >> At least to my understanding, the fixes we made were on a HW that >> requires the USB leaf devices nodes (mmc/memstick) to have the USB >> parent to be powered. This seems to not be the case for your >> situation. > > > Yes, when the leaf devices (rtsx_usb_{sdmmc,ms}) are in use, the parent > (rtsx_usb) needs to be powered. Right, thanks for clarifying that. > > The original issue I had is when the slot is empty, the card detection keeps > waking up the card reader, because of pm_runtime_get_sync(). Ok, now I understand a bit more of what you want to do. Let me elaborate on the mmc case (the memstick works the similar). So, depending on what card detect mechanism the mmc host supports, it may set different host capabilities to inform the mmc core about a desired behavior. In this case, rtsx_usb_sdmmc has set MMC_CAP_NEEDS_POLL, because the driver consider its HW to *not* support a remote wakeup for card detect. Hence the core schedules a work for polling, meaning that it will wakeup the mmc host (pm_runtime_get_sync()) and then try to initialize a card. When there is no card, it will fail and let the host go back to sleep (pm_runtime_put) and re-schedule a new work. > It's unnecessary because the card reader has remote wakeup capability, it > wakes up when there's a card gets plugged into slot. Can you please elaborate on how card detect works for your case. The common way to do that for mmc, is to use a separate GPIO card detect pin. Is possibly that what is used in your case as well - or do you have another external logic serving the remote wakeup? [...] > > Thanks, I'll send a patch based on your suggestion. Hold on. Using pm_suspend_ignore_children() is not the correct solution to this problem, now that I understand more. Kind regards Uffe -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html