Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp672168pxb; Tue, 5 Apr 2022 18:10:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyIN0tcVxfFGLkOaJBxEaze2yNmFpohqAhmwWNqb8XutijTFpgLeul5YA8sd5H3Bdvx8+Cb X-Received: by 2002:a17:907:8a26:b0:6e1:2646:ef23 with SMTP id sc38-20020a1709078a2600b006e12646ef23mr6188388ejc.109.1649207428216; Tue, 05 Apr 2022 18:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649207428; cv=none; d=google.com; s=arc-20160816; b=Rngi2IfSV4v8J/2CU7nDxqHqq7XqTLmC9QfIdQEUIZV+75wMJZ7fUmHVFTh6nXYewv KApXXAWZrXQLOVkuAa0xat7K2Xqk6mBO1ZFOrJPT4qu4HdlLJ6mok8+NhBSrm3rB1Grp Bg0nYgLhDkwuXobib1tvnT+AP+Bl/lC6gUszdUUz82usjmPBQhFgjA5N4W+f9OF1s5C4 JaOlpsOy6fOykw04LK+g4qQNgcQDMNgYzjstKhncve7uefqjpQo6oQyArs/rFqb2b+SX cj8AWCq957TmAapR7aUQU8nqwaHWmRyKClIMI1Pv4L8fD1T3ix3+tE4S6MqEYu8GzT0G lf4w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6thB3rLw+zop14Nc6E7w27SyRiNc4PxJ7BgbYm3g2x0=; b=SIdwauprJ0LfHXyLKIgzG9rBNOfUCAivOlAGo/I4Re/aKDninzPTaTw/3rgR38GUdl 7ikvnHUTnnz/X+hrCvIBiAymF7gaV6uy8vNsp1XWJgFKvlxYEm2j8m54Tw5qOkxelaYr btySGzAheSa+qljINwhlxv9Tc7VPiLAfikfyG9MLj4i2lA3/M6HUsziZ2n/EDRNfZVgw zLwq7SLVHhOXogzpbKbLPPZKC5AwecxZAxVhexF6YUKK66gb25IHjnfj/n3WyqNvbMgo ip71SmN1QLe4+rF2dstAtKUI64Cj2cZkF/PlKtKqcDAq+GBCNsVskRlb/Aqzod6C2kNy IH6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GyV6SCuW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w11-20020a056402268b00b00418c2b5bd27si11856528edd.9.2022.04.05.18.10.03; Tue, 05 Apr 2022 18:10:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=GyV6SCuW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355551AbiDEKUY (ORCPT + 99 others); Tue, 5 Apr 2022 06:20:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45884 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241249AbiDEIc5 (ORCPT ); Tue, 5 Apr 2022 04:32:57 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B23CA614E; Tue, 5 Apr 2022 01:30:34 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 6307FB81C13; Tue, 5 Apr 2022 08:30:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B718FC385A1; Tue, 5 Apr 2022 08:30:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1649147432; bh=WzivcXSmnyAyLc6VtEfU3zcYJ5LcHw/WrmshFZPnr7s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=GyV6SCuWdhBFWLus8u020KuAIJhit8VP1coIReA3u3Ab44yT2NvdwRjD8ZiuLOIPx KH1t70B6ShWJ/elcx9Uv2YflfIf+i+u25ESPU6xmOQ/2tJ84iebFSZNKEvdnB178b9 Yp1GI0QW4LWmyO7cWOoABT+3XHn7CZ7aUlKJq/9c= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ulf Hansson , Kai-Heng Feng Subject: [PATCH 5.17 1121/1126] mmc: rtsx: Let MMC core handle runtime PM Date: Tue, 5 Apr 2022 09:31:08 +0200 Message-Id: <20220405070440.331222310@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220405070407.513532867@linuxfoundation.org> References: <20220405070407.513532867@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Kai-Heng Feng commit 7570fb41e450ba37bf9335fe3751fa9f502c30fa upstream. Since MMC core handles runtime PM reference counting, we can avoid doing redundant runtime PM work in the driver. That means the only thing commit 5b4258f6721f ("misc: rtsx: rts5249 support runtime PM") misses is to always enable runtime PM, to let its parent driver enable ASPM in the runtime idle routine. Fixes: 7499b529d97f ("mmc: rtsx: Use pm_runtime_{get,put}() to handle runtime PM") Reviewed-by: Ulf Hansson Signed-off-by: Kai-Heng Feng Link: https://lore.kernel.org/r/20220216055435.2335297-1-kai.heng.feng@canonical.com Signed-off-by: Greg Kroah-Hartman --- drivers/mmc/host/rtsx_pci_sdmmc.c | 18 ------------------ 1 file changed, 18 deletions(-) --- a/drivers/mmc/host/rtsx_pci_sdmmc.c +++ b/drivers/mmc/host/rtsx_pci_sdmmc.c @@ -823,7 +823,6 @@ static void sd_request(struct work_struc } mutex_lock(&pcr->pcr_mutex); - pm_runtime_get_sync(dev); rtsx_pci_start_run(pcr); @@ -860,8 +859,6 @@ static void sd_request(struct work_struc data->bytes_xfered = data->blocks * data->blksz; } - pm_runtime_mark_last_busy(dev); - pm_runtime_put_autosuspend(dev); mutex_unlock(&pcr->pcr_mutex); finish: @@ -1093,7 +1090,6 @@ static void sdmmc_set_ios(struct mmc_hos return; mutex_lock(&pcr->pcr_mutex); - pm_runtime_get_sync(dev); rtsx_pci_start_run(pcr); @@ -1127,8 +1123,6 @@ static void sdmmc_set_ios(struct mmc_hos rtsx_pci_switch_clock(pcr, ios->clock, host->ssc_depth, host->initial_mode, host->double_clk, host->vpclk); - pm_runtime_mark_last_busy(dev); - pm_runtime_put_autosuspend(dev); mutex_unlock(&pcr->pcr_mutex); } @@ -1144,7 +1138,6 @@ static int sdmmc_get_ro(struct mmc_host return -ENOMEDIUM; mutex_lock(&pcr->pcr_mutex); - pm_runtime_get_sync(dev); rtsx_pci_start_run(pcr); @@ -1154,8 +1147,6 @@ static int sdmmc_get_ro(struct mmc_host if (val & SD_WRITE_PROTECT) ro = 1; - pm_runtime_mark_last_busy(dev); - pm_runtime_put_autosuspend(dev); mutex_unlock(&pcr->pcr_mutex); return ro; @@ -1173,7 +1164,6 @@ static int sdmmc_get_cd(struct mmc_host return cd; mutex_lock(&pcr->pcr_mutex); - pm_runtime_get_sync(dev); rtsx_pci_start_run(pcr); @@ -1183,8 +1173,6 @@ static int sdmmc_get_cd(struct mmc_host if (val & SD_EXIST) cd = 1; - pm_runtime_mark_last_busy(dev); - pm_runtime_put_autosuspend(dev); mutex_unlock(&pcr->pcr_mutex); return cd; @@ -1282,7 +1270,6 @@ static int sdmmc_switch_voltage(struct m return err; mutex_lock(&pcr->pcr_mutex); - pm_runtime_get_sync(dev); rtsx_pci_start_run(pcr); @@ -1312,8 +1299,6 @@ out: err = rtsx_pci_write_register(pcr, SD_BUS_STAT, SD_CLK_TOGGLE_EN | SD_CLK_FORCE_STOP, 0); - pm_runtime_mark_last_busy(dev); - pm_runtime_put_autosuspend(dev); mutex_unlock(&pcr->pcr_mutex); return err; @@ -1334,7 +1319,6 @@ static int sdmmc_execute_tuning(struct m return err; mutex_lock(&pcr->pcr_mutex); - pm_runtime_get_sync(dev); rtsx_pci_start_run(pcr); @@ -1367,8 +1351,6 @@ static int sdmmc_execute_tuning(struct m err = sd_change_phase(host, DDR50_RX_PHASE(pcr), true); out: - pm_runtime_mark_last_busy(dev); - pm_runtime_put_autosuspend(dev); mutex_unlock(&pcr->pcr_mutex); return err;