From patchwork Thu Oct 13 11:37:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 77612 Delivered-To: patches@linaro.org Received: by 10.140.97.247 with SMTP id m110csp186626qge; Thu, 13 Oct 2016 04:37:56 -0700 (PDT) X-Received: by 10.25.92.152 with SMTP id u24mr8678487lfi.114.1476358676684; Thu, 13 Oct 2016 04:37:56 -0700 (PDT) Return-Path: Received: from mail-lf0-x22d.google.com (mail-lf0-x22d.google.com. [2a00:1450:4010:c07::22d]) by mx.google.com with ESMTPS id u141si8151876lff.103.2016.10.13.04.37.56 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 13 Oct 2016 04:37:56 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22d as permitted sender) client-ip=2a00:1450:4010:c07::22d; 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::22d as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x22d.google.com with SMTP id b75so131018332lfg.3 for ; Thu, 13 Oct 2016 04:37:56 -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:in-reply-to:references; bh=c3vOD18pM8tlkG0/bb4C/1ENvsApB4LLzkjP1pJajjU=; b=LBBwj3QVX2dp3vYUpGvkN6u3OPOhwk8FDvHec4PzaIIpirlZbq9StCi3oHFtEenske 48l6NJ5sFb3t49DJwdBarmV+XMk4v0H7hRpU3LmHm5MKz1SFDC72DGToUTMxUreV0KRI qQ3Lb8lXC9UTti4EwZVohJCfZz9XeRnbyFpJQ= 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:in-reply-to :references; bh=c3vOD18pM8tlkG0/bb4C/1ENvsApB4LLzkjP1pJajjU=; b=MboOjwSoquPyca7A7aM6AK1iRpEw8y+GwA6LOaw+J9oMHrELn9e2z2/JLryk8zcsNn vcLT1MB6QEgXlngqFiG+GaMDQ4E55/YbH/kNAbdC4SAAsfdRX3iKVuM5OM3ARUEW3GrX fCXOfVZp0nabHL1/G7HLT4Rl1Hu8DUXPLYIhgjw/dxdIzODT8WiKuelnkI5f89n18f1J jOQTAL7phpYOmUMSd4g4V0wwOeNFJlmKXvS4J7y9uRKLMLT6Q5l3sFgstOMwYspZX2Ku wLIT+RplSo/IBwyec8QnnBKY99ELW316imMrGkH4uappREJOrLJNIbMW1Tjo74e90QoS U0Hg== X-Gm-Message-State: AA6/9Rk/LSQE3sg5sDIR9WRu2Hmwu6cnd0+FeDWx2uoVWXgksTagmEnTH96hzjFV3//EjZ3NdVE= X-Received: by 10.25.234.141 with SMTP id y13mr9501733lfi.25.1476358675878; Thu, 13 Oct 2016 04:37:55 -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 p76sm3648114lfd.11.2016.10.13.04.37.54 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 13 Oct 2016 04:37:54 -0700 (PDT) From: Ulf Hansson To: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Ulf Hansson Cc: Ritesh Raj Sarraf , Alan Stern , Oliver Neukum , USB list , Roger Tseng , Wei WANG , Subject: [PATCH 2/6] mmc: rtsx_usb_sdmmc: Handle runtime PM while changing the led Date: Thu, 13 Oct 2016 13:37:36 +0200 Message-Id: <1476358660-8338-3-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476358660-8338-1-git-send-email-ulf.hansson@linaro.org> References: <1476358660-8338-1-git-send-email-ulf.hansson@linaro.org> Accesses of the rtsx sdmmc's parent device, which is the rtsx usb device, must be done when it's runtime resumed. Currently this isn't case when changing the led, so let's fix this by adding a pm_runtime_get_sync() and a pm_runtime_put() around those operations. Reported-by: Ritesh Raj Sarraf Tested-by: Ritesh Raj Sarraf Cc: Cc: Alan Stern Signed-off-by: Ulf Hansson --- 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 e0b8590..6e9c0f8 100644 --- a/drivers/mmc/host/rtsx_usb_sdmmc.c +++ b/drivers/mmc/host/rtsx_usb_sdmmc.c @@ -1309,6 +1309,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) @@ -1317,6 +1318,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