Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+8 -13
+1 -1
drivers/mtd/mtdchar.c
··· 376 376 * Make a fake call to mtd_read_fact_prot_reg() to check if OTP 377 377 * operations are supported. 378 378 */ 379 - if (mtd_read_fact_prot_reg(mtd, -1, -1, &retlen, NULL) == -EOPNOTSUPP) 379 + if (mtd_read_fact_prot_reg(mtd, -1, 0, &retlen, NULL) == -EOPNOTSUPP) 380 380 return -EOPNOTSUPP; 381 381 382 382 switch (mode) {
+6 -11
drivers/mtd/nand/ams-delta.c
··· 212 212 /* Link the private data with the MTD structure */ 213 213 ams_delta_mtd->priv = this; 214 214 215 - if (!request_mem_region(res->start, resource_size(res), 216 - dev_name(&pdev->dev))) { 217 - dev_err(&pdev->dev, "request_mem_region failed\n"); 218 - err = -EBUSY; 219 - goto out_free; 220 - } 215 + /* 216 + * Don't try to request the memory region from here, 217 + * it should have been already requested from the 218 + * gpio-omap driver and requesting it again would fail. 219 + */ 221 220 222 221 io_base = ioremap(res->start, resource_size(res)); 223 222 if (io_base == NULL) { 224 223 dev_err(&pdev->dev, "ioremap failed\n"); 225 224 err = -EIO; 226 - goto out_release_io; 225 + goto out_free; 227 226 } 228 227 229 228 this->priv = io_base; ··· 270 271 platform_set_drvdata(pdev, NULL); 271 272 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); 272 273 iounmap(io_base); 273 - out_release_io: 274 - release_mem_region(res->start, resource_size(res)); 275 274 out_free: 276 275 kfree(ams_delta_mtd); 277 276 out: ··· 282 285 static int __devexit ams_delta_cleanup(struct platform_device *pdev) 283 286 { 284 287 void __iomem *io_base = platform_get_drvdata(pdev); 285 - struct resource *res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 286 288 287 289 /* Release resources, unregister device */ 288 290 nand_release(ams_delta_mtd); ··· 289 293 gpio_free_array(_mandatory_gpio, ARRAY_SIZE(_mandatory_gpio)); 290 294 gpio_free(AMS_DELTA_GPIO_PIN_NAND_RB); 291 295 iounmap(io_base); 292 - release_mem_region(res->start, resource_size(res)); 293 296 294 297 /* Free the MTD device structure */ 295 298 kfree(ams_delta_mtd);
+1 -1
fs/jffs2/gc.c
··· 234 234 return 0; 235 235 236 236 jffs2_dbg(1, "No progress from erasing block; doing GC anyway\n"); 237 - spin_lock(&c->erase_completion_lock); 238 237 mutex_lock(&c->alloc_sem); 238 + spin_lock(&c->erase_completion_lock); 239 239 } 240 240 241 241 /* First, work out which block we're garbage-collecting */