lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1337987696-31728-4-git-send-email-festevam@gmail.com>
Date:	Fri, 25 May 2012 20:14:45 -0300
From:	Fabio Estevam <festevam@...il.com>
To:	kernel@...gutronix.de
Cc:	shawn.guo@...escale.com,
	Fabio Estevam <fabio.estevam@...escale.com>,
	Vinod Koul <vinod.koul@...el.com>,
	<linux-kernel@...r.kernel.org>
Subject: [PATCH 04/15] dma: imx-sdma: Use clk_prepare_enable/clk_disable_unprepare

From: Fabio Estevam <fabio.estevam@...escale.com>

Prepare the clock before enabling it.

Cc: Vinod Koul <vinod.koul@...el.com>
Cc: <linux-kernel@...r.kernel.org>
Signed-off-by: Fabio Estevam <fabio.estevam@...escale.com>
---
 drivers/dma/imx-sdma.c |   28 ++++++++++++++--------------
 1 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/drivers/dma/imx-sdma.c b/drivers/dma/imx-sdma.c
index fb4f499..b6174e6 100644
--- a/drivers/dma/imx-sdma.c
+++ b/drivers/dma/imx-sdma.c
@@ -868,8 +868,8 @@ static int sdma_alloc_chan_resources(struct dma_chan *chan)
 	sdmac->peripheral_type = data->peripheral_type;
 	sdmac->event_id0 = data->dma_request;
 
-	clk_enable(sdmac->sdma->clk_ipg);
-	clk_enable(sdmac->sdma->clk_ahb);
+	clk_prepare_enable(sdmac->sdma->clk_ipg);
+	clk_prepare_enable(sdmac->sdma->clk_ahb);
 
 	ret = sdma_request_channel(sdmac);
 	if (ret)
@@ -906,8 +906,8 @@ static void sdma_free_chan_resources(struct dma_chan *chan)
 
 	dma_free_coherent(NULL, PAGE_SIZE, sdmac->bd, sdmac->bd_phys);
 
-	clk_disable(sdma->clk_ipg);
-	clk_disable(sdma->clk_ahb);
+	clk_disable_unprepare(sdma->clk_ipg);
+	clk_disable_unprepare(sdma->clk_ahb);
 }
 
 static struct dma_async_tx_descriptor *sdma_prep_slave_sg(
@@ -1180,14 +1180,14 @@ static void sdma_load_firmware(const struct firmware *fw, void *context)
 	addr = (void *)header + header->script_addrs_start;
 	ram_code = (void *)header + header->ram_code_start;
 
-	clk_enable(sdma->clk_ipg);
-	clk_enable(sdma->clk_ahb);
+	clk_prepare_enable(sdma->clk_ipg);
+	clk_prepare_enable(sdma->clk_ahb);
 	/* download the RAM image for SDMA */
 	sdma_load_script(sdma, ram_code,
 			header->ram_code_size,
 			addr->ram_code_start_addr);
-	clk_disable(sdma->clk_ipg);
-	clk_disable(sdma->clk_ahb);
+	clk_disable_unprepare(sdma->clk_ipg);
+	clk_disable_unprepare(sdma->clk_ahb);
 
 	sdma_add_scripts(sdma, addr);
 
@@ -1229,8 +1229,8 @@ static int __init sdma_init(struct sdma_engine *sdma)
 		return -ENODEV;
 	}
 
-	clk_enable(sdma->clk_ipg);
-	clk_enable(sdma->clk_ahb);
+	clk_prepare_enable(sdma->clk_ipg);
+	clk_prepare_enable(sdma->clk_ahb);
 
 	/* Be sure SDMA has not started yet */
 	writel_relaxed(0, sdma->regs + SDMA_H_C0PTR);
@@ -1283,14 +1283,14 @@ static int __init sdma_init(struct sdma_engine *sdma)
 	/* Initializes channel's priorities */
 	sdma_set_channel_priority(&sdma->channel[0], 7);
 
-	clk_disable(sdma->clk_ipg);
-	clk_disable(sdma->clk_ahb);
+	clk_disable_unprepare(sdma->clk_ipg);
+	clk_disable_unprepare(sdma->clk_ahb);
 
 	return 0;
 
 err_dma_alloc:
-	clk_disable(sdma->clk_ipg);
-	clk_disable(sdma->clk_ahb);
+	clk_disable_unprepare(sdma->clk_ipg);
+	clk_disable_unprepare(sdma->clk_ahb);
 	dev_err(sdma->dev, "initialisation failed with %d\n", ret);
 	return ret;
 }
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ