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: 76439 Delivered-To: patches@linaro.org Received: by 10.140.106.72 with SMTP id d66csp96899qgf; Sat, 17 Sep 2016 03:14:47 -0700 (PDT) X-Received: by 10.25.22.38 with SMTP id m38mr3522230lfi.180.1474107287379; Sat, 17 Sep 2016 03:14:47 -0700 (PDT) Return-Path: Received: from mail-lf0-x235.google.com (mail-lf0-x235.google.com. [2a00:1450:4010:c07::235]) by mx.google.com with ESMTPS id g81si3659943lfe.338.2016.09.17.03.14.47 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 17 Sep 2016 03:14:47 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::235 as permitted sender) client-ip=2a00:1450:4010:c07::235; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::235 as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x235.google.com with SMTP id h127so81446470lfh.0 for ; Sat, 17 Sep 2016 03:14:47 -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=g4z/8tYmkBuehxVj87cRBnnZ7KGm+Qds1XGfUrCBLHtiDIyDgr2ictp9KFbVBH+s4s W1sgebuWD+UYzPJCIuA6jgfBbGbX9x3tVz+HaG+M3yUI14DpFcVP05I2ItvHw0Eyxbds eofkAf9y5EJt0i8LZcjA0WWNgW6i8h3HpKCilSJANwSaFJ8jwcYxeC3C6L7BdcCofld7 ejCWVQXxuqQjJUFxGeOccatjAbIWWBx6u2pKlXis2fyjKmJO/3e+tYKRmjAKm6ZdrQT0 olPdGwFtrJVcOZhAxSH8wjP3+wlJ1BCw/qDGAAvzx7n6W1UzJAiVYAO62H8Q2UGZAVBH GM8A== X-Gm-Message-State: AE9vXwPaEJMZLKcnhmuf47yHKINRPelan9qrLVreQDrQRWjAgihLDP9k+F3OsVVKn0K/68VfdpA= X-Received: by 10.46.9.215 with SMTP id 206mr3917832ljj.71.1474107286860; Sat, 17 Sep 2016 03:14:46 -0700 (PDT) Return-Path: 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 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(+) -- 1.9.1 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