diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-01-15 15:40:53 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-01-15 15:40:53 -0500 |
commit | c92816275674c1491ce228ee49aa030a5fa1be04 (patch) | |
tree | 97deb97f282c6b9f4f58e45a60ea78d1fe31df4e | |
parent | 2d5a7101a140adcf7a5d8677649847fbb2dd5a2f (diff) | |
parent | c8a6a09c1c617402cc9254b2bc8da359a0347d75 (diff) |
Merge tag 'char-misc-4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH:
"Here are some small char/misc driver fixes for 4.10-rc4 that resolve
some reported issues.
The MEI driver issue resolves a lot of problems that people have been
having, as does the mem driver fix. The other minor fixes resolve
other reported issues.
All of these have been in linux-next for a while"
* tag 'char-misc-4.10-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
vme: Fix wrong pointer utilization in ca91cx42_slave_get
auxdisplay: fix new ht16k33 build errors
ppdev: don't print a free'd string
extcon: return error code on failure
drivers: char: mem: Fix thinkos in kmem address checks
mei: bus: enable OS version only for SPT and newer
-rw-r--r-- | drivers/auxdisplay/Kconfig | 6 | ||||
-rw-r--r-- | drivers/char/mem.c | 10 | ||||
-rw-r--r-- | drivers/char/ppdev.c | 13 | ||||
-rw-r--r-- | drivers/extcon/extcon.c | 2 | ||||
-rw-r--r-- | drivers/misc/mei/bus-fixup.c | 3 | ||||
-rw-r--r-- | drivers/misc/mei/debugfs.c | 2 | ||||
-rw-r--r-- | drivers/misc/mei/hbm.c | 4 | ||||
-rw-r--r-- | drivers/misc/mei/hw.h | 6 | ||||
-rw-r--r-- | drivers/misc/mei/mei_dev.h | 2 | ||||
-rw-r--r-- | drivers/vme/bridges/vme_ca91cx42.c | 2 |
10 files changed, 34 insertions, 16 deletions
diff --git a/drivers/auxdisplay/Kconfig b/drivers/auxdisplay/Kconfig index 4ef4c5caed4f..8a8e403644d6 100644 --- a/drivers/auxdisplay/Kconfig +++ b/drivers/auxdisplay/Kconfig | |||
@@ -132,9 +132,9 @@ config HT16K33 | |||
132 | tristate "Holtek Ht16K33 LED controller with keyscan" | 132 | tristate "Holtek Ht16K33 LED controller with keyscan" |
133 | depends on FB && OF && I2C && INPUT | 133 | depends on FB && OF && I2C && INPUT |
134 | select FB_SYS_FOPS | 134 | select FB_SYS_FOPS |
135 | select FB_CFB_FILLRECT | 135 | select FB_SYS_FILLRECT |
136 | select FB_CFB_COPYAREA | 136 | select FB_SYS_COPYAREA |
137 | select FB_CFB_IMAGEBLIT | 137 | select FB_SYS_IMAGEBLIT |
138 | select INPUT_MATRIXKMAP | 138 | select INPUT_MATRIXKMAP |
139 | select FB_BACKLIGHT | 139 | select FB_BACKLIGHT |
140 | help | 140 | help |
diff --git a/drivers/char/mem.c b/drivers/char/mem.c index 5bb1985ec484..6d9cc2d39d22 100644 --- a/drivers/char/mem.c +++ b/drivers/char/mem.c | |||
@@ -381,9 +381,6 @@ static ssize_t read_kmem(struct file *file, char __user *buf, | |||
381 | char *kbuf; /* k-addr because vread() takes vmlist_lock rwlock */ | 381 | char *kbuf; /* k-addr because vread() takes vmlist_lock rwlock */ |
382 | int err = 0; | 382 | int err = 0; |
383 | 383 | ||
384 | if (!pfn_valid(PFN_DOWN(p))) | ||
385 | return -EIO; | ||
386 | |||
387 | read = 0; | 384 | read = 0; |
388 | if (p < (unsigned long) high_memory) { | 385 | if (p < (unsigned long) high_memory) { |
389 | low_count = count; | 386 | low_count = count; |
@@ -412,6 +409,8 @@ static ssize_t read_kmem(struct file *file, char __user *buf, | |||
412 | * by the kernel or data corruption may occur | 409 | * by the kernel or data corruption may occur |
413 | */ | 410 | */ |
414 | kbuf = xlate_dev_kmem_ptr((void *)p); | 411 | kbuf = xlate_dev_kmem_ptr((void *)p); |
412 | if (!virt_addr_valid(kbuf)) | ||
413 | return -ENXIO; | ||
415 | 414 | ||
416 | if (copy_to_user(buf, kbuf, sz)) | 415 | if (copy_to_user(buf, kbuf, sz)) |
417 | return -EFAULT; | 416 | return -EFAULT; |
@@ -482,6 +481,8 @@ static ssize_t do_write_kmem(unsigned long p, const char __user *buf, | |||
482 | * corruption may occur. | 481 | * corruption may occur. |
483 | */ | 482 | */ |
484 | ptr = xlate_dev_kmem_ptr((void *)p); | 483 | ptr = xlate_dev_kmem_ptr((void *)p); |
484 | if (!virt_addr_valid(ptr)) | ||
485 | return -ENXIO; | ||
485 | 486 | ||
486 | copied = copy_from_user(ptr, buf, sz); | 487 | copied = copy_from_user(ptr, buf, sz); |
487 | if (copied) { | 488 | if (copied) { |
@@ -512,9 +513,6 @@ static ssize_t write_kmem(struct file *file, const char __user *buf, | |||
512 | char *kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */ | 513 | char *kbuf; /* k-addr because vwrite() takes vmlist_lock rwlock */ |
513 | int err = 0; | 514 | int err = 0; |
514 | 515 | ||
515 | if (!pfn_valid(PFN_DOWN(p))) | ||
516 | return -EIO; | ||
517 | |||
518 | if (p < (unsigned long) high_memory) { | 516 | if (p < (unsigned long) high_memory) { |
519 | unsigned long to_write = min_t(unsigned long, count, | 517 | unsigned long to_write = min_t(unsigned long, count, |
520 | (unsigned long)high_memory - p); | 518 | (unsigned long)high_memory - p); |
diff --git a/drivers/char/ppdev.c b/drivers/char/ppdev.c index 02819e0703c8..87885d146dbb 100644 --- a/drivers/char/ppdev.c +++ b/drivers/char/ppdev.c | |||
@@ -290,6 +290,7 @@ static int register_device(int minor, struct pp_struct *pp) | |||
290 | struct pardevice *pdev = NULL; | 290 | struct pardevice *pdev = NULL; |
291 | char *name; | 291 | char *name; |
292 | struct pardev_cb ppdev_cb; | 292 | struct pardev_cb ppdev_cb; |
293 | int rc = 0; | ||
293 | 294 | ||
294 | name = kasprintf(GFP_KERNEL, CHRDEV "%x", minor); | 295 | name = kasprintf(GFP_KERNEL, CHRDEV "%x", minor); |
295 | if (name == NULL) | 296 | if (name == NULL) |
@@ -298,8 +299,8 @@ static int register_device(int minor, struct pp_struct *pp) | |||
298 | port = parport_find_number(minor); | 299 | port = parport_find_number(minor); |
299 | if (!port) { | 300 | if (!port) { |
300 | pr_warn("%s: no associated port!\n", name); | 301 | pr_warn("%s: no associated port!\n", name); |
301 | kfree(name); | 302 | rc = -ENXIO; |
302 | return -ENXIO; | 303 | goto err; |
303 | } | 304 | } |
304 | 305 | ||
305 | memset(&ppdev_cb, 0, sizeof(ppdev_cb)); | 306 | memset(&ppdev_cb, 0, sizeof(ppdev_cb)); |
@@ -308,16 +309,18 @@ static int register_device(int minor, struct pp_struct *pp) | |||
308 | ppdev_cb.private = pp; | 309 | ppdev_cb.private = pp; |
309 | pdev = parport_register_dev_model(port, name, &ppdev_cb, minor); | 310 | pdev = parport_register_dev_model(port, name, &ppdev_cb, minor); |
310 | parport_put_port(port); | 311 | parport_put_port(port); |
311 | kfree(name); | ||
312 | 312 | ||
313 | if (!pdev) { | 313 | if (!pdev) { |
314 | pr_warn("%s: failed to register device!\n", name); | 314 | pr_warn("%s: failed to register device!\n", name); |
315 | return -ENXIO; | 315 | rc = -ENXIO; |
316 | goto err; | ||
316 | } | 317 | } |
317 | 318 | ||
318 | pp->pdev = pdev; | 319 | pp->pdev = pdev; |
319 | dev_dbg(&pdev->dev, "registered pardevice\n"); | 320 | dev_dbg(&pdev->dev, "registered pardevice\n"); |
320 | return 0; | 321 | err: |
322 | kfree(name); | ||
323 | return rc; | ||
321 | } | 324 | } |
322 | 325 | ||
323 | static enum ieee1284_phase init_phase(int mode) | 326 | static enum ieee1284_phase init_phase(int mode) |
diff --git a/drivers/extcon/extcon.c b/drivers/extcon/extcon.c index 78298460d168..7c1e3a7b14e0 100644 --- a/drivers/extcon/extcon.c +++ b/drivers/extcon/extcon.c | |||
@@ -453,7 +453,7 @@ int extcon_sync(struct extcon_dev *edev, unsigned int id) | |||
453 | dev_err(&edev->dev, "out of memory in extcon_set_state\n"); | 453 | dev_err(&edev->dev, "out of memory in extcon_set_state\n"); |
454 | kobject_uevent(&edev->dev.kobj, KOBJ_CHANGE); | 454 | kobject_uevent(&edev->dev.kobj, KOBJ_CHANGE); |
455 | 455 | ||
456 | return 0; | 456 | return -ENOMEM; |
457 | } | 457 | } |
458 | 458 | ||
459 | length = name_show(&edev->dev, NULL, prop_buf); | 459 | length = name_show(&edev->dev, NULL, prop_buf); |
diff --git a/drivers/misc/mei/bus-fixup.c b/drivers/misc/mei/bus-fixup.c index 18e05ca7584f..3600c9993a98 100644 --- a/drivers/misc/mei/bus-fixup.c +++ b/drivers/misc/mei/bus-fixup.c | |||
@@ -152,6 +152,9 @@ static void mei_mkhi_fix(struct mei_cl_device *cldev) | |||
152 | { | 152 | { |
153 | int ret; | 153 | int ret; |
154 | 154 | ||
155 | if (!cldev->bus->hbm_f_os_supported) | ||
156 | return; | ||
157 | |||
155 | ret = mei_cldev_enable(cldev); | 158 | ret = mei_cldev_enable(cldev); |
156 | if (ret) | 159 | if (ret) |
157 | return; | 160 | return; |
diff --git a/drivers/misc/mei/debugfs.c b/drivers/misc/mei/debugfs.c index c6c051b52f55..c6217a4993ad 100644 --- a/drivers/misc/mei/debugfs.c +++ b/drivers/misc/mei/debugfs.c | |||
@@ -180,6 +180,8 @@ static ssize_t mei_dbgfs_read_devstate(struct file *fp, char __user *ubuf, | |||
180 | dev->hbm_f_ev_supported); | 180 | dev->hbm_f_ev_supported); |
181 | pos += scnprintf(buf + pos, bufsz - pos, "\tFA: %01d\n", | 181 | pos += scnprintf(buf + pos, bufsz - pos, "\tFA: %01d\n", |
182 | dev->hbm_f_fa_supported); | 182 | dev->hbm_f_fa_supported); |
183 | pos += scnprintf(buf + pos, bufsz - pos, "\tOS: %01d\n", | ||
184 | dev->hbm_f_os_supported); | ||
183 | } | 185 | } |
184 | 186 | ||
185 | pos += scnprintf(buf + pos, bufsz - pos, "pg: %s, %s\n", | 187 | pos += scnprintf(buf + pos, bufsz - pos, "pg: %s, %s\n", |
diff --git a/drivers/misc/mei/hbm.c b/drivers/misc/mei/hbm.c index dd7f15a65eed..25b4a1ba522d 100644 --- a/drivers/misc/mei/hbm.c +++ b/drivers/misc/mei/hbm.c | |||
@@ -989,6 +989,10 @@ static void mei_hbm_config_features(struct mei_device *dev) | |||
989 | /* Fixed Address Client Support */ | 989 | /* Fixed Address Client Support */ |
990 | if (dev->version.major_version >= HBM_MAJOR_VERSION_FA) | 990 | if (dev->version.major_version >= HBM_MAJOR_VERSION_FA) |
991 | dev->hbm_f_fa_supported = 1; | 991 | dev->hbm_f_fa_supported = 1; |
992 | |||
993 | /* OS ver message Support */ | ||
994 | if (dev->version.major_version >= HBM_MAJOR_VERSION_OS) | ||
995 | dev->hbm_f_os_supported = 1; | ||
992 | } | 996 | } |
993 | 997 | ||
994 | /** | 998 | /** |
diff --git a/drivers/misc/mei/hw.h b/drivers/misc/mei/hw.h index 9daf3f9aed25..e1e4d47d4d7d 100644 --- a/drivers/misc/mei/hw.h +++ b/drivers/misc/mei/hw.h | |||
@@ -76,6 +76,12 @@ | |||
76 | #define HBM_MINOR_VERSION_FA 0 | 76 | #define HBM_MINOR_VERSION_FA 0 |
77 | #define HBM_MAJOR_VERSION_FA 2 | 77 | #define HBM_MAJOR_VERSION_FA 2 |
78 | 78 | ||
79 | /* | ||
80 | * MEI version with OS ver message support | ||
81 | */ | ||
82 | #define HBM_MINOR_VERSION_OS 0 | ||
83 | #define HBM_MAJOR_VERSION_OS 2 | ||
84 | |||
79 | /* Host bus message command opcode */ | 85 | /* Host bus message command opcode */ |
80 | #define MEI_HBM_CMD_OP_MSK 0x7f | 86 | #define MEI_HBM_CMD_OP_MSK 0x7f |
81 | /* Host bus message command RESPONSE */ | 87 | /* Host bus message command RESPONSE */ |
diff --git a/drivers/misc/mei/mei_dev.h b/drivers/misc/mei/mei_dev.h index 699693cd8c59..8dadb98662a9 100644 --- a/drivers/misc/mei/mei_dev.h +++ b/drivers/misc/mei/mei_dev.h | |||
@@ -406,6 +406,7 @@ const char *mei_pg_state_str(enum mei_pg_state state); | |||
406 | * @hbm_f_ev_supported : hbm feature event notification | 406 | * @hbm_f_ev_supported : hbm feature event notification |
407 | * @hbm_f_fa_supported : hbm feature fixed address client | 407 | * @hbm_f_fa_supported : hbm feature fixed address client |
408 | * @hbm_f_ie_supported : hbm feature immediate reply to enum request | 408 | * @hbm_f_ie_supported : hbm feature immediate reply to enum request |
409 | * @hbm_f_os_supported : hbm feature support OS ver message | ||
409 | * | 410 | * |
410 | * @me_clients_rwsem: rw lock over me_clients list | 411 | * @me_clients_rwsem: rw lock over me_clients list |
411 | * @me_clients : list of FW clients | 412 | * @me_clients : list of FW clients |
@@ -487,6 +488,7 @@ struct mei_device { | |||
487 | unsigned int hbm_f_ev_supported:1; | 488 | unsigned int hbm_f_ev_supported:1; |
488 | unsigned int hbm_f_fa_supported:1; | 489 | unsigned int hbm_f_fa_supported:1; |
489 | unsigned int hbm_f_ie_supported:1; | 490 | unsigned int hbm_f_ie_supported:1; |
491 | unsigned int hbm_f_os_supported:1; | ||
490 | 492 | ||
491 | struct rw_semaphore me_clients_rwsem; | 493 | struct rw_semaphore me_clients_rwsem; |
492 | struct list_head me_clients; | 494 | struct list_head me_clients; |
diff --git a/drivers/vme/bridges/vme_ca91cx42.c b/drivers/vme/bridges/vme_ca91cx42.c index 6b5ee896af63..7cc51223db1c 100644 --- a/drivers/vme/bridges/vme_ca91cx42.c +++ b/drivers/vme/bridges/vme_ca91cx42.c | |||
@@ -464,7 +464,7 @@ static int ca91cx42_slave_get(struct vme_slave_resource *image, int *enabled, | |||
464 | vme_bound = ioread32(bridge->base + CA91CX42_VSI_BD[i]); | 464 | vme_bound = ioread32(bridge->base + CA91CX42_VSI_BD[i]); |
465 | pci_offset = ioread32(bridge->base + CA91CX42_VSI_TO[i]); | 465 | pci_offset = ioread32(bridge->base + CA91CX42_VSI_TO[i]); |
466 | 466 | ||
467 | *pci_base = (dma_addr_t)vme_base + pci_offset; | 467 | *pci_base = (dma_addr_t)*vme_base + pci_offset; |
468 | *size = (unsigned long long)((vme_bound - *vme_base) + granularity); | 468 | *size = (unsigned long long)((vme_bound - *vme_base) + granularity); |
469 | 469 | ||
470 | *enabled = 0; | 470 | *enabled = 0; |