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 tag 'for-linus-20121123' of git://git.infradead.org/mtd-2.6

Pull MTD fixes from David Woodhouse:
"The most important part of this is that it fixes a regression in
Samsung NAND chip detection, introduced by some rework which went into
3.7. The initial fix wasn't quite complete, so it's in two parts. In
fact the first part is committed twice (Artem committed his own copy
of the same patch) and I've merged Artem's tree into mine which
already had that fix.

I'd have recommitted that to make it somewhat cleaner, but figured by
this point in the release cycle it was better to merge *exactly* the
commits which have been in linux-next.

If I'd recommitted, I'd also omit the sparse warning fix. But it's
there, and it's harmless — just marking one function as 'static' in
onenand code.

This also includes a couple more fixes for stable: an AB-BA deadlock
in JFFS2, and an invalid range check in slram."

* tag 'for-linus-20121123' of git://git.infradead.org/mtd-2.6:
mtd: nand: fix Samsung SLC detection regression
mtd: nand: fix Samsung SLC NAND identification regression
jffs2: Fix lock acquisition order bug in jffs2_write_begin
mtd: onenand: Make flexonenand_set_boundary static
mtd: slram: invalid checking of absolute end address
mtd: ofpart: Fix incorrect NULL check in parse_ofoldpart_partitions()
mtd: nand: fix Samsung SLC NAND identification regression

+31 -26
+1 -1
drivers/mtd/devices/slram.c
··· 240 240 241 241 if (*(szlength) != '+') { 242 242 devlength = simple_strtoul(szlength, &buffer, 0); 243 - devlength = handle_unit(devlength, buffer) - devstart; 243 + devlength = handle_unit(devlength, buffer); 244 244 if (devlength < devstart) 245 245 goto err_out; 246 246
+6 -4
drivers/mtd/nand/nand_base.c
··· 2983 2983 /* 2984 2984 * Field definitions are in the following datasheets: 2985 2985 * Old style (4,5 byte ID): Samsung K9GAG08U0M (p.32) 2986 - * New style (6 byte ID): Samsung K9GAG08U0F (p.44) 2986 + * New Samsung (6 byte ID): Samsung K9GAG08U0F (p.44) 2987 2987 * Hynix MLC (6 byte ID): Hynix H27UBG8T2B (p.22) 2988 2988 * 2989 - * Check for ID length, cell type, and Hynix/Samsung ID to decide what 2990 - * to do. 2989 + * Check for ID length, non-zero 6th byte, cell type, and Hynix/Samsung 2990 + * ID to decide what to do. 2991 2991 */ 2992 - if (id_len == 6 && id_data[0] == NAND_MFR_SAMSUNG) { 2992 + if (id_len == 6 && id_data[0] == NAND_MFR_SAMSUNG && 2993 + (chip->cellinfo & NAND_CI_CELLTYPE_MSK) && 2994 + id_data[5] != 0x00) { 2993 2995 /* Calc pagesize */ 2994 2996 mtd->writesize = 2048 << (extid & 0x03); 2995 2997 extid >>= 2;
+1 -1
drivers/mtd/ofpart.c
··· 121 121 nr_parts = plen / sizeof(part[0]); 122 122 123 123 *pparts = kzalloc(nr_parts * sizeof(*(*pparts)), GFP_KERNEL); 124 - if (!pparts) 124 + if (!*pparts) 125 125 return -ENOMEM; 126 126 127 127 names = of_get_property(dp, "partition-names", &plen);
+1 -1
drivers/mtd/onenand/onenand_base.c
··· 3694 3694 * flexonenand_set_boundary - Writes the SLC boundary 3695 3695 * @param mtd - mtd info structure 3696 3696 */ 3697 - int flexonenand_set_boundary(struct mtd_info *mtd, int die, 3697 + static int flexonenand_set_boundary(struct mtd_info *mtd, int die, 3698 3698 int boundary, int lock) 3699 3699 { 3700 3700 struct onenand_chip *this = mtd->priv;
+22 -19
fs/jffs2/file.c
··· 138 138 struct page *pg; 139 139 struct inode *inode = mapping->host; 140 140 struct jffs2_inode_info *f = JFFS2_INODE_INFO(inode); 141 + struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); 142 + struct jffs2_raw_inode ri; 143 + uint32_t alloc_len = 0; 141 144 pgoff_t index = pos >> PAGE_CACHE_SHIFT; 142 145 uint32_t pageofs = index << PAGE_CACHE_SHIFT; 143 146 int ret = 0; 144 147 145 - pg = grab_cache_page_write_begin(mapping, index, flags); 146 - if (!pg) 147 - return -ENOMEM; 148 - *pagep = pg; 149 - 150 148 jffs2_dbg(1, "%s()\n", __func__); 151 149 152 150 if (pageofs > inode->i_size) { 151 + ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len, 152 + ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE); 153 + if (ret) 154 + return ret; 155 + } 156 + 157 + mutex_lock(&f->sem); 158 + pg = grab_cache_page_write_begin(mapping, index, flags); 159 + if (!pg) { 160 + if (alloc_len) 161 + jffs2_complete_reservation(c); 162 + mutex_unlock(&f->sem); 163 + return -ENOMEM; 164 + } 165 + *pagep = pg; 166 + 167 + if (alloc_len) { 153 168 /* Make new hole frag from old EOF to new page */ 154 - struct jffs2_sb_info *c = JFFS2_SB_INFO(inode->i_sb); 155 - struct jffs2_raw_inode ri; 156 169 struct jffs2_full_dnode *fn; 157 - uint32_t alloc_len; 158 170 159 171 jffs2_dbg(1, "Writing new hole frag 0x%x-0x%x between current EOF and new page\n", 160 172 (unsigned int)inode->i_size, pageofs); 161 173 162 - ret = jffs2_reserve_space(c, sizeof(ri), &alloc_len, 163 - ALLOC_NORMAL, JFFS2_SUMMARY_INODE_SIZE); 164 - if (ret) 165 - goto out_page; 166 - 167 - mutex_lock(&f->sem); 168 174 memset(&ri, 0, sizeof(ri)); 169 175 170 176 ri.magic = cpu_to_je16(JFFS2_MAGIC_BITMASK); ··· 197 191 if (IS_ERR(fn)) { 198 192 ret = PTR_ERR(fn); 199 193 jffs2_complete_reservation(c); 200 - mutex_unlock(&f->sem); 201 194 goto out_page; 202 195 } 203 196 ret = jffs2_add_full_dnode_to_inode(c, f, fn); ··· 211 206 jffs2_mark_node_obsolete(c, fn->raw); 212 207 jffs2_free_full_dnode(fn); 213 208 jffs2_complete_reservation(c); 214 - mutex_unlock(&f->sem); 215 209 goto out_page; 216 210 } 217 211 jffs2_complete_reservation(c); 218 212 inode->i_size = pageofs; 219 - mutex_unlock(&f->sem); 220 213 } 221 214 222 215 /* ··· 223 220 * case of a short-copy. 224 221 */ 225 222 if (!PageUptodate(pg)) { 226 - mutex_lock(&f->sem); 227 223 ret = jffs2_do_readpage_nolock(inode, pg); 228 - mutex_unlock(&f->sem); 229 224 if (ret) 230 225 goto out_page; 231 226 } 227 + mutex_unlock(&f->sem); 232 228 jffs2_dbg(1, "end write_begin(). pg->flags %lx\n", pg->flags); 233 229 return ret; 234 230 235 231 out_page: 236 232 unlock_page(pg); 237 233 page_cache_release(pg); 234 + mutex_unlock(&f->sem); 238 235 return ret; 239 236 } 240 237