From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753536AbdJHPuV (ORCPT ); Sun, 8 Oct 2017 11:50:21 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:38387 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751867AbdJHPuT (ORCPT ); Sun, 8 Oct 2017 11:50:19 -0400 X-Google-Smtp-Source: AOwi7QBvgAfIKvyLoubsze2SxYtSDxlXuKf4YW4huH6JfiSUEgB1HciZN6RYVN49nhPlZvzfE8edpg== Date: Sun, 8 Oct 2017 17:50:15 +0200 From: Krzysztof Kozlowski To: Anand Moon Cc: Rob Herring , Mark Rutland , Russell King , Kukjin Kim , Kishon Vijay Abraham I , Bartlomiej Zolnierkiewicz , Lee Jones , Chunfeng Yun , Vivek Gautam , Andrzej Pietrasiewicz , devicetree , linux-arm-kernel , "linux-samsung-soc@vger.kernel.org" , Linux Kernel Subject: Re: [RFC 2/2] phy: exynos5-usbdrd: remove disable and enable of phy clk Message-ID: <20171008155015.252gefhsc4tks7k6@kozik-lap> References: <1507264595-3565-1-git-send-email-linux.amoon@gmail.com> <1507264595-3565-2-git-send-email-linux.amoon@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Oct 08, 2017 at 06:11:12PM +0530, Anand Moon wrote: > Hi Krzysztof, > > On 6 October 2017 at 12:12, Krzysztof Kozlowski wrote: > > On Fri, Oct 6, 2017 at 6:36 AM, Anand Moon wrote: > >> remove the disable and enable of phy clk. > >> phy clk is needed to tune the phy controller. > > > > Drivers should in general enable and disable the clocks they use. Just > > like in patch #1 please describe why you are doing this, what kind of > > problem are you trying to solve and what exactly are you trying to do > > here. > > > > BR, > > Krzysztof > > > > [snip] > > Usually we would disable the clk on error patch and return with failed. > but in the current code we disable the clk in init routine and > enable the clk in disable routine which seem incorrect. No. For example for exynos5_usbdrd_phy_exit() the driver enables the clock only for the access to PHY block (PHY registers). > > [0] https://github.com/torvalds/linux/blob/master/drivers/phy/samsung/phy-exynos5-usbdrd.c#L362-L412 > [1] https://github.com/torvalds/linux/blob/master/drivers/phy/samsung/phy-exynos5-usbdrd.c#L424-L446 > > On 3.10.x kernel clk_summary all the clk are enables. > > mout_usbdrd300 3 3 24000000 > dout_usbdrd300 2 2 24000000 > sclk_usbdrd300 1 1 24000000 > dout_usbphy300 2 2 24000000 > sclk_usbphy300 1 1 24000000 > mout_usbdrd301 3 3 24000000 > dout_usbdrd301 2 2 24000000 > sclk_usbdrd301 1 1 24000000 > dout_usbphy301 2 2 24000000 > sclk_usbphy301 1 1 24000000 > > Some more changes in clk driver might be required to stabilize the usb module. Please describe the issues with stability first. Best regards, Krzysztof