<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/base/core.c, branch v5.9-rc5</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge tag 'driver-core-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core</title>
<updated>2020-09-13T16:02:59+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-09-13T16:02:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=20a7b6be0514334a30a4306331a4bcf6f78e451a'/>
<id>20a7b6be0514334a30a4306331a4bcf6f78e451a</id>
<content type='text'>
Pull driver core fixes from Greg KH:
 "Here are some small driver core and debugfs fixes for 5.9-rc5

  Included in here are:

   - firmware loader memory leak fix

   - firmware loader testing fixes for non-EFI systems

   - device link locking fixes found by lockdep

   - kobject_del() bugfix that has been affecting some callers

   - debugfs minor fix

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'driver-core-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  test_firmware: Test platform fw loading on non-EFI systems
  PM: &lt;linux/device.h&gt;: fix @em_pd kernel-doc warning
  kobject: Drop unneeded conditional in __kobject_del()
  driver core: Fix device_pm_lock() locking for device links
  MAINTAINERS: Add the security document to SECURITY CONTACT
  driver code: print symbolic error code
  debugfs: Fix module state check condition
  kobject: Restore old behaviour of kobject_del(NULL)
  firmware_loader: fix memory leak for paged buffer
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull driver core fixes from Greg KH:
 "Here are some small driver core and debugfs fixes for 5.9-rc5

  Included in here are:

   - firmware loader memory leak fix

   - firmware loader testing fixes for non-EFI systems

   - device link locking fixes found by lockdep

   - kobject_del() bugfix that has been affecting some callers

   - debugfs minor fix

  All of these have been in linux-next for a while with no reported
  issues"

* tag 'driver-core-5.9-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core:
  test_firmware: Test platform fw loading on non-EFI systems
  PM: &lt;linux/device.h&gt;: fix @em_pd kernel-doc warning
  kobject: Drop unneeded conditional in __kobject_del()
  driver core: Fix device_pm_lock() locking for device links
  MAINTAINERS: Add the security document to SECURITY CONTACT
  driver code: print symbolic error code
  debugfs: Fix module state check condition
  kobject: Restore old behaviour of kobject_del(NULL)
  firmware_loader: fix memory leak for paged buffer
</pre>
</div>
</content>
</entry>
<entry>
<title>driver core: Fix device_pm_lock() locking for device links</title>
<updated>2020-09-04T16:21:35+00:00</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2020-09-01T18:44:44+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6b57b15abe11aa334ebf726e02c0deaf123ba040'/>
<id>6b57b15abe11aa334ebf726e02c0deaf123ba040</id>
<content type='text'>
This commit fixes two issues:

1. The lockdep warning reported by Dong Aisheng &lt;dongas86@gmail.com&gt; [1].

It is a warning about a cycle (dpm_list_mtx --&gt; kn-&gt;active#3 --&gt; fw_lock)
that was introduced when device-link devices were added to expose device
link information in sysfs.

The patch that "introduced" this cycle can't be reverted because it's fixes
a real SRCU issue and also ensures that the device-link device is deleted
as soon as the device-link is deleted. This is important to avoid sysfs
name collisions if the device-link is create again immediately (this can
happen a lot with deferred probing).

2. Inconsistency in grabbing device_pm_lock() during device link deletion

Some device link deletion code paths grab device_pm_lock(), while others
don't.  The device_pm_lock() is grabbed during device_link_add() because it
checks if the supplier is in the dpm_list and also reorders the dpm_list.
However, when a device link is deleted, it does not do either of those and
therefore device_pm_lock() is not necessary. Dropping the device_pm_lock()
in all the device link deletion paths removes the inconsistency in locking.

Thanks to Stephen Boyd for helping me understand the lockdep splat.

Fixes: 843e600b8a2b ("driver core: Fix sleeping in invalid context during device link deletion")
[1] - https://lore.kernel.org/lkml/CAA+hA=S4eAreb7vo69LAXSk2t5=DEKNxHaiY1wSpk4xTp9urLg@mail.gmail.com/
Reported-by: Dong Aisheng &lt;dongas86@gmail.com&gt;
Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Tested-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Link: https://lore.kernel.org/r/20200901184445.1736658-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This commit fixes two issues:

1. The lockdep warning reported by Dong Aisheng &lt;dongas86@gmail.com&gt; [1].

It is a warning about a cycle (dpm_list_mtx --&gt; kn-&gt;active#3 --&gt; fw_lock)
that was introduced when device-link devices were added to expose device
link information in sysfs.

The patch that "introduced" this cycle can't be reverted because it's fixes
a real SRCU issue and also ensures that the device-link device is deleted
as soon as the device-link is deleted. This is important to avoid sysfs
name collisions if the device-link is create again immediately (this can
happen a lot with deferred probing).

2. Inconsistency in grabbing device_pm_lock() during device link deletion

Some device link deletion code paths grab device_pm_lock(), while others
don't.  The device_pm_lock() is grabbed during device_link_add() because it
checks if the supplier is in the dpm_list and also reorders the dpm_list.
However, when a device link is deleted, it does not do either of those and
therefore device_pm_lock() is not necessary. Dropping the device_pm_lock()
in all the device link deletion paths removes the inconsistency in locking.

Thanks to Stephen Boyd for helping me understand the lockdep splat.

Fixes: 843e600b8a2b ("driver core: Fix sleeping in invalid context during device link deletion")
[1] - https://lore.kernel.org/lkml/CAA+hA=S4eAreb7vo69LAXSk2t5=DEKNxHaiY1wSpk4xTp9urLg@mail.gmail.com/
Reported-by: Dong Aisheng &lt;dongas86@gmail.com&gt;
Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Tested-by: Peng Fan &lt;peng.fan@nxp.com&gt;
Link: https://lore.kernel.org/r/20200901184445.1736658-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>driver code: print symbolic error code</title>
<updated>2020-09-04T16:14:52+00:00</updated>
<author>
<name>Michał Mirosław</name>
<email>mirq-linux@rere.qmqm.pl</email>
</author>
<published>2020-08-28T16:14:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=693a8e936590f93451e6f5a3d748616f5a59c80b'/>
<id>693a8e936590f93451e6f5a3d748616f5a59c80b</id>
<content type='text'>
dev_err_probe() prepends the message with an error code. Let's make it
more readable by translating the code to a more recognisable symbol.

Fixes: a787e5400a1c ("driver core: add device probe log helper")
Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Link: https://lore.kernel.org/r/ea3f973e4708919573026fdce52c264db147626d.1598630856.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
dev_err_probe() prepends the message with an error code. Let's make it
more readable by translating the code to a more recognisable symbol.

Fixes: a787e5400a1c ("driver core: add device probe log helper")
Signed-off-by: Michał Mirosław &lt;mirq-linux@rere.qmqm.pl&gt;
Link: https://lore.kernel.org/r/ea3f973e4708919573026fdce52c264db147626d.1598630856.git.mirq-linux@rere.qmqm.pl
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>device property: Fix the secondary firmware node handling in set_primary_fwnode()</title>
<updated>2020-08-21T18:26:21+00:00</updated>
<author>
<name>Heikki Krogerus</name>
<email>heikki.krogerus@linux.intel.com</email>
</author>
<published>2020-08-21T10:53:42+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c15e1bdda4365a5f17cdadf22bf1c1df13884a9e'/>
<id>c15e1bdda4365a5f17cdadf22bf1c1df13884a9e</id>
<content type='text'>
When the primary firmware node pointer is removed from a
device (set to NULL) the secondary firmware node pointer,
when it exists, is made the primary node for the device.
However, the secondary firmware node pointer of the original
primary firmware node is never cleared (set to NULL).

To avoid situation where the secondary firmware node pointer
is pointing to a non-existing object, clearing it properly
when the primary node is removed from a device in
set_primary_fwnode().

Fixes: 97badf873ab6 ("device property: Make it possible to use secondary firmware nodes")
Cc: All applicable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the primary firmware node pointer is removed from a
device (set to NULL) the secondary firmware node pointer,
when it exists, is made the primary node for the device.
However, the secondary firmware node pointer of the original
primary firmware node is never cleared (set to NULL).

To avoid situation where the secondary firmware node pointer
is pointing to a non-existing object, clearing it properly
when the primary node is removed from a device in
set_primary_fwnode().

Fixes: 97badf873ab6 ("device property: Make it possible to use secondary firmware nodes")
Cc: All applicable &lt;stable@vger.kernel.org&gt;
Signed-off-by: Heikki Krogerus &lt;heikki.krogerus@linux.intel.com&gt;
Signed-off-by: Rafael J. Wysocki &lt;rafael.j.wysocki@intel.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'devicetree-for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux</title>
<updated>2020-08-05T20:02:45+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2020-08-05T20:02:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=441977979a78bffe51b13932d353919b1fb20c14'/>
<id>441977979a78bffe51b13932d353919b1fb20c14</id>
<content type='text'>
Pull Devicetree updates from Rob Herring:

 - Improve device links cycle detection and breaking. Add more bindings
   for device link dependencies.

 - Refactor parsing 'no-map' in __reserved_mem_alloc_size()

 - Improve DT unittest 'ranges' and 'dma-ranges' test case to check
   differing cell sizes

 - Various http to https link conversions

 - Add a schema check to prevent 'syscon' from being used by itself
   without a more specific compatible

 - A bunch more DT binding conversions to schema

* tag 'devicetree-for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (55 commits)
  of: reserved-memory: remove duplicated call to of_get_flat_dt_prop() for no-map node
  of: unittest: Use bigger address cells to catch parser regressions
  dt-bindings: memory-controllers: Convert mmdc to json-schema
  dt-bindings: mtd: Convert imx nand to json-schema
  dt-bindings: mtd: Convert gpmi nand to json-schema
  dt-bindings: iio: io-channel-mux: Fix compatible string in example code
  of: property: Add device link support for pinctrl-0 through pinctrl-8
  of: property: Add device link support for multiple DT bindings
  dt-bindings: phy: ti: phy-gmii-sel: convert bindings to json-schema
  dt-bindings: mux: mux.h: drop a duplicated word
  dt-bindings: misc: Convert olpc,xo1.75-ec to json-schema
  dt-bindings: aspeed-lpc: Replace HTTP links with HTTPS ones
  dt-bindings: drm/bridge: Replace HTTP links with HTTPS ones
  drm/tilcdc: Replace HTTP links with HTTPS ones
  dt-bindings: iommu: renesas,ipmmu-vmsa: Add r8a774e1 support
  dt-bindings: fpga: Replace HTTP links with HTTPS ones
  dt-bindings: virtio: Replace HTTP links with HTTPS ones
  dt-bindings: media: imx274: Add optional input clock and supplies
  dt-bindings: i2c-gpio: Use 'deprecated' keyword on deprecated properties
  dt-bindings: interrupt-controller: Fix typos in loongson,liointc.yaml
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull Devicetree updates from Rob Herring:

 - Improve device links cycle detection and breaking. Add more bindings
   for device link dependencies.

 - Refactor parsing 'no-map' in __reserved_mem_alloc_size()

 - Improve DT unittest 'ranges' and 'dma-ranges' test case to check
   differing cell sizes

 - Various http to https link conversions

 - Add a schema check to prevent 'syscon' from being used by itself
   without a more specific compatible

 - A bunch more DT binding conversions to schema

* tag 'devicetree-for-5.9' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux: (55 commits)
  of: reserved-memory: remove duplicated call to of_get_flat_dt_prop() for no-map node
  of: unittest: Use bigger address cells to catch parser regressions
  dt-bindings: memory-controllers: Convert mmdc to json-schema
  dt-bindings: mtd: Convert imx nand to json-schema
  dt-bindings: mtd: Convert gpmi nand to json-schema
  dt-bindings: iio: io-channel-mux: Fix compatible string in example code
  of: property: Add device link support for pinctrl-0 through pinctrl-8
  of: property: Add device link support for multiple DT bindings
  dt-bindings: phy: ti: phy-gmii-sel: convert bindings to json-schema
  dt-bindings: mux: mux.h: drop a duplicated word
  dt-bindings: misc: Convert olpc,xo1.75-ec to json-schema
  dt-bindings: aspeed-lpc: Replace HTTP links with HTTPS ones
  dt-bindings: drm/bridge: Replace HTTP links with HTTPS ones
  drm/tilcdc: Replace HTTP links with HTTPS ones
  dt-bindings: iommu: renesas,ipmmu-vmsa: Add r8a774e1 support
  dt-bindings: fpga: Replace HTTP links with HTTPS ones
  dt-bindings: virtio: Replace HTTP links with HTTPS ones
  dt-bindings: media: imx274: Add optional input clock and supplies
  dt-bindings: i2c-gpio: Use 'deprecated' keyword on deprecated properties
  dt-bindings: interrupt-controller: Fix typos in loongson,liointc.yaml
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>driver core: add deferring probe reason to devices_deferred property</title>
<updated>2020-07-30T07:03:43+00:00</updated>
<author>
<name>Andrzej Hajda</name>
<email>a.hajda@samsung.com</email>
</author>
<published>2020-07-13T14:43:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d090b70ede02370014a1cf8acd211d1ed0fa9fd9'/>
<id>d090b70ede02370014a1cf8acd211d1ed0fa9fd9</id>
<content type='text'>
/sys/kernel/debug/devices_deferred property contains list of deferred devices.
This list does not contain reason why the driver deferred probe, the patch
improves it.
The natural place to set the reason is dev_err_probe function introduced
recently, ie. if dev_err_probe will be called with -EPROBE_DEFER instead of
printk the message will be attached to a deferred device and printed when user
reads devices_deferred property.

Signed-off-by: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
Link: https://lore.kernel.org/r/20200713144324.23654-3-a.hajda@samsung.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
/sys/kernel/debug/devices_deferred property contains list of deferred devices.
This list does not contain reason why the driver deferred probe, the patch
improves it.
The natural place to set the reason is dev_err_probe function introduced
recently, ie. if dev_err_probe will be called with -EPROBE_DEFER instead of
printk the message will be attached to a deferred device and printed when user
reads devices_deferred property.

Signed-off-by: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Reviewed-by: Javier Martinez Canillas &lt;javierm@redhat.com&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
Link: https://lore.kernel.org/r/20200713144324.23654-3-a.hajda@samsung.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>driver core: add device probe log helper</title>
<updated>2020-07-30T07:03:43+00:00</updated>
<author>
<name>Andrzej Hajda</name>
<email>a.hajda@samsung.com</email>
</author>
<published>2020-07-13T14:43:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a787e5400a1ceeb0ef92d71ec43aeb35b1fa1334'/>
<id>a787e5400a1ceeb0ef92d71ec43aeb35b1fa1334</id>
<content type='text'>
During probe every time driver gets resource it should usually check for
error printk some message if it is not -EPROBE_DEFER and return the error.
This pattern is simple but requires adding few lines after any resource
acquisition code, as a result it is often omitted or implemented only
partially.
dev_err_probe helps to replace such code sequences with simple call,
so code:
	if (err != -EPROBE_DEFER)
		dev_err(dev, ...);
	return err;
becomes:
	return dev_err_probe(dev, err, ...);

Signed-off-by: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20200713144324.23654-2-a.hajda@samsung.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
During probe every time driver gets resource it should usually check for
error printk some message if it is not -EPROBE_DEFER and return the error.
This pattern is simple but requires adding few lines after any resource
acquisition code, as a result it is often omitted or implemented only
partially.
dev_err_probe helps to replace such code sequences with simple call,
so code:
	if (err != -EPROBE_DEFER)
		dev_err(dev, ...);
	return err;
becomes:
	return dev_err_probe(dev, err, ...);

Signed-off-by: Andrzej Hajda &lt;a.hajda@samsung.com&gt;
Reviewed-by: Rafael J. Wysocki &lt;rafael@kernel.org&gt;
Reviewed-by: Mark Brown &lt;broonie@kernel.org&gt;
Reviewed-by: Andy Shevchenko &lt;andy.shevchenko@gmail.com&gt;
Link: https://lore.kernel.org/r/20200713144324.23654-2-a.hajda@samsung.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>driver core: Change delimiter in devlink device's name to "--"</title>
<updated>2020-07-24T18:55:25+00:00</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2020-07-24T18:05:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=90b109d50da09ddaa179732c01ccba7f759c125d'/>
<id>90b109d50da09ddaa179732c01ccba7f759c125d</id>
<content type='text'>
The devlink device name is of the form "supplier:consumer". But ":" is
fairly common in device names and makes it visually hard to distinguish
supplier and consumer. So, replace it with "--" to make it easier.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://lore.kernel.org/r/20200724180523.1393383-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The devlink device name is of the form "supplier:consumer". But ":" is
fairly common in device names and makes it visually hard to distinguish
supplier and consumer. So, replace it with "--" to make it easier.

Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Link: https://lore.kernel.org/r/20200724180523.1393383-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>driver core: Fix sleeping in invalid context during device link deletion</title>
<updated>2020-07-23T07:20:21+00:00</updated>
<author>
<name>Saravana Kannan</name>
<email>saravanak@google.com</email>
</author>
<published>2020-07-16T21:45:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=843e600b8a2b01463c4d873a90b2c2ea8033f1f6'/>
<id>843e600b8a2b01463c4d873a90b2c2ea8033f1f6</id>
<content type='text'>
Marek and Guenter reported that commit 287905e68dd2 ("driver core:
Expose device link details in sysfs") caused sleeping/scheduling while
atomic warnings.

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 12, name: kworker/0:1
2 locks held by kworker/0:1/12:
  #0: ee8074a8 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: process_one_work+0x174/0x7dc
  #1: ee921f20 ((work_completion)(&amp;sdp-&gt;work)){+.+.}-{0:0}, at: process_one_work+0x174/0x7dc
Preemption disabled at:
[&lt;c01b10f0&gt;] srcu_invoke_callbacks+0xc0/0x154
----- 8&lt; ----- SNIP
[&lt;c064590c&gt;] (device_del) from [&lt;c0645c9c&gt;] (device_unregister+0x24/0x64)
[&lt;c0645c9c&gt;] (device_unregister) from [&lt;c01b10fc&gt;] (srcu_invoke_callbacks+0xcc/0x154)
[&lt;c01b10fc&gt;] (srcu_invoke_callbacks) from [&lt;c01493c4&gt;] (process_one_work+0x234/0x7dc)
[&lt;c01493c4&gt;] (process_one_work) from [&lt;c01499b0&gt;] (worker_thread+0x44/0x51c)
[&lt;c01499b0&gt;] (worker_thread) from [&lt;c0150bf4&gt;] (kthread+0x158/0x1a0)
[&lt;c0150bf4&gt;] (kthread) from [&lt;c0100114&gt;] (ret_from_fork+0x14/0x20)
Exception stack(0xee921fb0 to 0xee921ff8)

This was caused by the device link device being released in the context
of srcu_invoke_callbacks().  There is no need to wait till the RCU
callback to release the device link device.  So release the device
earlier and move the call_srcu() into the device release code. That way,
the memory will get freed only after the device is released AND the RCU
callback is called.

Fixes: 287905e68dd2 ("driver core: Expose device link details in sysfs")
Reported-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reported-by: Naresh Kamboju &lt;naresh.kamboju@linaro.org&gt;
Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20200716214523.2924704-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Marek and Guenter reported that commit 287905e68dd2 ("driver core:
Expose device link details in sysfs") caused sleeping/scheduling while
atomic warnings.

BUG: sleeping function called from invalid context at kernel/locking/mutex.c:935
in_atomic(): 1, irqs_disabled(): 0, non_block: 0, pid: 12, name: kworker/0:1
2 locks held by kworker/0:1/12:
  #0: ee8074a8 ((wq_completion)rcu_gp){+.+.}-{0:0}, at: process_one_work+0x174/0x7dc
  #1: ee921f20 ((work_completion)(&amp;sdp-&gt;work)){+.+.}-{0:0}, at: process_one_work+0x174/0x7dc
Preemption disabled at:
[&lt;c01b10f0&gt;] srcu_invoke_callbacks+0xc0/0x154
----- 8&lt; ----- SNIP
[&lt;c064590c&gt;] (device_del) from [&lt;c0645c9c&gt;] (device_unregister+0x24/0x64)
[&lt;c0645c9c&gt;] (device_unregister) from [&lt;c01b10fc&gt;] (srcu_invoke_callbacks+0xcc/0x154)
[&lt;c01b10fc&gt;] (srcu_invoke_callbacks) from [&lt;c01493c4&gt;] (process_one_work+0x234/0x7dc)
[&lt;c01493c4&gt;] (process_one_work) from [&lt;c01499b0&gt;] (worker_thread+0x44/0x51c)
[&lt;c01499b0&gt;] (worker_thread) from [&lt;c0150bf4&gt;] (kthread+0x158/0x1a0)
[&lt;c0150bf4&gt;] (kthread) from [&lt;c0100114&gt;] (ret_from_fork+0x14/0x20)
Exception stack(0xee921fb0 to 0xee921ff8)

This was caused by the device link device being released in the context
of srcu_invoke_callbacks().  There is no need to wait till the RCU
callback to release the device link device.  So release the device
earlier and move the call_srcu() into the device release code. That way,
the memory will get freed only after the device is released AND the RCU
callback is called.

Fixes: 287905e68dd2 ("driver core: Expose device link details in sysfs")
Reported-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Reported-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Reported-by: Naresh Kamboju &lt;naresh.kamboju@linaro.org&gt;
Signed-off-by: Saravana Kannan &lt;saravanak@google.com&gt;
Tested-by: Marek Szyprowski &lt;m.szyprowski@samsung.com&gt;
Tested-by: Guenter Roeck &lt;linux@roeck-us.net&gt;
Link: https://lore.kernel.org/r/20200716214523.2924704-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge 5.8-rc6 into driver-core-next</title>
<updated>2020-07-20T07:31:35+00:00</updated>
<author>
<name>Greg Kroah-Hartman</name>
<email>gregkh@linuxfoundation.org</email>
</author>
<published>2020-07-20T07:31:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6bdb486c5a628f7a927c2658166e3a5ef1f883e7'/>
<id>6bdb486c5a628f7a927c2658166e3a5ef1f883e7</id>
<content type='text'>
We need the driver core fixes in here too.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We need the driver core fixes in here too.

Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
