|
@@ -76,6 +76,8 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
|
|
if (!access_ok(VERIFY_WRITE, buf, cnt))
|
|
if (!access_ok(VERIFY_WRITE, buf, cnt))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ pci_config_pm_runtime_get(dev);
|
|
|
|
+
|
|
if ((pos & 1) && cnt) {
|
|
if ((pos & 1) && cnt) {
|
|
unsigned char val;
|
|
unsigned char val;
|
|
pci_user_read_config_byte(dev, pos, &val);
|
|
pci_user_read_config_byte(dev, pos, &val);
|
|
@@ -121,6 +123,8 @@ proc_bus_pci_read(struct file *file, char __user *buf, size_t nbytes, loff_t *pp
|
|
cnt--;
|
|
cnt--;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ pci_config_pm_runtime_put(dev);
|
|
|
|
+
|
|
*ppos = pos;
|
|
*ppos = pos;
|
|
return nbytes;
|
|
return nbytes;
|
|
}
|
|
}
|
|
@@ -146,6 +150,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
|
|
if (!access_ok(VERIFY_READ, buf, cnt))
|
|
if (!access_ok(VERIFY_READ, buf, cnt))
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
|
|
|
|
|
|
+ pci_config_pm_runtime_get(dev);
|
|
|
|
+
|
|
if ((pos & 1) && cnt) {
|
|
if ((pos & 1) && cnt) {
|
|
unsigned char val;
|
|
unsigned char val;
|
|
__get_user(val, buf);
|
|
__get_user(val, buf);
|
|
@@ -191,6 +197,8 @@ proc_bus_pci_write(struct file *file, const char __user *buf, size_t nbytes, lof
|
|
cnt--;
|
|
cnt--;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ pci_config_pm_runtime_put(dev);
|
|
|
|
+
|
|
*ppos = pos;
|
|
*ppos = pos;
|
|
i_size_write(ino, dp->size);
|
|
i_size_write(ino, dp->size);
|
|
return nbytes;
|
|
return nbytes;
|