Skip to content

Commit 31dbf25

Browse files
committed
Merge remote-tracking branch 'stable/linux-6.1.y' into rpi-6.1.y
2 parents 1d15e6a + 61fd484 commit 31dbf25

File tree

10 files changed

+130
-45
lines changed

10 files changed

+130
-45
lines changed

Documentation/process/changes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,7 @@ openssl & libcrypto 1.0.0 openssl version
6060
bc 1.06.95 bc --version
6161
Sphinx\ [#f1]_ 1.7 sphinx-build --version
6262
cpio any cpio --version
63+
gtags (optional) 6.6.5 gtags --version
6364
====================== =============== ========================================
6465

6566
.. [#f1] Sphinx is needed only to build the Kernel documentation
@@ -174,6 +175,12 @@ You will need openssl to build kernels 3.7 and higher if module signing is
174175
enabled. You will also need openssl development packages to build kernels 4.3
175176
and higher.
176177

178+
gtags / GNU GLOBAL (optional)
179+
-----------------------------
180+
181+
The kernel build requires GNU GLOBAL version 6.6.5 or later to generate
182+
tag files through ``make gtags``. This is due to its use of the gtags
183+
``-C (--directory)`` flag.
177184

178185
System utilities
179186
****************

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# SPDX-License-Identifier: GPL-2.0
22
VERSION = 6
33
PATCHLEVEL = 1
4-
SUBLEVEL = 37
4+
SUBLEVEL = 38
55
EXTRAVERSION =
66
NAME = Curry Ramen
77

drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2363,6 +2363,10 @@ int amdgpu_vm_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
23632363
long timeout = msecs_to_jiffies(2000);
23642364
int r;
23652365

2366+
/* No valid flags defined yet */
2367+
if (args->in.flags)
2368+
return -EINVAL;
2369+
23662370
switch (args->in.op) {
23672371
case AMDGPU_VM_OP_RESERVE_VMID:
23682372
/* We only have requirement to reserve vmid from gfxhub */

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 29 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -401,8 +401,13 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc,
401401
{
402402
int i;
403403

404-
if (memcmp(adjust, &stream->adjust, sizeof(struct dc_crtc_timing_adjust)) == 0)
405-
return true;
404+
/*
405+
* Don't adjust DRR while there's bandwidth optimizations pending to
406+
* avoid conflicting with firmware updates.
407+
*/
408+
if (dc->ctx->dce_version > DCE_VERSION_MAX)
409+
if (dc->optimized_required || dc->wm_optimized_required)
410+
return false;
406411

407412
stream->adjust.v_total_max = adjust->v_total_max;
408413
stream->adjust.v_total_mid = adjust->v_total_mid;
@@ -2024,27 +2029,33 @@ void dc_post_update_surfaces_to_stream(struct dc *dc)
20242029

20252030
post_surface_trace(dc);
20262031

2027-
if (dc->ctx->dce_version >= DCE_VERSION_MAX)
2028-
TRACE_DCN_CLOCK_STATE(&context->bw_ctx.bw.dcn.clk);
2029-
else
2032+
/*
2033+
* Only relevant for DCN behavior where we can guarantee the optimization
2034+
* is safe to apply - retain the legacy behavior for DCE.
2035+
*/
2036+
2037+
if (dc->ctx->dce_version < DCE_VERSION_MAX)
20302038
TRACE_DCE_CLOCK_STATE(&context->bw_ctx.bw.dce);
2039+
else {
2040+
TRACE_DCN_CLOCK_STATE(&context->bw_ctx.bw.dcn.clk);
20312041

2032-
if (is_flip_pending_in_pipes(dc, context))
2033-
return;
2042+
if (is_flip_pending_in_pipes(dc, context))
2043+
return;
20342044

2035-
for (i = 0; i < dc->res_pool->pipe_count; i++)
2036-
if (context->res_ctx.pipe_ctx[i].stream == NULL ||
2037-
context->res_ctx.pipe_ctx[i].plane_state == NULL) {
2038-
context->res_ctx.pipe_ctx[i].pipe_idx = i;
2039-
dc->hwss.disable_plane(dc, &context->res_ctx.pipe_ctx[i]);
2040-
}
2045+
for (i = 0; i < dc->res_pool->pipe_count; i++)
2046+
if (context->res_ctx.pipe_ctx[i].stream == NULL ||
2047+
context->res_ctx.pipe_ctx[i].plane_state == NULL) {
2048+
context->res_ctx.pipe_ctx[i].pipe_idx = i;
2049+
dc->hwss.disable_plane(dc, &context->res_ctx.pipe_ctx[i]);
2050+
}
20412051

2042-
process_deferred_updates(dc);
2052+
process_deferred_updates(dc);
20432053

2044-
dc->hwss.optimize_bandwidth(dc, context);
2054+
dc->hwss.optimize_bandwidth(dc, context);
20452055

2046-
if (dc->debug.enable_double_buffered_dsc_pg_support)
2047-
dc->hwss.update_dsc_pg(dc, context, true);
2056+
if (dc->debug.enable_double_buffered_dsc_pg_support)
2057+
dc->hwss.update_dsc_pg(dc, context, true);
2058+
}
20482059

20492060
dc->optimized_required = false;
20502061
dc->wm_optimized_required = false;
@@ -3869,12 +3880,9 @@ void dc_commit_updates_for_stream(struct dc *dc,
38693880
if (new_pipe->plane_state && new_pipe->plane_state != old_pipe->plane_state)
38703881
new_pipe->plane_state->force_full_update = true;
38713882
}
3872-
} else if (update_type == UPDATE_TYPE_FAST && dc_ctx->dce_version >= DCE_VERSION_MAX) {
3883+
} else if (update_type == UPDATE_TYPE_FAST) {
38733884
/*
38743885
* Previous frame finished and HW is ready for optimization.
3875-
*
3876-
* Only relevant for DCN behavior where we can guarantee the optimization
3877-
* is safe to apply - retain the legacy behavior for DCE.
38783886
*/
38793887
dc_post_update_surfaces_to_stream(dc);
38803888
}

drivers/nubus/proc.c

Lines changed: 17 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,18 @@ static int nubus_proc_rsrc_show(struct seq_file *m, void *v)
137137
return 0;
138138
}
139139

140+
static int nubus_rsrc_proc_open(struct inode *inode, struct file *file)
141+
{
142+
return single_open(file, nubus_proc_rsrc_show, inode);
143+
}
144+
145+
static const struct proc_ops nubus_rsrc_proc_ops = {
146+
.proc_open = nubus_rsrc_proc_open,
147+
.proc_read = seq_read,
148+
.proc_lseek = seq_lseek,
149+
.proc_release = single_release,
150+
};
151+
140152
void nubus_proc_add_rsrc_mem(struct proc_dir_entry *procdir,
141153
const struct nubus_dirent *ent,
142154
unsigned int size)
@@ -152,8 +164,8 @@ void nubus_proc_add_rsrc_mem(struct proc_dir_entry *procdir,
152164
pded = nubus_proc_alloc_pde_data(nubus_dirptr(ent), size);
153165
else
154166
pded = NULL;
155-
proc_create_single_data(name, S_IFREG | 0444, procdir,
156-
nubus_proc_rsrc_show, pded);
167+
proc_create_data(name, S_IFREG | 0444, procdir,
168+
&nubus_rsrc_proc_ops, pded);
157169
}
158170

159171
void nubus_proc_add_rsrc(struct proc_dir_entry *procdir,
@@ -166,9 +178,9 @@ void nubus_proc_add_rsrc(struct proc_dir_entry *procdir,
166178
return;
167179

168180
snprintf(name, sizeof(name), "%x", ent->type);
169-
proc_create_single_data(name, S_IFREG | 0444, procdir,
170-
nubus_proc_rsrc_show,
171-
nubus_proc_alloc_pde_data(data, 0));
181+
proc_create_data(name, S_IFREG | 0444, procdir,
182+
&nubus_rsrc_proc_ops,
183+
nubus_proc_alloc_pde_data(data, 0));
172184
}
173185

174186
/*

drivers/pci/pci-acpi.c

Lines changed: 40 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,16 @@ bool acpi_pci_bridge_d3(struct pci_dev *dev)
10431043
return false;
10441044
}
10451045

1046+
static void acpi_pci_config_space_access(struct pci_dev *dev, bool enable)
1047+
{
1048+
int val = enable ? ACPI_REG_CONNECT : ACPI_REG_DISCONNECT;
1049+
int ret = acpi_evaluate_reg(ACPI_HANDLE(&dev->dev),
1050+
ACPI_ADR_SPACE_PCI_CONFIG, val);
1051+
if (ret)
1052+
pci_dbg(dev, "ACPI _REG %s evaluation failed (%d)\n",
1053+
enable ? "connect" : "disconnect", ret);
1054+
}
1055+
10461056
int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
10471057
{
10481058
struct acpi_device *adev = ACPI_COMPANION(&dev->dev);
@@ -1053,32 +1063,49 @@ int acpi_pci_set_power_state(struct pci_dev *dev, pci_power_t state)
10531063
[PCI_D3hot] = ACPI_STATE_D3_HOT,
10541064
[PCI_D3cold] = ACPI_STATE_D3_COLD,
10551065
};
1056-
int error = -EINVAL;
1066+
int error;
10571067

10581068
/* If the ACPI device has _EJ0, ignore the device */
10591069
if (!adev || acpi_has_method(adev->handle, "_EJ0"))
10601070
return -ENODEV;
10611071

10621072
switch (state) {
1063-
case PCI_D3cold:
1064-
if (dev_pm_qos_flags(&dev->dev, PM_QOS_FLAG_NO_POWER_OFF) ==
1065-
PM_QOS_FLAGS_ALL) {
1066-
error = -EBUSY;
1067-
break;
1068-
}
1069-
fallthrough;
10701073
case PCI_D0:
10711074
case PCI_D1:
10721075
case PCI_D2:
10731076
case PCI_D3hot:
1074-
error = acpi_device_set_power(adev, state_conv[state]);
1077+
case PCI_D3cold:
1078+
break;
1079+
default:
1080+
return -EINVAL;
1081+
}
1082+
1083+
if (state == PCI_D3cold) {
1084+
if (dev_pm_qos_flags(&dev->dev, PM_QOS_FLAG_NO_POWER_OFF) ==
1085+
PM_QOS_FLAGS_ALL)
1086+
return -EBUSY;
1087+
1088+
/* Notify AML lack of PCI config space availability */
1089+
acpi_pci_config_space_access(dev, false);
10751090
}
10761091

1077-
if (!error)
1078-
pci_dbg(dev, "power state changed by ACPI to %s\n",
1079-
acpi_power_state_string(adev->power.state));
1092+
error = acpi_device_set_power(adev, state_conv[state]);
1093+
if (error)
1094+
return error;
10801095

1081-
return error;
1096+
pci_dbg(dev, "power state changed by ACPI to %s\n",
1097+
acpi_power_state_string(adev->power.state));
1098+
1099+
/*
1100+
* Notify AML of PCI config space availability. Config space is
1101+
* accessible in all states except D3cold; the only transitions
1102+
* that change availability are transitions to D3cold and from
1103+
* D3cold to D0.
1104+
*/
1105+
if (state == PCI_D0)
1106+
acpi_pci_config_space_access(dev, true);
1107+
1108+
return 0;
10821109
}
10831110

10841111
pci_power_t acpi_pci_get_power_state(struct pci_dev *dev)

include/linux/mm.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ extern unsigned int kobjsize(const void *objp);
378378
#endif /* CONFIG_HAVE_ARCH_USERFAULTFD_MINOR */
379379

380380
/* Bits set in the VMA until the stack is in its final location */
381-
#define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ)
381+
#define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ | VM_STACK_EARLY)
382382

383383
#define TASK_EXEC ((current->personality & READ_IMPLIES_EXEC) ? VM_EXEC : 0)
384384

@@ -400,8 +400,10 @@ extern unsigned int kobjsize(const void *objp);
400400

401401
#ifdef CONFIG_STACK_GROWSUP
402402
#define VM_STACK VM_GROWSUP
403+
#define VM_STACK_EARLY VM_GROWSDOWN
403404
#else
404405
#define VM_STACK VM_GROWSDOWN
406+
#define VM_STACK_EARLY 0
405407
#endif
406408

407409
#define VM_STACK_FLAGS (VM_STACK | VM_STACK_DEFAULT_FLAGS | VM_ACCOUNT)

mm/nommu.c

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -688,8 +688,13 @@ EXPORT_SYMBOL(find_vma);
688688
struct vm_area_struct *lock_mm_and_find_vma(struct mm_struct *mm,
689689
unsigned long addr, struct pt_regs *regs)
690690
{
691+
struct vm_area_struct *vma;
692+
691693
mmap_read_lock(mm);
692-
return vma_lookup(mm, addr);
694+
vma = vma_lookup(mm, addr);
695+
if (!vma)
696+
mmap_read_unlock(mm);
697+
return vma;
693698
}
694699

695700
/*

scripts/tags.sh

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,13 @@ else
2525
tree=${srctree}/
2626
fi
2727

28+
# gtags(1) refuses to index any file outside of its current working dir.
29+
# If gtags indexing is requested and the build output directory is not
30+
# the kernel source tree, index all files in absolute-path form.
31+
if [[ "$1" == "gtags" && -n "${tree}" ]]; then
32+
tree=$(realpath "$tree")/
33+
fi
34+
2835
# Detect if ALLSOURCE_ARCHS is set. If not, we assume SRCARCH
2936
if [ "${ALLSOURCE_ARCHS}" = "" ]; then
3037
ALLSOURCE_ARCHS=${SRCARCH}
@@ -124,7 +131,7 @@ docscope()
124131

125132
dogtags()
126133
{
127-
all_target_sources | gtags -i -f -
134+
all_target_sources | gtags -i -C "${tree:-.}" -f - "$PWD"
128135
}
129136

130137
# Basic regular expressions with an optional /kind-spec/ for ctags and

tools/perf/util/symbol.c

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,10 +1368,23 @@ static int dso__load_kcore(struct dso *dso, struct map *map,
13681368

13691369
/* Find the kernel map using the '_stext' symbol */
13701370
if (!kallsyms__get_function_start(kallsyms_filename, "_stext", &stext)) {
1371+
u64 replacement_size = 0;
1372+
13711373
list_for_each_entry(new_map, &md.maps, node) {
1372-
if (stext >= new_map->start && stext < new_map->end) {
1374+
u64 new_size = new_map->end - new_map->start;
1375+
1376+
if (!(stext >= new_map->start && stext < new_map->end))
1377+
continue;
1378+
1379+
/*
1380+
* On some architectures, ARM64 for example, the kernel
1381+
* text can get allocated inside of the vmalloc segment.
1382+
* Select the smallest matching segment, in case stext
1383+
* falls within more than one in the list.
1384+
*/
1385+
if (!replacement_map || new_size < replacement_size) {
13731386
replacement_map = new_map;
1374-
break;
1387+
replacement_size = new_size;
13751388
}
13761389
}
13771390
}

0 commit comments

Comments
 (0)