1. 26 7月, 2014 1 次提交
  2. 23 5月, 2014 1 次提交
    • G
      of/irq: do irq resolution in platform_get_irq_byname() · ad69674e
      Grygorii Strashko 提交于
      The commit 9ec36caf
      "of/irq: do irq resolution in platform_get_irq" from Rob Herring -
      moves resolving of the interrupt resources in platform_get_irq().
      But this solution isn't complete because platform_get_irq_byname()
      need to be modified the same way.
      
      Hence, fix it by adding interrupt resolution code at the
      platform_get_irq_byname() function too.
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Rob Herring <robh@kernel.org>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Thierry Reding <thierry.reding@gmail.com>
      Signed-off-by: NGrygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      ad69674e
  3. 25 4月, 2014 1 次提交
    • R
      of/irq: do irq resolution in platform_get_irq · 9ec36caf
      Rob Herring 提交于
      Currently we get the following kind of errors if we try to use interrupt
      phandles to irqchips that have not yet initialized:
      
      irq: no irq domain found for /ocp/pinmux@48002030 !
      ------------[ cut here ]------------
      WARNING: CPU: 0 PID: 1 at drivers/of/platform.c:171 of_device_alloc+0x144/0x184()
      Modules linked in:
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.12.0-00038-g42a9708 #1012
      (show_stack+0x14/0x1c)
      (dump_stack+0x6c/0xa0)
      (warn_slowpath_common+0x64/0x84)
      (warn_slowpath_null+0x1c/0x24)
      (of_device_alloc+0x144/0x184)
      (of_platform_device_create_pdata+0x44/0x9c)
      (of_platform_bus_create+0xd0/0x170)
      (of_platform_bus_create+0x12c/0x170)
      (of_platform_populate+0x60/0x98)
      
      This is because we're wrongly trying to populate resources that are not
      yet available. It's perfectly valid to create irqchips dynamically, so
      let's fix up the issue by resolving the interrupt resources when
      platform_get_irq is called.
      
      And then we also need to accept the fact that some irqdomains do not
      exist that early on, and only get initialized later on. So we can
      make the current WARN_ON into just into a pr_debug().
      
      We still attempt to populate irq resources when we create the devices.
      This allows current drivers which don't use platform_get_irq to continue
      to function. Once all drivers are fixed, this code can be removed.
      Suggested-by: NRussell King <linux@arm.linux.org.uk>
      Signed-off-by: NRob Herring <robh@kernel.org>
      Signed-off-by: NTony Lindgren <tony@atomide.com>
      Tested-by: NTony Lindgren <tony@atomide.com>
      Cc: stable@vger.kernel.org # v3.10+
      Signed-off-by: NGrant Likely <grant.likely@linaro.org>
      9ec36caf
  4. 15 2月, 2014 1 次提交
  5. 17 1月, 2014 2 次提交
  6. 15 11月, 2013 1 次提交
    • R
      ACPI / driver core: Store an ACPI device pointer in struct acpi_dev_node · 7b199811
      Rafael J. Wysocki 提交于
      Modify struct acpi_dev_node to contain a pointer to struct acpi_device
      associated with the given device object (that is, its ACPI companion
      device) instead of an ACPI handle corresponding to it.  Introduce two
      new macros for manipulating that pointer in a CONFIG_ACPI-safe way,
      ACPI_COMPANION() and ACPI_COMPANION_SET(), and rework the
      ACPI_HANDLE() macro to take the above changes into account.
      Drop the ACPI_HANDLE_SET() macro entirely and rework its users to
      use ACPI_COMPANION_SET() instead.  For some of them who used to
      pass the result of acpi_get_child() directly to ACPI_HANDLE_SET()
      introduce a helper routine acpi_preset_companion() doing an
      equivalent thing.
      
      The main motivation for doing this is that there are things
      represented by struct acpi_device objects that don't have valid
      ACPI handles (so called fixed ACPI hardware features, such as
      power and sleep buttons) and we would like to create platform
      device objects for them and "glue" them to their ACPI companions
      in the usual way (which currently is impossible due to the
      lack of valid ACPI handles).  However, there are more reasons
      why it may be useful.
      
      First, struct acpi_device pointers allow of much better type checking
      than void pointers which are ACPI handles, so it should be more
      difficult to write buggy code using modified struct acpi_dev_node
      and the new macros.  Second, the change should help to reduce (over
      time) the number of places in which the result of ACPI_HANDLE() is
      passed to acpi_bus_get_device() in order to obtain a pointer to the
      struct acpi_device associated with the given "physical" device,
      because now that pointer is returned by ACPI_COMPANION() directly.
      Finally, the change should make it easier to write generic code that
      will build both for CONFIG_ACPI set and unset without adding explicit
      compiler directives to it.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Tested-by: Mika Westerberg <mika.westerberg@linux.intel.com> # on Haswell
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Reviewed-by: Aaron Lu <aaron.lu@intel.com> # for ATA and SDIO part
      7b199811
  7. 27 9月, 2013 1 次提交
    • J
      driver core: prevent deferred probe with platform_driver_probe · 3f9120b0
      Johan Hovold 提交于
      Prevent drivers relying on platform_driver_probe from requesting
      deferred probing in order to avoid further futile probe attempts (either
      the driver has been unregistered or its probe function has been set to
      platform_drv_probe_fail when probing is retried).
      
      Note that several platform drivers currently return subsystem errors
      from probe and that these can include -EPROBE_DEFER (e.g. if a gpio
      request fails).
      
      Add a warning to platform_drv_probe that can be used to catch drivers
      that inadvertently request probe deferral while using
      platform_driver_probe.
      Signed-off-by: NJohan Hovold <jhovold@gmail.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3f9120b0
  8. 24 8月, 2013 1 次提交
  9. 20 8月, 2013 1 次提交
  10. 17 7月, 2013 1 次提交
  11. 12 6月, 2013 1 次提交
  12. 04 6月, 2013 2 次提交
  13. 30 3月, 2013 2 次提交
  14. 27 11月, 2012 1 次提交
  15. 21 11月, 2012 1 次提交
    • R
      ACPI / platform: Initialize ACPI handles of platform devices in advance · 863f9f30
      Rafael J. Wysocki 提交于
      The current platform device creation and registration code in
      acpi_create_platform_device() is quite convoluted.  This function
      takes an ACPI device node as an argument and eventually calls
      platform_device_register_resndata() to create and register a
      platform device object on the basis of the information contained
      in that code.  However, it doesn't associate the new platform
      device with the ACPI node directly, but instead it relies on
      acpi_platform_notify(), called from within device_add(), to find
      that ACPI node again with the help of acpi_platform_find_device()
      and acpi_platform_match() and then attach the new platform device
      to it.  This causes an additional ACPI namespace walk to happen and
      is clearly suboptimal.
      
      Use the observation that it is now possible to initialize the ACPI
      handle of a device before calling device_add() for it to make this
      code more straightforward.  Namely, add a new field to struct
      platform_device_info allowing us to pass the ACPI handle of interest
      to platform_device_register_full(), which will then use it to
      initialize the new device's ACPI handle before registering it.
      This will cause acpi_platform_notify() to use the ACPI handle from
      the device structure directly instead of using the .find_device()
      routine provided by the device's bus type.  In consequence,
      acpi_platform_bus, acpi_platform_find_device(), and
      acpi_platform_match() are not necessary any more, so remove them.
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      Reviewed-by: NMika Westerberg <mika.westerberg@linux.intel.com>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      863f9f30
  16. 16 11月, 2012 1 次提交
  17. 15 11月, 2012 1 次提交
  18. 10 11月, 2012 1 次提交
  19. 31 10月, 2012 1 次提交
  20. 07 9月, 2012 1 次提交
  21. 04 9月, 2012 1 次提交
    • R
      PM / Runtime: Allow helpers to be called by early platform drivers · bed2b42d
      Rafael J. Wysocki 提交于
      Runtime PM helper functions, like pm_runtime_get_sync(), cannot be
      called by early platform device drivers, because the devices' power
      management locks are not initialized at that time.  This is quite
      inconvenient, so modify early_platform_add_devices() to initialize
      the devices power management locks as appropriate and make sure that
      they won't be initialized more than once if an early platform
      device is going to be used as a regular one later.
      Signed-off-by: NRafael J. Wysocki <rjw@sisk.pl>
      bed2b42d
  22. 17 8月, 2012 1 次提交
    • J
      platform: Add support for automatic device IDs · 689ae231
      Jean Delvare 提交于
      Right now we have support for explicit platform device IDs, as well as
      ID-less platform devices when a given device type can only have one
      instance. However there are cases where multiple instances of a device
      type can exist, and their IDs aren't (and can't be) known in advance
      and do not matter. In that case we need automatic device IDs to avoid
      device name collisions.
      
      I am using magic ID value -2 (PLATFORM_DEVID_AUTO) for this, similar
      to -1 for ID-less devices. The automatically allocated device IDs are
      global (to avoid an additional per-driver cost.) We keep note that the
      ID was automatically allocated so that it can be freed later.
      
      Note that we also restore the ID to PLATFORM_DEVID_AUTO on error and
      device deletion, to avoid avoid unexpected behavior on retry. I don't
      really expect retries on platform device addition, but better safe
      than sorry.
      Signed-off-by: NJean Delvare <khali@linux-fr.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      689ae231
  23. 02 2月, 2012 1 次提交
    • G
      drivercore: Output common devicetree information in uevent · 07d57a32
      Grant Likely 提交于
      When userspace needs to find a specific device, it currently isn't easy to
      resolve a /sys/devices/ path from a specific device tree node.  Nor is it
      easy to obtain the compatible list for devices.
      
      This patch generalizes the code that inserts OF_* values into the uevent
      device attribute so that any device that is attached to an OF node will
      have that information exported to userspace.  Without this patch only
      platform devices and some powerpc-specific busses have access to this
      data.
      
      The original function also creates a MODALIAS property for the compatible
      list, but that code has not been generalized into the common case because
      it has the potential to break module loading on a lot of bus types.  Bus
      types are still responsible for their own MODALIAS properties.
      
      Boot tested on ARM and compile tested on PowerPC and SPARC.
      Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
      Acked-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      Cc: Tobias Klauser <tklauser@distanz.ch>
      Cc: Frederic Lambert <frdrc66@gmail.com>
      Cc: Rob Herring <rob.herring@calxeda.com>
      Cc: Mark Brown <broonie@sirena.org.uk>
      Cc: "David S. Miller" <davem@davemloft.net>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      07d57a32
  24. 22 12月, 2011 1 次提交
  25. 10 12月, 2011 1 次提交
  26. 27 8月, 2011 1 次提交
  27. 23 8月, 2011 1 次提交
  28. 09 8月, 2011 1 次提交
  29. 08 7月, 2011 1 次提交
  30. 08 6月, 2011 1 次提交
  31. 17 5月, 2011 1 次提交
  32. 29 4月, 2011 2 次提交
  33. 23 4月, 2011 4 次提交