1. 22 7月, 2017 1 次提交
    • D
      driver core: emit uevents when device is bound to a driver · 1455cf8d
      Dmitry Torokhov 提交于
      There are certain touch controllers that may come up in either normal
      (application) or boot mode, depending on whether firmware/configuration is
      corrupted when they are powered on. In boot mode the kernel does not create
      input device instance (because it does not necessarily know the
      characteristics of the input device in question).
      
      Another number of controllers does not store firmware in a non-volatile
      memory, and they similarly need to have firmware loaded before input device
      instance is created. There are also other types of devices with similar
      behavior.
      
      There is a desire to be able to trigger firmware loading via udev, but it
      has to happen only when driver is bound to a physical device (i2c or spi).
      These udev actions can not use ADD events, as those happen too early, so we
      are introducing BIND and UNBIND events that are emitted at the right
      moment.
      
      Also, many drivers create additional driver-specific device attributes
      when binding to the device, to provide userspace with additional controls.
      The new events allow userspace to adjust these driver-specific attributes
      without worrying that they are not there yet.
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1455cf8d
  2. 20 4月, 2017 1 次提交
  3. 14 1月, 2017 1 次提交
  4. 11 11月, 2016 1 次提交
  5. 01 11月, 2016 2 次提交
    • R
      PM / runtime: Use device links · 21d5c57b
      Rafael J. Wysocki 提交于
      Modify the runtime PM framework to use device links to ensure that
      supplier devices will not be suspended if any of their consumer
      devices are active.
      
      The idea is to reference count suppliers on the consumer's resume
      and drop references to them on its suspend.  The information on
      whether or not the supplier has been reference counted by the
      consumer's (runtime) resume is stored in a new field (rpm_active)
      in the link object for each link.
      
      It may be necessary to clean up those references when the
      supplier is unbinding and that's why the links whose status is
      DEVICE_LINK_SUPPLIER_UNBIND are skipped by the runtime suspend
      and resume code.
      
      The above means that if the consumer device is probed in the
      runtime-active state, the supplier has to be resumed and reference
      counted by device_link_add() so the code works as expected on its
      (runtime) suspend.  There is a new flag, DEVICE_LINK_RPM_ACTIVE,
      to tell device_link_add() about that (in which case the caller
      is responsible for making sure that the consumer really will
      be runtime-active when runtime PM is enabled for it).
      
      The other new link flag, DEVICE_LINK_PM_RUNTIME, tells the core
      whether or not the link should be used for runtime PM at all.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      21d5c57b
    • R
      driver core: Functional dependencies tracking support · 9ed98953
      Rafael J. Wysocki 提交于
      Currently, there is a problem with taking functional dependencies
      between devices into account.
      
      What I mean by a "functional dependency" is when the driver of device
      B needs device A to be functional and (generally) its driver to be
      present in order to work properly.  This has certain consequences
      for power management (suspend/resume and runtime PM ordering) and
      shutdown ordering of these devices.  In general, it also implies that
      the driver of A needs to be working for B to be probed successfully
      and it cannot be unbound from the device before the B's driver.
      
      Support for representing those functional dependencies between
      devices is added here to allow the driver core to track them and act
      on them in certain cases where applicable.
      
      The argument for doing that in the driver core is that there are
      quite a few distinct use cases involving device dependencies, they
      are relatively hard to get right in a driver (if one wants to
      address all of them properly) and it only gets worse if multiplied
      by the number of drivers potentially needing to do it.  Morever, at
      least one case (asynchronous system suspend/resume) cannot be handled
      in a single driver at all, because it requires the driver of A to
      wait for B to suspend (during system suspend) and the driver of B to
      wait for A to resume (during system resume).
      
      For this reason, represent dependencies between devices as "links",
      with the help of struct device_link objects each containing pointers
      to the "linked" devices, a list node for each of them, status
      information, flags, and an RCU head for synchronization.
      
      Also add two new list heads, representing the lists of links to the
      devices that depend on the given one (consumers) and to the devices
      depended on by it (suppliers), and a "driver presence status" field
      (needed for figuring out initial states of device links) to struct
      device.
      
      The entire data structure consisting of all of the lists of link
      objects for all devices is protected by a mutex (for link object
      addition/removal and for list walks during device driver probing
      and removal) and by SRCU (for list walking in other case that will
      be introduced by subsequent change sets).  If CONFIG_SRCU is not
      selected, however, an rwsem is used for protecting the entire data
      structure.
      
      In addition, each link object has an internal status field whose
      value reflects whether or not drivers are bound to the devices
      pointed to by the link or probing/removal of their drivers is in
      progress etc.  That field is only modified under the device links
      mutex, but it may be read outside of it in some cases (introduced by
      subsequent change sets), so modifications of it are annotated with
      WRITE_ONCE().
      
      New links are added by calling device_link_add() which takes three
      arguments: pointers to the devices in question and flags.  In
      particular, if DL_FLAG_STATELESS is set in the flags, the link status
      is not to be taken into account for this link and the driver core
      will not manage it.  In turn, if DL_FLAG_AUTOREMOVE is set in the
      flags, the driver core will remove the link automatically when the
      consumer device driver unbinds from it.
      
      One of the actions carried out by device_link_add() is to reorder
      the lists used for device shutdown and system suspend/resume to
      put the consumer device along with all of its children and all of
      its consumers (and so on, recursively) to the ends of those lists
      in order to ensure the right ordering between all of the supplier
      and consumer devices.
      
      For this reason, it is not possible to create a link between two
      devices if the would-be supplier device already depends on the
      would-be consumer device as either a direct descendant of it or a
      consumer of one of its direct descendants or one of its consumers
      and so on.
      
      There are two types of link objects, persistent and non-persistent.
      The persistent ones stay around until one of the target devices is
      deleted, while the non-persistent ones are removed automatically when
      the consumer driver unbinds from its device (ie. they are assumed to
      be valid only as long as the consumer device has a driver bound to
      it).  Persistent links are created by default and non-persistent
      links are created when the DL_FLAG_AUTOREMOVE flag is passed
      to device_link_add().
      
      Both persistent and non-persistent device links can be deleted
      with an explicit call to device_link_del().
      
      Links created without the DL_FLAG_STATELESS flag set are managed
      by the driver core using a simple state machine.  There are 5 states
      each link can be in: DORMANT (unused), AVAILABLE (the supplier driver
      is present and functional), CONSUMER_PROBE (the consumer driver is
      probing), ACTIVE (both supplier and consumer drivers are present and
      functional), and SUPPLIER_UNBIND (the supplier driver is unbinding).
      The driver core updates the link state automatically depending on
      what happens to the linked devices and for each link state specific
      actions are taken in addition to that.
      
      For example, if the supplier driver unbinds from its device, the
      driver core will also unbind the drivers of all of its consumers
      automatically under the assumption that they cannot function
      properly without the supplier.  Analogously, the driver core will
      only allow the consumer driver to bind to its device if the
      supplier driver is present and functional (ie. the link is in
      the AVAILABLE state).  If that's not the case, it will rely on
      the existing deferred probing mechanism to wait for the supplier
      driver to become available.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9ed98953
  6. 31 10月, 2016 2 次提交
  7. 28 10月, 2016 1 次提交
  8. 02 9月, 2016 1 次提交
    • B
      device core: Remove deprecated create_singlethread_workqueue · 2c507e46
      Bhaktipriya Shridhar 提交于
      The workqueue "deferred_wq" queues a single work item
      &deferred_probe_work and hence doesn't require ordering.
      It is involved in probing devices and is not being used on a memory
      reclaim path. Hence, it has been converted to use system_wq.
      
      System workqueues have been able to handle high level of concurrency
      for a long time now and hence it's not required to have a singlethreaded
      workqueue just to gain concurrency. Unlike a dedicated per-cpu workqueue
      created with create_singlethread_workqueue(), system_wq allows multiple
      work items to overlap executions even on the same CPU; however, a
      per-cpu workqueue doesn't have any CPU locality or global ordering
      guarantee unless the target CPU is explicitly specified and thus the
      increase of local concurrency shouldn't make any difference.
      
      The work item has been flushed in driver_probe_done() to ensure that
      there are no pending tasks while disconnecting the driver.
      Signed-off-by: NBhaktipriya Shridhar <bhaktipriya96@gmail.com>
      Acked-by: NTejun Heo <tj@kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      2c507e46
  9. 31 8月, 2016 1 次提交
  10. 03 5月, 2016 1 次提交
    • G
      Revert "base: dd: don't remove driver_data in -EPROBE_DEFER case" · c6e360a0
      Greg Kroah-Hartman 提交于
      This reverts commit ded9db38.
      
      Thierry Reding writes:
      	This causes a boot regression on at least one board, caused by
      	one of the drivers looking at driver data to check whether or
      	not the driver has properly loaded. If the code encounters a
      	non-NULL pointer it tries to dereference it, but because it's
      	already been freed there is no memory backing it and things
      	crash.
      
      	I don't think keeping stale pointers around is a good idea. The
      	whole point of setting this to NULL in the core is so that probe
      	failures result in the same starting conditions no matter what.
      
      	Can we please get this reverted?
      Reported-by: NThierry Reding <thierry.reding@gmail.com>
      Cc: Yi Zhang <yizhang_hust@163.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      c6e360a0
  11. 02 5月, 2016 1 次提交
  12. 17 2月, 2016 1 次提交
  13. 12 1月, 2016 1 次提交
  14. 08 1月, 2016 2 次提交
  15. 09 12月, 2015 1 次提交
  16. 30 11月, 2015 2 次提交
    • U
      PM / runtime: Re-init runtime PM states at probe error and driver unbind · 5de85b9d
      Ulf Hansson 提交于
      There are two common expectations among several subsystems/drivers that
      deploys runtime PM support, but which isn't met by the driver core.
      
      Expectation 1)
      At ->probe() the subsystem/driver expects the runtime PM status of the
      device to be RPM_SUSPENDED, which is the initial status being assigned at
      device registration.
      
      This expectation is especially common among some of those subsystems/
      drivers that manages devices with an attached PM domain, as those requires
      the ->runtime_resume() callback at the PM domain level to be invoked
      during ->probe().
      
      Moreover these subsystems/drivers entirely relies on runtime PM resources
      being managed at the PM domain level, thus don't implement their own set
      of runtime PM callbacks.
      
      These are two scenarios that suffers from this unmet expectation.
      
      i) A failed ->probe() sequence requests probe deferral:
      
      ->probe()
        ...
        pm_runtime_enable()
        pm_runtime_get_sync()
        ...
      
      err:
        pm_runtime_put()
        pm_runtime_disable()
        ...
      
      As there are no guarantees that such sequence turns the runtime PM status
      of the device into RPM_SUSPENDED, the re-trying ->probe() may start with
      the status in RPM_ACTIVE.
      
      In such case the runtime PM core won't invoke the ->runtime_resume()
      callback because of a pm_runtime_get_sync(), as it considers the device to
      be already runtime resumed.
      
      ii) A driver re-bind sequence:
      
      At driver unbind, the subsystem/driver's >remove() callback invokes a
      sequence of runtime PM APIs, to undo actions during ->probe() and to put
      the device into low power state.
      
      ->remove()
        ...
        pm_runtime_put()
        pm_runtime_disable()
        ...
      
      Similar as in the failing ->probe() case, this sequence don't guarantee
      the runtime PM status of the device to turn into RPM_SUSPENDED.
      
      Trying to re-bind the driver thus causes the same issue as when re-trying
      ->probe(), in the probe deferral scenario.
      
      Expectation 2)
      Drivers that invokes the pm_runtime_irq_safe() API during ->probe(),
      triggers the runtime PM core to increase the usage count for the device's
      parent and permanently make it runtime resumed.
      
      The usage count is only dropped at device removal, which also allows it to
      be runtime suspended again.
      
      A re-trying ->probe() repeats the call to pm_runtime_irq_safe() and thus
      once more triggers the usage count of the device's parent to be increased.
      
      This leads to not only an imbalance issue of the usage count of the
      device's parent, but also to keep it runtime resumed permanently even if
      ->probe() fails.
      
      To address these issues, let's change the policy of the driver core to
      meet these expectations. More precisely, at ->probe() failures and driver
      unbind, restore the initial states of runtime PM.
      
      Although to still allow subsystem's to control PM for devices that doesn't
      ->probe() successfully, don't restore the initial states unless runtime PM
      is disabled.
      Signed-off-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NKevin Hilman <khilman@linaro.org>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      5de85b9d
    • S
      PM / sleep: prohibit devices probing during suspend/hibernation · 013c074f
      Strashko, Grygorii 提交于
      It is unsafe [1] if probing of devices will happen during suspend or
      hibernation and system behavior will be unpredictable in this case.
      So, let's prohibit device's probing in dpm_prepare() and defer their
      probing instead. The normal behavior will be restored in
      dpm_complete().
      
      This patch introduces new DD core APIs:
       device_block_probing()
         It will disable probing of devices and defer their probes instead.
       device_unblock_probing()
         It will restore normal behavior and trigger re-probing of deferred
         devices.
      
      [1] https://lkml.org/lkml/2015/9/11/554Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Acked-by: NPavel Machek <pavel@ucw.cz>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      013c074f
  17. 27 10月, 2015 1 次提交
    • D
      drivers/pinctrl: Add the concept of an "init" state · ef0eebc0
      Douglas Anderson 提交于
      For pinctrl the "default" state is applied to pins before the driver's
      probe function is called.  This is normally a sensible thing to do,
      but in some cases can cause problems.  That's because the pins will
      change state before the driver is given a chance to program how those
      pins should behave.
      
      As an example you might have a regulator that is controlled by a PWM
      (output high = high voltage, output low = low voltage).  The firmware
      might leave this pin as driven high.  If we allow the driver core to
      reconfigure this pin as a PWM pin before the PWM's probe function runs
      then you might end up running at too low of a voltage while we probe.
      
      Let's introudce a new "init" state.  If this is defined we'll set
      pinctrl to this state before probe and then "default" after probe
      (unless the driver explicitly changed states already).
      
      An alternative idea that was thought of was to use the pre-existing
      "sleep" or "idle" states and add a boolean property that we should
      start in that mode.  This was not done because the "init" state is
      needed for correctness and those other states are only present (and
      only transitioned in to and out of) when (optional) power management
      is enabled.
      
      Changes in v3:
      - Moved declarations to pinctrl/devinfo.h
      - Fixed author/SoB
      
      Changes in v2:
      - Added comment to pinctrl_init_done() as per Linus W.
      Signed-off-by: NDouglas Anderson <dianders@chromium.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Tested-by: NCaesar Wang <wxt@rock-chips.com>
      Signed-off-by: NLinus Walleij <linus.walleij@linaro.org>
      ef0eebc0
  18. 06 8月, 2015 1 次提交
    • G
      driver core: correct device's shutdown order · 52cdbdd4
      Grygorii Strashko 提交于
      Now device's shutdown sequence is performed in reverse order of their
      registration in devices_kset list and this sequence corresponds to the
      reverse device's creation order. So, devices_kset data tracks
      "parent<-child" device's dependencies only.
      
      Unfortunately, that's not enough and causes problems in case of
      implementing board's specific shutdown procedures. For example [1]:
      "DRA7XX_evm uses PCF8575 and one of the PCF output lines feeds to
      MMC/SD and this line should be driven high in order for the MMC/SD to
      be detected. This line is modelled as regulator and the hsmmc driver
      takes care of enabling and disabling it. In the case of 'reboot',
      during shutdown path as part of it's cleanup process the hsmmc driver
      disables this regulator. This makes MMC boot not functional."
      
      To handle this issue the .shutdown() callback could be implemented
      for PCF8575 device where corresponding GPIO pins will be configured to
      states, required for correct warm/cold reset. This can be achieved
      only when all .shutdown() callbacks have been called already for all
      PCF8575's consumers. But devices_kset is not filled correctly now:
      
      devices_kset: Device61 4e000000.dmm
      devices_kset: Device62 48070000.i2c
      devices_kset: Device63 48072000.i2c
      devices_kset: Device64 48060000.i2c
      devices_kset: Device65 4809c000.mmc
      ...
      devices_kset: Device102 fixedregulator-sd
      ...
      devices_kset: Device181 0-0020 // PCF8575
      devices_kset: Device182 gpiochip496
      devices_kset: Device183 0-0021 // PCF8575
      devices_kset: Device184 gpiochip480
      
      As can be seen from above .shutdown() callback for PCF8575 will be called
      before its consumers, which, in turn means, that any changes of PCF8575
      GPIO's pins will be or unsafe or overwritten later by GPIO's consumers.
      The problem can be solved if devices_kset list will be filled not only
      according device creation order, but also according device's probing
      order to track "supplier<-consumer" dependencies also.
      
      Hence, as a fix, lets add devices_kset_move_last(),
      devices_kset_move_before(), devices_kset_move_after() and call them
      from device_move() and also add call of devices_kset_move_last() in
      really_probe(). After this change all entries in devices_kset will
      be sorted according to device's creation ("parent<-child") and
      probing ("supplier<-consumer") order.
      
      devices_kset after:
      devices_kset: Device121 48070000.i2c
      devices_kset: Device122 i2c-0
      ...
      devices_kset: Device147 regulator.24
      devices_kset: Device148 0-0020
      devices_kset: Device149 gpiochip496
      devices_kset: Device150 0-0021
      devices_kset: Device151 gpiochip480
      devices_kset: Device152 0-0019
      ...
      devices_kset: Device372 fixedregulator-sd
      devices_kset: Device373 regulator.29
      devices_kset: Device374 4809c000.mmc
      devices_kset: Device375 mmc0
      
      [1] http://www.spinics.net/lists/linux-mmc/msg29825.html
      
      Cc: Sekhar Nori <nsekhar@ti.com>
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      52cdbdd4
  19. 28 7月, 2015 1 次提交
  20. 01 6月, 2015 1 次提交
  21. 25 5月, 2015 2 次提交
  22. 20 5月, 2015 3 次提交
    • L
      driver-core: enable drivers to opt-out of async probe · d173a137
      Luis R. Rodriguez 提交于
      There are drivers that can not be probed asynchronously. One such group
      is platform drivers registered with platform_driver_probe(), which
      expects driver's probe routine be discarded after the driver has been
      registered and initial binding attempt executed. Also
      platform_driver_probe() an error when no devices were bound to the
      driver, allowing failing to load such driver module altogether.
      
      Other drivers do not work well with asynchronous probing because of
      driver bug or not optimal driver organization.
      
      To allow using such drivers even when user requests asynchronous probing
      as default boot strategy, let's allow them to opt out.
      Signed-off-by: NLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      d173a137
    • L
      driver-core: add driver module asynchronous probe support · f2411da7
      Luis R. Rodriguez 提交于
      Some init systems may wish to express the desire to have device drivers
      run their probe() code asynchronously. This implements support for this
      and allows userspace to request async probe as a preference through a
      generic shared device driver module parameter, async_probe.
      
      Implementation for async probe is supported through a module parameter
      given that since synchronous probe has been prevalent for years some
      userspace might exist which relies on the fact that the device driver
      will probe synchronously and the assumption that devices it provides
      will be immediately available after this.
      Signed-off-by: NLuis R. Rodriguez <mcgrof@suse.com>
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      f2411da7
    • D
      driver-core: add asynchronous probing support for drivers · 765230b5
      Dmitry Torokhov 提交于
      Some devices take a long time when initializing, and not all drivers are
      suited to initialize their devices when they are open. For example,
      input drivers need to interrogate their devices in order to publish
      device's capabilities before userspace will open them. When such drivers
      are compiled into kernel they may stall entire kernel initialization.
      
      This change allows drivers request for their probe functions to be
      called asynchronously during driver and device registration (manual
      binding is still synchronous). Because async_schedule is used to perform
      asynchronous calls module loading will still wait for the probing to
      complete.
      
      Note that the end goal is to make the probing asynchronous by default,
      so annotating drivers with PROBE_PREFER_ASYNCHRONOUS is a temporary
      measure that allows us to speed up boot process while we validating and
      fixing the rest of the drivers and preparing userspace.
      
      This change is based on earlier patch by "Luis R. Rodriguez"
      <mcgrof@suse.com>
      Signed-off-by: NDmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      765230b5
  23. 25 3月, 2015 2 次提交
  24. 23 3月, 2015 1 次提交
    • R
      driver core / PM: Add PM domain callbacks for device setup/cleanup · e90d5532
      Rafael J. Wysocki 提交于
      If PM domains are in use, it may be necessary to prepare the code
      handling a PM domain for driver probing.  For example, in some
      cases device drivers rely on the ability to power on the devices
      with the help of the IO runtime PM framework and the PM domain
      code needs to be ready for that.  Also, if that code has not been
      fully initialized yet, the driver probing should be deferred.
      
      Moreover, after the probing is complete, it may be necessary to
      put the PM domain in question into the state reflecting the current
      needs of the devices in it, for example, so that power is not drawn
      in vain.  The same should be done after removing a driver from
      a device, as the PM domain state may need to be changed to reflect
      the new situation.
      
      For these reasons, introduce new PM domain callbacks, ->activate,
      ->sync and ->dismiss called, respectively, before probing for a
      device driver, after the probing has completed successfully and
      if the probing has failed or the driver has been removed.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NUlf Hansson <ulf.hansson@linaro.org>
      Reviewed-by: NKevin Hilman <khilman@linaro.org>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e90d5532
  25. 24 9月, 2014 1 次提交
  26. 28 5月, 2014 4 次提交
  27. 29 4月, 2014 1 次提交
    • G
      drivercore: deferral race condition fix · 58b116bc
      Grant Likely 提交于
      When the kernel is built with CONFIG_PREEMPT it is possible to reach a state
      when all modules loaded but some driver still stuck in the deferred list
      and there is a need for external event to kick the deferred queue to probe
      these drivers.
      
      The issue has been observed on embedded systems with CONFIG_PREEMPT enabled,
      audio support built as modules and using nfsroot for root filesystem.
      
      The following log fragment shows such sequence when all audio modules
      were loaded but the sound card is not present since the machine driver has
      failed to probe due to missing dependency during it's probe.
      The board is am335x-evmsk (McASP<->tlv320aic3106 codec) with davinci-evm
      machine driver:
      
      ...
      [   12.615118] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: ENTER
      [   12.719969] davinci_evm sound.3: davinci_evm_probe: ENTER
      [   12.725753] davinci_evm sound.3: davinci_evm_probe: snd_soc_register_card
      [   12.753846] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: snd_soc_register_component
      [   12.922051] davinci-mcasp 4803c000.mcasp: davinci_mcasp_probe: snd_soc_register_component DONE
      [   12.950839] davinci_evm sound.3: ASoC: platform (null) not registered
      [   12.957898] davinci_evm sound.3: davinci_evm_probe: snd_soc_register_card DONE (-517)
      [   13.099026] davinci-mcasp 4803c000.mcasp: Kicking the deferred list
      [   13.177838] davinci-mcasp 4803c000.mcasp: really_probe: probe_count = 2
      [   13.194130] davinci_evm sound.3: snd_soc_register_card failed (-517)
      [   13.346755] davinci_mcasp_driver_init: LEAVE
      [   13.377446] platform sound.3: Driver davinci_evm requests probe deferral
      [   13.592527] platform sound.3: really_probe: probe_count = 0
      
      In the log the machine driver enters it's probe at 12.719969 (this point it
      has been removed from the deferred lists). McASP driver already executing
      it's probing (since 12.615118).
      The machine driver tries to construct the sound card (12.950839) but did
      not found one of the components so it fails. After this McASP driver
      registers all the ASoC components (the machine driver still in it's probe
      function after it failed to construct the card) and the deferred work is
      prepared at 13.099026 (note that this time the machine driver is not in the
      lists so it is not going to be handled when the work is executing).
      Lastly the machine driver exit from it's probe and the core places it to
      the deferred list but there will be no other driver going to load and the
      deferred queue is not going to be kicked again - till we have external event
      like connecting USB stick, etc.
      
      The proposed solution is to try the deferred queue once more when the last
      driver is asking for deferring and we had drivers loaded while this last
      driver was probing.
      
      This way we can avoid drivers stuck in the deferred queue.
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      Reviewed-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
      Tested-by: NPeter Ujfalusi <peter.ujfalusi@ti.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Mark Brown <broonie@kernel.org>
      Cc: Stable <stable@vger.kernel.org> # v3.4+
      58b116bc
  28. 17 4月, 2014 1 次提交
  29. 08 11月, 2013 1 次提交