From patchwork Sat Sep 17 10:14:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 9337057 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 5C2826077F for ; Sat, 17 Sep 2016 10:14:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4E6C629C5A for ; Sat, 17 Sep 2016 10:14:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 41A2B29C5D; Sat, 17 Sep 2016 10:14:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.3 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB5B829C5A for ; Sat, 17 Sep 2016 10:14:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757501AbcIQKOu (ORCPT ); Sat, 17 Sep 2016 06:14:50 -0400 Received: from mail-lf0-f43.google.com ([209.85.215.43]:36748 "EHLO mail-lf0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757077AbcIQKOs (ORCPT ); Sat, 17 Sep 2016 06:14:48 -0400 Received: by mail-lf0-f43.google.com with SMTP id g62so77045740lfe.3 for ; Sat, 17 Sep 2016 03:14:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=VOC/GtxcDyR9JYr13pkTVPtfv1WJQQbiDKH25+5lfpg=; b=RxscwBD99QUMMkPyINTtv7AgMdrd9zY+KPF/M+WXtEGZ6+4Z+7luIUDGcSpSWXnmOm 6mNmFN+ZElTL5j9OreSWBRPaStLSXJWXBiP+mO1qQGvk0RUZDqZChu5veCYU6E+z01JP o1Ck6DmEZ2WdZclLx0TVDNWj5RusUF3NqGjA4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=VOC/GtxcDyR9JYr13pkTVPtfv1WJQQbiDKH25+5lfpg=; b=Oeqdmtm2Iy/Ch7Kdc8iyX5POoqdB97THvLoZ20iSX7vPFOnkFkootM8YReY2orozYA rPivGMI7Ogi8bZkRNFAAMZG9wO9x7c3TuEo8KfTJoOHFx2gbowobVMRMDnmqsaxIdpvy kjMiR42NXqv6uXiKvT6Bd6KU6r7SqYlAnoAV3sFkT98nB5JvCTfO3ulZAPRyHlOqN/Cq RmRWiEuRYcT75x01xGZ2kqHqiYU4loK51vlHe9IvlDvcS69/pBGBeV+cqwSzGJyNbaRO 2GDlrrhxmrWFM8K8m3QsWB3nhmKM4KfqVF8KcSfoWj/0EfYbNk/Bwmv66MOFiWyZq0gp nxeA== X-Gm-Message-State: AE9vXwOLV48ABD0In2i9WiiNJ+SZaoZDBHClUe3itivnlf9/9dNlHoL5h8wuSLUV10YY3bya X-Received: by 10.46.9.215 with SMTP id 206mr3917832ljj.71.1474107286860; Sat, 17 Sep 2016 03:14:46 -0700 (PDT) Received: from localhost.localdomain (h-155-4-221-67.na.cust.bahnhof.se. [155.4.221.67]) by smtp.gmail.com with ESMTPSA id f71sm3118360lfg.36.2016.09.17.03.14.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 17 Sep 2016 03:14:45 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, Ulf Hansson Cc: Ritesh Raj Sarraf , Alan Stern , USB list , Micky Ching , Roger Tseng , Wei WANG Subject: [PATCH] mmc: rtsx_usb_sdmmc: Handle runtime PM while changing led Date: Sat, 17 Sep 2016 12:14:38 +0200 Message-Id: <1474107278-3271-1-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Each access of the parent device (usb device) needs to be done in runtime resumed state. Currently this isn't case while changing the leds, so let's add pm_runtime_get_sync() and pm_runtime_put() around these calls. Signed-off-by: Ulf Hansson --- While discussing an issue[1] related to runtime PM, I found out that this minor change at least improves the behavior that has been observed. [1] http://www.spinics.net/lists/linux-usb/msg144634.html --- drivers/mmc/host/rtsx_usb_sdmmc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mmc/host/rtsx_usb_sdmmc.c b/drivers/mmc/host/rtsx_usb_sdmmc.c index 6c71fc9..a59c7fa 100644 --- a/drivers/mmc/host/rtsx_usb_sdmmc.c +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c @@ -1314,6 +1314,7 @@ static void rtsx_usb_update_led(struct work_struct *work) container_of(work, struct rtsx_usb_sdmmc, led_work); struct rtsx_ucr *ucr = host->ucr; + pm_runtime_get_sync(sdmmc_dev(host)); mutex_lock(&ucr->dev_mutex); if (host->led.brightness == LED_OFF) @@ -1322,6 +1323,7 @@ static void rtsx_usb_update_led(struct work_struct *work) rtsx_usb_turn_on_led(ucr); mutex_unlock(&ucr->dev_mutex); + pm_runtime_put(sdmmc_dev(host)); } #endif