Linux kernel source tree
Go to file
Saravana Kannan d122e95dc6 BACKPORT: driver core: Fix SYNC_STATE_ONLY device link implementation
When SYNC_STATE_ONLY support was added in commit 05ef983e0d ("driver
core: Add device link support for SYNC_STATE_ONLY flag"),
device_link_add() incorrectly skipped adding the new SYNC_STATE_ONLY
device link to the supplier's and consumer's "device link" list.

This causes multiple issues:
- The device link is lost forever from driver core if the caller
  didn't keep track of it (caller typically isn't expected to). This is
  a memory leak.
- The device link is also never visible to any other code path after
  device_link_add() returns.

If we fix the "device link" list handling, that exposes a bunch of
issues.

1. The device link "status" state management code rightfully doesn't
handle the case where a DL_FLAG_MANAGED device link exists between a
supplier and consumer, but the consumer manages to probe successfully
before the supplier. The addition of DL_FLAG_SYNC_STATE_ONLY links break
this assumption. This causes device_links_driver_bound() to throw a
warning when this happens.

Since DL_FLAG_SYNC_STATE_ONLY device links are mainly used for creating
proxy device links for child device dependencies and aren't useful once
the consumer device probes successfully, this patch just deletes
DL_FLAG_SYNC_STATE_ONLY device links once its consumer device probes.
This way, we avoid the warning, free up some memory and avoid
complicating the device links "status" state management code.

2. Creating a DL_FLAG_STATELESS device link between two devices that
already have a DL_FLAG_SYNC_STATE_ONLY device link will result in the
DL_FLAG_STATELESS flag not getting set correctly. This patch also fixes
this.

Lastly, this patch also fixes minor whitespace issues.

Cc: stable@vger.kernel.org
Fixes: 05ef983e0d ("driver core: Add device link support for SYNC_STATE_ONLY flag")
Signed-off-by: Saravana Kannan <saravanak@google.com>
Reviewed-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Link: https://lore.kernel.org/r/20200519063000.128819-1-saravanak@google.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
(cherry picked from commit 21c27f0658)
Bug: 157103558
[minor dev_dbg vs dev_info conflict resolution]
Signed-off-by: Saravana Kannan <saravanak@google.com>
Change-Id: Icb091de185c7efbb7db0ec86267675ac0472f379
2020-05-28 14:59:57 -07:00
arch This is the 4.19.125 stable release 2020-05-28 12:20:07 +02:00
block ANDROID: block: backport the ability to specify max_dun_bytes 2020-05-14 15:44:27 -07:00
certs export.h: remove VMLINUX_SYMBOL() and VMLINUX_SYMBOL_STR() 2018-08-22 23:21:44 +09:00
crypto This is the 4.19.124 stable release 2020-05-20 11:37:46 +02:00
Documentation BACKPORT: FROMLIST: fscrypt: add support for IV_INO_LBLK_32 policies 2020-05-21 11:55:14 -07:00
drivers BACKPORT: driver core: Fix SYNC_STATE_ONLY device link implementation 2020-05-28 14:59:57 -07:00
firmware Fix built-in early-load Intel microcode alignment 2020-01-23 08:21:29 +01:00
fs Revert "ANDROID: Incremental fs: Avoid continually recalculating hashes" 2020-05-28 13:50:57 +00:00
include This is the 4.19.125 stable release 2020-05-28 12:20:07 +02:00
init This is the 4.19.124 stable release 2020-05-20 11:37:46 +02:00
ipc This is the 4.19.124 stable release 2020-05-20 11:37:46 +02:00
kernel This is the 4.19.125 stable release 2020-05-28 12:20:07 +02:00
lib This is the 4.19.125 stable release 2020-05-28 12:20:07 +02:00
LICENSES LICENSES: Remove CC-BY-SA-4.0 license text 2018-10-18 11:28:50 +02:00
mm This is the 4.19.124 stable release 2020-05-20 11:37:46 +02:00
net This is the 4.19.125 stable release 2020-05-28 12:20:07 +02:00
samples This is the 4.19.119 stable release 2020-04-29 17:26:17 +02:00
scripts This is the 4.19.125 stable release 2020-05-28 12:20:07 +02:00
security This is the 4.19.125 stable release 2020-05-28 12:20:07 +02:00
sound This is the 4.19.125 stable release 2020-05-28 12:20:07 +02:00
tools This is the 4.19.123 stable release 2020-05-14 08:54:02 +02:00
usr initramfs: restore default compression behavior 2020-04-13 10:44:59 +02:00
virt KVM: arm64: Fix 32bit PC wrap-around 2020-05-14 07:57:20 +02:00
.clang-format clang-format: Set IndentWrappedFunctionNames false 2018-08-01 18:38:51 +02:00
.cocciconfig scripts: add Linux .cocciconfig for coccinelle 2016-07-22 12:13:39 +02:00
.get_maintainer.ignore Add hch to .get_maintainer.ignore 2015-08-21 14:30:10 -07:00
.gitattributes .gitattributes: set git diff driver for C source code files 2016-10-07 18:46:30 -07:00
.gitignore Kbuild updates for v4.17 (2nd) 2018-04-15 17:21:30 -07:00
.mailmap libnvdimm-for-4.19_misc 2018-08-25 18:13:10 -07:00
abi_gki_aarch64_cuttlefish_whitelist ANDROID: abi_gki_aarch64_cuttlefish_whitelist: remove stale symbols 2020-04-29 10:52:02 +00:00
abi_gki_aarch64_qcom_whitelist ANDROID: Bulk update the ABI xml and qcom whitelist 2020-05-28 13:17:00 -07:00
abi_gki_aarch64_whitelist ANDROID: GKI: Update the ABI xml and whitelist 2020-05-14 15:58:13 -07:00
abi_gki_aarch64.xml ANDROID: Bulk update the ABI xml and qcom whitelist 2020-05-28 13:17:00 -07:00
build.config.aarch64 ANDROID: add compat cross compiler 2020-04-27 22:52:19 -07:00
build.config.allmodconfig ANDROID: build.config.allmodconfig: Re-enable XFS_FS 2020-04-17 08:41:31 +00:00
build.config.allmodconfig.aarch64 ANDROID: Add allmodconfig build.configs for x86_64 and aarch64 2019-11-12 20:55:23 +00:00
build.config.allmodconfig.arm ANDROID: Add build.config files for ARM 32-bit 2020-03-16 17:43:55 +00:00
build.config.allmodconfig.x86_64 ANDROID: Add allmodconfig build.configs for x86_64 and aarch64 2019-11-12 20:55:23 +00:00
build.config.arm ANDROID: Add build.config files for ARM 32-bit 2020-03-16 17:43:55 +00:00
build.config.common ANDROID: clang: update to 11.0.1 2020-05-18 19:33:08 +00:00
build.config.gki ANDROID: gki: Removed cf modules from gki_defconfig 2020-01-31 16:23:38 -08:00
build.config.gki_kasan ANDROID: Rename build.config.gki.arch_kasan 2020-05-13 15:10:51 +00:00
build.config.gki_kasan.aarch64 ANDROID: Drop ABI monitoring from KASAN build config 2020-05-13 15:11:47 +00:00
build.config.gki_kasan.x86_64 ANDROID: Rename build.config.gki.arch_kasan 2020-05-13 15:10:51 +00:00
build.config.gki-debug.aarch64 ANDROID: Fix build.config.gki-debug 2020-05-20 11:50:18 +00:00
build.config.gki-debug.x86_64 ANDROID: Fix build.config.gki-debug 2020-05-20 11:50:18 +00:00
build.config.gki.aarch64 ANDROID: build.config.gki.aarch64: Enable WHITELIST_STRICT_MODE 2020-05-07 08:12:23 +00:00
build.config.gki.x86_64 ANDROID: refactor build.config files to remove duplication 2019-10-22 18:27:12 -07:00
build.config.x86_64 ANDROID: refactor build.config files to remove duplication 2019-10-22 18:27:12 -07:00
COPYING COPYING: use the new text with points to the license files 2018-03-23 12:41:45 -06:00
CREDITS 9p: remove Ron Minnich from MAINTAINERS 2018-08-17 16:20:26 -07:00
Kbuild Kbuild updates for v4.15 2017-11-17 17:45:29 -08:00
Kconfig kconfig: move the "Executable file formats" menu to fs/Kconfig.binfmt 2018-08-02 08:06:55 +09:00
MAINTAINERS This is the 4.19.107 stable release 2020-03-03 07:33:01 +01:00
Makefile This is the 4.19.125 stable release 2020-05-28 12:20:07 +02:00
README Docs: Added a pointer to the formatted docs to README 2018-03-21 09:02:53 -06:00

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.