diff options
author | Ingo Molnar <mingo@kernel.org> | 2012-04-25 06:24:16 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2012-04-25 06:24:16 -0400 |
commit | cd32b1616bc79b2f2ce1b1c6164beecfecc2259c (patch) | |
tree | 2e91c49b5c2bd927b9b74b7414dbb6839af601e1 /drivers | |
parent | 89b8835ec865dddd6673a8dd7003581bf2377176 (diff) | |
parent | a720b2dd2470a52345df11dca8d6c1466599f812 (diff) |
Merge tag 'l3-fix-for-3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp into x86/urgent
A small L3 cache index disable fix from Srivatsa Bhat which unifies the
way the code checks for already disabled indices.
( Pulling it into v3.4 despite the v3.5 tag - the fix is small and we better
keep the same code across kernel versions for such user facing interfaces. )
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/amba/bus.c | 42 | ||||
-rw-r--r-- | drivers/mfd/db8500-prcmu.c | 1 | ||||
-rw-r--r-- | drivers/pci/pci.c | 57 | ||||
-rw-r--r-- | drivers/scsi/scsi_error.c | 2 | ||||
-rw-r--r-- | drivers/spi/spi-pl022.c | 2 | ||||
-rw-r--r-- | drivers/video/msm/mddi.c | 8 |
6 files changed, 46 insertions, 66 deletions
diff --git a/drivers/amba/bus.c b/drivers/amba/bus.c index 01c2cf4efcd..cc273226dbd 100644 --- a/drivers/amba/bus.c +++ b/drivers/amba/bus.c | |||
@@ -247,8 +247,7 @@ static int amba_pm_restore(struct device *dev) | |||
247 | /* | 247 | /* |
248 | * Hooks to provide runtime PM of the pclk (bus clock). It is safe to | 248 | * Hooks to provide runtime PM of the pclk (bus clock). It is safe to |
249 | * enable/disable the bus clock at runtime PM suspend/resume as this | 249 | * enable/disable the bus clock at runtime PM suspend/resume as this |
250 | * does not result in loss of context. However, disabling vcore power | 250 | * does not result in loss of context. |
251 | * would do, so we leave that to the driver. | ||
252 | */ | 251 | */ |
253 | static int amba_pm_runtime_suspend(struct device *dev) | 252 | static int amba_pm_runtime_suspend(struct device *dev) |
254 | { | 253 | { |
@@ -354,39 +353,6 @@ static void amba_put_disable_pclk(struct amba_device *pcdev) | |||
354 | clk_put(pclk); | 353 | clk_put(pclk); |
355 | } | 354 | } |
356 | 355 | ||
357 | static int amba_get_enable_vcore(struct amba_device *pcdev) | ||
358 | { | ||
359 | struct regulator *vcore = regulator_get(&pcdev->dev, "vcore"); | ||
360 | int ret; | ||
361 | |||
362 | pcdev->vcore = vcore; | ||
363 | |||
364 | if (IS_ERR(vcore)) { | ||
365 | /* It is OK not to supply a vcore regulator */ | ||
366 | if (PTR_ERR(vcore) == -ENODEV) | ||
367 | return 0; | ||
368 | return PTR_ERR(vcore); | ||
369 | } | ||
370 | |||
371 | ret = regulator_enable(vcore); | ||
372 | if (ret) { | ||
373 | regulator_put(vcore); | ||
374 | pcdev->vcore = ERR_PTR(-ENODEV); | ||
375 | } | ||
376 | |||
377 | return ret; | ||
378 | } | ||
379 | |||
380 | static void amba_put_disable_vcore(struct amba_device *pcdev) | ||
381 | { | ||
382 | struct regulator *vcore = pcdev->vcore; | ||
383 | |||
384 | if (!IS_ERR(vcore)) { | ||
385 | regulator_disable(vcore); | ||
386 | regulator_put(vcore); | ||
387 | } | ||
388 | } | ||
389 | |||
390 | /* | 356 | /* |
391 | * These are the device model conversion veneers; they convert the | 357 | * These are the device model conversion veneers; they convert the |
392 | * device model structures to our more specific structures. | 358 | * device model structures to our more specific structures. |
@@ -399,10 +365,6 @@ static int amba_probe(struct device *dev) | |||
399 | int ret; | 365 | int ret; |
400 | 366 | ||
401 | do { | 367 | do { |
402 | ret = amba_get_enable_vcore(pcdev); | ||
403 | if (ret) | ||
404 | break; | ||
405 | |||
406 | ret = amba_get_enable_pclk(pcdev); | 368 | ret = amba_get_enable_pclk(pcdev); |
407 | if (ret) | 369 | if (ret) |
408 | break; | 370 | break; |
@@ -420,7 +382,6 @@ static int amba_probe(struct device *dev) | |||
420 | pm_runtime_put_noidle(dev); | 382 | pm_runtime_put_noidle(dev); |
421 | 383 | ||
422 | amba_put_disable_pclk(pcdev); | 384 | amba_put_disable_pclk(pcdev); |
423 | amba_put_disable_vcore(pcdev); | ||
424 | } while (0); | 385 | } while (0); |
425 | 386 | ||
426 | return ret; | 387 | return ret; |
@@ -442,7 +403,6 @@ static int amba_remove(struct device *dev) | |||
442 | pm_runtime_put_noidle(dev); | 403 | pm_runtime_put_noidle(dev); |
443 | 404 | ||
444 | amba_put_disable_pclk(pcdev); | 405 | amba_put_disable_pclk(pcdev); |
445 | amba_put_disable_vcore(pcdev); | ||
446 | 406 | ||
447 | return ret; | 407 | return ret; |
448 | } | 408 | } |
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index ebc1e865822..5be32489714 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c | |||
@@ -2788,6 +2788,7 @@ static struct regulator_init_data db8500_regulators[DB8500_NUM_REGULATORS] = { | |||
2788 | .constraints = { | 2788 | .constraints = { |
2789 | .name = "db8500-vape", | 2789 | .name = "db8500-vape", |
2790 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, | 2790 | .valid_ops_mask = REGULATOR_CHANGE_STATUS, |
2791 | .always_on = true, | ||
2791 | }, | 2792 | }, |
2792 | .consumer_supplies = db8500_vape_consumers, | 2793 | .consumer_supplies = db8500_vape_consumers, |
2793 | .num_consumer_supplies = ARRAY_SIZE(db8500_vape_consumers), | 2794 | .num_consumer_supplies = ARRAY_SIZE(db8500_vape_consumers), |
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 81567441526..d20f1334792 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -967,16 +967,47 @@ pci_save_state(struct pci_dev *dev) | |||
967 | return 0; | 967 | return 0; |
968 | } | 968 | } |
969 | 969 | ||
970 | static void pci_restore_config_dword(struct pci_dev *pdev, int offset, | ||
971 | u32 saved_val, int retry) | ||
972 | { | ||
973 | u32 val; | ||
974 | |||
975 | pci_read_config_dword(pdev, offset, &val); | ||
976 | if (val == saved_val) | ||
977 | return; | ||
978 | |||
979 | for (;;) { | ||
980 | dev_dbg(&pdev->dev, "restoring config space at offset " | ||
981 | "%#x (was %#x, writing %#x)\n", offset, val, saved_val); | ||
982 | pci_write_config_dword(pdev, offset, saved_val); | ||
983 | if (retry-- <= 0) | ||
984 | return; | ||
985 | |||
986 | pci_read_config_dword(pdev, offset, &val); | ||
987 | if (val == saved_val) | ||
988 | return; | ||
989 | |||
990 | mdelay(1); | ||
991 | } | ||
992 | } | ||
993 | |||
994 | static void pci_restore_config_space(struct pci_dev *pdev, int start, int end, | ||
995 | int retry) | ||
996 | { | ||
997 | int index; | ||
998 | |||
999 | for (index = end; index >= start; index--) | ||
1000 | pci_restore_config_dword(pdev, 4 * index, | ||
1001 | pdev->saved_config_space[index], | ||
1002 | retry); | ||
1003 | } | ||
1004 | |||
970 | /** | 1005 | /** |
971 | * pci_restore_state - Restore the saved state of a PCI device | 1006 | * pci_restore_state - Restore the saved state of a PCI device |
972 | * @dev: - PCI device that we're dealing with | 1007 | * @dev: - PCI device that we're dealing with |
973 | */ | 1008 | */ |
974 | void pci_restore_state(struct pci_dev *dev) | 1009 | void pci_restore_state(struct pci_dev *dev) |
975 | { | 1010 | { |
976 | int i; | ||
977 | u32 val; | ||
978 | int tries; | ||
979 | |||
980 | if (!dev->state_saved) | 1011 | if (!dev->state_saved) |
981 | return; | 1012 | return; |
982 | 1013 | ||
@@ -984,24 +1015,14 @@ void pci_restore_state(struct pci_dev *dev) | |||
984 | pci_restore_pcie_state(dev); | 1015 | pci_restore_pcie_state(dev); |
985 | pci_restore_ats_state(dev); | 1016 | pci_restore_ats_state(dev); |
986 | 1017 | ||
1018 | pci_restore_config_space(dev, 10, 15, 0); | ||
987 | /* | 1019 | /* |
988 | * The Base Address register should be programmed before the command | 1020 | * The Base Address register should be programmed before the command |
989 | * register(s) | 1021 | * register(s) |
990 | */ | 1022 | */ |
991 | for (i = 15; i >= 0; i--) { | 1023 | pci_restore_config_space(dev, 4, 9, 10); |
992 | pci_read_config_dword(dev, i * 4, &val); | 1024 | pci_restore_config_space(dev, 0, 3, 0); |
993 | tries = 10; | 1025 | |
994 | while (tries && val != dev->saved_config_space[i]) { | ||
995 | dev_dbg(&dev->dev, "restoring config " | ||
996 | "space at offset %#x (was %#x, writing %#x)\n", | ||
997 | i, val, (int)dev->saved_config_space[i]); | ||
998 | pci_write_config_dword(dev,i * 4, | ||
999 | dev->saved_config_space[i]); | ||
1000 | pci_read_config_dword(dev, i * 4, &val); | ||
1001 | mdelay(10); | ||
1002 | tries--; | ||
1003 | } | ||
1004 | } | ||
1005 | pci_restore_pcix_state(dev); | 1026 | pci_restore_pcix_state(dev); |
1006 | pci_restore_msi_state(dev); | 1027 | pci_restore_msi_state(dev); |
1007 | pci_restore_iov_state(dev); | 1028 | pci_restore_iov_state(dev); |
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c index 2cfcbffa41f..386f0c53bea 100644 --- a/drivers/scsi/scsi_error.c +++ b/drivers/scsi/scsi_error.c | |||
@@ -835,7 +835,7 @@ static int scsi_send_eh_cmnd(struct scsi_cmnd *scmd, unsigned char *cmnd, | |||
835 | 835 | ||
836 | scsi_eh_restore_cmnd(scmd, &ses); | 836 | scsi_eh_restore_cmnd(scmd, &ses); |
837 | 837 | ||
838 | if (sdrv->eh_action) | 838 | if (sdrv && sdrv->eh_action) |
839 | rtn = sdrv->eh_action(scmd, cmnd, cmnd_size, rtn); | 839 | rtn = sdrv->eh_action(scmd, cmnd, cmnd_size, rtn); |
840 | 840 | ||
841 | return rtn; | 841 | return rtn; |
diff --git a/drivers/spi/spi-pl022.c b/drivers/spi/spi-pl022.c index 96f0da66b18..09c925aaf32 100644 --- a/drivers/spi/spi-pl022.c +++ b/drivers/spi/spi-pl022.c | |||
@@ -2195,7 +2195,6 @@ static int pl022_runtime_suspend(struct device *dev) | |||
2195 | struct pl022 *pl022 = dev_get_drvdata(dev); | 2195 | struct pl022 *pl022 = dev_get_drvdata(dev); |
2196 | 2196 | ||
2197 | clk_disable(pl022->clk); | 2197 | clk_disable(pl022->clk); |
2198 | amba_vcore_disable(pl022->adev); | ||
2199 | 2198 | ||
2200 | return 0; | 2199 | return 0; |
2201 | } | 2200 | } |
@@ -2204,7 +2203,6 @@ static int pl022_runtime_resume(struct device *dev) | |||
2204 | { | 2203 | { |
2205 | struct pl022 *pl022 = dev_get_drvdata(dev); | 2204 | struct pl022 *pl022 = dev_get_drvdata(dev); |
2206 | 2205 | ||
2207 | amba_vcore_enable(pl022->adev); | ||
2208 | clk_enable(pl022->clk); | 2206 | clk_enable(pl022->clk); |
2209 | 2207 | ||
2210 | return 0; | 2208 | return 0; |
diff --git a/drivers/video/msm/mddi.c b/drivers/video/msm/mddi.c index 4527cbf0a4e..b061d709bc4 100644 --- a/drivers/video/msm/mddi.c +++ b/drivers/video/msm/mddi.c | |||
@@ -420,7 +420,7 @@ static void mddi_resume(struct msm_mddi_client_data *cdata) | |||
420 | mddi_set_auto_hibernate(&mddi->client_data, 1); | 420 | mddi_set_auto_hibernate(&mddi->client_data, 1); |
421 | } | 421 | } |
422 | 422 | ||
423 | static int __init mddi_get_client_caps(struct mddi_info *mddi) | 423 | static int __devinit mddi_get_client_caps(struct mddi_info *mddi) |
424 | { | 424 | { |
425 | int i, j; | 425 | int i, j; |
426 | 426 | ||
@@ -622,9 +622,9 @@ uint32_t mddi_remote_read(struct msm_mddi_client_data *cdata, uint32_t reg) | |||
622 | 622 | ||
623 | static struct mddi_info mddi_info[2]; | 623 | static struct mddi_info mddi_info[2]; |
624 | 624 | ||
625 | static int __init mddi_clk_setup(struct platform_device *pdev, | 625 | static int __devinit mddi_clk_setup(struct platform_device *pdev, |
626 | struct mddi_info *mddi, | 626 | struct mddi_info *mddi, |
627 | unsigned long clk_rate) | 627 | unsigned long clk_rate) |
628 | { | 628 | { |
629 | int ret; | 629 | int ret; |
630 | 630 | ||