From patchwork Fri Aug 28 06:07:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 250508 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9ADA7C433E2 for ; Fri, 28 Aug 2020 06:08:29 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7618420791 for ; Fri, 28 Aug 2020 06:08:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="O/ulWoot" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728273AbgH1GI2 (ORCPT ); Fri, 28 Aug 2020 02:08:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34500 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728086AbgH1GIZ (ORCPT ); Fri, 28 Aug 2020 02:08:25 -0400 Received: from mail-pj1-x1043.google.com (mail-pj1-x1043.google.com [IPv6:2607:f8b0:4864:20::1043]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83EF8C061234 for ; Thu, 27 Aug 2020 23:08:24 -0700 (PDT) Received: by mail-pj1-x1043.google.com with SMTP id ls14so51617pjb.3 for ; Thu, 27 Aug 2020 23:08:24 -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 :mime-version:content-transfer-encoding; bh=xHZeI2yfFEkpCkFHmLsd7DtKmS2VipSIn1WAzrLDQFE=; b=O/ulWoothsxdPQ97xUPAUF8mGcsHgg0SyY1cIBhktJYelPiAMSEkxkz/j33wP2C+Lq vbXrtKofh2FKpOGyRQmm9D9Cts2zfKI9qst0d9eDfHoZ3ARRHSvM47r89aGu9oRT4QRx 64B9170HVrKF8kOJiV8NrDLdPSDI+gRjG8N/bKQf1V4TBIvWLY4xg0MnamDt8rVICGLN +rVhKfjcmjNJLx5WZl1n4E3tCbSCFY8qbEsEdPo5WpqxCs65T6GdDqBj3pNNyznWONvZ OQxut+bgVRDcKCXc3uvfKhbN4aNZbQMFIJwee77qFz0Pv6LUakfOtGZrFOlIPhb0T4XB zK5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=xHZeI2yfFEkpCkFHmLsd7DtKmS2VipSIn1WAzrLDQFE=; b=ZVNNM5tQf46LER20ZVp/rjM0+u3rqWnkJpA20uDB+UUpK+IUjJChiDcMTUQgDgoDUJ PWxhYqG6ciMUHG9rjNFvvJBuPodXAT3wBBCXHg1kp4HY565wNIkImPizpPBu0NWKMh+d qHb+PCW32snM9jPC5yzMxhsxp6YiEeH3eJGVX4KAshOZYkm1UpO22gFRbljQOFCJOQ0Z 9zlyV5CHJ+5t6/e18abx2VNM5tai/+RRu724ONlHQU7GhUjaTVHRuEbZX7b2TKcQHlA3 c0QKys9FXSGNES/Vm/hmkn2o4LB0koeLt6eEitKFWlvZ7TFIMFEb4k5YjAJEmE+WHZwW Z2SQ== X-Gm-Message-State: AOAM5321Yy80Zd27we0an7Sfu5nS41GmoTKnW1rd9fw94J21/OJ9v/aH q29/aTQ3MptYIgSyDmQAL9S19A== X-Google-Smtp-Source: ABdhPJzUn/yAsux1BzGUFFYk5nk+3HRDii55+GgvRQzXYUbbXQKWlcl/DTr9MzJvuF556xdk7KaYkg== X-Received: by 2002:a17:90a:1e65:: with SMTP id w92mr262778pjw.187.1598594903805; Thu, 27 Aug 2020 23:08:23 -0700 (PDT) Received: from localhost ([122.167.135.199]) by smtp.gmail.com with ESMTPSA id e65sm96904pjk.45.2020.08.27.23.08.22 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2020 23:08:23 -0700 (PDT) From: Viresh Kumar To: rnayak@codeaurora.org, Rob Clark , Sean Paul Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Douglas Anderson , Naresh Kamboju , linux-arm-msm@vger.kernel.org, dri-devel@lists.freedesktop.org, freedreno@lists.freedesktop.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 3/8] drm/msm: Unconditionally call dev_pm_opp_of_remove_table() Date: Fri, 28 Aug 2020 11:37:48 +0530 Message-Id: <6e4110032f8711e8bb0acbeccfe66dec3b09d5c1.1598594714.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org dev_pm_opp_of_remove_table() doesn't report any errors when it fails to find the OPP table with error -ENODEV (i.e. OPP table not present for the device). And we can call dev_pm_opp_of_remove_table() unconditionally here. While at it, also create a label to put clkname. Signed-off-by: Viresh Kumar --- V2: - Compare with -ENODEV only for failures. - Create new label to put clkname. --- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c | 14 +++++--------- drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h | 1 - drivers/gpu/drm/msm/dsi/dsi_host.c | 8 ++------ 3 files changed, 7 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c index c0a4d4e16d82..c8287191951f 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.c @@ -1010,12 +1010,9 @@ static int dpu_bind(struct device *dev, struct device *master, void *data) return PTR_ERR(dpu_kms->opp_table); /* OPP table is optional */ ret = dev_pm_opp_of_add_table(dev); - if (!ret) { - dpu_kms->has_opp_table = true; - } else if (ret != -ENODEV) { + if (ret && ret != -ENODEV) { dev_err(dev, "invalid OPP table in device tree\n"); - dev_pm_opp_put_clkname(dpu_kms->opp_table); - return ret; + goto put_clkname; } mp = &dpu_kms->mp; @@ -1037,8 +1034,8 @@ static int dpu_bind(struct device *dev, struct device *master, void *data) priv->kms = &dpu_kms->base; return ret; err: - if (dpu_kms->has_opp_table) - dev_pm_opp_of_remove_table(dev); + dev_pm_opp_of_remove_table(dev); +put_clkname: dev_pm_opp_put_clkname(dpu_kms->opp_table); return ret; } @@ -1056,8 +1053,7 @@ static void dpu_unbind(struct device *dev, struct device *master, void *data) if (dpu_kms->rpm_enabled) pm_runtime_disable(&pdev->dev); - if (dpu_kms->has_opp_table) - dev_pm_opp_of_remove_table(dev); + dev_pm_opp_of_remove_table(dev); dev_pm_opp_put_clkname(dpu_kms->opp_table); } diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h index e140cd633071..8295979a7165 100644 --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_kms.h @@ -129,7 +129,6 @@ struct dpu_kms { bool rpm_enabled; struct opp_table *opp_table; - bool has_opp_table; struct dss_module_power mp; diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c index b17ac6c27554..4335fe33250c 100644 --- a/drivers/gpu/drm/msm/dsi/dsi_host.c +++ b/drivers/gpu/drm/msm/dsi/dsi_host.c @@ -113,7 +113,6 @@ struct msm_dsi_host { struct clk *byte_intf_clk; struct opp_table *opp_table; - bool has_opp_table; u32 byte_clk_rate; u32 pixel_clk_rate; @@ -1891,9 +1890,7 @@ int msm_dsi_host_init(struct msm_dsi *msm_dsi) return PTR_ERR(msm_host->opp_table); /* OPP table is optional */ ret = dev_pm_opp_of_add_table(&pdev->dev); - if (!ret) { - msm_host->has_opp_table = true; - } else if (ret != -ENODEV) { + if (ret && ret != -ENODEV) { dev_err(&pdev->dev, "invalid OPP table in device tree\n"); dev_pm_opp_put_clkname(msm_host->opp_table); return ret; @@ -1934,8 +1931,7 @@ void msm_dsi_host_destroy(struct mipi_dsi_host *host) mutex_destroy(&msm_host->cmd_mutex); mutex_destroy(&msm_host->dev_mutex); - if (msm_host->has_opp_table) - dev_pm_opp_of_remove_table(&msm_host->pdev->dev); + dev_pm_opp_of_remove_table(&msm_host->pdev->dev); dev_pm_opp_put_clkname(msm_host->opp_table); pm_runtime_disable(&msm_host->pdev->dev); } From patchwork Fri Aug 28 06:07:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 250506 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0ACC8C43461 for ; Fri, 28 Aug 2020 06:09:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D8DFC20791 for ; Fri, 28 Aug 2020 06:09:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="YHxrgc08" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728455AbgH1GI6 (ORCPT ); Fri, 28 Aug 2020 02:08:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34512 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728265AbgH1GI1 (ORCPT ); Fri, 28 Aug 2020 02:08:27 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 64CDCC061232 for ; Thu, 27 Aug 2020 23:08:27 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id q3so1424599pls.11 for ; Thu, 27 Aug 2020 23:08:27 -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 :mime-version:content-transfer-encoding; bh=1O4RY3xhuvkoEFzZpCQj6200V2Vqk24TL8ijKSG6Muc=; b=YHxrgc08UC1m38a1Dl9/EMqZvlm1VnCvNkcD5izm8rqm0YvG045fdqTeSSWU3zP84e BcHHK7aom3QnCZXtUYQLKNwtzO8Ep+4tdG162+rjOVRMJzAe9ar/ApD7pQMI2nyLOMUH VHxAUkL2Zi7UuCJwfo7ZzxrnFHu1NDpn9oVgClh9Tx+29Pdty6EV9otz6UhKGUR891SW wkvRExXAFgi7fFHZQNrEqAV0/zj9YKpaYfC9Dhuk56XSCOmiDcaepwAo98fzbxuDipUH 6vj1UnT8LoXRzXROKT2eUIwLnX1yD4R4GhACqleeeiYO5gST/E+Tw2Aaja92+f/5DDMD pKZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1O4RY3xhuvkoEFzZpCQj6200V2Vqk24TL8ijKSG6Muc=; b=ZsyL1e1DTabs4LrI8d6tktnCHoC4wDqZLaiMfMa+RKPPTsxSJmfSL8mitfCKd7ntY5 +UHN+wE0Ybrc6yE1M3eEfvgpkVa0oItuzt0feiGOyt4Affs31ab+yk9Kv4L8ykRbzMNI AeVt1CXlI+MUK4j5gx5ytAAuOVCsirMUQsdIBAUaxum++BD9ztxywXC9peDx3KzgvCNu VESAh5+g/BzBJ5fzuEJ+bUTVD2T5mrLl6w9E/Pe1rhHZGzzagqWd3m3cVZ5JYAkuKZKi /ocxg3vtECWkxCwYmvK6xlg5I6OqoJuw8UK+6xj4ejb8vgGzD/I7iwqcyfFeJASuVu9h NQVw== X-Gm-Message-State: AOAM533WaS79pxcmbTrmMGtpPptATE/eociT2l/r5iccGUkqNa9o61Ri tSRqgEthvEmB6jqbVcQ0peiBxQ== X-Google-Smtp-Source: ABdhPJzzOn4s+bHlp/tecgCMbtWwHe8wbvcQ++dsCXro+voefVp33ciwr2Rsvu03Ia3822LnjIRAVw== X-Received: by 2002:a17:902:76c3:: with SMTP id j3mr73551plt.227.1598594906914; Thu, 27 Aug 2020 23:08:26 -0700 (PDT) Received: from localhost ([122.167.135.199]) by smtp.gmail.com with ESMTPSA id d76sm169607pfd.63.2020.08.27.23.08.25 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2020 23:08:26 -0700 (PDT) From: Viresh Kumar To: rnayak@codeaurora.org, Adrian Hunter , Andy Gross , Bjorn Andersson , Ulf Hansson Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Douglas Anderson , Naresh Kamboju , linux-arm-msm@vger.kernel.org, linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 4/8] mmc: sdhci-msm: Unconditionally call dev_pm_opp_of_remove_table() Date: Fri, 28 Aug 2020 11:37:49 +0530 Message-Id: <1d7c97524b9e1fbc60271d9c246c5461ca8a106c.1598594714.git.viresh.kumar@linaro.org> X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org dev_pm_opp_of_remove_table() doesn't report any errors when it fails to find the OPP table with error -ENODEV (i.e. OPP table not present for the device). And we can call dev_pm_opp_of_remove_table() unconditionally here. Signed-off-by: Viresh Kumar Tested-by: Douglas Anderson Reviewed-by: Douglas Anderson --- V2: - Compare with -ENODEV only for failures. - Create new label to put clkname. --- drivers/mmc/host/sdhci-msm.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/drivers/mmc/host/sdhci-msm.c b/drivers/mmc/host/sdhci-msm.c index 5a33389037cd..f7beaec6412e 100644 --- a/drivers/mmc/host/sdhci-msm.c +++ b/drivers/mmc/host/sdhci-msm.c @@ -263,7 +263,6 @@ struct sdhci_msm_host { unsigned long clk_rate; struct mmc_host *mmc; struct opp_table *opp_table; - bool has_opp_table; bool use_14lpp_dll_reset; bool tuning_done; bool calibration_done; @@ -2285,11 +2284,9 @@ static int sdhci_msm_probe(struct platform_device *pdev) /* OPP table is optional */ ret = dev_pm_opp_of_add_table(&pdev->dev); - if (!ret) { - msm_host->has_opp_table = true; - } else if (ret != -ENODEV) { + if (ret && ret != -ENODEV) { dev_err(&pdev->dev, "Invalid OPP table in Device tree\n"); - goto opp_cleanup; + goto opp_put_clkname; } /* Vote for maximum clock rate for maximum performance */ @@ -2453,8 +2450,8 @@ static int sdhci_msm_probe(struct platform_device *pdev) clk_bulk_disable_unprepare(ARRAY_SIZE(msm_host->bulk_clks), msm_host->bulk_clks); opp_cleanup: - if (msm_host->has_opp_table) - dev_pm_opp_of_remove_table(&pdev->dev); + dev_pm_opp_of_remove_table(&pdev->dev); +opp_put_clkname: dev_pm_opp_put_clkname(msm_host->opp_table); bus_clk_disable: if (!IS_ERR(msm_host->bus_clk)) @@ -2474,8 +2471,7 @@ static int sdhci_msm_remove(struct platform_device *pdev) sdhci_remove_host(host, dead); - if (msm_host->has_opp_table) - dev_pm_opp_of_remove_table(&pdev->dev); + dev_pm_opp_of_remove_table(&pdev->dev); dev_pm_opp_put_clkname(msm_host->opp_table); pm_runtime_get_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); From patchwork Fri Aug 28 06:07:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248457 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp799111ilg; Thu, 27 Aug 2020 23:08:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwNeR9fuK/YY1HSH/LAsSHi6FEZMI6g36v8wNXls2pBDvfYsSIa8d88ERWv8TRQ6gaqI/Sh X-Received: by 2002:a17:906:f107:: with SMTP id gv7mr150174ejb.519.1598594917641; Thu, 27 Aug 2020 23:08:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598594917; cv=none; d=google.com; s=arc-20160816; b=YFfL8Km3g0wD0RScCdVSi/Pen9ug/tp9duQA1ZRxcS59+Dx3zzuwVRqEIoufPFUoNJ gIDztLHIUgfgmPnRaNWPmVROp48PsNBU21O7jjlwldb0jZtfuXnWHU7HbJHFT3jz7C9Y YMNZYhhDoT45ZY3pU9I6cLowx/qr8Ju6kk1WWav0TvEvjKPMK/E/l5XO1orA3AG9wkSh Pe5N0LcxJYFb5gLlHg3gq1xpDrszf9j9/1+lkqTv3UklB2gUCjIzuDUO2AYQzfKzspOd 94IpohRjszNBqR8dGlb7NFldnX4HaRxdq7oSaQk5sdUf76F7hOxiCSYRRrnkwXnXiRbW ayjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=qLAjxAlrCMxjNqyejiXq+bbcpAkao+Zf6GfSzx0XooU=; b=aIrbBJJnrd+gxcWM6m1Xe87tpB3o6aMr4a985MAC884D2yZgg3keydYpctDJzNSNnC h/xrooyr+MBBHIJiYYv1J3BYJ13z0VfRIJCgrvPuEnU8dyMYdjEmAHkQ7vK894Ty1oOc A/ba2GMrJOz9sKh0m/xQZPLLYfDiWJfHdQXU5pXD4okX8ApjHyLLeAcmE7AoQd+7Wriz CF9ThNyMhJc+C9abTIk40L4dz5Fw2SE6TOcXuFqQjte4f1R/Nnj13ktghgG878emX8xQ Lf0SubYL0oKNLeShlrwN8/2kk//UU4iKzKmUIPgeafUDkA5YF2EdFPcM6rumpwg3kqnJ rlyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nswnWFQb; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id x14si2943878edv.549.2020.08.27.23.08.37; Thu, 27 Aug 2020 23:08:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nswnWFQb; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728379AbgH1GIg (ORCPT + 15 others); Fri, 28 Aug 2020 02:08:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34532 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728355AbgH1GId (ORCPT ); Fri, 28 Aug 2020 02:08:33 -0400 Received: from mail-pf1-x444.google.com (mail-pf1-x444.google.com [IPv6:2607:f8b0:4864:20::444]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 515CBC061235 for ; Thu, 27 Aug 2020 23:08:30 -0700 (PDT) Received: by mail-pf1-x444.google.com with SMTP id d22so120334pfn.5 for ; Thu, 27 Aug 2020 23:08:30 -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 :mime-version:content-transfer-encoding; bh=qLAjxAlrCMxjNqyejiXq+bbcpAkao+Zf6GfSzx0XooU=; b=nswnWFQbby8eZequAZEvYr5Jjuak9S+823ghqqWSTOTx7ja8VvGzt34RFq7Gzj5Abi mqqgRT9USNbs7wAf6cAaSnQZr+w/4wYerRcnbL0oOEWM6hCcY3Vocb/SSmcZPg78yRE6 q75+qzqdofCkOZl0rpSPtLVi0c8EVv9FLOS+Zx6tMtvpWUMnEdb7ZWmLnZgV3ycdstGM r9XQWao1BfH0AB4xtBxP222lSqQy1FDwukTDHWeDDY70cCjFlBWLkUKv4awU1xLUWw3b Dur0w0aqQ2Pmdxn7V2PB6RKn1yWMuRkcK+mf+/9QcVmjV88175vdUHylZ2X32cRE1u8W mR1g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=qLAjxAlrCMxjNqyejiXq+bbcpAkao+Zf6GfSzx0XooU=; b=SKG2zBFX3XMCdmnULp0ZPPFZzgn/6/UfLQKBMo4THW5+v42VfEmCrb1oiYPXb/tjGD VR50L1UkAyt8ltxrvDn3qouG5P+b+8hV2WklbtqFREoA8lvqqJS6/Tu1z5nC7xYyIjnV i+5oOnfQr0KJARePAGrjYxhxX3Na+Lx0HRWJQuORgckfisbUElpvua67yDo5sUcTgf60 RHYShUTJmVE6V5CQlpObsC0jLGG6SvF2bzDtvy3FinfpNGAXOUVT0B9ek6E8pDe6DJET sQAx51HGH5cpx7WePKN8cRo/zojxB7nmX8qfNuPPScXgbocdb2lBjKfj4IjIfR6USBmx bHdg== X-Gm-Message-State: AOAM530BgNgO9s5aYgdiu2CusmOu6H0i+D/GHumz21HqmmxZus53Ma5i vrEeHBdQnSd0zaSWLv4nT01X4A== X-Received: by 2002:a63:1d5c:: with SMTP id d28mr96622pgm.82.1598594909878; Thu, 27 Aug 2020 23:08:29 -0700 (PDT) Received: from localhost ([122.167.135.199]) by smtp.gmail.com with ESMTPSA id cv3sm92193pjb.45.2020.08.27.23.08.28 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2020 23:08:29 -0700 (PDT) From: Viresh Kumar To: rnayak@codeaurora.org, Andy Gross , Bjorn Andersson , Mark Brown Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Douglas Anderson , Naresh Kamboju , linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 5/8] spi: spi-geni-qcom: Unconditionally call dev_pm_opp_of_remove_table() Date: Fri, 28 Aug 2020 11:37:50 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org dev_pm_opp_of_remove_table() doesn't report any errors when it fails to find the OPP table with error -ENODEV (i.e. OPP table not present for the device). And we can call dev_pm_opp_of_remove_table() unconditionally here. While at it, create a new label and put clkname on errors. Signed-off-by: Viresh Kumar --- V2: - Compare with -ENODEV only for failures. - Create new label to put clkname. --- drivers/spi/spi-geni-qcom.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/spi/spi-geni-qcom.c b/drivers/spi/spi-geni-qcom.c index 80cea5cd3612..0dc3f4c55b0b 100644 --- a/drivers/spi/spi-geni-qcom.c +++ b/drivers/spi/spi-geni-qcom.c @@ -613,11 +613,9 @@ static int spi_geni_probe(struct platform_device *pdev) return PTR_ERR(mas->se.opp_table); /* OPP table is optional */ ret = dev_pm_opp_of_add_table(&pdev->dev); - if (!ret) { - mas->se.has_opp_table = true; - } else if (ret != -ENODEV) { + if (ret && ret != -ENODEV) { dev_err(&pdev->dev, "invalid OPP table in device tree\n"); - return ret; + goto put_clkname; } spi->bus_num = -1; @@ -669,8 +667,8 @@ static int spi_geni_probe(struct platform_device *pdev) spi_geni_probe_runtime_disable: pm_runtime_disable(dev); spi_master_put(spi); - if (mas->se.has_opp_table) - dev_pm_opp_of_remove_table(&pdev->dev); + dev_pm_opp_of_remove_table(&pdev->dev); +put_clkname: dev_pm_opp_put_clkname(mas->se.opp_table); return ret; } @@ -685,8 +683,7 @@ static int spi_geni_remove(struct platform_device *pdev) free_irq(mas->irq, spi); pm_runtime_disable(&pdev->dev); - if (mas->se.has_opp_table) - dev_pm_opp_of_remove_table(&pdev->dev); + dev_pm_opp_of_remove_table(&pdev->dev); dev_pm_opp_put_clkname(mas->se.opp_table); return 0; } From patchwork Fri Aug 28 06:07:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Viresh Kumar X-Patchwork-Id: 248460 Delivered-To: patch@linaro.org Received: by 2002:a92:5b9c:0:0:0:0:0 with SMTP id c28csp799190ilg; Thu, 27 Aug 2020 23:08:47 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzTLJp4101gedUBJMo3rXmSwrjc4Dnlj+LZVJyr/gtiaHiqZh6I2wGx0IMNjFMIoeRIOmt1 X-Received: by 2002:a17:906:114c:: with SMTP id i12mr179669eja.137.1598594927367; Thu, 27 Aug 2020 23:08:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598594927; cv=none; d=google.com; s=arc-20160816; b=qxTahiVr25/8YA6hxM/HpHaUP9ZVSvZWePWULWqF9+qFUmjxrj/p/RgoDbSVkmosbo kBaU1HIocVum1bWfYi3EjEhne7tGXVIIVf1z7EIrHJo9/ZSQQosMH4iYUbNhv38LyYwU OB9hYh95JjtrxDweZe8BSP5GOA/FHuhaxp3lu7f04asLLnO+C8T4LZJfPrl7yuGd3BbZ Duc33tVIIx/hBWztzOIYcOAdxPsbv48K2jpneOJDOXF6ZzQc6cNAY00i4cUstwyFfRhH WX+NgbVeWXFxXNV4yMZ6s/F652Zuz38hWb+cVd5cBmP2mxnxOEtI1VwQ75zUYJYV9pbL kzzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=W5JEvLx/kGgYmOG8XtJ4S9to1B/pZ75QIWOnP5VQYf4=; b=Jw4fLLK0IRFwwuJsZ+CtG4g4eVVnyDU0ngWMLefeDM1HkgF6BkpzjVtBWZDS2oUsqh I2wfQ9A0bmUCExuOuLdi1GYJTc18k2HnY/3ET4exNquPzZsV+zHRZO7uGEYGswaH4LJj HGKvxTeHgorOFY29UrG1nv0h7BbSNnu1jE5ZyLfk8eSWVP6Hx737XLGUY2Q/WbBu5VoC aG91t+3Hi5vqYmuEmMXZI7yRF9OFEpjAXdlbxi9VBcJlozPfqdf9MICLYeCpPOTCfCZM KA3Ivoi3fyamKjcpiieJh0omVdfTJYv+hjS5I6pJh1YKGcqoGuwNWsxTz0Be1EW1Lwx4 c5qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yFVGFQnO; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec14si9626ejb.320.2020.08.27.23.08.47; Thu, 27 Aug 2020 23:08:47 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=yFVGFQnO; spf=pass (google.com: domain of linux-arm-msm-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728360AbgH1GIh (ORCPT + 15 others); Fri, 28 Aug 2020 02:08:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34538 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728356AbgH1GId (ORCPT ); Fri, 28 Aug 2020 02:08:33 -0400 Received: from mail-pl1-x642.google.com (mail-pl1-x642.google.com [IPv6:2607:f8b0:4864:20::642]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 44571C061264 for ; Thu, 27 Aug 2020 23:08:33 -0700 (PDT) Received: by mail-pl1-x642.google.com with SMTP id c15so1424856plq.4 for ; Thu, 27 Aug 2020 23:08:33 -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 :mime-version:content-transfer-encoding; bh=W5JEvLx/kGgYmOG8XtJ4S9to1B/pZ75QIWOnP5VQYf4=; b=yFVGFQnOS4KNqIKtBL7mmGQ5uo5VXN9yJhK3RPtU7p1esz0OX71XfY6oSObv6qgzHE lGKhCLfUiDGiDzc+hYhL9KwSUdk57dX+2e99nSgthYWlLpBkSv7UGQhFf2ZDiw5RxgiE OcMHzyPn8fcNpjJUoyD/rl0NRRuvA0aInKx0lkwohVrpNKdYjtCV2L+Yv5R2aNIYPy1p yA8L16DK1aCOWWv9EFPlgeAxEMGSJTQ9DpZMeDopWeUEiv0kEYCCR2Sq2nv+0pGL4aEj gTwS3ad9RLsCDpndJG15ZqlOamawfENoS+I7+k6TXNgP8KuDEGzfN11WKABbt5twJucC EaFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=W5JEvLx/kGgYmOG8XtJ4S9to1B/pZ75QIWOnP5VQYf4=; b=qMBwsde8QE6ndXNzF8BK6CRfmItvporBa+GbZSi8gXCaBmeJOBUjaNaG8wcwxZOXro cQ+rj4+YWanWeqIxuVjqBdJ0/hm+0rd1e8hGp+5bhAD/3UIemWtbu8MFCavUpKow601A 9zDPJdbIbNNgoouSdlt5OST1KDahKFMWqZggOvLJBVDoiF91kJw7ARJn1C706Hr730k7 U26cfPFXYYhpy6jyj3rOvWNxG8XUh8mr0h45/+IM4ih3Uo7JQoO7XrUrzEsP3+03tzNM cMzSbTh+mu7VjBNt0Vfgoq6fTIeun2BBKdLUzEMy2y34QeFrW/mqVtKSHmI6dIahZLPf uGGQ== X-Gm-Message-State: AOAM5332LbJT2wCwI0N2lo54D9iwQSz5Xmx4ALf+YG0u5z3ZxKQwfuXZ KTmf2daFjU4ejb0kmOCDBMtYyw== X-Received: by 2002:a17:902:8f82:: with SMTP id z2mr80379plo.177.1598594912781; Thu, 27 Aug 2020 23:08:32 -0700 (PDT) Received: from localhost ([122.167.135.199]) by smtp.gmail.com with ESMTPSA id l9sm333978pgg.29.2020.08.27.23.08.31 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 27 Aug 2020 23:08:32 -0700 (PDT) From: Viresh Kumar To: rnayak@codeaurora.org, Andy Gross , Bjorn Andersson , Mark Brown Cc: Viresh Kumar , linux-pm@vger.kernel.org, Vincent Guittot , Rafael Wysocki , Stephen Boyd , Nishanth Menon , Douglas Anderson , Naresh Kamboju , linux-arm-msm@vger.kernel.org, linux-spi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH V2 6/8] spi: spi-qcom-qspi: Unconditionally call dev_pm_opp_of_remove_table() Date: Fri, 28 Aug 2020 11:37:51 +0530 Message-Id: X-Mailer: git-send-email 2.25.0.rc1.19.g042ed3e048af In-Reply-To: References: MIME-Version: 1.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org dev_pm_opp_of_remove_table() doesn't report any errors when it fails to find the OPP table with error -ENODEV (i.e. OPP table not present for the device). And we can call dev_pm_opp_of_remove_table() unconditionally here. While at it, create a new label and put clkname on errors. Signed-off-by: Viresh Kumar --- V2: - Compare with -ENODEV only for failures. - Create new label to put clkname. --- drivers/spi/spi-qcom-qspi.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) -- 2.25.0.rc1.19.g042ed3e048af diff --git a/drivers/spi/spi-qcom-qspi.c b/drivers/spi/spi-qcom-qspi.c index b8857a97f40a..e5829c56650b 100644 --- a/drivers/spi/spi-qcom-qspi.c +++ b/drivers/spi/spi-qcom-qspi.c @@ -143,7 +143,6 @@ struct qcom_qspi { struct qspi_xfer xfer; struct icc_path *icc_path_cpu_to_qspi; struct opp_table *opp_table; - bool has_opp_table; unsigned long last_speed; /* Lock to protect data accessed by IRQs */ spinlock_t lock; @@ -546,11 +545,9 @@ static int qcom_qspi_probe(struct platform_device *pdev) } /* OPP table is optional */ ret = dev_pm_opp_of_add_table(&pdev->dev); - if (!ret) { - ctrl->has_opp_table = true; - } else if (ret != -ENODEV) { + if (ret && ret != -ENODEV) { dev_err(&pdev->dev, "invalid OPP table in device tree\n"); - goto exit_probe_master_put; + goto exit_probe_put_clkname; } pm_runtime_use_autosuspend(dev); @@ -562,8 +559,9 @@ static int qcom_qspi_probe(struct platform_device *pdev) return 0; pm_runtime_disable(dev); - if (ctrl->has_opp_table) - dev_pm_opp_of_remove_table(&pdev->dev); + dev_pm_opp_of_remove_table(&pdev->dev); + +exit_probe_put_clkname: dev_pm_opp_put_clkname(ctrl->opp_table); exit_probe_master_put: @@ -581,8 +579,7 @@ static int qcom_qspi_remove(struct platform_device *pdev) spi_unregister_master(master); pm_runtime_disable(&pdev->dev); - if (ctrl->has_opp_table) - dev_pm_opp_of_remove_table(&pdev->dev); + dev_pm_opp_of_remove_table(&pdev->dev); dev_pm_opp_put_clkname(ctrl->opp_table); return 0;