Skip to content

Commit 08731a1

Browse files
author
Treehugger Robot
committed
Merge "Merge 5.10.208 into android12-5.10-lts" into android12-5.10-lts
2 parents 274aa12 + 680475a commit 08731a1

File tree

43 files changed

+419
-225
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+419
-225
lines changed

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 = 5
33
PATCHLEVEL = 10
4-
SUBLEVEL = 207
4+
SUBLEVEL = 208
55
EXTRAVERSION =
66
NAME = Dare mighty things
77

arch/arm/mach-sunxi/mc_smp.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -808,12 +808,12 @@ static int __init sunxi_mc_smp_init(void)
808808
break;
809809
}
810810

811-
is_a83t = sunxi_mc_smp_data[i].is_a83t;
812-
813811
of_node_put(node);
814812
if (ret)
815813
return -ENODEV;
816814

815+
is_a83t = sunxi_mc_smp_data[i].is_a83t;
816+
817817
if (!sunxi_mc_smp_cpu_table_init())
818818
return -EINVAL;
819819

arch/powerpc/kernel/ppc_save_regs.S

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -58,10 +58,10 @@ _GLOBAL(ppc_save_regs)
5858
lbz r0,PACAIRQSOFTMASK(r13)
5959
PPC_STL r0,SOFTE-STACK_FRAME_OVERHEAD(r3)
6060
#endif
61-
/* go up one stack frame for SP */
62-
PPC_LL r4,0(r1)
63-
PPC_STL r4,1*SZL(r3)
61+
/* store current SP */
62+
PPC_STL r1,1*SZL(r3)
6463
/* get caller's LR */
64+
PPC_LL r4,0(r1)
6565
PPC_LL r0,LRSAVE(r4)
6666
PPC_STL r0,_LINK-STACK_FRAME_OVERHEAD(r3)
6767
mflr r0

arch/x86/kernel/kprobes/core.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,8 @@ static void kprobe_emulate_call_indirect(struct kprobe *p, struct pt_regs *regs)
569569
{
570570
unsigned long offs = addrmode_regoffs[p->ainsn.indirect.reg];
571571

572-
int3_emulate_call(regs, regs_get_register(regs, offs));
572+
int3_emulate_push(regs, regs->ip - INT3_INSN_SIZE + p->ainsn.size);
573+
int3_emulate_jmp(regs, regs_get_register(regs, offs));
573574
}
574575
NOKPROBE_SYMBOL(kprobe_emulate_call_indirect);
575576

drivers/firewire/ohci.c

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,51 @@ static char ohci_driver_name[] = KBUILD_MODNAME;
279279
#define QUIRK_TI_SLLZ059 0x20
280280
#define QUIRK_IR_WAKE 0x40
281281

282+
// On PCI Express Root Complex in any type of AMD Ryzen machine, VIA VT6306/6307/6308 with Asmedia
283+
// ASM1083/1085 brings an inconvenience that the read accesses to 'Isochronous Cycle Timer' register
284+
// (at offset 0xf0 in PCI I/O space) often causes unexpected system reboot. The mechanism is not
285+
// clear, since the read access to the other registers is enough safe; e.g. 'Node ID' register,
286+
// while it is probable due to detection of any type of PCIe error.
287+
#define QUIRK_REBOOT_BY_CYCLE_TIMER_READ 0x80000000
288+
289+
#if IS_ENABLED(CONFIG_X86)
290+
291+
static bool has_reboot_by_cycle_timer_read_quirk(const struct fw_ohci *ohci)
292+
{
293+
return !!(ohci->quirks & QUIRK_REBOOT_BY_CYCLE_TIMER_READ);
294+
}
295+
296+
#define PCI_DEVICE_ID_ASMEDIA_ASM108X 0x1080
297+
298+
static bool detect_vt630x_with_asm1083_on_amd_ryzen_machine(const struct pci_dev *pdev)
299+
{
300+
const struct pci_dev *pcie_to_pci_bridge;
301+
302+
// Detect any type of AMD Ryzen machine.
303+
if (!static_cpu_has(X86_FEATURE_ZEN))
304+
return false;
305+
306+
// Detect VIA VT6306/6307/6308.
307+
if (pdev->vendor != PCI_VENDOR_ID_VIA)
308+
return false;
309+
if (pdev->device != PCI_DEVICE_ID_VIA_VT630X)
310+
return false;
311+
312+
// Detect Asmedia ASM1083/1085.
313+
pcie_to_pci_bridge = pdev->bus->self;
314+
if (pcie_to_pci_bridge->vendor != PCI_VENDOR_ID_ASMEDIA)
315+
return false;
316+
if (pcie_to_pci_bridge->device != PCI_DEVICE_ID_ASMEDIA_ASM108X)
317+
return false;
318+
319+
return true;
320+
}
321+
322+
#else
323+
#define has_reboot_by_cycle_timer_read_quirk(ohci) false
324+
#define detect_vt630x_with_asm1083_on_amd_ryzen_machine(pdev) false
325+
#endif
326+
282327
/* In case of multiple matches in ohci_quirks[], only the first one is used. */
283328
static const struct {
284329
unsigned short vendor, device, revision, flags;
@@ -1713,6 +1758,9 @@ static u32 get_cycle_time(struct fw_ohci *ohci)
17131758
s32 diff01, diff12;
17141759
int i;
17151760

1761+
if (has_reboot_by_cycle_timer_read_quirk(ohci))
1762+
return 0;
1763+
17161764
c2 = reg_read(ohci, OHCI1394_IsochronousCycleTimer);
17171765

17181766
if (ohci->quirks & QUIRK_CYCLE_TIMER) {
@@ -3615,6 +3663,9 @@ static int pci_probe(struct pci_dev *dev,
36153663
if (param_quirks)
36163664
ohci->quirks = param_quirks;
36173665

3666+
if (detect_vt630x_with_asm1083_on_amd_ryzen_machine(dev))
3667+
ohci->quirks |= QUIRK_REBOOT_BY_CYCLE_TIMER_READ;
3668+
36183669
/*
36193670
* Because dma_alloc_coherent() allocates at least one page,
36203671
* we save space by using a common buffer for the AR request/

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5584,7 +5584,7 @@ void intel_dp_process_phy_request(struct intel_dp *intel_dp)
55845584
intel_dp_autotest_phy_ddi_enable(intel_dp, data->num_lanes);
55855585

55865586
drm_dp_set_phy_test_pattern(&intel_dp->aux, data,
5587-
link_status[DP_DPCD_REV]);
5587+
intel_dp->dpcd[DP_DPCD_REV]);
55885588
}
55895589

55905590
static u8 intel_dp_autotest_phy_pattern(struct intel_dp *intel_dp)

drivers/gpu/drm/qxl/qxl_drv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ int qxl_gem_object_create_with_handle(struct qxl_device *qdev,
329329
u32 domain,
330330
size_t size,
331331
struct qxl_surface *surf,
332-
struct qxl_bo **qobj,
332+
struct drm_gem_object **gobj,
333333
uint32_t *handle);
334334
void qxl_gem_object_free(struct drm_gem_object *gobj);
335335
int qxl_gem_object_open(struct drm_gem_object *obj, struct drm_file *file_priv);

drivers/gpu/drm/qxl/qxl_dumb.c

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ int qxl_mode_dumb_create(struct drm_file *file_priv,
3434
{
3535
struct qxl_device *qdev = to_qxl(dev);
3636
struct qxl_bo *qobj;
37+
struct drm_gem_object *gobj;
3738
uint32_t handle;
3839
int r;
3940
struct qxl_surface surf;
@@ -62,11 +63,13 @@ int qxl_mode_dumb_create(struct drm_file *file_priv,
6263

6364
r = qxl_gem_object_create_with_handle(qdev, file_priv,
6465
QXL_GEM_DOMAIN_SURFACE,
65-
args->size, &surf, &qobj,
66+
args->size, &surf, &gobj,
6667
&handle);
6768
if (r)
6869
return r;
70+
qobj = gem_to_qxl_bo(gobj);
6971
qobj->is_dumb = true;
72+
drm_gem_object_put(gobj);
7073
args->pitch = pitch;
7174
args->handle = handle;
7275
return 0;

drivers/gpu/drm/qxl/qxl_gem.c

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -72,32 +72,41 @@ int qxl_gem_object_create(struct qxl_device *qdev, int size,
7272
return 0;
7373
}
7474

75+
/*
76+
* If the caller passed a valid gobj pointer, it is responsible to call
77+
* drm_gem_object_put() when it no longer needs to acess the object.
78+
*
79+
* If gobj is NULL, it is handled internally.
80+
*/
7581
int qxl_gem_object_create_with_handle(struct qxl_device *qdev,
7682
struct drm_file *file_priv,
7783
u32 domain,
7884
size_t size,
7985
struct qxl_surface *surf,
80-
struct qxl_bo **qobj,
86+
struct drm_gem_object **gobj,
8187
uint32_t *handle)
8288
{
83-
struct drm_gem_object *gobj;
8489
int r;
90+
struct drm_gem_object *local_gobj;
8591

86-
BUG_ON(!qobj);
8792
BUG_ON(!handle);
8893

8994
r = qxl_gem_object_create(qdev, size, 0,
9095
domain,
9196
false, false, surf,
92-
&gobj);
97+
&local_gobj);
9398
if (r)
9499
return -ENOMEM;
95-
r = drm_gem_handle_create(file_priv, gobj, handle);
100+
r = drm_gem_handle_create(file_priv, local_gobj, handle);
96101
if (r)
97102
return r;
98-
/* drop reference from allocate - handle holds it now */
99-
*qobj = gem_to_qxl_bo(gobj);
100-
drm_gem_object_put(gobj);
103+
104+
if (gobj)
105+
*gobj = local_gobj;
106+
else
107+
/* drop reference from allocate - handle holds it now */
108+
drm_gem_object_put(local_gobj);
109+
101110
return 0;
102111
}
103112

drivers/gpu/drm/qxl/qxl_ioctl.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,6 @@ static int qxl_alloc_ioctl(struct drm_device *dev, void *data,
3939
struct qxl_device *qdev = to_qxl(dev);
4040
struct drm_qxl_alloc *qxl_alloc = data;
4141
int ret;
42-
struct qxl_bo *qobj;
4342
uint32_t handle;
4443
u32 domain = QXL_GEM_DOMAIN_VRAM;
4544

@@ -51,7 +50,7 @@ static int qxl_alloc_ioctl(struct drm_device *dev, void *data,
5150
domain,
5251
qxl_alloc->size,
5352
NULL,
54-
&qobj, &handle);
53+
NULL, &handle);
5554
if (ret) {
5655
DRM_ERROR("%s: failed to create gem ret=%d\n",
5756
__func__, ret);
@@ -393,7 +392,6 @@ static int qxl_alloc_surf_ioctl(struct drm_device *dev, void *data,
393392
{
394393
struct qxl_device *qdev = to_qxl(dev);
395394
struct drm_qxl_alloc_surf *param = data;
396-
struct qxl_bo *qobj;
397395
int handle;
398396
int ret;
399397
int size, actual_stride;
@@ -413,7 +411,7 @@ static int qxl_alloc_surf_ioctl(struct drm_device *dev, void *data,
413411
QXL_GEM_DOMAIN_SURFACE,
414412
size,
415413
&surf,
416-
&qobj, &handle);
414+
NULL, &handle);
417415
if (ret) {
418416
DRM_ERROR("%s: failed to create gem ret=%d\n",
419417
__func__, ret);

0 commit comments

Comments
 (0)