6.7.3-rc1 review
Subsystems (6)
Greg Kroah-Hartman
maintainerPATCH 238/346 platform/x86: p2sb: Allow p2sb_bar() calls during PCI device probe
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shin'ichiro Kawasaki <[email protected]>
commit 5913320eb0b3ec88158cfcb0fa5e996bf4ef681b upstream.
p2sb_bar() unhides P2SB device to get resources from the device. It guards the operation by locking pci_rescan_remove_lock so that parallel rescans do not find the P2SB device. However, this lock causes deadlock when PCI bus rescan is triggered by /sys/bus/pci/rescan. The rescan locks pci_rescan_remove_lock and probes PCI devices. When PCI devices call p2sb_bar() during probe, it locks pci_rescan_remove_lock again. Hence the deadlock.
To avoid the deadlock, do not lock pci_rescan_remove_lock in p2sb_bar(). Instead, do the lock at fs_initcall. Introduce p2sb_cache_resources() for fs_initcall which gets and caches the P2SB resources. At p2sb_bar(), refer the cache and return to the caller.
Before operating the device at P2SB DEVFN for resource cache, check that its device class is PCI_CLASS_MEMORY_OTHER 0x0580 that PCH specifications define. This avoids unexpected operation to other devices at the same DEVFN.
Tested-by Klara Modin <[email protected]>
--- drivers/platform/x86/p2sb.c | 180 +++++++++++++++++++++++++++++++++----------- 1 file changed, 139 insertions(+), 41 deletions(-)
drivers/platform/x86/p2sb.c +139 -41
@@ -26,6 +26,21 @@ static const struct x86_cpu_id p2sb_cpu_ {} }; +/* +* Cache BAR0 of P2SB device functions 0 to 7. +* TODO: The constant 8 is the number of functions that PCI specification +* defines. Same definitions exist tree-wide. Unify this definition and +* the other definitions then move to include/uapi/linux/pci.h. +*/ +#define NR_P2SB_RES_CACHE 8 + +struct p2sb_res_cache { +u32 bus_dev_id; +struct resource res; +}; + +static struct p2sb_res_cache p2sb_resources[NR_P2SB_RES_CACHE ]; +static int p2sb_get_devfn (unsigned int *devfn) {unsigned int fn =P2SB_DEVFN_DEFAULT ;
@@ -39,8 +54,16 @@ static int p2sb_get_devfn(unsigned int *return 0 ; } +static bool p2sb_valid_resource (struct resource *res) +{ +if (res->flags) +return true; + +return false; +} +/* Copy resource from the first BAR of the device in question */ -static int p2sb_read_bar0 (struct pci_dev *pdev,struct resource *mem) +static void p2sb_read_bar0 (struct pci_dev *pdev,struct resource *mem) {struct resource *bar0 = &pdev->resource[0 ];
@@ -56,49 +79,66 @@ static int p2sb_read_bar0(struct pci_dev mem->end = bar0->end; mem->flags = bar0->flags; mem->desc = bar0->desc; - -return 0 ; } -static int p2sb_scan_and_read (struct pci_bus *bus,unsigned int devfn,struct resource *mem) +static void p2sb_scan_and_cache_devfn (struct pci_bus *bus,unsigned int devfn) { +struct p2sb_res_cache *cache = &p2sb_resources[PCI_FUNC (devfn)];struct pci_dev *pdev; -int ret; pdev =pci_scan_single_device (bus, devfn);if (!pdev) -return -ENODEV ; +return ; - ret =p2sb_read_bar0 (pdev, mem); +p2sb_read_bar0 (pdev, &cache->res); + cache->bus_dev_id = bus->dev.id;pci_stop_and_remove_bus_device (pdev); -return ret; } -/** -* p2sb_bar - Get Primary to Sideband (P2SB) bridge device BAR -* @bus: PCI bus to communicate with -* @devfn: PCI slot and function to communicate with -* @mem: memory resource to be filled in -* -* The BIOS prevents the P2SB device from being enumerated by the PCI -* subsystem, so we need to unhide and hide it back to lookup the BAR. -* -* if @bus is NULL, the bus 0 in domain 0 will be used. -* If @devfn is 0, it will be replaced by devfn of the P2SB device. -* -* Caller must provide a valid pointer to @mem. -* -* Locking is handled by pci_rescan_remove_lock mutex. -* -* Return: -* 0 on success or appropriate errno value on error. -*/ -int p2sb_bar (struct pci_bus *bus,unsigned int devfn,struct resource *mem) +static int p2sb_scan_and_cache (struct pci_bus *bus,unsigned int devfn) +{ +unsigned int slot, fn; + +if (PCI_FUNC (devfn) ==0 ) { +/* +* When function number of the P2SB device is zero, scan it and +* other function numbers, and if devices are available, cache +* their BAR0s. +*/ + slot =PCI_SLOT (devfn); +for (fn =0 ; fn <NR_P2SB_RES_CACHE ; fn++) +p2sb_scan_and_cache_devfn (bus,PCI_DEVFN (slot, fn)); + }else { +/* Scan the P2SB device and cache its BAR0 */ +p2sb_scan_and_cache_devfn (bus, devfn); + } + +if (!p2sb_valid_resource (&p2sb_resources[PCI_FUNC (devfn)].res)) +return -ENOENT ; + +return 0 ; +} + +static struct pci_bus *p2sb_get_bus (struct pci_bus *bus) +{ +static struct pci_bus *p2sb_bus; + + bus = bus ?: p2sb_bus; +if (bus) +return bus; + +/* Assume P2SB is on the bus 0 in domain 0 */ + p2sb_bus =pci_find_bus (0 ,0 ); +return p2sb_bus; +} + +static int p2sb_cache_resources (void ) { -struct pci_dev *pdev_p2sb;unsigned int devfn_p2sb;u32 value =P2SBC_HIDE ; +struct pci_bus *bus; +u16 class;int ret;/* Get devfn for P2SB device itself */
@@ -106,8 +146,17 @@ int p2sb_bar(struct pci_bus *bus, unsignif (ret)return ret; -/* if @bus is NULL, use bus 0 in domain 0 */ - bus = bus ?:pci_find_bus (0 ,0 ); + bus =p2sb_get_bus (NULL ); +if (!bus) +return -ENODEV ; + +/* +* When a device with same devfn exists and its device class is not +* PCI_CLASS_MEMORY_OTHER for P2SB, do not touch it. +*/ +pci_bus_read_config_word (bus, devfn_p2sb,PCI_CLASS_DEVICE , &class); +if (!PCI_POSSIBLE_ERROR (class) && class !=PCI_CLASS_MEMORY_OTHER ) +return -ENODEV ;/* * Prevent concurrent PCI bus scan from seeing the P2SB device and
@@ -115,17 +164,16 @@ int p2sb_bar(struct pci_bus *bus, unsign*/ pci_lock_rescan_remove (); -/* Unhide the P2SB device, if needed */ +/* +* The BIOS prevents the P2SB device from being enumerated by the PCI +* subsystem, so we need to unhide and hide it back to lookup the BAR. +* Unhide the P2SB device here, if needed. +*/ pci_bus_read_config_dword (bus, devfn_p2sb,P2SBC , &value);if (value &P2SBC_HIDE )pci_bus_write_config_dword (bus, devfn_p2sb,P2SBC ,0 ); - pdev_p2sb =pci_scan_single_device (bus, devfn_p2sb); -if (devfn) - ret =p2sb_scan_and_read (bus, devfn, mem); -else - ret =p2sb_read_bar0 (pdev_p2sb, mem); -pci_stop_and_remove_bus_device (pdev_p2sb); + ret =p2sb_scan_and_cache (bus, devfn_p2sb);/* Hide the P2SB device, if it was hidden */ if (value &P2SBC_HIDE )
@@ -133,12 +181,62 @@ int p2sb_bar(struct pci_bus *bus, unsignpci_unlock_rescan_remove (); -if (ret) -return ret; +return ret; +} -if (mem->flags ==0 ) +/** +* p2sb_bar - Get Primary to Sideband (P2SB) bridge device BAR +* @bus: PCI bus to communicate with +* @devfn: PCI slot and function to communicate with +* @mem: memory resource to be filled in +* +* If @bus is NULL, the bus 0 in domain 0 will be used. +* If @devfn is 0, it will be replaced by devfn of the P2SB device. +* +* Caller must provide a valid pointer to @mem. +* +* Return: +* 0 on success or appropriate errno value on error. +*/ +int p2sb_bar (struct pci_bus *bus,unsigned int devfn,struct resource *mem) +{ +struct p2sb_res_cache *cache; +int ret; + + bus =p2sb_get_bus (bus); +if (!bus)return -ENODEV ; +if (!devfn) { + ret =p2sb_get_devfn (&devfn); +if (ret) +return ret; + } + + cache = &p2sb_resources[PCI_FUNC (devfn)]; +if (cache->bus_dev_id != bus->dev.id) +return -ENODEV ; + +if (!p2sb_valid_resource (&cache->res)) +return -ENOENT ; + +memcpy (mem, &cache->res,sizeof (*mem));return 0 ; }EXPORT_SYMBOL_GPL (p2sb_bar); + +static int __init p2sb_fs_init (void ) +{ +p2sb_cache_resources (); +return 0 ; +} + +/* +* pci_rescan_remove_lock to avoid access to unhidden P2SB devices can +* not be locked in sysfs pci bus rescan path because of deadlock. To +* avoid the deadlock, access to P2SB devices with the lock at an early +* step in kernel initialization and cache required resources. This +* should happen after subsys_initcall which initializes PCI subsystem +* and before device_initcall which requires P2SB resources. +*/ +fs_initcall (p2sb_fs_init);
Greg Kroah-Hartman
maintainerPATCH 239/346 ksmbd: fix global oob in ksmbd_nl_policy
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lin Ma <[email protected]>
commit ebeae8adf89d9a82359f6659b1663d09beec2faa upstream.
Similar to a reported issue (check the commit b33fb5b801c6 ("net:
qualcomm: rmnet: fix global oob in rmnet_policy"), my local fuzzer finds another global out-of-bounds read for policy ksmbd_nl_policy. See bug trace below:
==================================================================
BUG: KASAN: global-out-of-bounds in validate_nla lib/nlattr.c:386 [inline]
BUG: KASAN: global-out-of-bounds in __nla_validate_parse+0x24af/0x2750 lib/nlattr.c:600
Read of size 1 at addr ffffffff8f24b100 by task syz-executor.1/62810
CPU: 0 PID: 62810 Comm: syz-executor.1 Tainted: G N 6.1.0 #3
Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.13.0-1ubuntu1.1 04/01/2014
Call Trace:
<TASK>
__dump_stack lib/dump_stack.c:88 [inline]
dump_stack_lvl+0x8b/0xb3 lib/dump_stack.c:106
print_address_description mm/kasan/report.c:284 [inline]
print_report+0x172/0x475 mm/kasan/report.c:395
kasan_report+0xbb/0x1c0 mm/kasan/report.c:495
validate_nla lib/nlattr.c:386 [inline]
__nla_validate_parse+0x24af/0x2750 lib/nlattr.c:600
__nla_parse+0x3e/0x50 lib/nlattr.c:697
__nlmsg_parse include/net/netlink.h:748 [inline]
genl_family_rcv_msg_attrs_parse.constprop.0+0x1b0/0x290 net/netlink/genetlink.c:565
genl_family_rcv_msg_doit+0xda/0x330 net/netlink/genetlink.c:734
genl_family_rcv_msg net/netlink/genetlink.c:833 [inline]
genl_rcv_msg+0x441/0x780 net/netlink/genetlink.c:850
netlink_rcv_skb+0x14f/0x410 net/netlink/af_netlink.c:2540
genl_rcv+0x24/0x40 net/netlink/genetlink.c:861
netlink_unicast_kernel net/netlink/af_netlink.c:1319 [inline]
netlink_unicast+0x54e/0x800 net/netlink/af_netlink.c:1345
netlink_sendmsg+0x930/0xe50 net/netlink/af_netlink.c:1921
sock_sendmsg_nosec net/socket.c:714 [inline]
sock_sendmsg+0x154/0x190 net/socket.c:734
____sys_sendmsg+0x6df/0x840 net/socket.c:2482
___sys_sendmsg+0x110/0x1b0 net/socket.c:2536
__sys_sendmsg+0xf3/0x1c0 net/socket.c:2565
do_syscall_x64 arch/x86/entry/common.c:50 [inline]
do_syscall_64+0x3b/0x90 arch/x86/entry/common.c:80
entry_SYSCALL_64_after_hwframe+0x63/0xcd
RIP: 0033:0x7fdd66a8f359
Code: 28 00 00 00 75 05 48 83 c4 28 c3 e8 f1 19 00 00 90 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 c7 c1 b8 ff ff ff f7 d8 64 89 01 48
RSP: 002b:00007fdd65e00168 EFLAGS: 00000246 ORIG_RAX: 000000000000002e
RAX: ffffffffffffffda RBX: 00007fdd66bbcf80 RCX: 00007fdd66a8f359
RDX: 0000000000000000 RSI: 0000000020000500 RDI: 0000000000000003
RBP: 00007fdd66ada493 R08: 0000000000000000 R09: 0000000000000000
R10: 0000000000000000 R11: 0000000000000246 R12: 0000000000000000
R13: 00007ffc84b81aff R14: 00007fdd65e00300 R15: 0000000000022000
</TASK>
The buggy address belongs to the variable:
ksmbd_nl_policy+0x100/0xa80
The buggy address belongs to the physical page:
page:0000000034f47940 refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x1ccc4b
flags: 0x200000000001000(reserved|node=0|zone=2)
raw: 0200000000001000 ffffea00073312c8 ffffea00073312c8 0000000000000000
raw: 0000000000000000 0000000000000000 00000001ffffffff 0000000000000000
page dumped because: kasan: bad access detected
Memory state around the buggy address:
ffffffff8f24b000: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
ffffffff8f24b080: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
>ffffffff8f24b100: f9 f9 f9 f9 00 00 f9 f9 f9 f9 f9 f9 00 00 07 f9
^
ffffffff8f24b180: f9 f9 f9 f9 00 05 f9 f9 f9 f9 f9 f9 00 00 00 05
ffffffff8f24b200: f9 f9 f9 f9 00 00 03 f9 f9 f9 f9 f9 00 00 04 f9
==================================================================To fix it, add a placeholder named __KSMBD_EVENT_MAX and let KSMBD_EVENT_MAX to be its original value - 1 according to what other netlink families do. Also change two sites that refer the KSMBD_EVENT_MAX to correct value.
--- fs/smb/server/ksmbd_netlink.h | 3 ++- fs/smb/server/transport_ipc.c | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-)
fs/smb/server/ksmbd_netlink.h +2 -1
@@ -304,7 +304,8 @@ enum ksmbd_event {KSMBD_EVENT_SPNEGO_AUTHEN_REQUEST ,KSMBD_EVENT_SPNEGO_AUTHEN_RESPONSE =15 , - KSMBD_EVENT_MAX + __KSMBD_EVENT_MAX, + KSMBD_EVENT_MAX = __KSMBD_EVENT_MAX - 1 };/*
fs/smb/server/transport_ipc.c +2 -2
@@ -74,7 +74,7 @@ static int handle_unsupported_event(strustatic int handle_generic_event (struct sk_buff *skb,struct genl_info *info);static int ksmbd_ipc_heartbeat_request (void ); -static const struct nla_policy ksmbd_nl_policy[KSMBD_EVENT_MAX ] = { +static const struct nla_policy ksmbd_nl_policy[KSMBD_EVENT_MAX +1 ] = { [KSMBD_EVENT_UNSPEC ] = { .len =0 , },
@@ -403,7 +403,7 @@ static int handle_generic_event(struct sreturn -EPERM ;#endif -if (type >=KSMBD_EVENT_MAX ) { +if (type >KSMBD_EVENT_MAX ) {WARN_ON (1 );return -EINVAL ; }
Greg Kroah-Hartman
maintainerPATCH 240/346 firmware: arm_scmi: Check mailbox/SMT channel for consistency
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Marussi <[email protected]>
commit 437a310b22244d4e0b78665c3042e5d1c0f45306 upstream.
On reception of a completion interrupt the shared memory area is accessed to retrieve the message header at first and then, if the message sequence number identifies a transaction which is still pending, the related payload is fetched too.
When an SCMI command times out the channel ownership remains with the platform until eventually a late reply is received and, as a consequence, any further transmission attempt remains pending, waiting for the channel to be relinquished by the platform.
Once that late reply is received the channel ownership is given back to the agent and any pending request is then allowed to proceed and overwrite the SMT area of the just delivered late reply; then the wait for the reply to the new request starts.
It has been observed that the spurious IRQ related to the late reply can be wrongly associated with the freshly enqueued request: when that happens the SCMI stack in-flight lookup procedure is fooled by the fact that the message header now present in the SMT area is related to the new pending transaction, even though the real reply has still to arrive.
This race-condition on the A2P channel can be detected by looking at the channel status bits: a genuine reply from the platform will have set the channel free bit before triggering the completion IRQ.
Add a consistency check to validate such condition in the A2P ISR.
--- drivers/firmware/arm_scmi/common.h | 1 + drivers/firmware/arm_scmi/mailbox.c | 14 ++++++++++++++ drivers/firmware/arm_scmi/shmem.c | 6 ++++++ 3 files changed, 21 insertions(+)
drivers/firmware/arm_scmi/common.h +1 -0
@@ -314,6 +314,7 @@ void shmem_fetch_notification(struct scmvoid shmem_clear_channel (struct scmi_shared_mem __iomem *shmem);bool shmem_poll_done (struct scmi_shared_mem __iomem *shmem,struct scmi_xfer *xfer); +bool shmem_channel_free (struct scmi_shared_mem __iomem *shmem);/* declarations for message passing transports */ struct scmi_msg_payld ;
drivers/firmware/arm_scmi/mailbox.c +14 -0
@@ -45,6 +45,20 @@ static void rx_callback(struct mbox_clie {struct scmi_mailbox *smbox =client_to_scmi_mailbox (cl); +/* +* An A2P IRQ is NOT valid when received while the platform still has +* the ownership of the channel, because the platform at first releases +* the SMT channel and then sends the completion interrupt. +* +* This addresses a possible race condition in which a spurious IRQ from +* a previous timed-out reply which arrived late could be wrongly +* associated with the next pending transaction. +*/ +if (cl->knows_txdone && !shmem_channel_free (smbox->shmem)) { +dev_warn (smbox->cinfo->dev,"Ignoring spurious A2P IRQ !\n" ); +return ; + } +scmi_rx_callback (smbox->cinfo,shmem_read_header (smbox->shmem),NULL ); }
drivers/firmware/arm_scmi/shmem.c +6 -0
@@ -122,3 +122,9 @@ bool shmem_poll_done(struct scmi_shared_ (SCMI_SHMEM_CHAN_STAT_CHANNEL_ERROR |SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE ); } + +bool shmem_channel_free (struct scmi_shared_mem __iomem *shmem) +{ +return (ioread32 (&shmem->channel_status) & +SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE ); +}
Greg Kroah-Hartman
maintainerPATCH 241/346 Revert "drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync"
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
commit d1b163aa0749706379055e40a52cf7a851abf9dc upstream.
This reverts commit 60aebc9559492cea6a9625f514a8041717e3a2e4.
Commit 60aebc9559492cea ("drivers/firmware: Move sysfb_init() from device_initcall to subsys_initcall_sync") messes up initialization order of the graphics drivers and leads to blank displays on some systems. So revert the commit.
To make the display drivers fully independent from initialization order requires to track framebuffer memory by device and independently from the loaded drivers. The kernel currently lacks the infrastructure to do so.
--- drivers/firmware/sysfb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/firmware/sysfb.c +1 -1
@@ -128,4 +128,4 @@ unlock_mutex: }/* must execute after PCI subsystem for EFI quirks */ -subsys_initcall_sync (sysfb_init); +device_initcall (sysfb_init);
Greg Kroah-Hartman
maintainerPATCH 242/346 drm/amdgpu: Fix the null pointer when load rlc firmware
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ma Jun <[email protected]>
commit bc03c02cc1991a066b23e69bbcc0f66e8f1f7453 upstream.
If the RLC firmware is invalid because of wrong header size, the pointer to the rlc firmware is released in function amdgpu_ucode_request. There will be a null pointer error in subsequent use. So skip validation to fix it.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +6 -9
@@ -3996,16 +3996,13 @@ static int gfx_v10_0_init_microcode(struif (!amdgpu_sriov_vf (adev)) {snprintf (fw_name,sizeof (fw_name),"amdgpu/%s_rlc.bin" , ucode_prefix); - err =amdgpu_ucode_request (adev, &adev->gfx.rlc_fw, fw_name); -/* don't check this. There are apparently firmwares in the wild with -* incorrect size in the header -*/ -if (err == -ENODEV ) - goto out; + err =request_firmware (&adev->gfx.rlc_fw, fw_name, adev->dev);if (err) -dev_dbg (adev->dev, -"gfx10: amdgpu_ucode_request() failed \"%s\"\n" , - fw_name); + goto out; + +/* don't validate this firmware. There are apparently firmwares +* in the wild with incorrect size in the header +*/ rlc_hdr = (const struct rlc_firmware_header_v2_0 *)adev->gfx.rlc_fw->data; version_major =le16_to_cpu (rlc_hdr->header.header_version_major); version_minor =le16_to_cpu (rlc_hdr->header.header_version_minor);
Greg Kroah-Hartman
maintainerPATCH 243/346 xfs: read only mounts with fsopen mount API are busted
In reply to Greg Kroah-Hartman6.7-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
@@ -1510,6 +1510,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)return error;
@@ -1979,6 +1991,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) {
@@ -2010,16 +2027,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 244/346 gpiolib: acpi: Ignore touchpad wakeup on GPD G1619-04
In reply to Greg Kroah-Hartman6.7-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
@@ -1651,6 +1651,20 @@ static const struct dmi_system_id gpioli .ignore_interrupt = "INT33FC:00@3", }, }, + { + /* + * 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 245/346 cpufreq: intel_pstate: Refine computation of P-state for given frequency
In reply to Greg Kroah-Hartman6.7-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
@@ -526,6 +526,30 @@ static int intel_pstate_cppc_get_scaling }#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.
@@ -543,6 +567,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);
@@ -556,16 +581,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 )
@@ -2524,13 +2549,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",
@@ -2904,18 +2928,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;
@@ -2933,7 +2946,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 246/346 Revert "nouveau: push event block/allowing out of the fence context"
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dave Airlie <[email protected]>
commit 4d7acc8f48bcf27d0dc068f02e55c77e840b9110 upstream.
This reverts commit eacabb5462717a52fccbbbba458365a4f5e61f35.
This commit causes some regressions in desktop usage, this will reintroduce the original deadlock in DRI_PRIME situations, I've got an idea to fix it by offloading to a workqueue in a different spot, however this code has a race condition where we sometimes miss interrupts so I'd like to fix that as well.
--- drivers/gpu/drm/nouveau/nouveau_fence.c | 28 +++++----------------------- drivers/gpu/drm/nouveau/nouveau_fence.h | 5 +---- 2 files changed, 6 insertions(+), 27 deletions(-)
drivers/gpu/drm/nouveau/nouveau_fence.c +5 -23
@@ -62,7 +62,7 @@ nouveau_fence_signal(struct nouveau_fencif (test_bit (DMA_FENCE_FLAG_USER_BITS , &fence->base.flags)) {struct nouveau_fence_chan *fctx =nouveau_fctx (fence); -if (atomic_dec_and_test (&fctx->notify_ref)) +if (!--fctx->notify_ref) drop =1 ; }
@@ -103,7 +103,6 @@ nouveau_fence_context_kill(struct nouveavoid nouveau_fence_context_del (struct nouveau_fence_chan *fctx) { -cancel_work_sync (&fctx->allow_block_work);nouveau_fence_context_kill (fctx,0 );nvif_event_dtor (&fctx->event); fctx->dead =1 ;
@@ -168,18 +167,6 @@ nouveau_fence_wait_uevent_handler(structreturn ret; } -static void -nouveau_fence_work_allow_block (struct work_struct *work) -{ - struct nouveau_fence_chan *fctx = container_of(work, struct nouveau_fence_chan, - allow_block_work); - -if (atomic_read (&fctx->notify_ref) ==0 ) -nvif_event_block (&fctx->event); -else -nvif_event_allow (&fctx->event); -} -void nouveau_fence_context_new (struct nouveau_channel *chan,struct nouveau_fence_chan *fctx) {
@@ -191,7 +178,6 @@ nouveau_fence_context_new(struct nouveau } args;int ret; -INIT_WORK (&fctx->allow_block_work, nouveau_fence_work_allow_block);INIT_LIST_HEAD (&fctx->flip);INIT_LIST_HEAD (&fctx->pending);spin_lock_init (&fctx->lock);
@@ -535,19 +521,15 @@ static bool nouveau_fence_enable_signalistruct nouveau_fence *fence =from_fence (f);struct nouveau_fence_chan *fctx =nouveau_fctx (fence);bool ret; -bool do_work; -if (atomic_inc_return (&fctx->notify_ref) ==0 ) - do_work = true; +if (!fctx->notify_ref++) +nvif_event_allow (&fctx->event); ret =nouveau_fence_no_signaling (f);if (ret)set_bit (DMA_FENCE_FLAG_USER_BITS , &fence->base.flags); -else if (atomic_dec_and_test (&fctx->notify_ref)) - do_work = true; - -if (do_work) -schedule_work (&fctx->allow_block_work); +else if (!--fctx->notify_ref) +nvif_event_block (&fctx->event);return ret; }
drivers/gpu/drm/nouveau/nouveau_fence.h +1 -4
@@ -3,7 +3,6 @@#define __NOUVEAU_FENCE_H__#include <linux/dma-fence.h> -#include <linux/workqueue.h> #include <nvif/event.h> struct nouveau_drm ;
@@ -46,9 +45,7 @@ struct nouveau_fence_chan {char name[32 ];struct nvif_event event; -struct work_struct allow_block_work; -atomic_t notify_ref; -int dead, killed; +int notify_ref, dead, killed; };struct nouveau_fence_priv {
Greg Kroah-Hartman
maintainerPATCH 247/346 Revert "drm/i915/dsi: Do display on sequence later on icl+"
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit 6992eb815d087858f8d7e4020529c2fe800456b3 upstream.
This reverts commit 88b065943cb583e890324d618e8d4b23460d51a3.
Lenovo 82TQ is unhappy if we do the display on sequence this late. The display output shows severe corruption.
It's unclear if this is a failure on our part (perhaps something to do with sending commands in LP mode after HS /video mode transmission has been started? Though the backlight on command at least seems to work) or simply that there are some commands in the sequence that are needed to be done earlier (eg. could be some DSC init stuff?). If the latter then I don't think the current Windows code would work either, but maybe this was originally tested with an older driver, who knows.
Root causing this fully would likely require a lot of experimentation which isn't really feasible without direct access to the machine, so let's just accept failure and go back to the original sequence.
--- drivers/gpu/drm/i915/display/icl_dsi.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/gpu/drm/i915/display/icl_dsi.c +1 -2
@@ -1155,6 +1155,7 @@ static void gen11_dsi_powerup_panel(stru }intel_dsi_vbt_exec_sequence (intel_dsi,MIPI_SEQ_INIT_OTP ); +intel_dsi_vbt_exec_sequence (intel_dsi,MIPI_SEQ_DISPLAY_ON );/* ensure all panel commands dispatched before enabling transcoder */ wait_for_cmds_dispatched_to_panel (encoder);
@@ -1255,8 +1256,6 @@ static void gen11_dsi_enable(struct inte/* step6d: enable dsi transcoder */ gen11_dsi_enable_transcoder (encoder); -intel_dsi_vbt_exec_sequence (intel_dsi,MIPI_SEQ_DISPLAY_ON ); -/* step7: enable backlight */ intel_backlight_enable (crtc_state, conn_state);intel_dsi_vbt_exec_sequence (intel_dsi,MIPI_SEQ_BACKLIGHT_ON );
Greg Kroah-Hartman
maintainerPATCH 248/346 drm: Dont unref the same fb many times by mistake due to deadlock handling
In reply to Greg Kroah-Hartman6.7-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
@@ -1387,6 +1387,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 249/346 drm/i915/psr: Only allow PSR in LPSP mode on HSW non-ULT
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ville Syrjälä <[email protected]>
commit f9f031dd21a7ce13a13862fa5281d32e1029c70f upstream.
On HSW non-ULT (or at least on Dell Latitude E6540) external displays start to flicker when we enable PSR on the eDP. We observe a much higher SR and PC6 residency than should be possible with an external display, and indeen much higher than what we observe with eDP disabled and only the external display enabled. Looks like the hardware is somehow ignoring the fact that the external display is active during PSR.
I wasn't able to redproduce this on my HSW ULT machine, or BDW. So either there's something specific about this particular laptop (eg. some unknown firmware thing) or the issue is limited to just non-ULT HSW systems. All known registers that could affect this look perfectly reasonable on the affected machine.
As a workaround let's unmask the LPSP event to prevent PSR entry except while in LPSP mode (only pipe A + eDP active). This will prevent PSR entry entirely when multiple pipes are active. The one slight downside is that we now also prevent PSR entry when driving eDP with pipe B or C, but I think that's a reasonable tradeoff to avoid having to implement a more complex workaround.
--- drivers/gpu/drm/i915/display/intel_psr.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/display/intel_psr.c +12 -2
@@ -1401,8 +1401,18 @@ static void intel_psr_enable_source(stru* can rely on frontbuffer tracking. */ mask =EDP_PSR_DEBUG_MASK_MEMUP | -EDP_PSR_DEBUG_MASK_HPD | -EDP_PSR_DEBUG_MASK_LPSP ; +EDP_PSR_DEBUG_MASK_HPD ; + +/* +* For some unknown reason on HSW non-ULT (or at least on +* Dell Latitude E6540) external displays start to flicker +* when PSR is enabled on the eDP. SR/PC6 residency is much +* higher than should be possible with an external display. +* As a workaround leave LPSP unmasked to prevent PSR entry +* when external displays are active. +*/ +if (DISPLAY_VER (dev_priv) >=8 ||IS_HASWELL_ULT (dev_priv)) + mask |=EDP_PSR_DEBUG_MASK_LPSP ;if (DISPLAY_VER (dev_priv) <20 ) mask |=EDP_PSR_DEBUG_MASK_MAX_SLEEP ;
Greg Kroah-Hartman
maintainerPATCH 250/346 drm/bridge: nxp-ptn3460: fix i2c_master_send() error checking
In reply to Greg Kroah-Hartman6.7-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 251/346 drm: Fix TODO list mentioning non-KMS drivers
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Thomas Zimmermann <[email protected]>
commit 9cf5ca1f485cae406968947a92bf304603999fa1 upstream.
Non-KMS drivers have been removed from DRM. Update the TODO list accordingly.
--- Documentation/gpu/todo.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
Documentation/gpu/todo.rst +3 -4
@@ -337,8 +337,8 @@ connector register/unregister fixes Level: Intermediate -Remove load/unload callbacks from all non-DRIVER_LEGACY drivers ---------------------------------------------------------------- +Remove load/unload callbacks +---------------------------- The load/unload callbacks in struct &drm_driver are very much midlayers, plus for historical reasons they get the ordering wrong (and we can't fix that)
@@ -347,8 +347,7 @@ between setting up the &drm_driver struc - Rework drivers to no longer use the load/unload callbacks, directly coding the load/unload sequence into the driver's probe function. -- Once all non-DRIVER_LEGACY drivers are converted, disallow the load/unload - callbacks for all modern drivers. +- Once all drivers are converted, remove the load/unload callbacks. Contact: Daniel Vetter
Greg Kroah-Hartman
maintainerPATCH 252/346 drm/tidss: Fix atomic_flush check
In reply to Greg Kroah-Hartman6.7-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
@@ -169,13 +169,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 253/346 drm: Disable the cursor plane on atomic contexts with virtualized drivers
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Zack Rusin <[email protected]>
commit 4e3b70da64a53784683cfcbac2deda5d6e540407 upstream.
Cursor planes on virtualized drivers have special meaning and require that the clients handle them in specific ways, e.g. the cursor plane should react to the mouse movement the way a mouse cursor would be expected to and the client is required to set hotspot properties on it in order for the mouse events to be routed correctly.
This breaks the contract as specified by the "universal planes". Fix it by disabling the cursor planes on virtualized drivers while adding a foundation on top of which it's possible to special case mouse cursor planes for clients that want it.
Disabling the cursor planes makes some kms compositors which were broken, e.g. Weston, fallback to software cursor which works fine or at least better than currently while having no effect on others, e.g. gnome-shell or kwin, which put virtualized drivers on a deny-list when running in atomic context to make them fallback to legacy kms and avoid this issue.
--- drivers/gpu/drm/drm_plane.c | 13 +++++++++++++ drivers/gpu/drm/qxl/qxl_drv.c | 2 +- drivers/gpu/drm/vboxvideo/vbox_drv.c | 2 +- drivers/gpu/drm/virtio/virtgpu_drv.c | 2 +- drivers/gpu/drm/vmwgfx/vmwgfx_drv.c | 2 +- include/drm/drm_drv.h | 9 +++++++++ include/drm/drm_file.h | 12 ++++++++++++ 7 files changed, 38 insertions(+), 4 deletions(-)
drivers/gpu/drm/drm_plane.c +13 -0
@@ -678,6 +678,19 @@ int drm_mode_getplane_res(struct drm_dev !file_priv->universal_planes)continue ; +/* +* If we're running on a virtualized driver then, +* unless userspace advertizes support for the +* virtualized cursor plane, disable cursor planes +* because they'll be broken due to missing cursor +* hotspot info. +*/ +if (plane->type ==DRM_PLANE_TYPE_CURSOR && +drm_core_check_feature (dev,DRIVER_CURSOR_HOTSPOT ) && + file_priv->atomic && + !file_priv->supports_virtualized_cursor_plane) +continue ; +if (drm_lease_held (file_priv, plane->base.id)) {if (count < plane_resp->count_planes &&put_user (plane->base.id, plane_ptr + count))
drivers/gpu/drm/qxl/qxl_drv.c +1 -1
@@ -285,7 +285,7 @@ static const struct drm_ioctl_desc qxl_i };static struct drm_driver qxl_driver = { - .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC , + .driver_features =DRIVER_GEM |DRIVER_MODESET |DRIVER_ATOMIC |DRIVER_CURSOR_HOTSPOT , .dumb_create = qxl_mode_dumb_create, .dumb_map_offset = drm_gem_ttm_dumb_map_offset,
drivers/gpu/drm/vboxvideo/vbox_drv.c +1 -1
@@ -182,7 +182,7 @@ DEFINE_DRM_GEM_FOPS(vbox_fops);static const struct drm_driver driver = { .driver_features = -DRIVER_MODESET |DRIVER_GEM |DRIVER_ATOMIC , +DRIVER_MODESET |DRIVER_GEM |DRIVER_ATOMIC |DRIVER_CURSOR_HOTSPOT , .fops = &vbox_fops, .name =DRIVER_NAME ,
drivers/gpu/drm/virtio/virtgpu_drv.c +1 -1
@@ -177,7 +177,7 @@ static const struct drm_driver driver =* out via drm_device::driver_features: */ .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_RENDER | DRIVER_ATOMIC | - DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE, + DRIVER_SYNCOBJ | DRIVER_SYNCOBJ_TIMELINE | DRIVER_CURSOR_HOTSPOT, .open = virtio_gpu_driver_open, .postclose = virtio_gpu_driver_postclose,
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c +1 -1
@@ -1611,7 +1611,7 @@ static const struct file_operations vmwgstatic const struct drm_driver driver = { .driver_features = -DRIVER_MODESET |DRIVER_RENDER |DRIVER_ATOMIC |DRIVER_GEM , +DRIVER_MODESET |DRIVER_RENDER |DRIVER_ATOMIC |DRIVER_GEM |DRIVER_CURSOR_HOTSPOT , .ioctls = vmw_ioctls, .num_ioctls =ARRAY_SIZE (vmw_ioctls), .master_set = vmw_master_set,
include/drm/drm_drv.h +9 -0
@@ -110,6 +110,15 @@ enum drm_driver_feature {* Driver supports user defined GPU VA bindings for GEM objects. */ DRIVER_GEM_GPUVA =BIT (8 ), +/** +* @DRIVER_CURSOR_HOTSPOT: +* +* Driver supports and requires cursor hotspot information in the +* cursor plane (e.g. cursor plane has to actually track the mouse +* cursor and the clients are required to set hotspot in order for +* the cursor planes to work correctly). +*/ + DRIVER_CURSOR_HOTSPOT = BIT(9),/* IMPORTANT: Below are all the legacy flags, add new ones above. */
include/drm/drm_file.h +12 -0
@@ -227,6 +227,18 @@ struct drm_file {bool is_master;/** +* @supports_virtualized_cursor_plane: +* +* This client is capable of handling the cursor plane with the +* restrictions imposed on it by the virtualized drivers. +* +* This implies that the cursor plane has to behave like a cursor +* i.e. track cursor movement. It also requires setting of the +* hotspot properties by the client on the cursor plane. +*/ +bool supports_virtualized_cursor_plane; + +/** * @master: * * Master this node is currently associated with. Protected by struct
Greg Kroah-Hartman
maintainerPATCH 254/346 drm/virtio: Disable damage clipping if FB changed since last page-flip
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Martinez Canillas <[email protected]>
commit 0240db231dfe5ee5b7a3a03cba96f0844b7a673d upstream.
The driver does per-buffer uploads and needs to force a full plane update if the plane's attached framebuffer has change since the last page-flip.
--- drivers/gpu/drm/virtio/virtgpu_plane.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/gpu/drm/virtio/virtgpu_plane.c +10 -0
@@ -79,6 +79,8 @@ static int virtio_gpu_plane_atomic_check {struct drm_plane_state *new_plane_state =drm_atomic_get_new_plane_state (state, plane); +struct drm_plane_state *old_plane_state =drm_atomic_get_old_plane_state (state, + plane);bool is_cursor = plane->type ==DRM_PLANE_TYPE_CURSOR ;struct drm_crtc_state *crtc_state;int ret;
@@ -86,6 +88,14 @@ static int virtio_gpu_plane_atomic_checkif (!new_plane_state->fb ||WARN_ON (!new_plane_state->crtc))return 0 ; +/* +* Ignore damage clips if the framebuffer attached to the plane's state +* has changed since the last plane update (page-flip). In this case, a +* full plane update should happen because uploads are done per-buffer. +*/ +if (old_plane_state->fb != new_plane_state->fb) + new_plane_state->ignore_damage_clips = true; + crtc_state =drm_atomic_get_crtc_state (state, new_plane_state->crtc);if (IS_ERR (crtc_state))
Greg Kroah-Hartman
maintainerPATCH 255/346 drm: Allow drivers to indicate the damage helpers to ignore damage clips
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Javier Martinez Canillas <[email protected]>
commit 35ed38d58257336c1df26b14fd5110b026e2adde upstream.
It allows drivers to set a struct drm_plane_state .ignore_damage_clips in their plane's .atomic_check callback, as an indication to damage helpers such as drm_atomic_helper_damage_iter_init() that the damage clips should be ignored.
To be used by drivers that do per-buffer (e.g: virtio-gpu) uploads (rather than per-plane uploads), since these type of drivers need to handle buffer damages instead of frame damages.
That way, these drivers could force a full plane update if the framebuffer attached to a plane's state has changed since the last update (page-flip).
--- Documentation/gpu/drm-kms.rst | 2 ++ drivers/gpu/drm/drm_damage_helper.c | 3 ++- include/drm/drm_plane.h | 10 ++++++++++ 3 files changed, 14 insertions(+), 1 deletion(-)
Documentation/gpu/drm-kms.rst +2 -0
@@ -548,6 +548,8 @@ Plane Composition Properties .. kernel-doc:: drivers/gpu/drm/drm_blend.c :doc: overview +.. _damage_tracking_properties: + Damage Tracking Properties --------------------------
drivers/gpu/drm/drm_damage_helper.c +2 -1
@@ -241,7 +241,8 @@ drm_atomic_helper_damage_iter_init(struc iter->plane_src.x2 = (src.x2 >>16 ) + !!(src.x2 &0xFFFF ); iter->plane_src.y2 = (src.y2 >>16 ) + !!(src.y2 &0xFFFF ); -if (!iter->clips || !drm_rect_equals (&state->src, &old_state->src)) { +if (!iter->clips || state->ignore_damage_clips || + !drm_rect_equals (&state->src, &old_state->src)) { iter->clips =NULL ; iter->num_clips =0 ; iter->full_update = true;
include/drm/drm_plane.h +10 -0
@@ -191,6 +191,16 @@ struct drm_plane_state {struct drm_property_blob *fb_damage_clips;/** +* @ignore_damage_clips: +* +* Set by drivers to indicate the drm_atomic_helper_damage_iter_init() +* helper that the @fb_damage_clips blob property should be ignored. +* +* See :ref:`damage_tracking_properties` for more information. +*/ +bool ignore_damage_clips; + +/** * @src: * * source coordinates of the plane (in 16.16).
Greg Kroah-Hartman
maintainerPATCH 256/346 drm/amd/display: fix bandwidth validation failure on DCN 2.1
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Melissa Wen <[email protected]>
commit 3a0fa3bc245ef92838a8296e0055569b8dff94c4 upstream.
IGT amdgpu/amd_color/crtc-lut-accuracy fails right at the beginning of the test execution, during atomic check, because DC rejects the bandwidth state for a fb sizing 64x64. The test was previously working with the deprecated dc_commit_state(). Now using dc_validate_with_context() approach, the atomic check needs to perform a full state validation. Therefore, set fast_validation to false in the dc_validate_global_state call for atomic check.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -10479,7 +10479,7 @@ static int amdgpu_dm_atomic_check(structDRM_DEBUG_DRIVER ("drm_dp_mst_atomic_check() failed\n" ); goto fail; } - status =dc_validate_global_state (dc, dm_state->context, true); + status =dc_validate_global_state (dc, dm_state->context, false);if (status !=DC_OK ) {DRM_DEBUG_DRIVER ("DC global validation failure: %s (%d)" ,dc_status_to_str (status), status);
Greg Kroah-Hartman
maintainerPATCH 257/346 drm/amd/display: Disable PSR-SU on Parade 0803 TCON again
In reply to Greg Kroah-Hartman6.7-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
@@ -841,6 +841,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 258/346 Revert "drm/amd/display: fix bandwidth validation failure on DCN 2.1"
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ivan Lipski <[email protected]>
commit c2ab9ce0ee7225fc05f58a6671c43b8a3684f530 upstream.
This commit causes dmesg-warn on several IGT tests on DCN 3.1.6: *ERROR*link_enc_cfg_validate: Invalid link encoder assignments - 0x1c
Affected IGT tests include:
- amdgpu/[amd_assr|amd_plane|amd_hotplug]
- kms_atomic
- kms_color
- kms_flip
- kms_properties
- kms_universal_plane
and some other tests
This reverts commit 3a0fa3bc245ef92838a8296e0055569b8dff94c4.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -10479,7 +10479,7 @@ static int amdgpu_dm_atomic_check(structDRM_DEBUG_DRIVER ("drm_dp_mst_atomic_check() failed\n" ); goto fail; } - status =dc_validate_global_state (dc, dm_state->context, false); + status =dc_validate_global_state (dc, dm_state->context, true);if (status !=DC_OK ) {DRM_DEBUG_DRIVER ("DC global validation failure: %s (%d)" ,dc_status_to_str (status), status);
Greg Kroah-Hartman
maintainerPATCH 259/346 drm/bridge: nxp-ptn3460: simplify some error checking
In reply to Greg Kroah-Hartman6.7-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 260/346 drm/amd/display: Fix a debugfs null pointer error
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aurabindo Pillai <[email protected]>
commit efb91fea652a42fcc037d2a9ef4ecd1ffc5ff4b7 upstream.
[WHY & HOW]
Check whether get_subvp_en() callback exists before calling it.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +5 -1
@@ -3647,12 +3647,16 @@ static int capabilities_show(struct seq_bool mall_supported = dc->caps.mall_size_total;bool subvp_supported = dc->caps.subvp_fw_processing_delay_us;unsigned int mall_in_use = false; -unsigned int subvp_in_use = dc->cap_funcs.get_subvp_en (dc, dc->current_state); +unsigned int subvp_in_use = false; +struct hubbub *hubbub = dc->res_pool->hubbub;if (hubbub->funcs->get_mall_en) hubbub->funcs->get_mall_en (hubbub, &mall_in_use); +if (dc->cap_funcs.get_subvp_en) + subvp_in_use = dc->cap_funcs.get_subvp_en (dc, dc->current_state); +seq_printf (m,"mall supported: %s, enabled: %s\n" , mall_supported ?"yes" :"no" , mall_in_use ?"yes" :"no" ); seq_printf(m, "sub-viewport supported: %s, enabled: %s\n",
Greg Kroah-Hartman
maintainerPATCH 261/346 drm/amdgpu: Enable GFXOFF for Compute on GFX11
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ori Messinger <[email protected]>
commit aa0901a9008eeb2710292aff94e615adf7884d5f upstream.
On GFX version 11, GFXOFF was disabled due to a MES KIQ firmware issue, which has since been fixed after version 64. This patch only re-enables GFXOFF for GFX version 11 if the GPU's MES KIQ firmware version is newer than version 64.
V2: Keep GFXOFF disabled on GFX11 if MES KIQ is below version 64.
V3: Add parentheses to avoid GCC warning for parentheses:
"suggest parentheses around comparison in operand of ‘&’"
V4: Remove "V3" from commit title
V5: Change commit description and insert 'Acked-by'
--- drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_amdkfd.c +2 -4
@@ -684,10 +684,8 @@ err:void amdgpu_amdkfd_set_compute_idle (struct amdgpu_device *adev,bool idle) {enum amd_powergating_state state = idle ?AMD_PG_STATE_GATE :AMD_PG_STATE_UNGATE ; -/* Temporary workaround to fix issues observed in some -* compute applications when GFXOFF is enabled on GFX11. -*/ -if (IP_VERSION_MAJ (amdgpu_ip_version (adev,GC_HWIP ,0 )) ==11 ) { +if (IP_VERSION_MAJ (amdgpu_ip_version (adev,GC_HWIP ,0 )) ==11 && + ((adev->mes.kiq_version &AMDGPU_MES_VERSION_MASK ) <=64 )) {pr_debug ("GFXOFF is %s\n" , idle ?"enabled" :"disabled" );amdgpu_gfx_off_ctrl (adev, idle); } else if ((IP_VERSION_MAJ(amdgpu_ip_version(adev, GC_HWIP, 0)) == 9) &&
Greg Kroah-Hartman
maintainerPATCH 262/346 drm/amdgpu: drop exp hw support check for GC 9.4.3
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
commit c3d5e297dcae88274dc6924db337a2159279eced upstream.
No longer needed.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 2 -- 1 file changed, 2 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +0 -2
@@ -1963,8 +1963,6 @@ static int amdgpu_discovery_set_gc_ip_blamdgpu_device_ip_block_add (adev, &gfx_v9_0_ip_block);break ;case IP_VERSION (9 ,4 ,3 ): -if (!amdgpu_exp_hw_support) -return -EINVAL ;amdgpu_device_ip_block_add (adev, &gfx_v9_4_3_ip_block);break ;case IP_VERSION (10 ,1 ,10 ):
Greg Kroah-Hartman
maintainerPATCH 263/346 drm/amdgpu: update regGL2C_CTRL4 value in golden setting
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yifan Zhang <[email protected]>
commit 2b9a073b7304f4a9e130d04794c91a0c4f9a5c12 upstream.
This patch to update regGL2C_CTRL4 in golden setting.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +1 -1
@@ -114,7 +114,7 @@ static const struct soc15_reg_golden golSOC15_REG_GOLDEN_VALUE (GC ,0 , regGL2C_ADDR_MATCH_MASK,0xffffffff ,0xfffffff3 ),SOC15_REG_GOLDEN_VALUE (GC ,0 , regGL2C_CTRL,0xffffffff ,0xf37fff3f ),SOC15_REG_GOLDEN_VALUE (GC ,0 , regGL2C_CTRL3,0xfffffffb ,0x00f40188 ), -SOC15_REG_GOLDEN_VALUE (GC ,0 , regGL2C_CTRL4,0xf0ffffff ,0x8000b007 ), +SOC15_REG_GOLDEN_VALUE (GC ,0 , regGL2C_CTRL4,0xf0ffffff ,0x80009007 ),SOC15_REG_GOLDEN_VALUE (GC ,0 , regPA_CL_ENHANCE,0xf1ffffff ,0x00880007 ),SOC15_REG_GOLDEN_VALUE (GC ,0 , regPC_CONFIG_CNTL_1,0xffffffff ,0x00010000 ), SOC15_REG_GOLDEN_VALUE(GC, 0, regTA_CNTL_AUX, 0xf7f7ffff, 0x01030000),
Greg Kroah-Hartman
maintainerPATCH 264/346 drm/amdgpu: correct the cu count for gfx v11
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Likun Gao <[email protected]>
commit f4a94dbb6dc0bed10a5fc63718d00f1de45b12c0 upstream.
Correct the algorithm of active CU to skip disabled sa for gfx v11.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +3 -0
@@ -6328,6 +6328,9 @@ static int gfx_v11_0_get_cu_info(structmutex_lock (&adev->grbm_idx_mutex);for (i =0 ; i < adev->gfx.config.max_shader_engines; i++) {for (j =0 ; j < adev->gfx.config.max_sh_per_se; j++) { + bitmap = i * adev->gfx.config.max_sh_per_se + j; +if (!((gfx_v11_0_get_sa_active_bitmap (adev) >> bitmap) &1 )) +continue ; mask =1 ; counter =0 ;gfx_v11_0_select_se_sh (adev, i, j,0xffffffff ,0 );
Greg Kroah-Hartman
maintainerPATCH 265/346 drm/amd/pm: Fix smuv13.0.6 current clock reporting
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <[email protected]>
commit a992c90d8ed3929b70ae815ce21ca5651cc0a692 upstream.
When current clock is equal to max dpm level clock, the level is not indicated correctly with *. Fix by comparing current clock against dpm level value.
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +3 -1
@@ -924,7 +924,9 @@ static int smu_v13_0_6_print_clks(structif (i < (clocks.num_levels -1 )) clk2 = clocks.data[i +1 ].clocks_in_khz /1000 ; -if (curr_clk >= clk1 && curr_clk < clk2) { +if (curr_clk == clk1) { + level = i; + }else if (curr_clk >= clk1 && curr_clk < clk2) { level = (curr_clk - clk1) <= (clk2 - curr_clk) ? i : i +1 ;
Greg Kroah-Hartman
maintainerPATCH 266/346 drm/amd/pm: Add error log for smu v13.0.6 reset
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <[email protected]>
commit 91739a897c12dcec699e53f390be1b4abdeef3a0 upstream.
For all mode-2 reset fail cases, add error log.
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_6_ppt.c +6 -5
@@ -2192,17 +2192,18 @@ static int smu_v13_0_6_mode2_reset(struccontinue ; } -if (ret) { -dev_err (adev->dev, -"failed to send mode2 message \tparam: 0x%08x error code %d\n" , -SMU_RESET_MODE_2 , ret); +if (ret) goto out; - } + }while (ret == -ETIME && timeout); out:mutex_unlock (&smu->message_lock); +if (ret) +dev_err (adev->dev,"failed to send mode2 reset, error code %d" , + ret); +return ret; }
Greg Kroah-Hartman
maintainerPATCH 267/346 drm/amd/display: Fix variable deferencing before NULL check in edp_setup_replay()
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
commit 7073934f5d73f8b53308963cee36f0d389ea857c upstream.
In edp_setup_replay(), 'struct dc *dc' & 'struct dmub_replay *replay' was dereferenced before the pointer 'link' & 'replay' NULL check.
Fixes the below:drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_edp_panel_control.c:947 edp_setup_replay() warn: variable dereferenced before check 'link' (see line 933)
--- drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c | 11 ++++++---- 1 file changed, 7 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +7 -4
@@ -927,8 +927,8 @@ bool edp_get_replay_state(const struct dbool edp_setup_replay (struct dc_link *link,const struct dc_stream_state *stream) {/* To-do: Setup Replay */ -struct dc *dc = link->ctx->dc; -struct dmub_replay *replay = dc->res_pool->replay; +struct dc *dc; +struct dmub_replay *replay;int i;unsigned int panel_inst;struct replay_context replay_context = {0 };
@@ -944,6 +944,10 @@ bool edp_setup_replay(struct dc_link *liif (!link)return false; + dc = link->ctx->dc; + + replay = dc->res_pool->replay; +if (!replay)return false;
@@ -972,8 +976,7 @@ bool edp_setup_replay(struct dc_link *li replay_context.line_time_in_ns = lineTimeInNs; -if (replay) - link->replay_settings.replay_feature_enabled = + link->replay_settings.replay_feature_enabled = replay->funcs->replay_copy_settings (replay, link, &replay_context, panel_inst);if (link->replay_settings.replay_feature_enabled) {
Greg Kroah-Hartman
maintainerPATCH 268/346 drm/amd/display: Fix DML2 watermark calculation
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ovidiu Bunea <[email protected]>
commit d3579f5df0536c2f0fabaa3ea80bb2d179884195 upstream.
[Why]core_mode_programming in DML2 should output watermark calculations to locals, but it incorrectly uses mode_lib
[How]
update code to match HW DML2
--- drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c +7 -7
@@ -9446,13 +9446,13 @@ void dml_core_mode_programming(struct di CalculateWatermarks_params->CompressedBufferSizeInkByte = locals->CompressedBufferSizeInkByte;// Output - CalculateWatermarks_params->Watermark = &s->dummy_watermark;// Watermarks *Watermark - CalculateWatermarks_params->DRAMClockChangeSupport = &mode_lib->ms.support.DRAMClockChangeSupport[0 ]; - CalculateWatermarks_params->MaxActiveDRAMClockChangeLatencySupported = &s->dummy_single_array[0 ][0 ];// dml_float_t *MaxActiveDRAMClockChangeLatencySupported[] - CalculateWatermarks_params->SubViewportLinesNeededInMALL = &mode_lib->ms.SubViewportLinesNeededInMALL[j];// dml_uint_t SubViewportLinesNeededInMALL[] - CalculateWatermarks_params->FCLKChangeSupport = &mode_lib->ms.support.FCLKChangeSupport[0 ]; - CalculateWatermarks_params->MaxActiveFCLKChangeLatencySupported = &s->dummy_single[0 ];// dml_float_t *MaxActiveFCLKChangeLatencySupported - CalculateWatermarks_params->USRRetrainingSupport = &mode_lib->ms.support.USRRetrainingSupport[0 ]; + CalculateWatermarks_params->Watermark = &locals->Watermark;// Watermarks *Watermark + CalculateWatermarks_params->DRAMClockChangeSupport = &locals->DRAMClockChangeSupport; + CalculateWatermarks_params->MaxActiveDRAMClockChangeLatencySupported = locals->MaxActiveDRAMClockChangeLatencySupported;// dml_float_t *MaxActiveDRAMClockChangeLatencySupported[] + CalculateWatermarks_params->SubViewportLinesNeededInMALL = locals->SubViewportLinesNeededInMALL;// dml_uint_t SubViewportLinesNeededInMALL[] + CalculateWatermarks_params->FCLKChangeSupport = &locals->FCLKChangeSupport; + CalculateWatermarks_params->MaxActiveFCLKChangeLatencySupported = &locals->MaxActiveFCLKChangeLatencySupported;// dml_float_t *MaxActiveFCLKChangeLatencySupported + CalculateWatermarks_params->USRRetrainingSupport = &locals->USRRetrainingSupport; CalculateWatermarksMALLUseAndDRAMSpeedChangeSupport( &mode_lib->scratch,
Greg Kroah-Hartman
maintainerPATCH 269/346 drm/amd/display: Port DENTIST hang and TDR fixes to OTG disable W/A
In reply to Greg Kroah-Hartman6.7-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); } } }
@@ -252,11 +249,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 270/346 drm/amd/display: Align the returned error code with legacy DP
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wayne Lin <[email protected]>
commit bfe79f5fff1300d96203383582b078c7b0aec80a upstream.
[Why]
For usb4 connector, AUX transaction is handled by dmub utilizing a differnt code path comparing to legacy DP connector. If the usb4 DP connector is disconnected, AUX access will report EBUSY and cause igt@kms_dp_aux_dev fail.
[How]
Align the error code with the one reported by legacy DP as EIO.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +5 -0
@@ -965,6 +965,11 @@ int dm_helper_dmub_aux_transfer_sync( struct aux_payload *payload, enum aux_return_code_type *operation_result) { +if (!link->hpd_status) { + *operation_result =AUX_RET_ERROR_HPD_DISCON ; +return -1 ; + } +return amdgpu_dm_process_dmub_aux_transfer_sync (ctx, link->link_index, payload, operation_result); }
Greg Kroah-Hartman
maintainerPATCH 271/346 drm/amd/display: Fix late derefrence dsc check in link_set_dsc_pps_packet()
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
commit 3bb9b1f958c3d986ed90a3ff009f1e77e9553207 upstream.
In link_set_dsc_pps_packet(), 'struct display_stream_compressor *dsc' was dereferenced in a DC_LOGGER_INIT(dsc->ctx->logger); before the 'dsc' NULL pointer check.
Fixes the below:drivers/gpu/drm/amd/amdgpu/../display/dc/link/link_dpms.c:905 link_set_dsc_pps_packet() warn: variable dereferenced before check 'dsc' (see line 903)
--- drivers/gpu/drm/amd/display/dc/link/link_dpms.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/link/link_dpms.c +6 -2
@@ -875,11 +875,15 @@ bool link_set_dsc_pps_packet(struct pipe {struct display_stream_compressor *dsc = pipe_ctx->stream_res.dsc;struct dc_stream_state *stream = pipe_ctx->stream; -DC_LOGGER_INIT (dsc->ctx->logger); -if (!pipe_ctx->stream->timing.flags.DSC || !dsc) +if (!pipe_ctx->stream->timing.flags.DSC) +return false; + +if (!dsc)return false; +DC_LOGGER_INIT (dsc->ctx->logger); +if (enable) {struct dsc_config dsc_cfg;uint8_t dsc_packed_pps[128 ];
Greg Kroah-Hartman
maintainerPATCH 272/346 drm/amd/display: Fix a switch statement in populate_dml_output_cfg_from_stream_state()
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Christophe JAILLET <[email protected]>
commit 05638ff6dd6f0f38734b6b3ee2c7cf15520f5c00 upstream.
It is likely that the statement related to 'dml_edp' is misplaced. So move it in the correct "case SIGNAL_TYPE_EDP".
--- drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +1 -1
@@ -624,8 +624,8 @@ static void populate_dml_output_cfg_fromif (is_dp2p0_output_encoder (pipe)) out->OutputEncoder[location] = dml_dp2p0;break ; - out->OutputEncoder[location] = dml_edp;case SIGNAL_TYPE_EDP : + out->OutputEncoder[location] = dml_edp;break ;case SIGNAL_TYPE_HDMI_TYPE_A :case SIGNAL_TYPE_DVI_SINGLE_LINK :
Greg Kroah-Hartman
maintainerPATCH 273/346 drm/amd/amdgpu: Assign GART pages to AMD device mapping
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tom St Denis <[email protected]>
commit e7a8594cc2af920a905db15653c19c362d4ebd3f upstream.
This allows kernel mapped pages like the PDB and PTB to be read via the iomem debugfs when there is no vram in the system.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_gart.c +8 -0
@@ -121,6 +121,7 @@ int amdgpu_gart_table_ram_alloc(struct astruct amdgpu_bo_param bp;dma_addr_t dma_addr;struct page *p; +unsigned long x;int ret;if (adev->gart.bo !=NULL )
@@ -130,6 +131,10 @@ int amdgpu_gart_table_ram_alloc(struct aif (!p)return -ENOMEM ; +/* assign pages to this device */ +for (x =0 ; x < (1UL << order); x++) + p[x].mapping = adev->mman.bdev.dev_mapping; +/* If the hardware does not support UTCL2 snooping of the CPU caches * then set_memory_wc() could be used as a workaround to mark the pages * as write combine memory.
@@ -223,6 +228,7 @@ void amdgpu_gart_table_ram_free(struct aunsigned int order =get_order (adev->gart.table_size);struct sg_table *sg = adev->gart.bo->tbo.sg;struct page *p; +unsigned long x;int ret; ret =amdgpu_bo_reserve (adev->gart.bo, false);
@@ -234,6 +240,8 @@ void amdgpu_gart_table_ram_free(struct asg_free_table (sg);kfree (sg); p =virt_to_page (adev->gart.ptr); +for (x =0 ; x < (1UL << order); x++) + p[x].mapping =NULL ;__free_pages (p, order); adev->gart.ptr =NULL ;
Greg Kroah-Hartman
maintainerPATCH 274/346 drm/amd/pm: Fetch current power limit from FW
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <[email protected]>
commit f1807682de0edbff6c1e46b19642a517d2e15c57 upstream.
Power limit of SMUv13.0.6 SOCs can be updated by out-of-band ways. Fetch the limit from firmware instead of using cached values.
--- drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 -0
@@ -2502,6 +2502,7 @@ int smu_get_power_limit(void *handle,case SMU_PPT_LIMIT_CURRENT :switch (amdgpu_ip_version (adev,MP1_HWIP ,0 )) {case IP_VERSION (13 ,0 ,2 ): +case IP_VERSION (13 ,0 ,6 ):case IP_VERSION (11 ,0 ,7 ):case IP_VERSION (11 ,0 ,11 ):case IP_VERSION (11 ,0 ,12 ):
Greg Kroah-Hartman
maintainerPATCH 275/346 drm/amdgpu: Avoid fetching vram vendor information
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <[email protected]>
commit 90751bdeee4e3ac87ebf814bf282b0fa97edfeab upstream.
For GFX 9.4.3 APUs, the current method of fetching vram vendor information is not reliable. Avoid fetching the information.
--- drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +2 -1
@@ -1950,7 +1950,8 @@ static void gmc_v9_4_3_init_vram_info(ststatic const u32 regBIF_BIOS_SCRATCH_4 =0x50 ;u32 vram_info; -if (!amdgpu_sriov_vf (adev)) { +/* Only for dGPU, vendor informaton is reliable */ +if (!amdgpu_sriov_vf (adev) && !(adev->flags &AMD_IS_APU )) { vram_info =RREG32 (regBIF_BIOS_SCRATCH_4); adev->gmc.vram_vendor = vram_info &0xF ; }
Greg Kroah-Hartman
maintainerPATCH 276/346 drm/amdgpu: Show vram vendor only if available
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lijo Lazar <[email protected]>
commit 89a7c0bd74918f723c94c10452265e25063cba9b upstream.
Ony if vram vendor info is available, show in sysfs.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +16 -1
@@ -221,8 +221,23 @@ static struct attribute *amdgpu_vram_mgr_attributes[] = { NULL }; +static umode_t amdgpu_vram_attrs_is_visible (struct kobject *kobj, +struct attribute *attr,int i) +{ +struct device *dev =kobj_to_dev (kobj); +struct drm_device *ddev =dev_get_drvdata (dev); +struct amdgpu_device *adev =drm_to_adev (ddev); + +if (attr == &dev_attr_mem_info_vram_vendor.attr && + !adev->gmc.vram_vendor) +return 0 ; + +return attr->mode; +} +const struct attribute_group amdgpu_vram_mgr_attr_group = { - .attrs = amdgpu_vram_mgr_attributes + .attrs = amdgpu_vram_mgr_attributes, + .is_visible = amdgpu_vram_attrs_is_visible };/**
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 277/346 drm/amd/pm: update the power cap setting
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Kenneth Feng <[email protected]>
commit 30269954745c6cac730352829ac9850918457440 upstream.
update the power cap setting for smu_v13.0.0/smu_v13.0.7
--- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c | 54 ++++++++++++++++++- drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c | 54 ++++++++++++++++++- 2 files changed, 104 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +52 -2
@@ -2352,6 +2352,7 @@ static int smu_v13_0_0_get_power_limit(sPPTable_t *pptable = table_context->driver_pptable;SkuTable_t *skutable = &pptable->SkuTable;uint32_t power_limit, od_percent_upper, od_percent_lower; +uint32_t msg_limit = skutable->MsgLimits.Power[PPT_THROTTLER_PPT0 ][POWER_SOURCE_AC ];if (smu_v13_0_get_current_power_limit (smu, &power_limit)) power_limit = smu->adev->pm.ac_power ?
@@ -2375,7 +2376,7 @@ static int smu_v13_0_0_get_power_limit(s od_percent_upper, od_percent_lower, power_limit);if (max_power_limit) { - *max_power_limit = power_limit * (100 + od_percent_upper); + *max_power_limit = msg_limit * (100 + od_percent_upper); *max_power_limit /=100 ; }
@@ -2970,6 +2971,55 @@ static ssize_t smu_v13_0_0_get_ecc_info(return ret; } +static int smu_v13_0_0_set_power_limit (struct smu_context *smu, +enum smu_ppt_limit_type limit_type, +uint32_t limit) +{ +PPTable_t *pptable = smu->smu_table.driver_pptable; +SkuTable_t *skutable = &pptable->SkuTable; +uint32_t msg_limit = skutable->MsgLimits.Power[PPT_THROTTLER_PPT0 ][POWER_SOURCE_AC ]; +struct smu_table_context *table_context = &smu->smu_table; +OverDriveTableExternal_t *od_table = + (OverDriveTableExternal_t *)table_context->overdrive_table; +int ret =0 ; + +if (limit_type !=SMU_DEFAULT_PPT_LIMIT ) +return -EINVAL ; + +if (limit <= msg_limit) { +if (smu->current_power_limit > msg_limit) { + od_table->OverDriveTable.Ppt =0 ; + od_table->OverDriveTable.FeatureCtrlMask |=1U <<PP_OD_FEATURE_PPT_BIT ; + + ret =smu_v13_0_0_upload_overdrive_table (smu, od_table); +if (ret) { +dev_err (smu->adev->dev,"Failed to upload overdrive table!\n" ); +return ret; + } + } +return smu_v13_0_set_power_limit (smu, limit_type, limit); + }else if (smu->od_enabled) { + ret =smu_v13_0_set_power_limit (smu, limit_type, msg_limit); +if (ret) +return ret; + + od_table->OverDriveTable.Ppt = (limit *100 ) / msg_limit -100 ; + od_table->OverDriveTable.FeatureCtrlMask |=1U <<PP_OD_FEATURE_PPT_BIT ; + + ret =smu_v13_0_0_upload_overdrive_table (smu, od_table); +if (ret) { +dev_err (smu->adev->dev,"Failed to upload overdrive table!\n" ); +return ret; + } + + smu->current_power_limit = limit; + }else { +return -EINVAL ; + } + +return 0 ; +} +static const struct pptable_funcs smu_v13_0_0_ppt_funcs = { .get_allowed_feature_mask = smu_v13_0_0_get_allowed_feature_mask, .set_default_dpm_table = smu_v13_0_0_set_default_dpm_table,
@@ -3024,7 +3074,7 @@ static const struct pptable_funcs smu_v1 .set_fan_control_mode = smu_v13_0_set_fan_control_mode, .enable_mgpu_fan_boost = smu_v13_0_0_enable_mgpu_fan_boost, .get_power_limit = smu_v13_0_0_get_power_limit, - .set_power_limit = smu_v13_0_set_power_limit, + .set_power_limit = smu_v13_0_0_set_power_limit, .set_power_source = smu_v13_0_set_power_source, .get_power_profile_mode = smu_v13_0_0_get_power_profile_mode, .set_power_profile_mode = smu_v13_0_0_set_power_profile_mode,
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +52 -2
78 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 278/346 drm/amdgpu/pm: Fix the power source flag error
In reply to Greg Kroah-Hartman6.7-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"
@@ -817,16 +818,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 ((amdgpu_ip_version (adev,MP1_HWIP ,0 ) ==IP_VERSION (13 ,0 ,1 )) || (amdgpu_ip_version (adev,MP1_HWIP ,0 ) ==IP_VERSION (13 ,0 ,3 )))
drivers/gpu/drm/amd/pm/swsmu/smu11/smu_v11_0.c +2 -0
@@ -1442,10 +1442,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
@@ -1379,10 +1379,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 279/346 drm/amd/display: Fix uninitialized variable usage in core_link_ read_dpcd() & write_dpcd() functions
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Srinivasan Shanmugam <[email protected]>
commit a58371d632ebab9ea63f10893a6b6731196b6f8d upstream.
The 'status' variable in 'core_link_read_dpcd()' & 'core_link_write_dpcd()' was uninitialized.
Thus, initializing 'status' variable to 'DC_ERROR_UNEXPECTED' by default.
Fixes the below:drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dpcd.c:226 core_link_read_dpcd() error: uninitialized symbol 'status'. drivers/gpu/drm/amd/amdgpu/../display/dc/link/protocols/link_dpcd.c:248 core_link_write_dpcd() error: uninitialized symbol 'status'.
--- drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/link/protocols/link_dpcd.c +2 -2
@@ -205,7 +205,7 @@ enum dc_status core_link_read_dpcd(uint32_t extended_size;/* size of the remaining partitioned address space */ uint32_t size_left_to_read; -enum dc_status status; +enum dc_status status =DC_ERROR_UNEXPECTED ;/* size of the next partition to be read from */ uint32_t partition_size;uint32_t data_index =0 ;
@@ -234,7 +234,7 @@ enum dc_status core_link_write_dpcd( {uint32_t partition_size;uint32_t data_index =0 ; -enum dc_status status; +enum dc_status status =DC_ERROR_UNEXPECTED ;while (size) { partition_size =dpcd_get_next_partition_size (address, size);
Greg Kroah-Hartman
maintainerPATCH 280/346 thermal: intel: hfi: Refactor enabling code into helper functions
In reply to Greg Kroah-Hartman6.7-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
@@ -347,6 +347,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
@@ -364,8 +384,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. */
@@ -409,8 +427,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.
@@ -420,16 +436,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);
@@ -438,13 +444,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 281/346 thermal: intel: hfi: Disable an HFI instance when all its CPUs go offline
In reply to Greg Kroah-Hartman6.7-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>
@@ -367,6 +368,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
@@ -421,6 +448,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);
@@ -485,6 +516,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 282/346 thermal: intel: hfi: Add syscore callbacks for system-wide PM
In reply to Greg Kroah-Hartman6.7-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>
@@ -568,6 +570,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;
@@ -599,6 +625,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 283/346 media: v4l: cci: Include linux/bits.h
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sakari Ailus <[email protected]>
[ Upstream commit eba5058633b4d11e2a4d65eae9f1fce0b96365d9 ]
linux/bits.h is needed for GENMASK(). Include it.
Stable-dep-of: d92e7a013ff3 ("media: v4l2-cci: Add support for little-endian encoded registers")
--- include/media/v4l2-cci.h | 1 + 1 file changed, 1 insertion(+)
include/media/v4l2-cci.h +1 -0
@@ -7,6 +7,7 @@#ifndef _V4L2_CCI_H#define _V4L2_CCI_H +#include <linux/bits.h> #include <linux/types.h> struct i2c_client ;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 284/346 media: v4l: cci: Add macros to obtain register width and address
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sakari Ailus <[email protected]>
[ Upstream commit cd93cc245dfe334c38da98c14b34f9597e1b4ea6 ]
Add CCI_REG_WIDTH() macro to obtain register width in bits and similarly, CCI_REG_WIDTH_BYTES() to obtain it in bytes.
Also add CCI_REG_ADDR() macro to obtain the address of a register.
Use both macros in v4l2-cci.c, too.
Stable-dep-of: d92e7a013ff3 ("media: v4l2-cci: Add support for little-endian encoded registers")
--- drivers/media/v4l2-core/v4l2-cci.c | 8 ++++---- include/media/v4l2-cci.h | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-)
drivers/media/v4l2-core/v4l2-cci.c +4 -4
@@ -25,8 +25,8 @@ int cci_read(struct regmap *map, u32 reg, u64 *val, int *err)if (err && *err)return *err; - len =FIELD_GET (CCI_REG_WIDTH_MASK , reg); - reg =FIELD_GET (CCI_REG_ADDR_MASK , reg); + len =CCI_REG_WIDTH_BYTES (reg); + reg =CCI_REG_ADDR (reg); ret =regmap_bulk_read (map, reg, buf, len);if (ret) {
@@ -75,8 +75,8 @@ int cci_write(struct regmap *map, u32 reg, u64 val, int *err)if (err && *err)return *err; - len =FIELD_GET (CCI_REG_WIDTH_MASK , reg); - reg =FIELD_GET (CCI_REG_ADDR_MASK , reg); + len =CCI_REG_WIDTH_BYTES (reg); + reg =CCI_REG_ADDR (reg);switch (len) {case 1 :
include/media/v4l2-cci.h +5 -0
@@ -7,6 +7,7 @@#ifndef _V4L2_CCI_H#define _V4L2_CCI_H +#include <linux/bitfield.h> #include <linux/bits.h> #include <linux/types.h>
@@ -34,6 +35,10 @@ struct cci_reg_sequence {#define CCI_REG_WIDTH_SHIFT 16#define CCI_REG_WIDTH_MASK GENMASK(19, 16) +#define CCI_REG_WIDTH_BYTES (x) FIELD_GET(CCI_REG_WIDTH_MASK, x) +#define CCI_REG_WIDTH (x) (CCI_REG_WIDTH_BYTES(x) << 3) +#define CCI_REG_ADDR (x) FIELD_GET(CCI_REG_ADDR_MASK, x) +#define CCI_REG8 (x) ((1 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG16 (x) ((2 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG24 (x) ((3 << CCI_REG_WIDTH_SHIFT) | (x))
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 285/346 media: v4l2-cci: Add support for little-endian encoded registers
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
[ Upstream commit d92e7a013ff33f4e0b31bbf768d0c85a8acefebf ]
Some sensors, e.g. Sony IMX290, are using little-endian registers. Add support for those by encoding the endianness into Bit 20 of the register address.
--- drivers/media/v4l2-core/v4l2-cci.c | 44 ++++++++++++++++++++++++------ include/media/v4l2-cci.h | 5 ++++ 2 files changed, 41 insertions(+), 8 deletions(-)
drivers/media/v4l2-core/v4l2-cci.c +36 -8
@@ -18,6 +18,7 @@int cci_read (struct regmap *map,u32 reg,u64 *val,int *err) { +bool little_endian;unsigned int len;u8 buf[8 ];int ret;
@@ -25,6 +26,7 @@ int cci_read(struct regmap *map, u32 reg, u64 *val, int *err)if (err && *err)return *err; + little_endian = reg &CCI_REG_LE ; len =CCI_REG_WIDTH_BYTES (reg); reg =CCI_REG_ADDR (reg);
@@ -40,16 +42,28 @@ int cci_read(struct regmap *map, u32 reg, u64 *val, int *err) *val = buf[0 ];break ;case 2 : - *val =get_unaligned_be16 (buf); +if (little_endian) + *val =get_unaligned_le16 (buf); +else + *val =get_unaligned_be16 (buf);break ;case 3 : - *val =get_unaligned_be24 (buf); +if (little_endian) + *val =get_unaligned_le24 (buf); +else + *val =get_unaligned_be24 (buf);break ;case 4 : - *val =get_unaligned_be32 (buf); +if (little_endian) + *val =get_unaligned_le32 (buf); +else + *val =get_unaligned_be32 (buf);break ;case 8 : - *val =get_unaligned_be64 (buf); +if (little_endian) + *val =get_unaligned_le64 (buf); +else + *val =get_unaligned_be64 (buf);break ;default : dev_err(regmap_get_device(map), "Error invalid reg-width %u for reg 0x%04x\n",
@@ -68,6 +82,7 @@ EXPORT_SYMBOL_GPL(cci_read);int cci_write (struct regmap *map,u32 reg,u64 val,int *err) { +bool little_endian;unsigned int len;u8 buf[8 ];int ret;
@@ -75,6 +90,7 @@ int cci_write(struct regmap *map, u32 reg, u64 val, int *err)if (err && *err)return *err; + little_endian = reg &CCI_REG_LE ; len =CCI_REG_WIDTH_BYTES (reg); reg =CCI_REG_ADDR (reg);
@@ -83,16 +99,28 @@ int cci_write(struct regmap *map, u32 reg, u64 val, int *err) buf[0 ] = val;break ;case 2 : -put_unaligned_be16 (val, buf); +if (little_endian) +put_unaligned_le16 (val, buf); +else +put_unaligned_be16 (val, buf);break ;case 3 : -put_unaligned_be24 (val, buf); +if (little_endian) +put_unaligned_le24 (val, buf); +else +put_unaligned_be24 (val, buf);break ;case 4 : -put_unaligned_be32 (val, buf); +if (little_endian) +put_unaligned_le32 (val, buf); +else +put_unaligned_be32 (val, buf);break ;case 8 : -put_unaligned_be64 (val, buf); +if (little_endian) +put_unaligned_le64 (val, buf); +else +put_unaligned_be64 (val, buf);break ;default : dev_err(regmap_get_device(map), "Error invalid reg-width %u for reg 0x%04x\n",
include/media/v4l2-cci.h +5 -0
@@ -38,12 +38,17 @@ struct cci_reg_sequence {#define CCI_REG_WIDTH_BYTES (x) FIELD_GET(CCI_REG_WIDTH_MASK, x)#define CCI_REG_WIDTH (x) (CCI_REG_WIDTH_BYTES(x) << 3)#define CCI_REG_ADDR (x) FIELD_GET(CCI_REG_ADDR_MASK, x) +#define CCI_REG_LE BIT(20)#define CCI_REG8 (x) ((1 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG16 (x) ((2 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG24 (x) ((3 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG32 (x) ((4 << CCI_REG_WIDTH_SHIFT) | (x))#define CCI_REG64 (x) ((8 << CCI_REG_WIDTH_SHIFT) | (x)) +#define CCI_REG16_LE (x) (CCI_REG_LE | (2U << CCI_REG_WIDTH_SHIFT) | (x)) +#define CCI_REG24_LE (x) (CCI_REG_LE | (3U << CCI_REG_WIDTH_SHIFT) | (x)) +#define CCI_REG32_LE (x) (CCI_REG_LE | (4U << CCI_REG_WIDTH_SHIFT) | (x)) +#define CCI_REG64_LE (x) (CCI_REG_LE | (8U << CCI_REG_WIDTH_SHIFT) | (x))/** * cci_read() - Read a value from a single CCI register
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 286/346 media: i2c: imx290: Properly encode registers as little-endian
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexander Stein <[email protected]>
[ Upstream commit 60fc87a69523c294eb23a1316af922f6665a6f8c ]
The conversion to CCI also converted the multi-byte register access to big-endian. Correct the register definition by using the correct little-endian ones.
--- drivers/media/i2c/imx290.c | 42 +++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 21 deletions(-)
drivers/media/i2c/imx290.c +21 -21
@@ -41,18 +41,18 @@#define IMX290_WINMODE_720P (1 << 4)#define IMX290_WINMODE_CROP (4 << 4)#define IMX290_FR_FDG_SEL CCI_REG8(0x3009) -#define IMX290_BLKLEVEL CCI_REG16(0x300a) +#define IMX290_BLKLEVEL CCI_REG16_LE(0x300a)#define IMX290_GAIN CCI_REG8(0x3014) -#define IMX290_VMAX CCI_REG24(0x3018) +#define IMX290_VMAX CCI_REG24_LE(0x3018)#define IMX290_VMAX_MAX 0x3ffff -#define IMX290_HMAX CCI_REG16(0x301c) +#define IMX290_HMAX CCI_REG16_LE(0x301c)#define IMX290_HMAX_MAX 0xffff -#define IMX290_SHS1 CCI_REG24(0x3020) +#define IMX290_SHS1 CCI_REG24_LE(0x3020)#define IMX290_WINWV_OB CCI_REG8(0x303a) -#define IMX290_WINPV CCI_REG16(0x303c) -#define IMX290_WINWV CCI_REG16(0x303e) -#define IMX290_WINPH CCI_REG16(0x3040) -#define IMX290_WINWH CCI_REG16(0x3042) +#define IMX290_WINPV CCI_REG16_LE(0x303c) +#define IMX290_WINWV CCI_REG16_LE(0x303e) +#define IMX290_WINPH CCI_REG16_LE(0x3040) +#define IMX290_WINWH CCI_REG16_LE(0x3042)#define IMX290_OUT_CTRL CCI_REG8(0x3046)#define IMX290_ODBIT_10BIT (0 << 0)#define IMX290_ODBIT_12BIT (1 << 0)
@@ -78,28 +78,28 @@#define IMX290_ADBIT2 CCI_REG8(0x317c)#define IMX290_ADBIT2_10BIT 0x12#define IMX290_ADBIT2_12BIT 0x00 -#define IMX290_CHIP_ID CCI_REG16(0x319a) +#define IMX290_CHIP_ID CCI_REG16_LE(0x319a)#define IMX290_ADBIT3 CCI_REG8(0x31ec)#define IMX290_ADBIT3_10BIT 0x37#define IMX290_ADBIT3_12BIT 0x0e#define IMX290_REPETITION CCI_REG8(0x3405)#define IMX290_PHY_LANE_NUM CCI_REG8(0x3407)#define IMX290_OPB_SIZE_V CCI_REG8(0x3414) -#define IMX290_Y_OUT_SIZE CCI_REG16(0x3418) -#define IMX290_CSI_DT_FMT CCI_REG16(0x3441) +#define IMX290_Y_OUT_SIZE CCI_REG16_LE(0x3418) +#define IMX290_CSI_DT_FMT CCI_REG16_LE(0x3441)#define IMX290_CSI_DT_FMT_RAW10 0x0a0a#define IMX290_CSI_DT_FMT_RAW12 0x0c0c#define IMX290_CSI_LANE_MODE CCI_REG8(0x3443) -#define IMX290_EXTCK_FREQ CCI_REG16(0x3444) -#define IMX290_TCLKPOST CCI_REG16(0x3446) -#define IMX290_THSZERO CCI_REG16(0x3448) -#define IMX290_THSPREPARE CCI_REG16(0x344a) -#define IMX290_TCLKTRAIL CCI_REG16(0x344c) -#define IMX290_THSTRAIL CCI_REG16(0x344e) -#define IMX290_TCLKZERO CCI_REG16(0x3450) -#define IMX290_TCLKPREPARE CCI_REG16(0x3452) -#define IMX290_TLPX CCI_REG16(0x3454) -#define IMX290_X_OUT_SIZE CCI_REG16(0x3472) +#define IMX290_EXTCK_FREQ CCI_REG16_LE(0x3444) +#define IMX290_TCLKPOST CCI_REG16_LE(0x3446) +#define IMX290_THSZERO CCI_REG16_LE(0x3448) +#define IMX290_THSPREPARE CCI_REG16_LE(0x344a) +#define IMX290_TCLKTRAIL CCI_REG16_LE(0x344c) +#define IMX290_THSTRAIL CCI_REG16_LE(0x344e) +#define IMX290_TCLKZERO CCI_REG16_LE(0x3450) +#define IMX290_TCLKPREPARE CCI_REG16_LE(0x3452) +#define IMX290_TLPX CCI_REG16_LE(0x3454) +#define IMX290_X_OUT_SIZE CCI_REG16_LE(0x3472)#define IMX290_INCKSEL7 CCI_REG8(0x3480)#define IMX290_PGCTRL_REGEN BIT(0)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 287/346 btrfs: zoned: factor out prepare_allocation_zoned()
In reply to Greg Kroah-Hartman6.7-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
@@ -4301,6 +4301,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,
@@ -4311,19 +4329,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 288/346 btrfs: zoned: optimize hint byte for zoned allocator
In reply to Greg Kroah-Hartman6.7-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
@@ -4314,6 +4314,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 289/346 drm/amd/display: do not send commands to DMUB if DMUB is inactive from S3
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Samson Tam <[email protected]>
[ Upstream commit 0f657938e4345a77be871d906f3e0de3c58a7a49 ]
[Why]
On resume from S3, may get apply_idle_optimizations call while DMUB is inactive which will just time out.
[How]
Set and track power state in dmub_srv and check power state before sending commands to DMUB. Add interface in both dmub_srv and dc_dmub_srv
Stable-dep-of: 8892780834ae ("drm/amd/display: Wake DMCUB before sending a command")
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 14 +++++++++++++ drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 2 ++ drivers/gpu/drm/amd/display/dmub/dmub_srv.h | 21 +++++++++++++++++++ .../gpu/drm/amd/display/dmub/src/dmub_srv.c | 15 +++++++++++++ 5 files changed, 55 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
@@ -2656,6 +2656,7 @@ static int dm_suspend(void *handle)hpd_rx_irq_work_suspend (dm);dc_set_power_state (dm->dc,DC_ACPI_CM_POWER_STATE_D3 ); +dc_dmub_srv_set_power_state (dm->dc->ctx->dmub_srv,DC_ACPI_CM_POWER_STATE_D3 );return 0 ; }
@@ -2851,6 +2852,7 @@ static int dm_resume(void *handle)if (r)DRM_ERROR ("DMUB interface failed to initialize: status=%d\n" , r); +dc_dmub_srv_set_power_state (dm->dc->ctx->dmub_srv,DC_ACPI_CM_POWER_STATE_D0 );dc_set_power_state (dm->dc,DC_ACPI_CM_POWER_STATE_D0 );dc_resume (dm->dc);
@@ -2901,6 +2903,7 @@ static int dm_resume(void *handle) }/* power on hardware */ +dc_dmub_srv_set_power_state (dm->dc->ctx->dmub_srv,DC_ACPI_CM_POWER_STATE_D0 );dc_set_power_state (dm->dc,DC_ACPI_CM_POWER_STATE_D0 );/* program HPD filter */
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +14 -0
@@ -1251,3 +1251,17 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)ASSERT (0 ); } +void dc_dmub_srv_set_power_state (struct dc_dmub_srv *dc_dmub_srv,enum dc_acpi_cm_power_state powerState) +{ +struct dmub_srv *dmub; + +if (!dc_dmub_srv) +return ; + + dmub = dc_dmub_srv->dmub; + +if (powerState ==DC_ACPI_CM_POWER_STATE_D0 ) +dmub_srv_set_power_state (dmub,DMUB_POWER_STATE_D0 ); +else +dmub_srv_set_power_state (dmub,DMUB_POWER_STATE_D3 ); +}
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +2 -0
@@ -102,4 +102,6 @@ void dc_dmub_srv_subvp_save_surf_addr(const struct dc_dmub_srv *dc_dmub_srv, conbool dc_dmub_srv_is_hw_pwr_up (struct dc_dmub_srv *dc_dmub_srv,bool wait);void dc_dmub_srv_notify_idle (const struct dc *dc,bool allow_idle);void dc_dmub_srv_exit_low_power_state (const struct dc *dc); + +void dc_dmub_srv_set_power_state (struct dc_dmub_srv *dc_dmub_srv,enum dc_acpi_cm_power_state powerState);#endif /* _DMUB_DC_SRV_H_ */
drivers/gpu/drm/amd/display/dmub/dmub_srv.h +21 -0
@@ -150,6 +150,13 @@ enum dmub_memory_access_type { DMUB_MEMORY_ACCESS_DMA }; +/* enum dmub_power_state type - to track DC power state in dmub_srv */ +enum dmub_srv_power_state_type { +DMUB_POWER_STATE_UNDEFINED =0 , +DMUB_POWER_STATE_D0 =1 , +DMUB_POWER_STATE_D3 =8 +}; +/** * struct dmub_region - dmub hw memory region * @base: base address for region, must be 256 byte aligned
@@ -485,6 +492,8 @@ struct dmub_srv {/* Feature capabilities reported by fw */ struct dmub_feature_caps feature_caps;struct dmub_visual_confirm_color visual_confirm_color; + +enum dmub_srv_power_state_type power_state; };/**
@@ -889,6 +898,18 @@ enum dmub_status dmub_srv_clear_inbox0_ack(struct dmub_srv *dmub);*/ void dmub_srv_subvp_save_surf_addr (struct dmub_srv *dmub,const struct dc_plane_address *addr,uint8_t subvp_index); +/** +* dmub_srv_set_power_state() - Track DC power state in dmub_srv +* @dmub: The dmub service +* @power_state: DC power state setting +* +* Store DC power state in dmub_srv. If dmub_srv is in D3, then don't send messages to DMUB +* +* Return: +* void +*/ +void dmub_srv_set_power_state (struct dmub_srv *dmub,enum dmub_srv_power_state_type dmub_srv_power_state); +#if defined(__cplusplus) }#endif
drivers/gpu/drm/amd/display/dmub/src/dmub_srv.c +15 -0
@@ -713,6 +713,7 @@ enum dmub_status dmub_srv_hw_init(struct dmub_srv *dmub, dmub->hw_funcs.reset_release (dmub); dmub->hw_init = true; + dmub->power_state =DMUB_POWER_STATE_D0 ;return DMUB_STATUS_OK ; }
@@ -766,6 +767,9 @@ enum dmub_status dmub_srv_cmd_queue(struct dmub_srv *dmub,if (!dmub->hw_init)return DMUB_STATUS_INVALID ; +if (dmub->power_state !=DMUB_POWER_STATE_D0 ) +return DMUB_STATUS_INVALID ; +if (dmub->inbox1_rb.rptr > dmub->inbox1_rb.capacity || dmub->inbox1_rb.wrpt > dmub->inbox1_rb.capacity) {return DMUB_STATUS_HW_FAILURE ;
@@ -784,6 +788,9 @@ enum dmub_status dmub_srv_cmd_execute(struct dmub_srv *dmub)if (!dmub->hw_init)return DMUB_STATUS_INVALID ; +if (dmub->power_state !=DMUB_POWER_STATE_D0 ) +return DMUB_STATUS_INVALID ; +/** * Read back all the queued commands to ensure that they've * been flushed to framebuffer memory. Otherwise DMCUB might
@@ -1100,3 +1107,11 @@ void dmub_srv_subvp_save_surf_addr(struct dmub_srv *dmub, const struct dc_plane_ subvp_index); } } + +void dmub_srv_set_power_state (struct dmub_srv *dmub,enum dmub_srv_power_state_type dmub_srv_power_state) +{ +if (!dmub || !dmub->hw_init) +return ; + + dmub->power_state = dmub_srv_power_state; +}
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 290/346 drm/amd/display: Refactor DMCUB enter/exit idle interface
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Kazlauskas <[email protected]>
[ Upstream commit 8e57c06bf4b0f51a4d6958e15e1a99c9520d00fa ]
[Why]
We can hang in place trying to send commands when the DMCUB isn't powered on.
[How]
We need to exit out of the idle state prior to sending a command, but the process that performs the exit also invokes a command itself.
Fixing this issue involves the following:
1. Using a software state to track whether or not we need to start the process to exit idle or notify idle.
It's possible for the hardware to have exited an idle state without driver knowledge, but entering one is always restricted to a driver allow - which makes the SW state vs HW state mismatch issue purely one of optimization, which should seldomly be hit, if at all.
2. Refactor any instances of exit/notify idle to use a single wrapper that maintains this SW state.
This works simialr to dc_allow_idle_optimizations, but works at the DMCUB level and makes sure the state is marked prior to any notify/exit idle so we don't enter an infinite loop.
3. Make sure we exit out of idle prior to sending any commands or waiting for DMCUB idle.
This patch takes care of 1/2. A future patch will take care of wrapping DMCUB command submission with calls to this new interface.
Stable-dep-of: 8892780834ae ("drm/amd/display: Wake DMCUB before sending a command")
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 37 ++++++++++++++++++- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 6 ++- .../amd/display/dc/hwss/dcn35/dcn35_hwseq.c | 8 +--- 4 files changed, 43 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -2
@@ -2825,7 +2825,7 @@ static int dm_resume(void *handle)bool need_hotplug = false;if (dm->dc->caps.ips_support) { -dc_dmub_srv_exit_low_power_state (dm->dc); +dc_dmub_srv_apply_idle_power_optimizations (dm->dc, false); }if (amdgpu_in_reset (adev)) {
@@ -8771,7 +8771,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state)if (new_con_state->crtc && new_con_state->crtc->state->active &&drm_atomic_crtc_needs_modeset (new_con_state->crtc->state)) { -dc_dmub_srv_exit_low_power_state (dm->dc); +dc_dmub_srv_apply_idle_power_optimizations (dm->dc, false);break ; } }
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +35 -2
@@ -1143,6 +1143,9 @@ bool dc_dmub_srv_is_hw_pwr_up(struct dc_dmub_srv *dc_dmub_srv, bool wait)struct dc_context *dc_ctx = dc_dmub_srv->ctx;enum dmub_status status; +if (!dc_dmub_srv || !dc_dmub_srv->dmub) +return true; +if (dc_dmub_srv->ctx->dc->debug.dmcub_emulation)return true;
@@ -1158,7 +1161,7 @@ bool dc_dmub_srv_is_hw_pwr_up(struct dc_dmub_srv *dc_dmub_srv, bool wait)return true; } -void dc_dmub_srv_notify_idle (const struct dc *dc,bool allow_idle) +static void dc_dmub_srv_notify_idle (const struct dc *dc,bool allow_idle) {union dmub_rb_cmd cmd = {0 };
@@ -1182,7 +1185,7 @@ void dc_dmub_srv_notify_idle(const struct dc *dc, bool allow_idle)dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } -void dc_dmub_srv_exit_low_power_state (const struct dc *dc) +static void dc_dmub_srv_exit_low_power_state (const struct dc *dc) {const uint32_t max_num_polls =10000 ;uint32_t allow_state =0 ;
@@ -1195,6 +1198,9 @@ void dc_dmub_srv_exit_low_power_state(const struct dc *dc)if (!dc->idle_optimizations_allowed)return ; +if (!dc->ctx->dmub_srv || !dc->ctx->dmub_srv->dmub) +return ; +if (dc->hwss.get_idle_state && dc->hwss.set_idle_state && dc->clk_mgr->funcs->exit_low_power_state) {
@@ -1265,3 +1271,30 @@ void dc_dmub_srv_set_power_state(struct dc_dmub_srv *dc_dmub_srv, enum dc_acpi_celse dmub_srv_set_power_state (dmub,DMUB_POWER_STATE_D3 ); } + +void dc_dmub_srv_apply_idle_power_optimizations (const struct dc *dc,bool allow_idle) +{ +struct dc_dmub_srv *dc_dmub_srv = dc->ctx->dmub_srv; + +if (!dc_dmub_srv || !dc_dmub_srv->dmub) +return ; + +if (dc_dmub_srv->idle_allowed == allow_idle) +return ; + +/* +* Entering a low power state requires a driver notification. +* Powering up the hardware requires notifying PMFW and DMCUB. +* Clearing the driver idle allow requires a DMCUB command. +* DMCUB commands requires the DMCUB to be powered up and restored. +* +* Exit out early to prevent an infinite loop of DMCUB commands +* triggering exit low power - use software state to track this. +*/ + dc_dmub_srv->idle_allowed = allow_idle; + +if (!allow_idle) +dc_dmub_srv_exit_low_power_state (dc); +else +dc_dmub_srv_notify_idle (dc, allow_idle); +}
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +4 -2
@@ -50,6 +50,8 @@ struct dc_dmub_srv {struct dc_context *ctx;void *dm; + +bool idle_allowed; };void dc_dmub_srv_wait_idle (struct dc_dmub_srv *dc_dmub_srv);
@@ -100,8 +102,8 @@ void dc_dmub_srv_enable_dpia_trace(const struct dc *dc);void dc_dmub_srv_subvp_save_surf_addr (const struct dc_dmub_srv *dc_dmub_srv,const struct dc_plane_address *addr,uint8_t subvp_index);bool dc_dmub_srv_is_hw_pwr_up (struct dc_dmub_srv *dc_dmub_srv,bool wait); -void dc_dmub_srv_notify_idle (const struct dc *dc,bool allow_idle); -void dc_dmub_srv_exit_low_power_state (const struct dc *dc); + +void dc_dmub_srv_apply_idle_power_optimizations (const struct dc *dc,bool allow_idle);void dc_dmub_srv_set_power_state (struct dc_dmub_srv *dc_dmub_srv,enum dc_acpi_cm_power_state powerState);#endif /* _DMUB_DC_SRV_H_ */
drivers/gpu/drm/amd/display/dc/hwss/dcn35/dcn35_hwseq.c +2 -6
@@ -671,11 +671,7 @@ bool dcn35_apply_idle_power_optimizations(struct dc *dc, bool enable) }// TODO: review other cases when idle optimization is allowed - -if (!enable) -dc_dmub_srv_exit_low_power_state (dc); -else -dc_dmub_srv_notify_idle (dc, enable); +dc_dmub_srv_apply_idle_power_optimizations (dc, enable);return true; }
@@ -685,7 +681,7 @@ void dcn35_z10_restore(const struct dc *dc)if (dc->debug.disable_z10)return ; -dc_dmub_srv_exit_low_power_state (dc); +dc_dmub_srv_apply_idle_power_optimizations (dc, false);dcn31_z10_restore (dc); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 291/346 drm/amd/display: Wake DMCUB before sending a command
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Kazlauskas <[email protected]>
[ Upstream commit 8892780834ae294bc3697c7d0e056d7743900b39 ]
[Why]
We can hang in place trying to send commands when the DMCUB isn't powered on.
[How]
For functions that execute within a DC context or DC lock we can wrap the direct calls to dm_execute_dmub_cmd/list with code that exits idle power optimizations and reallows once we're done with the command submission on success.
For DM direct submissions the DM will need to manage the enter/exit sequencing manually.
We cannot invoke a DMCUB command directly within the DM execution helper or we can deadlock.
--- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 2 +- .../drm/amd/display/dc/bios/command_table2.c | 12 ++--- .../display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c | 2 +- .../dc/clk_mgr/dcn314/dcn314_clk_mgr.c | 2 +- .../dc/clk_mgr/dcn315/dcn315_clk_mgr.c | 2 +- .../dc/clk_mgr/dcn316/dcn316_clk_mgr.c | 2 +- .../display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c | 2 +- drivers/gpu/drm/amd/display/dc/core/dc.c | 12 ++--- .../drm/amd/display/dc/core/dc_hw_sequencer.c | 2 +- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 53 ++++++++++++++++--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 40 ++++++++++++++ drivers/gpu/drm/amd/display/dc/dc_helper.c | 6 +-- .../gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c | 14 ++--- .../drm/amd/display/dc/dce/dmub_hw_lock_mgr.c | 2 +- .../gpu/drm/amd/display/dc/dce/dmub_outbox.c | 2 +- drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 14 ++--- .../gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c | 2 +- .../display/dc/dcn31/dcn31_dio_link_encoder.c | 4 +- .../amd/display/dc/dcn31/dcn31_panel_cntl.c | 4 +- .../amd/display/dc/hwss/dcn21/dcn21_hwseq.c | 4 +- .../amd/display/dc/hwss/dcn30/dcn30_hwseq.c | 8 +-- .../amd/display/dc/hwss/dcn31/dcn31_hwseq.c | 4 +- .../amd/display/dc/hwss/dcn32/dcn32_hwseq.c | 6 +-- .../dc/link/protocols/link_dp_capability.c | 2 +- .../display/dc/link/protocols/link_dp_dpia.c | 3 +- 25 files changed, 143 insertions(+), 63 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +1 -1
@@ -10620,7 +10620,7 @@ static bool dm_edid_parser_send_cea(struct amdgpu_display_manager *dm, input->cea_total_length = total_length;memcpy (input->payload, data, length); - res =dm_execute_dmub_cmd (dm->dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ); + res =dc_wake_and_execute_dmub_cmd (dm->dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY );if (!res) {DRM_ERROR ("EDID CEA parser failed\n" );return false;
drivers/gpu/drm/amd/display/dc/bios/command_table2.c +6 -6
@@ -123,7 +123,7 @@ static void encoder_control_dmcub(sizeof (cmd.digx_encoder_control.header); cmd.digx_encoder_control.encoder_control.dig.stream_param = *dig; -dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result encoder_control_digx_v1_5(
@@ -259,7 +259,7 @@ static void transmitter_control_dmcub(sizeof (cmd.dig1_transmitter_control.header); cmd.dig1_transmitter_control.transmitter_control.dig = *dig; -dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result transmitter_control_v1_6(
@@ -321,7 +321,7 @@ static void transmitter_control_dmcub_v1_7(sizeof (cmd.dig1_transmitter_control.header); cmd.dig1_transmitter_control.transmitter_control.dig_v1_7 = *dig; -dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result transmitter_control_v1_7(
@@ -429,7 +429,7 @@ static void set_pixel_clock_dmcub(sizeof (cmd.set_pixel_clock.header); cmd.set_pixel_clock.pixel_clock.clk = *clk; -dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result set_pixel_clock_v7(
@@ -796,7 +796,7 @@ static void enable_disp_power_gating_dmcub(sizeof (cmd.enable_disp_power_gating.header); cmd.enable_disp_power_gating.power_gating.pwr = *pwr; -dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result enable_disp_power_gating_v2_1(
@@ -1006,7 +1006,7 @@ static void enable_lvtma_control_dmcub( pwrseq_instance; cmd.lvtma_control.data.bypass_panel_control_wait = bypass_panel_control_wait; -dm_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dmcub->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static enum bp_result enable_lvtma_control(
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn31/dcn31_clk_mgr.c +1 -1
@@ -253,7 +253,7 @@ void dcn31_update_clocks(struct clk_mgr *clk_mgr_base, cmd.notify_clocks.clocks.dispclk_khz = clk_mgr_base->clks.dispclk_khz; cmd.notify_clocks.clocks.dppclk_khz = clk_mgr_base->clks.dppclk_khz; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }static int get_vco_frequency_from_reg (struct clk_mgr_internal *clk_mgr)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn314/dcn314_clk_mgr.c +1 -1
@@ -281,7 +281,7 @@ void dcn314_update_clocks(struct clk_mgr *clk_mgr_base, cmd.notify_clocks.clocks.dispclk_khz = clk_mgr_base->clks.dispclk_khz; cmd.notify_clocks.clocks.dppclk_khz = clk_mgr_base->clks.dppclk_khz; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }static int get_vco_frequency_from_reg (struct clk_mgr_internal *clk_mgr)
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn315/dcn315_clk_mgr.c +1 -1
@@ -232,7 +232,7 @@ static void dcn315_update_clocks(struct clk_mgr *clk_mgr_base, cmd.notify_clocks.clocks.dispclk_khz = clk_mgr_base->clks.dispclk_khz; cmd.notify_clocks.clocks.dppclk_khz = clk_mgr_base->clks.dppclk_khz; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static void dcn315_dump_clk_registers(struct clk_state_registers_and_bypass *regs_and_bypass,
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn316/dcn316_clk_mgr.c +1 -1
@@ -239,7 +239,7 @@ static void dcn316_update_clocks(struct clk_mgr *clk_mgr_base, cmd.notify_clocks.clocks.dispclk_khz = clk_mgr_base->clks.dispclk_khz; cmd.notify_clocks.clocks.dppclk_khz = clk_mgr_base->clks.dppclk_khz; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } static void dcn316_dump_clk_registers(struct clk_state_registers_and_bypass *regs_and_bypass,
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +1 -1
@@ -349,7 +349,7 @@ void dcn35_update_clocks(struct clk_mgr *clk_mgr_base, cmd.notify_clocks.clocks.dispclk_khz = clk_mgr_base->clks.dispclk_khz; cmd.notify_clocks.clocks.dppclk_khz = clk_mgr_base->clks.dppclk_khz; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }static int get_vco_frequency_from_reg (struct clk_mgr_internal *clk_mgr)
drivers/gpu/drm/amd/display/dc/core/dc.c +6 -6
@@ -519,7 +519,7 @@ dc_stream_forward_dmub_crc_window(struct dc_dmub_srv *dmub_srv, cmd.secure_display.roi_info.y_end = rect->y + rect->height; } -dm_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); +dc_wake_and_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); } static inline void
@@ -3386,7 +3386,7 @@ void dc_dmub_update_dirty_rect(struct dc *dc, update_dirty_rect->panel_inst = panel_inst; update_dirty_rect->pipe_idx = j; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); } } }
@@ -5213,7 +5213,7 @@ bool dc_process_dmub_aux_transfer_async(struct dc *dc, ); } -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -5267,7 +5267,7 @@ bool dc_process_dmub_set_config_async(struct dc *dc, cmd.set_config_access.set_config_control.cmd_pkt.msg_type = payload->msg_type; cmd.set_config_access.set_config_control.cmd_pkt.msg_data = payload->msg_data; -if (!dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) { +if (!dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) {/* command is not processed by dmub */ notify->sc_status =SET_CONFIG_UNKNOWN_ERROR ;return is_cmd_complete;
@@ -5310,7 +5310,7 @@ enum dc_status dc_process_dmub_set_mst_slots(const struct dc *dc, cmd.set_mst_alloc_slots.mst_slots_control.instance = dc->links[link_index]->ddc_hw_inst; cmd.set_mst_alloc_slots.mst_slots_control.mst_alloc_slots = mst_alloc_slots; -if (!dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) +if (!dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ))/* command is not processed by dmub */ return DC_ERROR_UNEXPECTED ;
@@ -5348,7 +5348,7 @@ void dc_process_dmub_dpia_hpd_int_enable(const struct dc *dc, cmd.dpia_hpd_int_enable.header.type =DMUB_CMD__DPIA_HPD_INT_ENABLE ; cmd.dpia_hpd_int_enable.enable = hpd_int_enable; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );DC_LOG_DEBUG ("%s: hpd_int_enable(%d)\n" , __func__, hpd_int_enable); }
drivers/gpu/drm/amd/display/dc/core/dc_hw_sequencer.c +1 -1
@@ -724,7 +724,7 @@ void hwss_send_dmcub_cmd(union block_sequence_params *params)union dmub_rb_cmd *cmd = params->send_dmcub_cmd_params.cmd;enum dm_dmub_wait_type wait_type = params->send_dmcub_cmd_params.wait_type; -dm_execute_dmub_cmd (ctx, cmd, wait_type); +dc_wake_and_execute_dmub_cmd (ctx, cmd, wait_type); }void hwss_program_manual_trigger (union block_sequence_params *params)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +46 -7
104 lines not on this page · raw message
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +40 -0
@@ -106,4 +106,44 @@ bool dc_dmub_srv_is_hw_pwr_up(struct dc_dmub_srv *dc_dmub_srv, bool wait);void dc_dmub_srv_apply_idle_power_optimizations (const struct dc *dc,bool allow_idle);void dc_dmub_srv_set_power_state (struct dc_dmub_srv *dc_dmub_srv,enum dc_acpi_cm_power_state powerState); + +/** +* dc_wake_and_execute_dmub_cmd() - Wrapper for DMUB command execution. +* +* Refer to dc_wake_and_execute_dmub_cmd_list() for usage and limitations, +* This function is a convenience wrapper for a single command execution. +* +* @ctx: DC context +* @cmd: The command to send/receive +* @wait_type: The wait behavior for the execution +* +* Return: true on command submission success, false otherwise +*/ +bool dc_wake_and_execute_dmub_cmd (const struct dc_context *ctx,union dmub_rb_cmd *cmd, +enum dm_dmub_wait_type wait_type); + +/** +* dc_wake_and_execute_dmub_cmd_list() - Wrapper for DMUB command list execution. +* +* If the DMCUB hardware was asleep then it wakes the DMUB before +* executing the command and attempts to re-enter if the command +* submission was successful. +* +* This should be the preferred command submission interface provided +* the DC lock is acquired. +* +* Entry/exit out of idle power optimizations would need to be +* manually performed otherwise through dc_allow_idle_optimizations(). +* +* @ctx: DC context +* @count: Number of commands to send/receive +* @cmd: Array of commands to send +* @wait_type: The wait behavior for the execution +* +* Return: true on command submission success, false otherwise +*/ +bool dc_wake_and_execute_dmub_cmd_list (const struct dc_context *ctx,unsigned int count, +union dmub_rb_cmd *cmd,enum dm_dmub_wait_type wait_type); + +#endif /* _DMUB_DC_SRV_H_ */
drivers/gpu/drm/amd/display/dc/dc_helper.c +3 -3
@@ -50,7 +50,7 @@ static inline void submit_dmub_read_modify_write( cmd_buf->header.payload_bytes =sizeof (struct dmub_cmd_read_modify_write_sequence ) * offload->reg_seq_count; -dm_execute_dmub_cmd (ctx, &offload->cmd_data,DM_DMUB_WAIT_TYPE_NO_WAIT ); +dc_wake_and_execute_dmub_cmd (ctx, &offload->cmd_data,DM_DMUB_WAIT_TYPE_NO_WAIT );memset (cmd_buf,0 ,sizeof (*cmd_buf));
@@ -67,7 +67,7 @@ static inline void submit_dmub_burst_write( cmd_buf->header.payload_bytes =sizeof (uint32_t ) * offload->reg_seq_count; -dm_execute_dmub_cmd (ctx, &offload->cmd_data,DM_DMUB_WAIT_TYPE_NO_WAIT ); +dc_wake_and_execute_dmub_cmd (ctx, &offload->cmd_data,DM_DMUB_WAIT_TYPE_NO_WAIT );memset (cmd_buf,0 ,sizeof (*cmd_buf));
@@ -80,7 +80,7 @@ static inline void submit_dmub_reg_wait( {struct dmub_rb_cmd_reg_wait *cmd_buf = &offload->cmd_data.reg_wait; -dm_execute_dmub_cmd (ctx, &offload->cmd_data,DM_DMUB_WAIT_TYPE_NO_WAIT ); +dc_wake_and_execute_dmub_cmd (ctx, &offload->cmd_data,DM_DMUB_WAIT_TYPE_NO_WAIT );memset (cmd_buf,0 ,sizeof (*cmd_buf)); offload->reg_seq_count =0 ;
drivers/gpu/drm/amd/display/dc/dce/dmub_abm_lcd.c +7 -7
@@ -76,7 +76,7 @@ static void dmub_abm_enable_fractional_pwm(struct dc_context *dc) cmd.abm_set_pwm_frac.abm_set_pwm_frac_data.panel_mask = panel_mask; cmd.abm_set_pwm_frac.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_pwm_frac_data ); -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }void dmub_abm_init (struct abm *abm,uint32_t backlight)
@@ -155,7 +155,7 @@ bool dmub_abm_set_level(struct abm *abm, uint32_t level, uint8_t panel_mask) cmd.abm_set_level.abm_set_level_data.panel_mask = panel_mask; cmd.abm_set_level.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_level_data ); -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -186,7 +186,7 @@ void dmub_abm_init_config(struct abm *abm, cmd.abm_init_config.header.payload_bytes =sizeof (struct dmub_cmd_abm_init_config_data ); -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }
@@ -203,7 +203,7 @@ bool dmub_abm_set_pause(struct abm *abm, bool pause, unsigned int panel_inst, un cmd.abm_pause.abm_pause_data.panel_mask = panel_mask; cmd.abm_set_level.header.payload_bytes =sizeof (struct dmub_cmd_abm_pause_data ); -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -246,7 +246,7 @@ bool dmub_abm_save_restore( cmd.abm_save_restore.header.payload_bytes =sizeof (struct dmub_rb_cmd_abm_save_restore ); -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );// Copy iramtable data into local structure memcpy ((void *)pData, dc->dmub_srv->dmub->scratch_mem_fb.cpu_addr, bytes);
@@ -274,7 +274,7 @@ bool dmub_abm_set_pipe(struct abm *abm, cmd.abm_set_pipe.abm_set_pipe_data.ramping_boundary = ramping_boundary; cmd.abm_set_pipe.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_pipe_data ); -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -296,7 +296,7 @@ bool dmub_abm_set_backlight_level(struct abm *abm, cmd.abm_set_backlight.abm_set_backlight_data.panel_mask = (0x01 << panel_inst); cmd.abm_set_backlight.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_backlight_data ); -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
drivers/gpu/drm/amd/display/dc/dce/dmub_hw_lock_mgr.c +1 -1
@@ -47,7 +47,7 @@ void dmub_hw_lock_mgr_cmd(struct dc_dmub_srv *dmub_srv,if (!lock) cmd.lock_hw.lock_hw_data.should_release =1 ; -dm_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); } void dmub_hw_lock_mgr_inbox0_cmd(struct dc_dmub_srv *dmub_srv,
drivers/gpu/drm/amd/display/dc/dce/dmub_outbox.c +1 -1
@@ -48,5 +48,5 @@ void dmub_enable_outbox_notification(struct dc_dmub_srv *dmub_srv)sizeof (cmd.outbox1_enable.header); cmd.outbox1_enable.enable = true; -dm_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +7 -7
@@ -171,7 +171,7 @@ static bool dmub_psr_set_version(struct dmub_psr *dmub, struct dc_stream_state * cmd.psr_set_version.psr_set_version_data.panel_inst = panel_inst; cmd.psr_set_version.header.payload_bytes =sizeof (struct dmub_cmd_psr_set_version_data ); -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -199,7 +199,7 @@ static void dmub_psr_enable(struct dmub_psr *dmub, bool enable, bool wait, uint8 cmd.psr_enable.header.payload_bytes =0 ;// Send header only -dm_execute_dmub_cmd (dc->dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );/* Below loops 1000 x 500us = 500 ms. * Exit PSR may need to wait 1-2 frames to power up. Timeout after at
@@ -248,7 +248,7 @@ static void dmub_psr_set_level(struct dmub_psr *dmub, uint16_t psr_level, uint8_ cmd.psr_set_level.psr_set_level_data.psr_level = psr_level; cmd.psr_set_level.psr_set_level_data.cmd_version =DMUB_CMD_PSR_CONTROL_VERSION_1 ; cmd.psr_set_level.psr_set_level_data.panel_inst = panel_inst; -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }/*
@@ -267,7 +267,7 @@ static void dmub_psr_set_sink_vtotal_in_psr_active(struct dmub_psr *dmub, cmd.psr_set_vtotal.psr_set_vtotal_data.psr_vtotal_idle = psr_vtotal_idle; cmd.psr_set_vtotal.psr_set_vtotal_data.psr_vtotal_su = psr_vtotal_su; -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }/*
@@ -286,7 +286,7 @@ static void dmub_psr_set_power_opt(struct dmub_psr *dmub, unsigned int power_opt cmd.psr_set_power_opt.psr_set_power_opt_data.power_opt = power_opt; cmd.psr_set_power_opt.psr_set_power_opt_data.panel_inst = panel_inst; -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }/*
@@ -423,7 +423,7 @@ static bool dmub_psr_copy_settings(struct dmub_psr *dmub, copy_settings_data->relock_delay_frame_cnt =2 ; copy_settings_data->dsc_slice_height = psr_context->dsc_slice_height; -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -444,7 +444,7 @@ static void dmub_psr_force_static(struct dmub_psr *dmub, uint8_t panel_inst) cmd.psr_force_static.header.sub_type =DMUB_CMD__PSR_FORCE_STATIC ; cmd.psr_enable.header.payload_bytes =0 ; -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }/*
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubp.c +1 -1
@@ -691,7 +691,7 @@ static void dmcub_PLAT_54186_wa(struct hubp *hubp, cmd.PLAT_54186_wa.flip.flip_params.vmid = flip_regs->vmid;PERF_TRACE ();// TODO: remove after performance is stable. -dm_execute_dmub_cmd (hubp->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (hubp->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );PERF_TRACE ();// TODO: remove after performance is stable. }
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.c +2 -2
@@ -125,7 +125,7 @@ static bool query_dp_alt_from_dmub(struct link_encoder *enc, cmd->query_dp_alt.header.payload_bytes =sizeof (cmd->query_dp_alt.data); cmd->query_dp_alt.data.phy_id =phy_id_from_transmitter (enc10->base.transmitter); -if (!dm_execute_dmub_cmd (enc->ctx, cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) +if (!dc_wake_and_execute_dmub_cmd (enc->ctx, cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ))return false;return true;
@@ -436,7 +436,7 @@ static bool link_dpia_control(struct dc_context *dc_ctx, cmd.dig1_dpia_control.dpia_control = *dpia_control; -dm_execute_dmub_cmd (dc_ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc_ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_panel_cntl.c +2 -2
@@ -52,7 +52,7 @@ static bool dcn31_query_backlight_info(struct panel_cntl *panel_cntl, union dmub cmd->panel_cntl.header.payload_bytes =sizeof (cmd->panel_cntl.data); cmd->panel_cntl.data.pwrseq_inst = dcn31_panel_cntl->base.pwrseq_inst; -return dm_execute_dmub_cmd (dc_dmub_srv->ctx, cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ); +return dc_wake_and_execute_dmub_cmd (dc_dmub_srv->ctx, cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ); }static uint32_t dcn31_get_16_bit_backlight_from_pwm (struct panel_cntl *panel_cntl)
@@ -85,7 +85,7 @@ static uint32_t dcn31_panel_cntl_hw_init(struct panel_cntl *panel_cntl) panel_cntl->stored_backlight_registers.LVTMA_PWRSEQ_REF_DIV_BL_PWM_REF_DIV; cmd.panel_cntl.data.bl_pwm_ref_div2 = panel_cntl->stored_backlight_registers.PANEL_PWRSEQ_REF_DIV2; -if (!dm_execute_dmub_cmd (dc_dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) +if (!dc_wake_and_execute_dmub_cmd (dc_dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ))return 0 ; panel_cntl->stored_backlight_registers.BL_PWM_CNTL = cmd.panel_cntl.data.bl_pwm_cntl;
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c +2 -2
@@ -154,7 +154,7 @@ static bool dmub_abm_set_pipe(struct abm *abm, uint32_t otg_inst, cmd.abm_set_pipe.abm_set_pipe_data.ramping_boundary = ramping_boundary; cmd.abm_set_pipe.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_pipe_data ); -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
@@ -173,7 +173,7 @@ static void dmub_abm_set_backlight(struct dc_context *dc, uint32_t backlight_pwm cmd.abm_set_backlight.abm_set_backlight_data.panel_mask = (0x01 << panel_inst); cmd.abm_set_backlight.header.payload_bytes =sizeof (struct dmub_cmd_abm_set_backlight_data ); -dm_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }void dcn21_set_abm_immediate_disable (struct pipe_ctx *pipe_ctx)
drivers/gpu/drm/amd/display/dc/hwss/dcn30/dcn30_hwseq.c +4 -4
@@ -750,7 +750,7 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.mall.header.sub_type =DMUB_CMD__MALL_ACTION_NO_DF_REQ ; cmd.mall.header.payload_bytes =sizeof (cmd.mall) -sizeof (cmd.mall.header); -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT );return true; }
@@ -872,7 +872,7 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.mall.cursor_height = cursor_attr.height; cmd.mall.cursor_pitch = cursor_attr.pitch; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );/* Use copied cursor, and it's okay to not switch back */ cursor_attr.address.quad_part = cmd.mall.cursor_copy_dst.quad_part;
@@ -888,7 +888,7 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.mall.tmr_scale = tmr_scale; cmd.mall.debug_bits = dc->debug.mall_error_as_fatal; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT );return true; }
@@ -905,7 +905,7 @@ bool dcn30_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.mall.header.payload_bytes =sizeof (cmd.mall) -sizeof (cmd.mall.header); -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
drivers/gpu/drm/amd/display/dc/hwss/dcn31/dcn31_hwseq.c +2 -2
@@ -415,7 +415,7 @@ void dcn31_z10_save_init(struct dc *dc) cmd.dcn_restore.header.type =DMUB_CMD__IDLE_OPT ; cmd.dcn_restore.header.sub_type =DMUB_CMD__IDLE_OPT_DCN_SAVE_INIT ; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }void dcn31_z10_restore (const struct dc *dc)
@@ -433,7 +433,7 @@ void dcn31_z10_restore(const struct dc *dc) cmd.dcn_restore.header.type =DMUB_CMD__IDLE_OPT ; cmd.dcn_restore.header.sub_type =DMUB_CMD__IDLE_OPT_DCN_RESTORE ; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); }void dcn31_hubp_pg_control (struct dce_hwseq *hws,unsigned int hubp_inst,bool power_on)
drivers/gpu/drm/amd/display/dc/hwss/dcn32/dcn32_hwseq.c +3 -3
@@ -277,7 +277,7 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.cab.header.sub_type =DMUB_CMD__CAB_NO_DCN_REQ ; cmd.cab.header.payload_bytes =sizeof (cmd.cab) -sizeof (cmd.cab.header); -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT );return true; }
@@ -311,7 +311,7 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.cab.header.payload_bytes =sizeof (cmd.cab) -sizeof (cmd.cab.header); cmd.cab.cab_alloc_ways = (uint8_t )ways; -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_NO_WAIT );return true; }
@@ -327,7 +327,7 @@ bool dcn32_apply_idle_power_optimizations(struct dc *dc, bool enable) cmd.cab.header.payload_bytes =sizeof (cmd.cab) -sizeof (cmd.cab.header); -dm_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT ); +dc_wake_and_execute_dmub_cmd (dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT );return true; }
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_capability.c +1 -1
@@ -1392,7 +1392,7 @@ static bool get_usbc_cable_id(struct dc_link *link, union dp_cable_id *cable_id) cmd.cable_id.header.payload_bytes =sizeof (cmd.cable_id.data); cmd.cable_id.data.input.phy_inst =resource_transmitter_to_phy_idx ( link->dc, link->link_enc->transmitter); -if (dm_execute_dmub_cmd (link->dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ) && +if (dc_wake_and_execute_dmub_cmd (link->dc->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ) && cmd.cable_id.header.ret_status ==1 ) { cable_id->raw = cmd.cable_id.data.output_raw;DC_LOG_DC ("usbc_cable_id = %d.\n" , cable_id->raw);
drivers/gpu/drm/amd/display/dc/link/protocols/link_dp_dpia.c +2 -1
@@ -90,7 +90,8 @@ bool dpia_query_hpd_status(struct dc_link *link) cmd.query_hpd.data.ch_type =AUX_CHANNEL_DPIA ;/* Return HPD status reported by DMUB if query successfully executed. */ -if (dm_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ) && cmd.query_hpd.data.status ==AUX_RET_SUCCESS ) +if (dc_wake_and_execute_dmub_cmd (dmub_srv->ctx, &cmd,DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ) && + cmd.query_hpd.data.status ==AUX_RET_SUCCESS ) is_hpd_high = cmd.query_hpd.data.result; DC_LOG_DEBUG("%s: link(%d) dpia(%d) cmd_status(%d) result(%d)\n",
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 292/346 drm/amd/display: Wake DMCUB before executing GPINT commands
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Kazlauskas <[email protected]>
[ Upstream commit e5ffd1263dd5b44929c676171802e7b6af483f21 ]
[Why]
DMCUB can be in idle when we attempt to interface with the HW through the GPINT mailbox resulting in a system hang.
[How]
Add dc_wake_and_execute_gpint() to wrap the wake, execute, sleep sequence.
If the GPINT executes successfully then DMCUB will be put back into sleep after the optional response is returned.
It functions similar to the inbox command interface.
--- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c | 72 ++++++++++++++----- drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h | 11 +++ drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c | 19 ++--- 3 files changed, 72 insertions(+), 30 deletions(-)
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.c +55 -17
@@ -282,17 +282,11 @@ bool dc_dmub_srv_optimized_init_done(struct dc_dmub_srv *dc_dmub_srv)bool dc_dmub_srv_notify_stream_mask (struct dc_dmub_srv *dc_dmub_srv,unsigned int stream_mask) { -struct dmub_srv *dmub; -const uint32_t timeout =30 ; -if (!dc_dmub_srv || !dc_dmub_srv->dmub)return false; - dmub = dc_dmub_srv->dmub; - -return dmub_srv_send_gpint_command ( - dmub,DMUB_GPINT__IDLE_OPT_NOTIFY_STREAM_MASK , - stream_mask, timeout) ==DMUB_STATUS_OK ; +return dc_wake_and_execute_gpint (dc_dmub_srv->ctx,DMUB_GPINT__IDLE_OPT_NOTIFY_STREAM_MASK , + stream_mask,NULL ,DM_DMUB_WAIT_TYPE_WAIT ); }bool dc_dmub_srv_is_restore_required (struct dc_dmub_srv *dc_dmub_srv)
@@ -1107,25 +1101,20 @@ bool dc_dmub_check_min_version(struct dmub_srv *srv)void dc_dmub_srv_enable_dpia_trace (const struct dc *dc) {struct dc_dmub_srv *dc_dmub_srv = dc->ctx->dmub_srv; -struct dmub_srv *dmub; -enum dmub_status status; -static const uint32_t timeout_us =30 ;if (!dc_dmub_srv || !dc_dmub_srv->dmub) {DC_LOG_ERROR ("%s: invalid parameters." , __func__);return ; } - dmub = dc_dmub_srv->dmub; - - status =dmub_srv_send_gpint_command (dmub,DMUB_GPINT__SET_TRACE_BUFFER_MASK_WORD1 ,0x0010 , timeout_us); -if (status !=DMUB_STATUS_OK ) { +if (!dc_wake_and_execute_gpint (dc->ctx,DMUB_GPINT__SET_TRACE_BUFFER_MASK_WORD1 , +0x0010 ,NULL ,DM_DMUB_WAIT_TYPE_WAIT )) {DC_LOG_ERROR ("timeout updating trace buffer mask word\n" );return ; } - status =dmub_srv_send_gpint_command (dmub,DMUB_GPINT__UPDATE_TRACE_BUFFER_MASK ,0x0000 , timeout_us); -if (status !=DMUB_STATUS_OK ) { +if (!dc_wake_and_execute_gpint (dc->ctx,DMUB_GPINT__UPDATE_TRACE_BUFFER_MASK , +0x0000 ,NULL ,DM_DMUB_WAIT_TYPE_WAIT )) {DC_LOG_ERROR ("timeout updating trace buffer mask word\n" );return ; }
@@ -1337,3 +1326,52 @@ bool dc_wake_and_execute_dmub_cmd_list(const struct dc_context *ctx, unsigned inreturn result; } + +static bool dc_dmub_execute_gpint (const struct dc_context *ctx,enum dmub_gpint_command command_code, +uint16_t param,uint32_t *response,enum dm_dmub_wait_type wait_type) +{ +struct dc_dmub_srv *dc_dmub_srv = ctx->dmub_srv; +const uint32_t wait_us = wait_type ==DM_DMUB_WAIT_TYPE_NO_WAIT ?0 :30 ; +enum dmub_status status; + +if (response) + *response =0 ; + +if (!dc_dmub_srv || !dc_dmub_srv->dmub) +return false; + + status =dmub_srv_send_gpint_command (dc_dmub_srv->dmub, command_code, param, wait_us); +if (status !=DMUB_STATUS_OK ) { +if (status ==DMUB_STATUS_TIMEOUT && wait_type ==DM_DMUB_WAIT_TYPE_NO_WAIT ) +return true; + +return false; + } + +if (response && wait_type ==DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ) +dmub_srv_get_gpint_response (dc_dmub_srv->dmub, response); + +return true; +} + +bool dc_wake_and_execute_gpint (const struct dc_context *ctx,enum dmub_gpint_command command_code, +uint16_t param,uint32_t *response,enum dm_dmub_wait_type wait_type) +{ +struct dc_dmub_srv *dc_dmub_srv = ctx->dmub_srv; +bool result = false, reallow_idle = false; + +if (!dc_dmub_srv || !dc_dmub_srv->dmub) +return false; + +if (dc_dmub_srv->idle_allowed) { +dc_dmub_srv_apply_idle_power_optimizations (ctx->dc, false); + reallow_idle = true; + } + + result =dc_dmub_execute_gpint (ctx, command_code, param, response, wait_type); + +if (result && reallow_idle) +dc_dmub_srv_apply_idle_power_optimizations (ctx->dc, true); + +return result; +}
drivers/gpu/drm/amd/display/dc/dc_dmub_srv.h +11 -0
@@ -145,5 +145,16 @@ bool dc_wake_and_execute_dmub_cmd(const struct dc_context *ctx, union dmub_rb_cmbool dc_wake_and_execute_dmub_cmd_list (const struct dc_context *ctx,unsigned int count,union dmub_rb_cmd *cmd,enum dm_dmub_wait_type wait_type); +/** +* dc_wake_and_execute_gpint() +* +* @ctx: DC context +* @command_code: The command ID to send to DMCUB +* @param: The parameter to message DMCUB +* @response: Optional response out value - may be NULL. +* @wait_type: The wait behavior for the execution +*/ +bool dc_wake_and_execute_gpint (const struct dc_context *ctx,enum dmub_gpint_command command_code, +uint16_t param,uint32_t *response,enum dm_dmub_wait_type wait_type);#endif /* _DMUB_DC_SRV_H_ */
drivers/gpu/drm/amd/display/dc/dce/dmub_psr.c +6 -13
@@ -105,23 +105,18 @@ static enum dc_psr_state convert_psr_state(uint32_t raw_state)*/ static void dmub_psr_get_state (struct dmub_psr *dmub,enum dc_psr_state *state,uint8_t panel_inst) { -struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;uint32_t raw_state =0 ;uint32_t retry_count =0 ; -enum dmub_status status;do {// Send gpint command and wait for ack - status =dmub_srv_send_gpint_command (srv,DMUB_GPINT__GET_PSR_STATE , panel_inst,30 ); - -if (status ==DMUB_STATUS_OK ) { -// GPINT was executed, get response -dmub_srv_get_gpint_response (srv, &raw_state); +if (dc_wake_and_execute_gpint (dmub->ctx,DMUB_GPINT__GET_PSR_STATE , panel_inst, &raw_state, +DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY )) { *state =convert_psr_state (raw_state); - }else + }else {// Return invalid state when GPINT times out *state =PSR_STATE_INVALID ; - + } }while (++retry_count <=1000 && *state ==PSR_STATE_INVALID );// Assert if max retry hit
@@ -452,13 +447,11 @@ static void dmub_psr_force_static(struct dmub_psr *dmub, uint8_t panel_inst)*/ static void dmub_psr_get_residency (struct dmub_psr *dmub,uint32_t *residency,uint8_t panel_inst) { -struct dmub_srv *srv = dmub->ctx->dmub_srv->dmub;uint16_t param = (uint16_t )(panel_inst <<8 );/* Send gpint command and wait for ack */ -dmub_srv_send_gpint_command (srv,DMUB_GPINT__PSR_RESIDENCY , param,30 ); - -dmub_srv_get_gpint_response (srv, residency); +dc_wake_and_execute_gpint (dmub->ctx,DMUB_GPINT__PSR_RESIDENCY , param, residency, +DM_DMUB_WAIT_TYPE_WAIT_WITH_REPLY ); }static const struct dmub_psr_funcs psr_funcs = {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 293/346 drm/amd/display: Fix conversions between bytes and KB
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Taimur Hassan <[email protected]>
[ Upstream commit 22136ff27c4e01fae81f6588033363a46c72ed8c ]
[Why]
There are a number of instances where we convert HostVMMinPageSize or GPUVMMinPageSize from bytes to KB by dividing (rather than multiplying) and vice versa.
Additionally, in some cases, a parameter is passed through DML in KB but later checked as if it were in bytes.
--- .../drm/amd/display/dc/dml2/display_mode_core.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/gpu/drm/amd/display/dc/dml2/display_mode_core.c +8 -8
@@ -6329,7 +6329,7 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib) mode_lib->ms.NoOfDPPThisState, mode_lib->ms.dpte_group_bytes, s->HostVMInefficiencyFactor, - mode_lib->ms.soc.hostvm_min_page_size_kbytes, + mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 , mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels); s->NextMaxVStartup = s->MaxVStartupAllPlanes[j];
@@ -6542,7 +6542,7 @@ static void dml_prefetch_check(struct display_mode_lib_st *mode_lib) mode_lib->ms.cache_display_cfg.plane.HostVMEnable, mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels, mode_lib->ms.cache_display_cfg.plane.GPUVMEnable, - mode_lib->ms.soc.hostvm_min_page_size_kbytes, + mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 , mode_lib->ms.PDEAndMetaPTEBytesPerFrame[j][k], mode_lib->ms.MetaRowBytes[j][k], mode_lib->ms.DPTEBytesPerRow[j][k],
@@ -7687,7 +7687,7 @@ dml_bool_t dml_core_mode_support(struct display_mode_lib_st *mode_lib) CalculateVMRowAndSwath_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels; CalculateVMRowAndSwath_params->GPUVMMaxPageTableLevels = mode_lib->ms.cache_display_cfg.plane.GPUVMMaxPageTableLevels; CalculateVMRowAndSwath_params->GPUVMMinPageSizeKBytes = mode_lib->ms.cache_display_cfg.plane.GPUVMMinPageSizeKBytes; - CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes; + CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 ; CalculateVMRowAndSwath_params->PTEBufferModeOverrideEn = mode_lib->ms.cache_display_cfg.plane.PTEBufferModeOverrideEn; CalculateVMRowAndSwath_params->PTEBufferModeOverrideVal = mode_lib->ms.cache_display_cfg.plane.PTEBufferMode; CalculateVMRowAndSwath_params->PTEBufferSizeNotExceeded = mode_lib->ms.PTEBufferSizeNotExceededPerState;
@@ -7957,7 +7957,7 @@ dml_bool_t dml_core_mode_support(struct display_mode_lib_st *mode_lib) UseMinimumDCFCLK_params->GPUVMMaxPageTableLevels = mode_lib->ms.cache_display_cfg.plane.GPUVMMaxPageTableLevels; UseMinimumDCFCLK_params->HostVMEnable = mode_lib->ms.cache_display_cfg.plane.HostVMEnable; UseMinimumDCFCLK_params->NumberOfActiveSurfaces = mode_lib->ms.num_active_planes; - UseMinimumDCFCLK_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes; + UseMinimumDCFCLK_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 ; UseMinimumDCFCLK_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels; UseMinimumDCFCLK_params->DynamicMetadataVMEnabled = mode_lib->ms.ip.dynamic_metadata_vm_enabled; UseMinimumDCFCLK_params->ImmediateFlipRequirement = s->ImmediateFlipRequiredFinal;
@@ -8699,7 +8699,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc CalculateVMRowAndSwath_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels; CalculateVMRowAndSwath_params->GPUVMMaxPageTableLevels = mode_lib->ms.cache_display_cfg.plane.GPUVMMaxPageTableLevels; CalculateVMRowAndSwath_params->GPUVMMinPageSizeKBytes = mode_lib->ms.cache_display_cfg.plane.GPUVMMinPageSizeKBytes; - CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes; + CalculateVMRowAndSwath_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 ; CalculateVMRowAndSwath_params->PTEBufferModeOverrideEn = mode_lib->ms.cache_display_cfg.plane.PTEBufferModeOverrideEn; CalculateVMRowAndSwath_params->PTEBufferModeOverrideVal = mode_lib->ms.cache_display_cfg.plane.PTEBufferMode; CalculateVMRowAndSwath_params->PTEBufferSizeNotExceeded = s->dummy_boolean_array[0 ];
@@ -8805,7 +8805,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc mode_lib->ms.cache_display_cfg.hw.DPPPerSurface, locals->dpte_group_bytes, s->HostVMInefficiencyFactor, - mode_lib->ms.soc.hostvm_min_page_size_kbytes, + mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 , mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels); locals->TCalc =24.0 / locals->DCFCLKDeepSleep;
@@ -8995,7 +8995,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc CalculatePrefetchSchedule_params->GPUVMEnable = mode_lib->ms.cache_display_cfg.plane.GPUVMEnable; CalculatePrefetchSchedule_params->HostVMEnable = mode_lib->ms.cache_display_cfg.plane.HostVMEnable; CalculatePrefetchSchedule_params->HostVMMaxNonCachedPageTableLevels = mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels; - CalculatePrefetchSchedule_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes; + CalculatePrefetchSchedule_params->HostVMMinPageSize = mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 ; CalculatePrefetchSchedule_params->DynamicMetadataEnable = mode_lib->ms.cache_display_cfg.plane.DynamicMetadataEnable[k]; CalculatePrefetchSchedule_params->DynamicMetadataVMEnabled = mode_lib->ms.ip.dynamic_metadata_vm_enabled; CalculatePrefetchSchedule_params->DynamicMetadataLinesBeforeActiveRequired = mode_lib->ms.cache_display_cfg.plane.DynamicMetadataLinesBeforeActiveRequired[k];
@@ -9240,7 +9240,7 @@ void dml_core_mode_programming(struct display_mode_lib_st *mode_lib, const struc mode_lib->ms.cache_display_cfg.plane.HostVMEnable, mode_lib->ms.cache_display_cfg.plane.HostVMMaxPageTableLevels, mode_lib->ms.cache_display_cfg.plane.GPUVMEnable, - mode_lib->ms.soc.hostvm_min_page_size_kbytes, + mode_lib->ms.soc.hostvm_min_page_size_kbytes *1024 , locals->PDEAndMetaPTEBytesFrame[k], locals->MetaRowByte[k], locals->PixelPTEBytesPerRow[k],
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 294/346 drm/panel-edp: Add AUO B116XTN02, BOE NT116WHM-N21,836X2, NV116WHM-N49 V8.0
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sheng-Liang Pan <[email protected]>
[ Upstream commit 3db2420422a5912d97966e0176050bb0fc9aa63e ]
Add panel identification entry for
- AUO B116XTN02 family (product ID:0x235c)
- BOE NT116WHM-N21,836X2 (product ID:0x09c3)
- BOE NV116WHM-N49 V8.0 (product ID:0x0979)
Stable-dep-of: fc6e76792965 ("drm/panel-edp: drm/panel-edp: Fix AUO B116XAK01 name and timing")
--- drivers/gpu/drm/panel/panel-edp.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/panel/panel-edp.c +3 -0
@@ -1840,6 +1840,7 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x145c , &delay_200_500_e50,"B116XAB01.4" ),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' ,0x235c , &delay_200_500_e50,"B116XTN02" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x582d , &delay_200_500_e50,"B133UAN01.0" ), EDP_PANEL_ENTRY('A', 'U', 'O', 0x615c, &delay_200_500_e50, "B116XAN06.1"),
@@ -1848,8 +1849,10 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0786 , &delay_200_500_p2e80,"NV116WHM-T01" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x07d1 , &boe_nv133fhm_n61.delay,"NV133FHM-N61" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x082d , &boe_nv133fhm_n61.delay,"NV133FHM-N62" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x09c3 , &delay_200_500_e50,"NT116WHM-N21,836X2" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x094b , &delay_200_500_e50,"NT116WHM-N21" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x095f , &delay_200_500_e50,"NE135FBM-N41 v8.1" ), +EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x0979 , &delay_200_500_e50,"NV116WHM-N49 V8.0" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x098d , &boe_nv110wtm_n61.delay,"NV110WTM-N61" ),EDP_PANEL_ENTRY ('B' ,'O' ,'E' ,0x09dd , &delay_200_500_e50,"NT116WHM-N21" ), EDP_PANEL_ENTRY('B', 'O', 'E', 0x0a5d, &delay_200_500_e50, "NV116WHM-N45"),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 295/346 drm/panel-edp: drm/panel-edp: Fix AUO B116XAK01 name and timing
In reply to Greg Kroah-Hartman6.7-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
@@ -973,6 +973,8 @@ static const struct panel_desc auo_b116xak01 = { }, .delay = { .hpd_absent = 200, + .unprepare = 500, + .enable = 50, }, };
@@ -1841,7 +1843,7 @@ static const struct edp_panel_entry edp_panels[] = {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' ,0x235c , &delay_200_500_e50,"B116XTN02" ), -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' ,0x582d , &delay_200_500_e50,"B133UAN01.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 296/346 drm/panel-edp: drm/panel-edp: Fix AUO B116XTN02 name
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hsin-Yi Wang <[email protected]>
[ Upstream commit 962845c090c4f85fa4f6872a5b6c89ee61f53cc0 ]
Rename AUO 0x235c B116XTN02 to B116XTN02.3 according to decoding edid.
--- drivers/gpu/drm/panel/panel-edp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-edp.c +1 -1
@@ -1842,7 +1842,7 @@ static const struct edp_panel_entry edp_panels[] = {EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x145c , &delay_200_500_e50,"B116XAB01.4" ),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' ,0x235c , &delay_200_500_e50,"B116XTN02" ), +EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x235c , &delay_200_500_e50,"B116XTN02.3" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x405c , &auo_b116xak01.delay,"B116XAK01.0" ),EDP_PANEL_ENTRY ('A' ,'U' ,'O' ,0x582d , &delay_200_500_e50,"B133UAN01.0" ), EDP_PANEL_ENTRY('A', 'U', 'O', 0x615c, &delay_200_500_e50, "B116XAN06.1"),
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 297/346 drm/amd/display: Fix hang/underflow when transitioning to ODM4:1
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Bakoulin <[email protected]>
[ Upstream commit e7b2b108cdeab76a7e7324459e50b0c1214c0386 ]
[Why]
Under some circumstances, disabling an OPTC and attempting to reclaim its OPP(s) for a different OPTC could cause a hang/underflow due to OPPs not being properly disconnected from the disabled OPTC.
[How]
Ensure that all OPPs are unassigned from an OPTC when it gets disabled.
Stable-dep-of: 3ba2a0bfd8cf ("drm/amd/display: Clear OPTC mem select on disable")
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_optc.c | 7 +++++++ drivers/gpu/drm/amd/display/dc/dcn35/dcn35_optc.c | 7 +++++++ 2 files changed, 14 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_optc.c +7 -0
@@ -172,6 +172,13 @@ static bool optc32_disable_crtc(struct timing_generator *optc)REG_UPDATE (OTG_CONTROL ,OTG_MASTER_EN ,0 ); +REG_UPDATE_5 (OPTC_DATA_SOURCE_SELECT , +OPTC_SEG0_SRC_SEL ,0xf , +OPTC_SEG1_SRC_SEL ,0xf , +OPTC_SEG2_SRC_SEL ,0xf , +OPTC_SEG3_SRC_SEL ,0xf , +OPTC_NUM_OF_INPUT_SEGMENT ,0 ); +REG_UPDATE (CONTROL ,VTG0_ENABLE ,0 );
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_optc.c +7 -0
@@ -144,6 +144,13 @@ static bool optc35_disable_crtc(struct timing_generator *optc)REG_UPDATE (OTG_CONTROL ,OTG_MASTER_EN ,0 ); +REG_UPDATE_5 (OPTC_DATA_SOURCE_SELECT , +OPTC_SEG0_SRC_SEL ,0xf , +OPTC_SEG1_SRC_SEL ,0xf , +OPTC_SEG2_SRC_SEL ,0xf , +OPTC_SEG3_SRC_SEL ,0xf , +OPTC_NUM_OF_INPUT_SEGMENT ,0 ); +REG_UPDATE (CONTROL ,VTG0_ENABLE ,0 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 298/346 drm/amd/display: Disconnect phantom pipe OPP from OPTC being disabled
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: George Shen <[email protected]>
[ Upstream commit 7bdbfb4e36e34eb788e44f27666bf0a2b3b90803 ]
[Why]
If an OPP is used for a different OPTC without first being disconnected from the previous OPTC, unexpected behaviour can occur. This also applies to phantom pipes, which is what the current logic missed.
[How]
Disconnect OPPs from OPTC for phantom pipes before disabling OTG master.
Also move the disconnection to before the OTG master disable, since the register is double buffered.
Stable-dep-of: 3ba2a0bfd8cf ("drm/amd/display: Clear OPTC mem select on disable")
--- .../gpu/drm/amd/display/dc/dcn32/dcn32_optc.c | 19 +++++++++++++------ .../gpu/drm/amd/display/dc/dcn35/dcn35_optc.c | 12 ++++++------ 2 files changed, 19 insertions(+), 12 deletions(-)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_optc.c +13 -6
@@ -166,12 +166,6 @@ static bool optc32_disable_crtc(struct timing_generator *optc) {struct optc *optc1 =DCN10TG_FROM_TG (optc); -/* disable otg request until end of the first line -* in the vertical blank region -*/ -REG_UPDATE (OTG_CONTROL , -OTG_MASTER_EN ,0 ); - REG_UPDATE_5(OPTC_DATA_SOURCE_SELECT, OPTC_SEG0_SRC_SEL, 0xf, OPTC_SEG1_SRC_SEL, 0xf,
@@ -179,6 +173,12 @@ static bool optc32_disable_crtc(struct timing_generator *optc)OPTC_SEG3_SRC_SEL ,0xf , OPTC_NUM_OF_INPUT_SEGMENT, 0); +/* disable otg request until end of the first line +* in the vertical blank region +*/ +REG_UPDATE (OTG_CONTROL , +OTG_MASTER_EN ,0 ); +REG_UPDATE (CONTROL ,VTG0_ENABLE ,0 );
@@ -205,6 +205,13 @@ static void optc32_disable_phantom_otg(struct timing_generator *optc) {struct optc *optc1 =DCN10TG_FROM_TG (optc); +REG_UPDATE_5 (OPTC_DATA_SOURCE_SELECT , +OPTC_SEG0_SRC_SEL ,0xf , +OPTC_SEG1_SRC_SEL ,0xf , +OPTC_SEG2_SRC_SEL ,0xf , +OPTC_SEG3_SRC_SEL ,0xf , +OPTC_NUM_OF_INPUT_SEGMENT ,0 ); +REG_UPDATE (OTG_CONTROL ,OTG_MASTER_EN ,0 ); }
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_optc.c +6 -6
@@ -138,12 +138,6 @@ static bool optc35_disable_crtc(struct timing_generator *optc) {struct optc *optc1 =DCN10TG_FROM_TG (optc); -/* disable otg request until end of the first line -* in the vertical blank region -*/ -REG_UPDATE (OTG_CONTROL , -OTG_MASTER_EN ,0 ); - REG_UPDATE_5(OPTC_DATA_SOURCE_SELECT, OPTC_SEG0_SRC_SEL, 0xf, OPTC_SEG1_SRC_SEL, 0xf,
@@ -151,6 +145,12 @@ static bool optc35_disable_crtc(struct timing_generator *optc)OPTC_SEG3_SRC_SEL ,0xf , OPTC_NUM_OF_INPUT_SEGMENT, 0); +/* disable otg request until end of the first line +* in the vertical blank region +*/ +REG_UPDATE (OTG_CONTROL , +OTG_MASTER_EN ,0 ); +REG_UPDATE (CONTROL ,VTG0_ENABLE ,0 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 299/346 drm/amd/display: Clear OPTC mem select on disable
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Ilya Bakoulin <[email protected]>
[ Upstream commit 3ba2a0bfd8cf94eb225e1c60dff16e5c35bde1da ]
[Why]
Not clearing the memory select bits prior to OPTC disable can cause DSC corruption issues when attempting to reuse a memory instance for another OPTC that enables ODM.
[How]
Clear the memory select bits prior to disabling an OPTC.
--- drivers/gpu/drm/amd/display/dc/dcn32/dcn32_optc.c | 3 +++ drivers/gpu/drm/amd/display/dc/dcn35/dcn35_optc.c | 3 +++ 2 files changed, 6 insertions(+)
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_optc.c +3 -0
@@ -173,6 +173,9 @@ static bool optc32_disable_crtc(struct timing_generator *optc)OPTC_SEG3_SRC_SEL ,0xf , OPTC_NUM_OF_INPUT_SEGMENT, 0); +REG_UPDATE (OPTC_MEMORY_CONFIG , +OPTC_MEM_SEL ,0 ); +/* disable otg request until end of the first line * in the vertical blank region */
drivers/gpu/drm/amd/display/dc/dcn35/dcn35_optc.c +3 -0
@@ -145,6 +145,9 @@ static bool optc35_disable_crtc(struct timing_generator *optc)OPTC_SEG3_SRC_SEL ,0xf , OPTC_NUM_OF_INPUT_SEGMENT, 0); +REG_UPDATE (OPTC_MEMORY_CONFIG , +OPTC_MEM_SEL ,0 ); +/* disable otg request until end of the first line * in the vertical blank region */
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 300/346 drm/amd/display: Add logging resource checks
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Charlene Liu <[email protected]>
[ Upstream commit 8a51cc097dd590a86e8eec5398934ef389ff9a7b ]
[Why]
When mapping resources, resources could be unavailable.
--- drivers/gpu/drm/amd/display/dc/core/dc.c | 4 +++- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 7 ++++++- 2 files changed, 9 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc.c +3 -1
@@ -3626,7 +3626,7 @@ static void commit_planes_for_stream(struct dc *dc, top_pipe_to_program =resource_get_otg_master_for_stream ( &context->res_ctx, stream); - +ASSERT (top_pipe_to_program !=NULL );for (i =0 ; i < dc->res_pool->pipe_count; i++) {struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];
@@ -4457,6 +4457,8 @@ static bool should_commit_minimal_transition_for_windowed_mpo_odm(struct dc *dc, cur_pipe =resource_get_otg_master_for_stream (&dc->current_state->res_ctx, stream); new_pipe =resource_get_otg_master_for_stream (&context->res_ctx, stream); +if (!cur_pipe || !new_pipe) +return false; cur_is_odm_in_use =resource_get_odm_slice_count (cur_pipe) >1 ; new_is_odm_in_use =resource_get_odm_slice_count (new_pipe) >1 ;if (cur_is_odm_in_use == new_is_odm_in_use)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +6 -1
@@ -2170,6 +2170,10 @@ void resource_log_pipe_topology_update(struct dc *dc, struct dc_state *state)for (stream_idx =0 ; stream_idx < state->stream_count; stream_idx++) { otg_master =resource_get_otg_master_for_stream ( &state->res_ctx, state->streams[stream_idx]); +if (!otg_master || otg_master->stream_res.tg ==NULL ) { +DC_LOG_DC ("topology update: otg_master NULL stream_idx %d!\n" , stream_idx); +return ; + } slice_count =resource_get_opp_heads_for_otg_master (otg_master, &state->res_ctx, opp_heads);for (slice_idx =0 ; slice_idx < slice_count; slice_idx++) {
@@ -2990,7 +2994,8 @@ bool dc_add_plane_to_context( otg_master_pipe =resource_get_otg_master_for_stream ( &context->res_ctx, stream); - added =resource_append_dpp_pipes_for_plane_composition (context, +if (otg_master_pipe) + added =resource_append_dpp_pipes_for_plane_composition (context, dc->current_state, pool, otg_master_pipe, plane_state);if (added) {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 301/346 drm/amd/display: update pixel clock params after stream slice count change in context
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Wenjing Liu <[email protected]>
[ Upstream commit cfab803884f426b36b58dbe1f86f99742767c208 ]
[why]
When ODM slice count is changed, otg master pipe's pixel clock params is no longer valid as the value is dependent on ODM slice count.
Stable-dep-of: aa36d8971fcc ("drm/amd/display: Init link enc resources in dc_state only if res_pool presents")
--- .../gpu/drm/amd/display/dc/core/dc_resource.c | 9 ++++++--- .../drm/amd/display/dc/dcn20/dcn20_resource.c | 16 ++++++++++------ .../drm/amd/display/dc/dcn20/dcn20_resource.h | 1 + .../drm/amd/display/dc/dcn32/dcn32_resource.c | 1 + .../drm/amd/display/dc/dcn321/dcn321_resource.c | 1 + .../gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c | 6 +----- drivers/gpu/drm/amd/display/dc/inc/core_types.h | 1 + 7 files changed, 21 insertions(+), 14 deletions(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +6 -3
@@ -2237,7 +2237,7 @@ static struct pipe_ctx *get_last_dpp_pipe_in_mpcc_combine( }static bool update_pipe_params_after_odm_slice_count_change ( -const struct dc_stream_state *stream, +struct pipe_ctx *otg_master,struct dc_state *context,const struct resource_pool *pool) {
@@ -2247,9 +2247,12 @@ static bool update_pipe_params_after_odm_slice_count_change(for (i =0 ; i < pool->pipe_count && result; i++) { pipe = &context->res_ctx.pipe_ctx[i]; -if (pipe->stream == stream && pipe->plane_state) +if (pipe->stream == otg_master->stream && pipe->plane_state) result =resource_build_scaling_params (pipe); } + +if (pool->funcs->build_pipe_pix_clk_params) + pool->funcs->build_pipe_pix_clk_params (otg_master);return result; }
@@ -2932,7 +2935,7 @@ bool resource_update_pipes_for_stream_with_slice_count( otg_master, new_ctx, pool);if (result) result =update_pipe_params_after_odm_slice_count_change ( - otg_master->stream, new_ctx, pool); + otg_master, new_ctx, pool);return result; }
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +10 -6
@@ -1273,15 +1273,19 @@ static void build_clamping_params(struct dc_stream_state *stream) stream->clamping.pixel_encoding = stream->timing.pixel_encoding; } -static enum dc_status build_pipe_hw_param (struct pipe_ctx *pipe_ctx) +void dcn20_build_pipe_pix_clk_params (struct pipe_ctx *pipe_ctx) { -get_pixel_clock_parameters (pipe_ctx, &pipe_ctx->stream_res.pix_clk_params); - pipe_ctx->clock_source->funcs->get_pix_clk_dividers ( - pipe_ctx->clock_source, - &pipe_ctx->stream_res.pix_clk_params, - &pipe_ctx->pll_settings); + pipe_ctx->clock_source, + &pipe_ctx->stream_res.pix_clk_params, + &pipe_ctx->pll_settings); +} + +static enum dc_status build_pipe_hw_param (struct pipe_ctx *pipe_ctx) +{ + +dcn20_build_pipe_pix_clk_params (pipe_ctx); pipe_ctx->stream->clamping.pixel_encoding = pipe_ctx->stream->timing.pixel_encoding;
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.h +1 -0
@@ -165,6 +165,7 @@ enum dc_status dcn20_add_stream_to_ctx(struct dc *dc, struct dc_state *new_ctx,enum dc_status dcn20_add_dsc_to_stream_resource (struct dc *dc,struct dc_state *dc_ctx,struct dc_stream_state *dc_stream);enum dc_status dcn20_remove_stream_from_ctx (struct dc *dc,struct dc_state *new_ctx,struct dc_stream_state *dc_stream);enum dc_status dcn20_patch_unknown_plane_state (struct dc_plane_state *plane_state); +void dcn20_build_pipe_pix_clk_params (struct pipe_ctx *pipe_ctx);#endif /* __DC_RESOURCE_DCN20_H__ */
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 -0
@@ -2041,6 +2041,7 @@ static struct resource_funcs dcn32_res_pool_funcs = { .retain_phantom_pipes = dcn32_retain_phantom_pipes, .save_mall_state = dcn32_save_mall_state, .restore_mall_state = dcn32_restore_mall_state, + .build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params, };static uint32_t read_pipe_fuses (struct dc_context *ctx)
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +1 -0
@@ -1609,6 +1609,7 @@ static struct resource_funcs dcn321_res_pool_funcs = { .retain_phantom_pipes = dcn32_retain_phantom_pipes, .save_mall_state = dcn32_save_mall_state, .restore_mall_state = dcn32_restore_mall_state, + .build_pipe_pix_clk_params = dcn20_build_pipe_pix_clk_params, };static uint32_t read_pipe_fuses (struct dc_context *ctx)
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 -5
@@ -1237,15 +1237,11 @@ static void update_pipes_with_slice_table(struct dc *dc, struct dc_state *contex {int i; -for (i =0 ; i < table->odm_combine_count; i++) { +for (i =0 ; i < table->odm_combine_count; i++)resource_update_pipes_for_stream_with_slice_count (context, dc->current_state, dc->res_pool, table->odm_combines[i].stream, table->odm_combines[i].slice_count); -/* TODO: move this into the function above */ -dcn20_build_mapped_resource (dc, context, - table->odm_combines[i].stream); - }for (i =0 ; i < table->mpc_combine_count; i++) resource_update_pipes_for_plane_with_slice_count(context,
drivers/gpu/drm/amd/display/dc/inc/core_types.h +1 -0
@@ -205,6 +205,7 @@ struct resource_funcs {void (*get_panel_config_defaults)(struct dc_panel_config *panel_config);void (*save_mall_state)(struct dc *dc,struct dc_state *context,struct mall_temp_config *temp_config);void (*restore_mall_state)(struct dc *dc,struct dc_state *context,struct mall_temp_config *temp_config); +void (*build_pipe_pix_clk_params)(struct pipe_ctx *pipe_ctx); };struct audio_support {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 302/346 drm/amd/display: Init link enc resources in dc_state only if res_pool presents
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dillon Varone <[email protected]>
[ Upstream commit aa36d8971fccb55ef3241cbfff9d1799e31d8628 ]
[Why & How]res_pool is not initialized in all situations such as virtual environments, and therefore link encoder resources should not be initialized if res_pool is NULL.
--- drivers/gpu/drm/amd/display/dc/core/dc_resource.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/core/dc_resource.c +2 -1
@@ -3774,7 +3774,8 @@ void dc_resource_state_construct( dst_ctx->clk_mgr = dc->clk_mgr;/* Initialise DIG link encoder resource tracking variables. */ -link_enc_cfg_init (dc, dst_ctx); +if (dc->res_pool) +link_enc_cfg_init (dc, dst_ctx); }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 303/346 drm/amdgpu: Enable tunneling on high-priority compute queues
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Friedrich Vock <[email protected]>
[ Upstream commit 91963397c49aa2907aeafa52d929555dcbc9cd07 ]
This improves latency if the GPU is already busy with other work. This is useful for VR compositors that submit highly latency-sensitive compositing work on high-priority compute queues while the GPU is busy rendering the next frame.
Userspace merge request:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26462
v2: bump driver version (Alex)
Stable-dep-of: 03ff6d7238b7 ("drm/amdgpu/gfx10: set UNORD_DISPATCH in compute MQDs")
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | 3 ++- drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 10 ++++++---- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 3 ++- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 3 ++- 5 files changed, 13 insertions(+), 7 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -757,6 +757,7 @@ struct amdgpu_mqd_prop {uint64_t eop_gpu_addr;uint32_t hqd_pipe_priority;uint32_t hqd_queue_priority; +bool allow_tunneling;bool hqd_active; };
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +2 -1
@@ -115,9 +115,10 @@* 3.54.0 - Add AMDGPU_CTX_QUERY2_FLAGS_RESET_IN_PROGRESS support * - 3.55.0 - Add AMDGPU_INFO_GPUVM_FAULT query * - 3.56.0 - Update IB start address and size alignment for decode and encode +* - 3.57.0 - Compute tunneling on GFX10+ */ #define KMS_DRIVER_MAJOR 3 -#define KMS_DRIVER_MINOR 56 +#define KMS_DRIVER_MINOR 57#define KMS_DRIVER_PATCHLEVEL 0/*
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c +6 -4
@@ -642,6 +642,10 @@ static void amdgpu_ring_to_mqd_prop(struct amdgpu_ring *ring, struct amdgpu_mqd_prop *prop) {struct amdgpu_device *adev = ring->adev; +bool is_high_prio_compute = ring->funcs->type ==AMDGPU_RING_TYPE_COMPUTE && +amdgpu_gfx_is_high_priority_compute_queue (adev, ring); +bool is_high_prio_gfx = ring->funcs->type ==AMDGPU_RING_TYPE_GFX && +amdgpu_gfx_is_high_priority_graphics_queue (adev, ring);memset (prop,0 ,sizeof (*prop));
@@ -659,10 +663,8 @@ static void amdgpu_ring_to_mqd_prop(struct amdgpu_ring *ring,*/ prop->hqd_active = ring->funcs->type ==AMDGPU_RING_TYPE_KIQ ; -if ((ring->funcs->type ==AMDGPU_RING_TYPE_COMPUTE && -amdgpu_gfx_is_high_priority_compute_queue (adev, ring)) || - (ring->funcs->type ==AMDGPU_RING_TYPE_GFX && -amdgpu_gfx_is_high_priority_graphics_queue (adev, ring))) { + prop->allow_tunneling = is_high_prio_compute; +if (is_high_prio_compute || is_high_prio_gfx) { prop->hqd_pipe_priority =AMDGPU_GFX_PIPE_PRIO_HIGH ; prop->hqd_queue_priority =AMDGPU_GFX_QUEUE_PRIORITY_MAXIMUM ; }
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 -1
@@ -6590,7 +6590,8 @@ static int gfx_v10_0_compute_mqd_init(struct amdgpu_device *adev, void *m, tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,ENDIAN_SWAP ,1 );#endif tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,0 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH ,0 ); + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH , + prop->allow_tunneling); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); mqd->cp_hqd_pq_control = tmp;
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +2 -1
@@ -3839,7 +3839,8 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m, tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,RPTR_BLOCK_SIZE , (order_base_2 (AMDGPU_GPU_PAGE_SIZE /4 ) -1 )); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,0 ); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH ,0 ); + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH , + prop->allow_tunneling); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,KMD_QUEUE ,1 ); mqd->cp_hqd_pq_control = tmp;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 304/346 drm/amdgpu/gfx10: set UNORD_DISPATCH in compute MQDs
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 03ff6d7238b77e5fb2b85dc5fe01d2db9eb893bd ]
This needs to be set to 1 to avoid a potential deadlock in the GC 10.x and newer. On GC 9.x and older, this needs to be set to 0. This can lead to hangs in some mixed graphics and compute workloads. Updated firmware is also required for AQL.
--- drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +1 -1
@@ -6589,7 +6589,7 @@ static int gfx_v10_0_compute_mqd_init(struct amdgpu_device *adev, void *m,#ifdef __BIG_ENDIAN tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,ENDIAN_SWAP ,1 );#endif - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,0 ); + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH , prop->allow_tunneling); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 );
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v10.c +1 -0
@@ -170,6 +170,7 @@ static void update_mqd(struct mqd_manager *mm, void *mqd, m->cp_hqd_pq_control =5 <<CP_HQD_PQ_CONTROL__RPTR_BLOCK_SIZE__SHIFT ; m->cp_hqd_pq_control |=ffs (q->queue_size /sizeof (unsigned int )) -1 -1 ; + m->cp_hqd_pq_control |=CP_HQD_PQ_CONTROL__UNORD_DISPATCH_MASK ;pr_debug ("cp_hqd_pq_control 0x%x\n" , m->cp_hqd_pq_control); m->cp_hqd_pq_base_lo =lower_32_bits ((uint64_t )q->queue_address >>8 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 305/346 drm/amdgpu/gfx11: set UNORD_DISPATCH in compute MQDs
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alex Deucher <[email protected]>
[ Upstream commit 3380fcad2c906872110d31ddf7aa1fdea57f9df6 ]
This needs to be set to 1 to avoid a potential deadlock in the GC 10.x and newer. On GC 9.x and older, this needs to be set to 0. This can lead to hangs in some mixed graphics and compute workloads. Updated firmware is also required for AQL.
--- drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c | 2 +- drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c | 1 + 2 files changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +1 -1
@@ -3838,7 +3838,7 @@ static int gfx_v11_0_compute_mqd_init(struct amdgpu_device *adev, void *m, (order_base_2(prop->queue_size / 4) - 1)); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,RPTR_BLOCK_SIZE , (order_base_2 (AMDGPU_GPU_PAGE_SIZE /4 ) -1 )); - tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,0 ); + tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,UNORD_DISPATCH ,1 ); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,TUNNEL_DISPATCH , prop->allow_tunneling); tmp =REG_SET_FIELD (tmp,CP_HQD_PQ_CONTROL ,PRIV_STATE ,1 );
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager_v11.c +1 -0
@@ -224,6 +224,7 @@ static void update_mqd(struct mqd_manager *mm, void *mqd, m->cp_hqd_pq_control =5 <<CP_HQD_PQ_CONTROL__RPTR_BLOCK_SIZE__SHIFT ; m->cp_hqd_pq_control |=ffs (q->queue_size /sizeof (unsigned int )) -1 -1 ; + m->cp_hqd_pq_control |=CP_HQD_PQ_CONTROL__UNORD_DISPATCH_MASK ;pr_debug ("cp_hqd_pq_control 0x%x\n" , m->cp_hqd_pq_control); m->cp_hqd_pq_base_lo =lower_32_bits ((uint64_t )q->queue_address >>8 );
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 306/346 drm/bridge: parade-ps8640: Wait for HPD when doing an AUX transfer
In reply to Greg Kroah-Hartman6.7-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
@@ -346,6 +346,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 307/346 drm: panel-simple: add missing bus flags for Tianma tm070jvhg[30/33]
In reply to Greg Kroah-Hartman6.7-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
@@ -3861,6 +3861,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 = {
@@ -3873,6 +3874,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 308/346 drm/panel: samsung-s6d7aa0: drop DRM_BUS_FLAG_DE_HIGH for lsl080al02
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Artur Weber <[email protected]>
[ Upstream commit 62b143b5ec4a14e1ae0dede5aabaf1832e3b0073 ]
It turns out that I had misconfigured the device I was using the panel with; the bus data polarity is not high for this panel, I had to change the config on the display controller's side.
Fix the panel config to properly reflect its accurate settings.
--- drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/panel/panel-samsung-s6d7aa0.c +1 -1
@@ -309,7 +309,7 @@ static const struct s6d7aa0_panel_desc s6d7aa0_lsl080al02_desc = { .off_func = s6d7aa0_lsl080al02_off, .drm_mode = &s6d7aa0_lsl080al02_mode, .mode_flags = MIPI_DSI_MODE_VSYNC_FLUSH | MIPI_DSI_MODE_VIDEO_NO_HFP, - .bus_flags = DRM_BUS_FLAG_DE_HIGH, + .bus_flags = 0, .has_backlight = false, .use_passwd3 = false,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 309/346 drm/panel/raydium-rm692e5: select CONFIG_DRM_DISPLAY_DP_HELPER
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arnd Bergmann <[email protected]>
[ Upstream commit 589830b13ac21bddf99b9bc5a4ec17813d0869ef ]
As with several other panel drivers, this fails to link without the DP helper library:
ld: drivers/gpu/drm/panel/panel-raydium-rm692e5.o: in function `rm692e5_prepare':
panel-raydium-rm692e5.c:(.text+0x11f4): undefined reference to `drm_dsc_pps_payload_pack'
Select the same symbols that the others already use.
--- drivers/gpu/drm/panel/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/panel/Kconfig +2 -0
@@ -530,6 +530,8 @@ config DRM_PANEL_RAYDIUM_RM692E5 depends on OF depends on DRM_MIPI_DSI depends on BACKLIGHT_CLASS_DEVICE + select DRM_DISPLAY_DP_HELPER + select DRM_DISPLAY_HELPER help Say Y here if you want to enable support for Raydium RM692E5-based display panels, such as the one found in the Fairphone 5 smartphone.
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 310/346 drm/bridge: sii902x: Fix probing race issue
In reply to Greg Kroah-Hartman6.7-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
@@ -1080,16 +1080,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);
@@ -1102,7 +1092,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)
@@ -1170,12 +1174,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 311/346 drm/bridge: sii902x: Fix audio codec unregistration
In reply to Greg Kroah-Hartman6.7-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
@@ -1080,7 +1080,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);
@@ -1088,13 +1090,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;
@@ -1107,6 +1111,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)
@@ -1179,6 +1189,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 312/346 drm/bridge: parade-ps8640: Ensure bridge is suspended in .post_disable()
In reply to Greg Kroah-Hartman6.7-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
@@ -107,6 +107,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[] = {
@@ -345,6 +346,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) {
@@ -354,6 +356,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; }
@@ -475,7 +478,18 @@ static void ps8640_atomic_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,
@@ -624,6 +638,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 313/346 drm/bridge: parade-ps8640: Make sure we drop the AUX mutex in the error case
In reply to Greg Kroah-Hartman6.7-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
@@ -351,11 +351,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 314/346 memblock: fix crash when reserved memory is not added to memory
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Yajun Deng <[email protected]>
[ Upstream commit 6a9531c3a88096a26cf3ac582f7ec44f94a7dcb2 ]
After commit 61167ad5fecd ("mm: pass nid to reserve_bootmem_region()") nid of a reserved region is used by init_reserved_page() (with CONFIG_DEFERRED_STRUCT_PAGE_INIT=y) to access node strucure. In many cases the nid of the reserved memory is not set and this causes a crash.
When the nid of a reserved region is not set, fall back to early_pfn_to_nid(), so that nid of the first_online_node will be passed to init_reserved_page().
--- mm/memblock.c | 3 +++ 1 file changed, 3 insertions(+)
mm/memblock.c +3 -0
@@ -2141,6 +2141,9 @@ static void __init memmap_init_reserved_pages(void) start = region->base; end = start + region->size; +if (nid ==NUMA_NO_NODE || nid >=MAX_NUMNODES ) + nid =early_pfn_to_nid (PFN_DOWN (start)); +reserve_bootmem_region (start, end, nid); } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 315/346 futex: Prevent the reuse of stale pi_state
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sebastian Andrzej Siewior <[email protected]>
[ Upstream commit e626cb02ee8399fd42c415e542d031d185783903 ]
Jiri Slaby reported a futex state inconsistency resulting in -EINVAL during a lock operation for a PI futex. It requires that the a lock process is interrupted by a timeout or signal:
T1 Owns the futex in user space.
T2 Tries to acquire the futex in kernel (futex_lock_pi()). Allocates a
pi_state and attaches itself to it.
T2 Times out and removes its rt_waiter from the rt_mutex. Drops the
rtmutex lock and tries to acquire the hash bucket lock to remove the futex_q. The lock is contended and T2 schedules out.
T1 Unlocks the futex (futex_unlock_pi()). Finds a futex_q but no
rt_waiter. Unlocks the futex (do_uncontended) and makes it available to user space.
T3 Acquires the futex in user space.
T4 Tries to acquire the futex in kernel (futex_lock_pi()). Finds the
existing futex_q of T2 and tries to attach itself to the existing pi_state. This (attach_to_pi_state()) fails with -EINVAL because uval contains the TID of T3 but pi_state points to T1.
It's incorrect to unlock the futex and make it available for user space to acquire as long as there is still an existing state attached to it in the kernel.
T1 cannot hand over the futex to T2 because T2 already gave up and started to clean up and is blocked on the hash bucket lock, so T2's futex_q with the pi_state pointing to T1 is still queued.
T2 observes the futex_q, but ignores it as there is no waiter on the corresponding rt_mutex and takes the uncontended path which allows the subsequent caller of futex_lock_pi() (T4) to observe that stale state.
To prevent this the unlock path must dequeue all futex_q entries which point to the same pi_state when there is no waiter on the rt mutex. This requires obviously to make the dequeue conditional in the locking path to prevent a double dequeue. With that it's guaranteed that user space cannot observe an uncontended futex which has kernel state attached.
--- kernel/futex/core.c | 15 ++++++++++++--- kernel/futex/pi.c | 11 ++++++++--- 2 files changed, 20 insertions(+), 6 deletions(-)
kernel/futex/core.c +12 -3
@@ -626,12 +626,21 @@ int futex_unqueue(struct futex_q *q) }/* -* PI futexes can not be requeued and must remove themselves from the -* hash bucket. The hash bucket lock (i.e. lock_ptr) is held. +* PI futexes can not be requeued and must remove themselves from the hash +* bucket. The hash bucket lock (i.e. lock_ptr) is held. */ void futex_unqueue_pi (struct futex_q *q) { -__futex_unqueue (q); +/* +* If the lock was not acquired (due to timeout or signal) then the +* rt_waiter is removed before futex_q is. If this is observed by +* an unlocker after dropping the rtmutex wait lock and before +* acquiring the hash bucket lock, then the unlocker dequeues the +* futex_q from the hash bucket list to guarantee consistent state +* vs. userspace. Therefore the dequeue here must be conditional. +*/ +if (!plist_node_empty (&q->list)) +__futex_unqueue (q);BUG_ON (!q->pi_state);put_pi_state (q->pi_state);
kernel/futex/pi.c +8 -3
@@ -1135,6 +1135,7 @@ int futex_unlock_pi(u32 __user *uaddr, unsigned int flags) hb =futex_hash (&key);spin_lock (&hb->lock); +retry_hb:/* * Check waiters first. We do not trust user space values at
@@ -1177,12 +1178,17 @@ int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)/* * Futex vs rt_mutex waiter state -- if there are no rt_mutex * waiters even though futex thinks there are, then the waiter -* is leaving and the uncontended path is safe to take. +* is leaving. The entry needs to be removed from the list so a +* new futex_lock_pi() is not using this stale PI-state while +* the futex is available in user space again. +* There can be more than one task on its way out so it needs +* to retry. */ rt_waiter =rt_mutex_top_waiter (&pi_state->pi_mutex);if (!rt_waiter) { +__futex_unqueue (top_waiter);raw_spin_unlock_irq (&pi_state->pi_mutex.wait_lock); - goto do_uncontended; + goto retry_hb; }get_pi_state (pi_state);
@@ -1217,7 +1223,6 @@ int futex_unlock_pi(u32 __user *uaddr, unsigned int flags)return ret; } -do_uncontended:/* * We have no kernel internal state, i.e. no waiters in the * kernel. Waiters which are about to queue themselves are stuck
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 316/346 drm/exynos: fix accidental on-stack copy of exynos_drm_plane
In reply to Greg Kroah-Hartman6.7-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
@@ -661,9 +661,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 317/346 drm/exynos: gsc: minor fix for loop iteration in gsc_runtime_resume
In reply to Greg Kroah-Hartman6.7-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 318/346 firmware: arm_scmi: Use xa_insert() to store opps
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Marussi <[email protected]>
[ Upstream commit e8ef4bbe39b9576a73f104f6af743fb9c7b624ba ]
When storing opps by level or index use xa_insert() instead of xa_store() and add error-checking to spot bad duplicates indexes possibly wrongly provided by the platform firmware.
--- drivers/firmware/arm_scmi/perf.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
drivers/firmware/arm_scmi/perf.c +18 -5
@@ -347,8 +347,8 @@ process_response_opp(struct scmi_opp *opp, unsigned int loop_idx, }static inline void -process_response_opp_v4 (struct perf_dom_info *dom,struct scmi_opp *opp, -unsigned int loop_idx, +process_response_opp_v4 (struct device *dev,struct perf_dom_info *dom, +struct scmi_opp *opp,unsigned int loop_idx,const struct scmi_msg_resp_perf_describe_levels_v4 *r) { opp->perf =le32_to_cpu (r->opp[loop_idx].perf_val);
@@ -359,10 +359,23 @@ process_response_opp_v4(struct perf_dom_info *dom, struct scmi_opp *opp,/* Note that PERF v4 reports always five 32-bit words */ opp->indicative_freq =le32_to_cpu (r->opp[loop_idx].indicative_freq);if (dom->level_indexing_mode) { +int ret; + opp->level_index =le32_to_cpu (r->opp[loop_idx].level_index); -xa_store (&dom->opps_by_idx, opp->level_index, opp,GFP_KERNEL ); -xa_store (&dom->opps_by_lvl, opp->perf, opp,GFP_KERNEL ); + ret =xa_insert (&dom->opps_by_idx, opp->level_index, opp, +GFP_KERNEL ); +if (ret) +dev_warn (dev, +"Failed to add opps_by_idx at %d - ret:%d\n" , + opp->level_index, ret); + + ret =xa_insert (&dom->opps_by_lvl, opp->perf, opp,GFP_KERNEL ); +if (ret) +dev_warn (dev, +"Failed to add opps_by_lvl at %d - ret:%d\n" , + opp->perf, ret); +hash_add (dom->opps_by_freq, &opp->hash, opp->indicative_freq); } }
@@ -379,7 +392,7 @@ iter_perf_levels_process_response(const struct scmi_protocol_handle *ph,if (PROTOCOL_REV_MAJOR (p->version) <=0x3 )process_response_opp (opp, st->loop_idx, response);else -process_response_opp_v4 (p->perf_dom, opp, st->loop_idx, +process_response_opp_v4 (ph->dev, p->perf_dom, opp, st->loop_idx, response); p->perf_dom->opp_count++;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 319/346 firmware: arm_scmi: Use xa_insert() when saving raw queues
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Marussi <[email protected]>
[ Upstream commit b5dc0ffd36560dbadaed9a3d9fd7838055d62d74 ]
Use xa_insert() when saving per-channel raw queues to better check for duplicates.
--- drivers/firmware/arm_scmi/raw_mode.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-)
drivers/firmware/arm_scmi/raw_mode.c +8 -4
@@ -1111,7 +1111,6 @@ static int scmi_raw_mode_setup(struct scmi_raw_mode_info *raw,int i;for (i =0 ; i < num_chans; i++) { -void *xret;struct scmi_raw_queue *q; q =scmi_raw_queue_init (raw);
@@ -1120,13 +1119,12 @@ static int scmi_raw_mode_setup(struct scmi_raw_mode_info *raw, goto err_xa; } - xret =xa_store (&raw->chans_q, channels[i], q, + ret =xa_insert (&raw->chans_q, channels[i], q,GFP_KERNEL ); -if (xa_err (xret)) { +if (ret) {dev_err (dev,"Fail to allocate Raw queue 0x%02X\n" , channels[i]); - ret =xa_err (xret); goto err_xa; } }
@@ -1322,6 +1320,12 @@ void scmi_raw_message_report(void *r, struct scmi_xfer *xfer, dev = raw->handle->dev; q =scmi_raw_queue_select (raw, idx,SCMI_XFER_IS_CHAN_SET (xfer) ? chan_id :0 ); +if (!q) { +dev_warn (dev, +"RAW[%d] - NO queue for chan 0x%X. Dropping report.\n" , + idx, chan_id); +return ; + }/* * Grab the msg_q_lock upfront to avoid a possible race between
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 320/346 firmware: arm_scmi: Fix the clock protocol version for v3.2
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Marussi <[email protected]>
[ Upstream commit 27600c96e2ffa6c1b2cb378ddc75c6620c628d04 ]
The clock protocol version as per the SCMI v3.2 specification is 0x30000. Enable the v3.0 clock protocol features only when clock protocol version equals 0x30000.
The previous beta version of the spec had this value set to 0x20001 and th same value trickled down from the initial development. The version update were missed in the driver.
--- drivers/firmware/arm_scmi/clock.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/firmware/arm_scmi/clock.c +1 -2
@@ -951,8 +951,7 @@ static int scmi_clock_protocol_init(const struct scmi_protocol_handle *ph)scmi_clock_describe_rates_get (ph, clkid, clk); } -if (PROTOCOL_REV_MAJOR (version) >=0x2 && -PROTOCOL_REV_MINOR (version) >=0x1 ) { +if (PROTOCOL_REV_MAJOR (version) >=0x3 ) { cinfo->clock_config_set = scmi_clock_config_set_v2; cinfo->clock_config_get = scmi_clock_config_get_v2; }else {
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 321/346 firmware: arm_ffa: Add missing rwlock_init() in ffa_setup_partitions()
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Marussi <[email protected]>
[ Upstream commit 59b2e242b13192e50bf47df3780bf8a7e2260e98 ]
Add the missing rwlock initialization for the individual FF-A partition information in ffa_setup_partitions().
--- drivers/firmware/arm_ffa/driver.c | 1 + 1 file changed, 1 insertion(+)
drivers/firmware/arm_ffa/driver.c +1 -0
@@ -1226,6 +1226,7 @@ static void ffa_setup_partitions(void)ffa_device_unregister (ffa_dev);continue ; } +rwlock_init (&info->rw_lock);xa_store (&drv_info->partition_info, tpbuf->id, info,GFP_KERNEL ); } drv_info->partition_count = count;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 322/346 firmware: arm_ffa: Add missing rwlock_init() for the driver partition
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Marussi <[email protected]>
[ Upstream commit 5ff30ade16cd9efc2466d3ea22bbaf370772941a ]
Add the missing rwlock initialization for the FF-A partition associated the driver in ffa_setup_partitions(). It will the primary scheduler partition in the host or the VM partition in the virtualised environment. IOW, it corresponds to the partition with VM ID == drv_info->vm_id.
--- drivers/firmware/arm_ffa/driver.c | 1 + 1 file changed, 1 insertion(+)
drivers/firmware/arm_ffa/driver.c +1 -0
@@ -1237,6 +1237,7 @@ static void ffa_setup_partitions(void) info =kzalloc (sizeof (*info),GFP_KERNEL );if (!info)return ; +rwlock_init (&info->rw_lock);xa_store (&drv_info->partition_info, drv_info->vm_id, info,GFP_KERNEL ); drv_info->partition_count++; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 323/346 firmware: arm_ffa: Check xa_load() return value
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Cristian Marussi <[email protected]>
[ Upstream commit c00d9738fd5fce15dc5494d05b7599dce23e8146 ]
Add a check to verify the result of xa_load() during the partition lookups done while registering/unregistering the scheduler receiver interrupt callbacks and while executing the main scheduler receiver interrupt callback handler.
--- drivers/firmware/arm_ffa/driver.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/firmware/arm_ffa/driver.c +10 -0
@@ -733,6 +733,11 @@ static void __do_sched_recv_cb(u16 part_id, u16 vcpu, bool is_per_vcpu)void *cb_data; partition =xa_load (&drv_info->partition_info, part_id); +if (!partition) { +pr_err ("%s: Invalid partition ID 0x%x\n" , __func__, part_id); +return ; + } +read_lock (&partition->rw_lock); callback = partition->callback; cb_data = partition->cb_data;
@@ -915,6 +920,11 @@ static int ffa_sched_recv_cb_update(u16 part_id, ffa_sched_recv_cb callback,return -EOPNOTSUPP ; partition =xa_load (&drv_info->partition_info, part_id); +if (!partition) { +pr_err ("%s: Invalid partition ID 0x%x\n" , __func__, part_id); +return -EINVAL ; + } +write_lock (&partition->rw_lock); cb_valid = !!partition->callback;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 324/346 platform/x86: wmi: Fix error handling in legacy WMI notify handler functions
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Armin Wolf <[email protected]>
[ Upstream commit 6ba7843b59b77360812617d071313c7f35f3757a ]
When wmi_install_notify_handler()/wmi_remove_notify_handler() are unable to enable/disable the WMI device, they unconditionally return an error to the caller.
When registering legacy WMI notify handlers, this means that the callback remains registered despite wmi_install_notify_handler() having returned an error.
When removing legacy WMI notify handlers, this means that the callback is removed despite wmi_remove_notify_handler() having returned an error.
Fix this by only warning when the WMI device could not be enabled. This behaviour matches the bus-based WMI interface.
Tested on a Dell Inspiron 3505 and a Acer Aspire E1-731.
--- drivers/platform/x86/wmi.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-)
drivers/platform/x86/wmi.c +9 -7
@@ -686,9 +686,10 @@ acpi_status wmi_install_notify_handler(const char *guid, block->handler_data = data; wmi_status =wmi_method_enable (block, true); -if ((wmi_status !=AE_OK ) || - ((wmi_status ==AE_OK ) && (status ==AE_NOT_EXIST ))) - status = wmi_status; +if (ACPI_FAILURE (wmi_status)) +dev_warn (&block->dev.dev,"Failed to enable device\n" ); + + status =AE_OK ; } }
@@ -729,12 +730,13 @@ acpi_status wmi_remove_notify_handler(const char *guid) status =AE_OK ; }else { wmi_status =wmi_method_enable (block, false); +if (ACPI_FAILURE (wmi_status)) +dev_warn (&block->dev.dev,"Failed to disable device\n" ); + block->handler =NULL ; block->handler_data =NULL ; -if ((wmi_status !=AE_OK ) || - ((wmi_status ==AE_OK ) && - (status ==AE_NOT_EXIST ))) - status = wmi_status; + + status =AE_OK ; } } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 325/346 gpio: eic-sprd: Clear interrupt after set the interrupt type
In reply to Greg Kroah-Hartman6.7-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
@@ -330,20 +330,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 ;
@@ -355,20 +362,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 ;
@@ -382,29 +396,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 :
@@ -417,29 +436,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 326/346 ARM: dts: exynos4212-tab3: add samsung,invert-vclk flag to fimd
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Artur Weber <[email protected]>
[ Upstream commit eab4f56d3e75dad697acf8dc2c8be3c341d6c63e ]
After more investigation, I've found that it's not the panel driver config that needs to be modified to invert the data polarity, but the FIMD config.
Add the missing invert-vclk option that is required to get the display to work correctly.
--- arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/samsung/exynos4212-tab3.dtsi +1 -0
@@ -434,6 +434,7 @@ &exynos_usbphy { }; &fimd { + samsung,invert-vclk; status = "okay"; };
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 327/346 platform/mellanox: mlxbf-pmc: Fix offset calculation for crspace events
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shravan Kumar Ramani <[email protected]>
[ Upstream commit 732c35ce6d4892f7b07cc9aca61a6ad0fd400a26 ]
The event selector fields for 2 counters are contained in one 32-bit register and the current logic does not account for this.
--- drivers/platform/mellanox/mlxbf-pmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/platform/mellanox/mlxbf-pmc.c +2 -2
@@ -1170,7 +1170,7 @@ static int mlxbf_pmc_program_crspace_counter(int blk_num, uint32_t cnt_num,int ret; addr = pmc->block[blk_num].mmio_base + - (rounddown (cnt_num,2 ) *MLXBF_PMC_CRSPACE_PERFSEL_SZ ); + ((cnt_num /2 ) *MLXBF_PMC_CRSPACE_PERFSEL_SZ ); ret =mlxbf_pmc_readl (addr, &word);if (ret)return ret;
@@ -1413,7 +1413,7 @@ static int mlxbf_pmc_read_crspace_event(int blk_num, uint32_t cnt_num,int ret; addr = pmc->block[blk_num].mmio_base + - (rounddown (cnt_num,2 ) *MLXBF_PMC_CRSPACE_PERFSEL_SZ ); + ((cnt_num /2 ) *MLXBF_PMC_CRSPACE_PERFSEL_SZ ); ret =mlxbf_pmc_readl (addr, &word);if (ret)return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 328/346 spi: intel-pci: Remove Meteor Lake-S SoC PCI ID from the list
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mika Westerberg <[email protected]>
[ Upstream commit 6c314425b9ef6b247cefd0903e287eb072580c3b ]
Turns out this "SoC" side controller does not support certain commands, such as reading chip JEDEC ID, so the controller is pretty much unusable in Linux. We should be using the "PCH" side controller instead. For this reason remove this PCI ID from the list.
--- drivers/spi/spi-intel-pci.c | 1 - 1 file changed, 1 deletion(-)
drivers/spi/spi-intel-pci.c +0 -1
@@ -84,7 +84,6 @@ static const struct pci_device_id intel_spi_pci_ids[] = { { PCI_VDEVICE(INTEL, 0xa2a4), (unsigned long)&cnl_info }, { PCI_VDEVICE(INTEL, 0xa324), (unsigned long)&cnl_info }, { PCI_VDEVICE(INTEL, 0xa3a4), (unsigned long)&cnl_info }, - { PCI_VDEVICE(INTEL, 0xae23), (unsigned long)&cnl_info }, { }, };MODULE_DEVICE_TABLE (pci, intel_spi_pci_ids);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 329/346 block: Move checking GENHD_FL_NO_PART to bdev_add_partition()
In reply to Greg Kroah-Hartman6.7-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
@@ -447,6 +447,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 330/346 drm/bridge: anx7625: Ensure bridge is suspended in disable()
In reply to Greg Kroah-Hartman6.7-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
@@ -1741,6 +1741,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) {
@@ -1757,6 +1758,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; }
@@ -2453,7 +2455,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
@@ -2647,6 +2651,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 331/346 cpufreq/amd-pstate: Fix setting scaling max/min freq values
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Limonciello <[email protected]>
[ Upstream commit 22fb4f041999f5f16ecbda15a2859b4ef4cbf47e ]
Scaling min/max freq values were being cached and lagging a setting each time. Fix the ordering of the clamp call to ensure they work.
--- drivers/cpufreq/amd-pstate.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
drivers/cpufreq/amd-pstate.c +3 -4
@@ -1232,14 +1232,13 @@ static void amd_pstate_epp_update_limit(struct cpufreq_policy *policy) max_limit_perf =div_u64 (policy->max * cpudata->highest_perf, cpudata->max_freq); min_limit_perf =div_u64 (policy->min * cpudata->highest_perf, cpudata->max_freq); +WRITE_ONCE (cpudata->max_limit_perf, max_limit_perf); +WRITE_ONCE (cpudata->min_limit_perf, min_limit_perf); + max_perf = clamp_t(unsigned long, max_perf, cpudata->min_limit_perf, cpudata->max_limit_perf); min_perf = clamp_t(unsigned long, min_perf, cpudata->min_limit_perf, cpudata->max_limit_perf); - -WRITE_ONCE (cpudata->max_limit_perf, max_limit_perf); -WRITE_ONCE (cpudata->min_limit_perf, min_limit_perf); - value =READ_ONCE (cpudata->cppc_req_cached);if (cpudata->policy ==CPUFREQ_POLICY_PERFORMANCE )
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 332/346 spi: bcm-qspi: fix SFDP BFPT read by usig mspi read
In reply to Greg Kroah-Hartman6.7-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 333/346 spi: spi-cadence: Reverse the order of interleaved write and read operations
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Amit Kumar Mahapatra <[email protected]>
[ Upstream commit 633cd6fe6e1993ba80e0954c2db127a0b1a3e66f ]
In the existing implementation, when executing interleaved write and read operations in the ISR for a transfer length greater than the FIFO size, the TXFIFO write precedes the RXFIFO read. Consequently, the initially received data in the RXFIFO is pushed out and lost, leading to a failure in data integrity. To address this issue, reverse the order of interleaved operations and conduct the RXFIFO read followed by the TXFIFO write.
--- drivers/spi/spi-cadence.c | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
drivers/spi/spi-cadence.c +9 -8
@@ -317,6 +317,15 @@ static void cdns_spi_process_fifo(struct cdns_spi *xspi, int ntx, int nrx) xspi->rx_bytes -= nrx;while (ntx || nrx) { +if (nrx) { +u8 data =cdns_spi_read (xspi,CDNS_SPI_RXD ); + +if (xspi->rxbuf) + *xspi->rxbuf++ = data; + + nrx--; + } +if (ntx) {if (xspi->txbuf)cdns_spi_write (xspi,CDNS_SPI_TXD , *xspi->txbuf++);
@@ -326,14 +335,6 @@ static void cdns_spi_process_fifo(struct cdns_spi *xspi, int ntx, int nrx) ntx--; } -if (nrx) { -u8 data =cdns_spi_read (xspi,CDNS_SPI_RXD ); - -if (xspi->rxbuf) - *xspi->rxbuf++ = data; - - nrx--; - } } }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 334/346 cifs: fix stray unlock in cifs_chan_skip_or_disable
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Shyam Prasad N <[email protected]>
[ Upstream commit 993d1c346b1a51ac41b2193609a0d4e51e9748f4 ]
A recent change moved the code that decides to skip a channel or disable multichannel entirely, into a helper function.
During this, a mutex_unlock of the session_mutex
should have been removed. Doing that here.
--- fs/smb/client/smb2pdu.c | 1 - 1 file changed, 1 deletion(-)
fs/smb/client/smb2pdu.c +0 -1
@@ -195,7 +195,6 @@ cifs_chan_skip_or_disable(struct cifs_ses *ses, pserver = server->primary_server;cifs_signal_cifsd_for_reconnect (pserver, false); skip_terminate: -mutex_unlock (&ses->session_mutex);return -EHOSTDOWN ; }
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 335/346 spi: fix finalize message on error return
In reply to Greg Kroah-Hartman6.7-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
@@ -1624,6 +1624,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 336/346 LoongArch/smp: Call rcutree_report_cpu_starting() at tlb_init()
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
[ Upstream commit 5056c596c3d1848021a4eaa76ee42f4c05c50346 ]
Machines which have more than 8 nodes fail to boot SMP after commit a2ccf46333d7b2cf96 ("LoongArch/smp: Call rcutree_report_cpu_starting() earlier"). Because such machines use tlb-based per-cpu base address rather than dmw-based per-cpu base address, resulting per-cpu variables can only be accessed after tlb_init(). But rcutree_report_cpu_starting() is now called before tlb_init() and accesses per-cpu variables indeed.
Since the original patch want to avoid the lockdep warning caused by page allocation in tlb_init(), we can move rcutree_report_cpu_starting() to tlb_init() where after tlb exception configuration but before page allocation.
--- arch/loongarch/kernel/smp.c | 1 - arch/loongarch/mm/tlb.c | 16 ++++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-)
arch/loongarch/kernel/smp.c +0 -1
@@ -506,7 +506,6 @@ asmlinkage void start_secondary(void)sync_counter (); cpu =raw_smp_processor_id ();set_my_cpu_offset (per_cpu_offset (cpu)); -rcutree_report_cpu_starting (cpu);cpu_probe ();constant_clockevent_init ();
arch/loongarch/mm/tlb.c +10 -6
@@ -284,12 +284,16 @@ static void setup_tlb_handler(int cpu)set_handler (EXCCODE_TLBNR *VECSIZE , handle_tlb_protect,VECSIZE );set_handler (EXCCODE_TLBNX *VECSIZE , handle_tlb_protect,VECSIZE );set_handler (EXCCODE_TLBPE *VECSIZE , handle_tlb_protect,VECSIZE ); - } + }else { +int vec_sz__maybe_unused ; +void *addr__maybe_unused ; +struct page *page__maybe_unused ; + +/* Avoid lockdep warning */ +rcutree_report_cpu_starting (cpu); +#ifdef CONFIG_NUMA - else { -void *addr; -struct page *page; -const int vec_sz =sizeof (exception_handlers); + vec_sz =sizeof (exception_handlers);if (pcpu_handlers[cpu])return ;
@@ -305,8 +309,8 @@ static void setup_tlb_handler(int cpu)csr_write64 (pcpu_handlers[cpu],LOONGARCH_CSR_EENTRY );csr_write64 (pcpu_handlers[cpu],LOONGARCH_CSR_MERRENTRY );csr_write64 (pcpu_handlers[cpu] +80 *VECSIZE ,LOONGARCH_CSR_TLBRENTRY ); - }#endif + } }void tlb_init (int cpu)
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 337/346 MIPS: lantiq: register smp_ops on non-smp platforms
In reply to Greg Kroah-Hartman6.7-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
@@ -108,10 +108,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 338/346 riscv: dts: sophgo: separate sg2042 mtime and mtimecmp to fit aclint format
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Inochi Amaoto <[email protected]>
[ Upstream commit 1f4a994be2c3d13852fd5c1054f292bd303352cc ]
Change the timer layout in the dtb to fit the format that needed by the SBI.
--- arch/riscv/boot/dts/sophgo/sg2042.dtsi | 80 +++++++++++++++----------- 1 file changed, 48 insertions(+), 32 deletions(-)
arch/riscv/boot/dts/sophgo/sg2042.dtsi +48 -32
@@ -93,144 +93,160 @@ clint_mswi: interrupt-controller@7094000000 { <&cpu63_intc 3>; }; - clint_mtimer0: timer@70ac000000 { + clint_mtimer0: timer@70ac004000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac000000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac004000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu0_intc 7>, <&cpu1_intc 7>, <&cpu2_intc 7>, <&cpu3_intc 7>; }; - clint_mtimer1: timer@70ac010000 { + clint_mtimer1: timer@70ac014000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac010000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac014000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu4_intc 7>, <&cpu5_intc 7>, <&cpu6_intc 7>, <&cpu7_intc 7>; }; - clint_mtimer2: timer@70ac020000 { + clint_mtimer2: timer@70ac024000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac020000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac024000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu8_intc 7>, <&cpu9_intc 7>, <&cpu10_intc 7>, <&cpu11_intc 7>; }; - clint_mtimer3: timer@70ac030000 { + clint_mtimer3: timer@70ac034000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac030000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac034000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu12_intc 7>, <&cpu13_intc 7>, <&cpu14_intc 7>, <&cpu15_intc 7>; }; - clint_mtimer4: timer@70ac040000 { + clint_mtimer4: timer@70ac044000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac040000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac044000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu16_intc 7>, <&cpu17_intc 7>, <&cpu18_intc 7>, <&cpu19_intc 7>; }; - clint_mtimer5: timer@70ac050000 { + clint_mtimer5: timer@70ac054000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac050000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac054000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu20_intc 7>, <&cpu21_intc 7>, <&cpu22_intc 7>, <&cpu23_intc 7>; }; - clint_mtimer6: timer@70ac060000 { + clint_mtimer6: timer@70ac064000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac060000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac064000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu24_intc 7>, <&cpu25_intc 7>, <&cpu26_intc 7>, <&cpu27_intc 7>; }; - clint_mtimer7: timer@70ac070000 { + clint_mtimer7: timer@70ac074000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac070000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac074000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu28_intc 7>, <&cpu29_intc 7>, <&cpu30_intc 7>, <&cpu31_intc 7>; }; - clint_mtimer8: timer@70ac080000 { + clint_mtimer8: timer@70ac084000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac080000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac084000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu32_intc 7>, <&cpu33_intc 7>, <&cpu34_intc 7>, <&cpu35_intc 7>; }; - clint_mtimer9: timer@70ac090000 { + clint_mtimer9: timer@70ac094000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac090000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac094000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu36_intc 7>, <&cpu37_intc 7>, <&cpu38_intc 7>, <&cpu39_intc 7>; }; - clint_mtimer10: timer@70ac0a0000 { + clint_mtimer10: timer@70ac0a4000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac0a0000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac0a4000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu40_intc 7>, <&cpu41_intc 7>, <&cpu42_intc 7>, <&cpu43_intc 7>; }; - clint_mtimer11: timer@70ac0b0000 { + clint_mtimer11: timer@70ac0b4000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac0b0000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac0b4000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu44_intc 7>, <&cpu45_intc 7>, <&cpu46_intc 7>, <&cpu47_intc 7>; }; - clint_mtimer12: timer@70ac0c0000 { + clint_mtimer12: timer@70ac0c4000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac0c0000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac0c4000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu48_intc 7>, <&cpu49_intc 7>, <&cpu50_intc 7>, <&cpu51_intc 7>; }; - clint_mtimer13: timer@70ac0d0000 { + clint_mtimer13: timer@70ac0d4000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac0d0000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac0d4000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu52_intc 7>, <&cpu53_intc 7>, <&cpu54_intc 7>, <&cpu55_intc 7>; }; - clint_mtimer14: timer@70ac0e0000 { + clint_mtimer14: timer@70ac0e4000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac0e0000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac0e4000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu56_intc 7>, <&cpu57_intc 7>, <&cpu58_intc 7>, <&cpu59_intc 7>; }; - clint_mtimer15: timer@70ac0f0000 { + clint_mtimer15: timer@70ac0f4000 { compatible = "sophgo,sg2042-aclint-mtimer", "thead,c900-aclint-mtimer"; - reg = <0x00000070 0xac0f0000 0x00000000 0x00007ff8>; + reg = <0x00000070 0xac0f4000 0x00000000 0x0000c000>; + reg-names = "mtimecmp"; interrupts-extended = <&cpu60_intc 7>, <&cpu61_intc 7>, <&cpu62_intc 7>,
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 339/346 drm: bridge: samsung-dsim: Dont use FORCE_STOP_STATE
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Michael Walle <[email protected]>
[ Upstream commit ff3d5d04db07e5374758baa7e877fde8d683ebab ]
The FORCE_STOP_STATE bit is unsuitable to force the DSI link into LP-11 mode. It seems the bridge internally queues DSI packets and when the FORCE_STOP_STATE bit is cleared, they are sent in close succession without any useful timing (this also means that the DSI lanes won't go into LP-11 mode). The length of this gibberish varies between 1ms and 5ms. This sometimes breaks an attached bridge (TI SN65DSI84 in this case). In our case, the bridge will fail in about 1 per 500 reboots.
The FORCE_STOP_STATE handling was introduced to have the DSI lanes in LP-11 state during the .pre_enable phase. But as it turns out, none of this is needed at all. Between samsung_dsim_init() and samsung_dsim_set_display_enable() the lanes are already in LP-11 mode. The code as it was before commit 20c827683de0 ("drm: bridge:
samsung-dsim: Fix init during host transfer") and 0c14d3130654 ("drm:
bridge: samsung-dsim: Fix i.MX8M enable flow to meet spec") was correct in this regard.
This patch basically reverts both commits. It was tested on an i.MX8M SoC with an SN65DSI84 bridge. The signals were probed and the DSI packets were decoded during initialization and link start-up. After this patch the first DSI packet on the link is a VSYNC packet and the timing is correct.
Command mode between .pre_enable and .enable was also briefly tested by a quick hack. There was no DSI link partner which would have responded, but it was made sure the DSI packet was send on the link. As a side note, the command mode seems to just work in HS mode. I couldn't find that the bridge will handle commands in LP mode.
--- drivers/gpu/drm/bridge/samsung-dsim.c | 32 ++------------------------- 1 file changed, 2 insertions(+), 30 deletions(-)
drivers/gpu/drm/bridge/samsung-dsim.c +2 -30
@@ -969,10 +969,6 @@ static int samsung_dsim_init_link(struct samsung_dsim *dsi) reg =samsung_dsim_read (dsi,DSIM_ESCMODE_REG ); reg &= ~DSIM_STOP_STATE_CNT_MASK ; reg |=DSIM_STOP_STATE_CNT (driver_data->reg_values[STOP_STATE_CNT ]); - -if (!samsung_dsim_hw_is_exynos (dsi->plat_data->hw_type)) - reg |=DSIM_FORCE_STOP_STATE ; -samsung_dsim_write (dsi,DSIM_ESCMODE_REG , reg); reg =DSIM_BTA_TIMEOUT (0xff ) |DSIM_LPDR_TIMEOUT (0xffff );
@@ -1431,18 +1427,6 @@ static void samsung_dsim_disable_irq(struct samsung_dsim *dsi)disable_irq (dsi->irq); } -static void samsung_dsim_set_stop_state (struct samsung_dsim *dsi,bool enable) -{ -u32 reg =samsung_dsim_read (dsi,DSIM_ESCMODE_REG ); - -if (enable) - reg |=DSIM_FORCE_STOP_STATE ; -else - reg &= ~DSIM_FORCE_STOP_STATE ; - -samsung_dsim_write (dsi,DSIM_ESCMODE_REG , reg); -} -static int samsung_dsim_init (struct samsung_dsim *dsi) {const struct samsung_dsim_driver_data *driver_data = dsi->driver_data;
@@ -1492,9 +1476,6 @@ static void samsung_dsim_atomic_pre_enable(struct drm_bridge *bridge, ret =samsung_dsim_init (dsi);if (ret)return ; - -samsung_dsim_set_display_mode (dsi); -samsung_dsim_set_display_enable (dsi, true); } }
@@ -1503,12 +1484,8 @@ static void samsung_dsim_atomic_enable(struct drm_bridge *bridge, {struct samsung_dsim *dsi =bridge_to_dsi (bridge); -if (samsung_dsim_hw_is_exynos (dsi->plat_data->hw_type)) { -samsung_dsim_set_display_mode (dsi); -samsung_dsim_set_display_enable (dsi, true); - }else { -samsung_dsim_set_stop_state (dsi, false); - } +samsung_dsim_set_display_mode (dsi); +samsung_dsim_set_display_enable (dsi, true); dsi->state |=DSIM_STATE_VIDOUT_AVAILABLE ; }
@@ -1521,9 +1498,6 @@ static void samsung_dsim_atomic_disable(struct drm_bridge *bridge,if (!(dsi->state &DSIM_STATE_ENABLED ))return ; -if (!samsung_dsim_hw_is_exynos (dsi->plat_data->hw_type)) -samsung_dsim_set_stop_state (dsi, true); - dsi->state &= ~DSIM_STATE_VIDOUT_AVAILABLE ; }
@@ -1828,8 +1802,6 @@ static ssize_t samsung_dsim_host_transfer(struct mipi_dsi_host *host,if (ret)return ret; -samsung_dsim_set_stop_state (dsi, false); - ret =mipi_dsi_create_packet (&xfer.packet, msg);if (ret <0 )return ret;
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 340/346 platform/x86/intel/ifs: Call release_firmware() when handling errors.
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jithu Joseph <[email protected]>
[ Upstream commit 8c898ec07a2fc1d4694e81097a48e94a3816308d ]
Missing release_firmware() due to error handling blocked any future image loading.
Fix the return code and release_fiwmare() to release the bad image.
--- drivers/platform/x86/intel/ifs/load.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/platform/x86/intel/ifs/load.c +2 -1
@@ -399,7 +399,8 @@ int ifs_load_firmware(struct device *dev)if (fw->size != expected_size) {dev_err (dev,"File size mismatch (expected %u, actual %zu). Corrupted IFS image.\n" , expected_size, fw->size); -return -EINVAL ; + ret = -EINVAL ; + goto release; } ret =image_sanity_check (dev, (struct microcode_header_intel *)fw->data);
Signature · 1 line
2.43.0
Greg Kroah-Hartman
maintainerPATCH 341/346 cxl/region:Fix overflow issue in alloc_hpa()
In reply to Greg Kroah-Hartman6.7-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
@@ -525,7 +525,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);
@@ -545,7 +545,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 342/346 mips: Call lose_fpu(0) before initializing fcr31 in mips_set_personality_nan
In reply to Greg Kroah-Hartman6.7-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 343/346 genirq: Initialize resend_node hlist for all interrupt descriptors
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Dawei Li <[email protected]>
commit b184c8c2889ceef0a137c7d0567ef9fe3d92276e upstream.
For a CONFIG_SPARSE_IRQ=n kernel, early_irq_init() is supposed to initialize all interrupt descriptors.
It does except for irq_desc::resend_node, which ia only initialized for the first descriptor.
Use the indexed decriptor and not the base pointer to address that.
--- kernel/irq/irqdesc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/irq/irqdesc.c +1 -1
@@ -600,7 +600,7 @@ int __init early_irq_init(void)mutex_init (&desc[i].request_mutex);init_waitqueue_head (&desc[i].wait_for_threads);desc_set_defaults (i, &desc[i], node,NULL ,NULL ); -irq_resend_init (desc); +irq_resend_init (&desc[i]); }return arch_early_irq_init (); }
Greg Kroah-Hartman
maintainerPATCH 344/346 clocksource: Skip watchdog check for large watchdog intervals
In reply to Greg Kroah-Hartman6.7-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jiri Wiesner <[email protected]>
commit 644649553508b9bacf0fc7a5bdc4f9e0165576a5 upstream.
There have been reports of the watchdog marking clocksources unstable on machines with 8 NUMA nodes:
clocksource: timekeeping watchdog on CPU373:
Marking clocksource 'tsc' as unstable because the skew is too large:
clocksource: 'hpet' wd_nsec: 14523447520
clocksource: 'tsc' cs_nsec: 14524115132
The measured clocksource skew - the absolute difference between cs_nsec and wd_nsec - was 668 microseconds:
cs_nsec - wd_nsec = 14524115132 - 14523447520 = 667612
The kernel used 200 microseconds for the uncertainty_margin of both the clocksource and watchdog, resulting in a threshold of 400 microseconds (the md variable). Both the cs_nsec and the wd_nsec value indicate that the readout interval was circa 14.5 seconds. The observed behaviour is that watchdog checks failed for large readout intervals on 8 NUMA node machines. This indicates that the size of the skew was directly proportinal to the length of the readout interval on those machines. The measured clocksource skew, 668 microseconds, was evaluated against a threshold (the md variable) that is suited for readout intervals of roughly WATCHDOG_INTERVAL, i.e. HZ >> 1, which is 0.5 second.
The intention of 2e27e793e280 ("clocksource: Reduce clocksource-skew threshold") was to tighten the threshold for evaluating skew and set the lower bound for the uncertainty_margin of clocksources to twice WATCHDOG_MAX_SKEW. Later in c37e85c135ce ("clocksource: Loosen clocksource watchdog constraints"), the WATCHDOG_MAX_SKEW constant was increased to 125 microseconds to fit the limit of NTP, which is able to use a clocksource that suffers from up to 500 microseconds of skew per second. Both the TSC and the HPET use default uncertainty_margin. When the readout interval gets stretched the default uncertainty_margin is no longer a suitable lower bound for evaluating skew - it imposes a limit that is far stricter than the skew with which NTP can deal.
The root causes of the skew being directly proportinal to the length of the readout interval are:
* the inaccuracy of the shift/mult pairs of clocksources and the watchdog
* the conversion to nanoseconds is imprecise for large readout intervals
Prevent this by skipping the current watchdog check if the readout interval exceeds 2 * WATCHDOG_INTERVAL. Considering the maximum readout interval of 2 * WATCHDOG_INTERVAL, the current default uncertainty margin (of the TSC and HPET) corresponds to a limit on clocksource skew of 250 ppm (microseconds of skew per second). To keep the limit imposed by NTP (500 microseconds of skew per second) for all possible readout intervals, the margins would have to be scaled so that the threshold value is proportional to the length of the actual readout interval.
As for why the readout interval may get stretched: Since the watchdog is executed in softirq context the expiration of the watchdog timer can get severely delayed on account of a ksoftirqd thread not getting to run in a timely manner. Surely, a system with such belated softirq execution is not working well and the scheduling issue should be looked into but the clocksource watchdog should be able to deal with it accordingly.
--- kernel/time/clocksource.c | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-)
kernel/time/clocksource.c +24 -1
@@ -99,6 +99,7 @@ static u64 suspend_start;* Interval: 0.5sec. */ #define WATCHDOG_INTERVAL (HZ >> 1) +#define WATCHDOG_INTERVAL_MAX_NS ((2 * WATCHDOG_INTERVAL) * (NSEC_PER_SEC / HZ))/* * Threshold: 0.0312s, when doubled: 0.0625s.
@@ -134,6 +135,7 @@ static DECLARE_WORK(watchdog_work, clockstatic DEFINE_SPINLOCK (watchdog_lock);static int watchdog_running;static atomic_t watchdog_reset_pending; +static int64_t watchdog_max_interval;static inline void clocksource_watchdog_lock (unsigned long *flags) {
@@ -399,8 +401,8 @@ static inline void clocksource_reset_watstatic void clocksource_watchdog (struct timer_list *unused) {u64 csnow, wdnow, cslast, wdlast, delta; +int64_t wd_nsec, cs_nsec, interval;int next_cpu, reset_pending; -int64_t wd_nsec, cs_nsec;struct clocksource *cs;enum wd_read_status read_ret;unsigned long extra_wait =0 ;
@@ -470,6 +472,27 @@ static void clocksource_watchdog(structif (atomic_read (&watchdog_reset_pending))continue ; +/* +* The processing of timer softirqs can get delayed (usually +* on account of ksoftirqd not getting to run in a timely +* manner), which causes the watchdog interval to stretch. +* Skew detection may fail for longer watchdog intervals +* on account of fixed margins being used. +* Some clocksources, e.g. acpi_pm, cannot tolerate +* watchdog intervals longer than a few seconds. +*/ + interval =max (cs_nsec, wd_nsec); +if (unlikely (interval >WATCHDOG_INTERVAL_MAX_NS )) { +if (system_state >SYSTEM_SCHEDULING && + interval >2 * watchdog_max_interval) { + watchdog_max_interval = interval; +pr_warn ("Long readout interval, skipping watchdog check: cs_nsec: %lld wd_nsec: %lld\n" , + cs_nsec, wd_nsec); + } + watchdog_timer.expires = jiffies; +continue ; + } +/* Check the deviation from the watchdog clocksource. */ md = cs->uncertainty_margin + watchdog->uncertainty_margin;if (abs (cs_nsec - wd_nsec) > md) {
Greg Kroah-Hartman
maintainerPATCH 345/346 tick/sched: Preserve number of idle sleeps across CPU hotplug events
In reply to Greg Kroah-Hartman6.7-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
@@ -1574,6 +1574,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)
@@ -1582,9 +1583,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 346/346 x86/entry/ia32: Ensure s32 is sign extended to s64
In reply to Greg Kroah-Hartman6.7-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
@@ -125,6 +125,7 @@ struct cachestat;#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))
Hello,
Quoted 5 lines · On Mon, 29 Jan 2024 09:00:31 -0800 Greg Kroah-Hartman…
This is the start of the stable review cycle for the 6.7.3 release. There are 346 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.7.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.7.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] 7c05c677b6ca ("Linux 6.7.3-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: debugfs_rm_non_contexts.sh
ok 8 selftests: damon: sysfs.sh
ok 9 selftests: damon: sysfs_update_removed_scheme_dir.sh
ok 10 selftests: damon: reclaim.sh
ok 11 selftests: damon: lru_sort.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.7.3 release. There are 346 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.7.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.7.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.7.3 release. There are 346 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.7.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.7.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.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.7.3 release. There are 346 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.7.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.7.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.7.3 release. There are 346 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.
Successfully compiled and installed the kernel on my computer (Acer Aspire E15, Intel Core i3 Haswell). No noticeable regressions.
Signature · 1 line
An old man doll... just what I always wanted! - Clara
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.7.3 release. There are 346 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.7.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.7.y
and the diffstat can be found below.thanks,
greg k-h
Built and booted successfully on RISC-V RV64 (HiFive Unmatched).
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.7.3 release. There are 346 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.7.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.7.y
and the diffstat can be found below.thanks,
greg k-h
No new regressions for Tegra ...
Test results for stable-v6.7:
10 builds: 10 pass, 0 fail
26 boots: 26 pass, 0 fail
116 tests: 115 pass, 1 failLinux version: 6.7.3-rc1-g7c05c677b6ca
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra194-p3509-0000+p3668-0000,
tegra20-ventana, tegra210-p2371-2180,
tegra210-p3450-0000, tegra30-cardhu-a04Test failures: tegra186-p2771-0000: pm-system-suspend.sh
Jon
Signature · 1 line
nvpublic
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.7.3 release. There are 346 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.7.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.7.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 6.7.3-rc1
* git: https://gitlab.com/Linaro/lkft/mirrors/stable/linux-stable-rc
* git branch: linux-6.7.y
* git commit: 7c05c677b6ca67bd17cb1606e63c1962e0c2e2a2
* git describe: v6.7.2-347-g7c05c677b6ca
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-6.7.y/build/v6.7.2-347-g7c05c677b6ca
## Test Regressions (compared to v6.7.1-639-g2320541f64ba)
## Metric Regressions (compared to v6.7.1-639-g2320541f64ba)
## Test Fixes (compared to v6.7.1-639-g2320541f64ba)
## Metric Fixes (compared to v6.7.1-639-g2320541f64ba)
## Test result summary
total: 142243, pass: 124118, fail: 1075, skip: 16831, xfail: 219
## Build Summary
* arc: 5 total, 5 passed, 0 failed
* arm: 145 total, 143 passed, 2 failed
* arm64: 52 total, 50 passed, 2 failed
* i386: 41 total, 38 passed, 3 failed
* mips: 26 total, 26 passed, 0 failed
* parisc: 4 total, 4 passed, 0 failed
* powerpc: 36 total, 36 passed, 0 failed
* riscv: 25 total, 24 passed, 1 failed
* s390: 13 total, 13 passed, 0 failed
* sh: 10 total, 10 passed, 0 failed
* sparc: 8 total, 8 passed, 0 failed
* x86_64: 46 total, 45 passed, 1 failed
## Test suites summary
* boot
* kselftest-arm64
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-exec
* kselftest-fpu
* kselftest-ftrace
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-kcmp
* kselftest-membarrier
* kselftest-mincore
* kselftest-mqueue
* kselftest-net
* kselftest-net-mptcp
* kselftest-openat2
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-sigaltstack
* kselftest-size
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user_events
* kselftest-vDSO
* kselftest-x86
* kunit
* kvm-unit-tests
* libgpiod
* libhugetlbfs
* log-parser-boot
* log-parser-test
* ltp-cap_bounds
* ltp-commands
* ltp-containers
* ltp-controllers
* ltp-cpuhotplug
* ltp-crypto
* ltp-cve
* ltp-dio
* ltp-fcntl-locktests
* ltp-filecaps
* ltp-fs
* ltp-fs_bind
* ltp-fs_perms_simple
* ltp-fsx
* ltp-hugetlb
* ltp-io
* ltp-ipc
* ltp-math
* ltp-mm
* ltp-nptl
* ltp-pty
* ltp-sched
* ltp-securebits
* ltp-smoke
* ltp-syscalls
* ltp-tracing
* network-basic-tests
* perf
* rcutorture
* v4l2-compliance
--
Linaro LKFT
https://lkft.linaro.org
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.7.3 release. There are 346 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.7.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.7.y
and the diffstat can be found below.thanks,
Hi Greg,
No noticeable regressions on my system.
[ 0.000000] Linux version 6.7.3-rc1-ktest-g7c05c677b6ca (rbmarliere@debian) (gcc (Debian 13.2.0-12) 13.2.0, GNU ld (GNU Binutils for Debian) 2.42) #2 SMP PREEMPT_DYNAMIC Mon Jan 29 22:13:17 -03 2024
Thank you,
- Ricardo.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 6.7.3 release. There are 346 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.7.3-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-6.7.y
and the diffstat can be found below.thanks,
greg k-h
Tested rc1 against the Fedora build system (aarch64, ppc64le, s390x, x86_64), and boot tested x86_64. No regressions noted.