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

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'char-misc-6.7-rc5' 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 fixes for 6.7-rc5 for a variety of small driver
subsystems. Included in here are:

- debugfs revert for reported issue

- greybus revert for reported issue

- greybus fixup for endian build warning

- coresight driver fixes

- nvmem driver fixes

- devcoredump fix

- parport new device id

- ndtest build fix

All of these have ben in linux-next with no reported issues"

* tag 'char-misc-6.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
nvmem: Do not expect fixed layouts to grab a layout driver
parport: Add support for Brainboxes IX/UC/PX parallel cards
Revert "greybus: gb-beagleplay: Ensure le for values in transport"
greybus: gb-beagleplay: Ensure le for values in transport
greybus: BeaglePlay driver needs CRC_CCITT
Revert "debugfs: annotate debugfs handlers vs. removal with lockdep"
devcoredump: Send uevent once devcd is ready
ndtest: fix typo class_regster -> class_register
misc: mei: client.c: fix problem of return '-EOVERFLOW' in mei_cl_write
misc: mei: client.c: return negative error code in mei_cl_write
mei: pxp: fix mei_pxp_send_message return value
coresight: ultrasoc-smb: Fix uninitialized before use buf_hw_base
coresight: ultrasoc-smb: Config SMB buffer before register sink
coresight: ultrasoc-smb: Fix sleep while close preempt in enable_smb
Documentation: coresight: fix `make refcheckdocs` warning
hwtracing: hisi_ptt: Don't try to attach a task
hwtracing: hisi_ptt: Handle the interrupt in hardirq context
hwtracing: hisi_ptt: Add dummy callback pmu::read()
coresight: Fix crash when Perf and sysfs modes are used concurrently
coresight: etm4x: Remove bogous __exit annotation for some functions

+79 -74
+1 -1
Documentation/trace/coresight/coresight.rst
··· 130 130 Device Tree Bindings 131 131 -------------------- 132 132 133 - See Documentation/devicetree/bindings/arm/arm,coresight-\*.yaml for details. 133 + See ``Documentation/devicetree/bindings/arm/arm,coresight-*.yaml`` for details. 134 134 135 135 As of this writing drivers for ITM, STMs and CTIs are not provided but are 136 136 expected to be added as the solution matures.
+3
drivers/base/devcoredump.c
··· 362 362 devcd->devcd_dev.class = &devcd_class; 363 363 364 364 mutex_lock(&devcd->mutex); 365 + dev_set_uevent_suppress(&devcd->devcd_dev, true); 365 366 if (device_add(&devcd->devcd_dev)) 366 367 goto put_device; 367 368 ··· 377 376 "devcoredump")) 378 377 dev_warn(dev, "devcoredump create_link failed\n"); 379 378 379 + dev_set_uevent_suppress(&devcd->devcd_dev, false); 380 + kobject_uevent(&devcd->devcd_dev.kobj, KOBJ_ADD); 380 381 INIT_DELAYED_WORK(&devcd->del_wk, devcd_del); 381 382 schedule_delayed_work(&devcd->del_wk, DEVCD_TIMEOUT); 382 383 mutex_unlock(&devcd->mutex);
+1
drivers/greybus/Kconfig
··· 20 20 config GREYBUS_BEAGLEPLAY 21 21 tristate "Greybus BeaglePlay driver" 22 22 depends on SERIAL_DEV_BUS 23 + select CRC_CCITT 23 24 help 24 25 Select this option if you have a BeaglePlay where CC1352 25 26 co-processor acts as Greybus SVC.
+2 -2
drivers/hwtracing/coresight/coresight-etm-perf.c
··· 493 493 goto fail_end_stop; 494 494 495 495 /* Finally enable the tracer */ 496 - if (coresight_enable_source(csdev, CS_MODE_PERF, event)) 496 + if (source_ops(csdev)->enable(csdev, event, CS_MODE_PERF)) 497 497 goto fail_disable_path; 498 498 499 499 /* ··· 587 587 return; 588 588 589 589 /* stop tracer */ 590 - coresight_disable_source(csdev, event); 590 + source_ops(csdev)->disable(csdev, event); 591 591 592 592 /* tell the core */ 593 593 event->hw.state = PERF_HES_STOPPED;
+3 -3
drivers/hwtracing/coresight/coresight-etm4x-core.c
··· 2224 2224 per_cpu(delayed_probe, cpu) = NULL; 2225 2225 } 2226 2226 2227 - static void __exit etm4_remove_dev(struct etmv4_drvdata *drvdata) 2227 + static void etm4_remove_dev(struct etmv4_drvdata *drvdata) 2228 2228 { 2229 2229 bool had_delayed_probe; 2230 2230 /* ··· 2253 2253 } 2254 2254 } 2255 2255 2256 - static void __exit etm4_remove_amba(struct amba_device *adev) 2256 + static void etm4_remove_amba(struct amba_device *adev) 2257 2257 { 2258 2258 struct etmv4_drvdata *drvdata = dev_get_drvdata(&adev->dev); 2259 2259 ··· 2261 2261 etm4_remove_dev(drvdata); 2262 2262 } 2263 2263 2264 - static int __exit etm4_remove_platform_dev(struct platform_device *pdev) 2264 + static int etm4_remove_platform_dev(struct platform_device *pdev) 2265 2265 { 2266 2266 struct etmv4_drvdata *drvdata = dev_get_drvdata(&pdev->dev); 2267 2267
+23 -35
drivers/hwtracing/coresight/ultrasoc-smb.c
··· 99 99 struct smb_drv_data, miscdev); 100 100 int ret = 0; 101 101 102 - mutex_lock(&drvdata->mutex); 102 + spin_lock(&drvdata->spinlock); 103 103 104 104 if (drvdata->reading) { 105 105 ret = -EBUSY; ··· 115 115 116 116 drvdata->reading = true; 117 117 out: 118 - mutex_unlock(&drvdata->mutex); 118 + spin_unlock(&drvdata->spinlock); 119 119 120 120 return ret; 121 121 } ··· 132 132 if (!len) 133 133 return 0; 134 134 135 - mutex_lock(&drvdata->mutex); 136 - 137 135 if (!sdb->data_size) 138 - goto out; 136 + return 0; 139 137 140 138 to_copy = min(sdb->data_size, len); 141 139 ··· 143 145 144 146 if (copy_to_user(data, sdb->buf_base + sdb->buf_rdptr, to_copy)) { 145 147 dev_dbg(dev, "Failed to copy data to user\n"); 146 - to_copy = -EFAULT; 147 - goto out; 148 + return -EFAULT; 148 149 } 149 150 150 151 *ppos += to_copy; 151 - 152 152 smb_update_read_ptr(drvdata, to_copy); 153 - 154 - dev_dbg(dev, "%zu bytes copied\n", to_copy); 155 - out: 156 153 if (!sdb->data_size) 157 154 smb_reset_buffer(drvdata); 158 - mutex_unlock(&drvdata->mutex); 159 155 156 + dev_dbg(dev, "%zu bytes copied\n", to_copy); 160 157 return to_copy; 161 158 } 162 159 ··· 160 167 struct smb_drv_data *drvdata = container_of(file->private_data, 161 168 struct smb_drv_data, miscdev); 162 169 163 - mutex_lock(&drvdata->mutex); 170 + spin_lock(&drvdata->spinlock); 164 171 drvdata->reading = false; 165 - mutex_unlock(&drvdata->mutex); 172 + spin_unlock(&drvdata->spinlock); 166 173 167 174 return 0; 168 175 } ··· 255 262 struct smb_drv_data *drvdata = dev_get_drvdata(csdev->dev.parent); 256 263 int ret = 0; 257 264 258 - mutex_lock(&drvdata->mutex); 265 + spin_lock(&drvdata->spinlock); 259 266 260 267 /* Do nothing, the trace data is reading by other interface now */ 261 268 if (drvdata->reading) { ··· 287 294 288 295 dev_dbg(&csdev->dev, "Ultrasoc SMB enabled\n"); 289 296 out: 290 - mutex_unlock(&drvdata->mutex); 297 + spin_unlock(&drvdata->spinlock); 291 298 292 299 return ret; 293 300 } ··· 297 304 struct smb_drv_data *drvdata = dev_get_drvdata(csdev->dev.parent); 298 305 int ret = 0; 299 306 300 - mutex_lock(&drvdata->mutex); 307 + spin_lock(&drvdata->spinlock); 301 308 302 309 if (drvdata->reading) { 303 310 ret = -EBUSY; ··· 320 327 321 328 dev_dbg(&csdev->dev, "Ultrasoc SMB disabled\n"); 322 329 out: 323 - mutex_unlock(&drvdata->mutex); 330 + spin_unlock(&drvdata->spinlock); 324 331 325 332 return ret; 326 333 } ··· 401 408 if (!buf) 402 409 return 0; 403 410 404 - mutex_lock(&drvdata->mutex); 411 + spin_lock(&drvdata->spinlock); 405 412 406 413 /* Don't do anything if another tracer is using this sink. */ 407 414 if (atomic_read(&csdev->refcnt) != 1) ··· 425 432 if (!buf->snapshot && lost) 426 433 perf_aux_output_flag(handle, PERF_AUX_FLAG_TRUNCATED); 427 434 out: 428 - mutex_unlock(&drvdata->mutex); 435 + spin_unlock(&drvdata->spinlock); 429 436 430 437 return data_size; 431 438 } ··· 477 484 static void smb_init_hw(struct smb_drv_data *drvdata) 478 485 { 479 486 smb_disable_hw(drvdata); 480 - smb_reset_buffer(drvdata); 481 487 482 488 writel(SMB_LB_CFG_LO_DEFAULT, drvdata->base + SMB_LB_CFG_LO_REG); 483 489 writel(SMB_LB_CFG_HI_DEFAULT, drvdata->base + SMB_LB_CFG_HI_REG); ··· 582 590 return ret; 583 591 } 584 592 585 - mutex_init(&drvdata->mutex); 593 + ret = smb_config_inport(dev, true); 594 + if (ret) 595 + return ret; 596 + 597 + smb_reset_buffer(drvdata); 598 + platform_set_drvdata(pdev, drvdata); 599 + spin_lock_init(&drvdata->spinlock); 586 600 drvdata->pid = -1; 587 601 588 602 ret = smb_register_sink(pdev, drvdata); 589 603 if (ret) { 604 + smb_config_inport(&pdev->dev, false); 590 605 dev_err(dev, "Failed to register SMB sink\n"); 591 606 return ret; 592 607 } 593 - 594 - ret = smb_config_inport(dev, true); 595 - if (ret) { 596 - smb_unregister_sink(drvdata); 597 - return ret; 598 - } 599 - 600 - platform_set_drvdata(pdev, drvdata); 601 608 602 609 return 0; 603 610 } ··· 604 613 static int smb_remove(struct platform_device *pdev) 605 614 { 606 615 struct smb_drv_data *drvdata = platform_get_drvdata(pdev); 607 - int ret; 608 - 609 - ret = smb_config_inport(&pdev->dev, false); 610 - if (ret) 611 - return ret; 612 616 613 617 smb_unregister_sink(drvdata); 618 + 619 + smb_config_inport(&pdev->dev, false); 614 620 615 621 return 0; 616 622 }
+3 -3
drivers/hwtracing/coresight/ultrasoc-smb.h
··· 8 8 #define _ULTRASOC_SMB_H 9 9 10 10 #include <linux/miscdevice.h> 11 - #include <linux/mutex.h> 11 + #include <linux/spinlock.h> 12 12 13 13 /* Offset of SMB global registers */ 14 14 #define SMB_GLB_CFG_REG 0x00 ··· 105 105 * @csdev: Component vitals needed by the framework. 106 106 * @sdb: Data buffer for SMB. 107 107 * @miscdev: Specifics to handle "/dev/xyz.smb" entry. 108 - * @mutex: Control data access to one at a time. 108 + * @spinlock: Control data access to one at a time. 109 109 * @reading: Synchronise user space access to SMB buffer. 110 110 * @pid: Process ID of the process being monitored by the 111 111 * session that is using this component. ··· 116 116 struct coresight_device *csdev; 117 117 struct smb_data_buffer sdb; 118 118 struct miscdevice miscdev; 119 - struct mutex mutex; 119 + spinlock_t spinlock; 120 120 bool reading; 121 121 pid_t pid; 122 122 enum cs_mode mode;
+11 -3
drivers/hwtracing/ptt/hisi_ptt.c
··· 342 342 return ret; 343 343 344 344 hisi_ptt->trace_irq = pci_irq_vector(pdev, HISI_PTT_TRACE_DMA_IRQ); 345 - ret = devm_request_threaded_irq(&pdev->dev, hisi_ptt->trace_irq, 346 - NULL, hisi_ptt_isr, 0, 347 - DRV_NAME, hisi_ptt); 345 + ret = devm_request_irq(&pdev->dev, hisi_ptt->trace_irq, hisi_ptt_isr, 346 + IRQF_NOBALANCING | IRQF_NO_THREAD, DRV_NAME, 347 + hisi_ptt); 348 348 if (ret) { 349 349 pci_err(pdev, "failed to request irq %d, ret = %d\n", 350 350 hisi_ptt->trace_irq, ret); ··· 1000 1000 return -EOPNOTSUPP; 1001 1001 } 1002 1002 1003 + if (event->attach_state & PERF_ATTACH_TASK) 1004 + return -EOPNOTSUPP; 1005 + 1003 1006 if (event->attr.type != hisi_ptt->hisi_ptt_pmu.type) 1004 1007 return -ENOENT; 1005 1008 ··· 1181 1178 hisi_ptt_pmu_stop(event, PERF_EF_UPDATE); 1182 1179 } 1183 1180 1181 + static void hisi_ptt_pmu_read(struct perf_event *event) 1182 + { 1183 + } 1184 + 1184 1185 static void hisi_ptt_remove_cpuhp_instance(void *hotplug_node) 1185 1186 { 1186 1187 cpuhp_state_remove_instance_nocalls(hisi_ptt_pmu_online, hotplug_node); ··· 1228 1221 .stop = hisi_ptt_pmu_stop, 1229 1222 .add = hisi_ptt_pmu_add, 1230 1223 .del = hisi_ptt_pmu_del, 1224 + .read = hisi_ptt_pmu_read, 1231 1225 }; 1232 1226 1233 1227 reg = readl(hisi_ptt->iobase + HISI_PTT_LOCATION);
+2 -2
drivers/misc/mei/client.c
··· 2011 2011 2012 2012 mei_hdr = mei_msg_hdr_init(cb); 2013 2013 if (IS_ERR(mei_hdr)) { 2014 - rets = -PTR_ERR(mei_hdr); 2014 + rets = PTR_ERR(mei_hdr); 2015 2015 mei_hdr = NULL; 2016 2016 goto err; 2017 2017 } ··· 2032 2032 2033 2033 hbuf_slots = mei_hbuf_empty_slots(dev); 2034 2034 if (hbuf_slots < 0) { 2035 - rets = -EOVERFLOW; 2035 + buf_len = -EOVERFLOW; 2036 2036 goto out; 2037 2037 } 2038 2038
+2 -1
drivers/misc/mei/pxp/mei_pxp.c
··· 84 84 byte = ret; 85 85 break; 86 86 } 87 + return byte; 87 88 } 88 89 89 - return byte; 90 + return 0; 90 91 } 91 92 92 93 /**
+6
drivers/nvmem/core.c
··· 796 796 if (!layout_np) 797 797 return NULL; 798 798 799 + /* Fixed layouts don't have a matching driver */ 800 + if (of_device_is_compatible(layout_np, "fixed-layout")) { 801 + of_node_put(layout_np); 802 + return NULL; 803 + } 804 + 799 805 /* 800 806 * In case the nvmem device was built-in while the layout was built as a 801 807 * module, we shall manually request the layout driver loading otherwise
+21
drivers/parport/parport_pc.c
··· 2658 2658 asix_ax99100, 2659 2659 quatech_sppxp100, 2660 2660 wch_ch382l, 2661 + brainboxes_uc146, 2662 + brainboxes_px203, 2661 2663 }; 2662 2664 2663 2665 ··· 2739 2737 /* asix_ax99100 */ { 1, { { 0, 1 }, } }, 2740 2738 /* quatech_sppxp100 */ { 1, { { 0, 1 }, } }, 2741 2739 /* wch_ch382l */ { 1, { { 2, -1 }, } }, 2740 + /* brainboxes_uc146 */ { 1, { { 3, -1 }, } }, 2741 + /* brainboxes_px203 */ { 1, { { 0, -1 }, } }, 2742 2742 }; 2743 2743 2744 2744 static const struct pci_device_id parport_pc_pci_tbl[] = { ··· 2837 2833 PCI_ANY_ID, PCI_ANY_ID, 0, 0, quatech_sppxp100 }, 2838 2834 /* WCH CH382L PCI-E single parallel port card */ 2839 2835 { 0x1c00, 0x3050, 0x1c00, 0x3050, 0, 0, wch_ch382l }, 2836 + /* Brainboxes IX-500/550 */ 2837 + { PCI_VENDOR_ID_INTASHIELD, 0x402a, 2838 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_pcie_pport }, 2839 + /* Brainboxes UC-146/UC-157 */ 2840 + { PCI_VENDOR_ID_INTASHIELD, 0x0be1, 2841 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc146 }, 2842 + { PCI_VENDOR_ID_INTASHIELD, 0x0be2, 2843 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_uc146 }, 2844 + /* Brainboxes PX-146/PX-257 */ 2845 + { PCI_VENDOR_ID_INTASHIELD, 0x401c, 2846 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_pcie_pport }, 2847 + /* Brainboxes PX-203 */ 2848 + { PCI_VENDOR_ID_INTASHIELD, 0x4007, 2849 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, brainboxes_px203 }, 2850 + /* Brainboxes PX-475 */ 2851 + { PCI_VENDOR_ID_INTASHIELD, 0x401f, 2852 + PCI_ANY_ID, PCI_ANY_ID, 0, 0, oxsemi_pcie_pport }, 2840 2853 { 0, } /* terminate list */ 2841 2854 }; 2842 2855 MODULE_DEVICE_TABLE(pci, parport_pc_pci_tbl);
-10
fs/debugfs/file.c
··· 108 108 kfree(fsd); 109 109 fsd = READ_ONCE(dentry->d_fsdata); 110 110 } 111 - #ifdef CONFIG_LOCKDEP 112 - fsd->lock_name = kasprintf(GFP_KERNEL, "debugfs:%pd", dentry); 113 - lockdep_register_key(&fsd->key); 114 - lockdep_init_map(&fsd->lockdep_map, fsd->lock_name ?: "debugfs", 115 - &fsd->key, 0); 116 - #endif 117 111 INIT_LIST_HEAD(&fsd->cancellations); 118 112 mutex_init(&fsd->cancellations_mtx); 119 113 } ··· 126 132 if (!refcount_inc_not_zero(&fsd->active_users)) 127 133 return -EIO; 128 134 129 - lock_map_acquire_read(&fsd->lockdep_map); 130 - 131 135 return 0; 132 136 } 133 137 EXPORT_SYMBOL_GPL(debugfs_file_get); ··· 142 150 void debugfs_file_put(struct dentry *dentry) 143 151 { 144 152 struct debugfs_fsdata *fsd = READ_ONCE(dentry->d_fsdata); 145 - 146 - lock_map_release(&fsd->lockdep_map); 147 153 148 154 if (refcount_dec_and_test(&fsd->active_users)) 149 155 complete(&fsd->active_users_drained);
-7
fs/debugfs/inode.c
··· 243 243 244 244 /* check it wasn't a dir (no fsdata) or automount (no real_fops) */ 245 245 if (fsd && fsd->real_fops) { 246 - #ifdef CONFIG_LOCKDEP 247 - lockdep_unregister_key(&fsd->key); 248 - kfree(fsd->lock_name); 249 - #endif 250 246 WARN_ON(!list_empty(&fsd->cancellations)); 251 247 mutex_destroy(&fsd->cancellations_mtx); 252 248 } ··· 750 754 fsd = READ_ONCE(dentry->d_fsdata); 751 755 if ((unsigned long)fsd & DEBUGFS_FSDATA_IS_REAL_FOPS_BIT) 752 756 return; 753 - 754 - lock_map_acquire(&fsd->lockdep_map); 755 - lock_map_release(&fsd->lockdep_map); 756 757 757 758 /* if we hit zero, just wait for all to finish */ 758 759 if (!refcount_dec_and_test(&fsd->active_users)) {
-6
fs/debugfs/internal.h
··· 7 7 8 8 #ifndef _DEBUGFS_INTERNAL_H_ 9 9 #define _DEBUGFS_INTERNAL_H_ 10 - #include <linux/lockdep.h> 11 10 #include <linux/list.h> 12 11 13 12 struct file_operations; ··· 24 25 struct { 25 26 refcount_t active_users; 26 27 struct completion active_users_drained; 27 - #ifdef CONFIG_LOCKDEP 28 - struct lockdep_map lockdep_map; 29 - struct lock_class_key key; 30 - char *lock_name; 31 - #endif 32 28 33 29 /* protect cancellations */ 34 30 struct mutex cancellations_mtx;
+1 -1
tools/testing/nvdimm/test/ndtest.c
··· 924 924 925 925 nfit_test_setup(ndtest_resource_lookup, NULL); 926 926 927 - rc = class_regster(&ndtest_dimm_class); 927 + rc = class_register(&ndtest_dimm_class); 928 928 if (rc) 929 929 goto err_register; 930 930