From patchwork Tue Jun 25 09:31:31 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1952007 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7fk30sDKz20ZS for ; Tue, 25 Jun 2024 19:32:11 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM2Wz-0008Qy-Bn; Tue, 25 Jun 2024 09:32:05 +0000 Received: from mail-pl1-f173.google.com ([209.85.214.173]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM2Wx-0008Pg-Bw for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 09:32:03 +0000 Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-1f480624d10so43691085ad.1 for ; Tue, 25 Jun 2024 02:32:03 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719307921; x=1719912721; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=H7YKlAG4FzKCKzRnejs5KdoTRvNmdzogtzwK25t3qWQ=; b=lP9rVQZvoPTtFRF9pUK48gwaVpPu/mMpdzGh9PUt/aghACmipYOOR/Dnp4dPEqluJX GuATBmyytWM9jXSDOrrmZHK87BUuspwAKHCkFFQEBiUyfDabJjnXWEynMcYzGXuGFR/Y SHmcnGAhuE/uyVUctng8eWyHoPS2mEZ/E4rHZB06ZefIBEWr2FFyMgeumTfdJWp9jFwZ 4AgiICahvAxu50EAHXJnPttGQ87XgB2SC/FJ14Eqa1CP+xXRFKrxepoNtMe2C9glmlwt PHsH3+Pz92frKH5PFC70JySraTnWOkPu1o1sirP5Nix9ipLKnsOiQPrTbCX2kebCnl6f E8WA== X-Gm-Message-State: AOJu0Ywy0yGyO+G3khdDvlM3S9n0F6pOByl4hmRk2S9N3KSRghHlBtUQ I/zmfJcMoXF+EmRrATjgokmto8d8TAv/gSlshfKy+Tc4LrLRDs5SAjzMGVFu X-Google-Smtp-Source: AGHT+IFDGGN6FoU7C6Dea1WDLvKJ+2P6nBrKICwTQb8uu+6Xpiuu34edHV/N4pdvWi8tyCgrx5HTZA== X-Received: by 2002:a17:902:bb84:b0:1f9:9422:9ccb with SMTP id d9443c01a7336-1fa1d6835b6mr71593965ad.54.1719307920632; Tue, 25 Jun 2024 02:32:00 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb3c5a74sm76664405ad.151.2024.06.25.02.31.59 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 02:32:00 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 1/8][SRU][Noble] mei: vsc: Don't stop/restart mei device during system suspend/resume Date: Tue, 25 Jun 2024 17:31:31 +0800 Message-ID: <20240625093138.3793885-2-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625093138.3793885-1-vicamo.yang@canonical.com> References: <20240625093138.3793885-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.173; envelope-from=vicamo@gmail.com; helo=mail-pl1-f173.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Wentong Wu BugLink: https://bugs.launchpad.net/bugs/2067364 The dynamically created mei client device (mei csi) is used as one V4L2 sub device of the whole video pipeline, and the V4L2 connection graph is built by software node. The mei_stop() and mei_restart() will delete the old mei csi client device and create a new mei client device, which will cause the software node information saved in old mei csi device lost and the whole video pipeline will be broken. Removing mei_stop()/mei_restart() during system suspend/resume can fix the issue above and won't impact hardware actual power saving logic. Fixes: f6085a96c973 ("mei: vsc: Unregister interrupt handler for system suspend") Cc: stable@vger.kernel.org # for 6.8+ Reported-by: Hao Yao Signed-off-by: Wentong Wu Reviewed-by: Sakari Ailus Tested-by: Jason Chen Tested-by: Sakari Ailus Acked-by: Tomas Winkler Link: https://lore.kernel.org/r/20240527123835.522384-1-wentong.wu@intel.com Signed-off-by: Greg Kroah-Hartman (cherry picked from commit 9b5e045029d8bded4c6979874ed3abc347c1415c) Signed-off-by: You-Sheng Yang --- drivers/misc/mei/platform-vsc.c | 39 +++++++++++++-------------------- 1 file changed, 15 insertions(+), 24 deletions(-) diff --git a/drivers/misc/mei/platform-vsc.c b/drivers/misc/mei/platform-vsc.c index 8db0fcf24e70..5a445f3b96a9 100644 --- a/drivers/misc/mei/platform-vsc.c +++ b/drivers/misc/mei/platform-vsc.c @@ -401,41 +401,32 @@ static int mei_vsc_remove(struct platform_device *pdev) static int mei_vsc_suspend(struct device *dev) { - struct mei_device *mei_dev = dev_get_drvdata(dev); - struct mei_vsc_hw *hw = mei_dev_to_vsc_hw(mei_dev); + struct mei_device *mei_dev; + int ret = 0; - mei_stop(mei_dev); + mei_dev = dev_get_drvdata(dev); + if (!mei_dev) + return -ENODEV; - mei_disable_interrupts(mei_dev); + mutex_lock(&mei_dev->device_lock); - vsc_tp_free_irq(hw->tp); + if (!mei_write_is_idle(mei_dev)) + ret = -EAGAIN; - return 0; + mutex_unlock(&mei_dev->device_lock); + + return ret; } static int mei_vsc_resume(struct device *dev) { - struct mei_device *mei_dev = dev_get_drvdata(dev); - struct mei_vsc_hw *hw = mei_dev_to_vsc_hw(mei_dev); - int ret; - - ret = vsc_tp_request_irq(hw->tp); - if (ret) - return ret; - - ret = mei_restart(mei_dev); - if (ret) - goto err_free; + struct mei_device *mei_dev; - /* start timer if stopped in suspend */ - schedule_delayed_work(&mei_dev->timer_work, HZ); + mei_dev = dev_get_drvdata(dev); + if (!mei_dev) + return -ENODEV; return 0; - -err_free: - vsc_tp_free_irq(hw->tp); - - return ret; } static DEFINE_SIMPLE_DEV_PM_OPS(mei_vsc_pm_ops, mei_vsc_suspend, mei_vsc_resume); From patchwork Tue Jun 25 09:31:32 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1952008 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7fk609xVz20X6 for ; Tue, 25 Jun 2024 19:32:14 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM2X2-0008Ss-0h; Tue, 25 Jun 2024 09:32:08 +0000 Received: from mail-pl1-f179.google.com ([209.85.214.179]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM2Wy-0008Pw-FL for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 09:32:04 +0000 Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-1f9b523a15cso37804085ad.0 for ; Tue, 25 Jun 2024 02:32:04 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719307922; x=1719912722; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=af9Ku23chq0WCbpFA/zESUEXFxtR1KXXr1u0FAIUpqI=; b=MOphKPuhtSSlh3U5PfWBmbjHfihZob4X/MEvofrwRjsfVIqGStytRP6oe263GIJLPE hfBlOtU4+m4Q6bPAyepc+jJZ21VPOyhL/MQ3sKPm1G5/cm8gO11PZGYtrozLar1c1avw 5Q/r0BDkVnNt403UarUJM1nyqQwz77d5kWnc0MkiRqpyh0fLSH2PEyzLfnNSEOKxX6D0 DQDeJve5qRJgT4J6z94p2xLiLURNm1dOJkHaUWeYxJy/HEOTEZZxH/NcSkC+FaooWSHq llRsUL++iszNzqQvmZYBHlCxlG9eyV6rbPWM1a8jc+yFi9QKvx91ZkQP/CuOJ/AcfU7A 1WUA== X-Gm-Message-State: AOJu0Yz6XFnw+ez/SPOmDud+JiwNsW5p2d81UFRXN4IRCniGBDoZ3cec QxZio7WVZ99dHAZIGgU1eY9NxxWDc0kNiDkBjQuEAalUo0yLeZREUOYC82SZ X-Google-Smtp-Source: AGHT+IGFeumL9yzc8GaiUmTSrydEYso6wIVL4t+2Tn8P6blsPVZ5jk+NrPhjWcz+1O/7q4GX3xlSCg== X-Received: by 2002:a17:902:ea0e:b0:1f7:3a70:9e71 with SMTP id d9443c01a7336-1fa5e6723f7mr48465475ad.13.1719307922337; Tue, 25 Jun 2024 02:32:02 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb3c5a74sm76664405ad.151.2024.06.25.02.32.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 02:32:01 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 2/8][SRU][Noble] UBUNTU: SAUCE: media: ivsc: csi: don't count privacy on as error Date: Tue, 25 Jun 2024 17:31:32 +0800 Message-ID: <20240625093138.3793885-3-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625093138.3793885-1-vicamo.yang@canonical.com> References: <20240625093138.3793885-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.179; envelope-from=vicamo@gmail.com; helo=mail-pl1-f179.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Wentong Wu BugLink: https://bugs.launchpad.net/bugs/2067364 Prior to the ongoing command privacy is on, it would return -1 to indicate the current privacy status, and the ongoing command would be well executed by firmware as well, so this is not error. This patch changes its behavior to notify privacy on directly by V4L2 privacy control instead of reporting error. Fixes: 29006e196a56 ("media: pci: intel: ivsc: Add CSI submodule") Reported-by: Hao Yao Signed-off-by: Wentong Wu Tested-by: Jason Chen (cherry picked from https://lore.kernel.org/r/all/20240607132547.2820515-2-wentong.wu@intel.com) Signed-off-by: You-Sheng Yang --- drivers/media/pci/intel/ivsc/mei_csi.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ivsc/mei_csi.c b/drivers/media/pci/intel/ivsc/mei_csi.c index 3c74d06a27fa..6e2d865cd0d5 100644 --- a/drivers/media/pci/intel/ivsc/mei_csi.c +++ b/drivers/media/pci/intel/ivsc/mei_csi.c @@ -188,7 +188,11 @@ static int mei_csi_send(struct mei_csi *csi, u8 *buf, size_t len) /* command response status */ ret = csi->cmd_response.status; - if (ret) { + if (ret == -1) { + /* notify privacy on instead of reporting error */ + ret = 0; + v4l2_ctrl_s_ctrl(csi->privacy_ctrl, 1); + } else if (ret) { ret = -EINVAL; goto out; } From patchwork Tue Jun 25 09:31:33 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1952009 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7fk61npHz20ZS for ; Tue, 25 Jun 2024 19:32:14 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM2X2-0008T9-7O; Tue, 25 Jun 2024 09:32:08 +0000 Received: from mail-pl1-f172.google.com ([209.85.214.172]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM2X0-0008RI-Pn for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 09:32:07 +0000 Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1f47f07acd3so43375925ad.0 for ; Tue, 25 Jun 2024 02:32:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719307925; x=1719912725; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=GD2ROlpBHZ1jmibLnwmZavDfnuZD2B7uTSc9q6yMLE8=; b=qmC6nsUo5DP/ZGHavgsdV+brTekG4b6RteY7indeZidxDVqSZ2/6wVbPKxuobgDeCG ToVJugVDkt3Lhm7YPpMJA+bCXR6cEPrkbxth+Lud1U3jQipgXk+S9nxTpI/LpoOg+gX8 Q7GQ9zbDjr/YNck4AArZ+ZgaGOykOhxe/fUDIxu6yLf15ZQQrmmO9g0u4Fy627AYf9kp 0KItJZdj8No5xnisCrkXFCGbrXsLMVtgCzI4/nFdkH7eSZ+IUwm1A1F19VBYKgLcHWQu kb3sj1DAk3tYqzsQShOuDHO9MMFODuHcbpnGcEluYmlEJ00l4KKp5kyAwhZZfffTzOUR 6d2g== X-Gm-Message-State: AOJu0YxTZlvXe/7qGFN7UkFtCm58XO5B2XCtchWIOC5s0QcqO17E1zmO llDIMlYSglGyNthyamigCu+m2cPuV/8UxloziUU/v5wN5kJZ40em10E7nleG X-Google-Smtp-Source: AGHT+IFQ8Q3ZiZR6sjZQbjqxEgft5qOwlMEfKZvXrbOfu+Ank8/FcIdCo34b403FkuyH89O91Ui+BA== X-Received: by 2002:a17:902:d344:b0:1f9:b35f:65f9 with SMTP id d9443c01a7336-1fa1d6aa411mr72878135ad.65.1719307923673; Tue, 25 Jun 2024 02:32:03 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb3c5a74sm76664405ad.151.2024.06.25.02.32.02 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 02:32:03 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 3/8][SRU][Noble] UBUNTU: SAUCE: media: ivsc: csi: add separate lock for v4l2 control handler Date: Tue, 25 Jun 2024 17:31:33 +0800 Message-ID: <20240625093138.3793885-4-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625093138.3793885-1-vicamo.yang@canonical.com> References: <20240625093138.3793885-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.172; envelope-from=vicamo@gmail.com; helo=mail-pl1-f172.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Wentong Wu BugLink: https://bugs.launchpad.net/bugs/2067364 There're possibilities that privacy status change notification happens in the middle of the ongoing mei command which already takes the command lock, but v4l2_ctrl_s_ctrl() would also need the same lock prior to this patch, so this may results in circular locking problem. This patch adds one dedicated lock for v4l2 control handler to avoid described issue. Reported-by: Hao Yao Signed-off-by: Wentong Wu Tested-by: Jason Chen (cherry picked from https://lore.kernel.org/r/all/20240607132547.2820515-3-wentong.wu@intel.com) Signed-off-by: You-Sheng Yang --- drivers/media/pci/intel/ivsc/mei_csi.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/media/pci/intel/ivsc/mei_csi.c b/drivers/media/pci/intel/ivsc/mei_csi.c index 6e2d865cd0d5..1e713aa0e931 100644 --- a/drivers/media/pci/intel/ivsc/mei_csi.c +++ b/drivers/media/pci/intel/ivsc/mei_csi.c @@ -123,6 +123,8 @@ struct mei_csi { struct v4l2_ctrl_handler ctrl_handler; struct v4l2_ctrl *freq_ctrl; struct v4l2_ctrl *privacy_ctrl; + /* lock for v4l2 controls */ + struct mutex ctrl_lock; unsigned int remote_pad; /* start streaming or not */ int streaming; @@ -615,11 +617,13 @@ static int mei_csi_init_controls(struct mei_csi *csi) u32 max; int ret; + mutex_init(&csi->ctrl_lock); + ret = v4l2_ctrl_handler_init(&csi->ctrl_handler, 2); if (ret) return ret; - csi->ctrl_handler.lock = &csi->lock; + csi->ctrl_handler.lock = &csi->ctrl_lock; max = ARRAY_SIZE(link_freq_menu_items) - 1; csi->freq_ctrl = v4l2_ctrl_new_int_menu(&csi->ctrl_handler, @@ -798,6 +802,7 @@ static int mei_csi_probe(struct mei_cl_device *cldev, err_ctrl_handler: v4l2_ctrl_handler_free(&csi->ctrl_handler); + mutex_destroy(&csi->ctrl_lock); v4l2_async_nf_unregister(&csi->notifier); v4l2_async_nf_cleanup(&csi->notifier); @@ -817,6 +822,7 @@ static void mei_csi_remove(struct mei_cl_device *cldev) v4l2_async_nf_unregister(&csi->notifier); v4l2_async_nf_cleanup(&csi->notifier); v4l2_ctrl_handler_free(&csi->ctrl_handler); + mutex_destroy(&csi->ctrl_lock); v4l2_async_unregister_subdev(&csi->subdev); v4l2_subdev_cleanup(&csi->subdev); media_entity_cleanup(&csi->subdev.entity); From patchwork Tue Jun 25 09:31:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1952010 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7fk849N0z20X6 for ; Tue, 25 Jun 2024 19:32:16 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM2X4-0008WB-J5; Tue, 25 Jun 2024 09:32:10 +0000 Received: from mail-pl1-f172.google.com ([209.85.214.172]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM2X2-0008SJ-3L for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 09:32:08 +0000 Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-1f6da06ba24so38283075ad.2 for ; Tue, 25 Jun 2024 02:32:07 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719307926; x=1719912726; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=2iBZ4OMxf5DMcME9tOxR3XCmFteQxeRj1y93NAoFQMI=; b=FuR00p2f7yjkOynU9CHndovqhGQnhYhFboG5Rjm8I151cVbvT1EruVVm5VC963e7+U CufFK2GIcDt9aYOAbfnOi3Qn/6AScBeNoPNj1onxiqOo4n/wnAAU4XGrhiZCXmEPReO+ yh/aEAFQ6HACunPMGYzr1pX2Et5LU7tDdN8bOrlawjLo/8r8VaKdJ1vuLKgook3Dnk71 GM0mbDtinsj6D5FLLfEw6CTu5dCofy8wvgurCR7YYE1hUrvj3I6uboJ5sJxAgx3vuDYq Y6EV2eropAKtxXaXjeEI/XzIJLF0Qe8h6E7FG9Oxwn2Mc0dJp+q5OnpZO1CLFBfc+Sfs 5CXw== X-Gm-Message-State: AOJu0YxVVptrizqX7dzZFqip/nfc04sBr4RqUKdtdVbl7Y0QXiuEpVfs YblYDE6Ij7nAAvGUILgdGnuiVWbEZkFgMVHwhJQ5wMZ5QJcW/hgAYUa/djLb X-Google-Smtp-Source: AGHT+IHr75SvBamQuH42XZQnFu9c55U+q2fnBYhX2wXbxeXXNalBFXfpSyLAkOYUUTi74qiQXTf3XQ== X-Received: by 2002:a17:902:6545:b0:1f7:3379:1c71 with SMTP id d9443c01a7336-1fa23f49e0cmr65830785ad.27.1719307925939; Tue, 25 Jun 2024 02:32:05 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb3c5a74sm76664405ad.151.2024.06.25.02.32.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 02:32:05 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 4/8][SRU][Noble] UBUNTU: SAUCE: media: ivsc: csi: remove privacy status in struct mei_csi Date: Tue, 25 Jun 2024 17:31:34 +0800 Message-ID: <20240625093138.3793885-5-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625093138.3793885-1-vicamo.yang@canonical.com> References: <20240625093138.3793885-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.172; envelope-from=vicamo@gmail.com; helo=mail-pl1-f172.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Wentong Wu BugLink: https://bugs.launchpad.net/bugs/2067364 The privacy status is maintained by privacy_ctrl, on which all of the privacy status changes will go through, so there is no point in maintaining one more element any more. Reported-by: Hao Yao Signed-off-by: Wentong Wu Tested-by: Jason Chen (cherry picked from https://lore.kernel.org/r/all/20240607132547.2820515-4-wentong.wu@intel.com) Signed-off-by: You-Sheng Yang --- drivers/media/pci/intel/ivsc/mei_csi.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/media/pci/intel/ivsc/mei_csi.c b/drivers/media/pci/intel/ivsc/mei_csi.c index 1e713aa0e931..f936b0b6a962 100644 --- a/drivers/media/pci/intel/ivsc/mei_csi.c +++ b/drivers/media/pci/intel/ivsc/mei_csi.c @@ -136,9 +136,6 @@ struct mei_csi { u32 nr_of_lanes; /* frequency of the CSI-2 link */ u64 link_freq; - - /* privacy status */ - enum ivsc_privacy_status status; }; static const struct v4l2_mbus_framefmt mei_csi_format_mbus_default = { @@ -269,10 +266,9 @@ static void mei_csi_rx(struct mei_cl_device *cldev) switch (notif.cmd_id) { case CSI_PRIVACY_NOTIF: - if (notif.cont.cont < CSI_PRIVACY_MAX) { - csi->status = notif.cont.cont; - v4l2_ctrl_s_ctrl(csi->privacy_ctrl, csi->status); - } + if (notif.cont.cont < CSI_PRIVACY_MAX) + v4l2_ctrl_s_ctrl(csi->privacy_ctrl, + notif.cont.cont == CSI_PRIVACY_ON); break; case CSI_SET_OWNER: case CSI_SET_CONF: From patchwork Tue Jun 25 09:31:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1952011 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7fkB2YYYz20X6 for ; Tue, 25 Jun 2024 19:32:18 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM2X6-00006r-3G; Tue, 25 Jun 2024 09:32:12 +0000 Received: from mail-pl1-f181.google.com ([209.85.214.181]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM2X3-0008Tl-HU for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 09:32:09 +0000 Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-1f44b45d6abso41187145ad.0 for ; Tue, 25 Jun 2024 02:32:09 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719307927; x=1719912727; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ataXYeZ+yyI3q3Uj243PgLxIODDCB7tX/Pp2pW2S5VE=; b=sS46EZjDCZEU7VnOvy1epIf014z/1gZXVcAvlDE54/lfjTBYuWlqf1Azfi7w3ZllmL ZcwmlI2wayBy/3oovUa5B//TgwKyf6Fsyl4/rdfEB1qqyl8kcU+69DxwyVYTn/KOhXVh GnCSLCH2HfCl5TRj6VlEqmFytvtuEL05ZoXq5aRtccwLiZroMNjTO75sGfWOo1dGd2No y0//e/6HRnBQTiUhKWj/v0FQZtwyBVBn5lKOwoTKV0tHLpwJlQ47JuJDFjCOMtktXl7B 0RNf98qthOGFZmhrvSlun7HBdxOPv8Xa8E+3OP74MNptzF9bPDLaFWQBD1K7zBgZzHme RKew== X-Gm-Message-State: AOJu0Ywfq4ixEc7Q1M1DG8GTf3WMSnI/ooLgf/wojv6lKuX3tWZZ1znb Ho5VcMK5HstEFCl4klmJU3ubZX/TZW8IsTZVbYOGhTN/pOKtouV56JaPs/76 X-Google-Smtp-Source: AGHT+IGiI5+vYrRzNuWzd5BIq5kF6LauUgOcI2/2XXA94tL48AGa5vASV+9zDn6T6c0u30ykRhPrng== X-Received: by 2002:a17:902:e844:b0:1fa:1ebb:eb4f with SMTP id d9443c01a7336-1fa1ebbee17mr84041635ad.12.1719307927372; Tue, 25 Jun 2024 02:32:07 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb3c5a74sm76664405ad.151.2024.06.25.02.32.06 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 02:32:06 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 5/8][SRU][Noble] UBUNTU: SAUCE: mei: vsc: Enhance IVSC chipset stability during warm reboot Date: Tue, 25 Jun 2024 17:31:35 +0800 Message-ID: <20240625093138.3793885-6-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625093138.3793885-1-vicamo.yang@canonical.com> References: <20240625093138.3793885-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.181; envelope-from=vicamo@gmail.com; helo=mail-pl1-f181.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Wentong Wu BugLink: https://bugs.launchpad.net/bugs/2067364 During system shutdown, incorporate reset logic to ensure the IVSC chipset remains in a valid state. This adjustment guarantees that the IVSC chipset operates in a known state following a warm reboot. Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device") Cc: stable@vger.kernel.org # for 6.8+ Signed-off-by: Wentong Wu Tested-by: Jason Chen (cherry picked from https://lore.kernel.org/all/20240624014223.4171341-2-wentong.wu@intel.com/) Signed-off-by: You-Sheng Yang --- drivers/misc/mei/vsc-tp.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c index 870c70ef3bb8..452946120b81 100644 --- a/drivers/misc/mei/vsc-tp.c +++ b/drivers/misc/mei/vsc-tp.c @@ -568,6 +568,19 @@ static void vsc_tp_remove(struct spi_device *spi) free_irq(spi->irq, tp); } +static void vsc_tp_shutdown(struct spi_device *spi) +{ + struct vsc_tp *tp = spi_get_drvdata(spi); + + platform_device_unregister(tp->pdev); + + mutex_destroy(&tp->mutex); + + vsc_tp_reset(tp); + + free_irq(spi->irq, tp); +} + static const struct acpi_device_id vsc_tp_acpi_ids[] = { { "INTC1009" }, /* Raptor Lake */ { "INTC1058" }, /* Tiger Lake */ @@ -580,6 +593,7 @@ MODULE_DEVICE_TABLE(acpi, vsc_tp_acpi_ids); static struct spi_driver vsc_tp_driver = { .probe = vsc_tp_probe, .remove = vsc_tp_remove, + .shutdown = vsc_tp_shutdown, .driver = { .name = "vsc-tp", .acpi_match_table = vsc_tp_acpi_ids, From patchwork Tue Jun 25 09:31:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1952012 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7fkB3tbjz20ZS for ; Tue, 25 Jun 2024 19:32:18 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM2X6-00007q-Fp; Tue, 25 Jun 2024 09:32:12 +0000 Received: from mail-pl1-f175.google.com ([209.85.214.175]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM2X4-0008VX-RR for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 09:32:11 +0000 Received: by mail-pl1-f175.google.com with SMTP id d9443c01a7336-1fa78306796so1470525ad.3 for ; Tue, 25 Jun 2024 02:32:10 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719307929; x=1719912729; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5nWzdA6AqE4g/hqeofbHGan7+7uEZk2FqChN6mKVFJ8=; b=mjjtLqgx9iW5sPGcwbunnG+L42VBsD7WzEKI4PpH0qnNFwZpuBbiDo1n8r+eqy6aNM 2ipCjYOmWOqoMCqwuygQmUO3xXASlTFTWZQWdfMGJsN6lt7Ze88aMoDUZZbsUIGUeCUl QnAl9qvZLKawtby1mq4/ub7ZX5s5noz/qnVP+J24lSR1wpGBKu4K6GM6GxOVO4uMY7sz 5YNmpX+qsSAJRYvZmmLp/Le8P5WRvSmT7zpMIssytbNIxhBy6r+2vM779N23xTFu4e4n k6Uup/+cvH0foQfG+wvT7Avx0hSZikGMk7XJ2+CjtQ1A2tNe61wm5FWuj+4FMxAE1XBD iHyA== X-Gm-Message-State: AOJu0YxhVemRbEI8dUNTaofP+9bwnBN7/PBUwQ5O2ieVetJ8rN46TwaL zfD6shtsmrXeTiQBB1H1BMRpfVZ/eBEF/Kyej4UmaytzEDBg9hYJRy2Bjax0 X-Google-Smtp-Source: AGHT+IGg178l0r14oaUvKC4hW9pXtvsdQWUa4s4QXXb8r0zY4W8mo7IYF+fOgbcXhmWehBzFZiflWw== X-Received: by 2002:a17:902:d50b:b0:1f9:98e1:de41 with SMTP id d9443c01a7336-1fa1c6fed2dmr88635495ad.0.1719307928643; Tue, 25 Jun 2024 02:32:08 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb3c5a74sm76664405ad.151.2024.06.25.02.32.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 02:32:08 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 6/8][SRU][Noble] UBUNTU: SAUCE: mei: vsc: Enhance SPI transfer of IVSC rom Date: Tue, 25 Jun 2024 17:31:36 +0800 Message-ID: <20240625093138.3793885-7-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625093138.3793885-1-vicamo.yang@canonical.com> References: <20240625093138.3793885-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.175; envelope-from=vicamo@gmail.com; helo=mail-pl1-f175.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Wentong Wu BugLink: https://bugs.launchpad.net/bugs/2067364 Constructing the SPI transfer command as per the specific request. Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device") Cc: stable@vger.kernel.org # for 6.8+ Signed-off-by: Wentong Wu Tested-by: Jason Chen (cherry picked from https://lore.kernel.org/all/20240624014223.4171341-3-wentong.wu@intel.com/) Signed-off-by: You-Sheng Yang --- drivers/misc/mei/vsc-tp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c index 452946120b81..3d92e7f84953 100644 --- a/drivers/misc/mei/vsc-tp.c +++ b/drivers/misc/mei/vsc-tp.c @@ -331,7 +331,7 @@ int vsc_tp_rom_xfer(struct vsc_tp *tp, const void *obuf, void *ibuf, size_t len) return ret; } - ret = vsc_tp_dev_xfer(tp, tp->tx_buf, tp->rx_buf, len); + ret = vsc_tp_dev_xfer(tp, tp->tx_buf, ibuf ? tp->rx_buf : ibuf, len); if (ret) return ret; From patchwork Tue Jun 25 09:31:37 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1952013 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7fkC4J3Yz20X6 for ; Tue, 25 Jun 2024 19:32:19 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM2X8-0000Bd-0O; Tue, 25 Jun 2024 09:32:14 +0000 Received: from mail-pl1-f174.google.com ([209.85.214.174]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM2X6-00006C-My for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 09:32:12 +0000 Received: by mail-pl1-f174.google.com with SMTP id d9443c01a7336-1f44b45d6abso41187615ad.0 for ; Tue, 25 Jun 2024 02:32:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719307930; x=1719912730; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9pkh3Po1aXZ9nkEcjmb2AYd0BYfrq2elFxylFvwmrZI=; b=BT1iuRt0NWunqzbSZFqthA4W8cat5KP6iO5fIKi2AaKeJnPvzQ1Xzsu1wDfiF4OC1Q 7DPv9tzWe66//Z54+bLCSKYiZsDmS4SJ8izi93KN4je56so97cSg6H+IDP/aOcyw9ts+ Vt/go3VW6EshZsCtyj6wBXvzy4aHZcgD3j8BsLFpIbufJvWGZjQWG5MVlQ7bfl3dGznK w5Zic80FuMkGcyVQ++hQp15kytqr3Nu6QCdF4Kx9KM8LP+mfpb4U01Bmoq48Ct9zHrPH vVENNaT/AARe2gpZCFbUPQbmQUuTkuBaKrKP5cMx7hXY0UUVQKorP/j0P8GWYAPeXop6 IZtQ== X-Gm-Message-State: AOJu0YwLkcfqRbXoZv9aCLwnah/Dat79hLE0GMfis7bIIXHeZ39tpWpT 9z8fq/+jn0NkKzDMpdkUX392jyIzp4REkHU+J28Gr3ba2RbSkE+4qMnRgg6J X-Google-Smtp-Source: AGHT+IHJZ4mD4J10j+9N6vXBaOmWDp0JDAdFtCnNQbP/GdcPHlM1/0tSQ4ZEp6j5cB9ffCPCunbH8Q== X-Received: by 2002:a17:903:18e:b0:1f9:f06a:e2aa with SMTP id d9443c01a7336-1fa1d629d03mr65968995ad.35.1719307929898; Tue, 25 Jun 2024 02:32:09 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb3c5a74sm76664405ad.151.2024.06.25.02.32.08 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 02:32:09 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 7/8][SRU][Noble] UBUNTU: SAUCE: mei: vsc: Utilize the appropriate byte order swap function Date: Tue, 25 Jun 2024 17:31:37 +0800 Message-ID: <20240625093138.3793885-8-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625093138.3793885-1-vicamo.yang@canonical.com> References: <20240625093138.3793885-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.174; envelope-from=vicamo@gmail.com; helo=mail-pl1-f174.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Wentong Wu BugLink: https://bugs.launchpad.net/bugs/2067364 Switch from cpu_to_be32_array() to be32_to_cpu_array() for the received rom data. Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device") Cc: stable@vger.kernel.org # for 6.8+ Signed-off-by: Wentong Wu Tested-by: Jason Chen (cherry picked from https://lore.kernel.org/all/20240624014223.4171341-4-wentong.wu@intel.com/) Signed-off-by: You-Sheng Yang --- drivers/misc/mei/vsc-tp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/mei/vsc-tp.c b/drivers/misc/mei/vsc-tp.c index 3d92e7f84953..941f5b3df72f 100644 --- a/drivers/misc/mei/vsc-tp.c +++ b/drivers/misc/mei/vsc-tp.c @@ -336,7 +336,7 @@ int vsc_tp_rom_xfer(struct vsc_tp *tp, const void *obuf, void *ibuf, size_t len) return ret; if (ibuf) - cpu_to_be32_array(ibuf, tp->rx_buf, words); + be32_to_cpu_array(ibuf, tp->rx_buf, words); return ret; } From patchwork Tue Jun 25 09:31:38 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: You-Sheng Yang X-Patchwork-Id: 1952014 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.ubuntu.com (client-ip=185.125.189.65; helo=lists.ubuntu.com; envelope-from=kernel-team-bounces@lists.ubuntu.com; receiver=patchwork.ozlabs.org) Received: from lists.ubuntu.com (lists.ubuntu.com [185.125.189.65]) (using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4W7fkD46X0z20X6 for ; Tue, 25 Jun 2024 19:32:20 +1000 (AEST) Received: from localhost ([127.0.0.1] helo=lists.ubuntu.com) by lists.ubuntu.com with esmtp (Exim 4.86_2) (envelope-from ) id 1sM2X9-0000FE-C9; Tue, 25 Jun 2024 09:32:15 +0000 Received: from mail-pl1-f182.google.com ([209.85.214.182]) by lists.ubuntu.com with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.86_2) (envelope-from ) id 1sM2X7-00007g-LC for kernel-team@lists.ubuntu.com; Tue, 25 Jun 2024 09:32:13 +0000 Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1fa3bdd91c1so15938095ad.2 for ; Tue, 25 Jun 2024 02:32:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1719307931; x=1719912731; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=IUFdtkt9AM5PxlSiUu3FMAxz8CqJdOD/5A4hFsw/9HI=; b=M8XgAfzt7o6ptEXoU4EGALD8O57IANHyiE8CUUGa/rl+m1asey9zisZ54GZvqrl4SE h481dyxFaBzRxrByL4jJLvWbFKtOukIBvVKiA4tG26Gk3ES2s5A3rmKjxIocs8pe8tiq CKkEb4iBi3mcuL1piKAEaJQgBWKeoIcBStR8bcv3QUs86n/VD0+LdEH3NzyOk9LDVgOm QFTZWXAjpxfmApGkifhYRVMx24g04v8Gk7LG+ocskcgFp31oV0sxql4QOlVwRXBWvFuf +gPHeSc+7bU5qccGv9W+7jAAtoI2djnGwYwl/D+1BSahM3SXK/SHpD4r94HUr+zxmdGX PU+A== X-Gm-Message-State: AOJu0Yzixps1h+c5cDfHi4sc0pPUAQYvhLhu8mXGgoLAtX7oPs7oxfv7 ADFcPlNPx9BGmkA76zE+cL0Jr6kY7NQNcYOPtCumnzE6lax+Zo3VWDd1Mdty X-Google-Smtp-Source: AGHT+IGDhPV3+2HBBNWAI0MrRqhie+paF1CZn5jPtxGxzLXTSR2VUIX7OjGJTOUkcTugoJyQiFnBzA== X-Received: by 2002:a17:902:d505:b0:1f6:ec21:fd43 with SMTP id d9443c01a7336-1fa23f15770mr94758295ad.48.1719307931320; Tue, 25 Jun 2024 02:32:11 -0700 (PDT) Received: from localhost.localdomain (125-229-129-140.hinet-ip.hinet.net. [125.229.129.140]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-1f9eb3c5a74sm76664405ad.151.2024.06.25.02.32.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 25 Jun 2024 02:32:10 -0700 (PDT) From: You-Sheng Yang To: kernel-team@lists.ubuntu.com Subject: [PATCH 8/8][SRU][Noble] UBUNTU: SAUCE: mei: vsc: Prevent timeout error with added delay post-firmware download Date: Tue, 25 Jun 2024 17:31:38 +0800 Message-ID: <20240625093138.3793885-9-vicamo.yang@canonical.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240625093138.3793885-1-vicamo.yang@canonical.com> References: <20240625093138.3793885-1-vicamo.yang@canonical.com> MIME-Version: 1.0 Received-SPF: pass client-ip=209.85.214.182; envelope-from=vicamo@gmail.com; helo=mail-pl1-f182.google.com X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.20 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: kernel-team-bounces@lists.ubuntu.com Sender: "kernel-team" From: Wentong Wu BugLink: https://bugs.launchpad.net/bugs/2067364 After completing the firmware download, the firmware requires some time to become functional. This change introduces additional sleep time before the first read operation to prevent a confusing timeout error in vsc_tp_xfer(). Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device") Cc: stable@vger.kernel.org # for 6.8+ Signed-off-by: Wentong Wu Tested-by: Jason Chen (cherry picked from https://lore.kernel.org/all/20240624014223.4171341-5-wentong.wu@intel.com/) Signed-off-by: You-Sheng Yang --- drivers/misc/mei/platform-vsc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/misc/mei/platform-vsc.c b/drivers/misc/mei/platform-vsc.c index 5a445f3b96a9..a59fb5a13bdc 100644 --- a/drivers/misc/mei/platform-vsc.c +++ b/drivers/misc/mei/platform-vsc.c @@ -28,8 +28,8 @@ #define MEI_VSC_MAX_MSG_SIZE 512 -#define MEI_VSC_POLL_DELAY_US (50 * USEC_PER_MSEC) -#define MEI_VSC_POLL_TIMEOUT_US (200 * USEC_PER_MSEC) +#define MEI_VSC_POLL_DELAY_US (100 * USEC_PER_MSEC) +#define MEI_VSC_POLL_TIMEOUT_US (400 * USEC_PER_MSEC) #define mei_dev_to_vsc_hw(dev) ((struct mei_vsc_hw *)((dev)->hw))