1. 07 11月, 2014 1 次提交
  2. 30 9月, 2014 1 次提交
  3. 22 9月, 2014 1 次提交
  4. 26 7月, 2014 1 次提交
  5. 12 7月, 2014 1 次提交
    • G
      platform_get_irq: Revert to platform_get_resource if of_irq_get fails · aff008ad
      Guenter Roeck 提交于
      Commits 9ec36caf (of/irq: do irq resolution in platform_get_irq)
      and ad69674e (of/irq: do irq resolution in platform_get_irq_byname)
      change the semantics of platform_get_irq and platform_get_irq_byname
      to always rely on devicetree information if devicetree is enabled
      and if a devicetree node is attached to the device. The functions
      now return an error if the devicetree data does not include interrupt
      information, even if the information is available as platform resource
      data.
      
      This causes mfd client drivers to fail if the interrupt number is
      passed via platform resources. Therefore, if of_irq_get fails, try
      platform_get_resource as method of last resort. This restores the
      original functionality for drivers depending on platform resources
      to get irq information.
      
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Tony Lindgren <tony@atomide.com>
      Cc: Grant Likely <grant.likely@linaro.org>
      Cc: Grygorii Strashko <grygorii.strashko@ti.com>
      Signed-off-by: NGuenter Roeck <linux@roeck-us.net>
      Acked-by: NRob Herring <robh@kernel.org>
      Cc: stable <stable@vger.kernel.org>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aff008ad
  6. 09 7月, 2014 2 次提交
    • K
      driver core: platform: add device binding path 'driver_override' · 3d713e0e
      Kim Phillips 提交于
      Needed by platform device drivers, such as the upcoming
      vfio-platform driver, in order to bypass the existing OF, ACPI,
      id_table and name string matches, and successfully be able to be
      bound to any device, like so:
      
      echo vfio-platform > /sys/bus/platform/devices/fff51000.ethernet/driver_override
      echo fff51000.ethernet > /sys/bus/platform/devices/fff51000.ethernet/driver/unbind
      echo fff51000.ethernet > /sys/bus/platform/drivers_probe
      
      This mimics "PCI: Introduce new device binding path using
      pci_dev.driver_override", which is an interface enhancement
      for more deterministic PCI device binding, e.g., when in the
      presence of hotplug.
      Reviewed-by: NAlex Williamson <alex.williamson@redhat.com>
      Reviewed-by: NAlexander Graf <agraf@suse.de>
      Reviewed-by: NStuart Yoder <stuart.yoder@freescale.com>
      Signed-off-by: NKim Phillips <kim.phillips@freescale.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      3d713e0e
    • Y
      driver core/platform: remove unused implicit padding in platform_object · 1cec24c5
      Yann Droneaud 提交于
      Up to 7 bytes are wasted at the end of struct platform_object
      in the form of padding after name field: unfortunately this
      padding is not used when allocating the memory to hold the
      name.
      
      This patch converts name array from name[1] to C99 flexible
      array name[] (equivalent to name[0]) so that no padding is
      required by the presence of this field. Memory allocation
      is updated to take care of allocating an additional byte for
      the NUL terminating character.
      
      Built on Fedora 20, using GCC 4.8, for ARM, i386, SPARC64 and
      x86_64 architectures, the data structure layout can be reported
      with following command:
      
        $ pahole drivers/base/platform.o \
                 --recursive             \
                 --class_name device,pdev_archdata,platform_device,platform_object
      
      Please find below some comparisons of structure layout for arm,
      i386, sparc64 and x86_64 architecture before and after the patch.
      
        --- obj-arm/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f	2014-05-30 10:32:06.290960701 +0200
        +++ obj-arm/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71	2014-05-30 11:26:20.851988347 +0200
        @@ -81,10 +81,9 @@
           /* XXX last struct has 4 bytes of padding */
      
        	/* --- cacheline 6 boundary (384 bytes) was 8 bytes ago --- */
        -	char                       name[1];              /*   392     1 */
        +	char                       name[0];              /*   392     0 */
      
        -	/* size: 400, cachelines: 7, members: 2 */
        -	/* padding: 7 */
        +	/* size: 392, cachelines: 7, members: 2 */
         	/* paddings: 1, sum paddings: 4 */
        -	/* last cacheline: 16 bytes */
        +	/* last cacheline: 8 bytes */
         };
      
        --- obj-i386/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f 2014-05-30 10:32:06.305960691 +0200
        +++ obj-i386/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 2014-05-30 11:26:20.875988332 +0200
        @@ -73,9 +73,8 @@
         struct platform_object {
         	struct platform_device     pdev;                 /*     0   396 */
         	/* --- cacheline 6 boundary (384 bytes) was 12 bytes ago --- */
        -	char                       name[1];              /*   396     1 */
        +	char                       name[0];              /*   396     0 */
      
        -	/* size: 400, cachelines: 7, members: 2 */
        -	/* padding: 3 */
        -	/* last cacheline: 16 bytes */
        +	/* size: 396, cachelines: 7, members: 2 */
        +	/* last cacheline: 12 bytes */
         };
      
        --- obj-sparc64/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f 2014-05-30 10:32:06.406960625 +0200
        +++ obj-sparc64/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 2014-05-30 11:26:20.971988269 +0200
        @@ -94,9 +94,8 @@
         struct platform_object {
         	struct platform_device     pdev;                 /*     0  2208 */
         	/* --- cacheline 34 boundary (2176 bytes) was 32 bytes ago --- */
        -	char                       name[1];              /*  2208     1 */
        +	char                       name[0];              /*  2208     0 */
      
        -	/* size: 2216, cachelines: 35, members: 2 */
        -	/* padding: 7 */
        -	/* last cacheline: 40 bytes */
        +	/* size: 2208, cachelines: 35, members: 2 */
        +	/* last cacheline: 32 bytes */
         };
      
        --- obj-x86_64/drivers/base/platform.o.pahole.v3.15-rc7-79-gfe45736f 2014-05-30 10:32:06.432960608 +0200
        +++ obj-x86_64/drivers/base/platform.o.pahole.v3.15-rc7-80-g2cdb06858d71 2014-05-30 11:26:21.000988250 +0200
        @@ -84,9 +84,8 @@
         struct platform_object {
         	struct platform_device     pdev;                 /*     0   720 */
         	/* --- cacheline 11 boundary (704 bytes) was 16 bytes ago --- */
        -	char                       name[1];              /*   720     1 */
        +	char                       name[0];              /*   720     0 */
      
        -	/* size: 728, cachelines: 12, members: 2 */
        -	/* padding: 7 */
        -	/* last cacheline: 24 bytes */
        +	/* size: 720, cachelines: 12, members: 2 */
        +	/* last cacheline: 16 bytes */
         };
      
      Changes from v5 [1]:
      - dropped dma_mask allocation changes and only kept padding
        removal changes (name array length set to 0).
      
      Changes from v4 [2]:
      [by Emil Goode <emilgoode@gmail.com>:]
      - Split v4 of the patch into two separate patches.
      - Generated new object file size and data structure layout info.
      - Updated the changelog message.
      
      Changes from v3 [3]:
      - fixed commit message so that git am doesn't fail.
      
      Changes from v2 [4]:
      - move 'dma_mask' to platform_object so that it's always
        allocated and won't leak on release; remove all previously
        added support functions.
      - use C99 flexible array member for 'name' to remove padding
        at the end of platform_object.
      
      Changes from v1 [5]:
      - remove unneeded kfree() from error path
      - add reference to author/commit adding allocation of dmamask
      
      Changes from v0 [6]:
      - small rewrite to squeeze the patch to a bare minimal
      
      [1] http://lkml.kernel.org/r/1401122483-31603-2-git-send-email-emilgoode@gmail.com
          http://lkml.kernel.org/r/1401122483-31603-1-git-send-email-emilgoode@gmail.com
          http://lkml.kernel.org/r/1401122483-31603-3-git-send-email-emilgoode@gmail.com
      
      [2] http://lkml.kernel.org/r/1390817152-30898-1-git-send-email-ydroneaud@opteya.com
          https://patchwork.kernel.org/patch/3541871/
      
      [3] http://lkml.kernel.org/r/1390771138-28348-1-git-send-email-ydroneaud@opteya.com
          https://patchwork.kernel.org/patch/3540081/
      
      [4] http://lkml.kernel.org/r/1389683909-17495-1-git-send-email-ydroneaud@opteya.com
          https://patchwork.kernel.org/patch/3484411/
      
      [5] http://lkml.kernel.org/r/1389649085-7365-1-git-send-email-ydroneaud@opteya.com
          https://patchwork.kernel.org/patch/3480961/
      
      [6] http://lkml.kernel.org/r/1386886207-2735-1-git-send-email-ydroneaud@opteya.com
      
      Cc: Emil Goode <emilgoode@gmail.com>
      Cc: Dan Carpenter <dan.carpenter@oracle.com>
      Cc: Shawn Guo <shawn.guo@freescale.com>
      Cc: Sascha Hauer <kernel@pengutronix.de>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Olof Johansson <olof@lixom.net>
      Cc: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: NYann Droneaud <ydroneaud@opteya.com>
      Acked-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      1cec24c5
  7. 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
  8. 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
  9. 15 2月, 2014 1 次提交
  10. 17 1月, 2014 2 次提交
  11. 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
  12. 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
  13. 24 8月, 2013 1 次提交
  14. 20 8月, 2013 1 次提交
  15. 17 7月, 2013 1 次提交
  16. 12 6月, 2013 1 次提交
  17. 04 6月, 2013 2 次提交
  18. 30 3月, 2013 2 次提交
  19. 27 11月, 2012 1 次提交
  20. 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
  21. 16 11月, 2012 1 次提交
  22. 15 11月, 2012 1 次提交
  23. 10 11月, 2012 1 次提交
  24. 31 10月, 2012 1 次提交
  25. 07 9月, 2012 1 次提交
  26. 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
  27. 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
  28. 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
  29. 22 12月, 2011 1 次提交
  30. 10 12月, 2011 1 次提交
  31. 27 8月, 2011 1 次提交
  32. 23 8月, 2011 1 次提交
  33. 09 8月, 2011 1 次提交
  34. 08 7月, 2011 1 次提交
  35. 08 6月, 2011 1 次提交
  36. 17 5月, 2011 1 次提交