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 'driver-core-5.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core

Pull driver core fixes from Greg KH:
"Here are a number of small driver core fixes for 5.7-rc5 to resolve a
bunch of reported issues with the current tree.

Biggest here are the reverts and patches from John Stultz to resolve a
bunch of deferred probe regressions we have been seeing in 5.7-rc
right now.

Along with those are some other smaller fixes:

- coredump crash fix

- devlink fix for when permissive mode was enabled

- amba and platform device dma_parms fixes

- component error silenced for when deferred probe happens

All of these have been in linux-next for a while with no reported
issues"

* tag 'driver-core-5.7-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
regulator: Revert "Use driver_deferred_probe_timeout for regulator_init_complete_work"
driver core: Ensure wait_for_device_probe() waits until the deferred_probe_timeout fires
driver core: Use dev_warn() instead of dev_WARN() for deferred_probe_timeout warnings
driver core: Revert default driver_deferred_probe_timeout value to 0
component: Silence bind error on -EPROBE_DEFER
driver core: Fix handling of fw_devlink=permissive
coredump: fix crash when umh is disabled
amba: Initialize dma_parms for amba devices
driver core: platform: Initialize dma_parms for platform devices

+48 -30
+1
drivers/amba/bus.c
··· 645 645 dev->dev.release = amba_device_release; 646 646 dev->dev.bus = &amba_bustype; 647 647 dev->dev.dma_mask = &dev->dev.coherent_dma_mask; 648 + dev->dev.dma_parms = &dev->dma_parms; 648 649 dev->res.name = dev_name(&dev->dev); 649 650 } 650 651
+5 -3
drivers/base/component.c
··· 256 256 ret = master->ops->bind(master->dev); 257 257 if (ret < 0) { 258 258 devres_release_group(master->dev, NULL); 259 - dev_info(master->dev, "master bind failed: %d\n", ret); 259 + if (ret != -EPROBE_DEFER) 260 + dev_info(master->dev, "master bind failed: %d\n", ret); 260 261 return ret; 261 262 } 262 263 ··· 612 611 devres_release_group(component->dev, NULL); 613 612 devres_release_group(master->dev, NULL); 614 613 615 - dev_err(master->dev, "failed to bind %s (ops %ps): %d\n", 616 - dev_name(component->dev), component->ops, ret); 614 + if (ret != -EPROBE_DEFER) 615 + dev_err(master->dev, "failed to bind %s (ops %ps): %d\n", 616 + dev_name(component->dev), component->ops, ret); 617 617 } 618 618 619 619 return ret;
+6 -1
drivers/base/core.c
··· 2370 2370 return fw_devlink_flags; 2371 2371 } 2372 2372 2373 + static bool fw_devlink_is_permissive(void) 2374 + { 2375 + return fw_devlink_flags == DL_FLAG_SYNC_STATE_ONLY; 2376 + } 2377 + 2373 2378 /** 2374 2379 * device_add - add device to device hierarchy. 2375 2380 * @dev: device. ··· 2529 2524 if (fw_devlink_flags && is_fwnode_dev && 2530 2525 fwnode_has_op(dev->fwnode, add_links)) { 2531 2526 fw_ret = fwnode_call_int_op(dev->fwnode, add_links, dev); 2532 - if (fw_ret == -ENODEV) 2527 + if (fw_ret == -ENODEV && !fw_devlink_is_permissive()) 2533 2528 device_link_wait_for_mandatory_supplier(dev); 2534 2529 else if (fw_ret) 2535 2530 device_link_wait_for_optional_supplier(dev);
+8 -12
drivers/base/dd.c
··· 224 224 } 225 225 DEFINE_SHOW_ATTRIBUTE(deferred_devs); 226 226 227 - #ifdef CONFIG_MODULES 228 - /* 229 - * In the case of modules, set the default probe timeout to 230 - * 30 seconds to give userland some time to load needed modules 231 - */ 232 - int driver_deferred_probe_timeout = 30; 233 - #else 234 - /* In the case of !modules, no probe timeout needed */ 235 - int driver_deferred_probe_timeout = -1; 236 - #endif 227 + int driver_deferred_probe_timeout; 237 228 EXPORT_SYMBOL_GPL(driver_deferred_probe_timeout); 229 + static DECLARE_WAIT_QUEUE_HEAD(probe_timeout_waitqueue); 238 230 239 231 static int __init deferred_probe_timeout_setup(char *str) 240 232 { ··· 258 266 return -ENODEV; 259 267 } 260 268 261 - if (!driver_deferred_probe_timeout) { 262 - dev_WARN(dev, "deferred probe timeout, ignoring dependency"); 269 + if (!driver_deferred_probe_timeout && initcalls_done) { 270 + dev_warn(dev, "deferred probe timeout, ignoring dependency"); 263 271 return -ETIMEDOUT; 264 272 } 265 273 ··· 276 284 277 285 list_for_each_entry_safe(private, p, &deferred_probe_pending_list, deferred_probe) 278 286 dev_info(private->device, "deferred probe pending"); 287 + wake_up(&probe_timeout_waitqueue); 279 288 } 280 289 static DECLARE_DELAYED_WORK(deferred_probe_timeout_work, deferred_probe_timeout_work_func); 281 290 ··· 651 658 */ 652 659 void wait_for_device_probe(void) 653 660 { 661 + /* wait for probe timeout */ 662 + wait_event(probe_timeout_waitqueue, !driver_deferred_probe_timeout); 663 + 654 664 /* wait for the deferred probe workqueue to finish */ 655 665 flush_work(&deferred_probe_work); 656 666
+2
drivers/base/platform.c
··· 380 380 */ 381 381 static void setup_pdev_dma_masks(struct platform_device *pdev) 382 382 { 383 + pdev->dev.dma_parms = &pdev->dma_parms; 384 + 383 385 if (!pdev->dev.coherent_dma_mask) 384 386 pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); 385 387 if (!pdev->dev.dma_mask) {
+11 -14
drivers/regulator/core.c
··· 5754 5754 5755 5755 static int __init regulator_init_complete(void) 5756 5756 { 5757 - int delay = driver_deferred_probe_timeout; 5758 - 5759 - if (delay < 0) 5760 - delay = 0; 5761 5757 /* 5762 5758 * Since DT doesn't provide an idiomatic mechanism for 5763 5759 * enabling full constraints and since it's much more natural ··· 5764 5768 has_full_constraints = true; 5765 5769 5766 5770 /* 5767 - * If driver_deferred_probe_timeout is set, we punt 5768 - * completion for that many seconds since systems like 5769 - * distros will load many drivers from userspace so consumers 5770 - * might not always be ready yet, this is particularly an 5771 - * issue with laptops where this might bounce the display off 5772 - * then on. Ideally we'd get a notification from userspace 5773 - * when this happens but we don't so just wait a bit and hope 5774 - * we waited long enough. It'd be better if we'd only do 5775 - * this on systems that need it. 5771 + * We punt completion for an arbitrary amount of time since 5772 + * systems like distros will load many drivers from userspace 5773 + * so consumers might not always be ready yet, this is 5774 + * particularly an issue with laptops where this might bounce 5775 + * the display off then on. Ideally we'd get a notification 5776 + * from userspace when this happens but we don't so just wait 5777 + * a bit and hope we waited long enough. It'd be better if 5778 + * we'd only do this on systems that need it, and a kernel 5779 + * command line option might be useful. 5776 5780 */ 5777 - schedule_delayed_work(&regulator_init_complete_work, delay * HZ); 5781 + schedule_delayed_work(&regulator_init_complete_work, 5782 + msecs_to_jiffies(30000)); 5778 5783 5779 5784 return 0; 5780 5785 }
+8
fs/coredump.c
··· 788 788 if (displaced) 789 789 put_files_struct(displaced); 790 790 if (!dump_interrupted()) { 791 + /* 792 + * umh disabled with CONFIG_STATIC_USERMODEHELPER_PATH="" would 793 + * have this set to NULL. 794 + */ 795 + if (!cprm.file) { 796 + pr_info("Core dump to |%s disabled\n", cn.corename); 797 + goto close_fail; 798 + } 791 799 file_start_write(cprm.file); 792 800 core_dumped = binfmt->core_dump(&cprm); 793 801 file_end_write(cprm.file);
+1
include/linux/amba/bus.h
··· 65 65 struct device dev; 66 66 struct resource res; 67 67 struct clk *pclk; 68 + struct device_dma_parameters dma_parms; 68 69 unsigned int periphid; 69 70 unsigned int cid; 70 71 struct amba_cs_uci_id uci;
+1
include/linux/platform_device.h
··· 25 25 bool id_auto; 26 26 struct device dev; 27 27 u64 platform_dma_mask; 28 + struct device_dma_parameters dma_parms; 28 29 u32 num_resources; 29 30 struct resource *resource; 30 31
+5
kernel/umh.c
··· 544 544 * Runs a user-space application. The application is started 545 545 * asynchronously if wait is not set, and runs as a child of system workqueues. 546 546 * (ie. it runs with full root capabilities and optimized affinity). 547 + * 548 + * Note: successful return value does not guarantee the helper was called at 549 + * all. You can't rely on sub_info->{init,cleanup} being called even for 550 + * UMH_WAIT_* wait modes as STATIC_USERMODEHELPER_PATH="" turns all helpers 551 + * into a successful no-op. 547 552 */ 548 553 int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait) 549 554 {