On Sat, Aug 06, 2011 at 10:27:02AM +0200, martin.peres@xxxxxxxxxxxxxxx wrote: > + i = 0; > + do { > + pci_write_byte(d->dev, where + PCI_PWR_DSR, i); > + > + w = pci_read_word(d->dev, where + PCI_PWR_DATA); The problem with this is that it's racy. If a device driver is accessing the power budget capability at the same time lspci accesses it, the driver could get the wrong numbers. (lspci could too, but that's way less important). Now, we don't have any device drivers accessing this capability yet. If we can persuade the first one who tries it to use some centralised API to access it, we can throw in the necessary calls to pci_block_user_cfg_access(). It'd be great if we can get started on that ... does anyone have a device driver in mind that could benefit from reading the power budgeting capability? -- Matthew Wilcox Intel Open Source Technology Centre "Bill, look, we understand that you're interested in selling us this operating system, but compare it to ours. We can't possibly take such a retrograde step." -- To unsubscribe from this list: send the line "unsubscribe linux-pci" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html