Sophie

Sophie

distrib > Mageia > 8 > i586 > by-pkgid > f65f1d773383ac49d6fcc3657259ff43 > files > 118

kernel-5.10.45-2.mga8.src.rpm

diff -up linux-5.9/drivers/i2c/busses/i2c-nvidia-gpu.c.i2c linux-5.9/drivers/i2c/busses/i2c-nvidia-gpu.c
--- linux-5.9/drivers/i2c/busses/i2c-nvidia-gpu.c.i2c	2020-10-30 17:33:28.896532825 +0100
+++ linux-5.9/drivers/i2c/busses/i2c-nvidia-gpu.c	2020-10-30 17:43:13.117313702 +0100
@@ -84,11 +84,6 @@ static int gpu_i2c_check_status(struct g
 				 (val & I2C_MST_CNTL_STATUS) != I2C_MST_CNTL_STATUS_BUS_BUSY,
 				 500, 1000 * USEC_PER_MSEC);
 
-	if (ret) {
-		dev_err(i2cd->dev, "i2c timeout error %x\n", val);
-		return -ETIMEDOUT;
-	}
-
 	val = readl(i2cd->regs + I2C_MST_CNTL);
 	switch (val & I2C_MST_CNTL_STATUS) {
 	case I2C_MST_CNTL_STATUS_OKAY:
@@ -97,6 +92,8 @@ static int gpu_i2c_check_status(struct g
 		return -ENXIO;
 	case I2C_MST_CNTL_STATUS_TIMEOUT:
 		return -ETIMEDOUT;
+	case I2C_MST_CNTL_STATUS_BUS_BUSY:
+       		return -EBUSY;
 	default:
 		return 0;
 	}
diff -up linux-5.9/drivers/usb/typec/ucsi/ucsi_ccg.c.i2c linux-5.9/drivers/usb/typec/ucsi/ucsi_ccg.c
--- linux-5.9/drivers/usb/typec/ucsi/ucsi_ccg.c.i2c	2020-10-30 17:33:28.913532322 +0100
+++ linux-5.9/drivers/usb/typec/ucsi/ucsi_ccg.c	2020-10-30 17:41:18.119789749 +0100
@@ -252,7 +252,10 @@ static int ccg_read(struct ucsi_ccg *uc,
 		put_unaligned_le16(rab, buf);
 		status = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
 		if (status < 0) {
-			dev_err(uc->dev, "i2c_transfer failed %d\n", status);
+			if (uc->fw_build != CCG_FW_BUILD_NVIDIA ||
+			    status != -EBUSY)
+			        dev_err(uc->dev, "i2c_transfer failed %d\n",
+			        status);
 			pm_runtime_put_sync(uc->dev);
 			return status;
 		}
@@ -289,7 +292,8 @@ static int ccg_write(struct ucsi_ccg *uc
 	pm_runtime_get_sync(uc->dev);
 	status = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
 	if (status < 0) {
-		dev_err(uc->dev, "i2c_transfer failed %d\n", status);
+		if (uc->fw_build != CCG_FW_BUILD_NVIDIA || status != -EBUSY)
+			dev_err(uc->dev, "i2c_transfer failed %d\n", status);
 		pm_runtime_put_sync(uc->dev);
 		kfree(buf);
 		return status;
@@ -1345,7 +1349,10 @@ static int ucsi_ccg_probe(struct i2c_cli
 	/* reset ccg device and initialize ucsi */
 	status = ucsi_ccg_init(uc);
 	if (status < 0) {
-		dev_err(uc->dev, "ucsi_ccg_init failed - %d\n", status);
+		if (uc->fw_build == CCG_FW_BUILD_NVIDIA && status == -EBUSY)
+			dev_info(uc->dev, "USB typec not present\n");
+		else
+			dev_err(uc->dev, "ucsi_ccg_init failed - %d\n", status);
 		return status;
 	}