From: Greg Kroah-Hartman Date: Mon, 9 Mar 2026 08:02:05 +0000 (+0100) Subject: drop some more patches that broke the build, or were not needed anymore X-Git-Tag: v6.19.7~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e22a73b338d6a6311f309ed89b0fc97506275502;p=thirdparty%2Fkernel%2Fstable-queue.git drop some more patches that broke the build, or were not needed anymore --- diff --git a/queue-5.10/perf-fix-__perf_event_overflow-vs-perf_remove_from_c.patch b/queue-5.10/perf-fix-__perf_event_overflow-vs-perf_remove_from_c.patch deleted file mode 100644 index a37b8d3be9..0000000000 --- a/queue-5.10/perf-fix-__perf_event_overflow-vs-perf_remove_from_c.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 0393e66095ee561bf7d033a6e99572b71a941656 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 24 Feb 2026 13:29:09 +0100 -Subject: perf: Fix __perf_event_overflow() vs perf_remove_from_context() race - -From: Peter Zijlstra - -[ Upstream commit c9bc1753b3cc41d0e01fbca7f035258b5f4db0ae ] - -Make sure that __perf_event_overflow() runs with IRQs disabled for all -possible callchains. Specifically the software events can end up running -it with only preemption disabled. - -This opens up a race vs perf_event_exit_event() and friends that will go -and free various things the overflow path expects to be present, like -the BPF program. - -Fixes: 592903cdcbf6 ("perf_counter: add an event_list") -Reported-by: Simond Hu -Signed-off-by: Peter Zijlstra (Intel) -Tested-by: Simond Hu -Link: https://patch.msgid.link/20260224122909.GV1395416@noisy.programming.kicks-ass.net -Signed-off-by: Sasha Levin ---- - kernel/events/core.c | 42 +++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 41 insertions(+), 1 deletion(-) - -diff --git a/kernel/events/core.c b/kernel/events/core.c -index c9cd1f622a1fc..269b505a6fa63 100644 ---- a/kernel/events/core.c -+++ b/kernel/events/core.c -@@ -9127,6 +9127,13 @@ int perf_event_overflow(struct perf_event *event, - struct perf_sample_data *data, - struct pt_regs *regs) - { -+ /* -+ * Entry point from hardware PMI, interrupts should be disabled here. -+ * This serializes us against perf_event_remove_from_context() in -+ * things like perf_event_release_kernel(). -+ */ -+ lockdep_assert_irqs_disabled(); -+ - return __perf_event_overflow(event, 1, data, regs); - } - -@@ -9207,6 +9214,19 @@ static void perf_swevent_event(struct perf_event *event, u64 nr, - { - struct hw_perf_event *hwc = &event->hw; - -+ /* -+ * This is: -+ * - software preempt -+ * - tracepoint preempt -+ * - tp_target_task irq (ctx->lock) -+ * - uprobes preempt/irq -+ * - kprobes preempt/irq -+ * - hw_breakpoint irq -+ * -+ * Any of these are sufficient to hold off RCU and thus ensure @event -+ * exists. -+ */ -+ lockdep_assert_preemption_disabled(); - local64_add(nr, &event->count); - - if (!regs) -@@ -9215,6 +9235,16 @@ static void perf_swevent_event(struct perf_event *event, u64 nr, - if (!is_sampling_event(event)) - return; - -+ /* -+ * Serialize against event_function_call() IPIs like normal overflow -+ * event handling. Specifically, must not allow -+ * perf_event_release_kernel() -> perf_remove_from_context() to make -+ * progress and 'release' the event from under us. -+ */ -+ guard(irqsave)(); -+ if (event->state != PERF_EVENT_STATE_ACTIVE) -+ return; -+ - if ((event->attr.sample_type & PERF_SAMPLE_PERIOD) && !event->attr.freq) { - data->period = nr; - return perf_swevent_overflow(event, 1, data, regs); -@@ -9631,6 +9661,11 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size, - struct perf_sample_data data; - struct perf_event *event; - -+ /* -+ * Per being a tracepoint, this runs with preemption disabled. -+ */ -+ lockdep_assert_preemption_disabled(); -+ - struct perf_raw_record raw = { - .frag = { - .size = entry_size, -@@ -10063,6 +10098,11 @@ void perf_bp_event(struct perf_event *bp, void *data) - struct perf_sample_data sample; - struct pt_regs *regs = data; - -+ /* -+ * Exception context, will have interrupts disabled. -+ */ -+ lockdep_assert_irqs_disabled(); -+ - perf_sample_data_init(&sample, bp->attr.bp_addr, 0); - - if (!bp->hw.state && !perf_exclude_event(bp, regs)) -@@ -10516,7 +10556,7 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer) - - if (regs && !perf_exclude_event(event, regs)) { - if (!(event->attr.exclude_idle && is_idle_task(current))) -- if (__perf_event_overflow(event, 1, &data, regs)) -+ if (perf_event_overflow(event, &data, regs)) - ret = HRTIMER_NORESTART; - } - --- -2.51.0 - diff --git a/queue-5.10/series b/queue-5.10/series index 0a54f42c3a..57cbc20ca4 100644 --- a/queue-5.10/series +++ b/queue-5.10/series @@ -3,7 +3,6 @@ ip6_tunnel-fix-usage-of-skb_vlan_inet_prepare.patch scsi-lpfc-properly-set-wc-for-dpp-mapping.patch scsi-ufs-core-move-link-recovery-for-hibern8-exit-fa.patch alsa-usb-audio-cap-the-packet-size-pre-calculations.patch -perf-fix-__perf_event_overflow-vs-perf_remove_from_c.patch btrfs-fix-incorrect-key-offset-in-error-message-in-c.patch memory-mtk-smi-add-device-link-between-smi-larb-and-.patch memory-mtk-smi-convert-to-platform-remove-callback-r.patch diff --git a/queue-5.15/driver-core-add-a-guard-definition-for-the-device_lo.patch b/queue-5.15/driver-core-add-a-guard-definition-for-the-device_lo.patch deleted file mode 100644 index 69ed56f020..0000000000 --- a/queue-5.15/driver-core-add-a-guard-definition-for-the-device_lo.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 07b317d9c46b72385edfa89a618df8edc8ca6dea Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 13 Dec 2023 15:02:35 -0800 -Subject: driver core: Add a guard() definition for the device_lock() - -From: Dan Williams - -[ Upstream commit 134c6eaa6087d78c0e289931ca15ae7a5007670d ] - -At present there are ~200 usages of device_lock() in the kernel. Some of -those usages lead to "goto unlock;" patterns which have proven to be -error prone. Define a "device" guard() definition to allow for those to -be cleaned up and prevent new ones from appearing. - -Link: http://lore.kernel.org/r/657897453dda8_269bd29492@dwillia2-mobl3.amr.corp.intel.com.notmuch -Link: http://lore.kernel.org/r/6577b0c2a02df_a04c5294bb@dwillia2-xfh.jf.intel.com.notmuch -Cc: Vishal Verma -Cc: Ira Weiny -Cc: Peter Zijlstra -Cc: Greg Kroah-Hartman -Cc: Andrew Morton -Signed-off-by: Dan Williams -Reviewed-by: Ira Weiny -Reviewed-by: Dave Jiang -Reviewed-by: Vishal Verma -Link: https://lore.kernel.org/r/170250854466.1522182.17555361077409628655.stgit@dwillia2-xfh.jf.intel.com -Signed-off-by: Greg Kroah-Hartman -Stable-dep-of: dc23806a7c47 ("driver core: enforce device_lock for driver_match_device()") -Signed-off-by: Sasha Levin ---- - include/linux/device.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/include/linux/device.h b/include/linux/device.h -index 89864b9185462..0ef5f7f5f8853 100644 ---- a/include/linux/device.h -+++ b/include/linux/device.h -@@ -779,6 +779,8 @@ static inline void device_unlock(struct device *dev) - mutex_unlock(&dev->mutex); - } - -+DEFINE_GUARD(device, struct device *, device_lock(_T), device_unlock(_T)) -+ - static inline void device_lock_assert(struct device *dev) - { - lockdep_assert_held(&dev->mutex); --- -2.51.0 - diff --git a/queue-5.15/driver-core-make-state_synced-device-attribute-write.patch b/queue-5.15/driver-core-make-state_synced-device-attribute-write.patch deleted file mode 100644 index 025f1cafb9..0000000000 --- a/queue-5.15/driver-core-make-state_synced-device-attribute-write.patch +++ /dev/null @@ -1,125 +0,0 @@ -From bb2d8947c1c77bdcef30f62feccb41488fb0a044 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Fri, 3 Mar 2023 16:53:54 -0800 -Subject: driver core: Make state_synced device attribute writeable - -From: Saravana Kannan - -[ Upstream commit f8fb576658a3e19796e2e1a12a5ec8f44dac02b6 ] - -If the file is written to and sync_state() hasn't been called for the -device yet, then call sync_state() for the device independent of the -state of its consumers. - -This is useful for supplier devices that have one or more consumers that -don't have a driver but the consumers are in a state that don't use the -resources supplied by the supplier device. - -This gives finer grained control than using the -fw_devlink.sync_state=timeout kernel commandline parameter. - -Signed-off-by: Saravana Kannan -Link: https://lore.kernel.org/r/20230304005355.746421-3-saravanak@google.com -Signed-off-by: Greg Kroah-Hartman -Stable-dep-of: dc23806a7c47 ("driver core: enforce device_lock for driver_match_device()") -Signed-off-by: Sasha Levin ---- - .../ABI/testing/sysfs-devices-state_synced | 5 ++++ - drivers/base/base.h | 8 +++++++ - drivers/base/core.c | 5 +--- - drivers/base/dd.c | 23 ++++++++++++++++++- - 4 files changed, 36 insertions(+), 5 deletions(-) - -diff --git a/Documentation/ABI/testing/sysfs-devices-state_synced b/Documentation/ABI/testing/sysfs-devices-state_synced -index 0c922d7d02fc2..c64636ddac410 100644 ---- a/Documentation/ABI/testing/sysfs-devices-state_synced -+++ b/Documentation/ABI/testing/sysfs-devices-state_synced -@@ -21,4 +21,9 @@ Description: - at the time the kernel starts are not affected or limited in - any way by sync_state() callbacks. - -+ Writing "1" to this file will force a call to the device's -+ sync_state() function if it hasn't been called already. The -+ sync_state() call happens independent of the state of the -+ consumer devices. -+ - -diff --git a/drivers/base/base.h b/drivers/base/base.h -index 2882af26392ab..406d108e8510f 100644 ---- a/drivers/base/base.h -+++ b/drivers/base/base.h -@@ -148,6 +148,14 @@ static inline int driver_match_device(struct device_driver *drv, - } - extern bool driver_allows_async_probing(struct device_driver *drv); - -+static inline void dev_sync_state(struct device *dev) -+{ -+ if (dev->bus->sync_state) -+ dev->bus->sync_state(dev); -+ else if (dev->driver && dev->driver->sync_state) -+ dev->driver->sync_state(dev); -+} -+ - extern int driver_add_groups(struct device_driver *drv, - const struct attribute_group **groups); - extern void driver_remove_groups(struct device_driver *drv, -diff --git a/drivers/base/core.c b/drivers/base/core.c -index 4fc62624a95e2..db665370d3788 100644 ---- a/drivers/base/core.c -+++ b/drivers/base/core.c -@@ -1112,10 +1112,7 @@ static void device_links_flush_sync_list(struct list_head *list, - if (dev != dont_lock_dev) - device_lock(dev); - -- if (dev->bus->sync_state) -- dev->bus->sync_state(dev); -- else if (dev->driver && dev->driver->sync_state) -- dev->driver->sync_state(dev); -+ dev_sync_state(dev); - - if (dev != dont_lock_dev) - device_unlock(dev); -diff --git a/drivers/base/dd.c b/drivers/base/dd.c -index 0bd166ad6f130..c0a6bc9c6d5f1 100644 ---- a/drivers/base/dd.c -+++ b/drivers/base/dd.c -@@ -492,6 +492,27 @@ EXPORT_SYMBOL_GPL(device_bind_driver); - static atomic_t probe_count = ATOMIC_INIT(0); - static DECLARE_WAIT_QUEUE_HEAD(probe_waitqueue); - -+static ssize_t state_synced_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ int ret = 0; -+ -+ if (strcmp("1", buf)) -+ return -EINVAL; -+ -+ device_lock(dev); -+ if (!dev->state_synced) { -+ dev->state_synced = true; -+ dev_sync_state(dev); -+ } else { -+ ret = -EINVAL; -+ } -+ device_unlock(dev); -+ -+ return ret ? ret : count; -+} -+ - static ssize_t state_synced_show(struct device *dev, - struct device_attribute *attr, char *buf) - { -@@ -503,7 +524,7 @@ static ssize_t state_synced_show(struct device *dev, - - return sysfs_emit(buf, "%u\n", val); - } --static DEVICE_ATTR_RO(state_synced); -+static DEVICE_ATTR_RW(state_synced); - - - static int call_driver_probe(struct device *dev, struct device_driver *drv) --- -2.51.0 - diff --git a/queue-5.15/perf-fix-__perf_event_overflow-vs-perf_remove_from_c.patch b/queue-5.15/perf-fix-__perf_event_overflow-vs-perf_remove_from_c.patch deleted file mode 100644 index 70736ec8eb..0000000000 --- a/queue-5.15/perf-fix-__perf_event_overflow-vs-perf_remove_from_c.patch +++ /dev/null @@ -1,118 +0,0 @@ -From 0f5ef0945f54f2e5f7a708e8e1da39af12e23940 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Tue, 24 Feb 2026 13:29:09 +0100 -Subject: perf: Fix __perf_event_overflow() vs perf_remove_from_context() race - -From: Peter Zijlstra - -[ Upstream commit c9bc1753b3cc41d0e01fbca7f035258b5f4db0ae ] - -Make sure that __perf_event_overflow() runs with IRQs disabled for all -possible callchains. Specifically the software events can end up running -it with only preemption disabled. - -This opens up a race vs perf_event_exit_event() and friends that will go -and free various things the overflow path expects to be present, like -the BPF program. - -Fixes: 592903cdcbf6 ("perf_counter: add an event_list") -Reported-by: Simond Hu -Signed-off-by: Peter Zijlstra (Intel) -Tested-by: Simond Hu -Link: https://patch.msgid.link/20260224122909.GV1395416@noisy.programming.kicks-ass.net -Signed-off-by: Sasha Levin ---- - kernel/events/core.c | 42 +++++++++++++++++++++++++++++++++++++++++- - 1 file changed, 41 insertions(+), 1 deletion(-) - -diff --git a/kernel/events/core.c b/kernel/events/core.c -index 156221bd56615..b4b77170cbd10 100644 ---- a/kernel/events/core.c -+++ b/kernel/events/core.c -@@ -9526,6 +9526,13 @@ int perf_event_overflow(struct perf_event *event, - struct perf_sample_data *data, - struct pt_regs *regs) - { -+ /* -+ * Entry point from hardware PMI, interrupts should be disabled here. -+ * This serializes us against perf_event_remove_from_context() in -+ * things like perf_event_release_kernel(). -+ */ -+ lockdep_assert_irqs_disabled(); -+ - return __perf_event_overflow(event, 1, data, regs); - } - -@@ -9606,6 +9613,19 @@ static void perf_swevent_event(struct perf_event *event, u64 nr, - { - struct hw_perf_event *hwc = &event->hw; - -+ /* -+ * This is: -+ * - software preempt -+ * - tracepoint preempt -+ * - tp_target_task irq (ctx->lock) -+ * - uprobes preempt/irq -+ * - kprobes preempt/irq -+ * - hw_breakpoint irq -+ * -+ * Any of these are sufficient to hold off RCU and thus ensure @event -+ * exists. -+ */ -+ lockdep_assert_preemption_disabled(); - local64_add(nr, &event->count); - - if (!regs) -@@ -9614,6 +9634,16 @@ static void perf_swevent_event(struct perf_event *event, u64 nr, - if (!is_sampling_event(event)) - return; - -+ /* -+ * Serialize against event_function_call() IPIs like normal overflow -+ * event handling. Specifically, must not allow -+ * perf_event_release_kernel() -> perf_remove_from_context() to make -+ * progress and 'release' the event from under us. -+ */ -+ guard(irqsave)(); -+ if (event->state != PERF_EVENT_STATE_ACTIVE) -+ return; -+ - if ((event->attr.sample_type & PERF_SAMPLE_PERIOD) && !event->attr.freq) { - data->period = nr; - return perf_swevent_overflow(event, 1, data, regs); -@@ -10030,6 +10060,11 @@ void perf_tp_event(u16 event_type, u64 count, void *record, int entry_size, - struct perf_sample_data data; - struct perf_event *event; - -+ /* -+ * Per being a tracepoint, this runs with preemption disabled. -+ */ -+ lockdep_assert_preemption_disabled(); -+ - struct perf_raw_record raw = { - .frag = { - .size = entry_size, -@@ -10478,6 +10513,11 @@ void perf_bp_event(struct perf_event *bp, void *data) - struct perf_sample_data sample; - struct pt_regs *regs = data; - -+ /* -+ * Exception context, will have interrupts disabled. -+ */ -+ lockdep_assert_irqs_disabled(); -+ - perf_sample_data_init(&sample, bp->attr.bp_addr, 0); - - if (!bp->hw.state && !perf_exclude_event(bp, regs)) -@@ -10931,7 +10971,7 @@ static enum hrtimer_restart perf_swevent_hrtimer(struct hrtimer *hrtimer) - - if (regs && !perf_exclude_event(event, regs)) { - if (!(event->attr.exclude_idle && is_idle_task(current))) -- if (__perf_event_overflow(event, 1, &data, regs)) -+ if (perf_event_overflow(event, &data, regs)) - ret = HRTIMER_NORESTART; - } - --- -2.51.0 - diff --git a/queue-5.15/series b/queue-5.15/series index 989e0db83c..7416075905 100644 --- a/queue-5.15/series +++ b/queue-5.15/series @@ -7,7 +7,6 @@ scsi-ufs-core-always-initialize-the-uic-done-complet.patch scsi-ufs-core-move-link-recovery-for-hibern8-exit-fa.patch alsa-usb-audio-cap-the-packet-size-pre-calculations.patch alsa-usb-audio-use-inclusive-terms.patch -perf-fix-__perf_event_overflow-vs-perf_remove_from_c.patch btrfs-fix-incorrect-key-offset-in-error-message-in-c.patch bpf-fix-stack-out-of-bounds-write-in-devmap.patch memory-mtk-smi-convert-to-platform-remove-callback-r.patch @@ -21,8 +20,6 @@ ata-libata-scsi-refactor-ata_scsi_translate.patch drm-tegra-dsi-fix-device-leak-on-probe.patch bus-omap-ocp2scp-convert-to-platform-remove-callback.patch bus-omap-ocp2scp-fix-of-populate-on-driver-rebind.patch -driver-core-make-state_synced-device-attribute-write.patch -driver-core-add-a-guard-definition-for-the-device_lo.patch mfd-qcom-pm8xxx-switch-away-from-using-chained-irq-h.patch mfd-qcom-pm8xxx-convert-to-platform-remove-callback-.patch mfd-qcom-pm8xxx-fix-of-populate-on-driver-rebind.patch diff --git a/queue-6.1/driver-core-add-a-guard-definition-for-the-device_lo.patch b/queue-6.1/driver-core-add-a-guard-definition-for-the-device_lo.patch deleted file mode 100644 index fd93456bca..0000000000 --- a/queue-6.1/driver-core-add-a-guard-definition-for-the-device_lo.patch +++ /dev/null @@ -1,49 +0,0 @@ -From 4f611ffe613a7b5d9b39728100b2dff21d143a88 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Wed, 13 Dec 2023 15:02:35 -0800 -Subject: driver core: Add a guard() definition for the device_lock() - -From: Dan Williams - -[ Upstream commit 134c6eaa6087d78c0e289931ca15ae7a5007670d ] - -At present there are ~200 usages of device_lock() in the kernel. Some of -those usages lead to "goto unlock;" patterns which have proven to be -error prone. Define a "device" guard() definition to allow for those to -be cleaned up and prevent new ones from appearing. - -Link: http://lore.kernel.org/r/657897453dda8_269bd29492@dwillia2-mobl3.amr.corp.intel.com.notmuch -Link: http://lore.kernel.org/r/6577b0c2a02df_a04c5294bb@dwillia2-xfh.jf.intel.com.notmuch -Cc: Vishal Verma -Cc: Ira Weiny -Cc: Peter Zijlstra -Cc: Greg Kroah-Hartman -Cc: Andrew Morton -Signed-off-by: Dan Williams -Reviewed-by: Ira Weiny -Reviewed-by: Dave Jiang -Reviewed-by: Vishal Verma -Link: https://lore.kernel.org/r/170250854466.1522182.17555361077409628655.stgit@dwillia2-xfh.jf.intel.com -Signed-off-by: Greg Kroah-Hartman -Stable-dep-of: dc23806a7c47 ("driver core: enforce device_lock for driver_match_device()") -Signed-off-by: Sasha Levin ---- - include/linux/device.h | 2 ++ - 1 file changed, 2 insertions(+) - -diff --git a/include/linux/device.h b/include/linux/device.h -index cc84521795b14..cfc3b1330c79d 100644 ---- a/include/linux/device.h -+++ b/include/linux/device.h -@@ -855,6 +855,8 @@ static inline void device_unlock(struct device *dev) - mutex_unlock(&dev->mutex); - } - -+DEFINE_GUARD(device, struct device *, device_lock(_T), device_unlock(_T)) -+ - static inline void device_lock_assert(struct device *dev) - { - lockdep_assert_held(&dev->mutex); --- -2.51.0 - diff --git a/queue-6.1/driver-core-make-state_synced-device-attribute-write.patch b/queue-6.1/driver-core-make-state_synced-device-attribute-write.patch deleted file mode 100644 index 494423399a..0000000000 --- a/queue-6.1/driver-core-make-state_synced-device-attribute-write.patch +++ /dev/null @@ -1,125 +0,0 @@ -From 6ad71de4f55d593d05c06ec6c68424e5d971c907 Mon Sep 17 00:00:00 2001 -From: Sasha Levin -Date: Fri, 3 Mar 2023 16:53:54 -0800 -Subject: driver core: Make state_synced device attribute writeable - -From: Saravana Kannan - -[ Upstream commit f8fb576658a3e19796e2e1a12a5ec8f44dac02b6 ] - -If the file is written to and sync_state() hasn't been called for the -device yet, then call sync_state() for the device independent of the -state of its consumers. - -This is useful for supplier devices that have one or more consumers that -don't have a driver but the consumers are in a state that don't use the -resources supplied by the supplier device. - -This gives finer grained control than using the -fw_devlink.sync_state=timeout kernel commandline parameter. - -Signed-off-by: Saravana Kannan -Link: https://lore.kernel.org/r/20230304005355.746421-3-saravanak@google.com -Signed-off-by: Greg Kroah-Hartman -Stable-dep-of: dc23806a7c47 ("driver core: enforce device_lock for driver_match_device()") -Signed-off-by: Sasha Levin ---- - .../ABI/testing/sysfs-devices-state_synced | 5 ++++ - drivers/base/base.h | 8 +++++++ - drivers/base/core.c | 5 +--- - drivers/base/dd.c | 23 ++++++++++++++++++- - 4 files changed, 36 insertions(+), 5 deletions(-) - -diff --git a/Documentation/ABI/testing/sysfs-devices-state_synced b/Documentation/ABI/testing/sysfs-devices-state_synced -index 0c922d7d02fc2..c64636ddac410 100644 ---- a/Documentation/ABI/testing/sysfs-devices-state_synced -+++ b/Documentation/ABI/testing/sysfs-devices-state_synced -@@ -21,4 +21,9 @@ Description: - at the time the kernel starts are not affected or limited in - any way by sync_state() callbacks. - -+ Writing "1" to this file will force a call to the device's -+ sync_state() function if it hasn't been called already. The -+ sync_state() call happens independent of the state of the -+ consumer devices. -+ - -diff --git a/drivers/base/base.h b/drivers/base/base.h -index b902d1ecc247f..2a6cf004dedc3 100644 ---- a/drivers/base/base.h -+++ b/drivers/base/base.h -@@ -148,6 +148,14 @@ static inline int driver_match_device(struct device_driver *drv, - } - extern bool driver_allows_async_probing(struct device_driver *drv); - -+static inline void dev_sync_state(struct device *dev) -+{ -+ if (dev->bus->sync_state) -+ dev->bus->sync_state(dev); -+ else if (dev->driver && dev->driver->sync_state) -+ dev->driver->sync_state(dev); -+} -+ - extern int driver_add_groups(struct device_driver *drv, - const struct attribute_group **groups); - extern void driver_remove_groups(struct device_driver *drv, -diff --git a/drivers/base/core.c b/drivers/base/core.c -index d985c4b87de5f..0f062032725ce 100644 ---- a/drivers/base/core.c -+++ b/drivers/base/core.c -@@ -1232,10 +1232,7 @@ static void device_links_flush_sync_list(struct list_head *list, - if (dev != dont_lock_dev) - device_lock(dev); - -- if (dev->bus->sync_state) -- dev->bus->sync_state(dev); -- else if (dev->driver && dev->driver->sync_state) -- dev->driver->sync_state(dev); -+ dev_sync_state(dev); - - if (dev != dont_lock_dev) - device_unlock(dev); -diff --git a/drivers/base/dd.c b/drivers/base/dd.c -index dbbe2cebb8917..6ad1b6eae65d6 100644 ---- a/drivers/base/dd.c -+++ b/drivers/base/dd.c -@@ -512,6 +512,27 @@ EXPORT_SYMBOL_GPL(device_bind_driver); - static atomic_t probe_count = ATOMIC_INIT(0); - static DECLARE_WAIT_QUEUE_HEAD(probe_waitqueue); - -+static ssize_t state_synced_store(struct device *dev, -+ struct device_attribute *attr, -+ const char *buf, size_t count) -+{ -+ int ret = 0; -+ -+ if (strcmp("1", buf)) -+ return -EINVAL; -+ -+ device_lock(dev); -+ if (!dev->state_synced) { -+ dev->state_synced = true; -+ dev_sync_state(dev); -+ } else { -+ ret = -EINVAL; -+ } -+ device_unlock(dev); -+ -+ return ret ? ret : count; -+} -+ - static ssize_t state_synced_show(struct device *dev, - struct device_attribute *attr, char *buf) - { -@@ -523,7 +544,7 @@ static ssize_t state_synced_show(struct device *dev, - - return sysfs_emit(buf, "%u\n", val); - } --static DEVICE_ATTR_RO(state_synced); -+static DEVICE_ATTR_RW(state_synced); - - static void device_unbind_cleanup(struct device *dev) - { --- -2.51.0 - diff --git a/queue-6.1/series b/queue-6.1/series index 99ec6cce7c..84284d1574 100644 --- a/queue-6.1/series +++ b/queue-6.1/series @@ -39,8 +39,6 @@ kvm-x86-ignore-ebusy-when-checking-nested-events-fro.patch drm-tegra-dsi-fix-device-leak-on-probe.patch bus-omap-ocp2scp-convert-to-platform-remove-callback.patch bus-omap-ocp2scp-fix-of-populate-on-driver-rebind.patch -driver-core-make-state_synced-device-attribute-write.patch -driver-core-add-a-guard-definition-for-the-device_lo.patch ext4-make-ext4_es_remove_extent-return-void.patch ext4-get-rid-of-ppath-in-ext4_find_extent.patch ext4-get-rid-of-ppath-in-ext4_ext_create_new_leaf.patch