Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8633581imu; Tue, 4 Dec 2018 11:30:12 -0800 (PST) X-Google-Smtp-Source: AFSGD/W28QJLF2WWMQOhSu+Js35/vR1yTABvnab4ZJp2Pnn+zlI5+OWAXNWfkIpt+muoKirvSRfz X-Received: by 2002:a63:9712:: with SMTP id n18mr17613120pge.295.1543951812713; Tue, 04 Dec 2018 11:30:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543951812; cv=none; d=google.com; s=arc-20160816; b=O1GTVTippBhfKfxitlfX6bsHcIh5ahiLeP/+SAy+OCQZawCqH46VM2VQIf8FXFi3ZZ LaRRWwQ6kL/XX8IjN4oHvOnpUhbOERTj9noG3honEMn5X/KZmO3E2pXaktUpcd9ZMWFB o/HQM9bVW30lqyCmjB6DKZG+yOYmmEgFYm4bdQWCHDDbH/jME75HALusLzcOUO47+d09 DcOKcQ+M1/x2emqoIDNS3lEfbB0B/De9qR3Gu7w4cVYIy8iWm3aniKmrjIJDzCK91Dn2 MSxQHq9lKEQR4YWyeJIZT5ub9UUFjr45xhVFvqabBL9ldwpgPCg8O7K29wveECYum0C6 vMtQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:in-reply-to :subject:cc:to:from:date; bh=guKaS/0YMH1/muNF25Re2cRBGdWHKXFbbYXK5gtDaXg=; b=lsud7qjuM1UZRuDHjoBWeIQyqWSAd2SrlKOPS+I4A70nIReJqiuNMy/kUejmv4F63R DZDHGfWbyWRxl8VbAG0YtQMc/PBKMOSonlqezkzeaEbubvk9pOn+BTwpHDoKLl8Tzh04 CGqgD3W02eCB2Bk3UKCZEHrVWqXU8+sX071+hmvrAtXVH+Qy/NBWmkP7QGHehT9o9/xf f6WZcI757BS6OxcDr83Izxtg5h4hyALU7NGJ0gwA6vnrEv6uvzRBz+oICOJbJhM6BOm8 qV3Ki4L1OjGemuMcubqDVQJV4NsYTADC06BqfDzFe0Kag/CLLNxQO4RWT4GDFX9BpdF1 Fatw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y6si16370401plr.186.2018.12.04.11.29.57; Tue, 04 Dec 2018 11:30:12 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726105AbeLDT3E (ORCPT + 99 others); Tue, 4 Dec 2018 14:29:04 -0500 Received: from iolanthe.rowland.org ([192.131.102.54]:47014 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1725912AbeLDT2v (ORCPT ); Tue, 4 Dec 2018 14:28:51 -0500 Received: (qmail 6603 invoked by uid 2102); 4 Dec 2018 14:28:50 -0500 Received: from localhost (sendmail-bs@127.0.0.1) by localhost with SMTP; 4 Dec 2018 14:28:50 -0500 Date: Tue, 4 Dec 2018 14:28:50 -0500 (EST) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: Anurag Kumar Vulisha cc: Felipe Balbi , Greg Kroah-Hartman , Shuah Khan , Johan Hovold , Jaejoong Kim , Benjamin Herrenschmidt , Roger Quadros , Manu Gautam , "martin.petersen@oracle.com" , Bart Van Assche , Mike Christie , Matthew Wilcox , Colin Ian King , "linux-usb@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "v.anuragkumar@gmail.com" , Thinh Nguyen , Tejas Joglekar , Ajay Yugalkishore Pandey Subject: RE: [PATCH v7 01/10] usb: gadget: udc: Add timer support for usb requests In-Reply-To: Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 4 Dec 2018, Anurag Kumar Vulisha wrote: > >Is there any way for the device controller driver to detect the problem without relying > >on a timeout? > > > >In fact, is this problem a known bug in the existing device controller hardware? Have > >the controller manufacturers published a suggested scheme for working around it? > > > > Yes, this problem is mentioned in dwc3 controller data book and the workaround > mentioned is the same that we are doing , to implement timeout and if no valid > stream event is found , after timeout issue end transfer followed by start transfer. Okay. But this implies that the problem is confined to DWC3 and doesn't affect other types of controllers, which would mean modifying the UDC core would be inappropriate. Does the data book suggest a value for the timeout? > >At this point, it seems that the generic approach will be messier than having every > >controller driver implement its own fix. At least, that's how it appears to me. (Especially if dwc3 is the only driver affected.) > With the dequeue approach there is an advantage(not related to this issue) that the > class driver can have control of the timed out transfer whether to requeue it or consider > it as an error (based on implementation). This approach gives more flexibility to the class > drivers. This may be out of context of this issue but wanted to point out that we may lose > this advantage on switching to older implementation. Class drivers can cancel and requeue requests at any time. There's no extra flexibility. > >Ideally it would not be necessary to rely on a timeout at all. > > > >Also, maintainers dislike module parameters. It would be better not to add one. > > Okay. I would be happy if any alternative for this issue is present but unfortunately > I am not able to figure out any alternative other than timers. If not module_params() > we can add an configfs entry in stream gadget to update the timeout. Please provide > your opinion on this approach. Since the purpose of the timeout is to detect a deadlock caused by a hardware bug, I suggest a fixed and relatively short timeout value such as one second. Cancelling and requeuing a few requests at 1-second intervals shouldn't add very much overhead. Alan Stern