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

Merge branch 'for-next' from git://sources.calxeda.com/kernel/linux.git

Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

+60 -48
+1 -1
Documentation/devicetree/bindings/mmc/exynos-dw-mshc.txt
··· 4 4 The Synopsis designware mobile storage host controller is used to interface 5 5 a SoC with storage medium such as eMMC or SD/MMC cards. This file documents 6 6 differences between the core Synopsis dw mshc controller properties described 7 - by synposis-dw-mshc.txt and the properties used by the Samsung Exynos specific 7 + by synopsis-dw-mshc.txt and the properties used by the Samsung Exynos specific 8 8 extensions to the Synopsis Designware Mobile Storage Host Controller. 9 9 10 10 Required Properties:
+2 -2
arch/sparc/kernel/prom_common.c
··· 64 64 err = -ENODEV; 65 65 66 66 mutex_lock(&of_set_property_mutex); 67 - write_lock(&devtree_lock); 67 + raw_spin_lock(&devtree_lock); 68 68 prevp = &dp->properties; 69 69 while (*prevp) { 70 70 struct property *prop = *prevp; ··· 91 91 } 92 92 prevp = &(*prevp)->next; 93 93 } 94 - write_unlock(&devtree_lock); 94 + raw_spin_unlock(&devtree_lock); 95 95 mutex_unlock(&of_set_property_mutex); 96 96 97 97 /* XXX Upate procfs if necessary... */
+56 -44
drivers/of/base.c
··· 38 38 /* use when traversing tree through the allnext, child, sibling, 39 39 * or parent members of struct device_node. 40 40 */ 41 - DEFINE_RWLOCK(devtree_lock); 41 + DEFINE_RAW_SPINLOCK(devtree_lock); 42 42 43 43 int of_n_addr_cells(struct device_node *np) 44 44 { ··· 171 171 int *lenp) 172 172 { 173 173 struct property *pp; 174 + unsigned long flags; 174 175 175 - read_lock(&devtree_lock); 176 + raw_spin_lock_irqsave(&devtree_lock, flags); 176 177 pp = __of_find_property(np, name, lenp); 177 - read_unlock(&devtree_lock); 178 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 178 179 179 180 return pp; 180 181 } ··· 193 192 { 194 193 struct device_node *np; 195 194 196 - read_lock(&devtree_lock); 195 + raw_spin_lock(&devtree_lock); 197 196 np = prev ? prev->allnext : of_allnodes; 198 197 for (; np != NULL; np = np->allnext) 199 198 if (of_node_get(np)) 200 199 break; 201 200 of_node_put(prev); 202 - read_unlock(&devtree_lock); 201 + raw_spin_unlock(&devtree_lock); 203 202 return np; 204 203 } 205 204 EXPORT_SYMBOL(of_find_all_nodes); ··· 258 257 int of_device_is_compatible(const struct device_node *device, 259 258 const char *compat) 260 259 { 260 + unsigned long flags; 261 261 int res; 262 262 263 - read_lock(&devtree_lock); 263 + raw_spin_lock_irqsave(&devtree_lock, flags); 264 264 res = __of_device_is_compatible(device, compat); 265 - read_unlock(&devtree_lock); 265 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 266 266 return res; 267 267 } 268 268 EXPORT_SYMBOL(of_device_is_compatible); ··· 325 323 struct device_node *of_get_parent(const struct device_node *node) 326 324 { 327 325 struct device_node *np; 326 + unsigned long flags; 328 327 329 328 if (!node) 330 329 return NULL; 331 330 332 - read_lock(&devtree_lock); 331 + raw_spin_lock_irqsave(&devtree_lock, flags); 333 332 np = of_node_get(node->parent); 334 - read_unlock(&devtree_lock); 333 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 335 334 return np; 336 335 } 337 336 EXPORT_SYMBOL(of_get_parent); ··· 351 348 struct device_node *of_get_next_parent(struct device_node *node) 352 349 { 353 350 struct device_node *parent; 351 + unsigned long flags; 354 352 355 353 if (!node) 356 354 return NULL; 357 355 358 - read_lock(&devtree_lock); 356 + raw_spin_lock_irqsave(&devtree_lock, flags); 359 357 parent = of_node_get(node->parent); 360 358 of_node_put(node); 361 - read_unlock(&devtree_lock); 359 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 362 360 return parent; 363 361 } 364 362 ··· 375 371 struct device_node *prev) 376 372 { 377 373 struct device_node *next; 374 + unsigned long flags; 378 375 379 - read_lock(&devtree_lock); 376 + raw_spin_lock_irqsave(&devtree_lock, flags); 380 377 next = prev ? prev->sibling : node->child; 381 378 for (; next; next = next->sibling) 382 379 if (of_node_get(next)) 383 380 break; 384 381 of_node_put(prev); 385 - read_unlock(&devtree_lock); 382 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 386 383 return next; 387 384 } 388 385 EXPORT_SYMBOL(of_get_next_child); ··· 401 396 { 402 397 struct device_node *next; 403 398 404 - read_lock(&devtree_lock); 399 + raw_spin_lock(&devtree_lock); 405 400 next = prev ? prev->sibling : node->child; 406 401 for (; next; next = next->sibling) { 407 402 if (!of_device_is_available(next)) ··· 410 405 break; 411 406 } 412 407 of_node_put(prev); 413 - read_unlock(&devtree_lock); 408 + raw_spin_unlock(&devtree_lock); 414 409 return next; 415 410 } 416 411 EXPORT_SYMBOL(of_get_next_available_child); ··· 448 443 struct device_node *of_find_node_by_path(const char *path) 449 444 { 450 445 struct device_node *np = of_allnodes; 446 + unsigned long flags; 451 447 452 - read_lock(&devtree_lock); 448 + raw_spin_lock_irqsave(&devtree_lock, flags); 453 449 for (; np; np = np->allnext) { 454 450 if (np->full_name && (of_node_cmp(np->full_name, path) == 0) 455 451 && of_node_get(np)) 456 452 break; 457 453 } 458 - read_unlock(&devtree_lock); 454 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 459 455 return np; 460 456 } 461 457 EXPORT_SYMBOL(of_find_node_by_path); ··· 476 470 const char *name) 477 471 { 478 472 struct device_node *np; 473 + unsigned long flags; 479 474 480 - read_lock(&devtree_lock); 475 + raw_spin_lock_irqsave(&devtree_lock, flags); 481 476 np = from ? from->allnext : of_allnodes; 482 477 for (; np; np = np->allnext) 483 478 if (np->name && (of_node_cmp(np->name, name) == 0) 484 479 && of_node_get(np)) 485 480 break; 486 481 of_node_put(from); 487 - read_unlock(&devtree_lock); 482 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 488 483 return np; 489 484 } 490 485 EXPORT_SYMBOL(of_find_node_by_name); ··· 506 499 const char *type) 507 500 { 508 501 struct device_node *np; 502 + unsigned long flags; 509 503 510 - read_lock(&devtree_lock); 504 + raw_spin_lock_irqsave(&devtree_lock, flags); 511 505 np = from ? from->allnext : of_allnodes; 512 506 for (; np; np = np->allnext) 513 507 if (np->type && (of_node_cmp(np->type, type) == 0) 514 508 && of_node_get(np)) 515 509 break; 516 510 of_node_put(from); 517 - read_unlock(&devtree_lock); 511 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 518 512 return np; 519 513 } 520 514 EXPORT_SYMBOL(of_find_node_by_type); ··· 538 530 const char *type, const char *compatible) 539 531 { 540 532 struct device_node *np; 533 + unsigned long flags; 541 534 542 - read_lock(&devtree_lock); 535 + raw_spin_lock_irqsave(&devtree_lock, flags); 543 536 np = from ? from->allnext : of_allnodes; 544 537 for (; np; np = np->allnext) { 545 538 if (type ··· 551 542 break; 552 543 } 553 544 of_node_put(from); 554 - read_unlock(&devtree_lock); 545 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 555 546 return np; 556 547 } 557 548 EXPORT_SYMBOL(of_find_compatible_node); ··· 573 564 { 574 565 struct device_node *np; 575 566 struct property *pp; 567 + unsigned long flags; 576 568 577 - read_lock(&devtree_lock); 569 + raw_spin_lock_irqsave(&devtree_lock, flags); 578 570 np = from ? from->allnext : of_allnodes; 579 571 for (; np; np = np->allnext) { 580 572 for (pp = np->properties; pp; pp = pp->next) { ··· 587 577 } 588 578 out: 589 579 of_node_put(from); 590 - read_unlock(&devtree_lock); 580 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 591 581 return np; 592 582 } 593 583 EXPORT_SYMBOL(of_find_node_with_property); ··· 628 618 const struct device_node *node) 629 619 { 630 620 const struct of_device_id *match; 621 + unsigned long flags; 631 622 632 - read_lock(&devtree_lock); 623 + raw_spin_lock_irqsave(&devtree_lock, flags); 633 624 match = __of_match_node(matches, node); 634 - read_unlock(&devtree_lock); 625 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 635 626 return match; 636 627 } 637 628 EXPORT_SYMBOL(of_match_node); ··· 656 645 { 657 646 struct device_node *np; 658 647 const struct of_device_id *m; 648 + unsigned long flags; 659 649 660 650 if (match) 661 651 *match = NULL; 662 652 663 - read_lock(&devtree_lock); 653 + raw_spin_lock_irqsave(&devtree_lock, flags); 664 654 np = from ? from->allnext : of_allnodes; 665 655 for (; np; np = np->allnext) { 666 656 m = __of_match_node(matches, np); ··· 672 660 } 673 661 } 674 662 of_node_put(from); 675 - read_unlock(&devtree_lock); 663 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 676 664 return np; 677 665 } 678 666 EXPORT_SYMBOL(of_find_matching_node_and_match); ··· 715 703 { 716 704 struct device_node *np; 717 705 718 - read_lock(&devtree_lock); 706 + raw_spin_lock(&devtree_lock); 719 707 for (np = of_allnodes; np; np = np->allnext) 720 708 if (np->phandle == handle) 721 709 break; 722 710 of_node_get(np); 723 - read_unlock(&devtree_lock); 711 + raw_spin_unlock(&devtree_lock); 724 712 return np; 725 713 } 726 714 EXPORT_SYMBOL(of_find_node_by_phandle); ··· 1192 1180 return rc; 1193 1181 1194 1182 prop->next = NULL; 1195 - write_lock_irqsave(&devtree_lock, flags); 1183 + raw_spin_lock_irqsave(&devtree_lock, flags); 1196 1184 next = &np->properties; 1197 1185 while (*next) { 1198 1186 if (strcmp(prop->name, (*next)->name) == 0) { 1199 1187 /* duplicate ! don't insert it */ 1200 - write_unlock_irqrestore(&devtree_lock, flags); 1188 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 1201 1189 return -1; 1202 1190 } 1203 1191 next = &(*next)->next; 1204 1192 } 1205 1193 *next = prop; 1206 - write_unlock_irqrestore(&devtree_lock, flags); 1194 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 1207 1195 1208 1196 #ifdef CONFIG_PROC_DEVICETREE 1209 1197 /* try to add to proc as well if it was initialized */ ··· 1233 1221 if (rc) 1234 1222 return rc; 1235 1223 1236 - write_lock_irqsave(&devtree_lock, flags); 1224 + raw_spin_lock_irqsave(&devtree_lock, flags); 1237 1225 next = &np->properties; 1238 1226 while (*next) { 1239 1227 if (*next == prop) { ··· 1246 1234 } 1247 1235 next = &(*next)->next; 1248 1236 } 1249 - write_unlock_irqrestore(&devtree_lock, flags); 1237 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 1250 1238 1251 1239 if (!found) 1252 1240 return -ENODEV; ··· 1286 1274 if (!oldprop) 1287 1275 return of_add_property(np, newprop); 1288 1276 1289 - write_lock_irqsave(&devtree_lock, flags); 1277 + raw_spin_lock_irqsave(&devtree_lock, flags); 1290 1278 next = &np->properties; 1291 1279 while (*next) { 1292 1280 if (*next == oldprop) { ··· 1300 1288 } 1301 1289 next = &(*next)->next; 1302 1290 } 1303 - write_unlock_irqrestore(&devtree_lock, flags); 1291 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 1304 1292 1305 1293 if (!found) 1306 1294 return -ENODEV; ··· 1373 1361 if (rc) 1374 1362 return rc; 1375 1363 1376 - write_lock_irqsave(&devtree_lock, flags); 1364 + raw_spin_lock_irqsave(&devtree_lock, flags); 1377 1365 np->sibling = np->parent->child; 1378 1366 np->allnext = of_allnodes; 1379 1367 np->parent->child = np; 1380 1368 of_allnodes = np; 1381 - write_unlock_irqrestore(&devtree_lock, flags); 1369 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 1382 1370 1383 1371 of_add_proc_dt_entry(np); 1384 1372 return 0; ··· 1421 1409 if (rc) 1422 1410 return rc; 1423 1411 1424 - write_lock_irqsave(&devtree_lock, flags); 1412 + raw_spin_lock_irqsave(&devtree_lock, flags); 1425 1413 1426 1414 if (of_node_check_flag(np, OF_DETACHED)) { 1427 1415 /* someone already detached it */ 1428 - write_unlock_irqrestore(&devtree_lock, flags); 1416 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 1429 1417 return rc; 1430 1418 } 1431 1419 1432 1420 parent = np->parent; 1433 1421 if (!parent) { 1434 - write_unlock_irqrestore(&devtree_lock, flags); 1422 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 1435 1423 return rc; 1436 1424 } 1437 1425 ··· 1458 1446 } 1459 1447 1460 1448 of_node_set_flag(np, OF_DETACHED); 1461 - write_unlock_irqrestore(&devtree_lock, flags); 1449 + raw_spin_unlock_irqrestore(&devtree_lock, flags); 1462 1450 1463 1451 of_remove_proc_dt_entry(np); 1464 1452 return rc;
+1 -1
include/linux/of.h
··· 92 92 extern struct device_node *of_allnodes; 93 93 extern struct device_node *of_chosen; 94 94 extern struct device_node *of_aliases; 95 - extern rwlock_t devtree_lock; 95 + extern raw_spinlock_t devtree_lock; 96 96 97 97 static inline bool of_have_populated_dt(void) 98 98 {