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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20110209100857.555.54454.stgit@bob.linux.org.uk>
Date:	Wed, 09 Feb 2011 10:09:08 +0000
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	spi-devel-general@...ts.sourceforge.net, russ.gorby@...el.com,
	grant.likely@...retlab.ca, linux-kernel@...r.kernel.org
Subject: [PATCH 6/8] intel_mid_ssp_spi: Add the QoS quirk for slave mode

From: Alan Cox <alan@...ux.intel.com>

This is needed for Moorestown. Again we add this so that the default is off
and the code changed is all within if (quirks & ).

Baed on previous generic driver work by Mathieu SOULARD
<mathieux.soulard@...el.com>

Signed-off-by: Alan Cox <alan@...ux.intel.com>
---

 drivers/spi/intel_mid_ssp_spi.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)


diff --git a/drivers/spi/intel_mid_ssp_spi.c b/drivers/spi/intel_mid_ssp_spi.c
index c8cd3bb..26e41c2 100644
--- a/drivers/spi/intel_mid_ssp_spi.c
+++ b/drivers/spi/intel_mid_ssp_spi.c
@@ -186,6 +186,8 @@ struct driver_data {
 	int rxdma_done;
 	struct callback_param tx_param;
 	struct callback_param rx_param;
+	/* PM_QOS request (for Moorestown) */
+	struct pm_qos_request_list pm_qos_req;
 };
 
 struct chip_data {
@@ -443,6 +445,10 @@ static void dma_transfer_complete(void *arg)
 	/* Stop getting Time Outs */
 	iowrite32(0, reg + SSTO);
 
+	if (drv_data->quirks & QUIRKS_USE_PM_QOS)
+		pm_qos_update_request(&drv_data->pm_qos_req,
+						PM_QOS_DEFAULT_VALUE);
+
 	/* release DMA mappings */
 	unmap_dma_buffers(drv_data, drv_data->cur_msg);
 
@@ -556,6 +562,8 @@ static void dma_transfer(struct driver_data *drv_data)
 	struct dma_slave_config *txconf, *rxconf;
 	struct device *dev = &drv_data->pdev->dev;
 
+	if (drv_data->quirks & QUIRKS_USE_PM_QOS)
+		pm_qos_update_request(&drv_data->pm_qos_req, MIN_EXIT_LATENCY);
 	/* get Data Read/Write address */
 	ssdr_addr = (dma_addr_t)(drv_data->paddr + 0x10);
 	flag = DMA_PREP_INTERRUPT | DMA_CTRL_ACK;
@@ -1186,6 +1194,9 @@ static void cleanup(struct spi_device *spi)
 
 	if (drv_data->dma_inited)
 		intel_mid_ssp_spi_dma_exit(drv_data);
+	/* Remove the PM_QOS request */
+	if (drv_data->quirks & QUIRKS_USE_PM_QOS)
+		pm_qos_remove_request(&drv_data->pm_qos_req);
 	kfree(chip);
 	spi_set_ctldata(spi, NULL);
 }
@@ -1332,6 +1343,11 @@ static int intel_mid_ssp_spi_probe(struct pci_dev *pdev,
 
 	pci_set_drvdata(pdev, drv_data);
 
+	/* Create the PM_QOS request */
+	if (drv_data->quirks & QUIRKS_USE_PM_QOS)
+		pm_qos_add_request(&drv_data->pm_qos_req,
+			PM_QOS_CPU_DMA_LATENCY, PM_QOS_DEFAULT_VALUE);
+
 	pm_runtime_set_active(&pdev->dev);
 	pm_runtime_enable(&pdev->dev);
 	pm_runtime_idle(&pdev->dev);

--
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