Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp904623imm; Wed, 25 Jul 2018 08:07:12 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdu8946/+dzA6REr2XghdeEDjNILHUQNhe89+8uwzx7pEl5Fm5oACrSsucZSlNOmJSmLdOu X-Received: by 2002:aa7:8118:: with SMTP id b24-v6mr22511134pfi.78.1532531232478; Wed, 25 Jul 2018 08:07:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532531232; cv=none; d=google.com; s=arc-20160816; b=HRxZsznlW5L266aZhb+YdJuIRupDy9bhR4g6fK9ilNh5ODoD5nhL665Gd/lvixkEmb Cr4Cu8pWX5S0O3QMMraOkdZymr4gZ6dV3eomvEvwEZOq4F2qOcVlgr377ai2QCDzoI82 1n6RPg1Ffm0xUJyfVIBE3waU/ILaSdBRutYwgWm7l0P75vxZApadEwLlhbCGIl00Pl0k rWd7MYTXmrG1PkKOQkJIxRiW4bbVHJxmDlVvN8pyt8uFYgYa/4CvMpCtTQggZqRI9PCG drJL4nWAZI+33OZbu/zHbxQsA50X4BHqqOaEHAhNXIrNHou2mWlsCzc26Yd1YYz4U/28 Ka3Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=mKvFcf9HM4qwTrOfP0SSasTN/CA7wUlrNHiMvmSH6TM=; b=iiCtfUe+AiYGyq3+vOqCDA2elCc1mJSrkMVHXoIs5IUMeVZBeUVJYMSIaisQA8hBZz lqOubZZDyXtbZNwlTqw7U27cPcoB3JBY4vNnzg9osVUA2k+mNeAYxmQezAvqM4zsz4Da eDceH2xib/w8yeghKARcpgGx9DegDUnb0IhgDTKOReom4v/yeWKxU1GwYR9SUqOoMyCY 4lM4Y6FceuzH9E/mS2/8CYfBOlw5qn+0nnmV3ug3q0UAYQ0Jw3Ut4LTgVu+bddyYrKeS Xmuai9x3n5VbKxHFSG86YieEozsNKMRQik8+KZ9xsV/7LNpOSbMJH94QIm1G0iA9dOE2 NPNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HSDSB488; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b10-v6si12622506pls.501.2018.07.25.08.06.57; Wed, 25 Jul 2018 08:07:12 -0700 (PDT) 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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=HSDSB488; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728502AbeGYQSG (ORCPT + 99 others); Wed, 25 Jul 2018 12:18:06 -0400 Received: from mail-vk0-f66.google.com ([209.85.213.66]:37647 "EHLO mail-vk0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728357AbeGYQSG (ORCPT ); Wed, 25 Jul 2018 12:18:06 -0400 Received: by mail-vk0-f66.google.com with SMTP id v72-v6so3957365vkd.4; Wed, 25 Jul 2018 08:06:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=mKvFcf9HM4qwTrOfP0SSasTN/CA7wUlrNHiMvmSH6TM=; b=HSDSB488bvycix0tWHNfBeOrSbAIaXurtnlZq24O9gS33k//EBoYSfS+Rre+BHpytn stLRxVGyvM9JCkNnyLGEv+zGNZbHJ1Oj0gV1E6RIIiS4kGVGD1Ryw0Turkmh6bWrMRml kEyxUGtoRclw1D0ibkWbV+TyIDJwYy/eLR86PjkCQ5dvH7bdYWFIsmTlcYKCsTjw4x3k 9XfAcMqHLlVAQGDp5v0luQUIWz4ZPg1/7Y8qEviXHU6x4QG8wuqvHQFs5V2bOjrMvrB1 c0ndAmmsoONJX2cOwfrPMKS1+t4/Seoh2ky1+gBvKDQgwwNt4RtHt06BBfn9EPJ6Y1tS tK+Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=mKvFcf9HM4qwTrOfP0SSasTN/CA7wUlrNHiMvmSH6TM=; b=mZdj6aOZYX+tHpXTsrJjg0bgFPIkZ/ysWveHewayAQYdRRXvCjtipqe/JOsjcpnWla xEHKyCrfOXL26NEy8R6xzv4ARW4mC00g46J6jaZ2phCQSXZLc0SLe9Rtj6+Sfg6S/5qF 4uReik57TXuU85UGp6O5MJH+V5Z8T5quBKXZ3QYP1lVLXpaD/vIQhn++b9eQdOkbq4OH eeKxOQgXVtbNLS7vPgkfQbPc8MRXMCQnMLZwlUUJRMxApa8VXhCdGhp8emslGOAM/hC4 g4BhVHSYgQiOwWQFDptAWNxU8H4dvUNCddVKZ3XXZSurXcpsVrvXo4eva2EV17gxK2ZP tzVQ== X-Gm-Message-State: AOUpUlGhCnMrKoTGUXFsvzed4F1GHsiUWnSW8dibjTtX1VmYuP525esN QLBPGEYUTkt+KYvwSZ77hDV3Fjx5/Dib7e9R+FfOSJ3P X-Received: by 2002:a1f:c884:: with SMTP id y126-v6mr13017408vkf.76.1532531160695; Wed, 25 Jul 2018 08:06:00 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a67:2149:0:0:0:0:0 with HTTP; Wed, 25 Jul 2018 08:06:00 -0700 (PDT) In-Reply-To: <1532519491-19502-5-git-send-email-anurag.kumar.vulisha@xilinx.com> References: <1532519491-19502-1-git-send-email-anurag.kumar.vulisha@xilinx.com> <1532519491-19502-5-git-send-email-anurag.kumar.vulisha@xilinx.com> From: Andy Shevchenko Date: Wed, 25 Jul 2018 18:06:00 +0300 Message-ID: Subject: Re: [PATCH 4/8] usb: dwc3: implement stream transfer timeout To: Anurag Kumar Vulisha Cc: Felipe Balbi , Greg Kroah-Hartman , v.anuragkumar@gmail.com, USB , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 25, 2018 at 2:51 PM, Anurag Kumar Vulisha wrote: > According to dwc3 databook when streams are used, it may be possible > for the host and device become out of sync, where device may wait for > host to issue prime transcation and host may wait for device to issue > erdy. To avoid such deadlock, timeout needs to be implemented. After > timeout occurs, device will first stop transfer and restart the transfer > again. This patch does the same. > +/* > + * Timeout value in msecs used by stream_timeout_timer when streams are enabled > + */ > +#define STREAM_TIMEOUT 50 Perhaps, STREAM_TIMEOUT_MS 50 Dunno about this driver, but it's a usual practice to help reader with understanding code on the first glance. -- With Best Regards, Andy Shevchenko