Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp877097ybl; Fri, 31 Jan 2020 09:32:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxP6M8bZsfGbnM67xglUrbwrGtNPi7toLOmmJMGvXnIaQEy0wScJz/UaAJ8mbz8hyr91A8v X-Received: by 2002:a05:6830:1317:: with SMTP id p23mr8593732otq.3.1580491952564; Fri, 31 Jan 2020 09:32:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580491952; cv=none; d=google.com; s=arc-20160816; b=ha+n6mSbWVuSn0rHhVcaAksWqU5vqBvFbm0y8A65cIwVhbIoZaormPOsn/9TSAGUX1 t7+ex0kE265zaG6snpYF4h1RXx3XQ8RI6RVvfWhaDE55PTjh1IQ+E8zxfaFFM3e00dTD awMVigt8uR8CBFWqXgyqIbqh4yMXlRBXCMgcxaNF8/Yc+ke43Il28vDj2M6DPRgxoq9S 13OtOQZ0iiWDTnFp0ckdsv6DubZVbozmO7BdzKtO9mwvcM11HNxwjlTgAOkqD08Mcm3g sEQtWhrbcXQRE3AiVo67IFPRxgsQHuGCJGqpLaeAFFNY76sVK1kJwZk34IzzgAxHtO6k Y6ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=Gt5dd7XOIRcUxh6uvWBlZM+92xMNDI0LZYHC+I8v0Yc=; b=TBO6JZzjKnJBZjoDpAiG/U63ut8Uldl99GSsqFR1dZgUa8EbIFiIsPzqVyWogWbaAB g62zdquZYOWMzzZp9Z7uc1uaTonskjNfrYD5F25SusZghMTDKEIHeAJh+Xq0YVSN7MLU bp65iC2cjI1IpU6ahz/4N8gY1haaNofIgAUH5msG8WeiVGnC5TreqiBLoajavg/FVMe6 j1PbXL8Clf+si+uyox1vdMJMJhdokOJkdk/hnEIBRcRHPcZPzboZ/B3kyKN4T24EjwzU X2/D5kROHRtMsK/gP82iL7LKhBcqNzVwGjlWKcxYdwVciJj6CbB8Bz9UyRITmwF2EcIS C1Eg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=M4gREsBx; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l17si5256347otk.218.2020.01.31.09.32.20; Fri, 31 Jan 2020 09:32:32 -0800 (PST) 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; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=M4gREsBx; 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=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727074AbgAaRbM (ORCPT + 99 others); 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