mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
Three fixes for 3.4:
- Fix a lock ordering deadlock in JFFS2 - Fix an oops in the dataflash driver, triggered by a dummy call to test whether it has OTP functionality. - Fix request_mem_region() failure on amsdelta NAND driver. -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) iEYEABECAAYFAk+vekgACgkQdwG7hYl686N8bQCfdizsFrliKbDW20R/pO66NoAV aloAn0ln+mwe3rIdNt8qKynW8e8dbudF =R7XS -----END PGP SIGNATURE----- Merge tag 'for-linus-3.4-20120513' of git://git.infradead.org/linux-mtd Pull three MTD fixes from David Woodhouse: - Fix a lock ordering deadlock in JFFS2 - Fix an oops in the dataflash driver, triggered by a dummy call to test whether it has OTP functionality. - Fix request_mem_region() failure on amsdelta NAND driver. * tag 'for-linus-3.4-20120513' of git://git.infradead.org/linux-mtd: mtd: ams-delta: fix request_mem_region() failure jffs2: Fix lock acquisition order bug in gc path mtd: fix oops in dataflash driver
This commit is contained in:
commit
9ff00d58a9
3 changed files with 8 additions and 13 deletions
|
@ -376,7 +376,7 @@ static int otp_select_filemode(struct mtd_file_info *mfi, int mode)
|
||||||
* Make a fake call to mtd_read_fact_prot_reg() to check if OTP
|
* Make a fake call to mtd_read_fact_prot_reg() to check if OTP
|
||||||
* operations are supported.
|
* operations are supported.
|
||||||
*/
|
*/
|
||||||
if (mtd_read_fact_prot_reg(mtd, -1, -1, &retlen, NULL) == -EOPNOTSUPP)
|
if (mtd_read_fact_prot_reg(mtd, -1, 0, &retlen, NULL) == -EOPNOTSUPP)
|
||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
switch (mode) {
|
switch (mode) {
|
||||||
|
|
|
@ -212,18 +212,17 @@ static int __devinit ams_delta_init(struct platform_device *pdev)
|
||||||
/* Link the private data with the MTD structure */
|
/* Link the private data with the MTD structure */
|
||||||
ams_delta_mtd->priv = this;
|
ams_delta_mtd->priv = this;
|
||||||
|
|
||||||
if (!request_mem_region(res->start, resource_size(res),
|
/*
|
||||||
dev_name(&pdev->dev))) {
|
* Don't try to request the memory region from here,
|
||||||
dev_err(&pdev->dev, "request_mem_region failed\n");
|
* it should have been already requested from the
|
||||||
err = -EBUSY;
|
* gpio-omap driver and requesting it again would fail.
|
||||||
goto out_free;
|
*/
|
||||||
}
|
|
||||||
|
|
||||||
io_base = ioremap(res->start, resource_size(res));
|
io_base = ioremap(res->start, resource_size(res));
|
||||||
if (io_base == NULL) {
|
if (io_base == NULL) {
|
||||||
dev_err(&pdev->dev, "ioremap failed\n");
|
dev_err(&pdev->dev, "ioremap failed\n");
|
||||||
err = -EIO;
|
err = -EIO;
|
||||||
goto out_release_io;
|
goto out_free;
|
||||||
}
|
}
|
||||||
|
|
||||||
this->priv = io_base;
|
this->priv = io_base;
|
||||||
|
@ -271,8 +270,6 @@ out_gpio:
|
||||||
platform_set_drvdata(pdev, NULL);
|
platform_set_drvdata(pdev, NULL);
|
||||||
gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
|
gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
|
||||||
iounmap(io_base);
|
iounmap(io_base);
|
||||||
out_release_io:
|
|
||||||
release_mem_region(res->start, resource_size(res));
|
|
||||||
out_free:
|
out_free:
|
||||||
kfree(ams_delta_mtd);
|
kfree(ams_delta_mtd);
|
||||||
out:
|
out:
|
||||||
|
@ -285,7 +282,6 @@ out_free:
|
||||||
static int __devexit ams_delta_cleanup(struct platform_device *pdev)
|
static int __devexit ams_delta_cleanup(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
void __iomem *io_base = platform_get_drvdata(pdev);
|
void __iomem *io_base = platform_get_drvdata(pdev);
|
||||||
struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
|
||||||
|
|
||||||
/* Release resources, unregister device */
|
/* Release resources, unregister device */
|
||||||
nand_release(ams_delta_mtd);
|
nand_release(ams_delta_mtd);
|
||||||
|
@ -293,7 +289,6 @@ static int __devexit ams_delta_cleanup(struct platform_device *pdev)
|
||||||
gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
|
gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio));
|
||||||
gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
|
gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB);
|
||||||
iounmap(io_base);
|
iounmap(io_base);
|
||||||
release_mem_region(res->start, resource_size(res));
|
|
||||||
|
|
||||||
/* Free the MTD device structure */
|
/* Free the MTD device structure */
|
||||||
kfree(ams_delta_mtd);
|
kfree(ams_delta_mtd);
|
||||||
|
|
|
@ -234,8 +234,8 @@ int jffs2_garbage_collect_pass(struct jffs2_sb_info *c)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
jffs2_dbg(1, "No progress from erasing block; doing GC anyway\n");
|
jffs2_dbg(1, "No progress from erasing block; doing GC anyway\n");
|
||||||
spin_lock(&c->erase_completion_lock);
|
|
||||||
mutex_lock(&c->alloc_sem);
|
mutex_lock(&c->alloc_sem);
|
||||||
|
spin_lock(&c->erase_completion_lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* First, work out which block we're garbage-collecting */
|
/* First, work out which block we're garbage-collecting */
|
||||||
|
|
Loading…
Reference in a new issue