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

PNPACPI: add window support

Add support for resource windows. This is for bridge resources, i.e.,
regions where a bridge forwards transactions from the primary to the
secondary side. This does not add support for *setting* windows via
the /proc interface.

Signed-off-by: Bjorn Helgaas <bjorn.helgaas@hp.com>
Signed-off-by: Len Brown <len.brown@intel.com>

authored by

Bjorn Helgaas and committed by
Len Brown
fa35b492 9d7cca04

+24 -17
+4 -2
drivers/pnp/interface.c
··· 278 278 switch (pnp_resource_type(res)) { 279 279 case IORESOURCE_IO: 280 280 case IORESOURCE_MEM: 281 - pnp_printf(buffer, " %#llx-%#llx\n", 281 + pnp_printf(buffer, " %#llx-%#llx%s\n", 282 282 (unsigned long long) res->start, 283 - (unsigned long long) res->end); 283 + (unsigned long long) res->end, 284 + res->flags & IORESOURCE_WINDOW ? 285 + " window" : ""); 284 286 break; 285 287 case IORESOURCE_IRQ: 286 288 case IORESOURCE_DMA:
+20 -15
drivers/pnp/pnpacpi/rsparser.c
··· 177 177 } 178 178 179 179 static void pnpacpi_parse_allocated_ioresource(struct pnp_dev *dev, u64 start, 180 - u64 len, int io_decode) 180 + u64 len, int io_decode, 181 + int window) 181 182 { 182 183 int flags = 0; 183 184 u64 end = start + len - 1; ··· 187 186 flags |= IORESOURCE_IO_16BIT_ADDR; 188 187 if (len == 0 || end >= 0x10003) 189 188 flags |= IORESOURCE_DISABLED; 189 + if (window) 190 + flags |= IORESOURCE_WINDOW; 190 191 191 192 pnp_add_io_resource(dev, start, end, flags); 192 193 } ··· 250 247 251 248 static void pnpacpi_parse_allocated_memresource(struct pnp_dev *dev, 252 249 u64 start, u64 len, 253 - int write_protect) 250 + int write_protect, int window) 254 251 { 255 252 int flags = 0; 256 253 u64 end = start + len - 1; ··· 259 256 flags |= IORESOURCE_DISABLED; 260 257 if (write_protect == ACPI_READ_WRITE_MEMORY) 261 258 flags |= IORESOURCE_MEM_WRITEABLE; 259 + if (window) 260 + flags |= IORESOURCE_WINDOW; 262 261 263 262 pnp_add_mem_resource(dev, start, end, flags); 264 263 } ··· 270 265 { 271 266 struct acpi_resource_address64 addr, *p = &addr; 272 267 acpi_status status; 268 + int window; 273 269 274 270 status = acpi_resource_to_address64(res, p); 275 271 if (!ACPI_SUCCESS(status)) { ··· 279 273 return; 280 274 } 281 275 282 - if (p->producer_consumer == ACPI_PRODUCER) 283 - return; 276 + window = (p->producer_consumer == ACPI_PRODUCER) ? 1 : 0; 284 277 285 278 if (p->resource_type == ACPI_MEMORY_RANGE) 286 279 pnpacpi_parse_allocated_memresource(dev, 287 280 p->minimum, p->address_length, 288 - p->info.mem.write_protect); 281 + p->info.mem.write_protect, window); 289 282 else if (p->resource_type == ACPI_IO_RANGE) 290 283 pnpacpi_parse_allocated_ioresource(dev, 291 284 p->minimum, p->address_length, 292 285 p->granularity == 0xfff ? ACPI_DECODE_10 : 293 - ACPI_DECODE_16); 286 + ACPI_DECODE_16, window); 294 287 } 295 288 296 289 static void pnpacpi_parse_allocated_ext_address_space(struct pnp_dev *dev, 297 290 struct acpi_resource *res) 298 291 { 299 292 struct acpi_resource_extended_address64 *p = &res->data.ext_address64; 293 + int window; 300 294 301 - if (p->producer_consumer == ACPI_PRODUCER) 302 - return; 295 + window = (p->producer_consumer == ACPI_PRODUCER) ? 1 : 0; 303 296 304 297 if (p->resource_type == ACPI_MEMORY_RANGE) 305 298 pnpacpi_parse_allocated_memresource(dev, 306 299 p->minimum, p->address_length, 307 - p->info.mem.write_protect); 300 + p->info.mem.write_protect, window); 308 301 else if (p->resource_type == ACPI_IO_RANGE) 309 302 pnpacpi_parse_allocated_ioresource(dev, 310 303 p->minimum, p->address_length, 311 304 p->granularity == 0xfff ? ACPI_DECODE_10 : 312 - ACPI_DECODE_16); 305 + ACPI_DECODE_16, window); 313 306 } 314 307 315 308 static acpi_status pnpacpi_allocated_resource(struct acpi_resource *res, ··· 373 368 pnpacpi_parse_allocated_ioresource(dev, 374 369 io->minimum, 375 370 io->address_length, 376 - io->io_decode); 371 + io->io_decode, 0); 377 372 break; 378 373 379 374 case ACPI_RESOURCE_TYPE_START_DEPENDENT: ··· 385 380 pnpacpi_parse_allocated_ioresource(dev, 386 381 fixed_io->address, 387 382 fixed_io->address_length, 388 - ACPI_DECODE_10); 383 + ACPI_DECODE_10, 0); 389 384 break; 390 385 391 386 case ACPI_RESOURCE_TYPE_VENDOR: ··· 401 396 pnpacpi_parse_allocated_memresource(dev, 402 397 memory24->minimum, 403 398 memory24->address_length, 404 - memory24->write_protect); 399 + memory24->write_protect, 0); 405 400 break; 406 401 case ACPI_RESOURCE_TYPE_MEMORY32: 407 402 memory32 = &res->data.memory32; 408 403 pnpacpi_parse_allocated_memresource(dev, 409 404 memory32->minimum, 410 405 memory32->address_length, 411 - memory32->write_protect); 406 + memory32->write_protect, 0); 412 407 break; 413 408 case ACPI_RESOURCE_TYPE_FIXED_MEMORY32: 414 409 fixed_memory32 = &res->data.fixed_memory32; 415 410 pnpacpi_parse_allocated_memresource(dev, 416 411 fixed_memory32->address, 417 412 fixed_memory32->address_length, 418 - fixed_memory32->write_protect); 413 + fixed_memory32->write_protect, 0); 419 414 break; 420 415 case ACPI_RESOURCE_TYPE_ADDRESS16: 421 416 case ACPI_RESOURCE_TYPE_ADDRESS32: