Re: Kernel Oops in cdc_acm

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

 



Am Montag, den 25.05.2020, 14:00 +0200 schrieb Jean Rene Dawin:
> Hi,
> 
> I use a Nokia 515 connected via USB as a UMTS modem for my PC:
> CPU0: Intel(R) Core(TM)2 Duo CPU     E8400  @ 3.00GHz (family: 0x6, model: 0x17, stepping: 0xa)
> 
> Output of lsusb -v -d for the device is attached.
> 
> The battery of the phone is old, and sometimes the phone just turns off.
> Up intil recently (before 5.6.10) turning on the phone again would restore the connection.
> 
> But roughly since commits 0afccd7601514c4b83d8cc58c740089cc447051d and/or  4e7279cd1d19f48f0af2a10ed020febaa9ac092 the kernel gets an Oops and eventually the system hangs.
> The behaviour is reproducible by taking out the battery from the phone during a connection.
> 
> Tested wtih 5.6.10, 5.6.14 and 5.7-rc6. The following dmesg output is from 5.7-rc6:

Hi,

it looks to me like I made a mistake in fixing the error handling for
some devices. Could you test the attached patch?

	Regards
		Oliver
From 338fe738603d2612a317c9bec98236eb094ae109 Mon Sep 17 00:00:00 2001
From: Oliver Neukum <oneukum@xxxxxxxx>
Date: Mon, 25 May 2020 14:21:44 +0200
Subject: [PATCH] CDC-ACM: heed quirk also in error handling

If buffers are iterated over in the error case, the lower limits
for quirky devices must be heeded.

Signed-off-by: Oliver Neukum <oneukum@xxxxxxxx>
---
 drivers/usb/class/cdc-acm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/usb/class/cdc-acm.c b/drivers/usb/class/cdc-acm.c
index 7678ae4afd53..be4543569822 100644
--- a/drivers/usb/class/cdc-acm.c
+++ b/drivers/usb/class/cdc-acm.c
@@ -585,7 +585,7 @@ static void acm_softint(struct work_struct *work)
 	}
 
 	if (test_and_clear_bit(ACM_ERROR_DELAY, &acm->flags)) {
-		for (i = 0; i < ACM_NR; i++) 
+		for (i = 0; i < acm->rx_buflimit; i++) 
 			if (test_and_clear_bit(i, &acm->urbs_in_error_delay))
 					acm_submit_read_urb(acm, i, GFP_NOIO);
 	}
-- 
2.16.4


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux