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

Configure Feed

Select the types of activity you want to include in your feed.

Merge git://git.infradead.org/users/dwmw2/mtd-2.6.38

* git://git.infradead.org/users/dwmw2/mtd-2.6.38:
mtd: add "platform:" prefix for platform modalias
mtd: mtd_blkdevs: fix double free on error path
mtd: amd76xrom: fix oops at boot when resources are not available
mtd: fix race in cfi_cmdset_0001 driver
mtd: jedec_probe: initialise make sector erase command variable
mtd: jedec_probe: Change variable name from cfi_p to cfi

+44 -42
+22 -21
drivers/mtd/chips/cfi_cmdset_0001.c
··· 1230 1230 sleep_time = chip_op_time / 2; 1231 1231 1232 1232 for (;;) { 1233 + if (chip->state != chip_state) { 1234 + /* Someone's suspended the operation: sleep */ 1235 + DECLARE_WAITQUEUE(wait, current); 1236 + set_current_state(TASK_UNINTERRUPTIBLE); 1237 + add_wait_queue(&chip->wq, &wait); 1238 + mutex_unlock(&chip->mutex); 1239 + schedule(); 1240 + remove_wait_queue(&chip->wq, &wait); 1241 + mutex_lock(&chip->mutex); 1242 + continue; 1243 + } 1244 + 1233 1245 status = map_read(map, cmd_adr); 1234 1246 if (map_word_andequal(map, status, status_OK, status_OK)) 1235 1247 break; 1236 1248 1249 + if (chip->erase_suspended && chip_state == FL_ERASING) { 1250 + /* Erase suspend occured while sleep: reset timeout */ 1251 + timeo = reset_timeo; 1252 + chip->erase_suspended = 0; 1253 + } 1254 + if (chip->write_suspended && chip_state == FL_WRITING) { 1255 + /* Write suspend occured while sleep: reset timeout */ 1256 + timeo = reset_timeo; 1257 + chip->write_suspended = 0; 1258 + } 1237 1259 if (!timeo) { 1238 1260 map_write(map, CMD(0x70), cmd_adr); 1239 1261 chip->state = FL_STATUS; ··· 1279 1257 timeo--; 1280 1258 } 1281 1259 mutex_lock(&chip->mutex); 1282 - 1283 - while (chip->state != chip_state) { 1284 - /* Someone's suspended the operation: sleep */ 1285 - DECLARE_WAITQUEUE(wait, current); 1286 - set_current_state(TASK_UNINTERRUPTIBLE); 1287 - add_wait_queue(&chip->wq, &wait); 1288 - mutex_unlock(&chip->mutex); 1289 - schedule(); 1290 - remove_wait_queue(&chip->wq, &wait); 1291 - mutex_lock(&chip->mutex); 1292 - } 1293 - if (chip->erase_suspended && chip_state == FL_ERASING) { 1294 - /* Erase suspend occured while sleep: reset timeout */ 1295 - timeo = reset_timeo; 1296 - chip->erase_suspended = 0; 1297 - } 1298 - if (chip->write_suspended && chip_state == FL_WRITING) { 1299 - /* Write suspend occured while sleep: reset timeout */ 1300 - timeo = reset_timeo; 1301 - chip->write_suspended = 0; 1302 - } 1303 1260 } 1304 1261 1305 1262 /* Done and happy. */
+18 -17
drivers/mtd/chips/jedec_probe.c
··· 1935 1935 } 1936 1936 1937 1937 1938 - static int cfi_jedec_setup(struct cfi_private *p_cfi, int index) 1938 + static int cfi_jedec_setup(struct map_info *map, struct cfi_private *cfi, int index) 1939 1939 { 1940 1940 int i,num_erase_regions; 1941 1941 uint8_t uaddr; 1942 1942 1943 - if (! (jedec_table[index].devtypes & p_cfi->device_type)) { 1943 + if (!(jedec_table[index].devtypes & cfi->device_type)) { 1944 1944 DEBUG(MTD_DEBUG_LEVEL1, "Rejecting potential %s with incompatible %d-bit device type\n", 1945 - jedec_table[index].name, 4 * (1<<p_cfi->device_type)); 1945 + jedec_table[index].name, 4 * (1<<cfi->device_type)); 1946 1946 return 0; 1947 1947 } 1948 1948 ··· 1950 1950 1951 1951 num_erase_regions = jedec_table[index].nr_regions; 1952 1952 1953 - p_cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL); 1954 - if (!p_cfi->cfiq) { 1953 + cfi->cfiq = kmalloc(sizeof(struct cfi_ident) + num_erase_regions * 4, GFP_KERNEL); 1954 + if (!cfi->cfiq) { 1955 1955 //xx printk(KERN_WARNING "%s: kmalloc failed for CFI ident structure\n", map->name); 1956 1956 return 0; 1957 1957 } 1958 1958 1959 - memset(p_cfi->cfiq,0,sizeof(struct cfi_ident)); 1959 + memset(cfi->cfiq, 0, sizeof(struct cfi_ident)); 1960 1960 1961 - p_cfi->cfiq->P_ID = jedec_table[index].cmd_set; 1962 - p_cfi->cfiq->NumEraseRegions = jedec_table[index].nr_regions; 1963 - p_cfi->cfiq->DevSize = jedec_table[index].dev_size; 1964 - p_cfi->cfi_mode = CFI_MODE_JEDEC; 1961 + cfi->cfiq->P_ID = jedec_table[index].cmd_set; 1962 + cfi->cfiq->NumEraseRegions = jedec_table[index].nr_regions; 1963 + cfi->cfiq->DevSize = jedec_table[index].dev_size; 1964 + cfi->cfi_mode = CFI_MODE_JEDEC; 1965 + cfi->sector_erase_cmd = CMD(0x30); 1965 1966 1966 1967 for (i=0; i<num_erase_regions; i++){ 1967 - p_cfi->cfiq->EraseRegionInfo[i] = jedec_table[index].regions[i]; 1968 + cfi->cfiq->EraseRegionInfo[i] = jedec_table[index].regions[i]; 1968 1969 } 1969 - p_cfi->cmdset_priv = NULL; 1970 + cfi->cmdset_priv = NULL; 1970 1971 1971 1972 /* This may be redundant for some cases, but it doesn't hurt */ 1972 - p_cfi->mfr = jedec_table[index].mfr_id; 1973 - p_cfi->id = jedec_table[index].dev_id; 1973 + cfi->mfr = jedec_table[index].mfr_id; 1974 + cfi->id = jedec_table[index].dev_id; 1974 1975 1975 1976 uaddr = jedec_table[index].uaddr; 1976 1977 ··· 1979 1978 our brains explode when we see the datasheets talking about address 1980 1979 lines numbered from A-1 to A18. The CFI table has unlock addresses 1981 1980 in device-words according to the mode the device is connected in */ 1982 - p_cfi->addr_unlock1 = unlock_addrs[uaddr].addr1 / p_cfi->device_type; 1983 - p_cfi->addr_unlock2 = unlock_addrs[uaddr].addr2 / p_cfi->device_type; 1981 + cfi->addr_unlock1 = unlock_addrs[uaddr].addr1 / cfi->device_type; 1982 + cfi->addr_unlock2 = unlock_addrs[uaddr].addr2 / cfi->device_type; 1984 1983 1985 1984 return 1; /* ok */ 1986 1985 } ··· 2176 2175 "MTD %s(): matched device 0x%x,0x%x unlock_addrs: 0x%.4x 0x%.4x\n", 2177 2176 __func__, cfi->mfr, cfi->id, 2178 2177 cfi->addr_unlock1, cfi->addr_unlock2 ); 2179 - if (!cfi_jedec_setup(cfi, i)) 2178 + if (!cfi_jedec_setup(map, cfi, i)) 2180 2179 return 0; 2181 2180 goto ok_out; 2182 2181 }
+1
drivers/mtd/maps/amd76xrom.c
··· 151 151 printk(KERN_ERR MOD_NAME 152 152 " %s(): Unable to register resource %pR - kernel bug?\n", 153 153 __func__, &window->rsrc); 154 + return -EBUSY; 154 155 } 155 156 156 157
-1
drivers/mtd/mtd_blkdevs.c
··· 413 413 error2: 414 414 list_del(&new->list); 415 415 error1: 416 - kfree(new); 417 416 return ret; 418 417 } 419 418
+1 -1
drivers/mtd/nand/omap2.c
··· 968 968 module_init(omap_nand_init); 969 969 module_exit(omap_nand_exit); 970 970 971 - MODULE_ALIAS(DRIVER_NAME); 971 + MODULE_ALIAS("platform:" DRIVER_NAME); 972 972 MODULE_LICENSE("GPL"); 973 973 MODULE_DESCRIPTION("Glue layer for NAND flash on TI OMAP boards");
+1 -1
drivers/mtd/onenand/generic.c
··· 131 131 .remove = __devexit_p(generic_onenand_remove), 132 132 }; 133 133 134 - MODULE_ALIAS(DRIVER_NAME); 134 + MODULE_ALIAS("platform:" DRIVER_NAME); 135 135 136 136 static int __init generic_onenand_init(void) 137 137 {
+1 -1
drivers/mtd/onenand/omap2.c
··· 860 860 module_init(omap2_onenand_init); 861 861 module_exit(omap2_onenand_exit); 862 862 863 - MODULE_ALIAS(DRIVER_NAME); 863 + MODULE_ALIAS("platform:" DRIVER_NAME); 864 864 MODULE_LICENSE("GPL"); 865 865 MODULE_AUTHOR("Jarkko Lavinen <jarkko.lavinen@nokia.com>"); 866 866 MODULE_DESCRIPTION("Glue layer for OneNAND flash on OMAP2 / OMAP3");