Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754879AbbDHXwC (ORCPT ); Wed, 8 Apr 2015 19:52:02 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:33796 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751431AbbDHXv7 (ORCPT ); Wed, 8 Apr 2015 19:51:59 -0400 Message-ID: <5525BF1D.3050408@codeaurora.org> Date: Wed, 08 Apr 2015 16:51:57 -0700 From: Stephen Boyd User-Agent: Mozilla/5.0 (X11; Linux i686 on x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Pramod Gurav , linux-arm-msm@vger.kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org CC: gregkh@linuxfoundation.org, bryanh@codeaurora.org, jslaby@suse.cz Subject: Re: [PATCH v2 2/2] tty: serial: msm: Disable pclk when port is closed References: <1428499733-21963-1-git-send-email-gpramod@codeaurora.org> <1428499733-21963-2-git-send-email-gpramod@codeaurora.org> In-Reply-To: <1428499733-21963-2-git-send-email-gpramod@codeaurora.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1658 Lines: 44 On 04/08/15 06:28, Pramod Gurav wrote: > Disable the pclk when tty port is closed by user space. > > Signed-off-by: Pramod Gurav > --- > drivers/tty/serial/msm_serial.c | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/drivers/tty/serial/msm_serial.c b/drivers/tty/serial/msm_serial.c > index 4c1e9ea..f38565c 100644 > --- a/drivers/tty/serial/msm_serial.c > +++ b/drivers/tty/serial/msm_serial.c > @@ -523,6 +523,7 @@ static void msm_shutdown(struct uart_port *port) > msm_write(port, 0, UART_IMR); /* disable interrupts */ > > clk_disable_unprepare(msm_port->clk); > + clk_disable_unprepare(msm_port->pclk); > > free_irq(port->irq, port); > } It's not clear to me at all when this clock is enabled and when it's disabled during the lifetime of this driver. For example, why do we have a .pm op to turn clocks on and off? Shouldn't they already be on? Can you please explain when the clocks are turned on and off and what userspace actions cause that to happen? Looking at drivers like amba-pl010.c I don't see any .pm op, just a clk_prepare_enable/clk_disable_unprepare pair in the startup and shutdown ops. Minus my confusion of why our clocking is complicated, it looks correct to me to do this, so Reviewed-by: Stephen Boyd -- Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, a Linux Foundation Collaborative Project -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/