6.1.76-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 130/185 xfs: read only mounts with fsopen mount API are busted
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Chinner <[email protected]>
commit d8d222e09dab84a17bb65dda4b94d01c565f5327 upstream.
Recently xfs/513 started failing on my test machines testing "-o ro,norecovery" mount options. This was being emitted in dmesg:
[ 9906.932724] XFS (pmem0): no-recovery mounts must be read-only.
Turns out, readonly mounts with the fsopen()/fsconfig() mount API have been busted since day zero. It's only taken 5 years for debian unstable to start using this "new" mount API, and shortly after this I noticed xfs/513 had started to fail as per above.
The syscall trace is:
fsopen("xfs", FSOPEN_CLOEXEC) = 3mount_setattr(-1, NULL, 0, NULL, 0) = -1 EINVAL (Invalid argument)
.....fsconfig(3, FSCONFIG_SET_STRING, "source", "/dev/pmem0", 0) = 0 fsconfig(3, FSCONFIG_SET_FLAG, "ro", NULL, 0) = 0fsconfig(3, FSCONFIG_SET_FLAG, "norecovery", NULL, 0) = 0 fsconfig(3, FSCONFIG_CMD_CREATE, NULL, NULL, 0) = -1 EINVAL (Invalid argument)
close(3) = 0
Showing that the actual mount instantiation (FSCONFIG_CMD_CREATE) is what threw out the error.
During mount instantiation, we call xfs_fs_validate_params() which does:
/* No recovery flag requires a read-only mount */
if (xfs_has_norecovery(mp) && !xfs_is_readonly(mp)) {
xfs_warn(mp, "no-recovery mounts must be read-only.");
return -EINVAL;
}and xfs_is_readonly() checks internal mount flags for read only state. This state is set in xfs_init_fs_context() from the context superblock flag state:
/*
* Copy binary VFS mount flags we are interested in.
*/
if (fc->sb_flags & SB_RDONLY)
set_bit(XFS_OPSTATE_READONLY, &mp->m_opstate);With the old mount API, all of the VFS specific superblock flags had already been parsed and set before xfs_init_fs_context() is called, so this all works fine.
However, in the brave new fsopen/fsconfig world, xfs_init_fs_context() is called from fsopen() context, before any VFS superblock have been set or parsed. Hence if we use fsopen(), the internal XFS readonly state is *never set*. Hence anything that depends on xfs_is_readonly() actually returning true for read only mounts is broken if fsopen() has been used to mount the filesystem.
Fix this by moving this internal state initialisation to xfs_fs_fill_super() before we attempt to validate the parameters that have been set prior to the FSCONFIG_CMD_CREATE call being made.
--- fs/xfs/xfs_super.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-)
fs/xfs/xfs_super.c +17 -10
@@ -1458,6 +1458,18 @@ xfs_fs_fill_super( mp->m_super = sb; +/* +* Copy VFS mount flags from the context now that all parameter parsing +* is guaranteed to have been completed by either the old mount API or +* the newer fsopen/fsconfig API. +*/ +if (fc->sb_flags &SB_RDONLY ) +set_bit (XFS_OPSTATE_READONLY , &mp->m_opstate); +if (fc->sb_flags &SB_DIRSYNC ) + mp->m_features |=XFS_FEAT_DIRSYNC ; +if (fc->sb_flags &SB_SYNCHRONOUS ) + mp->m_features |=XFS_FEAT_WSYNC ; + error =xfs_fs_validate_params (mp);if (error) goto out_free_names;
@@ -1915,6 +1927,11 @@ static const struct fs_context_operation .free = xfs_fs_free, }; +/* +* WARNING: do not initialise any parameters in this function that depend on +* mount option parsing having already been performed as this can be called from +* fsopen() before any parameters have been set. +*/ static int xfs_init_fs_context (struct fs_context *fc) {
@@ -1947,16 +1964,6 @@ static int xfs_init_fs_context( mp->m_logbsize =-1 ; mp->m_allocsize_log =16 ;/* 64k */ -/* -* Copy binary VFS mount flags we are interested in. -*/ -if (fc->sb_flags &SB_RDONLY ) -set_bit (XFS_OPSTATE_READONLY , &mp->m_opstate); -if (fc->sb_flags &SB_DIRSYNC ) - mp->m_features |=XFS_FEAT_DIRSYNC ; -if (fc->sb_flags &SB_SYNCHRONOUS ) - mp->m_features |=XFS_FEAT_WSYNC ; - fc->s_fs_info = mp; fc->ops = &xfs_context_ops;
Greg Kroah-Hartman
maintainerPATCH 131/185 gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit 805c74eac8cb306dc69b87b6b066ab4da77ceaf1 upstream.
Spurious wakeups are reported on the GPD G1619-04 which can be absolved by programming the GPIO to ignore wakeups.
--- drivers/gpio/gpiolib-acpi.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/gpio/gpiolib-acpi.c +14 -0
@@ -1626,6 +1626,20 @@ static const struct dmi_system_id gpioli .ignore_wake = "ELAN0415:00@9", }, }, + { + /* + * Spurious wakeups from TP_ATTN# pin + * Found in BIOS 0.35 + * https://gitlab.freedesktop.org/drm/amd/-/issues/3073 + */ + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "GPD"), + DMI_MATCH(DMI_PRODUCT_NAME, "G1619-04"), + }, + .driver_data = &(struct acpi_gpiolib_dmi_quirk) { + .ignore_wake = "PNP0C50:00@8", + }, + }, {} /* Terminating entry */ };
Greg Kroah-Hartman
maintainerPATCH 132/185 cpufreq: intel_pstate: Refine computation of P-state for given frequency
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
commit 192cdb1c907fd8df2d764c5bb17496e415e59391 upstream.
On systems using HWP, if a given frequency is equal to the maximum turbo frequency or the maximum non-turbo frequency, the HWP performance level corresponding to it is already known and can be used directly without any computation.
Accordingly, adjust the code to use the known HWP performance levels in the cases mentioned above.
This also helps to avoid limiting CPU capacity artificially in some cases when the BIOS produces the HWP_CAP numbers using a different E-core-to-P-core performance scaling factor than expected by the kernel.
--- drivers/cpufreq/intel_pstate.c | 55 +++++++++++++++++++++++++---------------- 1 file changed, 34 insertions(+), 21 deletions(-)
drivers/cpufreq/intel_pstate.c +34 -21
@@ -493,6 +493,30 @@ static inline int intel_pstate_get_cppc_ }#endif /* CONFIG_ACPI_CPPC_LIB */ +static int intel_pstate_freq_to_hwp_rel (struct cpudata *cpu,int freq, +unsigned int relation) +{ +if (freq == cpu->pstate.turbo_freq) +return cpu->pstate.turbo_pstate; + +if (freq == cpu->pstate.max_freq) +return cpu->pstate.max_pstate; + +switch (relation) { +case CPUFREQ_RELATION_H : +return freq / cpu->pstate.scaling; +case CPUFREQ_RELATION_C : +return DIV_ROUND_CLOSEST (freq, cpu->pstate.scaling); + } + +return DIV_ROUND_UP (freq, cpu->pstate.scaling); +} + +static int intel_pstate_freq_to_hwp (struct cpudata *cpu,int freq) +{ +return intel_pstate_freq_to_hwp_rel (cpu, freq,CPUFREQ_RELATION_L ); +} +/** * intel_pstate_hybrid_hwp_adjust - Calibrate HWP performance levels. * @cpu: Target CPU.
@@ -510,6 +534,7 @@ static void intel_pstate_hybrid_hwp_adjuint perf_ctl_scaling = cpu->pstate.perf_ctl_scaling;int perf_ctl_turbo = pstate_funcs.get_turbo (cpu->cpu);int scaling = cpu->pstate.scaling; +int freq;pr_debug ("CPU%d: perf_ctl_max_phys = %d\n" , cpu->cpu, perf_ctl_max_phys);pr_debug ("CPU%d: perf_ctl_turbo = %d\n" , cpu->cpu, perf_ctl_turbo);
@@ -523,16 +548,16 @@ static void intel_pstate_hybrid_hwp_adju cpu->pstate.max_freq =rounddown (cpu->pstate.max_pstate * scaling, perf_ctl_scaling); - cpu->pstate.max_pstate_physical = -DIV_ROUND_UP (perf_ctl_max_phys * perf_ctl_scaling, - scaling); + freq = perf_ctl_max_phys * perf_ctl_scaling; + cpu->pstate.max_pstate_physical =intel_pstate_freq_to_hwp (cpu, freq); - cpu->pstate.min_freq = cpu->pstate.min_pstate * perf_ctl_scaling; + freq = cpu->pstate.min_pstate * perf_ctl_scaling; + cpu->pstate.min_freq = freq;/* * Cast the min P-state value retrieved via pstate_funcs.get_min() to * the effective range of HWP performance levels. */ - cpu->pstate.min_pstate =DIV_ROUND_UP (cpu->pstate.min_freq, scaling); + cpu->pstate.min_pstate =intel_pstate_freq_to_hwp (cpu, freq); }static inline void update_turbo_state (void )
@@ -2493,13 +2518,12 @@ static void intel_pstate_update_perf_lim* abstract values to represent performance rather than pure ratios. */ if (hwp_active && cpu->pstate.scaling != perf_ctl_scaling) { -int scaling = cpu->pstate.scaling;int freq; freq = max_policy_perf * perf_ctl_scaling; - max_policy_perf =DIV_ROUND_UP (freq, scaling); + max_policy_perf =intel_pstate_freq_to_hwp (cpu, freq); freq = min_policy_perf * perf_ctl_scaling; - min_policy_perf =DIV_ROUND_UP (freq, scaling); + min_policy_perf =intel_pstate_freq_to_hwp (cpu, freq); } pr_debug("cpu:%d min_policy_perf:%d max_policy_perf:%d\n",
@@ -2873,18 +2897,7 @@ static int intel_cpufreq_target(struct ccpufreq_freq_transition_begin (policy, &freqs); -switch (relation) { -case CPUFREQ_RELATION_L : - target_pstate =DIV_ROUND_UP (freqs.new, cpu->pstate.scaling); -break ; -case CPUFREQ_RELATION_H : - target_pstate = freqs.new / cpu->pstate.scaling; -break ; -default : - target_pstate =DIV_ROUND_CLOSEST (freqs.new, cpu->pstate.scaling); -break ; - } - + target_pstate =intel_pstate_freq_to_hwp_rel (cpu, freqs.new, relation); target_pstate =intel_cpufreq_update_pstate (policy, target_pstate, false); freqs.new = target_pstate * cpu->pstate.scaling;
@@ -2902,7 +2915,7 @@ static unsigned int intel_cpufreq_fast_supdate_turbo_state (); - target_pstate =DIV_ROUND_UP (target_freq, cpu->pstate.scaling); + target_pstate =intel_pstate_freq_to_hwp (cpu, target_freq); target_pstate =intel_cpufreq_update_pstate (policy, target_pstate, true);
Greg Kroah-Hartman
maintainerPATCH 133/185 drm: Dont unref the same fb many times by mistake due to deadlock handling
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit cb4daf271302d71a6b9a7c01bd0b6d76febd8f0c upstream.
If we get a deadlock after the fb lookup in drm_mode_page_flip_ioctl() we proceed to unref the fb and then retry the whole thing from the top. But we forget to reset the fb pointer back to NULL, and so if we then get another error during the retry, before the fb lookup, we proceed the unref the same fb again without having gotten another reference. The end result is that the fb will (eventually) end up being freed while it's still in use.
Reset fb to NULL once we've unreffed it to avoid doing it again until we've done another fb lookup.
This turned out to be pretty easy to hit on a DG2 when doing async flips (and CONFIG_DEBUG_WW_MUTEX_SLOWPATH=y). The first symptom I saw that drm_closefb() simply got stuck in a busy loop while walking the framebuffer list. Fortunately I was able to convince it to oops instead, and from there it was easier to track down the culprit.
--- drivers/gpu/drm/drm_plane.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/drm_plane.c +1 -0
@@ -1382,6 +1382,7 @@ retry: out:if (fb)drm_framebuffer_put (fb); + fb =NULL ;if (plane->old_fb)drm_framebuffer_put (plane->old_fb); plane->old_fb =NULL ;
Greg Kroah-Hartman
maintainerPATCH 134/185 drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 914437992876838662c968cb416f832110fb1093 upstream.
The i2c_master_send/recv() functions return negative error codes or the number of bytes that were able to be sent/received. This code has two problems. 1) Instead of checking if all the bytes were sent or received, it checks that at least one byte was sent or received.
2) If there was a partial send/receive then we should return a negative error code but this code returns success.
--- drivers/gpu/drm/bridge/nxp-ptn3460.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/bridge/nxp-ptn3460.c +5 -5
@@ -56,13 +56,13 @@ static int ptn3460_read_bytes(struct ptn ret =i2c_master_send (ptn_bridge->client, &addr,1 );if (ret <=0 ) {DRM_ERROR ("Failed to send i2c command, ret=%d\n" , ret); -return ret; +return ret ?: -EIO ; } ret =i2c_master_recv (ptn_bridge->client, buf, len); -if (ret <=0 ) { +if (ret != len) {DRM_ERROR ("Failed to recv i2c data, ret=%d\n" , ret); -return ret; +return ret <0 ? ret : -EIO ; }return 0 ;
@@ -78,9 +78,9 @@ static int ptn3460_write_byte(struct ptn buf[1 ] = val; ret =i2c_master_send (ptn_bridge->client, buf,ARRAY_SIZE (buf)); -if (ret <=0 ) { +if (ret !=ARRAY_SIZE (buf)) {DRM_ERROR ("Failed to send i2c command, ret=%d\n" , ret); -return ret; +return ret <0 ? ret : -EIO ; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 135/185 drm/tidss: Fix atomic_flush check
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomi Valkeinen <[email protected]>
commit 95d4b471953411854f9c80b568da7fcf753f3801 upstream.
tidss_crtc_atomic_flush() checks if the crtc is enabled, and if not, returns immediately as there's no reason to do any register changes.
However, the code checks for 'crtc->state->enable', which does not reflect the actual HW state. We should instead look at the 'crtc->state->active' flag.
This causes the tidss_crtc_atomic_flush() to proceed with the flush even if the active state is false, which then causes us to hit the WARN_ON(!crtc->state->event) check.
Fix this by checking the active flag, and while at it, fix the related debug print which had "active" and "needs modeset" wrong way.
--- drivers/gpu/drm/tidss/tidss_crtc.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/tidss/tidss_crtc.c +5 -5
@@ -170,13 +170,13 @@ static void tidss_crtc_atomic_flush(strustruct tidss_device *tidss =to_tidss (ddev);unsigned long flags; -dev_dbg (ddev->dev, -"%s: %s enabled %d, needs modeset %d, event %p\n" , __func__, - crtc->name,drm_atomic_crtc_needs_modeset (crtc->state), - crtc->state->enable, crtc->state->event); +dev_dbg (ddev->dev,"%s: %s is %sactive, %s modeset, event %p\n" , + __func__, crtc->name, crtc->state->active ?"" :"not " , +drm_atomic_crtc_needs_modeset (crtc->state) ?"needs" :"doesn't need" , + crtc->state->event);/* There is nothing to do if CRTC is not going to be enabled. */ -if (!crtc->state->enable) +if (!crtc->state->active)return ;/*
Greg Kroah-Hartman
maintainerPATCH 136/185 drm/amd/display: Disable PSR-SU on Parade 0803 TCON again
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
commit 571c2fa26aa654946447c282a09d40a56c7ff128 upstream.
When screen brightness is rapidly changed and PSR-SU is enabled the display hangs on panels with this TCON even on the latest DCN 3.1.4 microcode (0x8002a81 at this time).
This was disabled previously as commit 072030b17830 ("drm/amd: Disable PSR-SU on Parade 0803 TCON") but reverted as commit 1e66a17ce546 ("Revert "drm/amd: Disable PSR-SU on Parade 0803 TCON"") in favor of testing for a new enough microcode (commit cd2e31a9ab93 ("drm/amd/display: Set minimum requirement for using PSR-SU on Phoenix")).
As hangs are still happening specifically with this TCON, disable PSR-SU again for it until it can be root caused.
--- drivers/gpu/drm/amd/display/modules/power/power_helpers.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/display/modules/power/power_helpers.c +2 -0
@@ -818,6 +818,8 @@ bool is_psr_su_specific_panel(struct dc_ isPSRSUSupported = false; else if (dpcd_caps->sink_dev_id_str[1] == 0x08 && dpcd_caps->sink_dev_id_str[0] == 0x03) isPSRSUSupported = false; + else if (dpcd_caps->sink_dev_id_str[1] == 0x08 && dpcd_caps->sink_dev_id_str[0] == 0x03) + isPSRSUSupported = false; else if (dpcd_caps->psr_info.force_psrsu_cap == 0x1) isPSRSUSupported = true; }
Greg Kroah-Hartman
maintainerPATCH 137/185 platform/x86: intel-uncore-freq: Fix types in sysfs callbacks
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nathan Chancellor <[email protected]>
commit 416de0246f35f43d871a57939671fe814f4455ee upstream.
When booting a kernel with CONFIG_CFI_CLANG, there is a CFI failure when accessing any of the values under /sys/devices/system/cpu/intel_uncore_frequency/package_00_die_00:
$ cat /sys/devices/system/cpu/intel_uncore_frequency/package_00_die_00/max_freq_khz fish: Job 1, 'cat /sys/devices/system/cpu/int…' terminated by signal SIGSEGV (Address boundary error)
$ sudo dmesg &| grep 'CFI failure' [ 170.953925] CFI failure at kobj_attr_show+0x19/0x30 (target: show_max_freq_khz+0x0/0xc0 [intel_uncore_frequency_common]; expected type: 0xd34078c5
The sysfs callback functions such as show_domain_id() are written as if they are going to be called by dev_attr_show() but as the above message shows, they are instead called by kobj_attr_show(). kCFI checks that the destination of an indirect jump has the exact same type as the prototype of the function pointer it is called through and fails when they do not.
These callbacks are called through kobj_attr_show() because uncore_root_kobj was initialized with kobject_create_and_add(), which means uncore_root_kobj has a ->sysfs_ops of kobj_sysfs_ops from kobject_create(), which uses kobj_attr_show() as its ->show() value.
The only reason there has not been a more noticeable problem until this point is that 'struct kobj_attribute' and 'struct device_attribute' have the same layout, so getting the callback from container_of() works the same with either value.
Change all the callbacks and their uses to be compatible with kobj_attr_show() and kobj_attr_store(), which resolves the kCFI failure and allows the sysfs files to work properly.
--- drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c | 64 +++++----- drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h | 20 +-- 2 files changed, 42 insertions(+), 42 deletions(-)
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.c +32 -32
@@ -74,30 +74,30 @@ static ssize_t show_perf_status_freq_khz }#define store_uncore_min_max (name, min_max) \ - static ssize_t store_##name(struct device *dev, \ - struct device_attribute *attr, \ + static ssize_t store_##name(struct kobject *kobj, \ + struct kobj_attribute *attr, \ const char *buf, size_t count) \ { \ - struct uncore_data *data = container_of(attr, struct uncore_data, name##_dev_attr);\ + struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\ \ return store_min_max_freq_khz(data, buf, count, \ min_max); \ }#define show_uncore_min_max (name, min_max) \ - static ssize_t show_##name(struct device *dev, \ - struct device_attribute *attr, char *buf)\ + static ssize_t show_##name(struct kobject *kobj, \ + struct kobj_attribute *attr, char *buf)\ { \ - struct uncore_data *data = container_of(attr, struct uncore_data, name##_dev_attr);\ + struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\ \ return show_min_max_freq_khz(data, buf, min_max); \ }#define show_uncore_perf_status (name) \ - static ssize_t show_##name(struct device *dev, \ - struct device_attribute *attr, char *buf)\ + static ssize_t show_##name(struct kobject *kobj, \ + struct kobj_attribute *attr, char *buf)\ { \ - struct uncore_data *data = container_of(attr, struct uncore_data, name##_dev_attr);\ + struct uncore_data *data = container_of(attr, struct uncore_data, name##_kobj_attr);\ \ return show_perf_status_freq_khz(data, buf); \ }
@@ -111,11 +111,11 @@ show_uncore_min_max(max_freq_khz, 1);show_uncore_perf_status (current_freq_khz);#define show_uncore_data (member_name) \ - static ssize_t show_##member_name(struct device *dev, \ - struct device_attribute *attr, char *buf)\ + static ssize_t show_##member_name(struct kobject *kobj, \ + struct kobj_attribute *attr, char *buf)\ { \ struct uncore_data *data = container_of(attr, struct uncore_data,\ - member_name##_dev_attr);\ + member_name##_kobj_attr);\ \ return sysfs_emit(buf, "%u\n", \ data->member_name); \
@@ -126,29 +126,29 @@ show_uncore_data(initial_max_freq_khz);#define init_attribute_rw (_name) \ do { \ - sysfs_attr_init(&data->_name##_dev_attr.attr); \ - data->_name##_dev_attr.show = show_##_name; \ - data->_name##_dev_attr.store = store_##_name; \ - data->_name##_dev_attr.attr.name = #_name; \ - data->_name##_dev_attr.attr.mode = 0644; \ + sysfs_attr_init(&data->_name##_kobj_attr.attr); \ + data->_name##_kobj_attr.show = show_##_name; \ + data->_name##_kobj_attr.store = store_##_name; \ + data->_name##_kobj_attr.attr.name = #_name; \ + data->_name##_kobj_attr.attr.mode = 0644; \ } while (0)#define init_attribute_ro (_name) \ do { \ - sysfs_attr_init(&data->_name##_dev_attr.attr); \ - data->_name##_dev_attr.show = show_##_name; \ - data->_name##_dev_attr.store = NULL; \ - data->_name##_dev_attr.attr.name = #_name; \ - data->_name##_dev_attr.attr.mode = 0444; \ + sysfs_attr_init(&data->_name##_kobj_attr.attr); \ + data->_name##_kobj_attr.show = show_##_name; \ + data->_name##_kobj_attr.store = NULL; \ + data->_name##_kobj_attr.attr.name = #_name; \ + data->_name##_kobj_attr.attr.mode = 0444; \ } while (0)#define init_attribute_root_ro (_name) \ do { \ - sysfs_attr_init(&data->_name##_dev_attr.attr); \ - data->_name##_dev_attr.show = show_##_name; \ - data->_name##_dev_attr.store = NULL; \ - data->_name##_dev_attr.attr.name = #_name; \ - data->_name##_dev_attr.attr.mode = 0400; \ + sysfs_attr_init(&data->_name##_kobj_attr.attr); \ + data->_name##_kobj_attr.show = show_##_name; \ + data->_name##_kobj_attr.store = NULL; \ + data->_name##_kobj_attr.attr.name = #_name; \ + data->_name##_kobj_attr.attr.mode = 0400; \ } while (0)static int create_attr_group (struct uncore_data *data,char *name)
@@ -161,14 +161,14 @@ static int create_attr_group(struct uncoinit_attribute_ro (initial_max_freq_khz);init_attribute_root_ro (current_freq_khz); - data->uncore_attrs[index++] = &data->max_freq_khz_dev_attr.attr; - data->uncore_attrs[index++] = &data->min_freq_khz_dev_attr.attr; - data->uncore_attrs[index++] = &data->initial_min_freq_khz_dev_attr.attr; - data->uncore_attrs[index++] = &data->initial_max_freq_khz_dev_attr.attr; + data->uncore_attrs[index++] = &data->max_freq_khz_kobj_attr.attr; + data->uncore_attrs[index++] = &data->min_freq_khz_kobj_attr.attr; + data->uncore_attrs[index++] = &data->initial_min_freq_khz_kobj_attr.attr; + data->uncore_attrs[index++] = &data->initial_max_freq_khz_kobj_attr.attr; ret =uncore_read_freq (data, &freq);if (!ret) - data->uncore_attrs[index++] = &data->current_freq_khz_dev_attr.attr; + data->uncore_attrs[index++] = &data->current_freq_khz_kobj_attr.attr; data->uncore_attrs[index] =NULL ;
drivers/platform/x86/intel/uncore-frequency/uncore-frequency-common.h +10 -10
@@ -23,11 +23,11 @@* @die_id: Die id for this instance * @name: Sysfs entry name for this instance * @uncore_attr_group: Attribute group storage -* @max_freq_khz_dev_attr: Storage for device attribute max_freq_khz -* @mix_freq_khz_dev_attr: Storage for device attribute min_freq_khz -* @initial_max_freq_khz_dev_attr: Storage for device attribute initial_max_freq_khz -* @initial_min_freq_khz_dev_attr: Storage for device attribute initial_min_freq_khz -* @current_freq_khz_dev_attr: Storage for device attribute current_freq_khz +* @max_freq_khz_dev_attr: Storage for kobject attribute max_freq_khz +* @mix_freq_khz_dev_attr: Storage for kobject attribute min_freq_khz +* @initial_max_freq_khz_dev_attr: Storage for kobject attribute initial_max_freq_khz +* @initial_min_freq_khz_dev_attr: Storage for kobject attribute initial_min_freq_khz +* @current_freq_khz_dev_attr: Storage for kobject attribute current_freq_khz * @uncore_attrs: Attribute storage for group creation * * This structure is used to encapsulate all data related to uncore sysfs
@@ -44,11 +44,11 @@ struct uncore_data {char name[32 ];struct attribute_group uncore_attr_group; -struct device_attribute max_freq_khz_dev_attr; -struct device_attribute min_freq_khz_dev_attr; -struct device_attribute initial_max_freq_khz_dev_attr; -struct device_attribute initial_min_freq_khz_dev_attr; -struct device_attribute current_freq_khz_dev_attr; +struct kobj_attribute max_freq_khz_kobj_attr; +struct kobj_attribute min_freq_khz_kobj_attr; +struct kobj_attribute initial_max_freq_khz_kobj_attr; +struct kobj_attribute initial_min_freq_khz_kobj_attr; +struct kobj_attribute current_freq_khz_kobj_attr;struct attribute *uncore_attrs[6 ]; };
Greg Kroah-Hartman
maintainerPATCH 138/185 drm/bridge: nxp-ptn3460: simplify some error checking
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dan Carpenter <[email protected]>
commit 28d3d0696688154cc04983f343011d07bf0508e4 upstream.
The i2c_master_send/recv() functions return negative error codes or they return "len" on success. So the error handling here can be written as just normal checks for "if (ret < 0) return ret;". No need to complicate things.
Btw, in this code the "len" parameter can never be zero, but even if it were, then I feel like this would still be the best way to write it.
--- drivers/gpu/drm/bridge/nxp-ptn3460.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/bridge/nxp-ptn3460.c +6 -6
@@ -54,15 +54,15 @@ static int ptn3460_read_bytes(struct ptnint ret; ret =i2c_master_send (ptn_bridge->client, &addr,1 ); -if (ret <=0 ) { +if (ret <0 ) {DRM_ERROR ("Failed to send i2c command, ret=%d\n" , ret); -return ret ?: -EIO ; +return ret; } ret =i2c_master_recv (ptn_bridge->client, buf, len); -if (ret != len) { +if (ret <0 ) {DRM_ERROR ("Failed to recv i2c data, ret=%d\n" , ret); -return ret <0 ? ret : -EIO ; +return ret; }return 0 ;
@@ -78,9 +78,9 @@ static int ptn3460_write_byte(struct ptn buf[1 ] = val; ret =i2c_master_send (ptn_bridge->client, buf,ARRAY_SIZE (buf)); -if (ret !=ARRAY_SIZE (buf)) { +if (ret <0 ) {DRM_ERROR ("Failed to send i2c command, ret=%d\n" , ret); -return ret <0 ? ret : -EIO ; +return ret; }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 139/185 drm/amd/display: Port DENTIST hang and TDR fixes to OTG disable W/A
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Kazlauskas <[email protected]>
commit 4b56f7d47be87cde5f368b67bc7fac53a2c3e8d2 upstream.
[Why]
We can experience DENTIST hangs during optimize_bandwidth or TDRs if FIFO is toggled and hangs.
[How]
Port the DCN35 fixes to DCN314.
--- drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 21 ++++------ 1 file changed, 9 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +9 -12
@@ -131,30 +131,27 @@ static int dcn314_get_active_display_cntreturn display_count; } -static void dcn314_disable_otg_wa (struct clk_mgr *clk_mgr_base,struct dc_state *context,bool disable) +static void dcn314_disable_otg_wa (struct clk_mgr *clk_mgr_base,struct dc_state *context, +bool safe_to_lower,bool disable) {struct dc *dc = clk_mgr_base->ctx->dc;int i;for (i =0 ; i < dc->res_pool->pipe_count; ++i) { -struct pipe_ctx *pipe = &dc->current_state->res_ctx.pipe_ctx[i]; +struct pipe_ctx *pipe = safe_to_lower + ? &context->res_ctx.pipe_ctx[i] + : &dc->current_state->res_ctx.pipe_ctx[i];if (pipe->top_pipe || pipe->prev_odm_pipe)continue ;if (pipe->stream && (pipe->stream->dpms_off ||dc_is_virtual_signal (pipe->stream->signal))) { -struct stream_encoder *stream_enc = pipe->stream_res.stream_enc; -if (disable) { -if (stream_enc && stream_enc->funcs->disable_fifo) - pipe->stream_res.stream_enc->funcs->disable_fifo (stream_enc); +if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc) + pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg); - pipe->stream_res.tg->funcs->immediate_disable_crtc (pipe->stream_res.tg);reset_sync_context_for_pipe (dc, context, i); }else { pipe->stream_res.tg->funcs->enable_crtc (pipe->stream_res.tg); - -if (stream_enc && stream_enc->funcs->enable_fifo) - pipe->stream_res.stream_enc->funcs->enable_fifo (stream_enc); } } }
@@ -254,11 +251,11 @@ void dcn314_update_clocks(struct clk_mgr }if (should_set_clock (safe_to_lower, new_clocks->dispclk_khz, clk_mgr_base->clks.dispclk_khz)) { -dcn314_disable_otg_wa (clk_mgr_base, context, true); +dcn314_disable_otg_wa (clk_mgr_base, context, safe_to_lower, true); clk_mgr_base->clks.dispclk_khz = new_clocks->dispclk_khz;dcn314_smu_set_dispclk (clk_mgr, clk_mgr_base->clks.dispclk_khz); -dcn314_disable_otg_wa (clk_mgr_base, context, false); +dcn314_disable_otg_wa (clk_mgr_base, context, safe_to_lower, false); update_dispclk = true; }
Greg Kroah-Hartman
maintainerPATCH 140/185 drm/amdgpu/pm: Fix the power source flag error
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ma Jun <[email protected]>
commit ca1ffb174f16b699c536734fc12a4162097c49f4 upstream.
The power source flag should be updated when
[1] System receives an interrupt indicating that the power source has changed.
[2] System resumes from suspend or runtime suspend
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 13 +++---------- drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c | 2 ++ drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c | 2 ++ 3 files changed, 7 insertions(+), 10 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +3 -10
@@ -24,6 +24,7 @@#include <linux/firmware.h> #include <linux/pci.h> +#include <linux/power_supply.h> #include <linux/reboot.h> #include "amdgpu.h"
@@ -731,16 +732,8 @@ static int smu_late_init(void *handle)* handle the switch automatically. Driver involvement * is unnecessary. */ -if (!smu->dc_controlled_by_gpio) { - ret =smu_set_power_source (smu, - adev->pm.ac_power ?SMU_POWER_SOURCE_AC : -SMU_POWER_SOURCE_DC ); -if (ret) { -dev_err (adev->dev,"Failed to switch to %s mode!\n" , - adev->pm.ac_power ?"AC" :"DC" ); -return ret; - } - } + adev->pm.ac_power =power_supply_is_system_supplied () >0 ; +smu_set_ac_dc (smu);if ((adev->ip_versions[MP1_HWIP ][0 ] ==IP_VERSION (13 ,0 ,1 )) || (adev->ip_versions[MP1_HWIP ][0 ] ==IP_VERSION (13 ,0 ,3 )))
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +2 -0
@@ -1467,10 +1467,12 @@ static int smu_v11_0_irq_process(structcase 0x3 :dev_dbg (adev->dev,"Switched to AC mode!\n" );schedule_work (&smu->interrupt_work); + adev->pm.ac_power = true;break ;case 0x4 :dev_dbg (adev->dev,"Switched to DC mode!\n" );schedule_work (&smu->interrupt_work); + adev->pm.ac_power = false;break ;case 0x7 :/*
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +2 -0
@@ -1415,10 +1415,12 @@ static int smu_v13_0_irq_process(structcase 0x3 :dev_dbg (adev->dev,"Switched to AC mode!\n" );smu_v13_0_ack_ac_dc_interrupt (smu); + adev->pm.ac_power = true;break ;case 0x4 :dev_dbg (adev->dev,"Switched to DC mode!\n" );smu_v13_0_ack_ac_dc_interrupt (smu); + adev->pm.ac_power = false;break ;case 0x7 :/*
Greg Kroah-Hartman
maintainerPATCH 141/185 erofs: get rid of the remaining kmap_atomic()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gao Xiang <[email protected]>
[ Upstream commit 123ec246ebe323d468c5ca996700ea4739d20ddf ]
It's unnecessary to use kmap_atomic() compared with kmap_local_page(). In addition, kmap_atomic() is deprecated now.
Stable-dep-of: 3c12466b6b7b ("erofs: fix lz4 inplace decompression")
--- fs/erofs/decompressor.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-)
fs/erofs/decompressor.c +9 -9
@@ -148,7 +148,7 @@ static void *z_erofs_lz4_handle_overlap(struct z_erofs_lz4_decompress_ctx *ctx, *maptype =0 ;return inpage; } -kunmap_atomic (inpage); +kunmap_local (inpage);might_sleep (); src =erofs_vm_map_ram (rq->in, ctx->inpages);if (!src)
@@ -162,7 +162,7 @@ static void *z_erofs_lz4_handle_overlap(struct z_erofs_lz4_decompress_ctx *ctx, src =erofs_get_pcpubuf (ctx->inpages);if (!src) {DBG_BUGON (1 ); -kunmap_atomic (inpage); +kunmap_local (inpage);return ERR_PTR (-EFAULT ); }
@@ -173,9 +173,9 @@ static void *z_erofs_lz4_handle_overlap(struct z_erofs_lz4_decompress_ctx *ctx, min_t(unsigned int, total, PAGE_SIZE - *inputmargin);if (!inpage) - inpage =kmap_atomic (*in); + inpage =kmap_local_page (*in);memcpy (tmp, inpage + *inputmargin, page_copycnt); -kunmap_atomic (inpage); +kunmap_local (inpage); inpage =NULL ; tmp += page_copycnt; total -= page_copycnt;
@@ -214,7 +214,7 @@ static int z_erofs_lz4_decompress_mem(struct z_erofs_lz4_decompress_ctx *ctx,int ret, maptype;DBG_BUGON (*rq->in ==NULL ); - headpage =kmap_atomic (*rq->in); + headpage =kmap_local_page (*rq->in);/* LZ4 decompression inplace is only safe if zero_padding is enabled */ if (erofs_sb_has_zero_padding (EROFS_SB (rq->sb))) {
@@ -223,7 +223,7 @@ static int z_erofs_lz4_decompress_mem(struct z_erofs_lz4_decompress_ctx *ctx, min_t(unsigned int, rq->inputsize, EROFS_BLKSIZ - rq->pageofs_in));if (ret) { -kunmap_atomic (headpage); +kunmap_local (headpage);return ret; } may_inplace = !((rq->pageofs_in + rq->inputsize) &
@@ -261,7 +261,7 @@ static int z_erofs_lz4_decompress_mem(struct z_erofs_lz4_decompress_ctx *ctx, }if (maptype ==0 ) { -kunmap_atomic (headpage); +kunmap_local (headpage); }else if (maptype ==1 ) {vm_unmap_ram (src, ctx->inpages); }else if (maptype ==2 ) {
@@ -289,7 +289,7 @@ static int z_erofs_lz4_decompress(struct z_erofs_decompress_req *rq,/* one optimized fast path only for non bigpcluster cases yet */ if (ctx.inpages ==1 && ctx.outpages ==1 && !rq->inplace_io) {DBG_BUGON (!*rq->out); - dst =kmap_atomic (*rq->out); + dst =kmap_local_page (*rq->out); dst_maptype =0 ; goto dstmap_out; }
@@ -311,7 +311,7 @@ static int z_erofs_lz4_decompress(struct z_erofs_decompress_req *rq, dstmap_out: ret =z_erofs_lz4_decompress_mem (&ctx, dst + rq->pageofs_out);if (!dst_maptype) -kunmap_atomic (dst); +kunmap_local (dst);else if (dst_maptype ==2 )vm_unmap_ram (dst, ctx.outpages);return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 142/185 erofs: fix lz4 inplace decompression
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Gao Xiang <[email protected]>
[ Upstream commit 3c12466b6b7bf1e56f9b32c366a3d83d87afb4de ]
Currently EROFS can map another compressed buffer for inplace decompression, that was used to handle the cases that some pages of compressed data are actually not in-place I/O.
However, like most simple LZ77 algorithms, LZ4 expects the compressed data is arranged at the end of the decompressed buffer and it explicitly uses memmove() to handle overlapping:
__________________________________________________________
|_ direction of decompression --> ____ |_ compressed data _|
Although EROFS arranges compressed data like this, it typically maps two individual virtual buffers so the relative order is uncertain. Previously, it was hardly observed since LZ4 only uses memmove() for short overlapped literals and x86/arm64 memmove implementations seem to completely cover it up and they don't have this issue. Juhyung reported that EROFS data corruption can be found on a new Intel x86 processor. After some analysis, it seems that recent x86 processors with the new FSRM feature expose this issue with "rep movsb".
Let's strictly use the decompressed buffer for lz4 inplace decompression for now. Later, as an useful improvement, we could try to tie up these two buffers together in the correct order.
--- fs/erofs/decompressor.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-)
fs/erofs/decompressor.c +16 -15
@@ -122,11 +122,11 @@ static int z_erofs_lz4_prepare_dstpages(struct z_erofs_lz4_decompress_ctx *ctx, }static void *z_erofs_lz4_handle_overlap (struct z_erofs_lz4_decompress_ctx *ctx, -void *inpage,unsigned int *inputmargin,int *maptype, -bool may_inplace) +void *inpage,void *out,unsigned int *inputmargin, +int *maptype,bool may_inplace) {struct z_erofs_decompress_req *rq = ctx->rq; -unsigned int omargin, total, i, j; +unsigned int omargin, total, i;struct page **in;void *src, *tmp;
@@ -136,12 +136,13 @@ static void *z_erofs_lz4_handle_overlap(struct z_erofs_lz4_decompress_ctx *ctx, omargin < LZ4_DECOMPRESS_INPLACE_MARGIN(rq->inputsize)) goto docopy; -for (i =0 ; i < ctx->inpages; ++i) { -DBG_BUGON (rq->in[i] ==NULL ); -for (j =0 ; j < ctx->outpages - ctx->inpages + i; ++j) -if (rq->out[j] == rq->in[i]) - goto docopy; - } +for (i =0 ; i < ctx->inpages; ++i) +if (rq->out[ctx->outpages - ctx->inpages + i] != + rq->in[i]) + goto docopy; +kunmap_local (inpage); + *maptype =3 ; +return out + ((ctx->outpages - ctx->inpages) <<PAGE_SHIFT ); }if (ctx->inpages <=1 ) {
@@ -149,7 +150,6 @@ static void *z_erofs_lz4_handle_overlap(struct z_erofs_lz4_decompress_ctx *ctx,return inpage; }kunmap_local (inpage); -might_sleep (); src =erofs_vm_map_ram (rq->in, ctx->inpages);if (!src)return ERR_PTR (-ENOMEM );
@@ -205,12 +205,12 @@ int z_erofs_fixup_insize(struct z_erofs_decompress_req *rq, const char *padbuf, }static int z_erofs_lz4_decompress_mem (struct z_erofs_lz4_decompress_ctx *ctx, -u8 *out) +u8 *dst) {struct z_erofs_decompress_req *rq = ctx->rq;bool support_0padding = false, may_inplace = false;unsigned int inputmargin; -u8 *headpage, *src; +u8 *out, *headpage, *src;int ret, maptype;DBG_BUGON (*rq->in ==NULL );
@@ -231,11 +231,12 @@ static int z_erofs_lz4_decompress_mem(struct z_erofs_lz4_decompress_ctx *ctx, } inputmargin = rq->pageofs_in; - src =z_erofs_lz4_handle_overlap (ctx, headpage, &inputmargin, + src =z_erofs_lz4_handle_overlap (ctx, headpage, dst, &inputmargin, &maptype, may_inplace);if (IS_ERR (src))return PTR_ERR (src); + out = dst + rq->pageofs_out;/* legacy format could compress extra data in a pcluster. */ if (rq->partial_decoding || !support_0padding) ret = LZ4_decompress_safe_partial(src + inputmargin, out,
@@ -266,7 +267,7 @@ static int z_erofs_lz4_decompress_mem(struct z_erofs_lz4_decompress_ctx *ctx,vm_unmap_ram (src, ctx->inpages); }else if (maptype ==2 ) {erofs_put_pcpubuf (src); - }else { + }else if (maptype !=3 ) {DBG_BUGON (1 );return -EFAULT ; }
@@ -309,7 +310,7 @@ static int z_erofs_lz4_decompress(struct z_erofs_decompress_req *rq, } dstmap_out: - ret =z_erofs_lz4_decompress_mem (&ctx, dst + rq->pageofs_out); + ret =z_erofs_lz4_decompress_mem (&ctx, dst);if (!dst_maptype)kunmap_local (dst);else if (dst_maptype ==2 )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 143/185 media: ov13b10: Support device probe in non-zero ACPI D state
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arec Kao <[email protected]>
[ Upstream commit 1af2f618acc1486e3b46cb54cb4891d47bb80c61 ]
Tell ACPI device PM code that the driver supports the device being in non-zero ACPI D state when the driver's probe function is entered.
Also do identification on the first access of the device, whether in probe or when starting streaming.
Stable-dep-of: 7b0454cfd8ed ("media: ov13b10: Enable runtime PM before registering async sub-device")
--- drivers/media/i2c/ov13b10.c | 74 +++++++++++++++++++++++-------------- 1 file changed, 47 insertions(+), 27 deletions(-)
drivers/media/i2c/ov13b10.c +47 -27
@@ -589,6 +589,9 @@ struct ov13b10 {/* Streaming on/off */ bool streaming; + +/* True if the device has been identified */ +bool identified; };#define to_ov13b10 (_sd) container_of(_sd, struct ov13b10, sd)
@@ -1023,12 +1026,42 @@ ov13b10_set_pad_format(struct v4l2_subdev *sd,return 0 ; } +/* Verify chip ID */ +static int ov13b10_identify_module (struct ov13b10 *ov13b) +{ +struct i2c_client *client =v4l2_get_subdevdata (&ov13b->sd); +int ret; +u32 val; + +if (ov13b->identified) +return 0 ; + + ret =ov13b10_read_reg (ov13b,OV13B10_REG_CHIP_ID , +OV13B10_REG_VALUE_24BIT , &val); +if (ret) +return ret; + +if (val !=OV13B10_CHIP_ID ) { +dev_err (&client->dev,"chip id mismatch: %x!=%x\n" , +OV13B10_CHIP_ID , val); +return -EIO ; + } + + ov13b->identified = true; + +return 0 ; +} +static int ov13b10_start_streaming (struct ov13b10 *ov13b) {struct i2c_client *client =v4l2_get_subdevdata (&ov13b->sd);const struct ov13b10_reg_list *reg_list;int ret, link_freq_index; + ret =ov13b10_identify_module (ov13b); +if (ret) +return ret; +/* Get out of from software reset */ ret =ov13b10_write_reg (ov13b,OV13B10_REG_SOFTWARE_RST ,OV13B10_REG_VALUE_08BIT ,OV13B10_SOFTWARE_RST );
@@ -1144,27 +1177,6 @@ static int __maybe_unused ov13b10_resume(struct device *dev)return ret; } -/* Verify chip ID */ -static int ov13b10_identify_module (struct ov13b10 *ov13b) -{ -struct i2c_client *client =v4l2_get_subdevdata (&ov13b->sd); -int ret; -u32 val; - - ret =ov13b10_read_reg (ov13b,OV13B10_REG_CHIP_ID , -OV13B10_REG_VALUE_24BIT , &val); -if (ret) -return ret; - -if (val !=OV13B10_CHIP_ID ) { -dev_err (&client->dev,"chip id mismatch: %x!=%x\n" , -OV13B10_CHIP_ID , val); -return -EIO ; - } - -return 0 ; -} -static const struct v4l2_subdev_video_ops ov13b10_video_ops = { .s_stream = ov13b10_set_stream, };
@@ -1379,6 +1391,7 @@ static int ov13b10_check_hwcfg(struct device *dev)static int ov13b10_probe (struct i2c_client *client) {struct ov13b10 *ov13b; +bool full_power;int ret;/* Check HW config */
@@ -1395,11 +1408,14 @@ static int ov13b10_probe(struct i2c_client *client)/* Initialize subdev */ v4l2_i2c_subdev_init (&ov13b->sd, client, &ov13b10_subdev_ops); -/* Check module identity */ - ret =ov13b10_identify_module (ov13b); -if (ret) { -dev_err (&client->dev,"failed to find sensor: %d\n" , ret); -return ret; + full_power =acpi_dev_state_d0 (&client->dev); +if (full_power) { +/* Check module identity */ + ret =ov13b10_identify_module (ov13b); +if (ret) { +dev_err (&client->dev,"failed to find sensor: %d\n" , ret); +return ret; + } }/* Set default mode to max resolution */
@@ -1431,7 +1447,10 @@ static int ov13b10_probe(struct i2c_client *client)* Device is already turned on by i2c-core with ACPI domain PM. * Enable runtime PM and turn off the device. */ -pm_runtime_set_active (&client->dev); + +/* Set the device's state to active if it's in D0 state. */ +if (full_power) +pm_runtime_set_active (&client->dev);pm_runtime_enable (&client->dev);pm_runtime_idle (&client->dev);
@@ -1480,6 +1499,7 @@ static struct i2c_driver ov13b10_i2c_driver = { }, .probe_new = ov13b10_probe, .remove = ov13b10_remove, + .flags = I2C_DRV_ACPI_WAIVE_D0_PROBE, };module_i2c_driver (ov13b10_i2c_driver);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 144/185 media: ov13b10: Enable runtime PM before registering async sub-device
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bingbu Cao <[email protected]>
[ Upstream commit 7b0454cfd8edb3509619407c3b9f78a6d0dee1a5 ]
As the sensor device maybe accessible right after its async sub-device is registered, such as ipu-bridge will try to power up sensor by sensor's client device's runtime PM from the async notifier callback, if runtime PM is not enabled, it will fail.
So runtime PM should be ready before its async sub-device is registered and accessible by others.
--- drivers/media/i2c/ov13b10.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/media/i2c/ov13b10.c +9 -5
@@ -1439,24 +1439,27 @@ static int ov13b10_probe(struct i2c_client *client) goto error_handler_free; } - ret =v4l2_async_register_subdev_sensor (&ov13b->sd); -if (ret <0 ) - goto error_media_entity;/* * Device is already turned on by i2c-core with ACPI domain PM. * Enable runtime PM and turn off the device. */ -/* Set the device's state to active if it's in D0 state. */ if (full_power)pm_runtime_set_active (&client->dev);pm_runtime_enable (&client->dev);pm_runtime_idle (&client->dev); + ret =v4l2_async_register_subdev_sensor (&ov13b->sd); +if (ret <0 ) + goto error_media_entity_runtime_pm; +return 0 ; -error_media_entity: +error_media_entity_runtime_pm: +pm_runtime_disable (&client->dev); +if (full_power) +pm_runtime_set_suspended (&client->dev);media_entity_cleanup (&ov13b->sd.entity); error_handler_free:
@@ -1476,6 +1479,7 @@ static void ov13b10_remove(struct i2c_client *client)ov13b10_free_controls (ov13b);pm_runtime_disable (&client->dev); +pm_runtime_set_suspended (&client->dev); }static const struct dev_pm_ops ov13b10_pm_ops = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 145/185 bus: mhi: ep: Do not allocate event ring element on stack
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Manivannan Sadhasivam <[email protected]>
[ Upstream commit 987fdb5a43a66764808371b54e6047834170d565 ]
It is possible that the host controller driver would use DMA framework to write the event ring element. So avoid allocating event ring element on the stack as DMA cannot work on vmalloc memory.
--- drivers/bus/mhi/ep/main.c | 68 ++++++++++++++++++++++++++++----------- 1 file changed, 50 insertions(+), 18 deletions(-)
drivers/bus/mhi/ep/main.c +50 -18
@@ -71,45 +71,77 @@ static int mhi_ep_send_event(struct mhi_ep_cntrl *mhi_cntrl, u32 ring_idx,static int mhi_ep_send_completion_event (struct mhi_ep_cntrl *mhi_cntrl,struct mhi_ep_ring *ring,struct mhi_ring_element *tre,u32 len,enum mhi_ev_ccs code) { -struct mhi_ring_element event = {}; +struct mhi_ring_element *event; +int ret; + + event =kzalloc (sizeof (struct mhi_ring_element ),GFP_KERNEL ); +if (!event) +return -ENOMEM ; - event.ptr =cpu_to_le64 (ring->rbase + ring->rd_offset *sizeof (*tre)); - event.dword[0 ] =MHI_TRE_EV_DWORD0 (code, len); - event.dword[1 ] =MHI_TRE_EV_DWORD1 (ring->ch_id,MHI_PKT_TYPE_TX_EVENT ); + event->ptr =cpu_to_le64 (ring->rbase + ring->rd_offset *sizeof (*tre)); + event->dword[0 ] =MHI_TRE_EV_DWORD0 (code, len); + event->dword[1 ] =MHI_TRE_EV_DWORD1 (ring->ch_id,MHI_PKT_TYPE_TX_EVENT ); -return mhi_ep_send_event (mhi_cntrl, ring->er_index, &event,MHI_TRE_DATA_GET_BEI (tre)); + ret =mhi_ep_send_event (mhi_cntrl, ring->er_index, event,MHI_TRE_DATA_GET_BEI (tre)); +kfree (event); + +return ret; }int mhi_ep_send_state_change_event (struct mhi_ep_cntrl *mhi_cntrl,enum mhi_state state) { -struct mhi_ring_element event = {}; +struct mhi_ring_element *event; +int ret; + + event =kzalloc (sizeof (struct mhi_ring_element ),GFP_KERNEL ); +if (!event) +return -ENOMEM ; - event.dword[0 ] =MHI_SC_EV_DWORD0 (state); - event.dword[1 ] =MHI_SC_EV_DWORD1 (MHI_PKT_TYPE_STATE_CHANGE_EVENT ); + event->dword[0 ] =MHI_SC_EV_DWORD0 (state); + event->dword[1 ] =MHI_SC_EV_DWORD1 (MHI_PKT_TYPE_STATE_CHANGE_EVENT ); -return mhi_ep_send_event (mhi_cntrl,0 , &event,0 ); + ret =mhi_ep_send_event (mhi_cntrl,0 , event,0 ); +kfree (event); + +return ret; }int mhi_ep_send_ee_event (struct mhi_ep_cntrl *mhi_cntrl,enum mhi_ee_type exec_env) { -struct mhi_ring_element event = {}; +struct mhi_ring_element *event; +int ret; + + event =kzalloc (sizeof (struct mhi_ring_element ),GFP_KERNEL ); +if (!event) +return -ENOMEM ; - event.dword[0 ] =MHI_EE_EV_DWORD0 (exec_env); - event.dword[1 ] =MHI_SC_EV_DWORD1 (MHI_PKT_TYPE_EE_EVENT ); + event->dword[0 ] =MHI_EE_EV_DWORD0 (exec_env); + event->dword[1 ] =MHI_SC_EV_DWORD1 (MHI_PKT_TYPE_EE_EVENT ); -return mhi_ep_send_event (mhi_cntrl,0 , &event,0 ); + ret =mhi_ep_send_event (mhi_cntrl,0 , event,0 ); +kfree (event); + +return ret; }static int mhi_ep_send_cmd_comp_event (struct mhi_ep_cntrl *mhi_cntrl,enum mhi_ev_ccs code) {struct mhi_ep_ring *ring = &mhi_cntrl->mhi_cmd->ring; -struct mhi_ring_element event = {}; +struct mhi_ring_element *event; +int ret; + + event =kzalloc (sizeof (struct mhi_ring_element ),GFP_KERNEL ); +if (!event) +return -ENOMEM ; - event.ptr =cpu_to_le64 (ring->rbase + ring->rd_offset *sizeof (struct mhi_ring_element )); - event.dword[0 ] =MHI_CC_EV_DWORD0 (code); - event.dword[1 ] =MHI_CC_EV_DWORD1 (MHI_PKT_TYPE_CMD_COMPLETION_EVENT ); + event->ptr =cpu_to_le64 (ring->rbase + ring->rd_offset *sizeof (struct mhi_ring_element )); + event->dword[0 ] =MHI_CC_EV_DWORD0 (code); + event->dword[1 ] =MHI_CC_EV_DWORD1 (MHI_PKT_TYPE_CMD_COMPLETION_EVENT ); -return mhi_ep_send_event (mhi_cntrl,0 , &event,0 ); + ret =mhi_ep_send_event (mhi_cntrl,0 , event,0 ); +kfree (event); + +return ret; }static int mhi_ep_process_cmd_ring (struct mhi_ep_ring *ring,struct mhi_ring_element *el)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 146/185 PM: core: Remove unnecessary (void *) conversions
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li zeming <[email protected]>
[ Upstream commit 73d73f5ee7fb0c42ff87091d105bee720a9565f1 ]
Assignments from pointer variables of type (void *) do not require explicit type casts, so remove such type cases from the code in drivers/base/power/main.c where applicable.
Stable-dep-of: 7839d0078e0d ("PM: sleep: Fix possible deadlocks in core system-wide PM code")
--- drivers/base/power/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/base/power/main.c +6 -6
@@ -679,7 +679,7 @@ static bool dpm_async_fn(struct device *dev, async_func_t func)static void async_resume_noirq (void *data,async_cookie_t cookie) { -struct device *dev = (struct device *)data; +struct device *dev = data;int error; error =device_resume_noirq (dev, pm_transition, true);
@@ -816,7 +816,7 @@ static int device_resume_early(struct device *dev, pm_message_t state, bool asynstatic void async_resume_early (void *data,async_cookie_t cookie) { -struct device *dev = (struct device *)data; +struct device *dev = data;int error; error =device_resume_early (dev, pm_transition, true);
@@ -980,7 +980,7 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)static void async_resume (void *data,async_cookie_t cookie) { -struct device *dev = (struct device *)data; +struct device *dev = data;int error; error =device_resume (dev, pm_transition, true);
@@ -1269,7 +1269,7 @@ static int __device_suspend_noirq(struct device *dev, pm_message_t state, bool astatic void async_suspend_noirq (void *data,async_cookie_t cookie) { -struct device *dev = (struct device *)data; +struct device *dev = data;int error; error =__device_suspend_noirq (dev, pm_transition, true);
@@ -1450,7 +1450,7 @@ static int __device_suspend_late(struct device *dev, pm_message_t state, bool asstatic void async_suspend_late (void *data,async_cookie_t cookie) { -struct device *dev = (struct device *)data; +struct device *dev = data;int error; error =__device_suspend_late (dev, pm_transition, true);
@@ -1727,7 +1727,7 @@ static int __device_suspend(struct device *dev, pm_message_t state, bool async)static void async_suspend (void *data,async_cookie_t cookie) { -struct device *dev = (struct device *)data; +struct device *dev = data;int error; error =__device_suspend (dev, pm_transition, true);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 147/185 PM: sleep: Fix possible deadlocks in core system-wide PM code
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Rafael J. Wysocki <[email protected]>
[ Upstream commit 7839d0078e0d5e6cc2fa0b0dfbee71de74f1e557 ]
It is reported that in low-memory situations the system-wide resume core code deadlocks, because async_schedule_dev() executes its argument function synchronously if it cannot allocate memory (and not only in that case) and that function attempts to acquire a mutex that is already held. Executing the argument function synchronously from within dpm_async_fn() may also be problematic for ordering reasons (it may cause a consumer device's resume callback to be invoked before a requisite supplier device's one, for example).
Address this by changing the code in question to use async_schedule_dev_nocall() for scheduling the asynchronous execution of device suspend and resume functions and to directly run them synchronously if async_schedule_dev_nocall() returns false.
--- drivers/base/power/main.c | 148 ++++++++++++++++++-------------------- 1 file changed, 68 insertions(+), 80 deletions(-)
drivers/base/power/main.c +68 -80
@@ -579,7 +579,7 @@ bool dev_pm_skip_resume(struct device *dev) }/** -* device_resume_noirq - Execute a "noirq resume" callback for given device. +* __device_resume_noirq - Execute a "noirq resume" callback for given device. * @dev: Device to handle. * @state: PM transition of the system being carried out. * @async: If true, the device is being resumed asynchronously.
@@ -587,7 +587,7 @@ bool dev_pm_skip_resume(struct device *dev)* The driver of @dev will not receive interrupts while this function is being * executed. */ -static int device_resume_noirq (struct device *dev,pm_message_t state,bool async) +static void __device_resume_noirq (struct device *dev,pm_message_t state,bool async) {pm_callback_t callback =NULL ;const char *info =NULL ;
@@ -655,7 +655,13 @@ static int device_resume_noirq(struct device *dev, pm_message_t state, bool asyn Out:complete_all (&dev->power.completion);TRACE_RESUME (error); -return error; + +if (error) { + suspend_stats.failed_resume_noirq++; +dpm_save_failed_step (SUSPEND_RESUME_NOIRQ ); +dpm_save_failed_dev (dev_name (dev)); +pm_dev_err (dev, state, async ?" async noirq" :" noirq" , error); + } }static bool is_async (struct device *dev)
@@ -668,11 +674,15 @@ static bool dpm_async_fn(struct device *dev, async_func_t func) {reinit_completion (&dev->power.completion); -if (is_async (dev)) { -get_device (dev); -async_schedule_dev (func, dev); +if (!is_async (dev)) +return false; + +get_device (dev); + +if (async_schedule_dev_nocall (func, dev))return true; - } + +put_device (dev);return false; }
@@ -680,15 +690,19 @@ static bool dpm_async_fn(struct device *dev, async_func_t func)static void async_resume_noirq (void *data,async_cookie_t cookie) {struct device *dev = data; -int error; - - error =device_resume_noirq (dev, pm_transition, true); -if (error) -pm_dev_err (dev, pm_transition," async" , error); +__device_resume_noirq (dev, pm_transition, true);put_device (dev); } +static void device_resume_noirq (struct device *dev) +{ +if (dpm_async_fn (dev, async_resume_noirq)) +return ; + +__device_resume_noirq (dev, pm_transition, false); +} +static void dpm_noirq_resume_devices (pm_message_t state) {struct device *dev;
@@ -698,14 +712,6 @@ static void dpm_noirq_resume_devices(pm_message_t state)mutex_lock (&dpm_list_mtx); pm_transition = state; -/* -* Advanced the async threads upfront, -* in case the starting of async threads is -* delayed by non-async resuming devices. -*/ -list_for_each_entry (dev, &dpm_noirq_list, power.entry) -dpm_async_fn (dev, async_resume_noirq); -while (!list_empty (&dpm_noirq_list)) { dev =to_device (dpm_noirq_list.next);get_device (dev);
@@ -713,17 +719,7 @@ static void dpm_noirq_resume_devices(pm_message_t state)mutex_unlock (&dpm_list_mtx); -if (!is_async (dev)) { -int error; - - error =device_resume_noirq (dev, state, false); -if (error) { - suspend_stats.failed_resume_noirq++; -dpm_save_failed_step (SUSPEND_RESUME_NOIRQ ); -dpm_save_failed_dev (dev_name (dev)); -pm_dev_err (dev, state," noirq" , error); - } - } +device_resume_noirq (dev);put_device (dev);
@@ -751,14 +747,14 @@ void dpm_resume_noirq(pm_message_t state) }/** -* device_resume_early - Execute an "early resume" callback for given device. +* __device_resume_early - Execute an "early resume" callback for given device. * @dev: Device to handle. * @state: PM transition of the system being carried out. * @async: If true, the device is being resumed asynchronously. * * Runtime PM is disabled for @dev while this function is being executed. */ -static int device_resume_early (struct device *dev,pm_message_t state,bool async) +static void __device_resume_early (struct device *dev,pm_message_t state,bool async) {pm_callback_t callback =NULL ;const char *info =NULL ;
@@ -811,21 +807,31 @@ static int device_resume_early(struct device *dev, pm_message_t state, bool asynpm_runtime_enable (dev);complete_all (&dev->power.completion); -return error; + +if (error) { + suspend_stats.failed_resume_early++; +dpm_save_failed_step (SUSPEND_RESUME_EARLY ); +dpm_save_failed_dev (dev_name (dev)); +pm_dev_err (dev, state, async ?" async early" :" early" , error); + } }static void async_resume_early (void *data,async_cookie_t cookie) {struct device *dev = data; -int error; - - error =device_resume_early (dev, pm_transition, true); -if (error) -pm_dev_err (dev, pm_transition," async" , error); +__device_resume_early (dev, pm_transition, true);put_device (dev); } +static void device_resume_early (struct device *dev) +{ +if (dpm_async_fn (dev, async_resume_early)) +return ; + +__device_resume_early (dev, pm_transition, false); +} +/** * dpm_resume_early - Execute "early resume" callbacks for all devices. * @state: PM transition of the system being carried out.
@@ -839,14 +845,6 @@ void dpm_resume_early(pm_message_t state)mutex_lock (&dpm_list_mtx); pm_transition = state; -/* -* Advanced the async threads upfront, -* in case the starting of async threads is -* delayed by non-async resuming devices. -*/ -list_for_each_entry (dev, &dpm_late_early_list, power.entry) -dpm_async_fn (dev, async_resume_early); -while (!list_empty (&dpm_late_early_list)) { dev =to_device (dpm_late_early_list.next);get_device (dev);
@@ -854,17 +852,7 @@ void dpm_resume_early(pm_message_t state)mutex_unlock (&dpm_list_mtx); -if (!is_async (dev)) { -int error; - - error =device_resume_early (dev, state, false); -if (error) { - suspend_stats.failed_resume_early++; -dpm_save_failed_step (SUSPEND_RESUME_EARLY ); -dpm_save_failed_dev (dev_name (dev)); -pm_dev_err (dev, state," early" , error); - } - } +device_resume_early (dev);put_device (dev);
@@ -888,12 +876,12 @@ void dpm_resume_start(pm_message_t state)EXPORT_SYMBOL_GPL (dpm_resume_start);/** -* device_resume - Execute "resume" callbacks for given device. +* __device_resume - Execute "resume" callbacks for given device. * @dev: Device to handle. * @state: PM transition of the system being carried out. * @async: If true, the device is being resumed asynchronously. */ -static int device_resume (struct device *dev,pm_message_t state,bool async) +static void __device_resume (struct device *dev,pm_message_t state,bool async) {pm_callback_t callback =NULL ;const char *info =NULL ;
@@ -975,20 +963,30 @@ static int device_resume(struct device *dev, pm_message_t state, bool async)TRACE_RESUME (error); -return error; +if (error) { + suspend_stats.failed_resume++; +dpm_save_failed_step (SUSPEND_RESUME ); +dpm_save_failed_dev (dev_name (dev)); +pm_dev_err (dev, state, async ?" async" :"" , error); + } }static void async_resume (void *data,async_cookie_t cookie) {struct device *dev = data; -int error; - error =device_resume (dev, pm_transition, true); -if (error) -pm_dev_err (dev, pm_transition," async" , error); +__device_resume (dev, pm_transition, true);put_device (dev); } +static void device_resume (struct device *dev) +{ +if (dpm_async_fn (dev, async_resume)) +return ; + +__device_resume (dev, pm_transition, false); +} +/** * dpm_resume - Execute "resume" callbacks for non-sysdev devices. * @state: PM transition of the system being carried out.
@@ -1008,27 +1006,17 @@ void dpm_resume(pm_message_t state) pm_transition = state; async_error =0 ; -list_for_each_entry (dev, &dpm_suspended_list, power.entry) -dpm_async_fn (dev, async_resume); -while (!list_empty (&dpm_suspended_list)) { dev =to_device (dpm_suspended_list.next); +get_device (dev); -if (!is_async (dev)) { -int error; -mutex_unlock (&dpm_list_mtx); +mutex_unlock (&dpm_list_mtx); + +device_resume (dev); - error =device_resume (dev, state, false); -if (error) { - suspend_stats.failed_resume++; -dpm_save_failed_step (SUSPEND_RESUME ); -dpm_save_failed_dev (dev_name (dev)); -pm_dev_err (dev, state,"" , error); - } +mutex_lock (&dpm_list_mtx); -mutex_lock (&dpm_list_mtx); - }if (!list_empty (&dev->power.entry))list_move_tail (&dev->power.entry, &dpm_prepared_list);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 148/185 thermal: intel: hfi: Refactor enabling code into helper functions
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Neri <[email protected]>
[ Upstream commit 8a8b6bb93c704776c4b05cb517c3fa8baffb72f5 ]
In preparation for the addition of a suspend notifier, wrap the logic to enable HFI and program its memory buffer into helper functions. Both the CPU hotplug callback and the suspend notifier will use them.
This refactoring does not introduce functional changes.
Stable-dep-of: 97566d09fd02 ("thermal: intel: hfi: Add syscore callbacks for system-wide PM")
--- drivers/thermal/intel/intel_hfi.c | 43 ++++++++++++++++--------------- 1 file changed, 22 insertions(+), 21 deletions(-)
drivers/thermal/intel/intel_hfi.c +22 -21
@@ -338,6 +338,26 @@ static void init_hfi_instance(struct hfi_instance *hfi_instance) hfi_instance->data = hfi_instance->hdr + hfi_features.hdr_size; } +/* Caller must hold hfi_instance_lock. */ +static void hfi_enable (void ) +{ +u64 msr_val; + +rdmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); + msr_val |=HW_FEEDBACK_CONFIG_HFI_ENABLE_BIT ; +wrmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); +} + +static void hfi_set_hw_table (struct hfi_instance *hfi_instance) +{ +phys_addr_t hw_table_pa; +u64 msr_val; + + hw_table_pa =virt_to_phys (hfi_instance->hw_table); + msr_val = hw_table_pa |HW_FEEDBACK_PTR_VALID_BIT ; +wrmsrl (MSR_IA32_HW_FEEDBACK_PTR , msr_val); +} +/** * intel_hfi_online() - Enable HFI on @cpu * @cpu: CPU in which the HFI will be enabled
@@ -355,8 +375,6 @@ void intel_hfi_online(unsigned int cpu) {struct hfi_instance *hfi_instance;struct hfi_cpu_info *info; -phys_addr_t hw_table_pa; -u64 msr_val;u16 die_id;/* Nothing to do if hfi_instances are missing. */
@@ -400,8 +418,6 @@ void intel_hfi_online(unsigned int cpu)if (!hfi_instance->hw_table) goto unlock; - hw_table_pa =virt_to_phys (hfi_instance->hw_table); -/* * Allocate memory to keep a local copy of the table that * hardware generates.
@@ -411,16 +427,6 @@ void intel_hfi_online(unsigned int cpu)if (!hfi_instance->local_table) goto free_hw_table; -/* -* Program the address of the feedback table of this die/package. On -* some processors, hardware remembers the old address of the HFI table -* even after having been reprogrammed and re-enabled. Thus, do not free -* the pages allocated for the table or reprogram the hardware with a -* new base address. Namely, program the hardware only once. -*/ - msr_val = hw_table_pa |HW_FEEDBACK_PTR_VALID_BIT ; -wrmsrl (MSR_IA32_HW_FEEDBACK_PTR , msr_val); -init_hfi_instance (hfi_instance);INIT_DELAYED_WORK (&hfi_instance->update_work, hfi_update_work_fn);
@@ -429,13 +435,8 @@ void intel_hfi_online(unsigned int cpu)cpumask_set_cpu (cpu, hfi_instance->cpus); -/* -* Enable the hardware feedback interface and never disable it. See -* comment on programming the address of the table. -*/ -rdmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); - msr_val |=HW_FEEDBACK_CONFIG_HFI_ENABLE_BIT ; -wrmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); +hfi_set_hw_table (hfi_instance); +hfi_enable (); unlock:mutex_unlock (&hfi_instance_lock);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 149/185 thermal: intel: hfi: Disable an HFI instance when all its CPUs go offline
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Neri <[email protected]>
[ Upstream commit 1c53081d773c2cb4461636559b0d55b46559ceec ]
In preparation to support hibernation, add functionality to disable an HFI instance during CPU offline. The last CPU of an instance that goes offline will disable such instance.
The Intel Software Development Manual states that the operating system must wait for the hardware to set MSR_IA32_PACKAGE_THERM_STATUS[26] after disabling an HFI instance to ensure that it will no longer write on the HFI memory. Some processors, however, do not ever set such bit. Wait a minimum of 2ms to give time hardware to complete any pending memory writes.
Stable-dep-of: 97566d09fd02 ("thermal: intel: hfi: Add syscore callbacks for system-wide PM")
--- drivers/thermal/intel/intel_hfi.c | 35 +++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
drivers/thermal/intel/intel_hfi.c +35 -0
@@ -24,6 +24,7 @@#include <linux/bitops.h> #include <linux/cpufeature.h> #include <linux/cpumask.h> +#include <linux/delay.h> #include <linux/gfp.h> #include <linux/io.h> #include <linux/kernel.h>
@@ -358,6 +359,32 @@ static void hfi_set_hw_table(struct hfi_instance *hfi_instance)wrmsrl (MSR_IA32_HW_FEEDBACK_PTR , msr_val); } +/* Caller must hold hfi_instance_lock. */ +static void hfi_disable (void ) +{ +u64 msr_val; +int i; + +rdmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); + msr_val &= ~HW_FEEDBACK_CONFIG_HFI_ENABLE_BIT ; +wrmsrl (MSR_IA32_HW_FEEDBACK_CONFIG , msr_val); + +/* +* Wait for hardware to acknowledge the disabling of HFI. Some +* processors may not do it. Wait for ~2ms. This is a reasonable +* time for hardware to complete any pending actions on the HFI +* memory. +*/ +for (i =0 ; i <2000 ; i++) { +rdmsrl (MSR_IA32_PACKAGE_THERM_STATUS , msr_val); +if (msr_val &PACKAGE_THERM_STATUS_HFI_UPDATED ) +break ; + +udelay (1 ); +cpu_relax (); + } +} +/** * intel_hfi_online() - Enable HFI on @cpu * @cpu: CPU in which the HFI will be enabled
@@ -412,6 +439,10 @@ void intel_hfi_online(unsigned int cpu)/* * Hardware is programmed with the physical address of the first page * frame of the table. Hence, the allocated memory must be page-aligned. +* +* Some processors do not forget the initial address of the HFI table +* even after having been reprogrammed. Keep using the same pages. Do +* not free them. */ hfi_instance->hw_table =alloc_pages_exact (hfi_features.nr_table_pages,GFP_KERNEL | __GFP_ZERO);
@@ -476,6 +507,10 @@ void intel_hfi_offline(unsigned int cpu)mutex_lock (&hfi_instance_lock);cpumask_clear_cpu (cpu, hfi_instance->cpus); + +if (!cpumask_weight (hfi_instance->cpus)) +hfi_disable (); +mutex_unlock (&hfi_instance_lock); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 150/185 thermal: intel: hfi: Add syscore callbacks for system-wide PM
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ricardo Neri <[email protected]>
[ Upstream commit 97566d09fd02d2ab329774bb89a2cdf2267e86d9 ]
The kernel allocates a memory buffer and provides its location to the hardware, which uses it to update the HFI table. This allocation occurs during boot and remains constant throughout runtime.
When resuming from hibernation, the restore kernel allocates a second memory buffer and reprograms the HFI hardware with the new location as part of a normal boot. The location of the second memory buffer may differ from the one allocated by the image kernel.
When the restore kernel transfers control to the image kernel, its HFI buffer becomes invalid, potentially leading to memory corruption if the hardware writes to it (the hardware continues to use the buffer from the restore kernel).
It is also possible that the hardware "forgets" the address of the memory buffer when resuming from "deep" suspend. Memory corruption may also occur in such a scenario.
To prevent the described memory corruption, disable HFI when preparing to suspend or hibernate. Enable it when resuming.
Add syscore callbacks to handle the package of the boot CPU (packages of non-boot CPUs are handled via CPU offline). Syscore ops always run on the boot CPU. Additionally, HFI only needs to be disabled during "deep" suspend and hibernation. Syscore ops only run in these cases.
--- drivers/thermal/intel/intel_hfi.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
drivers/thermal/intel/intel_hfi.c +28 -0
@@ -35,7 +35,9 @@#include <linux/processor.h> #include <linux/slab.h> #include <linux/spinlock.h> +#include <linux/suspend.h> #include <linux/string.h> +#include <linux/syscore_ops.h> #include <linux/topology.h> #include <linux/workqueue.h>
@@ -559,6 +561,30 @@ static __init int hfi_parse_features(void)return 0 ; } +static void hfi_do_enable (void ) +{ +/* This code runs only on the boot CPU. */ +struct hfi_cpu_info *info = &per_cpu (hfi_cpu_info,0 ); +struct hfi_instance *hfi_instance = info->hfi_instance; + +/* No locking needed. There is no concurrency with CPU online. */ +hfi_set_hw_table (hfi_instance); +hfi_enable (); +} + +static int hfi_do_disable (void ) +{ +/* No locking needed. There is no concurrency with CPU offline. */ +hfi_disable (); + +return 0 ; +} + +static struct syscore_ops hfi_pm_ops = { + .resume = hfi_do_enable, + .suspend = hfi_do_disable, +}; +void __init intel_hfi_init (void ) {struct hfi_instance *hfi_instance;
@@ -590,6 +616,8 @@ void __init intel_hfi_init(void)if (!hfi_updates_wq) goto err_nomem; +register_syscore_ops (&hfi_pm_ops); +return ; err_nomem:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 151/185 fs/pipe: move check to pipe_has_watch_queue()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Max Kellermann <[email protected]>
[ Upstream commit b4bd6b4bac8edd61eb8f7b836969d12c0c6af165 ]
This declutters the code by reducing the number of #ifdefs and makes the watch_queue checks simpler. This has no runtime effect; the machine code is identical.
Message-Id: <[email protected]>
Stable-dep-of: e95aada4cb93 ("pipe: wakeup wr_wait after setting max_usage")
--- fs/pipe.c | 12 +++--------- include/linux/pipe_fs_i.h | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 9 deletions(-)
fs/pipe.c +3 -9
@@ -436,12 +436,10 @@ pipe_write(struct kiocb *iocb, struct iov_iter *from) goto out; } -#ifdef CONFIG_WATCH_QUEUE -if (pipe->watch_queue) { +if (pipe_has_watch_queue (pipe)) { ret = -EXDEV ; goto out; } -#endif /* * If it wasn't empty we try to merge new data into
@@ -1320,10 +1318,8 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long arg)unsigned int nr_slots, size;long ret =0 ; -#ifdef CONFIG_WATCH_QUEUE -if (pipe->watch_queue) +if (pipe_has_watch_queue (pipe))return -EBUSY ; -#endif size =round_pipe_size (arg); nr_slots = size >>PAGE_SHIFT ;
@@ -1375,10 +1371,8 @@ struct pipe_inode_info *get_pipe_info(struct file *file, bool for_splice)if (file->f_op != &pipefifo_fops || !pipe)return NULL ; -#ifdef CONFIG_WATCH_QUEUE -if (for_splice && pipe->watch_queue) +if (for_splice &&pipe_has_watch_queue (pipe))return NULL ; -#endif return pipe; }
include/linux/pipe_fs_i.h +16 -0
@@ -124,6 +124,22 @@ struct pipe_buf_operations {bool (*get)(struct pipe_inode_info *,struct pipe_buffer *); }; +/** +* pipe_has_watch_queue - Check whether the pipe is a watch_queue, +* i.e. it was created with O_NOTIFICATION_PIPE +* @pipe: The pipe to check +* +* Return: true if pipe is a watch queue, false otherwise. +*/ +static inline bool pipe_has_watch_queue (const struct pipe_inode_info *pipe) +{ +#ifdef CONFIG_WATCH_QUEUE +return pipe->watch_queue !=NULL ; +#else +return false; +#endif +} +/** * pipe_empty - Return true if the pipe is empty * @head: The pipe ring head pointer
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 152/185 pipe: wakeup wr_wait after setting max_usage
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lukas Schauer <[email protected]>
[ Upstream commit e95aada4cb93d42e25c30a0ef9eb2923d9711d4a ]
Commit c73be61cede5 ("pipe: Add general notification queue support") a regression was introduced that would lock up resized pipes under certain conditions. See the reproducer in [1].
The commit resizing the pipe ring size was moved to a different function, doing that moved the wakeup for pipe->wr_wait before actually raising pipe->max_usage. If a pipe was full before the resize occured it would result in the wakeup never actually triggering pipe_write.
Set @max_usage and @nr_accounted before waking writers if this isn't a watch queue.
--- fs/pipe.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
fs/pipe.c +5 -2
@@ -1301,6 +1301,11 @@ int pipe_resize_ring(struct pipe_inode_info *pipe, unsigned int nr_slots) pipe->tail = tail; pipe->head = head; +if (!pipe_has_watch_queue (pipe)) { + pipe->max_usage = nr_slots; + pipe->nr_accounted = nr_slots; + } +spin_unlock_irq (&pipe->rd_wait.lock);/* This might have made more room for writers */
@@ -1352,8 +1357,6 @@ static long pipe_set_size(struct pipe_inode_info *pipe, unsigned long arg)if (ret <0 ) goto out_revert_acct; - pipe->max_usage = nr_slots; - pipe->nr_accounted = nr_slots;return pipe->max_usage *PAGE_SIZE ; out_revert_acct:
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 153/185 ARM: dts: qcom: sdx55: fix USB wakeup interrupt types
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit d0ec3c4c11c3b30e1f2d344973b2a7bf0f986734 ]
The DP/DM wakeup interrupts are edge triggered and which edge to trigger on depends on use-case and whether a Low speed or Full/High speed device is connected.
--- arch/arm/boot/dts/qcom-sdx55.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/qcom-sdx55.dtsi +2 -2
@@ -497,8 +497,8 @@ usb: usb@a6f8800 { interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 158 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 157 IRQ_TYPE_LEVEL_HIGH>; + <GIC_SPI 158 IRQ_TYPE_EDGE_BOTH>, + <GIC_SPI 157 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 154/185 ARM: dts: samsung: exynos4210-i9100: Unconditionally enable LDO12
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Cercueil <[email protected]>
[ Upstream commit 84228d5e29dbc7a6be51e221000e1d122125826c ]
The kernel hangs for a good 12 seconds without any info being printed to dmesg, very early in the boot process, if this regulator is not enabled.
Force-enable it to work around this issue, until we know more about the underlying problem.
--- arch/arm/boot/dts/exynos4210-i9100.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/exynos4210-i9100.dts +8 -0
@@ -521,6 +521,14 @@ vtcam_reg: LDO12 { regulator-name = "VT_CAM_1.8V"; regulator-min-microvolt = <1800000>; regulator-max-microvolt = <1800000>; + + /* + * Force-enable this regulator; otherwise the + * kernel hangs very early in the boot process + * for about 12 seconds, without apparent + * reason. + */ + regulator-always-on; }; vcclcd_reg: LDO13 {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 155/185 ARM: dts: qcom: sdx55: fix pdc #interrupt-cells
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit cc25bd06c16aa582596a058d375b2e3133f79b93 ]
The Qualcomm PDC interrupt controller binding expects two cells in interrupt specifiers.
--- arch/arm/boot/dts/qcom-sdx55.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-sdx55.dtsi +1 -1
@@ -522,7 +522,7 @@ pdc: interrupt-controller@b210000 { compatible = "qcom,sdx55-pdc", "qcom,pdc"; reg = <0x0b210000 0x30000>; qcom,pdc-ranges = <0 179 52>; - #interrupt-cells = <3>; + #interrupt-cells = <2>; interrupt-parent = <&intc>; interrupt-controller; };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 156/185 ARM: dts: qcom: sdx55: fix USB DP/DM HS PHY interrupts
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit de95f139394a5ed82270f005bc441d2e7c1e51b7 ]
The USB DP/DM HS PHY interrupts need to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states and to be able to detect disconnect events, which requires triggering on falling edges.
A recent commit updated the trigger type but failed to change the interrupt provider as required. This leads to the current Linux driver failing to probe instead of printing an error during suspend and USB wakeup not working as intended.
--- arch/arm/boot/dts/qcom-sdx55.dtsi | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm/boot/dts/qcom-sdx55.dtsi +4 -4
@@ -495,10 +495,10 @@ usb: usb@a6f8800 { <&gcc GCC_USB30_MASTER_CLK>; assigned-clock-rates = <19200000>, <200000000>; - interrupts = <GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, - <GIC_SPI 158 IRQ_TYPE_EDGE_BOTH>, - <GIC_SPI 157 IRQ_TYPE_EDGE_BOTH>; + interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, + <&intc GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 11 IRQ_TYPE_EDGE_BOTH>, + <&pdc 10 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq", "dm_hs_phy_irq", "dp_hs_phy_irq";
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 157/185 ARM: dts: qcom: sdx55: fix USB SS wakeup
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
[ Upstream commit 710dd03464e4ab5b3d329768388b165d61958577 ]
The USB SS PHY interrupt needs to be provided by the PDC interrupt controller in order to be able to wake the system up from low-power states.
--- arch/arm/boot/dts/qcom-sdx55.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/qcom-sdx55.dtsi +1 -1
@@ -496,7 +496,7 @@ usb: usb@a6f8800 { assigned-clock-rates = <19200000>, <200000000>; interrupts-extended = <&intc GIC_SPI 131 IRQ_TYPE_LEVEL_HIGH>, - <&intc GIC_SPI 198 IRQ_TYPE_LEVEL_HIGH>, + <&pdc 51 IRQ_TYPE_LEVEL_HIGH>, <&pdc 11 IRQ_TYPE_EDGE_BOTH>, <&pdc 10 IRQ_TYPE_EDGE_BOTH>; interrupt-names = "hs_phy_irq", "ss_phy_irq",
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 158/185 dlm: use kernel_connect() and kernel_bind()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jordan Rife <[email protected]>
[ Upstream commit e9cdebbe23f1aa9a1caea169862f479ab3fa2773 ]
Recent changes to kernel_connect() and kernel_bind() ensure that callers are insulated from changes to the address parameter made by BPF SOCK_ADDR hooks. This patch wraps direct calls to ops->connect() and ops->bind() with kernel_connect() and kernel_bind() to protect callers in such cases.
--- fs/dlm/lowcomms.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
fs/dlm/lowcomms.c +7 -7
@@ -1845,8 +1845,8 @@ static int dlm_tcp_bind(struct socket *sock)memcpy (&src_addr, dlm_local_addr[0 ],sizeof (src_addr));make_sockaddr (&src_addr,0 , &addr_len); - result = sock->ops->bind (sock, (struct sockaddr *)&src_addr, - addr_len); + result =kernel_bind (sock, (struct sockaddr *)&src_addr, + addr_len);if (result <0 ) {/* This *may* not indicate a critical error */ log_print ("could not bind for connect: %d" , result);
@@ -1860,7 +1860,7 @@ static int dlm_tcp_connect(struct connection *con, struct socket *sock, {int ret; - ret = sock->ops->connect (sock, addr, addr_len,O_NONBLOCK ); + ret =kernel_connect (sock, addr, addr_len,O_NONBLOCK );switch (ret) {case -EINPROGRESS : fallthrough;
@@ -1900,8 +1900,8 @@ static int dlm_tcp_listen_bind(struct socket *sock)/* Bind to our port */ make_sockaddr (dlm_local_addr[0 ], dlm_config.ci_tcp_port, &addr_len); -return sock->ops->bind (sock, (struct sockaddr *)dlm_local_addr[0 ], - addr_len); +return kernel_bind (sock, (struct sockaddr *)&dlm_local_addr[0 ], + addr_len); }static const struct dlm_proto_ops dlm_tcp_ops = {
@@ -1928,12 +1928,12 @@ static int dlm_sctp_connect(struct connection *con, struct socket *sock,int ret;/* -* Make sock->ops->connect() function return in specified time, +* Make kernel_connect() function return in specified time, * since O_NONBLOCK argument in connect() function does not work here, * then, we should restore the default value of this attribute. */ sock_set_sndtimeo (sock->sk,5 ); - ret = sock->ops->connect (sock, addr, addr_len,0 ); + ret =kernel_connect (sock, addr, addr_len,0 );sock_set_sndtimeo (sock->sk,0 );if (ret <0 )return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 159/185 serial: core: Provide port lock wrappers
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit b0af4bcb49464c221ad5f95d40f2b1b252ceedcc ]
When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console.
So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress.
All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure.
Provide wrapper functions for spin_[un]lock*(port->lock) invocations so that the console mechanics can be applied later on at a single place and does not require to copy the same logic all over the drivers.
Stable-dep-of: 9915753037eb ("serial: sc16is7xx: fix unconditional activation of THRI interrupt")
--- include/linux/serial_core.h | 79 +++++++++++++++++++++++++++++++++++++ 1 file changed, 79 insertions(+)
include/linux/serial_core.h +79 -0
@@ -583,6 +583,85 @@ struct uart_port {void *private_data;/* generic platform data pointer */ }; +/** +* uart_port_lock - Lock the UART port +* @up: Pointer to UART port structure +*/ +static inline void uart_port_lock (struct uart_port *up) +{ +spin_lock (&up->lock); +} + +/** +* uart_port_lock_irq - Lock the UART port and disable interrupts +* @up: Pointer to UART port structure +*/ +static inline void uart_port_lock_irq (struct uart_port *up) +{ +spin_lock_irq (&up->lock); +} + +/** +* uart_port_lock_irqsave - Lock the UART port, save and disable interrupts +* @up: Pointer to UART port structure +* @flags: Pointer to interrupt flags storage +*/ +static inline void uart_port_lock_irqsave (struct uart_port *up,unsigned long *flags) +{ +spin_lock_irqsave (&up->lock, *flags); +} + +/** +* uart_port_trylock - Try to lock the UART port +* @up: Pointer to UART port structure +* +* Returns: True if lock was acquired, false otherwise +*/ +static inline bool uart_port_trylock (struct uart_port *up) +{ +return spin_trylock (&up->lock); +} + +/** +* uart_port_trylock_irqsave - Try to lock the UART port, save and disable interrupts +* @up: Pointer to UART port structure +* @flags: Pointer to interrupt flags storage +* +* Returns: True if lock was acquired, false otherwise +*/ +static inline bool uart_port_trylock_irqsave (struct uart_port *up,unsigned long *flags) +{ +return spin_trylock_irqsave (&up->lock, *flags); +} + +/** +* uart_port_unlock - Unlock the UART port +* @up: Pointer to UART port structure +*/ +static inline void uart_port_unlock (struct uart_port *up) +{ +spin_unlock (&up->lock); +} + +/** +* uart_port_unlock_irq - Unlock the UART port and re-enable interrupts +* @up: Pointer to UART port structure +*/ +static inline void uart_port_unlock_irq (struct uart_port *up) +{ +spin_unlock_irq (&up->lock); +} + +/** +* uart_port_lock_irqrestore - Unlock the UART port, restore interrupts +* @up: Pointer to UART port structure +* @flags: The saved interrupt flags for restore +*/ +static inline void uart_port_unlock_irqrestore (struct uart_port *up,unsigned long flags) +{ +spin_unlock_irqrestore (&up->lock, flags); +} +static inline int serial_port_in (struct uart_port *up,int offset) {return up->serial_in (up, offset);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 160/185 serial: sc16is7xx: Use port lock wrappers
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Gleixner <[email protected]>
[ Upstream commit b465848be8a652e2c5fefe102661fb660cff8497 ]
When a serial port is used for kernel console output, then all modifications to the UART registers which are done from other contexts, e.g. getty, termios, are interference points for the kernel console.
So far this has been ignored and the printk output is based on the principle of hope. The rework of the console infrastructure which aims to support threaded and atomic consoles, requires to mark sections which modify the UART registers as unsafe. This allows the atomic write function to make informed decisions and eventually to restore operational state. It also allows to prevent the regular UART code from modifying UART registers while printk output is in progress.
All modifications of UART registers are guarded by the UART port lock, which provides an obvious synchronization point with the console infrastructure.
To avoid adding this functionality to all UART drivers, wrap the spin_[un]lock*() invocations for uart_port::lock into helper functions which just contain the spin_[un]lock*() invocations for now. In a subsequent step these helpers will gain the console synchronization mechanisms.
Converted with coccinelle. No functional change.
Stable-dep-of: 9915753037eb ("serial: sc16is7xx: fix unconditional activation of THRI interrupt")
--- drivers/tty/serial/sc16is7xx.c | 40 +++++++++++++++++----------------- 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/tty/serial/sc16is7xx.c +20 -20
@@ -641,9 +641,9 @@ static void sc16is7xx_handle_tx(struct uart_port *port) }if (uart_circ_empty (xmit) ||uart_tx_stopped (port)) { -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);sc16is7xx_stop_tx (port); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags);return ; }
@@ -672,13 +672,13 @@ static void sc16is7xx_handle_tx(struct uart_port *port)sc16is7xx_fifo_write (port, to_send); } -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);if (uart_circ_chars_pending (xmit) <WAKEUP_CHARS )uart_write_wakeup (port);if (uart_circ_empty (xmit))sc16is7xx_stop_tx (port); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); }static unsigned int sc16is7xx_get_hwmctrl (struct uart_port *port)
@@ -709,7 +709,7 @@ static void sc16is7xx_update_mlines(struct sc16is7xx_one *one) one->old_mctrl = status; -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);if ((changed &TIOCM_RNG ) && (status &TIOCM_RNG )) port->icount.rng++;if (changed &TIOCM_DSR )
@@ -720,7 +720,7 @@ static void sc16is7xx_update_mlines(struct sc16is7xx_one *one)uart_handle_cts_change (port, status &TIOCM_CTS );wake_up_interruptible (&port->state->port.delta_msr_wait); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); }static bool sc16is7xx_port_irq (struct sc16is7xx_port *s,int portno)
@@ -814,9 +814,9 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws)sc16is7xx_handle_tx (port);mutex_unlock (&one->efr_lock); -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);sc16is7xx_ier_set (port,SC16IS7XX_IER_THRI_BIT ); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); }static void sc16is7xx_reconf_rs485 (struct uart_port *port)
@@ -827,14 +827,14 @@ static void sc16is7xx_reconf_rs485(struct uart_port *port)struct serial_rs485 *rs485 = &port->rs485;unsigned long irqflags; -spin_lock_irqsave (&port->lock, irqflags); +uart_port_lock_irqsave (port, &irqflags);if (rs485->flags &SER_RS485_ENABLED ) { efcr |=SC16IS7XX_EFCR_AUTO_RS485_BIT ;if (rs485->flags &SER_RS485_RTS_AFTER_SEND ) efcr |=SC16IS7XX_EFCR_RTS_INVERT_BIT ; } -spin_unlock_irqrestore (&port->lock, irqflags); +uart_port_unlock_irqrestore (port, irqflags);sc16is7xx_port_update (port,SC16IS7XX_EFCR_REG , mask, efcr); }
@@ -845,10 +845,10 @@ static void sc16is7xx_reg_proc(struct kthread_work *ws)struct sc16is7xx_one_config config;unsigned long irqflags; -spin_lock_irqsave (&one->port.lock, irqflags); +uart_port_lock_irqsave (&one->port, &irqflags); config = one->config;memset (&one->config,0 ,sizeof (one->config)); -spin_unlock_irqrestore (&one->port.lock, irqflags); +uart_port_unlock_irqrestore (&one->port, irqflags);if (config.flags &SC16IS7XX_RECONF_MD ) {u8 mcr =0 ;
@@ -954,18 +954,18 @@ static void sc16is7xx_throttle(struct uart_port *port)* value set in MCR register. Stop reading data from RX FIFO so the * AutoRTS feature will de-activate RTS output. */ -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);sc16is7xx_ier_clear (port,SC16IS7XX_IER_RDI_BIT ); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); }static void sc16is7xx_unthrottle (struct uart_port *port) {unsigned long flags; -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);sc16is7xx_ier_set (port,SC16IS7XX_IER_RDI_BIT ); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); }static unsigned int sc16is7xx_tx_empty (struct uart_port *port)
@@ -1103,7 +1103,7 @@ static void sc16is7xx_set_termios(struct uart_port *port,/* Setup baudrate generator */ baud =sc16is7xx_set_baud (port, baud); -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);/* Update timeout according to new baud rate */ uart_update_timeout (port, termios->c_cflag, baud);
@@ -1111,7 +1111,7 @@ static void sc16is7xx_set_termios(struct uart_port *port,if (UART_ENABLE_MS (port, termios->c_cflag))sc16is7xx_enable_ms (port); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags); } static int sc16is7xx_config_rs485(struct uart_port *port, struct ktermios *termios,
@@ -1197,9 +1197,9 @@ static int sc16is7xx_startup(struct uart_port *port)sc16is7xx_port_write (port,SC16IS7XX_IER_REG , val);/* Enable modem status polling */ -spin_lock_irqsave (&port->lock, flags); +uart_port_lock_irqsave (port, &flags);sc16is7xx_enable_ms (port); -spin_unlock_irqrestore (&port->lock, flags); +uart_port_unlock_irqrestore (port, flags);return 0 ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 161/185 serial: sc16is7xx: fix unconditional activation of THRI interrupt
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hugo Villeneuve <[email protected]>
[ Upstream commit 9915753037eba7135b209fef4f2afeca841af816 ]
Commit cc4c1d05eb10 ("sc16is7xx: Properly resume TX after stop") changed behavior to unconditionnaly set the THRI interrupt in sc16is7xx_tx_proc().
For example when sending a 65 bytes message, and assuming the Tx FIFO is initially empty, sc16is7xx_handle_tx() will write the first 64 bytes of the message to the FIFO and sc16is7xx_tx_proc() will then activate THRI. When the THRI IRQ is fired, the driver will write the remaining byte of the message to the FIFO, and disable THRI by calling sc16is7xx_stop_tx().
When sending a 2 bytes message, sc16is7xx_handle_tx() will write the 2 bytes of the message to the FIFO and call sc16is7xx_stop_tx(), disabling THRI. After sc16is7xx_handle_tx() exits, control returns to sc16is7xx_tx_proc() which will unconditionally set THRI. When the THRI IRQ is fired, the driver simply acknowledges the interrupt and does nothing more, since all the data has already been written to the FIFO. This results in 2 register writes and 4 register reads all for nothing and taking precious cycles from the I2C/SPI bus.
Fix this by enabling the THRI interrupt only when we fill the Tx FIFO to its maximum capacity and there are remaining bytes to send in the message.
--- drivers/tty/serial/sc16is7xx.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/tty/serial/sc16is7xx.c +2 -5
@@ -678,6 +678,8 @@ static void sc16is7xx_handle_tx(struct uart_port *port)if (uart_circ_empty (xmit))sc16is7xx_stop_tx (port); +else +sc16is7xx_ier_set (port,SC16IS7XX_IER_THRI_BIT );uart_port_unlock_irqrestore (port, flags); }
@@ -804,7 +806,6 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws) {struct uart_port *port = &(to_sc16is7xx_one (ws, tx_work)->port);struct sc16is7xx_one *one =to_sc16is7xx_one (port, port); -unsigned long flags;if ((port->rs485.flags &SER_RS485_ENABLED ) && (port->rs485.delay_rts_before_send >0 ))
@@ -813,10 +814,6 @@ static void sc16is7xx_tx_proc(struct kthread_work *ws)mutex_lock (&one->efr_lock);sc16is7xx_handle_tx (port);mutex_unlock (&one->efr_lock); - -uart_port_lock_irqsave (port, &flags); -sc16is7xx_ier_set (port,SC16IS7XX_IER_THRI_BIT ); -uart_port_unlock_irqrestore (port, flags); }static void sc16is7xx_reconf_rs485 (struct uart_port *port)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 162/185 btrfs: zoned: factor out prepare_allocation_zoned()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naohiro Aota <[email protected]>
[ Upstream commit b271fee9a41ca1474d30639fd6cc912c9901d0f8 ]
Factor out prepare_allocation_zoned() for further extension. While at it, optimize the if-branch a bit.
Stable-dep-of: 02444f2ac26e ("btrfs: zoned: optimize hint byte for zoned allocator")
--- fs/btrfs/extent-tree.c | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-)
fs/btrfs/extent-tree.c +19 -13
@@ -4207,6 +4207,24 @@ static int prepare_allocation_clustered(struct btrfs_fs_info *fs_info,return 0 ; } +static int prepare_allocation_zoned (struct btrfs_fs_info *fs_info, +struct find_free_extent_ctl *ffe_ctl) +{ +if (ffe_ctl->for_treelog) { +spin_lock (&fs_info->treelog_bg_lock); +if (fs_info->treelog_bg) + ffe_ctl->hint_byte = fs_info->treelog_bg; +spin_unlock (&fs_info->treelog_bg_lock); + }else if (ffe_ctl->for_data_reloc) { +spin_lock (&fs_info->relocation_bg_lock); +if (fs_info->data_reloc_bg) + ffe_ctl->hint_byte = fs_info->data_reloc_bg; +spin_unlock (&fs_info->relocation_bg_lock); + } + +return 0 ; +} + static int prepare_allocation(struct btrfs_fs_info *fs_info, struct find_free_extent_ctl *ffe_ctl, struct btrfs_space_info *space_info,
@@ -4217,19 +4235,7 @@ static int prepare_allocation(struct btrfs_fs_info *fs_info,return prepare_allocation_clustered (fs_info, ffe_ctl, space_info, ins);case BTRFS_EXTENT_ALLOC_ZONED : -if (ffe_ctl->for_treelog) { -spin_lock (&fs_info->treelog_bg_lock); -if (fs_info->treelog_bg) - ffe_ctl->hint_byte = fs_info->treelog_bg; -spin_unlock (&fs_info->treelog_bg_lock); - } -if (ffe_ctl->for_data_reloc) { -spin_lock (&fs_info->relocation_bg_lock); -if (fs_info->data_reloc_bg) - ffe_ctl->hint_byte = fs_info->data_reloc_bg; -spin_unlock (&fs_info->relocation_bg_lock); - } -return 0 ; +return prepare_allocation_zoned (fs_info, ffe_ctl);default :BUG (); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 163/185 btrfs: zoned: optimize hint byte for zoned allocator
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Naohiro Aota <[email protected]>
[ Upstream commit 02444f2ac26eae6385a65fcd66915084d15dffba ]
Writing sequentially to a huge file on btrfs on a SMR HDD revealed a decline of the performance (220 MiB/s to 30 MiB/s after 500 minutes).
The performance goes down because of increased latency of the extent allocation, which is induced by a traversing of a lot of full block groups.
So, this patch optimizes the ffe_ctl->hint_byte by choosing a block group with sufficient size from the active block group list, which does not contain full block groups.
After applying the patch, the performance is maintained well.
--- fs/btrfs/extent-tree.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
fs/btrfs/extent-tree.c +18 -0
@@ -4220,6 +4220,24 @@ static int prepare_allocation_zoned(struct btrfs_fs_info *fs_info,if (fs_info->data_reloc_bg) ffe_ctl->hint_byte = fs_info->data_reloc_bg;spin_unlock (&fs_info->relocation_bg_lock); + }else if (ffe_ctl->flags &BTRFS_BLOCK_GROUP_DATA ) { +struct btrfs_block_group *block_group; + +spin_lock (&fs_info->zone_active_bgs_lock); +list_for_each_entry (block_group, &fs_info->zone_active_bgs, active_bg_list) { +/* +* No lock is OK here because avail is monotinically +* decreasing, and this is just a hint. +*/ +u64 avail = block_group->zone_capacity - block_group->alloc_offset; + +if (block_group_bits (block_group, ffe_ctl->flags) && + avail >= ffe_ctl->num_bytes) { + ffe_ctl->hint_byte = block_group->start; +break ; + } + } +spin_unlock (&fs_info->zone_active_bgs_lock); }return 0 ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 164/185 drm/panel-edp: drm/panel-edp: Fix AUO B116XAK01 name and timing
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsin-Yi Wang <[email protected]>
[ Upstream commit fc6e7679296530106ee0954e8ddef1aa58b2e0b5 ]
Rename AUO 0x405c B116XAK01 to B116XAK01.0 and adjust the timing ofauo_b116xak01: T3=200, T12=500, T7_max = 50 according to decoding edid and datasheet.
--- drivers/gpu/drm/panel/panel-edp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-edp.c +3 -1
@@ -975,6 +975,8 @@ static const struct panel_desc auo_b116xak01 = { }, .delay = { .hpd_absent = 200, + .unprepare = 500, + .enable = 50, }, };
@@ -1870,7 +1872,7 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1062 , &delay_200_500_e50,"B120XAN01.0" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1e9b , &delay_200_500_e50,"B133UAN02.1" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x1ea5 , &delay_200_500_e50,"B116XAK01.6" ), -EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01.0" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x615c , &delay_200_500_e50,"B116XAN06.1" ), EDP_PANEL_ENTRY('A', 'U', 'O', 0x8594, &delay_200_500_e50, "B133UAN01.0"),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 165/185 Revert "powerpc/64s: Increase default stack size to 32KB"
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
This reverts commit 9ccf64e763aca088b0d25c1274af42b1a6a45135 which is upstream commit 18f14afe281648e31ed35c9ad2fcb724c4838ad9.
Breaks the build:
arch/powerpc/kvm/book3s_hv_rmhandlers.S:2689: Error: operand out of range (0x0000000000008310 is not between 0xffffffffffff8001 and 0x0000000000008000) make[3]: *** [scripts/Makefile.build:382: arch/powerpc/kvm/book3s_hv_rmhandlers.o] Error 1
--- arch/powerpc/Kconfig | 1 - 1 file changed, 1 deletion(-)
arch/powerpc/Kconfig +0 -1
@@ -806,7 +806,6 @@ config THREAD_SHIFT int "Thread shift" if EXPERT range 13 15 default "15" if PPC_256K_PAGES - default "15" if PPC_PSERIES || PPC_POWERNV default "14" if PPC64 default "13" help
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 166/185 drm/bridge: parade-ps8640: Wait for HPD when doing an AUX transfer
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit 024b32db43a359e0ded3fcc6cd86247cbbed4224 ]
Unlike what is claimed in commit f5aa7d46b0ee ("drm/bridge:
parade-ps8640: Provide wait_hpd_asserted() in struct drm_dp_aux"), if someone manually tries to do an AUX transfer (like via i2cdump ${bus} 0x50 i) while the panel is off we don't just get a simple transfer error. Instead, the whole ps8640 gets thrown for a loop and goes into a bad state.
Let's put the function to wait for the HPD (and the magical 50 ms after first reset) back in when we're doing an AUX transfer. This shouldn't actually make things much slower (assuming the panel is on) because we should immediately poll and see the HPD high. Mostly this is just an extra i2c transfer to the bridge.
--- drivers/gpu/drm/bridge/parade-ps8640.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/bridge/parade-ps8640.c +5 -0
@@ -354,6 +354,11 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux,int ret;pm_runtime_get_sync (dev); + ret =_ps8640_wait_hpd_asserted (ps_bridge,200 *1000 ); +if (ret) { +pm_runtime_put_sync_suspend (dev); +return ret; + } ret =ps8640_aux_transfer_msg (aux, msg);pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 167/185 drm: panel-simple: add missing bus flags for Tianma tm070jvhg[30/33]
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Markus Niebel <[email protected]>
[ Upstream commit 45dd7df26cee741b31c25ffdd44fb8794eb45ccd ]
The DE signal is active high on this display, fill in the missing bus_flags. This aligns panel_desc with its display_timing.
--- drivers/gpu/drm/panel/panel-simple.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/panel/panel-simple.c +2 -0
@@ -3603,6 +3603,7 @@ static const struct panel_desc tianma_tm070jdhg30 = { }, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .connector_type = DRM_MODE_CONNECTOR_LVDS, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, };static const struct panel_desc tianma_tm070jvhg33 = {
@@ -3615,6 +3616,7 @@ static const struct panel_desc tianma_tm070jvhg33 = { }, .bus_format = MEDIA_BUS_FMT_RGB888_1X7X4_SPWG, .connector_type = DRM_MODE_CONNECTOR_LVDS, + .bus_flags = DRM_BUS_FLAG_DE_HIGH, };static const struct display_timing tianma_tm070rvhg71_timing = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 168/185 drm/bridge: sii902x: Use devm_regulator_bulk_get_enable()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Matti Vaittinen <[email protected]>
[ Upstream commit ff1eae1201a46f997126297d2d3440baa2d1b9a9 ]
Simplify using devm_regulator_bulk_get_enable()
Stable-dep-of: 08ac6f132dd7 ("drm/bridge: sii902x: Fix probing race issue")
--- drivers/gpu/drm/bridge/sii902x.c | 26 ++++---------------------- 1 file changed, 4 insertions(+), 22 deletions(-)
drivers/gpu/drm/bridge/sii902x.c +4 -22
@@ -171,7 +171,6 @@ struct sii902x {struct drm_connector connector;struct gpio_desc *reset_gpio;struct i2c_mux_core *i2cmux; -struct regulator_bulk_data supplies[2 ];bool sink_is_hdmi;/* * Mutex protects audio and video functions from interfering
@@ -1072,6 +1071,7 @@ static int sii902x_probe(struct i2c_client *client,struct device *dev = &client->dev;struct device_node *endpoint;struct sii902x *sii902x; +static const char *const supplies[] = {"iovcc" ,"cvcc12" };int ret; ret = i2c_check_functionality(client->adapter,
@@ -1122,27 +1122,11 @@ static int sii902x_probe(struct i2c_client *client,mutex_init (&sii902x->mutex); - sii902x->supplies[0 ].supply ="iovcc" ; - sii902x->supplies[1 ].supply ="cvcc12" ; - ret =devm_regulator_bulk_get (dev,ARRAY_SIZE (sii902x->supplies), - sii902x->supplies); + ret =devm_regulator_bulk_get_enable (dev,ARRAY_SIZE (supplies), supplies);if (ret <0 ) -return ret; - - ret =regulator_bulk_enable (ARRAY_SIZE (sii902x->supplies), - sii902x->supplies); -if (ret <0 ) { -dev_err_probe (dev, ret,"Failed to enable supplies" ); -return ret; - } +return dev_err_probe (dev, ret,"Failed to enable supplies" ); - ret =sii902x_init (sii902x); -if (ret <0 ) { -regulator_bulk_disable (ARRAY_SIZE (sii902x->supplies), - sii902x->supplies); - } - -return ret; +return sii902x_init (sii902x); }static void sii902x_remove (struct i2c_client *client)
@@ -1152,8 +1136,6 @@ static void sii902x_remove(struct i2c_client *client)i2c_mux_del_adapters (sii902x->i2cmux);drm_bridge_remove (&sii902x->bridge); -regulator_bulk_disable (ARRAY_SIZE (sii902x->supplies), - sii902x->supplies); }static const struct of_device_id sii902x_dt_ids[] = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 169/185 drm/bridge: sii902x: Fix probing race issue
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomi Valkeinen <[email protected]>
[ Upstream commit 08ac6f132dd77e40f786d8af51140c96c6d739c9 ]
A null pointer dereference crash has been observed rarely on TI platforms using sii9022 bridge:
[ 53.271356] sii902x_get_edid+0x34/0x70 [sii902x] [ 53.276066] sii902x_bridge_get_edid+0x14/0x20 [sii902x] [ 53.281381] drm_bridge_get_edid+0x20/0x34 [drm] [ 53.286305] drm_bridge_connector_get_modes+0x8c/0xcc [drm_kms_helper] [ 53.292955] drm_helper_probe_single_connector_modes+0x190/0x538 [drm_kms_helper] [ 53.300510] drm_client_modeset_probe+0x1f0/0xbd4 [drm] [ 53.305958] __drm_fb_helper_initial_config_and_unlock+0x50/0x510 [drm_kms_helper] [ 53.313611] drm_fb_helper_initial_config+0x48/0x58 [drm_kms_helper] [ 53.320039] drm_fbdev_dma_client_hotplug+0x84/0xd4 [drm_dma_helper] [ 53.326401] drm_client_register+0x5c/0xa0 [drm] [ 53.331216] drm_fbdev_dma_setup+0xc8/0x13c [drm_dma_helper] [ 53.336881] tidss_probe+0x128/0x264 [tidss] [ 53.341174] platform_probe+0x68/0xc4 [ 53.344841] really_probe+0x188/0x3c4 [ 53.348501] __driver_probe_device+0x7c/0x16c [ 53.352854] driver_probe_device+0x3c/0x10c [ 53.357033] __device_attach_driver+0xbc/0x158 [ 53.361472] bus_for_each_drv+0x88/0xe8 [ 53.365303] __device_attach+0xa0/0x1b4 [ 53.369135] device_initial_probe+0x14/0x20 [ 53.373314] bus_probe_device+0xb0/0xb4 [ 53.377145] deferred_probe_work_func+0xcc/0x124 [ 53.381757] process_one_work+0x1f0/0x518 [ 53.385770] worker_thread+0x1e8/0x3dc [ 53.389519] kthread+0x11c/0x120 [ 53.392750] ret_from_fork+0x10/0x20
The issue here is as follows:
- tidss probes, but is deferred as sii902x is still missing.
- sii902x starts probing and enters sii902x_init().
- sii902x calls drm_bridge_add(). Now the sii902x bridge is ready from DRM's perspective.
- sii902x calls sii902x_audio_codec_init() and platform_device_register_data()
- The registration of the audio platform device causes probing of the deferred devices.
- tidss probes, which eventually causes sii902x_bridge_get_edid() to be called.
- sii902x_bridge_get_edid() tries to use the i2c to read the edid. However, the sii902x driver has not set up the i2c part yet, leading to the crash.
Fix this by moving the drm_bridge_add() to the end of the sii902x_init(), which is also at the very end of sii902x_probe().
--- drivers/gpu/drm/bridge/sii902x.c | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-)
drivers/gpu/drm/bridge/sii902x.c +16 -13
@@ -1040,16 +1040,6 @@ static int sii902x_init(struct sii902x *sii902x)return ret; } - sii902x->bridge.funcs = &sii902x_bridge_funcs; - sii902x->bridge.of_node = dev->of_node; - sii902x->bridge.timings = &default_sii902x_timings; - sii902x->bridge.ops =DRM_BRIDGE_OP_DETECT |DRM_BRIDGE_OP_EDID ; - -if (sii902x->i2c->irq >0 ) - sii902x->bridge.ops |=DRM_BRIDGE_OP_HPD ; - -drm_bridge_add (&sii902x->bridge); -sii902x_audio_codec_init (sii902x, dev);i2c_set_clientdata (sii902x->i2c, sii902x);
@@ -1062,7 +1052,21 @@ static int sii902x_init(struct sii902x *sii902x)return -ENOMEM ; sii902x->i2cmux->priv = sii902x; -return i2c_mux_add_adapter (sii902x->i2cmux,0 ,0 ,0 ); + ret =i2c_mux_add_adapter (sii902x->i2cmux,0 ,0 ,0 ); +if (ret) +return ret; + + sii902x->bridge.funcs = &sii902x_bridge_funcs; + sii902x->bridge.of_node = dev->of_node; + sii902x->bridge.timings = &default_sii902x_timings; + sii902x->bridge.ops =DRM_BRIDGE_OP_DETECT |DRM_BRIDGE_OP_EDID ; + +if (sii902x->i2c->irq >0 ) + sii902x->bridge.ops |=DRM_BRIDGE_OP_HPD ; + +drm_bridge_add (&sii902x->bridge); + +return 0 ; } static int sii902x_probe(struct i2c_client *client,
@@ -1130,12 +1134,11 @@ static int sii902x_probe(struct i2c_client *client, }static void sii902x_remove (struct i2c_client *client) - {struct sii902x *sii902x =i2c_get_clientdata (client); -i2c_mux_del_adapters (sii902x->i2cmux);drm_bridge_remove (&sii902x->bridge); +i2c_mux_del_adapters (sii902x->i2cmux); }static const struct of_device_id sii902x_dt_ids[] = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 170/185 drm/bridge: sii902x: Fix audio codec unregistration
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomi Valkeinen <[email protected]>
[ Upstream commit 3fc6c76a8d208d3955c9e64b382d0ff370bc61fc ]
The driver never unregisters the audio codec platform device, which can lead to a crash on module reloading, nor does it handle the return value from sii902x_audio_codec_init().
--- drivers/gpu/drm/bridge/sii902x.c | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-)
drivers/gpu/drm/bridge/sii902x.c +17 -4
@@ -1040,7 +1040,9 @@ static int sii902x_init(struct sii902x *sii902x)return ret; } -sii902x_audio_codec_init (sii902x, dev); + ret =sii902x_audio_codec_init (sii902x, dev); +if (ret) +return ret;i2c_set_clientdata (sii902x->i2c, sii902x);
@@ -1048,13 +1050,15 @@ static int sii902x_init(struct sii902x *sii902x)1 ,0 ,I2C_MUX_GATE , sii902x_i2c_bypass_select, sii902x_i2c_bypass_deselect); -if (!sii902x->i2cmux) -return -ENOMEM ; +if (!sii902x->i2cmux) { + ret = -ENOMEM ; + goto err_unreg_audio; + } sii902x->i2cmux->priv = sii902x; ret =i2c_mux_add_adapter (sii902x->i2cmux,0 ,0 ,0 );if (ret) -return ret; + goto err_unreg_audio; sii902x->bridge.funcs = &sii902x_bridge_funcs; sii902x->bridge.of_node = dev->of_node;
@@ -1067,6 +1071,12 @@ static int sii902x_init(struct sii902x *sii902x)drm_bridge_add (&sii902x->bridge);return 0 ; + +err_unreg_audio: +if (!PTR_ERR_OR_ZERO (sii902x->audio.pdev)) +platform_device_unregister (sii902x->audio.pdev); + +return ret; } static int sii902x_probe(struct i2c_client *client,
@@ -1139,6 +1149,9 @@ static void sii902x_remove(struct i2c_client *client)drm_bridge_remove (&sii902x->bridge);i2c_mux_del_adapters (sii902x->i2cmux); + +if (!PTR_ERR_OR_ZERO (sii902x->audio.pdev)) +platform_device_unregister (sii902x->audio.pdev); }static const struct of_device_id sii902x_dt_ids[] = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 171/185 drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Pin-yen Lin <[email protected]>
[ Upstream commit 26db46bc9c675e43230cc6accd110110a7654299 ]
The ps8640 bridge seems to expect everything to be power cycled at the disable process, but sometimes ps8640_aux_transfer() holds the runtime PM reference and prevents the bridge from suspend.
Prevent that by introducing a mutex lock between ps8640_aux_transfer() and .post_disable() to make sure the bridge is really powered off.
--- drivers/gpu/drm/bridge/parade-ps8640.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
drivers/gpu/drm/bridge/parade-ps8640.c +16 -0
@@ -106,6 +106,7 @@ struct ps8640 {struct device_link *link;bool pre_enabled;bool need_post_hpd_delay; +struct mutex aux_lock; };static const struct regmap_config ps8640_regmap_config[] = {
@@ -353,6 +354,7 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux,struct device *dev = &ps_bridge->page[PAGE0_DP_CNTL ]->dev;int ret; +mutex_lock (&ps_bridge->aux_lock);pm_runtime_get_sync (dev); ret =_ps8640_wait_hpd_asserted (ps_bridge,200 *1000 );if (ret) {
@@ -362,6 +364,7 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux, ret =ps8640_aux_transfer_msg (aux, msg);pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev); +mutex_unlock (&ps_bridge->aux_lock);return ret; }
@@ -481,7 +484,18 @@ static void ps8640_post_disable(struct drm_bridge *bridge) ps_bridge->pre_enabled = false;ps8640_bridge_vdo_control (ps_bridge,DISABLE ); + +/* +* The bridge seems to expect everything to be power cycled at the +* disable process, so grab a lock here to make sure +* ps8640_aux_transfer() is not holding a runtime PM reference and +* preventing the bridge from suspend. +*/ +mutex_lock (&ps_bridge->aux_lock); +pm_runtime_put_sync_suspend (&ps_bridge->page[PAGE0_DP_CNTL ]->dev); + +mutex_unlock (&ps_bridge->aux_lock); } static int ps8640_bridge_attach(struct drm_bridge *bridge,
@@ -662,6 +676,8 @@ static int ps8640_probe(struct i2c_client *client)if (!ps_bridge)return -ENOMEM ; +mutex_init (&ps_bridge->aux_lock); + ps_bridge->supplies[0 ].supply ="vdd12" ; ps_bridge->supplies[1 ].supply ="vdd33" ; ret = devm_regulator_bulk_get(dev, ARRAY_SIZE(ps_bridge->supplies),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 172/185 drm/bridge: parade-ps8640: Make sure we drop the AUX mutex in the error case
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Anderson <[email protected]>
[ Upstream commit a20f1b02bafcbf5a32d96a1d4185d6981cf7d016 ]
After commit 26db46bc9c67 ("drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable()"), if we hit the error case in ps8640_aux_transfer() then we return without dropping the mutex. Fix this oversight.
--- drivers/gpu/drm/bridge/parade-ps8640.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/parade-ps8640.c +3 -1
@@ -359,11 +359,13 @@ static ssize_t ps8640_aux_transfer(struct drm_dp_aux *aux, ret =_ps8640_wait_hpd_asserted (ps_bridge,200 *1000 );if (ret) {pm_runtime_put_sync_suspend (dev); -return ret; + goto exit; } ret =ps8640_aux_transfer_msg (aux, msg);pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev); + +exit:mutex_unlock (&ps_bridge->aux_lock);return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 173/185 drm/exynos: fix accidental on-stack copy of exynos_drm_plane
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 960b537e91725bcb17dd1b19e48950e62d134078 ]
gcc rightfully complains about excessive stack usage in the fimd_win_set_pixfmt() function:
drivers/gpu/drm/exynos/exynos_drm_fimd.c: In function 'fimd_win_set_pixfmt':drivers/gpu/drm/exynos/exynos_drm_fimd.c:750:1: error: the frame size of 1032 bytes is larger than 1024 byte drivers/gpu/drm/exynos/exynos5433_drm_decon.c: In function 'decon_win_set_pixfmt':drivers/gpu/drm/exynos/exynos5433_drm_decon.c:381:1: error: the frame size of 1032 bytes is larger than 1024 bytes
There is really no reason to copy the large exynos_drm_plane structure to the stack before using one of its members, so just use a pointer instead.
--- drivers/gpu/drm/exynos/exynos5433_drm_decon.c | 4 ++-- drivers/gpu/drm/exynos/exynos_drm_fimd.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/exynos/exynos5433_drm_decon.c +2 -2
@@ -319,9 +319,9 @@ static void decon_win_set_bldmod(struct decon_context *ctx, unsigned int win,static void decon_win_set_pixfmt (struct decon_context *ctx,unsigned int win,struct drm_framebuffer *fb) { -struct exynos_drm_plane plane = ctx->planes[win]; +struct exynos_drm_plane *plane = &ctx->planes[win];struct exynos_drm_plane_state *state = -to_exynos_plane_state (plane.base.state); +to_exynos_plane_state (plane->base.state);unsigned int alpha = state->base.alpha;unsigned int pixel_alpha;unsigned long val;
drivers/gpu/drm/exynos/exynos_drm_fimd.c +2 -2
@@ -662,9 +662,9 @@ static void fimd_win_set_bldmod(struct fimd_context *ctx, unsigned int win,static void fimd_win_set_pixfmt (struct fimd_context *ctx,unsigned int win,struct drm_framebuffer *fb,int width) { -struct exynos_drm_plane plane = ctx->planes[win]; +struct exynos_drm_plane *plane = &ctx->planes[win];struct exynos_drm_plane_state *state = -to_exynos_plane_state (plane.base.state); +to_exynos_plane_state (plane->base.state);uint32_t pixel_format = fb->format->format;unsigned int alpha = state->base.alpha;u32 val = WINCONx_ENWIN;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 174/185 drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Fedor Pchelkin <[email protected]>
[ Upstream commit 4050957c7c2c14aa795dbf423b4180d5ac04e113 ]
Do not forget to call clk_disable_unprepare() on the first element of ctx->clocks array.
Found by Linux Verification Center (linuxtesting.org).
--- drivers/gpu/drm/exynos/exynos_drm_gsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/exynos/exynos_drm_gsc.c +1 -1
@@ -1342,7 +1342,7 @@ static int __maybe_unused gsc_runtime_resume(struct device *dev)for (i =0 ; i < ctx->num_clocks; i++) { ret =clk_prepare_enable (ctx->clocks[i]);if (ret) { -while (--i >0 ) +while (--i >=0 )clk_disable_unprepare (ctx->clocks[i]);return ret; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 175/185 gpio: eic-sprd: Clear interrupt after set the interrupt type
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenhua Lin <[email protected]>
[ Upstream commit 84aef4ed59705585d629e81d633a83b7d416f5fb ]
The raw interrupt status of eic maybe set before the interrupt is enabled, since the eic interrupt has a latch function, which would trigger the interrupt event once enabled it from user side. To solve this problem, interrupts generated before setting the interrupt trigger type are ignored.
--- drivers/gpio/gpio-eic-sprd.c | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-)
drivers/gpio/gpio-eic-sprd.c +28 -4
@@ -318,20 +318,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)switch (flow_type) {case IRQ_TYPE_LEVEL_HIGH :sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IEV ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IC ,1 );break ;case IRQ_TYPE_LEVEL_LOW :sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IEV ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IC ,1 );break ;case IRQ_TYPE_EDGE_RISING :case IRQ_TYPE_EDGE_FALLING :case IRQ_TYPE_EDGE_BOTH : state =sprd_eic_get (chip, offset); -if (state) +if (state) {sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IEV ,0 ); -else +sprd_eic_update (chip, offset, +SPRD_EIC_DBNC_IC ,1 ); + }else {sprd_eic_update (chip, offset,SPRD_EIC_DBNC_IEV ,1 ); +sprd_eic_update (chip, offset, +SPRD_EIC_DBNC_IC ,1 ); + }break ;default :return -ENOTSUPP ;
@@ -343,20 +350,27 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)switch (flow_type) {case IRQ_TYPE_LEVEL_HIGH :sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTPOL ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTCLR ,1 );break ;case IRQ_TYPE_LEVEL_LOW :sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTPOL ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTCLR ,1 );break ;case IRQ_TYPE_EDGE_RISING :case IRQ_TYPE_EDGE_FALLING :case IRQ_TYPE_EDGE_BOTH : state =sprd_eic_get (chip, offset); -if (state) +if (state) {sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTPOL ,0 ); -else +sprd_eic_update (chip, offset, +SPRD_EIC_LATCH_INTCLR ,1 ); + }else {sprd_eic_update (chip, offset,SPRD_EIC_LATCH_INTPOL ,1 ); +sprd_eic_update (chip, offset, +SPRD_EIC_LATCH_INTCLR ,1 ); + }break ;default :return -ENOTSUPP ;
@@ -370,29 +384,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTPOL ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_EDGE_FALLING :sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTPOL ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_EDGE_BOTH :sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_LEVEL_HIGH :sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,1 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTPOL ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_level_irq);break ;case IRQ_TYPE_LEVEL_LOW :sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTMODE ,1 );sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTPOL ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_ASYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_level_irq);break ;default :
@@ -405,29 +424,34 @@ static int sprd_eic_irq_set_type(struct irq_data *data, unsigned int flow_type)sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTPOL ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_EDGE_FALLING :sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTPOL ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_EDGE_BOTH :sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_edge_irq);break ;case IRQ_TYPE_LEVEL_HIGH :sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,1 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTPOL ,1 ); +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_level_irq);break ;case IRQ_TYPE_LEVEL_LOW :sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTBOTH ,0 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTMODE ,1 );sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTPOL ,0 ); +sprd_eic_update (chip, offset,SPRD_EIC_SYNC_INTCLR ,1 );irq_set_handler_locked (data, handle_level_irq);break ;default :
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 176/185 block: Move checking GENHD_FL_NO_PART to bdev_add_partition()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Li Lingfeng <[email protected]>
[ Upstream commit 7777f47f2ea64efd1016262e7b59fab34adfb869 ]
Commit 1a721de8489f ("block: don't add or resize partition on the disk with GENHD_FL_NO_PART") prevented all operations about partitions on disks with GENHD_FL_NO_PART in blkpg_do_ioctl() since they are meaningless. However, it changed error code in some scenarios. So move checking GENHD_FL_NO_PART to bdev_add_partition() to eliminate impact.
--- block/ioctl.c | 2 -- block/partitions/core.c | 5 +++++ 2 files changed, 5 insertions(+), 2 deletions(-)
block/ioctl.c +0 -2
@@ -20,8 +20,6 @@ static int blkpg_do_ioctl(struct block_device *bdev,struct blkpg_partition p;sector_t start, length; -if (disk->flags &GENHD_FL_NO_PART ) -return -EINVAL ;if (!capable (CAP_SYS_ADMIN ))return -EACCES ;if (copy_from_user (&p, upart,sizeof (struct blkpg_partition )))
block/partitions/core.c +5 -0
@@ -453,6 +453,11 @@ int bdev_add_partition(struct gendisk *disk, int partno, sector_t start, goto out; } +if (disk->flags &GENHD_FL_NO_PART ) { + ret = -EINVAL ; + goto out; + } +if (partition_overlaps (disk, start, length,-1 )) { ret = -EBUSY ; goto out;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 177/185 drm/bridge: anx7625: Ensure bridge is suspended in disable()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsin-Yi Wang <[email protected]>
[ Upstream commit 4d5b7daa3c610af3f322ad1e91fc0c752ff32f0e ]
Similar to commit 26db46bc9c67 ("drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable()"). Add a mutex to ensure that aux transfer won't race with atomic_disable by holding the PM reference and prevent the bridge from suspend.
Also we need to use pm_runtime_put_sync_suspend() to suspend the bridge instead of idle with pm_runtime_put_sync().
--- drivers/gpu/drm/bridge/analogix/anx7625.c | 7 ++++++- drivers/gpu/drm/bridge/analogix/anx7625.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/bridge/analogix/anx7625.c +6 -1
@@ -1742,6 +1742,7 @@ static ssize_t anx7625_aux_transfer(struct drm_dp_aux *aux,u8 request = msg->request & ~DP_AUX_I2C_MOT ;int ret =0 ; +mutex_lock (&ctx->aux_lock);pm_runtime_get_sync (dev); msg->reply =0 ;switch (request) {
@@ -1758,6 +1759,7 @@ static ssize_t anx7625_aux_transfer(struct drm_dp_aux *aux, msg->size, msg->buffer);pm_runtime_mark_last_busy (dev);pm_runtime_put_autosuspend (dev); +mutex_unlock (&ctx->aux_lock);return ret; }
@@ -2454,7 +2456,9 @@ static void anx7625_bridge_atomic_disable(struct drm_bridge *bridge, ctx->connector =NULL ;anx7625_dp_stop (ctx); -pm_runtime_put_sync (dev); +mutex_lock (&ctx->aux_lock); +pm_runtime_put_sync_suspend (dev); +mutex_unlock (&ctx->aux_lock); } static enum drm_connector_status
@@ -2648,6 +2652,7 @@ static int anx7625_i2c_probe(struct i2c_client *client)mutex_init (&platform->lock);mutex_init (&platform->hdcp_wq_lock); +mutex_init (&platform->aux_lock);INIT_DELAYED_WORK (&platform->hdcp_work, hdcp_check_work_func); platform->hdcp_workqueue =create_workqueue ("hdcp workqueue" );
drivers/gpu/drm/bridge/analogix/anx7625.h +2 -0
@@ -471,6 +471,8 @@ struct anx7625_data {struct workqueue_struct *hdcp_workqueue;/* Lock for hdcp work queue */ struct mutex hdcp_wq_lock; +/* Lock for aux transfer and disable */ +struct mutex aux_lock;char edid_block;struct display_timing dt;u8 display_timing_valid;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 178/185 spi: bcm-qspi: fix SFDP BFPT read by usig mspi read
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kamal Dasu <[email protected]>
[ Upstream commit 574bf7bbe83794a902679846770f75a9b7f28176 ]
SFDP read shall use the mspi reads when using the bcm_qspi_exec_mem_op() call. This fixes SFDP parameter page read failures seen with parts that now use SFDP protocol to read the basic flash parameter table.
--- drivers/spi/spi-bcm-qspi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-bcm-qspi.c +2 -2
@@ -19,7 +19,7 @@#include <linux/platform_device.h> #include <linux/slab.h> #include <linux/spi/spi.h> -#include <linux/spi/spi-mem.h> +#include <linux/mtd/spi-nor.h> #include <linux/sysfs.h> #include <linux/types.h> #include "spi-bcm-qspi.h"
@@ -1221,7 +1221,7 @@ static int bcm_qspi_exec_mem_op(struct spi_mem *mem,/* non-aligned and very short transfers are handled by MSPI */ if (!IS_ALIGNED ((uintptr_t )addr,4 ) || !IS_ALIGNED ((uintptr_t )buf,4 ) || - len <4 ) + len <4 || op->cmd.opcode ==SPINOR_OP_RDSFDP ) mspi_read = true;if (!has_bspi (qspi) || mspi_read)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 179/185 spi: fix finalize message on error return
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Lechner <[email protected]>
[ Upstream commit 8c2ae772fe08e33f3d7a83849e85539320701abd ]
In __spi_pump_transfer_message(), the message was not finalized in the first error return as it is in the other error return paths. Not finalizing the message could cause anything waiting on the message to complete to hang forever.
This adds the missing call to spi_finalize_current_message().
--- drivers/spi/spi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/spi/spi.c +4 -0
@@ -1636,6 +1636,10 @@ static int __spi_pump_transfer_message(struct spi_controller *ctlr,pm_runtime_put_noidle (ctlr->dev.parent);dev_err (&ctlr->dev,"Failed to power device: %d\n" , ret); + + msg->status = ret; +spi_finalize_current_message (ctlr); +return ret; } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 180/185 MIPS: lantiq: register smp_ops on non-smp platforms
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aleksander Jan Bajkowski <[email protected]>
[ Upstream commit 4bf2a626dc4bb46f0754d8ac02ec8584ff114ad5 ]
Lantiq uses a common kernel config for devices with 24Kc and 34Kc cores. The changes made previously to add support for interrupts on all cores work on 24Kc platforms with SMP disabled and 34Kc platforms with SMP enabled. This patch fixes boot issues on Danube (single core 24Kc) with SMP enabled.
--- arch/mips/lantiq/prom.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
arch/mips/lantiq/prom.c +3 -4
@@ -114,10 +114,9 @@ void __init prom_init(void)prom_init_cmdline ();#if defined(CONFIG_MIPS_MT_SMP ) -if (cpu_has_mipsmt) { - lantiq_smp_ops = vsmp_smp_ops; + lantiq_smp_ops = vsmp_smp_ops; +if (cpu_has_mipsmt) lantiq_smp_ops.init_secondary = lantiq_init_secondary; -register_smp_ops (&lantiq_smp_ops); - } +register_smp_ops (&lantiq_smp_ops);#endif }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 181/185 cxl/region:Fix overflow issue in alloc_hpa()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Quanquan Cao <[email protected]>
commit d76779dd3681c01a4c6c3cae4d0627c9083e0ee6 upstream.
Creating a region with 16 memory devices caused a problem. The div_u64_rem function, used for dividing an unsigned 64-bit number by a 32-bit one, faced an issue when SZ_256M * p->interleave_ways. The result surpassed the maximum limit of the 32-bit divisor (4G), leading to an overflow and a remainder of 0.
note: At this point, p->interleave_ways is 16, meaning 16 * 256M = 4G
To fix this issue, I replaced the div_u64_rem function with div64_u64_rem and adjusted the type of the remainder.
--- drivers/cxl/core/region.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/cxl/core/region.c +2 -2
@@ -450,7 +450,7 @@ static int alloc_hpa(struct cxl_region *struct cxl_root_decoder *cxlrd =to_cxl_root_decoder (cxlr->dev.parent);struct cxl_region_params *p = &cxlr->params;struct resource *res; -u32 remainder =0 ; +u64 remainder =0 ;lockdep_assert_held_write (&cxl_region_rwsem);
@@ -470,7 +470,7 @@ static int alloc_hpa(struct cxl_region * (cxlr->mode == CXL_DECODER_PMEM && uuid_is_null(&p->uuid)))return -ENXIO ; -div_u64_rem (size,SZ_256M * p->interleave_ways, &remainder); +div64_u64_rem (size, (u64 )SZ_256M * p->interleave_ways, &remainder);if (remainder)return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 182/185 mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Xi Ruoyao <[email protected]>
commit 59be5c35850171e307ca5d3d703ee9ff4096b948 upstream.
If we still own the FPU after initializing fcr31, when we are preempted the dirty value in the FPU will be read out and stored into fcr31, clobbering our setting. This can cause an improper floating-point environment after execve(). For example:
zsh% cat measure.c
#include <fenv.h>
int main() { return fetestexcept(FE_INEXACT); } zsh% cc measure.c -o measure -lm
zsh% echo $((1.0/3)) # raising FE_INEXACT 0.33333333333333331
zsh% while ./measure; do ; done (stopped in seconds)
Call lose_fpu(0) before setting fcr31 to prevent this.
--- arch/mips/kernel/elf.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/mips/kernel/elf.c +6 -0
@@ -11,6 +11,7 @@#include <asm/cpu-features.h> #include <asm/cpu-info.h> +#include <asm/fpu.h> #ifdef CONFIG_MIPS_FP_SUPPORT
@@ -309,6 +310,11 @@ void mips_set_personality_nan(struct arcstruct cpuinfo_mips *c = &boot_cpu_data;struct task_struct *t = current; +/* Do this early so t->thread.fpu.fcr31 won't be clobbered in case +* we are preempted before the lose_fpu(0) in start_thread. +*/ +lose_fpu (0 ); + t->thread.fpu.fcr31 = c->fpu_csr31;switch (state->nan_2008) {case 0 :
Greg Kroah-Hartman
maintainerPATCH 183/185 tick/sched: Preserve number of idle sleeps across CPU hotplug events
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tim Chen <[email protected]>
commit 9a574ea9069be30b835a3da772c039993c43369b upstream.
Commit 71fee48f ("tick-sched: Fix idle and iowait sleeptime accounting vs CPU hotplug") preserved total idle sleep time and iowait sleeptime across CPU hotplug events.
Similar reasoning applies to the number of idle calls and idle sleeps to get the proper average of sleep time per idle invocation.
Preserve those fields too.
--- kernel/time/tick-sched.c | 5 +++++ 1 file changed, 5 insertions(+)
kernel/time/tick-sched.c +5 -0
@@ -1557,6 +1557,7 @@ void tick_cancel_sched_timer(int cpu) {struct tick_sched *ts = &per_cpu (tick_cpu_sched, cpu);ktime_t idle_sleeptime, iowait_sleeptime; +unsigned long idle_calls, idle_sleeps;# ifdef CONFIG_HIGH_RES_TIMERS if (ts->sched_timer.base)
@@ -1565,9 +1566,13 @@ void tick_cancel_sched_timer(int cpu) idle_sleeptime = ts->idle_sleeptime; iowait_sleeptime = ts->iowait_sleeptime; + idle_calls = ts->idle_calls; + idle_sleeps = ts->idle_sleeps;memset (ts,0 ,sizeof (*ts)); ts->idle_sleeptime = idle_sleeptime; ts->iowait_sleeptime = iowait_sleeptime; + ts->idle_calls = idle_calls; + ts->idle_sleeps = idle_sleeps; }#endif
Greg Kroah-Hartman
maintainerPATCH 184/185 x86/entry/ia32: Ensure s32 is sign extended to s64
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Richard Palethorpe <[email protected]>
commit 56062d60f117dccfb5281869e0ab61e090baf864 upstream.
Presently ia32 registers stored in ptregs are unconditionally cast to unsigned int by the ia32 stub. They are then cast to long when passed to __se_sys*, but will not be sign extended.
This takes the sign of the syscall argument into account in the ia32 stub. It still casts to unsigned int to avoid implementation specific behavior. However then casts to int or unsigned int as necessary. So that the following cast to long sign extends the value.
This fixes the io_pgetevents02 LTP test when compiled with -m32. Presently the systemcall io_pgetevents_time64() unexpectedly accepts -1 for the maximum number of events.
It doesn't appear other systemcalls with signed arguments are effected because they all have compat variants defined and wired up.
--- arch/x86/include/asm/syscall_wrapper.h | 25 +++++++++++++++++++++---- include/linux/syscalls.h | 1 + 2 files changed, 22 insertions(+), 4 deletions(-)
arch/x86/include/asm/syscall_wrapper.h +21 -4
@@ -58,12 +58,29 @@ extern long __ia32_sys_ni_syscall(const ,,regs->di,,regs->si,,regs->dx \ ,,regs->r10,,regs->r8,,regs->r9) \ + +/* SYSCALL_PT_ARGS is Adapted from s390x */ +#define SYSCALL_PT_ARG6 (m, t1, t2, t3, t4, t5, t6) \ + SYSCALL_PT_ARG5(m, t1, t2, t3, t4, t5), m(t6, (regs->bp)) +#define SYSCALL_PT_ARG5 (m, t1, t2, t3, t4, t5) \ + SYSCALL_PT_ARG4(m, t1, t2, t3, t4), m(t5, (regs->di)) +#define SYSCALL_PT_ARG4 (m, t1, t2, t3, t4) \ + SYSCALL_PT_ARG3(m, t1, t2, t3), m(t4, (regs->si)) +#define SYSCALL_PT_ARG3 (m, t1, t2, t3) \ + SYSCALL_PT_ARG2(m, t1, t2), m(t3, (regs->dx)) +#define SYSCALL_PT_ARG2 (m, t1, t2) \ + SYSCALL_PT_ARG1(m, t1), m(t2, (regs->cx)) +#define SYSCALL_PT_ARG1 (m, t1) m(t1, (regs->bx)) +#define SYSCALL_PT_ARGS (x, ...) SYSCALL_PT_ARG##x(__VA_ARGS__) + +#define __SC_COMPAT_CAST (t, a) \ + (__typeof(__builtin_choose_expr(__TYPE_IS_L(t), 0, 0U))) \ + (unsigned int)a +/* Mapping of registers to parameters for syscalls on i386 */ #define SC_IA32_REGS_TO_ARGS (x, ...) \ - __MAP(x,__SC_ARGS \ - ,,(unsigned int)regs->bx,,(unsigned int)regs->cx \ - ,,(unsigned int)regs->dx,,(unsigned int)regs->si \ - ,,(unsigned int)regs->di,,(unsigned int)regs->bp) + SYSCALL_PT_ARGS(x, __SC_COMPAT_CAST, \ + __MAP(x, __SC_TYPE, __VA_ARGS__)) \#define __SYS_STUB0 (abi, name) \ long __##abi##_##name(const struct pt_regs *regs); \
include/linux/syscalls.h +1 -0
@@ -123,6 +123,7 @@ enum landlock_rule_type;#define __TYPE_IS_LL (t) (__TYPE_AS(t, 0LL) || __TYPE_AS(t, 0ULL))#define __SC_LONG (t, a) __typeof(__builtin_choose_expr(__TYPE_IS_LL(t), 0LL, 0L)) a#define __SC_CAST (t, a) (__force t) a +#define __SC_TYPE (t, a) t#define __SC_ARGS (t, a) a#define __SC_TEST (t, a) (void)BUILD_BUG_ON_ZERO(!__TYPE_IS_LL(t) && sizeof(t) > sizeof(long))
Greg Kroah-Hartman
maintainerPATCH 185/185 serial: core: fix kernel-doc for uart_port_unlock_irqrestore()
In reply to Greg Kroah-Hartman6.1-stable review patch. If anyone has any objections, please let me know.
------------------
From: Randy Dunlap <[email protected]>
commit 29bff582b74ed0bdb7e6986482ad9e6799ea4d2f upstream.
Fix the function name to avoid a kernel-doc warning:
include/linux/serial_core.h:666: warning: expecting prototype for uart_port_lock_irqrestore(). Prototype was for uart_port_unlock_irqrestore() instead
--- include/linux/serial_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/serial_core.h +1 -1
@@ -653,7 +653,7 @@ static inline void uart_port_unlock_irq( }/** -* uart_port_lock_irqrestore - Unlock the UART port, restore interrupts +* uart_port_unlock_irqrestore - Unlock the UART port, restore interrupts * @up: Pointer to UART port structure * @flags: The saved interrupt flags for restore */
Hello,
Quoted 5 lines · On Mon, 29 Jan 2024 09:03:20 -0800 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.1.76 release. There are 185 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.76-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.
This rc kernel passes DAMON functionality test[1] on my test machine. Attaching the test results summary below. Please note that I retrieved the kernel from linux-stable-rc tree[2].
[1] https://github.com/awslabs/damon-tests/tree/next/corr
[2] 1f00d9fd963e ("Linux 6.1.76-rc1")
Thanks,
SJ
[...]
---
ok 1 selftests: damon: debugfs_attrs.sh
ok 2 selftests: damon: debugfs_schemes.sh
ok 3 selftests: damon: debugfs_target_ids.sh
ok 4 selftests: damon: debugfs_empty_targets.sh
ok 5 selftests: damon: debugfs_huge_count_read_write.sh
ok 6 selftests: damon: debugfs_duplicate_context_creation.sh
ok 7 selftests: damon: sysfs.sh
ok 1 selftests: damon-tests: kunit.sh
ok 2 selftests: damon-tests: huge_count_read_write.sh
ok 3 selftests: damon-tests: buffer_overflow.sh
ok 4 selftests: damon-tests: rm_contexts.sh
ok 5 selftests: damon-tests: record_null_deref.sh
ok 6 selftests: damon-tests: dbgfs_target_ids_read_before_terminate_race.sh ok 7 selftests: damon-tests: dbgfs_target_ids_pid_leak.sh
ok 8 selftests: damon-tests: damo_tests.sh
ok 9 selftests: damon-tests: masim-record.sh
ok 10 selftests: damon-tests: build_i386.sh
ok 11 selftests: damon-tests: build_arm64.sh
ok 12 selftests: damon-tests: build_m68k.sh
ok 13 selftests: damon-tests: build_i386_idle_flag.sh
ok 14 selftests: damon-tests: build_i386_highpte.sh
ok 15 selftests: damon-tests: build_nomemcg.sh
[33m
[92mPASS [39m
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.76 release. There are 185 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.76-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 9 lines
This is the start of the stable review cycle for the 6.1.76 release. There are 185 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.76-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my x86_64 and ARM64 test systems. No errors or regressions.
Thanks.
Hello!
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.76 release. There are 185 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.76-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
We see build regressions on Arm64, as reported by Naresh earlier, and System/390:
-----8<-----
/builds/linux/drivers/net/ethernet/mellanox/mlx5/core/en/params.c: In function 'mlx5e_build_sq_param':
/builds/linux/drivers/net/ethernet/mellanox/mlx5/core/en/params.c:994:53: error: 'MLX5_IPSEC_CAP_CRYPTO' undeclared (first use in this function)
994 | (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_CRYPTO);
| ^~~~~~~~~~~~~~~~~~~~~ /builds/linux/drivers/net/ethernet/mellanox/mlx5/core/en/params.c:994:53: note: each undeclared identifier is reported only once for each function it appears in make[7]: *** [/builds/linux/scripts/Makefile.build:250: drivers/net/ethernet/mellanox/mlx5/core/en/params.o] Error 1
----->8-----
Bisection points to:
commit 1288b23c9c528796ab656d2796705f52c5ffad8a
Author: Leon Romanovsky <[email protected]>
Date: Tue Dec 12 13:52:55 2023 +0200
net/mlx5e: Allow software parsing when IPsec crypto is enabled
[ Upstream commit 20f5468a7988dedd94a57ba8acd65ebda6a59723 ]
Reverting that commit made the build pass again.
Reproducers:
tuxmake --runtime podman --target-arch arm64 --toolchain gcc-13 --kconfig defconfig tuxmake --runtime podman --target-arch s390 --toolchain gcc-13 --kconfig defconfig
Greetings!
Daniel Díaz
[email protected]
Quoted 50 lines · Daniel Díaz
Hello!
Quoted 14 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.76 release. There are 185 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.76-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-6.1.y and the diffstat can be found below.Quoted 3 lines
thanks,
greg k-h
We see build regressions on Arm64, as reported by Naresh earlier, and System/390:
-----8<-----
/builds/linux/drivers/net/ethernet/mellanox/mlx5/core/en/params.c: In
function 'mlx5e_build_sq_param':/builds/linux/drivers/net/ethernet/mellanox/mlx5/core/en/params.c:994:53: error: '
MLX5_IPSEC_CAP_CRYPTO' undeclared (first use in this function)
994 | (mlx5_ipsec_device_caps(mdev)&MLX5_IPSEC_CAP_CRYPTO);
|
^~~~~~~~~~~~~~~~~~~~~/builds/linux/drivers/net/ethernet/mellanox/mlx5/core/en/params.c:994:53: note: each undeclared identifier is reported only once for each function it appears in
make[7]: *** [/builds/linux/scripts/Makefile.build:250:drivers/net/ethernet/mellanox/mlx5/core/en/params.o] Error 1
----->8-----Bisection points to:
commit
1288b23c9c528796ab656d2796705f52c5ffad8a
Author: Leon Romanovsky <[email protected]> Date: Tue Dec 12 13:52:55 2023 +0200net/mlx5e: Allow software parsing when IPsec crypto is enabled [ Upstream commit
20f5468a7988dedd94a57ba8acd65ebda6a59723]Reverting that commit made the build pass again.
Quoted 8 lines
Reproducers:
tuxmake --runtime podman --target-arch arm64 --toolchain gcc-13
--kconfig defconfig
tuxmake --runtime podman --target-arch s390 --toolchain gcc-13
--kconfig defconfig
FWIW, I am observing the same build issue.
Jon
Signature · 1 line
nvpublic
Hi!
Quoted 20 lines
Quoted 9 lines
This is the start of the stable review cycle for the 6.1.76 release. There are 185 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.76-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
We see build regressions on Arm64, as reported by Naresh earlier, and System/390:
Quoted 9 lines
-----8<-----
/builds/linux/drivers/net/ethernet/mellanox/mlx5/core/en/params.c: In function 'mlx5e_build_sq_param':
/builds/linux/drivers/net/ethernet/mellanox/mlx5/core/en/params.c:994:53: error: 'MLX5_IPSEC_CAP_CRYPTO' undeclared (first use in this function)994 | (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_CRYPTO); | ^~~~~~~~~~~~~~~~~~~~~/builds/linux/drivers/net/ethernet/mellanox/mlx5/core/en/params.c:994:53: note: each undeclared identifier is reported only once for each function it appears in make[7]: *** [/builds/linux/scripts/Makefile.build:250:
drivers/net/ethernet/mellanox/mlx5/core/en/params.o] Error 1
----->8-----
We see the same problem in -cip builds:
drivers/net/ethernet/mellanox/mlx5/core/en/params.c: In function 'mlx5e_build_sq_param':7942drivers/net/ethernet/mellanox/mlx5/core/en/params.c:994:53: error: 'MLX5_IPSEC_CAP_CRYPTO' undeclared (first use in this function)
7943 994 | (mlx5_ipsec_device_caps(mdev) & MLX5_IPSEC_CAP_CRYPTO);
7944 | ^~~~~~~~~~~~~~~~~~~~~7945drivers/net/ethernet/mellanox/mlx5/core/en/params.c:994:53: note: each undeclared identifier is reported only once for each function it appears in 7946 CC [M] drivers/net/ethernet/stmicro/stmmac/stmmac_xdp.o
7947make[6]: *** [scripts/Makefile.build:250: drivers/net/ethernet/mellanox/mlx5/core/en/params.o] Error 1
7948make[6]: *** Waiting for unfinished jobs....
7949
Best regards,
Pavel
Signature · 2 lines
DENX Software Engineering GmbH, Managing Director: Erika Unter HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.76 release. There are 185 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.76-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB using 32-bit and 64-bit ARM kernels, build tested on BMIPS_GENERIC:
Signature · 1 line
Florian
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.76 release. There are 185 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 9 lines
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.76-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.
KernelCI report for stable-rc/linux-6.1.y for this week :-
## stable-rc HEAD for linux-6.1.y:
Date: 2024-01-30
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git/log/?h=1f00d9fd963ebf5b448c0a5666c4e83ac97d8f03
## Build failures:
arm64:
- defconfig (gcc-10) and defconfig+arm64-chromebook (gcc-10)
- Build details :- https://linux.kernelci.org/build/stable-rc/branch/linux-6.1.y/kernel/v6.1.75-186-g1f00d9fd963eb/
- Errors :-
drivers/net/ethernet/mellanox/mlx5/core/en/params.c:994:39: error: ‘MLX5_IPSEC_CAP_CRYPTO’ undeclared (first use in this function)
## Boot failures:
No **new** boot failures seen for the stable-rc/linux-6.1.y commit head \o/
Thanks,
Shreeya Patel
Quoted 5 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.76 release. There are 185 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Quoted 8 lines
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.76-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.
Works fine here on x86_64. No Mellanox hardware, so I was not affected by the build failures which lead to -rc2.
Cheers,
Sven
Hi Greg,
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.1.76 release. There are 185 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 31 Jan 2024 16:59:28 +0000. Anything received after that time might be too late.
Quoted 7 lines
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v6.x/stable-review/patch-6.1.76-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.1.y
and the diffstat can be found below.thanks,
I tested 6.1.76-rc1 (1f00d9fd963e) on Kalray kvx arch (not upstream yet), just to let you know everything works in our CI.
It ran on real hw (k200, k200lp and k300 boards), on qemu as well as on our internal instruction set simulator (ISS).
Tests were run on several interfaces/drivers (usb, qsfp ethernet, eMMC, PCIe endpoint+RC, SPI, remoteproc, uart, iommu). LTP and uClibc-ng testsuites are also run without any regression.
Everything looks fine to us.
Thanks a lot!
--
Yann