Skip to content

Commit 127068a

Browse files
Lee JonesWolfram Sang
authored andcommitted
i2c: qcom-geni: Disable DMA processing on the Lenovo Yoga C630
We have a production-level laptop (Lenovo Yoga C630) which is exhibiting a rather horrific bug. When I2C HID devices are being scanned for at boot-time the QCom Geni based I2C (Serial Engine) attempts to use DMA. When it does, the laptop reboots and the user never sees the OS. Attempts are being made to debug the reason for the spontaneous reboot. No luck so far, hence the requirement for this hot-fix. This workaround will be removed once we have a viable fix. Signed-off-by: Lee Jones <[email protected]> Tested-by: Bjorn Andersson <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent aefcf2f commit 127068a

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

drivers/i2c/busses/i2c-qcom-geni.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -355,11 +355,13 @@ static int geni_i2c_rx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
355355
{
356356
dma_addr_t rx_dma;
357357
unsigned long time_left;
358-
void *dma_buf;
358+
void *dma_buf = NULL;
359359
struct geni_se *se = &gi2c->se;
360360
size_t len = msg->len;
361361

362-
dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
362+
if (!of_machine_is_compatible("lenovo,yoga-c630"))
363+
dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
364+
363365
if (dma_buf)
364366
geni_se_select_mode(se, GENI_SE_DMA);
365367
else
@@ -394,11 +396,13 @@ static int geni_i2c_tx_one_msg(struct geni_i2c_dev *gi2c, struct i2c_msg *msg,
394396
{
395397
dma_addr_t tx_dma;
396398
unsigned long time_left;
397-
void *dma_buf;
399+
void *dma_buf = NULL;
398400
struct geni_se *se = &gi2c->se;
399401
size_t len = msg->len;
400402

401-
dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
403+
if (!of_machine_is_compatible("lenovo,yoga-c630"))
404+
dma_buf = i2c_get_dma_safe_msg_buf(msg, 32);
405+
402406
if (dma_buf)
403407
geni_se_select_mode(se, GENI_SE_DMA);
404408
else

0 commit comments

Comments
 (0)