|
Lines 80-90
static int r_show(struct seq_file *m, vo
Link Here
|
| 80 |
for (depth = 0, p = r; depth < MAX_IORES_LEVEL; depth++, p = p->parent) |
80 |
for (depth = 0, p = r; depth < MAX_IORES_LEVEL; depth++, p = p->parent) |
| 81 |
if (p->parent == root) |
81 |
if (p->parent == root) |
| 82 |
break; |
82 |
break; |
| 83 |
seq_printf(m, "%*s%0*llx-%0*llx : %s\n", |
83 |
seq_printf(m, "%*s%0*llx-%0*llx : %s%c\n", |
| 84 |
depth * 2, "", |
84 |
depth * 2, "", |
| 85 |
width, (unsigned long long) r->start, |
85 |
width, (unsigned long long) r->start, |
| 86 |
width, (unsigned long long) r->end, |
86 |
width, (unsigned long long) r->end, |
| 87 |
r->name ? r->name : "<BAD>"); |
87 |
r->name ? r->name : "<BAD>", r->flags & |
|
|
88 |
IORESOURCE_BUSY_SOFT ? '*' : ' '); |
| 88 |
return 0; |
89 |
return 0; |
| 89 |
} |
90 |
} |
| 90 |
|
91 |
|
|
Lines 484-490
EXPORT_SYMBOL(adjust_resource);
Link Here
|
| 484 |
*/ |
485 |
*/ |
| 485 |
struct resource * __request_region(struct resource *parent, |
486 |
struct resource * __request_region(struct resource *parent, |
| 486 |
resource_size_t start, resource_size_t n, |
487 |
resource_size_t start, resource_size_t n, |
| 487 |
const char *name) |
488 |
const char *name, u32 flag) |
| 488 |
{ |
489 |
{ |
| 489 |
struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); |
490 |
struct resource *res = kzalloc(sizeof(*res), GFP_KERNEL); |
| 490 |
|
491 |
|
|
Lines 492-498
struct resource * __request_region(struc
Link Here
|
| 492 |
res->name = name; |
493 |
res->name = name; |
| 493 |
res->start = start; |
494 |
res->start = start; |
| 494 |
res->end = start + n - 1; |
495 |
res->end = start + n - 1; |
| 495 |
res->flags = IORESOURCE_BUSY; |
496 |
res->flags = flag; |
| 496 |
|
497 |
|
| 497 |
write_lock(&resource_lock); |
498 |
write_lock(&resource_lock); |
| 498 |
|
499 |
|
|
Lines 504-509
struct resource * __request_region(struc
Link Here
|
| 504 |
break; |
505 |
break; |
| 505 |
if (conflict != parent) { |
506 |
if (conflict != parent) { |
| 506 |
parent = conflict; |
507 |
parent = conflict; |
|
|
508 |
if ((conflict->flags & IORESOURCE_BUSY_SOFT)){ |
| 509 |
printk(KERN_ERR "IO resource region" |
| 510 |
" conflicts with IO %s regions," |
| 511 |
" conflict is ignored, system" |
| 512 |
" might run unstable.\n", |
| 513 |
res->name); |
| 514 |
} |
| 507 |
if (!(conflict->flags & IORESOURCE_BUSY)) |
515 |
if (!(conflict->flags & IORESOURCE_BUSY)) |
| 508 |
continue; |
516 |
continue; |
| 509 |
} |
517 |
} |
|
Lines 539-545
int __check_region(struct resource *pare
Link Here
|
| 539 |
{ |
547 |
{ |
| 540 |
struct resource * res; |
548 |
struct resource * res; |
| 541 |
|
549 |
|
| 542 |
res = __request_region(parent, start, n, "check-region"); |
550 |
res = __request_region(parent, start, n, "check-region", IORESOURCE_BUSY); |
| 543 |
if (!res) |
551 |
if (!res) |
| 544 |
return -EBUSY; |
552 |
return -EBUSY; |
| 545 |
|
553 |
|
|
Lines 636-642
struct resource * __devm_request_region(
Link Here
|
| 636 |
dr->start = start; |
644 |
dr->start = start; |
| 637 |
dr->n = n; |
645 |
dr->n = n; |
| 638 |
|
646 |
|
| 639 |
res = __request_region(parent, start, n, name); |
647 |
res = __request_region(parent, start, n, name, IORESOURCE_BUSY); |
| 640 |
if (res) |
648 |
if (res) |
| 641 |
devres_add(dev, dr); |
649 |
devres_add(dev, dr); |
| 642 |
else |
650 |
else |