View | Details | Raw Unified | Return to bug 259992
Collapse All | Expand All

(-)a/drivers/acpi/dispatcher/dsopcode.c (-1 / +2 lines)
Lines 359-365 acpi_status acpi_ds_get_region_arguments(union acpi_operand_object *obj_desc) Link Here
359
359
360
	status = acpi_os_validate_address(obj_desc->region.space_id,
360
	status = acpi_os_validate_address(obj_desc->region.space_id,
361
					  obj_desc->region.address,
361
					  obj_desc->region.address,
362
					  (acpi_size) obj_desc->region.length);
362
					  (acpi_size) obj_desc->region.length,
363
					 acpi_ut_get_node_name(node));
363
	if (ACPI_FAILURE(status)) {
364
	if (ACPI_FAILURE(status)) {
364
		/*
365
		/*
365
		 * Invalid address/length. We will emit an error message and mark
366
		 * Invalid address/length. We will emit an error message and mark
(-)a/drivers/acpi/osl.c (-1 / +19 lines)
Lines 1220-1228 acpi_status Link Here
1220
acpi_os_validate_address (
1220
acpi_os_validate_address (
1221
    u8                   space_id,
1221
    u8                   space_id,
1222
    acpi_physical_address   address,
1222
    acpi_physical_address   address,
1223
    acpi_size               length)
1223
    acpi_size               length,
1224
    char *name)
1224
{
1225
{
1225
1226
1227
    switch (space_id){
1228
	    case ACPI_ADR_SPACE_SYSTEM_IO:
1229
		request_region_soft(address, length, name);
1230
		break;
1231
1232
	    case ACPI_ADR_SPACE_SYSTEM_MEMORY:
1233
	    case ACPI_ADR_SPACE_PCI_CONFIG:
1234
	    case ACPI_ADR_SPACE_EC:
1235
	    case ACPI_ADR_SPACE_SMBUS:
1236
	    case ACPI_ADR_SPACE_CMOS:
1237
	    case ACPI_ADR_SPACE_PCI_BAR_TARGET:
1238
	    case ACPI_ADR_SPACE_DATA_TABLE:
1239
	    case ACPI_ADR_SPACE_FIXED_HARDWARE:
1240
	    default:
1241
		break;
1242
    }
1243
1226
    return AE_OK;
1244
    return AE_OK;
1227
}
1245
}
1228
1246
(-)a/include/acpi/acpiosxf.h (-1 / +1 lines)
Lines 240-246 acpi_status acpi_osi_invalidate(char* interface); Link Here
240
240
241
acpi_status
241
acpi_status
242
acpi_os_validate_address(u8 space_id,
242
acpi_os_validate_address(u8 space_id,
243
			 acpi_physical_address address, acpi_size length);
243
			 acpi_physical_address address, acpi_size length, char *name);
244
244
245
u64 acpi_os_get_timer(void);
245
u64 acpi_os_get_timer(void);
246
246
(-)a/include/linux/ioport.h (-3 / +5 lines)
Lines 45-50 struct resource_list { Link Here
45
#define IORESOURCE_SHADOWABLE	0x00010000
45
#define IORESOURCE_SHADOWABLE	0x00010000
46
#define IORESOURCE_BUS_HAS_VGA	0x00080000
46
#define IORESOURCE_BUS_HAS_VGA	0x00080000
47
47
48
#define IORESOURCE_BUSY_SOFT    0x01000000	/* This IO address appears in ACPI namespace */
48
#define IORESOURCE_DISABLED	0x10000000
49
#define IORESOURCE_DISABLED	0x10000000
49
#define IORESOURCE_UNSET	0x20000000
50
#define IORESOURCE_UNSET	0x20000000
50
#define IORESOURCE_AUTO		0x40000000
51
#define IORESOURCE_AUTO		0x40000000
Lines 114-126 int adjust_resource(struct resource *res, resource_size_t start, Link Here
114
extern int find_next_system_ram(struct resource *res);
115
extern int find_next_system_ram(struct resource *res);
115
116
116
/* Convenience shorthand with allocation */
117
/* Convenience shorthand with allocation */
117
#define request_region(start,n,name)	__request_region(&ioport_resource, (start), (n), (name))
118
#define request_region(start,n,name)	__request_region(&ioport_resource, (start), (n), (name), IORESOURCE_BUSY)
118
#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name))
119
#define request_region_soft(start,n,name)	__request_region(&ioport_resource, (start), (n), (name), IORESOURCE_BUSY_SOFT)
120
#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name), IORESOURCE_BUSY)
119
#define rename_region(region, newname) do { (region)->name = (newname); } while (0)
121
#define rename_region(region, newname) do { (region)->name = (newname); } while (0)
120
122
121
extern struct resource * __request_region(struct resource *,
123
extern struct resource * __request_region(struct resource *,
122
					resource_size_t start,
124
					resource_size_t start,
123
					resource_size_t n, const char *name);
125
					resource_size_t n, const char *name, u32 flags);
124
126
125
/* Compatibility cruft */
127
/* Compatibility cruft */
126
#define release_region(start,n)	__release_region(&ioport_resource, (start), (n))
128
#define release_region(start,n)	__release_region(&ioport_resource, (start), (n))
(-)a/kernel/resource.c (-6 / +14 lines)
Lines 80-90 static int r_show(struct seq_file *m, void *v) 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(struct resource *parent, 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(struct resource *parent, 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 *parent, resource_size_t start, 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(struct device *dev, 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

Return to bug 259992