mei: vsc: Enhance SPI transfer of IVSC ROM
authorWentong Wu <wentong.wu@intel.com>
Tue, 25 Jun 2024 08:10:46 +0000 (16:10 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Jul 2024 10:21:39 +0000 (12:21 +0200)
Before downloading firmware, a command response is required to
identify the silicon. However, when downloading IVSC firmware,
reading data from the SPI transfers with the IVSC ROM is not
necessary. Therefore, the rx buffer of SPI transfer command is
determined based on the specific request of the caller.

Fixes: 566f5ca97680 ("mei: Add transport driver for IVSC device")
Signed-off-by: Wentong Wu <wentong.wu@intel.com>
Tested-by: Jason Chen <jason.z.chen@intel.com>
Acked-by: Tomas Winker <tomas.winker@intel.com>
Acked-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Link: https://lore.kernel.org/r/20240625081047.4178494-5-wentong.wu@intel.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/misc/mei/vsc-tp.c

index 876330474444be6fb9032f136c19e3d472c2ece3..1618cca9a7317f5b2631b526b5e996a986f3186f 100644 (file)
@@ -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;