<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/platform.c, branch v5.3</title>
<subtitle>Mirror of https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/
</subtitle>
<id>https://git.shady.money/linux/atom?h=v5.3</id>
<link rel='self' href='https://git.shady.money/linux/atom?h=v5.3'/>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/'/>
<updated>2019-07-30T11:46:15Z</updated>
<entry>
<title>driver core: platform: return -ENXIO for missing GpioInt</title>
<updated>2019-07-30T11:46:15Z</updated>
<author>
<name>Brian Norris</name>
<email>briannorris@chromium.org</email>
</author>
<published>2019-07-29T20:49:54Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=46c42d844211ef5902e32aa507beac0817c585e9'/>
<id>urn:sha1:46c42d844211ef5902e32aa507beac0817c585e9</id>
<content type='text'>
Commit daaef255dc96 ("driver: platform: Support parsing GpioInt 0 in
platform_get_irq()") broke the Embedded Controller driver on most LPC
Chromebooks (i.e., most x86 Chromebooks), because cros_ec_lpc expects
platform_get_irq() to return -ENXIO for non-existent IRQs.
Unfortunately, acpi_dev_gpio_irq_get() doesn't follow this convention
and returns -ENOENT instead. So we get this error from cros_ec_lpc:

   couldn't retrieve IRQ number (-2)

I see a variety of drivers that treat -ENXIO specially, so rather than
fix all of them, let's fix up the API to restore its previous behavior.

I reported this on v2 of this patch:

https://lore.kernel.org/lkml/20190220180538.GA42642@google.com/

but apparently the patch had already been merged before v3 got sent out:

https://lore.kernel.org/lkml/20190221193429.161300-1-egranata@chromium.org/

and the result is that the bug landed and remains unfixed.

I differ from the v3 patch by:
 * allowing for ret==0, even though acpi_dev_gpio_irq_get() specifically
   documents (and enforces) that 0 is not a valid return value (noted on
   the v3 review)
 * adding a small comment

Reported-by: Brian Norris &lt;briannorris@chromium.org&gt;
Reported-by: Salvatore Bellizzi &lt;salvatore.bellizzi@linux.seppia.net&gt;
Cc: Enrico Granata &lt;egranata@chromium.org&gt;
Cc: &lt;stable@vger.kernel.org&gt;
Fixes: daaef255dc96 ("driver: platform: Support parsing GpioInt 0 in platform_get_irq()")
Signed-off-by: Brian Norris &lt;briannorris@chromium.org&gt;
Reviewed-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Acked-by: Enrico Granata &lt;egranata@google.com&gt;
Link: https://lore.kernel.org/r/20190729204954.25510-1-briannorris@chromium.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>docs: driver-model: move it to the driver-api book</title>
<updated>2019-07-15T14:03:02Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+samsung@kernel.org</email>
</author>
<published>2019-06-18T15:34:59Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=fe34c89d25429e079ba67416529514120dd715f8'/>
<id>urn:sha1:fe34c89d25429e079ba67416529514120dd715f8</id>
<content type='text'>
The audience for the Kernel driver-model is clearly Kernel hackers.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Acked-by: Jeff Kirsher &lt;jeffrey.t.kirsher@intel.com&gt; # ice driver changes
</content>
</entry>
<entry>
<title>docs: driver-model: convert docs to ReST and rename to *.rst</title>
<updated>2019-06-21T13:47:26Z</updated>
<author>
<name>Mauro Carvalho Chehab</name>
<email>mchehab+samsung@kernel.org</email>
</author>
<published>2019-06-18T20:53:27Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=4489f161b739f01ab60a58784f6ef7de9d7a1352'/>
<id>urn:sha1:4489f161b739f01ab60a58784f6ef7de9d7a1352</id>
<content type='text'>
Convert the various documents at the driver-model, preparing
them to be part of the driver-api book.

The conversion is actually:
  - add blank lines and identation in order to identify paragraphs;
  - fix tables markups;
  - add some lists markups;
  - mark literal blocks;
  - adjust title markups.

At its new index.rst, let's add a :orphan: while this is not linked to
the main index.rst file, in order to avoid build warnings.

Signed-off-by: Mauro Carvalho Chehab &lt;mchehab+samsung@kernel.org&gt;
Acked-by: Jeff Kirsher &lt;jeffrey.t.kirsher@intel.com&gt; # ice
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Revert "driver core: platform: Fix the usage of platform device name(pdev-&gt;name)"</title>
<updated>2019-04-29T17:49:21Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2019-04-29T17:49:21Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=391c0325cc5f9e2daf9117825714d777b3595a42'/>
<id>urn:sha1:391c0325cc5f9e2daf9117825714d777b3595a42</id>
<content type='text'>
This reverts commit edb16da34b084c66763f29bee42b4e6bb33c3d66 as it
breaks existing systems as reported by Krzysztof.

Reported-by: Krzysztof Kozlowski &lt;krzk@kernel.org&gt;
Cc: Venkata Narendra Kumar Gutta &lt;vnkgutta@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: platform: Fix the usage of platform device name(pdev-&gt;name)</title>
<updated>2019-04-25T20:22:12Z</updated>
<author>
<name>Venkata Narendra Kumar Gutta</name>
<email>vnkgutta@codeaurora.org</email>
</author>
<published>2019-04-23T00:16:29Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=edb16da34b084c66763f29bee42b4e6bb33c3d66'/>
<id>urn:sha1:edb16da34b084c66763f29bee42b4e6bb33c3d66</id>
<content type='text'>
Platform core is using pdev-&gt;name as the platform device name to do
the binding of the devices with the drivers. But, when the platform
driver overrides the platform device name with dev_set_name(),
the pdev-&gt;name is pointing to a location which is freed and becomes
an invalid parameter to do the binding match.

use-after-free instance:

[   33.325013] BUG: KASAN: use-after-free in strcmp+0x8c/0xb0
[   33.330646] Read of size 1 at addr ffffffc10beae600 by task modprobe
[   33.339068] CPU: 5 PID: 518 Comm: modprobe Tainted:
			G S      W  O      4.19.30+ #3
[   33.346835] Hardware name: MTP (DT)
[   33.350419] Call trace:
[   33.352941]  dump_backtrace+0x0/0x3b8
[   33.356713]  show_stack+0x24/0x30
[   33.360119]  dump_stack+0x160/0x1d8
[   33.363709]  print_address_description+0x84/0x2e0
[   33.368549]  kasan_report+0x26c/0x2d0
[   33.372322]  __asan_report_load1_noabort+0x2c/0x38
[   33.377248]  strcmp+0x8c/0xb0
[   33.380306]  platform_match+0x70/0x1f8
[   33.384168]  __driver_attach+0x78/0x3a0
[   33.388111]  bus_for_each_dev+0x13c/0x1b8
[   33.392237]  driver_attach+0x4c/0x58
[   33.395910]  bus_add_driver+0x350/0x560
[   33.399854]  driver_register+0x23c/0x328
[   33.403886]  __platform_driver_register+0xd0/0xe0

So, use dev_name(&amp;pdev-&gt;dev), which fetches the platform device name from
the kobject(dev-&gt;kobj-&gt;name) of the device instead of the pdev-&gt;name.

Signed-off-by: Venkata Narendra Kumar Gutta &lt;vnkgutta@codeaurora.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: platform: Propagate error from insert_resource()</title>
<updated>2019-04-25T19:48:37Z</updated>
<author>
<name>Andy Shevchenko</name>
<email>andriy.shevchenko@linux.intel.com</email>
</author>
<published>2019-04-04T08:11:58Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=25ebcb7dc84db59514b7409ad009d8d67833e091'/>
<id>urn:sha1:25ebcb7dc84db59514b7409ad009d8d67833e091</id>
<content type='text'>
Since insert_resource() might return an error we don't need
to shadow its error code and would safely propagate to the user.

Signed-off-by: Andy Shevchenko &lt;andriy.shevchenko@linux.intel.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>drivers: fix a typo in the kernel doc for devm_platform_ioremap_resource()</title>
<updated>2019-04-25T17:49:17Z</updated>
<author>
<name>Bartosz Golaszewski</name>
<email>bgolaszewski@baylibre.com</email>
</author>
<published>2019-04-01T08:16:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=7067c96ee8d2d77039aeb49670acfe160f484ef9'/>
<id>urn:sha1:7067c96ee8d2d77039aeb49670acfe160f484ef9</id>
<content type='text'>
It should have been 'management' not 'managemend'.

Fixes: 7945f929f1a7 ("drivers: provide devm_platform_ioremap_resource()")
Signed-off-by: Bartosz Golaszewski &lt;bgolaszewski@baylibre.com&gt;
Reviewed-by: Mukesh Ojha &lt;mojha@codeaurora.org&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'gpio-v5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio</title>
<updated>2019-03-08T18:09:53Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2019-03-08T18:09:53Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=3601fe43e8164f67a8de3de8e988bfcb3a94af46'/>
<id>urn:sha1:3601fe43e8164f67a8de3de8e988bfcb3a94af46</id>
<content type='text'>
Pull GPIO updates from Linus Walleij:
 "This is the bulk of GPIO changes for the v5.1 cycle:

  Core changes:

   - The big change this time around is the irqchip handling in the
     qualcomm pin controllers, closely coupled with the gpiochip. This
     rework, in a classic fall-between-the-chairs fashion has been
     sidestepped for too long.

     The Qualcomm IRQchips using the SPMI and SSBI transport mechanisms
     have been rewritten to use hierarchical irqchip. This creates the
     base from which I intend to gradually pull support for hierarchical
     irqchips into the gpiolib irqchip helpers to cut down on duplicate
     code.

     We have too many hacks in the kernel because people have been
     working around the missing hierarchical irqchip for years, and once
     it was there, noone understood it for a while. We are now slowly
     adapting to using it.

     This is why this pull requests include changes to MFD, SPMI,
     IRQchip core and some ARM Device Trees pertaining to the Qualcomm
     chip family. Since Qualcomm have so many chips and such large
     deployments it is paramount that this platform gets this right, and
     now it (hopefully) does.

   - Core support for pull-up and pull-down configuration, also from the
     device tree. When a simple GPIO chip supports an "off or on" pull-up
     or pull-down resistor, we provide a way to set this up using
     machine descriptors or device tree.

     If more elaborate control of pull up/down (such as resistance shunt
     setting) is required, drivers should be phased over to use pin
     control. We do not yet provide a userspace ABI for this pull
     up-down setting but I suspect the makers are going to ask for it
     soon enough. PCA953x is the first user of this new API.

   - The GPIO mockup driver has been revamped after some discussion
     improving the IRQ simulator in the process.

     The idea is to make it possible to use the mockup for both testing
     and virtual prototyping, e.g. when you do not yet have a GPIO
     expander to play with but really want to get something to develop
     code around before hardware is available. It's neat. The blackbox
     testing usecase is currently making its way into kernelci.

   - ACPI GPIO core preserves non direction flags when updating flags.

   - A new device core helper for devm_platform_ioremap_resource() is
     funneled through the GPIO tree with Greg's ACK.

  New drivers:

   - TQ-Systems QTMX86 GPIO controllers (using port-mapped I/O)

   - Gateworks PLD GPIO driver (vaccumed up from OpenWrt)

   - AMD G-Series PCH (Platform Controller Hub) GPIO driver.

   - Fintek F81804 &amp; F81966 subvariants.

   - PCA953x now supports NXP PCAL6416.

  Driver improvements:

   - IRQ support on the Nintendo Wii (Hollywood) GPIO.

   - get_direction() support for the MVEBU driver.

   - Set the right output level on SAMA5D2.

   - Drop the unused irq trigger setting on the Spreadtrum driver.

   - Wakeup support for PCA953x.

   - A slew of cleanups in the various Intel drivers"

* tag 'gpio-v5.1-1' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-gpio: (110 commits)
  gpio: gpio-omap: fix level interrupt idling
  gpio: amd-fch: Set proper output level for direction_output
  x86: apuv2: remove unused variable
  gpio: pca953x: Use PCA_LATCH_INT
  platform/x86: fix PCENGINES_APU2 Kconfig warning
  gpio: pca953x: Fix dereference of irq data in shutdown
  gpio: amd-fch: Fix type error found by sparse
  gpio: amd-fch: Drop const from resource
  gpio: mxc: add check to return defer probe if clock tree NOT ready
  gpio: ftgpio: Register per-instance irqchip
  gpio: ixp4xx: Add DT bindings
  x86: pcengines apuv2 gpio/leds/keys platform driver
  gpio: AMD G-Series PCH gpio driver
  drivers: depend on HAS_IOMEM for devm_platform_ioremap_resource()
  gpio: tqmx86: Set proper output level for direction_output
  gpio: sprd: Change to use SoC compatible string
  gpio: sprd: Use SoC compatible string instead of wildcard string
  gpio: of: Handle both enable-gpio{,s}
  gpio: of: Restrict enable-gpio quirk to regulator-gpio
  gpio: davinci: use devm_platform_ioremap_resource()
  ...
</content>
</entry>
<entry>
<title>driver core: platform: remove misleading err_alloc label</title>
<updated>2019-03-01T17:08:06Z</updated>
<author>
<name>Johannes Berg</name>
<email>johannes.berg@intel.com</email>
</author>
<published>2019-03-01T12:24:47Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=36cf3b1363f464c40f6ce647d3ac0ae9617d5fbc'/>
<id>urn:sha1:36cf3b1363f464c40f6ce647d3ac0ae9617d5fbc</id>
<content type='text'>
In platform_device_register_full() the err_alloc label is
misleading, we only ever jump to it if the pdev is NULL,
but it then proceeds to free it, which is a no-op.

Remove the label and simply exit the function immediately.

Signed-off-by: Johannes Berg &lt;johannes.berg@intel.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>platform: set of_node in platform_device_register_full()</title>
<updated>2019-02-26T11:58:10Z</updated>
<author>
<name>Mans Rullgard</name>
<email>mans@mansr.com</email>
</author>
<published>2019-02-21T11:29:35Z</published>
<link rel='alternate' type='text/html' href='https://git.shady.money/linux/commit/?id=2c1ea6abde8884208a9b94254740ae4597c62000'/>
<id>urn:sha1:2c1ea6abde8884208a9b94254740ae4597c62000</id>
<content type='text'>
If the provided fwnode is an OF node, set dev.of_node as well.

Also add an of_node_reused flag to struct platform_device_info and copy
this to the new device.  This is needed to avoid pinctrl settings being
requested twice.  See 4e75e1d7dac9 ("driver core: add helper to reuse a
device-tree node") for a longer explanation.

Some drivers are just shims that create extra "glue" devices with the
DT device as parent and have the real driver bind to these.  In these
cases, the glue device needs to get a reference to the original DT node
in order for the main driver to access properties and child nodes.

For example, the sunxi-musb driver creates such a glue device using
platform_device_register_full().  Consequently, devices attached to
this USB interface don't get associated with DT nodes, if present,
the way they do with EHCI.

This change will allow sunxi-musb and similar drivers to easily
propagate the DT node to child devices as required.

Signed-off-by: Mans Rullgard &lt;mans@mansr.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
</feed>
