<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/include/linux/device.h, branch v4.14.334</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.14.334</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v4.14.334'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2023-11-08T10:21:07Z</updated>
<entry>
<title>driver: platform: Add helper for safer setting of driver_override</title>
<updated>2023-11-08T10:21:07Z</updated>
<author>
<name>Krzysztof Kozlowski</name>
<email>krzysztof.kozlowski@linaro.org</email>
</author>
<published>2023-10-31T11:41:46Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e9a07a58533b8f1ee188e75f66cb11b3a16ee026'/>
<id>urn:sha1:e9a07a58533b8f1ee188e75f66cb11b3a16ee026</id>
<content type='text'>
commit 6c2f421174273de8f83cde4286d1c076d43a2d35 upstream.

Several core drivers and buses expect that driver_override is a
dynamically allocated memory thus later they can kfree() it.

However such assumption is not documented, there were in the past and
there are already users setting it to a string literal. This leads to
kfree() of static memory during device release (e.g. in error paths or
during unbind):

    kernel BUG at ../mm/slub.c:3960!
    Internal error: Oops - BUG: 0 [#1] PREEMPT SMP ARM
    ...
    (kfree) from [&lt;c058da50&gt;] (platform_device_release+0x88/0xb4)
    (platform_device_release) from [&lt;c0585be0&gt;] (device_release+0x2c/0x90)
    (device_release) from [&lt;c0a69050&gt;] (kobject_put+0xec/0x20c)
    (kobject_put) from [&lt;c0f2f120&gt;] (exynos5_clk_probe+0x154/0x18c)
    (exynos5_clk_probe) from [&lt;c058de70&gt;] (platform_drv_probe+0x6c/0xa4)
    (platform_drv_probe) from [&lt;c058b7ac&gt;] (really_probe+0x280/0x414)
    (really_probe) from [&lt;c058baf4&gt;] (driver_probe_device+0x78/0x1c4)
    (driver_probe_device) from [&lt;c0589854&gt;] (bus_for_each_drv+0x74/0xb8)
    (bus_for_each_drv) from [&lt;c058b48c&gt;] (__device_attach+0xd4/0x16c)
    (__device_attach) from [&lt;c058a638&gt;] (bus_probe_device+0x88/0x90)
    (bus_probe_device) from [&lt;c05871fc&gt;] (device_add+0x3dc/0x62c)
    (device_add) from [&lt;c075ff10&gt;] (of_platform_device_create_pdata+0x94/0xbc)
    (of_platform_device_create_pdata) from [&lt;c07600ec&gt;] (of_platform_bus_create+0x1a8/0x4fc)
    (of_platform_bus_create) from [&lt;c0760150&gt;] (of_platform_bus_create+0x20c/0x4fc)
    (of_platform_bus_create) from [&lt;c07605f0&gt;] (of_platform_populate+0x84/0x118)
    (of_platform_populate) from [&lt;c0f3c964&gt;] (of_platform_default_populate_init+0xa0/0xb8)
    (of_platform_default_populate_init) from [&lt;c01031f8&gt;] (do_one_initcall+0x8c/0x404)

Provide a helper which clearly documents the usage of driver_override.
This will allow later to reuse the helper and reduce the amount of
duplicated code.

Convert the platform driver to use a new helper and make the
driver_override field const char (it is not modified by the core).

Reviewed-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Acked-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
Signed-off-by: Krzysztof Kozlowski &lt;krzysztof.kozlowski@linaro.org&gt;
Link: https://lore.kernel.org/r/20220419113435.246203-2-krzysztof.kozlowski@linaro.org
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Lee Jones &lt;lee@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>PCI/MSI: Protect msi_desc::masked for multi-MSI</title>
<updated>2021-08-26T12:37:04Z</updated>
<author>
<name>Thomas Gleixner</name>
<email>tglx@linutronix.de</email>
</author>
<published>2021-07-29T21:51:47Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=dd3df556f9cbb60e968b74dd6d33196ff9e2092a'/>
<id>urn:sha1:dd3df556f9cbb60e968b74dd6d33196ff9e2092a</id>
<content type='text'>
commit 77e89afc25f30abd56e76a809ee2884d7c1b63ce upstream.

Multi-MSI uses a single MSI descriptor and there is a single mask register
when the device supports per vector masking. To avoid reading back the mask
register the value is cached in the MSI descriptor and updates are done by
clearing and setting bits in the cache and writing it to the device.

But nothing protects msi_desc::masked and the mask register from being
modified concurrently on two different CPUs for two different Linux
interrupts which belong to the same multi-MSI descriptor.

Add a lock to struct device and protect any operation on the mask and the
mask register with it.

This makes the update of msi_desc::masked unconditional, but there is no
place which requires a modification of the hardware register without
updating the masked cache.

msi_mask_irq() is now an empty wrapper which will be cleaned up in follow
up changes.

The problem goes way back to the initial support of multi-MSI, but picking
the commit which introduced the mask cache is a valid cut off point
(2.6.30).

Fixes: f2440d9acbe8 ("PCI MSI: Refactor interrupt masking code")
Signed-off-by: Thomas Gleixner &lt;tglx@linutronix.de&gt;
Tested-by: Marc Zyngier &lt;maz@kernel.org&gt;
Reviewed-by: Marc Zyngier &lt;maz@kernel.org&gt;
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/20210729222542.726833414@linutronix.de
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>devres: allow const resource arguments</title>
<updated>2020-01-27T13:46:39Z</updated>
<author>
<name>Arnd Bergmann</name>
<email>arnd@arndb.de</email>
</author>
<published>2019-06-28T14:59:45Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=97464364e3e1642315a9f194258b50e6781be139'/>
<id>urn:sha1:97464364e3e1642315a9f194258b50e6781be139</id>
<content type='text'>
[ Upstream commit 9dea44c91469512d346e638694c22c30a5273992 ]

devm_ioremap_resource() does not currently take 'const' arguments,
which results in a warning from the first driver trying to do it
anyway:

drivers/gpio/gpio-amd-fch.c: In function 'amd_fch_gpio_probe':
drivers/gpio/gpio-amd-fch.c:171:49: error: passing argument 2 of 'devm_ioremap_resource' discards 'const' qualifier from pointer target type [-Werror=discarded-qualifiers]
  priv-&gt;base = devm_ioremap_resource(&amp;pdev-&gt;dev, &amp;amd_fch_gpio_iores);
                                                 ^~~~~~~~~~~~~~~~~~~

Change the prototype to allow it, as there is no real reason not to.

Fixes: 9bb2e0452508 ("gpio: amd: Make resource struct const")
Signed-off-by: Arnd Bergmann &lt;arnd@arndb.de&gt;
Link: https://lore.kernel.org/r/20190628150049.1108048-1-arnd@arndb.de
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Reviwed-By: Enrico Weigelt &lt;info@metux.net&gt;
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
Signed-off-by: Sasha Levin &lt;sashal@kernel.org&gt;
</content>
</entry>
<entry>
<title>Merge tag 'driver-core-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core</title>
<updated>2017-10-03T15:57:07Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2017-10-03T15:57:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=c4142ed6029f06ab3a13bec1b07eaa01221772fc'/>
<id>urn:sha1:c4142ed6029f06ab3a13bec1b07eaa01221772fc</id>
<content type='text'>
Pull driver core fixes from Greg KH:
 "Here are a few small fixes for 4.14-rc4.

  The removal of DRIVER_ATTR() was almost completed by 4.14-rc1, but one
  straggler made it in through some other tree (odds are, one of
  mine...) So there's a simple removal of the last user, and then
  finally the macro is removed from the tree.

  There's a fix for old crazy udev instances that insist on reloading a
  module when it is removed from the kernel due to the new uevents for
  bind/unbind. This fixes the reported regression, hopefully some year
  in the future we can drop the workaround, once users update to the
  latest version, but I'm not holding my breath.

  And then there's a build fix for a linker warning, and a buffer
  overflow fix to match the PCI fixes you took through the PCI tree in
  the same area.

  All of these have been in linux-next for a few weeks while I've been
  traveling, sorry for the delay"

* tag 'driver-core-4.14-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  driver core: remove DRIVER_ATTR
  fpga: altera-cvp: remove DRIVER_ATTR() usage
  driver core: platform: Don't read past the end of "driver_override" buffer
  base: arch_topology: fix section mismatch build warnings
  driver core: suppress sending MODALIAS in UNBIND uevents
</content>
</entry>
<entry>
<title>driver core: remove DRIVER_ATTR</title>
<updated>2017-09-19T07:20:33Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-09-18T10:17:57Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=850fdec8d2fd1eebfa003fea39bec08cd69b6155'/>
<id>urn:sha1:850fdec8d2fd1eebfa003fea39bec08cd69b6155</id>
<content type='text'>
DRIVER_ATTR is no longer in use, and driver authors should be using
DRIVER_ATTR_RW() or DRIVER_ATTR_RO() or DRIVER_ATTR_WO() instead in
order to always get the permissions correct.  So remove it so that no
one can use it anymore.

Acked-by: Alan Tull &lt;atull@kernel.org&gt;
Reviewed-by: Moritz Fischer &lt;mdf@kernel.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Fix link to device power management documentation</title>
<updated>2017-09-18T11:22:30Z</updated>
<author>
<name>Geert Uytterhoeven</name>
<email>geert+renesas@glider.be</email>
</author>
<published>2017-09-05T18:16:27Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=74378c5c8cdaf0ce9f65e67cbd0613286f2c3bad'/>
<id>urn:sha1:74378c5c8cdaf0ce9f65e67cbd0613286f2c3bad</id>
<content type='text'>
Correct location as of commit 2728b2d2e5be4b82 (PM / core / docs:
Convert sleep states API document to reST).

Fixes: 2728b2d2e5be4b82 (PM / core / docs: Convert sleep states API document to reST)
Signed-off-by: Geert Uytterhoeven &lt;geert+renesas@glider.be&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
</entry>
<entry>
<title>Do not disable driver and bus shutdown hook when class shutdown hook is set.</title>
<updated>2017-08-28T16:02:46Z</updated>
<author>
<name>Michal Suchanek</name>
<email>msuchanek@suse.de</email>
</author>
<published>2017-08-11T13:44:43Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=7521621e600aeefe5ffcc1f90ae26a42fc20c452'/>
<id>urn:sha1:7521621e600aeefe5ffcc1f90ae26a42fc20c452</id>
<content type='text'>
As seen from the implementation of the single class shutdown hook this
is not very sound design.

Rename the class shutdown hook to shutdown_pre to make it clear it runs
before the driver shutdown hook.

Signed-off-by: Michal Suchanek &lt;msuchanek@suse.de&gt;
Reviewed-by: Jarkko Sakkinen &lt;jarkko.sakkinen@linux.intel.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: Document struct device:dma_ops</title>
<updated>2017-08-28T14:38:27Z</updated>
<author>
<name>Jonathan Corbet</name>
<email>corbet@lwn.net</email>
</author>
<published>2017-08-24T22:09:10Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=6a7a81761bee2a6694c0a5fb1a16b263c96241c1'/>
<id>urn:sha1:6a7a81761bee2a6694c0a5fb1a16b263c96241c1</id>
<content type='text'>
Commit 5657933dbb6e (treewide: Move dma_ops from struct dev_archdata into
struct device) added the dma_ops field to struct device, but did not
update the kerneldoc comment, yielding this warning:

  ./include/linux/device.h:969: warning: No description found for parameter 'dma_ops'

Add a description and bring a little peace to the world.

Signed-off-by: Jonathan Corbet &lt;corbet@lwn.net&gt;
Reviewed-by: Bart Van Assche &lt;bart.vanassche@wdc.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>Merge 4.13-rc5 into driver-core-next</title>
<updated>2017-08-14T20:33:39Z</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2017-08-14T20:33:39Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=f75f6ff2eaa626d32dd3225e3008f807741ad1c5'/>
<id>urn:sha1:f75f6ff2eaa626d32dd3225e3008f807741ad1c5</id>
<content type='text'>
We want the fixes in here as well for testing.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>pinctrl: generic: update references to Documentation/pinctrl.txt</title>
<updated>2017-08-07T13:26:34Z</updated>
<author>
<name>Ludovic Desroches</name>
<email>ludovic.desroches@o2linux.fr</email>
</author>
<published>2017-08-06T14:00:05Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=0cca6c8920ade95e2741b2062cf1397dc546fb0f'/>
<id>urn:sha1:0cca6c8920ade95e2741b2062cf1397dc546fb0f</id>
<content type='text'>
Update deprecated references to Documentation/pinctrl.txt since it has been
moved to Documentation/driver-api/pinctl.rst.

Signed-off-by: Ludovic Desroches &lt;ludovic.desroches@o2linux.fr&gt;
Fixes: 5a9b73832e9e ("pinctrl.txt: move it to the driver-api book")
Signed-off-by: Linus Walleij &lt;linus.walleij@linaro.org&gt;
</content>
</entry>
</feed>
