Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp171157imu; Thu, 6 Dec 2018 22:06:44 -0800 (PST) X-Google-Smtp-Source: AFSGD/WWf6XF3+ydS6TCpodznDeAmNepvJieYEvBVdjRziVukwiwbiICSwviyYaHmOonS7wLXCxN X-Received: by 2002:a17:902:161:: with SMTP id 88mr973067plb.306.1544162803977; Thu, 06 Dec 2018 22:06:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544162803; cv=none; d=google.com; s=arc-20160816; b=ooaCE1LD4m9xcsKLwXqzbREvd8OOpsfHtjN9FaSOMfqj75qw/vSAOOAstSn1HjFtjq FCKuLU+qxHxtWRl/MdpEtCoogSv2ogozH4PQ/n4OsB8n52RNeY+ZKdSQFsahsFkNm4SJ K9Z8WT9/AgoiL14ygfFuaM3nid4sBzEnjHS0WUHwuXw43FpXvurvn+uEQfEhrnrCzMcZ PwD5CWW3LYraSZlomwSSmKXH1/KdJSPoQgUsAW8XICtZl4avS/rlxdefrqkZmLYyT4/n ZeJXG3LtWBdcFPgGzMtptyP9sS4RUSFZbQHW6cWjNB7cXJExtNdhubQwykOpaw8rjOeH dayQ== 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:date:references :in-reply-to:subject:cc:to:from; bh=tZCJGaUQCdD7/g9ostzQSQcBK10Di7JnQ20SymB4OSg=; b=QbS0yGBADzXkpwIegqgEZ1oPWfVRAAN+ffaaVgYRj9QtVIq8V6ZvnC7qXL6qRXSqWz KgyiNY0sNuFEe2mfx7Jooq/3CSkKH+Yj2xEtHqdVWSc5v4ihEfdhYsRod+dq/cCAFGYm Ygg6piFxqOWJfiIuGAr2ZiGjUK3bak07R9ELNixrvpin1B7W+eyp7BUHLfbK+f/rJMGZ zihm68YBgAFIAHpA6oy12/MgKQnJrCzCxD6bPQ58/GLojq3eeXmMx4TkZ9HIrcH3qUil pGvna2M7Sd/WShfxqU/Jg3ZiAEf4fNXTUqSUOcGjmMMs4nOHhYi+cNFJ4juPCl7lD7/g 3fbw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y27si2059836pga.459.2018.12.06.22.06.28; Thu, 06 Dec 2018 22:06:43 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726027AbeLGGFq (ORCPT + 99 others); Fri, 7 Dec 2018 01:05:46 -0500 Received: from mga05.intel.com ([192.55.52.43]:54863 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725948AbeLGGFq (ORCPT ); Fri, 7 Dec 2018 01:05:46 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Dec 2018 22:05:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.56,324,1539673200"; d="scan'208";a="281662781" Received: from pipin.fi.intel.com (HELO localhost) ([10.237.72.175]) by orsmga005.jf.intel.com with ESMTP; 06 Dec 2018 22:05:40 -0800 From: Felipe Balbi To: Anurag Kumar Vulisha , Alan Stern Cc: 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: References: Date: Fri, 07 Dec 2018 08:05:39 +0200 Message-ID: <877eglx45o.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org hi, Anurag Kumar Vulisha writes: >>Does the data book suggest a value for the timeout? >> > > No, the databook doesn't mention about the timeout value > >>> >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. Why, if the UDC implementation will, anyway, be a timer? >>(Especially if dwc3 is the only driver affected.) > > As discussed above, the issue may happen with other gadgets too. As I got divide opinions > on this implementation and both the implementations looks fine to me, I am little confused > on which should be implemented. > > @Felipe: Do you agree with Alan's implementation? Please let us know your suggestion > on this. I still think a generic timer is a better solution since it has other uses. >>> >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. I wouldn't call this a HW bug though. This is just how the UDC behaves. There are N streams and host can move data in any stream at any time. This means that host & gadget _can_ disagree on what stream to start next. One way to avoid this would be to never pre-start any streams and always rely on XferNotReady, but that would mean greatly reduced throughput for streams. -- balbi