cxl/mbox: Add a check on input payload size
Subsystems (17)
Sasha Levin
maintainerPATCH 1/30 cxl/mbox: Add a check on input payload size
From: Jonathan Cameron <[email protected]>
[ Upstream commit cf00b33058b196b4db928419dde68993b15a975b ]
A bug in the LSA code resulted in transfers slightly larger than the mailbox size. Let us make it easier to catch similar issues in future by adding a low level check.
--- drivers/cxl/core/mbox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/core/mbox.c +1 -1
@@ -174,7 +174,7 @@ int cxl_mbox_send_cmd(struct cxl_dev_state *cxlds, u16 opcode, void *in, };int rc; -if (out_size > cxlds->payload_size) +if (in_size > cxlds->payload_size || out_size > cxlds->payload_size)return -E2BIG ; rc = cxlds->mbox_send (cxlds, &mbox_cmd);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 2/30 RDMA/efa: Add EFA 0xefa2 PCI ID
From: Michael Margolin <[email protected]>
[ Upstream commit b75927cff13e0b3b652a12da7eb9a012911799e8 ]
Add support for 0xefa2 devices.
--- drivers/infiniband/hw/efa/efa_main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/efa/efa_main.c +3 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 OR BSD-2-Clause /* -* Copyright 2018-2021 Amazon.com, Inc. or its affiliates. All rights reserved. +* Copyright 2018-2022 Amazon.com, Inc. or its affiliates. All rights reserved. */ #include <linux/module.h>
@@ -14,10 +14,12 @@#define PCI_DEV_ID_EFA0_VF 0xefa0#define PCI_DEV_ID_EFA1_VF 0xefa1 +#define PCI_DEV_ID_EFA2_VF 0xefa2static const struct pci_device_id efa_pci_tbl[] = { {PCI_VDEVICE (AMAZON ,PCI_DEV_ID_EFA0_VF ) }, {PCI_VDEVICE (AMAZON ,PCI_DEV_ID_EFA1_VF ) }, + {PCI_VDEVICE (AMAZON ,PCI_DEV_ID_EFA2_VF ) }, { } };
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 3/30 btrfs: raid56: properly handle the error when unable to find the missing stripe
In reply to Sasha LevinFrom: Qu Wenruo <[email protected]>
[ Upstream commit f15fb2cd979a07fbfc666e2f04b8b30ec9233b2a ]
In raid56_alloc_missing_rbio(), if we can not determine where the missing device is inside the full stripe, we just BUG_ON().
This is not necessary especially the only caller inside scrub.c is already properly checking the return value, and will treat it as a memory allocation failure.
Fix the error handling by:
- Add an extra warning for the reason
Although personally speaking it may be better to be an ASSERT().
- Properly free the allocated rbio
--- fs/btrfs/raid56.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/btrfs/raid56.c +4 -2
@@ -2767,8 +2767,10 @@ raid56_alloc_missing_rbio(struct bio *bio, struct btrfs_io_context *bioc) rbio->faila =find_logical_bio_stripe (rbio, bio);if (rbio->faila ==-1 ) { -BUG (); -kfree (rbio); +btrfs_warn_rl (fs_info, +"can not determine the failed stripe number for full stripe %llu" , + bioc->raid_map[0 ]); +__free_raid_bio (rbio);return NULL ; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 4/30 NFSv4: Retry LOCK on OLD_STATEID during delegation return
In reply to Sasha LevinFrom: Benjamin Coddington <[email protected]>
[ Upstream commit f5ea16137a3fa2858620dc9084466491c128535f ]
There's a small window where a LOCK sent during a delegation return can race with another OPEN on client, but the open stateid has not yet been updated. In this case, the client doesn't handle the OLD_STATEID error from the server and will lose this lock, emitting:
"NFS: nfs4_handle_delegation_recall_error: unhandled error -10024".
Fix this by sending the task through the nfs4 error handling in nfs4_lock_done() when we may have to reconcile our stateid with what the server believes it to be. For this case, the result is a retry of the LOCK operation with the updated stateid.
--- fs/nfs/nfs4proc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
fs/nfs/nfs4proc.c +4 -2
@@ -7137,6 +7137,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata) {struct nfs4_lockdata *data = calldata;struct nfs4_lock_state *lsp = data->lsp; +struct nfs_server *server =NFS_SERVER (d_inode (data->ctx->dentry));if (!nfs4_sequence_done (task, &data->res.seq_res))return ;
@@ -7144,8 +7145,7 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata) data->rpc_status = task->tk_status;switch (task->tk_status) {case 0 : -renew_lease (NFS_SERVER (d_inode (data->ctx->dentry)), - data->timestamp); +renew_lease (server, data->timestamp);if (data->arg.new_lock && !data->cancelled) { data->fl.fl_flags &= ~(FL_SLEEP |FL_ACCESS );if (locks_lock_inode_wait (lsp->ls_state->inode, &data->fl) <0 )
@@ -7166,6 +7166,8 @@ static void nfs4_lock_done(struct rpc_task *task, void *calldata)if (!nfs4_stateid_match (&data->arg.open_stateid, &lsp->ls_state->open_stateid)) goto out_restart; +else if (nfs4_async_handle_error (task, server, lsp->ls_state,NULL ) == -EAGAIN ) + goto out_restart; }else if (!nfs4_stateid_match (&data->arg.lock_stateid, &lsp->ls_stateid)) goto out_restart;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 5/30 SUNRPC: Fix crasher in gss_unwrap_resp_integ()
In reply to Sasha LevinFrom: Chuck Lever <[email protected]>
[ Upstream commit 8a0fa3ff3b606b55c4edc71ad133e61529b64549 ]
If a zero length is passed to kmalloc() it returns 0x10, which is not a valid address. gss_unwrap_resp_integ() subsequently crashes when it attempts to dereference that pointer.
--- net/sunrpc/auth_gss/auth_gss.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/sunrpc/auth_gss/auth_gss.c +1 -1
@@ -1989,7 +1989,7 @@ gss_unwrap_resp_integ(struct rpc_task *task, struct rpc_cred *cred, goto unwrap_failed; mic.len = len; mic.data =kmalloc (len,GFP_KERNEL ); -if (!mic.data) +if (ZERO_OR_NULL_PTR (mic.data)) goto unwrap_failed;if (read_bytes_from_xdr_buf (rcv_buf, offset, mic.data, mic.len)) goto unwrap_failed;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 6/30 ACPI: x86: Add another system to quirk list for forcing StorageD3Enable
In reply to Sasha LevinFrom: Mario Limonciello <[email protected]>
[ Upstream commit 2124becad797245d49252d2d733aee0322233d7e ]
commit 018d6711c26e4 ("ACPI: x86: Add a quirk for Dell Inspiron 14 2-in-1 for StorageD3Enable") introduced a quirk to allow a system with ambiguous use of _ADR 0 to force StorageD3Enable.
Julius Brockmann reports that Inspiron 16 5625 suffers that same symptoms. Add this other system to the list as well.
--- drivers/acpi/x86/utils.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/acpi/x86/utils.c +6 -0
@@ -219,6 +219,12 @@ static const struct dmi_system_id force_storage_d3_dmi[] = { DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 14 7425 2-in-1"), } }, + { + .matches = { + DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), + DMI_MATCH(DMI_PRODUCT_NAME, "Inspiron 16 5625"), + } + }, {} };
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 7/30 drm/rockchip: vop2: fix null pointer in plane_atomic_disable
In reply to Sasha LevinFrom: Michael Tretter <[email protected]>
[ Upstream commit 471bf2406c043491b1a8288e5f04bc278f7d7ca1 ]
If the vop2_plane_atomic_disable function is called with NULL as a state, accessing the old_pstate runs into a null pointer exception. However, the drm_atomic_helper_disable_planes_on_crtc function calls the atomic_disable callback with state NULL.
Allow to disable a plane without passing a plane state by checking the old_pstate only if a state is passed.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +4 -2
@@ -997,13 +997,15 @@ static int vop2_plane_atomic_check(struct drm_plane *plane,static void vop2_plane_atomic_disable (struct drm_plane *plane,struct drm_atomic_state *state) { -struct drm_plane_state *old_pstate =drm_atomic_get_old_plane_state (state, plane); +struct drm_plane_state *old_pstate =NULL ;struct vop2_win *win =to_vop2_win (plane);struct vop2 *vop2 = win->vop2;drm_dbg (vop2->drm,"%s disable\n" , win->data->name); -if (!old_pstate->crtc) +if (state) + old_pstate =drm_atomic_get_old_plane_state (state, plane); +if (old_pstate && !old_pstate->crtc)return ;vop2_win_disable (win);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 8/30 drm/rockchip: vop2: disable planes when disabling the crtc
In reply to Sasha LevinFrom: Michael Tretter <[email protected]>
[ Upstream commit 447fb14bf07905b880c9ed1ea92c53d6dd0649d7 ]
The vop2 driver needs to explicitly disable the planes if the crtc is disabled. Unless the planes are explicitly disabled, the address of the last framebuffer is kept in the registers of the VOP2. When re-enabling the encoder after it has been disabled by the driver, the VOP2 will start and read the framebuffer that has been freed but is still pointed to by the register. The iommu will catch these read accesses and print errors.
Explicitly disable the planes when the crtc is disabled to reset the registers.
--- drivers/gpu/drm/rockchip/rockchip_drm_vop2.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/rockchip/rockchip_drm_vop2.c +4 -0
@@ -878,10 +878,14 @@ static void vop2_crtc_atomic_disable(struct drm_crtc *crtc, {struct vop2_video_port *vp =to_vop2_video_port (crtc);struct vop2 *vop2 = vp->vop2; +struct drm_crtc_state *old_crtc_state;int ret;vop2_lock (vop2); + old_crtc_state =drm_atomic_get_old_crtc_state (state, crtc); +drm_atomic_helper_disable_planes_on_crtc (old_crtc_state, false); +drm_crtc_vblank_off (crtc);/*
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 9/30 ksefltests: pidfd: Fix wait_states: Test terminated by timeout
In reply to Sasha LevinFrom: Li Zhijian <[email protected]>
[ Upstream commit 88e1f16ba58665e9edfce437ea487da2fa759af9 ]
0Day/LKP observed that the kselftest blocks forever since one of the pidfd_wait doesn't terminate in 1 of 30 runs. After digging into the source, we found that it blocks at:ASSERT_EQ(sys_waitid(P_PIDFD, pidfd, &info, WCONTINUED, NULL), 0);
wait_states has below testing flow:
CHILD PARENT
---------------+--------------
1 STOP itself
2 WAIT for CHILD STOPPED
3 SIGNAL CHILD to CONT
4 CONT
5 STOP itself
5' WAIT for CHILD CONT
6 WAIT for CHILD STOPPED
The problem is that the kernel cannot ensure the order of 5 and 5', once 5 goes first, the test will fail.
we can reproduce it by:
$ while true; do make run_tests -C pidfd; done
Introduce a blocking read in child process to make sure the parent can check its WCONTINUED.
--- tools/testing/selftests/pidfd/pidfd_wait.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
tools/testing/selftests/pidfd/pidfd_wait.c +10 -0
@@ -95,20 +95,28 @@ TEST(wait_states) .flags = CLONE_PIDFD | CLONE_PARENT_SETTID, .exit_signal = SIGCHLD, }; +int pfd[2 ];pid_t pid;siginfo_t info = { .si_signo =0 , }; +ASSERT_EQ (pipe (pfd),0 ); pid =sys_clone3 (&args);ASSERT_GE (pid,0 );if (pid ==0 ) { +char buf[2 ]; + +close (pfd[1 ]);kill (getpid (),SIGSTOP ); +ASSERT_EQ (read (pfd[0 ], buf,1 ),1 ); +close (pfd[0 ]);kill (getpid (),SIGSTOP );exit (EXIT_SUCCESS ); } +close (pfd[0 ]);ASSERT_EQ (sys_waitid (P_PIDFD , pidfd, &info,WSTOPPED ,NULL ),0 );ASSERT_EQ (info.si_signo,SIGCHLD );ASSERT_EQ (info.si_code,CLD_STOPPED );
@@ -117,6 +125,8 @@ TEST(wait_states)ASSERT_EQ (sys_pidfd_send_signal (pidfd,SIGCONT ,NULL ,0 ),0 );ASSERT_EQ (sys_waitid (P_PIDFD , pidfd, &info,WCONTINUED ,NULL ),0 ); +ASSERT_EQ (write (pfd[1 ],"C" ,1 ),1 ); +close (pfd[1 ]);ASSERT_EQ (info.si_signo,SIGCHLD );ASSERT_EQ (info.si_code,CLD_CONTINUED );ASSERT_EQ (info.si_pid, parent_tid);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 10/30 powerpc/64e: Fix amdgpu build on Book3E w/o AltiVec
In reply to Sasha LevinFrom: Michael Ellerman <[email protected]>
[ Upstream commit 2153fc9623e5465f503d793d4c94ad65e9ec9b5f ]
There's a build failure for Book3E without AltiVec:
Error: cc1: error: AltiVec not supported in this target make[6]: *** [/linux/scripts/Makefile.build:250:
drivers/gpu/drm/amd/amdgpu/../display/dc/dml/display_mode_lib.o] Error 1
This happens because the amdgpu build is only gated by PPC_LONG_DOUBLE_128, but that symbol can be enabled even though AltiVec is disabled.
The only user of PPC_LONG_DOUBLE_128 is amdgpu, so just add a dependency on AltiVec to that symbol to fix the build.
--- arch/powerpc/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/Kconfig +1 -1
@@ -284,7 +284,7 @@ config PPC # config PPC_LONG_DOUBLE_128 - depends on PPC64 + depends on PPC64 && ALTIVEC def_bool $(success,test "$(shell,echo __LONG_DOUBLE_128__ | $(CC) -E -P -)" = 1) config PPC_BARRIER_NOSPEC
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 11/30 block: blk_add_rq_to_plug(): clear stale 'last' after flush
In reply to Sasha LevinFrom: Al Viro <[email protected]>
[ Upstream commit 878eb6e48f240d02ed1c9298020a0b6370695f24 ]
blk_mq_flush_plug_list() empties ->mq_list and request we'd peeked there before that call is gone; in any case, we are not dealing with a mix of requests for different queues now - there's no requests left in the plug.
--- block/blk-mq.c | 1 + 1 file changed, 1 insertion(+)
block/blk-mq.c +1 -0
@@ -1183,6 +1183,7 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq) (!blk_queue_nomerges(rq->q) && blk_rq_bytes(last) >= BLK_PLUG_FLUSH_SIZE)) {blk_mq_flush_plug_list (plug, false); + last =NULL ;trace_block_plug (rq->q); }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 12/30 firmware: arm_scmi: Cleanup the core driver removal callback
In reply to Sasha LevinFrom: Cristian Marussi <[email protected]>
[ Upstream commit 3f4071cbd2063b917486d1047a4da47718215fee ]
Platform drivers .remove callbacks are not supposed to fail and report errors. Such errors are indeed ignored by the core platform drivers and the driver unbind process is anyway completed.
The SCMI core platform driver as it is now, instead, bails out reporting an error in case of an explicit unbind request.
Fix the removal path by adding proper device links between the core SCMI device and the SCMI protocol devices so that a full SCMI stack unbind is triggered when the core driver is removed. The remove process does not bail out anymore on the anomalous conditions triggered by an explicit unbind but the user is still warned.
--- drivers/firmware/arm_scmi/bus.c | 11 +++++++++++ drivers/firmware/arm_scmi/common.h | 1 + drivers/firmware/arm_scmi/driver.c | 31 ++++++++++++++++++------------ 3 files changed, 31 insertions(+), 12 deletions(-)
drivers/firmware/arm_scmi/bus.c +11 -0
@@ -216,9 +216,20 @@ void scmi_device_destroy(struct scmi_device *scmi_dev)device_unregister (&scmi_dev->dev); } +void scmi_device_link_add (struct device *consumer,struct device *supplier) +{ +struct device_link *link; + + link =device_link_add (consumer, supplier,DL_FLAG_AUTOREMOVE_CONSUMER ); + +WARN_ON (!link); +} +void scmi_set_handle (struct scmi_device *scmi_dev) { scmi_dev->handle =scmi_handle_get (&scmi_dev->dev); +if (scmi_dev->handle) +scmi_device_link_add (&scmi_dev->dev, scmi_dev->handle->dev); }int scmi_protocol_register (const struct scmi_protocol *proto)
drivers/firmware/arm_scmi/common.h +1 -0
@@ -97,6 +97,7 @@ static inline void unpack_scmi_header(u32 msg_hdr, struct scmi_msg_hdr *hdr)struct scmi_revision_info *scmi_revision_area_get (const struct scmi_protocol_handle *ph);int scmi_handle_put (const struct scmi_handle *handle); +void scmi_device_link_add (struct device *consumer,struct device *supplier);struct scmi_handle *scmi_handle_get (struct device *dev);void scmi_set_handle (struct scmi_device *scmi_dev); void scmi_setup_protocol_implemented(const struct scmi_protocol_handle *ph,
drivers/firmware/arm_scmi/driver.c +19 -12
@@ -2273,10 +2273,16 @@ int scmi_protocol_device_request(const struct scmi_device_id *id_table) sdev =scmi_get_protocol_device (child, info, id_table->protocol_id, id_table->name); -/* Set handle if not already set: device existed */ -if (sdev && !sdev->handle) - sdev->handle = -scmi_handle_get_from_info_unlocked (info); +if (sdev) { +/* Set handle if not already set: device existed */ +if (!sdev->handle) + sdev->handle = +scmi_handle_get_from_info_unlocked (info); +/* Relink consumer and suppliers */ +if (sdev->handle) +scmi_device_link_add (&sdev->dev, + sdev->handle->dev); + } }else { dev_err(info->dev, "Failed. SCMI protocol %d not active.\n",
@@ -2475,20 +2481,17 @@ void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id)static int scmi_remove (struct platform_device *pdev) { -int ret =0 , id; +int ret, id;struct scmi_info *info =platform_get_drvdata (pdev);struct device_node *child;mutex_lock (&scmi_list_mutex);if (info->users) - ret = -EBUSY ; -else -list_del (&info->node); +dev_warn (&pdev->dev, +"Still active SCMI users will be forcibly unbound.\n" ); +list_del (&info->node);mutex_unlock (&scmi_list_mutex); -if (ret) -return ret; -scmi_notification_exit (&info->handle);mutex_lock (&info->protocols_mtx);
@@ -2500,7 +2503,11 @@ static int scmi_remove(struct platform_device *pdev)idr_destroy (&info->active_protocols);/* Safe to free channels since no more users */ -return scmi_cleanup_txrx_channels (info); + ret =scmi_cleanup_txrx_channels (info); +if (ret) +dev_warn (&pdev->dev,"Failed to cleanup SCMI channels.\n" ); + +return 0 ; } static ssize_t protocol_version_show(struct device *dev,
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 13/30 firmware: arm_scmi: Make tx_prepare time out eventually
In reply to Sasha LevinFrom: Cristian Marussi <[email protected]>
[ Upstream commit 59172b212ec0dbb97ceb5671d912e6e61fa802d5 ]
SCMI transports based on shared memory, at start of transmissions, have to wait for the shared Tx channel area to be eventually freed by the SCMI platform before accessing the channel. In fact the channel is owned by the SCMI platform until marked as free by the platform itself and, as such, cannot be used by the agent until relinquished.
As a consequence a badly misbehaving SCMI platform firmware could lock the channel indefinitely and make the kernel side SCMI stack loop forever waiting for such channel to be freed, possibly hanging the whole boot sequence.
Add a timeout to the existent Tx waiting spin-loop so that, when the system ends up in this situation, the SCMI stack can at least bail-out, nosily warn the user, and abort the transmission.
--- drivers/firmware/arm_scmi/common.h | 4 +++- drivers/firmware/arm_scmi/driver.c | 1 + drivers/firmware/arm_scmi/mailbox.c | 2 +- drivers/firmware/arm_scmi/optee.c | 2 +- drivers/firmware/arm_scmi/shmem.c | 31 +++++++++++++++++++++++++---- drivers/firmware/arm_scmi/smc.c | 2 +- 6 files changed, 34 insertions(+), 8 deletions(-)
drivers/firmware/arm_scmi/common.h +3 -1
@@ -118,6 +118,7 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id);* * @dev: Reference to device in the SCMI hierarchy corresponding to this * channel +* @rx_timeout_ms: The configured RX timeout in milliseconds. * @handle: Pointer to SCMI entity handle * @no_completion_irq: Flag to indicate that this channel has no completion * interrupt mechanism for synchronous commands.
@@ -127,6 +128,7 @@ void scmi_protocol_release(const struct scmi_handle *handle, u8 protocol_id);*/ struct scmi_chan_info {struct device *dev; +unsigned int rx_timeout_ms;struct scmi_handle *handle;bool no_completion_irq;void *transport_info;
@@ -233,7 +235,7 @@ void scmi_free_channel(struct scmi_chan_info *cinfo, struct idr *idr, int id);struct scmi_shared_mem ;void shmem_tx_prepare (struct scmi_shared_mem __iomem *shmem, -struct scmi_xfer *xfer); +struct scmi_xfer *xfer,struct scmi_chan_info *cinfo);u32 shmem_read_header (struct scmi_shared_mem __iomem *shmem);void shmem_fetch_response (struct scmi_shared_mem __iomem *shmem,struct scmi_xfer *xfer);
drivers/firmware/arm_scmi/driver.c +1 -0
@@ -2013,6 +2013,7 @@ static int scmi_chan_setup(struct scmi_info *info, struct device *dev,return -ENOMEM ; cinfo->dev = dev; + cinfo->rx_timeout_ms = info->desc->max_rx_timeout_ms; ret = info->desc->ops->chan_setup (cinfo, info->dev, tx);if (ret)
drivers/firmware/arm_scmi/mailbox.c +1 -1
@@ -36,7 +36,7 @@ static void tx_prepare(struct mbox_client *cl, void *m) {struct scmi_mailbox *smbox =client_to_scmi_mailbox (cl); -shmem_tx_prepare (smbox->shmem, m); +shmem_tx_prepare (smbox->shmem, m, smbox->cinfo); }static void rx_callback (struct mbox_client *cl,void *m)
drivers/firmware/arm_scmi/optee.c +1 -1
@@ -498,7 +498,7 @@ static int scmi_optee_send_message(struct scmi_chan_info *cinfo,msg_tx_prepare (channel->req.msg, xfer); ret =invoke_process_msg_channel (channel,msg_command_size (xfer)); }else { -shmem_tx_prepare (channel->req.shmem, xfer); +shmem_tx_prepare (channel->req.shmem, xfer, cinfo); ret =invoke_process_smt_channel (channel); }
drivers/firmware/arm_scmi/shmem.c +27 -4
@@ -5,10 +5,13 @@* Copyright (C) 2019 ARM Ltd. */ +#include <linux/ktime.h> #include <linux/io.h> #include <linux/processor.h> #include <linux/types.h> +#include <asm-generic/bug.h> +#include "common.h" /*
@@ -30,16 +33,36 @@ struct scmi_shared_mem { };void shmem_tx_prepare (struct scmi_shared_mem __iomem *shmem, -struct scmi_xfer *xfer) +struct scmi_xfer *xfer,struct scmi_chan_info *cinfo) { +ktime_t stop; +/* * Ideally channel must be free by now unless OS timeout last * request and platform continued to process the same, wait * until it releases the shared memory, otherwise we may endup -* overwriting its response with new message payload or vice-versa +* overwriting its response with new message payload or vice-versa. +* Giving up anyway after twice the expected channel timeout so as +* not to bail-out on intermittent issues where the platform is +* occasionally a bit slower to answer. +* +* Note that after a timeout is detected we bail-out and carry on but +* the transport functionality is probably permanently compromised: +* this is just to ease debugging and avoid complete hangs on boot +* due to a misbehaving SCMI firmware. */ -spin_until_cond (ioread32 (&shmem->channel_status) & -SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE ); + stop =ktime_add_ms (ktime_get (),2 * cinfo->rx_timeout_ms); +spin_until_cond ((ioread32 (&shmem->channel_status) & +SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE ) || +ktime_after (ktime_get (), stop)); +if (!(ioread32 (&shmem->channel_status) & +SCMI_SHMEM_CHAN_STAT_CHANNEL_FREE )) { +WARN_ON_ONCE (1 ); +dev_err (cinfo->dev, +"Timeout waiting for a free TX channel !\n" ); +return ; + } +/* Mark channel busy + clear error */ iowrite32 (0x0 , &shmem->channel_status); iowrite32(xfer->hdr.poll_completion ? 0 : SCMI_SHMEM_FLAG_INTR_ENABLED,
drivers/firmware/arm_scmi/smc.c +1 -1
@@ -188,7 +188,7 @@ static int smc_send_message(struct scmi_chan_info *cinfo,*/ smc_channel_lock_acquire (scmi_info, xfer); -shmem_tx_prepare (scmi_info->shmem, xfer); +shmem_tx_prepare (scmi_info->shmem, xfer, cinfo);arm_smccc_1_1_invoke (scmi_info->func_id,0 ,0 ,0 ,0 ,0 ,0 ,0 , &res);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 14/30 i2c: tegra: Allocate DMA memory for DMA engine
In reply to Sasha LevinFrom: Thierry Reding <[email protected]>
[ Upstream commit cdbf26251d3b35c4ccaea0c3a6de4318f727d3d2 ]
When the I2C controllers are running in DMA mode, it is the DMA engine that performs the memory accesses rather than the I2C controller. Pass the DMA engine's struct device pointer to the DMA API to make sure the correct DMA operations are used.
This fixes an issue where the DMA engine's SMMU stream ID needs to be misleadingly set for the I2C controllers in device tree.
--- drivers/i2c/busses/i2c-tegra.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-)
drivers/i2c/busses/i2c-tegra.c +10 -6
@@ -284,6 +284,7 @@ struct tegra_i2c_dev {struct dma_chan *tx_dma_chan;struct dma_chan *rx_dma_chan;unsigned int dma_buf_size; +struct device *dma_dev;dma_addr_t dma_phys;void *dma_buf;
@@ -420,7 +421,7 @@ static int tegra_i2c_dma_submit(struct tegra_i2c_dev *i2c_dev, size_t len)static void tegra_i2c_release_dma (struct tegra_i2c_dev *i2c_dev) {if (i2c_dev->dma_buf) { -dma_free_coherent (i2c_dev->dev, i2c_dev->dma_buf_size, +dma_free_coherent (i2c_dev->dma_dev, i2c_dev->dma_buf_size, i2c_dev->dma_buf, i2c_dev->dma_phys); i2c_dev->dma_buf =NULL ; }
@@ -467,10 +468,13 @@ static int tegra_i2c_init_dma(struct tegra_i2c_dev *i2c_dev) i2c_dev->tx_dma_chan = chan; +WARN_ON (i2c_dev->tx_dma_chan->device != i2c_dev->rx_dma_chan->device); + i2c_dev->dma_dev = chan->device->dev; + i2c_dev->dma_buf_size = i2c_dev->hw->quirks->max_write_len +I2C_PACKET_HEADER_SIZE ; - dma_buf =dma_alloc_coherent (i2c_dev->dev, i2c_dev->dma_buf_size, + dma_buf =dma_alloc_coherent (i2c_dev->dma_dev, i2c_dev->dma_buf_size, &dma_phys,GFP_KERNEL | __GFP_NOWARN);if (!dma_buf) {dev_err (i2c_dev->dev,"failed to allocate DMA buffer\n" );
@@ -1267,7 +1271,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,if (i2c_dev->dma_mode) {if (i2c_dev->msg_read) { -dma_sync_single_for_device (i2c_dev->dev, +dma_sync_single_for_device (i2c_dev->dma_dev, i2c_dev->dma_phys, xfer_size,DMA_FROM_DEVICE );
@@ -1275,7 +1279,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,if (err)return err; }else { -dma_sync_single_for_cpu (i2c_dev->dev, +dma_sync_single_for_cpu (i2c_dev->dma_dev, i2c_dev->dma_phys, xfer_size,DMA_TO_DEVICE ); }
@@ -1288,7 +1292,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev,memcpy (i2c_dev->dma_buf +I2C_PACKET_HEADER_SIZE , msg->buf, msg->len); -dma_sync_single_for_device (i2c_dev->dev, +dma_sync_single_for_device (i2c_dev->dma_dev, i2c_dev->dma_phys, xfer_size,DMA_TO_DEVICE );
@@ -1339,7 +1343,7 @@ static int tegra_i2c_xfer_msg(struct tegra_i2c_dev *i2c_dev, }if (i2c_dev->msg_read && i2c_dev->msg_err ==I2C_ERR_NONE ) { -dma_sync_single_for_cpu (i2c_dev->dev, +dma_sync_single_for_cpu (i2c_dev->dma_dev, i2c_dev->dma_phys, xfer_size,DMA_FROM_DEVICE );
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 15/30 i2c: i801: add lis3lv02d's I2C address for Vostro 5568
In reply to Sasha LevinFrom: Nam Cao <[email protected]>
[ Upstream commit d6643d7207c572c1b0305ed505101f15502c6c87 ]
Dell Vostro 5568 laptop has lis3lv02d, but its i2c address is not known to the kernel. Add this address.
Output of "cat /sys/devices/platform/lis3lv02d/position" on Dell Vostro 5568 laptop:
- Horizontal: (-18,0,1044)
- Front elevated: (522,-18,1080)
- Left elevated: (-18,-360,1080)
- Upside down: (36,108,-1134)
--- drivers/i2c/busses/i2c-i801.c | 1 + 1 file changed, 1 insertion(+)
drivers/i2c/busses/i2c-i801.c +1 -0
@@ -1243,6 +1243,7 @@ static const struct {*/ { "Latitude 5480", 0x29 }, { "Vostro V131", 0x1d }, + { "Vostro 5568", 0x29 }, };static void register_dell_lis3lv02d_i2c_device (struct i801_priv *priv)
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 16/30 drm/imx: imx-tve: Fix return type of imx_tve_connector_mode_valid
In reply to Sasha LevinFrom: Nathan Huckleberry <[email protected]>
[ Upstream commit fc007fb815ab5395c3962c09b79a1630b0fbed9c ]
The mode_valid field in drm_connector_helper_funcs is expected to be of type:
enum drm_mode_status (* mode_valid) (struct drm_connector *connector,
struct drm_display_mode *mode);
The mismatched return type breaks forward edge kCFI since the underlying function definition does not match the function hook definition.
The return type of imx_tve_connector_mode_valid should be changed from int to enum drm_mode_status.
--- drivers/gpu/drm/imx/imx-tve.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/imx/imx-tve.c +3 -2
@@ -218,8 +218,9 @@ static int imx_tve_connector_get_modes(struct drm_connector *connector)return ret; } -static int imx_tve_connector_mode_valid (struct drm_connector *connector, -struct drm_display_mode *mode) +static enum drm_mode_status +imx_tve_connector_mode_valid (struct drm_connector *connector, +struct drm_display_mode *mode) {struct imx_tve *tve =con_to_tve (connector);unsigned long rate;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 17/30 btrfs: remove pointless and double ulist frees in error paths of qgroup tests
In reply to Sasha LevinFrom: Filipe Manana <[email protected]>
[ Upstream commit d0ea17aec12ea0f7b9d2ed727d8ef8169d1e7699 ]
Several places in the qgroup self tests follow the pattern of freeing the ulist pointer they passed to btrfs_find_all_roots() if the call to that function returned an error. That is pointless because that function always frees the ulist in case it returns an error.
Also In some places like at test_multiple_refs(), after a call to btrfs_qgroup_account_extent() we also leave "old_roots" and "new_roots" pointing to ulists that were freed, because btrfs_qgroup_account_extent() has freed those ulists, and if after that the next call to btrfs_find_all_roots() fails, we call ulist_free() on the "old_roots" ulist again, resulting in a double free.
So remove those calls to reduce the code size and avoid double ulist free in case of an error.
--- fs/btrfs/tests/qgroup-tests.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-)
fs/btrfs/tests/qgroup-tests.c +4 -12
@@ -225,7 +225,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root,*/ ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &old_roots, false);if (ret) { -ulist_free (old_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -238,7 +237,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots, false);if (ret) {ulist_free (old_roots); -ulist_free (new_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -250,17 +248,18 @@ static int test_no_shared_qgroup(struct btrfs_root *root,return ret; } +/* btrfs_qgroup_account_extent() always frees the ulists passed to it. */ + old_roots =NULL ; + new_roots =NULL ; +if (btrfs_verify_qgroup_counts (fs_info,BTRFS_FS_TREE_OBJECTID , nodesize, nodesize)) {test_err ("qgroup counts didn't match expected values" );return -EINVAL ; } - old_roots =NULL ; - new_roots =NULL ; ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &old_roots, false);if (ret) { -ulist_free (old_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -272,7 +271,6 @@ static int test_no_shared_qgroup(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots, false);if (ret) {ulist_free (old_roots); -ulist_free (new_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -322,7 +320,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &old_roots, false);if (ret) { -ulist_free (old_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -335,7 +332,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots, false);if (ret) {ulist_free (old_roots); -ulist_free (new_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -355,7 +351,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &old_roots, false);if (ret) { -ulist_free (old_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -368,7 +363,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots, false);if (ret) {ulist_free (old_roots); -ulist_free (new_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -394,7 +388,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &old_roots, false);if (ret) { -ulist_free (old_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
@@ -407,7 +400,6 @@ static int test_multiple_refs(struct btrfs_root *root, ret =btrfs_find_all_roots (&trans, fs_info, nodesize,0 , &new_roots, false);if (ret) {ulist_free (old_roots); -ulist_free (new_roots);test_err ("couldn't find old roots: %d" , ret);return ret; }
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 18/30 drm/amd/display: Ignore Cable ID Feature
In reply to Sasha LevinFrom: Fangzhi Zuo <[email protected]>
[ Upstream commit 14aed119942f6c2f1286022323139f7404db5d2b ]
Ignore cable ID for DP2 receivers that does not support the feature.
--- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -0
@@ -1549,6 +1549,9 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) adev->dm.dc->debug.visual_confirm = amdgpu_dc_visual_confirm; +/* TODO: Remove after DP2 receiver gets proper support of Cable ID feature */ + adev->dm.dc->debug.ignore_cable_id = true; + r =dm_dmub_hw_init (adev);if (r) {DRM_ERROR ("DMUB interface failed to initialize: status=%d\n" , r);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 19/30 drm/amd/display: Enable timing sync on DCN32
In reply to Sasha LevinFrom: Alvin Lee <[email protected]>
[ Upstream commit c3d3f35b725bf9c93bec6d3c056f6bb7cfd27403 ]
Missed enabling timing sync on DCN32 because DCN32 has a different DML param.
--- drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/display/dc/dml/dcn20/dcn20_fpu.c +1 -0
@@ -1228,6 +1228,7 @@ int dcn20_populate_dml_pipes_from_context( pipes[pipe_cnt].pipe.src.dcc = false; pipes[pipe_cnt].pipe.src.dcc_rate =1 ; pipes[pipe_cnt].pipe.dest.synchronized_vblank_all_planes = synchronized_vblank; + pipes[pipe_cnt].pipe.dest.synchronize_timings = synchronized_vblank; pipes[pipe_cnt].pipe.dest.hblank_start = timing->h_total - timing->h_front_porch; pipes[pipe_cnt].pipe.dest.hblank_end = pipes[pipe_cnt].pipe.dest.hblank_start - timing->h_addressable
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 20/30 drm/amdgpu: set fb_modifiers_not_supported in vkms
In reply to Sasha LevinFrom: Yifan Zhang <[email protected]>
[ Upstream commit 89b3554782e6b65894f0551e9e0a82ad02dac94d ]
This patch to fix the gdm3 start failure with virual display:
/usr/libexec/gdm-x-session[1711]: (II) AMDGPU(0): Setting screen physical size to 270 x 203 /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): Failed to make import prime FD as pixmap: 22 /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): failed to set mode: Invalid argument /usr/libexec/gdm-x-session[1711]: (WW) AMDGPU(0): Failed to set mode on CRTC 0 /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): Failed to enable any CRTC gnome-shell[1840]: Running GNOME Shell (using mutter 42.2) as a X11 window and compositing manager /usr/libexec/gdm-x-session[1711]: (EE) AMDGPU(0): failed to set mode: Invalid argument
vkms doesn't have modifiers support, set fb_modifiers_not_supported to bring the gdm back.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_vkms.c +2 -0
@@ -500,6 +500,8 @@ static int amdgpu_vkms_sw_init(void *handle)adev_to_drm (adev)->mode_config.fb_base = adev->gmc.aper_base; +adev_to_drm (adev)->mode_config.fb_modifiers_not_supported = true; + r =amdgpu_display_modeset_create_props (adev);if (r)return r;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 21/30 drm/amd: Fail the suspend if resources can't be evicted
In reply to Sasha LevinFrom: Mario Limonciello <[email protected]>
[ Upstream commit 8d4de331f1b24a22d18e3c6116aa25228cf54854 ]
If a system does not have swap and memory is under 100% usage, amdgpu will fail to evict resources. Currently the suspend carries on proceeding to reset the GPU:
``` [drm] evicting device resources failed [drm:amdgpu_device_ip_suspend_phase2 [amdgpu]] *ERROR* suspend of IP block <vcn_v3_0> failed -12 [drm] free PSP TMR buffer [TTM] Failed allocating page table [drm] evicting device resources failed amdgpu 0000:03:00.0: amdgpu: MODE1 reset amdgpu 0000:03:00.0: amdgpu: GPU mode1 reset amdgpu 0000:03:00.0: amdgpu: GPU smu mode1 reset ```
At this point if the suspend actually succeeded I think that amdgpu would have recovered because the GPU would have power cut off and restored. However the kernel fails to continue the suspend from the memory pressure and amdgpu fails to run the "resume" from the aborted suspend.
``` ACPI: PM: Preparing to enter system sleep state S3 SLUB: Unable to allocate memory on node -1, gfp=0xdc0(GFP_KERNEL|__GFP_ZERO) cache: Acpi-State, object size: 80, buffer size: 80, default order: 0, min order: 0 node 0: slabs: 22, objs: 1122, free: 0 ACPI Error: AE_NO_MEMORY, Could not update object reference count (20210730/utdelete-651) [drm:psp_hw_start [amdgpu]] *ERROR* PSP load kdb failed! [drm:psp_resume [amdgpu]] *ERROR* PSP resume failed [drm:amdgpu_device_fw_loading [amdgpu]] *ERROR* resume of IP block <psp> failed -62 amdgpu 0000:03:00.0: amdgpu: amdgpu_device_ip_resume failed (-62). PM: dpm_run_callback(): pci_pm_resume+0x0/0x100 returns -62 amdgpu 0000:03:00.0: PM: failed to resume async: error -62 ```
To avoid this series of unfortunate events, fail amdgpu's suspend when the memory eviction fails. This will let the system gracefully recover and the user can try suspend again when the memory pressure is relieved.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +10 -5
@@ -4055,15 +4055,18 @@ void amdgpu_device_fini_sw(struct amdgpu_device *adev)* at suspend time. * */ -static void amdgpu_device_evict_resources (struct amdgpu_device *adev) +static int amdgpu_device_evict_resources (struct amdgpu_device *adev) { +int ret; +/* No need to evict vram on APUs for suspend to ram or s2idle */ if ((adev->in_s3 || adev->in_s0ix) && (adev->flags &AMD_IS_APU )) -return ; +return 0 ; -if (amdgpu_ttm_evict_resources (adev,TTM_PL_VRAM )) + ret =amdgpu_ttm_evict_resources (adev,TTM_PL_VRAM ); +if (ret)DRM_WARN ("evicting device resources failed\n" ); - +return ret; }/*
@@ -4113,7 +4116,9 @@ int amdgpu_device_suspend(struct drm_device *dev, bool fbcon)if (!adev->in_s0ix)amdgpu_amdkfd_suspend (adev, adev->in_runpm); -amdgpu_device_evict_resources (adev); + r =amdgpu_device_evict_resources (adev); +if (r) +return r;amdgpu_fence_driver_hw_fini (adev);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 22/30 drm/amd/display: Fix DCN32 DSC delay calculation
In reply to Sasha LevinFrom: George Shen <[email protected]>
[ Upstream commit bad610c97c08eef3ed1fa769a8b08b94f95b451e ]
[Why]
DCN32 DSC delay calculation had an unintentional integer division, resulting in a mismatch against the DML spreadsheet.
[How]
Cast numerator to double before performing the division.
--- .../gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +1 -1
@@ -1746,7 +1746,7 @@ unsigned int dml32_DSCDelayRequirement(bool DSCEnabled, } DSCDelayRequirement_val = DSCDelayRequirement_val + (HTotal - HActive) * -dml_ceil (DSCDelayRequirement_val / HActive,1 ); +dml_ceil ((double )DSCDelayRequirement_val / HActive,1 ); DSCDelayRequirement_val = DSCDelayRequirement_val * PixelClock / PixelClockBackEnd;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 23/30 drm/amd/display: Use forced DSC bpp in DML
In reply to Sasha LevinFrom: George Shen <[email protected]>
[ Upstream commit ab007e5db5d3b8b8975c7eec69992ff38fe2a46c ]
[Why]
DSC config is calculated separately from DML calculations. DML should use these separately calculated DSC params. The issue is that the calculated bpp is not properly propagated into DML.
[How]
Correctly used forced_bpp value in DML.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 2 +- drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +1 -1
@@ -1627,7 +1627,7 @@ static void mode_support_configuration(struct vba_vars_st *v, && !mode_lib->vba.MSOOrODMSplitWithNonDPLink && !mode_lib->vba.NotEnoughLanesForMSO && mode_lib->vba.LinkCapacitySupport[i] == true && !mode_lib->vba.P2IWith420 - && !mode_lib->vba.DSCOnlyIfNecessaryWithBPP +//&& !mode_lib->vba.DSCOnlyIfNecessaryWithBPP && !mode_lib->vba.DSC422NativeNotSupported && !mode_lib->vba.MPCCombineMethodIncompatible && mode_lib->vba.ODMCombine2To1SupportCheckOK[i] == true
drivers/gpu/drm/amd/display/dc/dml/display_mode_vba.c +1 -1
@@ -624,7 +624,7 @@ static void fetch_pipe_params(struct display_mode_lib *mode_lib) mode_lib->vba.skip_dio_check[mode_lib->vba.NumberOfActivePlanes] = dout->is_virtual; -if (!dout->dsc_enable) +if (dout->dsc_enable) mode_lib->vba.ForcedOutputLinkBPP[mode_lib->vba.NumberOfActivePlanes] = dout->output_bpp;else mode_lib->vba.ForcedOutputLinkBPP[mode_lib->vba.NumberOfActivePlanes] =0.0 ;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 24/30 drm/amd/display: Round up DST_after_scaler to nearest int
In reply to Sasha LevinFrom: George Shen <[email protected]>
[ Upstream commit 8dc323133d74518e3b5b07242e2b2f088799ea6e ]
[Why]
The DST_after_scaler value that DML spreadsheet outputs is generally the driver value round up to the nearest int.
--- .../gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_rq_dlg_calc_32.c +2 -2
@@ -291,8 +291,8 @@ void dml32_rq_dlg_get_dlg_reg(struct display_mode_lib *mode_lib,dml_print ("DML_DLG: %s: vready_after_vcount0 = %d\n" , __func__, dlg_regs->vready_after_vcount0); - dst_x_after_scaler =get_dst_x_after_scaler (mode_lib, e2e_pipe_param, num_pipes, pipe_idx); - dst_y_after_scaler =get_dst_y_after_scaler (mode_lib, e2e_pipe_param, num_pipes, pipe_idx); + dst_x_after_scaler =dml_ceil (get_dst_x_after_scaler (mode_lib, e2e_pipe_param, num_pipes, pipe_idx),1 ); + dst_y_after_scaler =dml_ceil (get_dst_y_after_scaler (mode_lib, e2e_pipe_param, num_pipes, pipe_idx),1 );// do some adjustment on the dst_after scaler to account for odm combine mode dml_print ("DML_DLG: %s: input dst_x_after_scaler = %d\n" , __func__, dst_x_after_scaler);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 25/30 drm/amd/display: Investigate tool reported FCLK P-state deviations
In reply to Sasha LevinFrom: Nevenko Stupar <[email protected]>
[ Upstream commit 7461016c5706eb8c477752bf69e5c9f5a38f502b ]
[Why]
Fix for some of the tool reported modes for FCLK P-state deviations and UCLK P-state deviations that are coming from DSC terms and/or Scaling terms causing MinActiveFCLKChangeLatencySupported and MaxActiveDRAMClockChangeLatencySupported incorrectly calculated in DML for these configurations.
--- drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +2 -1
@@ -364,7 +364,8 @@ static void DISPCLKDPPCLKDCFCLKDeepSleepPrefetchParametersWatermarksAndPerformanfor (k =0 ; k < mode_lib->vba.NumberOfActiveSurfaces; ++k) { v->DSCDelay[k] =dml32_DSCDelayRequirement (mode_lib->vba.DSCEnabled[k], mode_lib->vba.ODMCombineEnabled[k], mode_lib->vba.DSCInputBitPerComponent[k], - mode_lib->vba.OutputBpp[k], mode_lib->vba.HActive[k], mode_lib->vba.HTotal[k], + mode_lib->vba.OutputBppPerState[mode_lib->vba.VoltageLevel][k], + mode_lib->vba.HActive[k], mode_lib->vba.HTotal[k], mode_lib->vba.NumberOfDSCSlices[k], mode_lib->vba.OutputFormat[k], mode_lib->vba.Output[k], mode_lib->vba.PixelClock[k], mode_lib->vba.PixelClockBackEnd[k]);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 26/30 Bluetooth: L2CAP: Fix l2cap_global_chan_by_psm
In reply to Sasha LevinFrom: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit f937b758a188d6fd328a81367087eddbb2fce50f ]
l2cap_global_chan_by_psm shall not return fixed channels as they are not meant to be connected by (S)PSM.
--- net/bluetooth/l2cap_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/bluetooth/l2cap_core.c +1 -1
@@ -1990,7 +1990,7 @@ static struct l2cap_chan *l2cap_global_chan_by_psm(int state, __le16 psm,if (link_type ==LE_LINK && c->src_type ==BDADDR_BREDR )continue ; -if (c->psm == psm) { +if (c->chan_type !=L2CAP_CHAN_FIXED && c->psm == psm) {int src_match, dst_match;int src_any, dst_any;
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 27/30 cxl/pmem: Use size_add() against integer overflow
In reply to Sasha LevinFrom: Yu Zhe <[email protected]>
[ Upstream commit 4f1aa35f1fb7d51b125487c835982af792697ecb ]
"struct_size() + n" may cause a integer overflow,
use size_add() to handle it.
--- drivers/cxl/pmem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/cxl/pmem.c +1 -1
@@ -148,7 +148,7 @@ static int cxl_pmem_set_config_data(struct cxl_dev_state *cxlds,return -EINVAL ;/* 4-byte status follows the input data in the payload */ -if (struct_size (cmd, in_buf, cmd->in_length) +4 > buf_len) +if (size_add (struct_size (cmd, in_buf, cmd->in_length),4 ) > buf_len)return -EINVAL ; set_lsa =
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 28/30 x86/cpu: Add several Intel server CPU model numbers
In reply to Sasha LevinFrom: Tony Luck <[email protected]>
[ Upstream commit 7beade0dd41d42d797ccb7791b134a77fcebf35b ]
These servers are all on the public versions of the roadmap. The model numbers for Grand Ridge, Granite Rapids, and Sierra Forest were included in the September 2022 edition of the Instruction Set Extensions document.
--- arch/x86/include/asm/intel-family.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
arch/x86/include/asm/intel-family.h +10 -1
@@ -107,6 +107,11 @@#define INTEL_FAM6_SAPPHIRERAPIDS_X 0x8F/* Golden Cove */ +#define INTEL_FAM6_EMERALDRAPIDS_X 0xCF + +#define INTEL_FAM6_GRANITERAPIDS_X 0xAD +#define INTEL_FAM6_GRANITERAPIDS_D 0xAE +#define INTEL_FAM6_ALDERLAKE 0x97/* Golden Cove / Gracemont */ #define INTEL_FAM6_ALDERLAKE_L 0x9A/* Golden Cove / Gracemont */ #define INTEL_FAM6_ALDERLAKE_N 0xBE
@@ -118,7 +123,7 @@#define INTEL_FAM6_METEORLAKE 0xAC#define INTEL_FAM6_METEORLAKE_L 0xAA -/* "Small Core" Processors (Atom) */ +/* "Small Core" Processors (Atom/E-Core) */ #define INTEL_FAM6_ATOM_BONNELL 0x1C/* Diamondville, Pineview */ #define INTEL_FAM6_ATOM_BONNELL_MID 0x26/* Silverthorne, Lincroft */
@@ -145,6 +150,10 @@#define INTEL_FAM6_ATOM_TREMONT 0x96/* Elkhart Lake */ #define INTEL_FAM6_ATOM_TREMONT_L 0x9C/* Jasper Lake */ +#define INTEL_FAM6_SIERRAFOREST_X 0xAF + +#define INTEL_FAM6_GRANDRIDGE 0xB6 +/* Xeon Phi */ #define INTEL_FAM6_XEON_PHI_KNL 0x57/* Knights Landing */
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 29/30 tools/testing/cxl: Fix some error exits
In reply to Sasha LevinFrom: Dan Williams <[email protected]>
[ Upstream commit 86e86c3cb63325c12ea99fbce2cc5bafba86bb40 ]
Fix a few typos where 'goto err_port' was used rather than the object specific cleanup.
--- tools/testing/cxl/test/cxl.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
tools/testing/cxl/test/cxl.c +2 -2
@@ -695,7 +695,7 @@ static __init int cxl_test_init(void) pdev =platform_device_alloc ("cxl_switch_uport" , i);if (!pdev) - goto err_port; + goto err_uport; pdev->dev.parent = &root_port->dev; rc =platform_device_add (pdev);
@@ -713,7 +713,7 @@ static __init int cxl_test_init(void) pdev =platform_device_alloc ("cxl_switch_dport" , i);if (!pdev) - goto err_port; + goto err_dport; pdev->dev.parent = &uport->dev; rc =platform_device_add (pdev);
Signature · 1 line
2.35.1
Sasha Levin
maintainerPATCH 30/30 cifs: always iterate smb sessions using primary channel
In reply to Sasha LevinFrom: Shyam Prasad N <[email protected]>
[ Upstream commit 8abcaeaed38109e5ccaf40218e0e9e387f07bfe6 ]
smb sessions and tcons currently hang off primary channel only. Secondary channels have the lists as empty. Whenever there's a need to iterate sessions or tcons, we should use the list in the corresponding primary channel.
--- fs/cifs/misc.c | 6 +++++- fs/cifs/smb2misc.c | 12 ++++++++++-- fs/cifs/smb2ops.c | 6 +++++- fs/cifs/smb2transport.c | 6 +++++- 4 files changed, 25 insertions(+), 5 deletions(-)
fs/cifs/misc.c +5 -1
@@ -400,6 +400,7 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv) {struct smb_hdr *buf = (struct smb_hdr *)buffer;struct smb_com_lock_req *pSMB = (struct smb_com_lock_req *)buf; +struct TCP_Server_Info *pserver;struct cifs_ses *ses;struct cifs_tcon *tcon;struct cifsInodeInfo *pCifsInode;
@@ -464,9 +465,12 @@ is_valid_oplock_break(char *buffer, struct TCP_Server_Info *srv)if (!(pSMB->LockType &LOCKING_ANDX_OPLOCK_RELEASE ))return false; +/* If server is a channel, select the primary channel */ + pserver =CIFS_SERVER_IS_CHAN (srv) ? srv->primary_server : srv; +/* look up tcon based on tid & uid */ spin_lock (&cifs_tcp_ses_lock); -list_for_each_entry (ses, &srv->smb_ses_list, smb_ses_list) { +list_for_each_entry (ses, &pserver->smb_ses_list, smb_ses_list) {list_for_each_entry (tcon, &ses->tcon_list, tcon_list) {if (tcon->tid != buf->Tid)continue ;
fs/cifs/smb2misc.c +10 -2
@@ -135,6 +135,7 @@ static __u32 get_neg_ctxt_len(struct smb2_hdr *hdr, __u32 len,int smb2_check_message (char *buf,unsigned int len,struct TCP_Server_Info *server) { +struct TCP_Server_Info *pserver;struct smb2_hdr *shdr = (struct smb2_hdr *)buf;struct smb2_pdu *pdu = (struct smb2_pdu *)shdr;int hdr_size =sizeof (struct smb2_hdr );
@@ -143,6 +144,9 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)__u32 calc_len;/* calculated length */ __u64 mid; +/* If server is a channel, select the primary channel */ + pserver =CIFS_SERVER_IS_CHAN (server) ? server->primary_server : server; +/* * Add function to do table lookup of StructureSize by command * ie Validate the wct via smb2_struct_sizes table above
@@ -155,7 +159,7 @@ smb2_check_message(char *buf, unsigned int len, struct TCP_Server_Info *server)/* decrypt frame now that it is completely read in */ spin_lock (&cifs_tcp_ses_lock); -list_for_each_entry (iter, &server->smb_ses_list, smb_ses_list) { +list_for_each_entry (iter, &pserver->smb_ses_list, smb_ses_list) {if (iter->Suid ==le64_to_cpu (thdr->SessionId)) { ses = iter;break ;
@@ -671,6 +675,7 @@ bool smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server) {struct smb2_oplock_break *rsp = (struct smb2_oplock_break *)buffer; +struct TCP_Server_Info *pserver;struct cifs_ses *ses;struct cifs_tcon *tcon;struct cifsInodeInfo *cinode;
@@ -691,9 +696,12 @@ smb2_is_valid_oplock_break(char *buffer, struct TCP_Server_Info *server)cifs_dbg (FYI ,"oplock level 0x%x\n" , rsp->OplockLevel); +/* If server is a channel, select the primary channel */ + pserver =CIFS_SERVER_IS_CHAN (server) ? server->primary_server : server; +/* look up tcon based on tid & uid */ spin_lock (&cifs_tcp_ses_lock); -list_for_each_entry (ses, &server->smb_ses_list, smb_ses_list) { +list_for_each_entry (ses, &pserver->smb_ses_list, smb_ses_list) {list_for_each_entry (tcon, &ses->tcon_list, tcon_list) {spin_lock (&tcon->open_file_lock);
fs/cifs/smb2ops.c +5 -1
@@ -2288,14 +2288,18 @@ static void smb2_is_network_name_deleted(char *buf, struct TCP_Server_Info *server) {struct smb2_hdr *shdr = (struct smb2_hdr *)buf; +struct TCP_Server_Info *pserver;struct cifs_ses *ses;struct cifs_tcon *tcon;if (shdr->Status !=STATUS_NETWORK_NAME_DELETED )return ; +/* If server is a channel, select the primary channel */ + pserver =CIFS_SERVER_IS_CHAN (server) ? server->primary_server : server; +spin_lock (&cifs_tcp_ses_lock); -list_for_each_entry (ses, &server->smb_ses_list, smb_ses_list) { +list_for_each_entry (ses, &pserver->smb_ses_list, smb_ses_list) {list_for_each_entry (tcon, &ses->tcon_list, tcon_list) {if (tcon->tid ==le32_to_cpu (shdr->Id.SyncId.TreeId)) {spin_lock (&tcon->tc_lock);
fs/cifs/smb2transport.c +5 -1
@@ -140,9 +140,13 @@ int smb2_get_sign_key(__u64 ses_id, struct TCP_Server_Info *server, u8 *key)static struct cifs_ses *smb2_find_smb_ses_unlocked (struct TCP_Server_Info *server,__u64 ses_id) { +struct TCP_Server_Info *pserver;struct cifs_ses *ses; -list_for_each_entry (ses, &server->smb_ses_list, smb_ses_list) { +/* If server is a channel, select the primary channel */ + pserver =CIFS_SERVER_IS_CHAN (server) ? server->primary_server : server; + +list_for_each_entry (ses, &pserver->smb_ses_list, smb_ses_list) {if (ses->Suid != ses_id)continue ; ++ses->ses_count;
Signature · 1 line
2.35.1