Patch "HID: mcp2221: Allow IO to start during probe" has been added to the 6.6-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    HID: mcp2221: Allow IO to start during probe

to the 6.6-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     hid-mcp2221-allow-io-to-start-during-probe.patch
and it can be found in the queue-6.6 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.



commit 9106c6a2e872cbddd4499c266e5490cf28a925f7
Author: Hamish Martin <hamish.martin@xxxxxxxxxxxxxxxxxxx>
Date:   Wed Oct 25 16:55:11 2023 +1300

    HID: mcp2221: Allow IO to start during probe
    
    [ Upstream commit 73ce9f1f2741a38f5d27393e627702ae2c46e6f2 ]
    
    During the probe we add an I2C adapter and as soon as we add that adapter
    it may be used for a transfer (e.g via the code in i2cdetect()).
    Those transfers are not able to complete and time out. This is because the
    HID raw_event callback (mcp2221_raw_event) will not be invoked until the
    HID device's 'driver_input_lock' is marked up at the completion of the
    probe in hid_device_probe(). This starves the driver of the responses it
    is waiting for.
    In order to allow the I2C transfers to complete while we are still in the
    probe, start the IO once we have completed init of the HID device.
    
    This issue seems to have been seen before and a patch was submitted but
    it seems it was never accepted. See:
    https://lore.kernel.org/all/20221103222714.21566-3-Enrik.Berkhan@xxxxxxx/
    
    Signed-off-by: Hamish Martin <hamish.martin@xxxxxxxxxxxxxxxxxxx>
    Signed-off-by: Jiri Kosina <jkosina@xxxxxxx>
    Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx>

diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c
index b95f31cf0fa21..aef0785c91cc2 100644
--- a/drivers/hid/hid-mcp2221.c
+++ b/drivers/hid/hid-mcp2221.c
@@ -1142,6 +1142,8 @@ static int mcp2221_probe(struct hid_device *hdev,
 	if (ret)
 		return ret;
 
+	hid_device_io_start(hdev);
+
 	/* Set I2C bus clock diviser */
 	if (i2c_clk_freq > 400)
 		i2c_clk_freq = 400;




[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux