* [PATCH v3 1/5] mei: vsc: Enhance IVSC chipset stability during warm reboot
[not found] <20240624132849.4174494-1-wentong.wu@intel.com>
@ 2024-06-24 13:28 ` Wentong Wu
2024-06-24 13:28 ` [PATCH v3 2/5] mei: vsc: Enhance SPI transfer of IVSC rom Wentong Wu
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Wentong Wu @ 2024-06-24 13:28 UTC (permalink / raw)
To: sakari.ailus, tomas.winkler, gregkh
Cc: linux-kernel, Wentong Wu, stable, Jason Chen
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 <wentong.wu@intel.com>
Tested-by: Jason Chen <jason.z.chen@intel.com>
---
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 e6a98dba8a73..5f3195636e53 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,
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 2/5] mei: vsc: Enhance SPI transfer of IVSC rom
[not found] <20240624132849.4174494-1-wentong.wu@intel.com>
2024-06-24 13:28 ` [PATCH v3 1/5] mei: vsc: Enhance IVSC chipset stability during warm reboot Wentong Wu
@ 2024-06-24 13:28 ` Wentong Wu
2024-06-24 14:29 ` Winkler, Tomas
2024-06-24 13:28 ` [PATCH v3 3/5] mei: vsc: Utilize the appropriate byte order swap function Wentong Wu
2024-06-24 13:28 ` [PATCH v3 4/5] mei: vsc: Prevent timeout error with added delay post-firmware download Wentong Wu
3 siblings, 1 reply; 5+ messages in thread
From: Wentong Wu @ 2024-06-24 13:28 UTC (permalink / raw)
To: sakari.ailus, tomas.winkler, gregkh
Cc: linux-kernel, Wentong Wu, stable, Jason Chen
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 <wentong.wu@intel.com>
Tested-by: Jason Chen <jason.z.chen@intel.com>
---
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 5f3195636e53..26387e2f1dd7 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 : NULL, len);
if (ret)
return ret;
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 3/5] mei: vsc: Utilize the appropriate byte order swap function
[not found] <20240624132849.4174494-1-wentong.wu@intel.com>
2024-06-24 13:28 ` [PATCH v3 1/5] mei: vsc: Enhance IVSC chipset stability during warm reboot Wentong Wu
2024-06-24 13:28 ` [PATCH v3 2/5] mei: vsc: Enhance SPI transfer of IVSC rom Wentong Wu
@ 2024-06-24 13:28 ` Wentong Wu
2024-06-24 13:28 ` [PATCH v3 4/5] mei: vsc: Prevent timeout error with added delay post-firmware download Wentong Wu
3 siblings, 0 replies; 5+ messages in thread
From: Wentong Wu @ 2024-06-24 13:28 UTC (permalink / raw)
To: sakari.ailus, tomas.winkler, gregkh
Cc: linux-kernel, Wentong Wu, stable, Jason Chen
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 <wentong.wu@intel.com>
Tested-by: Jason Chen <jason.z.chen@intel.com>
---
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 26387e2f1dd7..1618cca9a731 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;
}
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v3 4/5] mei: vsc: Prevent timeout error with added delay post-firmware download
[not found] <20240624132849.4174494-1-wentong.wu@intel.com>
` (2 preceding siblings ...)
2024-06-24 13:28 ` [PATCH v3 3/5] mei: vsc: Utilize the appropriate byte order swap function Wentong Wu
@ 2024-06-24 13:28 ` Wentong Wu
3 siblings, 0 replies; 5+ messages in thread
From: Wentong Wu @ 2024-06-24 13:28 UTC (permalink / raw)
To: sakari.ailus, tomas.winkler, gregkh
Cc: linux-kernel, Wentong Wu, stable, Jason Chen
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 <wentong.wu@intel.com>
Tested-by: Jason Chen <jason.z.chen@intel.com>
---
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 1ec65d87488a..d02f6e881139 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))
--
2.34.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* RE: [PATCH v3 2/5] mei: vsc: Enhance SPI transfer of IVSC rom
2024-06-24 13:28 ` [PATCH v3 2/5] mei: vsc: Enhance SPI transfer of IVSC rom Wentong Wu
@ 2024-06-24 14:29 ` Winkler, Tomas
0 siblings, 0 replies; 5+ messages in thread
From: Winkler, Tomas @ 2024-06-24 14:29 UTC (permalink / raw)
To: Wu, Wentong, sakari.ailus@linux.intel.com,
gregkh@linuxfoundation.org
Cc: linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Chen, Jason Z
> Constructing the SPI transfer command as per the specific request.
Please provide "Why" , this is not straight forward to understand, also deserves a comment in code.
>
> Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device")
> Cc: stable@vger.kernel.org # for 6.8+
> Signed-off-by: Wentong Wu <wentong.wu@intel.com>
> Tested-by: Jason Chen <jason.z.chen@intel.com>
> ---
> 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
> 5f3195636e53..26387e2f1dd7 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 : NULL, len);
> if (ret)
> return ret;
>
> --
> 2.34.1
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-06-24 14:29 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20240624132849.4174494-1-wentong.wu@intel.com>
2024-06-24 13:28 ` [PATCH v3 1/5] mei: vsc: Enhance IVSC chipset stability during warm reboot Wentong Wu
2024-06-24 13:28 ` [PATCH v3 2/5] mei: vsc: Enhance SPI transfer of IVSC rom Wentong Wu
2024-06-24 14:29 ` Winkler, Tomas
2024-06-24 13:28 ` [PATCH v3 3/5] mei: vsc: Utilize the appropriate byte order swap function Wentong Wu
2024-06-24 13:28 ` [PATCH v3 4/5] mei: vsc: Prevent timeout error with added delay post-firmware download Wentong Wu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox