Hi, Please find below incremental patch for intel_mid_i2s to fix the runtime power management.
It removes access to PCI device register in case of interrupt call (the irq of SSP is shared, software interrupt should be ignored if in suspend). (FYI, this patch should be applied after the patches delivered on 10 November by Selma Bensaid : 0001-Call-the-DMA-Terminate-All-interface-when-closing-in.patch ) Best regards Louis >From 13115552e2b8b17fea72882a49f9415302635bc5 Mon Sep 17 00:00:00 2001 From: Louis LE GALL <[email protected]> Date: Fri, 19 Nov 2010 17:19:18 +0100 Subject: [PATCH] intel_mid_i2s : Fix handling interrupt for shared irq when suspended The irq for ssp is shared, so when device is suspended driver should not read register and ignore the interrupt This patch ignores interrupts when device is suspended. This also allows the device to be explictly suspended after probe Signed-off-by: Louis LE GALL <[email protected]> --- sound/pci/intel_mid_i2s/intel_mid_i2s.c | 18 ++++++++++++++++-- 1 files changed, 16 insertions(+), 2 deletions(-) diff --git a/sound/pci/intel_mid_i2s/intel_mid_i2s.c b/sound/pci/intel_mid_i2s/intel_mid_i2s.c index 65b2193..90c6f8e 100644 --- a/sound/pci/intel_mid_i2s/intel_mid_i2s.c +++ b/sound/pci/intel_mid_i2s/intel_mid_i2s.c @@ -627,11 +627,13 @@ void intel_mid_i2s_close(struct intel_mid_i2s_hdl *drv_data) put_device(&drv_data->pdev->dev); write_SSCR0(0, reg); - /* pm runtime */ - pm_runtime_put(&drv_data->pdev->dev); dev_dbg(&(drv_data->pdev->dev), "SSP Stopped.\n"); clear_bit(I2S_PORT_CLOSING, &drv_data->flags); clear_bit(I2S_PORT_OPENED, &drv_data->flags); + + /* pm runtime */ + pm_runtime_put(&drv_data->pdev->dev); + mutex_unlock(&drv_data->mutex); } EXPORT_SYMBOL_GPL(intel_mid_i2s_close); @@ -1027,6 +1029,14 @@ static irqreturn_t i2s_int(int irq, void *dev_id) reg = drv_data->ioaddr; irq_status = read_SSSR(reg); + + if (ddgb->status!=DPM_ON) + return IRQ_NONE; +#ifdef CONFIG_PM_RUNTIME + if (ddbg->runtime_status!=RPM_ACTIVE) + return IRQ_NONE; +#endif + if (!(irq_status & (drv_data->mask_sr))) { return IRQ_NONE; } else { @@ -1442,6 +1452,10 @@ static int intel_mid_i2s_probe(struct pci_dev *pdev, goto err_i2s_probe3; } pm_runtime_enable(&(drv_data->pdev->dev)); + pm_runtime_allow(&(drv_data->pdev->dev)); + pm_runtime_set_active(&(drv_data->pdev->dev)); + pm_request_idle(&(drv_data->pdev->dev)); + goto leave; err_i2s_probe3: iounmap(drv_data->ioaddr); -- 1.7.2.3 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris, 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies.
0001-intel_mid_i2s-Fix-handling-interrupt-for-shared-irq-.patch
Description: 0001-intel_mid_i2s-Fix-handling-interrupt-for-shared-irq-.patch
_______________________________________________ MeeGo-kernel mailing list [email protected] http://lists.meego.com/listinfo/meego-kernel
