From mboxrd@z Thu Jan 1 00:00:00 1970 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=-2.4 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 C085DC35240 for ; Fri, 31 Jan 2020 17:31:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 983162063A for ; Fri, 31 Jan 2020 17:31:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="M4gREsBx" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727090AbgAaRbM (ORCPT ); Fri, 31 Jan 2020 12:31:12 -0500 Received: from lelv0142.ext.ti.com ([198.47.23.249]:55844 "EHLO lelv0142.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726139AbgAaRbL (ORCPT ); Fri, 31 Jan 2020 12:31:11 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0142.ext.ti.com (8.15.2/8.15.2) with ESMTP id 00VHV36s087335; Fri, 31 Jan 2020 11:31:03 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1580491863; bh=Gt5dd7XOIRcUxh6uvWBlZM+92xMNDI0LZYHC+I8v0Yc=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=M4gREsBxtBTZzWFlbEJzezhFWLdaORzgSPq+7+d08L2iDdkdonMyzrF2XDxXWcq1J VbBBh3wXz0AWxkGag23GOKlr3Vhig1fvjsTxg3qL7Py70/JONWvb19yxwkvMIxrlgo phE5EXxmjYPV3AQPHMi7GieUayWb+rNJ8uaLJ8bg= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id 00VHV3HD096950 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Fri, 31 Jan 2020 11:31:03 -0600 Received: from DFLE103.ent.ti.com (10.64.6.24) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3; Fri, 31 Jan 2020 11:31:03 -0600 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1847.3 via Frontend Transport; Fri, 31 Jan 2020 11:31:03 -0600 Received: from [10.250.65.13] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id 00VHV3pe063654; Fri, 31 Jan 2020 11:31:03 -0600 Subject: Re: [PATCH v2] can: tcan4x5x: Turn on the power before parsing the config To: Marc Kleine-Budde CC: , , References: <20191210163204.28225-1-dmurphy@ti.com> <4a2e80f0-13c5-df7b-65af-25f86ca48f2a@pengutronix.de> From: Dan Murphy Message-ID: Date: Fri, 31 Jan 2020 11:27:44 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.4.1 MIME-Version: 1.0 In-Reply-To: <4a2e80f0-13c5-df7b-65af-25f86ca48f2a@pengutronix.de> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Marc On 1/2/20 6:38 AM, Marc Kleine-Budde wrote: > On 12/10/19 5:32 PM, Dan Murphy wrote: >> The parse config function now performs action on the device either >> reading or writing and a reset. If the regulator is managed it needs >> to be turned on. So turn on the regulator if available if the parsing >> fails then turn off the regulator. > Another BTW: > Consider converting the switching of the vsup to runtime_pm. > > Yet another one: > Why do you disable the clocks in the error path of tcan4x5x_can_probe(), > but never enable them? > >> out_clk: >> if (!IS_ERR(mcan_class->cclk)) { >> clk_disable_unprepare(mcan_class->cclk); >> clk_disable_unprepare(mcan_class->hclk); >> } > - please move the clock handling from the m_can.c to the individual > driver > - please move the clock handling to runtime_pm in the individual driver > - remove the obsolete m_can_class_get_clocks() > - make runtime_pm mandatory > > regards, > Marc > I have separate the clock calls into pm runtime calls and moved the clock init into the respective children of the framework. Did you want me to submit 1 patch with all the changes or would you like 3 separate patches?  First 2 patches will abstract the clocks away into the children and the 3rd patch would be to remove the clocks API from the framework Dan