Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2490850imm; Tue, 4 Sep 2018 05:29:47 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaEj9iodMuQIgML+J+8c3wcm1/72t5R5xDojvmYXcl71InpfpUMtOzNmreCqu3bWlW0qGiA X-Received: by 2002:a63:6849:: with SMTP id d70-v6mr30540043pgc.7.1536064187693; Tue, 04 Sep 2018 05:29:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536064187; cv=none; d=google.com; s=arc-20160816; b=R9HJS3WnAgDAThi3bWE/iLpErOBz4jPb+KD3E9kM/gy0YUdNGt11kobvFOerSM3ae2 zMm9yKXTTCya98MoTbrYiDUg8bJh3v2FJ3mvpcWYQzSEjWzXvHF+/64uM8rlM9W2NLMl HyG6e0IrLoT5/wPEv2xUIpMO/E73F5xDN7zRJnNMColIQg7fooTna9us/Q/xgTvw7X5x KuNbqlUV2rHAvB2ICCBJmsphjsz3jmCJE4gH84wjZHVNDUpFk6F9RD2aqBQFntnSFibZ 4SDa1aD7uO0Jf0RVFTHvJOCxG4aBRnT8dBSBo+7Hjz5zC3eJmxW2BalTYx/ROMGl6Vvz mZEQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:mime-version:message-id:date:subject:cc:to :from:arc-authentication-results; bh=BCFQ4NuDGfF/h7kaSs8VqKUGujIwg2kuwj/25/N5fN4=; b=zNHjPHxjaEzvsr/JdBGCL/1aqphvEvtZnf/SxS1xyxm8rabYBcLKonwCudunF8SVnc ZgJGihqtbu+0OLcGhtV8zeg7y97A54C69lh2bbYT80RGMMiNQmKxxkunHBUncA6QZHYM f1EMqZ28O9tkTRK6Z6InGkQLDqgmYvUoIhmy5kRELK6J/5DF27w5lNIRVSA59hyZeV1C QGvEIb9/3NeIVL2kJWtrHzG+4j4Kf7lBkAlcWlzuIkowOCI3WsggNbYLTP4MNIJmZfc8 yWW9ZHt3gYBJSLfEMtk5txze0SGQIK6w79CuBXnRJTEGJROZTDLUD8XROFCCTWEjkIx2 w/hA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i126-v6si16225107pgd.332.2018.09.04.05.29.31; Tue, 04 Sep 2018 05:29:47 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727401AbeIDQxN (ORCPT + 99 others); Tue, 4 Sep 2018 12:53:13 -0400 Received: from mail-co1nam03on0044.outbound.protection.outlook.com ([104.47.40.44]:21133 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727217AbeIDQxN (ORCPT ); Tue, 4 Sep 2018 12:53:13 -0400 Received: from BYAPR02CA0055.namprd02.prod.outlook.com (2603:10b6:a03:54::32) by BN7PR02MB5172.namprd02.prod.outlook.com (2603:10b6:408:23::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1101.14; Tue, 4 Sep 2018 12:28:10 +0000 Received: from SN1NAM02FT055.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::204) by BYAPR02CA0055.outlook.office365.com (2603:10b6:a03:54::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1080.15 via Frontend Transport; Tue, 4 Sep 2018 12:28:10 +0000 Authentication-Results: spf=softfail (sender IP is 149.199.60.100) smtp.mailfrom=gmail.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=fail action=none header.from=gmail.com; Received-SPF: SoftFail (protection.outlook.com: domain of transitioning gmail.com discourages use of 149.199.60.100 as permitted sender) Received: from xsj-pvapsmtpgw02 (149.199.60.100) by SN1NAM02FT055.mail.protection.outlook.com (10.152.72.174) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1101.10 via Frontend Transport; Tue, 4 Sep 2018 12:28:09 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:35315 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fxARF-0003pP-Nb; Tue, 04 Sep 2018 05:28:09 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fxARA-0007D9-Iq; Tue, 04 Sep 2018 05:28:04 -0700 Received: from xsj-pvapsmtp01 (smtp2.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w84CS3Br019905; Tue, 4 Sep 2018 05:28:03 -0700 Received: from [172.23.37.106] (helo=xhdshubhraj40.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fxAR8-0007C2-Sb; Tue, 04 Sep 2018 05:28:03 -0700 From: To: CC: , , , , , , , Shubhrajyoti Datta Subject: [PATCH] can: xilinx: Enable clocks even when CONFIG_PM is disabled Date: Tue, 4 Sep 2018 17:57:58 +0530 Message-ID: <1536064078-21539-1-git-send-email-shubhrajyoti.datta@gmail.com> X-Mailer: git-send-email 2.1.1 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-Result: No--3.830-7.0-31-1 X-imss-scan-details: No--3.830-7.0-31-1;No--3.830-5.0-31-1 X-TM-AS-User-Approved-Sender: No;No X-TM-AS-Result-Xfilter: Match text exemption rules:No X-EOPAttributedMessage: 0 X-Matching-Connectors: 131805376900410002;(f9e945fa-a09a-4caa-7158-08d2eb1d8c44);() X-Forefront-Antispam-Report: CIP:149.199.60.100;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(39860400002)(376002)(346002)(136003)(2980300002)(189003)(199004)(1857600001)(77096007)(26005)(76482006)(73392003)(426003)(336012)(4326008)(6916009)(6666003)(82202002)(105596002)(5660300001)(107886003)(450100002)(86152003)(106466001)(83322999)(73972006)(498600001)(14444005)(2351001)(48376002)(63266004)(2616005)(50466002)(50226002)(16586007)(2876002)(54906003)(8676002)(316002)(305945005)(2906002)(55446002)(356003)(51416003)(81166006)(47776003)(86362001)(61266001)(87572001)(9786002)(81156014)(8936002)(36756003)(486006)(476003)(126002)(107986001)(5001870100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN7PR02MB5172;H:xsj-pvapsmtpgw02;FPR:;SPF:SoftFail;LANG:en;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;MX:1;A:1; X-Microsoft-Exchange-Diagnostics: 1;SN1NAM02FT055;1:s8fmL+VJnMAlmjLFAZpay567GUcrwGF5dmS6eo4AzMyC16j3RA/Bb/OebHFfcAXAtxVIkMQSrWNz7AyoNOC3e65eNDTl60C+2cX6XVArwJR6AjzMTEa31KzigSvyqjca MIME-Version: 1.0 Content-Type: text/plain X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e296666d-01de-4aed-1f68-08d61261e010 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(7020095)(5600074)(711020)(2017052603328);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Ab3I+diVqyDH1CPo75fcvyVAvDU0jJoxczl7etcORTECk51csyd9BRy89V84UXSmuPiNglM6IJpV1VxzoGuzTGUkZo7sfGfw76rPlPLXiedVdjXts6oScSg/srvH9AuPElEhpDsUVZDyXKH3J92IEEQ9iy9tUYIKcMcKpG+7sV9BO7ss+F5AzX0nvOLZaGOOkoOUfR/3oAB+B3qhWv+xXqTGgogN4KZZpi/9krUbb9GHkaRq2QCjflf0SkDqkASKUkeFsRJEV3xP5P1rDWsucUPDQi7iIbSuUbfZfLag4k+QaUQpUuDJcMjmxduvds X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6095135)(2401047)(5005006)(8121501046)(93006095)(93001095)(3231311)(944501410)(52105095)(10201501046)(3002001)(6055026)(6096035)(20161123561025)(20161123559100)(201703131430075)(201703131448075)(201703131433075)(201703151042153)(20161123565025)(20161123556025)(20161123563025)(201708071742011)(7699016);SRVR:BN7PR02MB5172;BCL:0;PCL:0;RULEID:(400006);SRVR:BN7PR02MB5172; X-Forefront-PRVS: 0785459C39 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN7PR02MB5172;23:zwDGHITaIMlriBc7cw8VgzS2dqL5eZD5nsXAwnWou?= =?us-ascii?Q?R5VKjMGpOstWfXSW/FGNREAKhs3lSgb8edLA8v4jkyiWy4Wmxe7U4/b1URzj?= =?us-ascii?Q?8d5S7JW4DUG5NyoYAFcH0tC6J8ge7eTbbQTmuaEgRMp4xbeqgrYxFwdTUHbo?= =?us-ascii?Q?rhgeRKszRdwKG/Yomd49H1R3ml1ye0aN1S196NfTK49zF8QvbpdcXwXvnhjO?= =?us-ascii?Q?l8+r0JB2dAx3pR42CCEHs5Voj2Gtx4PFxZtcTrUYdnzOewBPVcLQbagUMpAK?= =?us-ascii?Q?i+6504+bpF/HdTyBE3Yc4itUeWpjnDrJg2JaOsPpMl6dah6pJDuk5u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z3wNeuSXTV9hbRASVbToKEdHMxf6aYQYiWrL40pIVJciFMr0TQMkfmPyjDi+/044MuTW6UPRCntrO/Ndx9k9yXy6IVX3fqY8J4ikQOoSwBJrEsHRIeLf2NjraiS9nSO/IJYYmhRDwV3k/pvn5UB8CRyXIIbEbG4=;7:9RUnNZzgbQyW6w+J7nSL1cxDIJvqDl6gg1cEajn/hZtTJ6G4j5xVRFpvF14wOa1l7lQ8lej4K9C6SolyOJsRmLjfirniBxc002XmBCFm9S11MbcxZybDzjX8Eqfvjw8Lnvfuh6YwCbsDhNru5kQeFXREr2Jn+1DPqtw/4KDj0+o64ySiCmzjE9QCKbwrgymbQ4JdIbN3jc1/mxjKOWi8CrdXBkkL9nxL9qy6mEqK0x6vTWZ7Dxby5mPo5fw8JV7c SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Sep 2018 12:28:09.8220 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e296666d-01de-4aed-1f68-08d61261e010 X-MS-Exchange-CrossTenant-Id: 5afe0b00-7697-4969-b663-5eab37d5f47e X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5afe0b00-7697-4969-b663-5eab37d5f47e;Ip=[149.199.60.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR02MB5172 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Shubhrajyoti Datta Currently the clocks are enabled only in the runtime calls. When CONFIG_PM is disabled the driver does not work as the clocks are disabled. Fix the same by enabling the clocks in probe. Signed-off-by: Shubhrajyoti Datta --- drivers/net/can/xilinx_can.c | 31 +++++++++++++++++++++++-------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/drivers/net/can/xilinx_can.c b/drivers/net/can/xilinx_can.c index 131cce1..bf39b52 100644 --- a/drivers/net/can/xilinx_can.c +++ b/drivers/net/can/xilinx_can.c @@ -1550,14 +1550,21 @@ static int xcan_probe(struct platform_device *pdev) priv->write_reg = xcan_write_reg_le; priv->read_reg = xcan_read_reg_le; - pm_runtime_enable(&pdev->dev); - ret = pm_runtime_get_sync(&pdev->dev); - if (ret < 0) { - netdev_err(ndev, "%s: pm_runtime_get failed(%d)\n", - __func__, ret); - goto err_pmdisable; + ret = clk_prepare_enable(priv->bus_clk); + if (ret) { + dev_err(&pdev->dev, "Cannot enable clock.\n"); + goto err_free; + } + + ret = clk_prepare_enable(priv->can_clk); + if (ret) { + dev_err(&pdev->dev, "Cannot enable clock.\n"); + goto err_clk; } + pm_runtime_set_active(&pdev->dev); + pm_runtime_enable(&pdev->dev); + if (priv->read_reg(priv, XCAN_SR_OFFSET) != XCAN_SR_CONFIG_MASK) { priv->write_reg = xcan_write_reg_be; priv->read_reg = xcan_read_reg_be; @@ -1584,9 +1591,11 @@ static int xcan_probe(struct platform_device *pdev) return 0; err_disableclks: - pm_runtime_put(priv->dev); -err_pmdisable: pm_runtime_disable(&pdev->dev); + pm_runtime_set_suspended(&pdev->dev); + clk_disable_unprepare(priv->can_clk); +err_clk: + clk_disable_unprepare(priv->bus_clk); err_free: free_candev(ndev); err: @@ -1606,6 +1615,12 @@ static int xcan_remove(struct platform_device *pdev) struct xcan_priv *priv = netdev_priv(ndev); unregister_candev(ndev); + + if (!pm_runtime_suspended(&pdev->dev)) { + clk_disable_unprepare(priv->bus_clk); + clk_disable_unprepare(priv->can_clk); + } + pm_runtime_disable(&pdev->dev); netif_napi_del(&priv->napi); free_candev(ndev); -- 2.1.1