Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp370416pxa; Fri, 21 Aug 2020 09:19:12 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyBEMPErG1CXgZnl3fJ6560o0jQqEWmU+nnRMay90vum9DviO+oqCrYkjGYBLMV289TC4nX X-Received: by 2002:a50:9fe6:: with SMTP id c93mr3503674edf.286.1598026752014; Fri, 21 Aug 2020 09:19:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598026752; cv=none; d=google.com; s=arc-20160816; b=kdi8QclfFbzJKUy8xKzIzTUeoWHyUb22eZvNTZh2GDlwQqA3ZkhJfBXP+62IAdP+B0 /TiCxvGARqJ6tUXFhjfD6735kyBVGEsNpCQl+Cf+heHQ9irip70uuutK31CRLl8iVQl7 lJCFe63+Orm21mtZV52vyd7k5PtToK7xfh71A51NQBB7KzcgKFU8CvP5Tm4xmIS5w7K2 BIBgFcLXLshS5EQheGFvLLcMjLaoAXoPFHBZKv0yHTg0AMivmOrO9Q7mcf51sPTIwq43 Wrb6YJzZH78gQYCG+bWDiq2+y/4Ti9z7PWSL2q3tpnxdP4ljZxepRNZmR6SQhOfLz/Mp XmUQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type :content-transfer-encoding:organization:mime-version:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature:dkim-filter; bh=Dxb1SZqMxibqUhl7VyWNPNEmP5zeKa3acFNVfEqRw/o=; b=X+pZCglLDueDqCBhn+/SgqLaWDxeCiWtIuetxbFUWJ0D40e1Aupw7O/BhyUhRDdiKL 8ZwPzO04cVc5pSOq3F8l+YDWy9TCmYDJ5Ui2cywdLyWo47dZwfK1zXgX1IQo/KVorS6z Uyi+7Hq3Cm6nx9GuY12Q8521Nc1C7EvuXo6+6RstH2dbSXhw6gOzVfZCiVfXb2GYX1BO ovefwv0WCCSVNqPXHth/mw6xKNQX8m5SWwCKJIX794UAt7V1JNxpkpvW/F5HMEjtJYPn r8e4EQGAfW+J9M70htAhhbFCgjbwIsQMY5s2+zn8LpkuGyuoaeR8K+La5tYLkqBS5Tf1 5Nbg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Ofdfivze; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c5si1558347ejm.274.2020.08.21.09.18.47; Fri, 21 Aug 2020 09:19:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Ofdfivze; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727123AbgHUQPL (ORCPT + 99 others); Fri, 21 Aug 2020 12:15:11 -0400 Received: from mailout2.w1.samsung.com ([210.118.77.12]:38845 "EHLO mailout2.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726956AbgHUQOW (ORCPT ); Fri, 21 Aug 2020 12:14:22 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout2.w1.samsung.com (KnoxPortal) with ESMTP id 20200821161409euoutp023e0e376ce1d2c23f9a9a3ac6b2fb22ce~tVJbCVso_0696006960euoutp02F for ; Fri, 21 Aug 2020 16:14:09 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout2.w1.samsung.com 20200821161409euoutp023e0e376ce1d2c23f9a9a3ac6b2fb22ce~tVJbCVso_0696006960euoutp02F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1598026449; bh=Dxb1SZqMxibqUhl7VyWNPNEmP5zeKa3acFNVfEqRw/o=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=OfdfivzeID+QoggnK8XOEVNIPQgAVgy9s/4/dsDxCMcelyYsqZ55fFVQAzWqAo9p1 LVDhQCO5AzEl4hiPYlEALMMCb3+8TEgq8qqFTFUEZtghWqtPG/6ypFp2gHHbMVzqaz 29WbXxGh/96oueBnmCJ50Xq98W9pV40VLuVbgGSI= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200821161408eucas1p2cafb7eeed6d5b4efac5898f5a39f8204~tVJaHwHFv1578115781eucas1p2l; Fri, 21 Aug 2020 16:14:08 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id 05.B2.06318.0D2FF3F5; Fri, 21 Aug 2020 17:14:08 +0100 (BST) Received: from eusmtrp1.samsung.com (unknown [182.198.249.138]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200821161407eucas1p23a283ac117d4381e087e9bacec537665~tVJZrBcp81823418234eucas1p2m; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200821161407eusmtrp10acbb38b7aa0954ac61f8e63a2c5ccda~tVJZqYXBt1179011790eusmtrp19; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) X-AuditID: cbfec7f5-371ff700000018ae-d5-5f3ff2d0fc0e Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id E2.B9.06017.FC2FF3F5; Fri, 21 Aug 2020 17:14:07 +0100 (BST) Received: from localhost (unknown [106.120.51.46]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200821161407eusmtip2fe0ec413613697189cd2361948227403~tVJZdOHJ_2051720517eusmtip2n; Fri, 21 Aug 2020 16:14:07 +0000 (GMT) From: =?UTF-8?q?=C5=81ukasz=20Stelmach?= To: Kukjin Kim , Krzysztof Kozlowski , Andi Shyti , Mark Brown , linux-spi@vger.kernel.org, linux-samsung-soc@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: m.szyprowski@samsung.com, b.zolnierkie@samsung.com, =?UTF-8?q?=C5=81ukasz=20Stelmach?= Subject: [PATCH v2 8/9] spi: spi-s3c64xx: Increase transfer timeout Date: Fri, 21 Aug 2020 18:14:00 +0200 Message-Id: <20200821161401.11307-9-l.stelmach@samsung.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200821161401.11307-1-l.stelmach@samsung.com> MIME-Version: 1.0 Organization: Samsung R&D Institute Poland Content-Transfer-Encoding: 8bit X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrIKsWRmVeSWpSXmKPExsWy7djPc7oXPtnHG/zv5LNY/OM5k8XGGetZ LaY+fMJm0f/4NbPF+fMb2C1uHlrBaLHp8TVWi8u75rBZzDi/j8mi8eNNdou1R+6yO3B7XF/y idlj06pONo/NS+o9+rasYvT4vEkugDWKyyYlNSezLLVI3y6BK2P19tfsBbs4KjoWTmZtYHzG 1sXIySEhYCJx7/hupi5GLg4hgRWMEicutjNDOF8YJX5NWsMEUiUk8JlR4sjmAJiO/b0HWSGK ljNKnN40hx3Cec4osa9pEStIFZuAo0T/0hNgVSICE5gkHp57A7aQWaBUomfnITBbWMBZ4sm9 /WA2i4CqxOsFe8FsXgFriZMr10IdKC/Rvnw7mM0pYCNx/FITK0SNoMTJmU9YQGx+AS2JNU3X WSDmy0s0b50N9oOEwCl2iUkNm6AGuUj8OL2LBcIWlnh1fAs7hC0jcXpyD1CcA8iul5g8yQyi t4dRYtucH1D11hJ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U4GBWEuF1Ons6Tog3JbGyKrUoP76oNCe1+BCjKdCbE5mlRJPzgYkh ryTe0NTQ3MLS0NzY3NjMQkmct0PgYIyQQHpiSWp2ampBahFMHxMHp1QDo7xZd5Szt3//6eNX MxcLvvwbPD2Rp6T13+Lrisa/2VTmu7Iu1WK1bRFaUB3QssG843jhL2/x/ZPK4+efnxn81lcs O+9rh4/r/F5N8ZrerM0qU67fNJigMb3OrDDksETE6kc3BWUrXn9aYp0TarCM+R13vv3uKYp7 nj5ZohCxdXLSpYgrhgGPlFiKMxINtZiLihMBWyc9dNQCAAA= X-CMS-MailID: 20200821161407eucas1p23a283ac117d4381e087e9bacec537665 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200821161407eucas1p23a283ac117d4381e087e9bacec537665 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200821161407eucas1p23a283ac117d4381e087e9bacec537665 References: <20200821161401.11307-1-l.stelmach@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Increase timeout by 30 ms for some wiggle and set the minimum value to 100 ms. This ensures a non-zero value for short transfers which may take less than 1 ms. The timeout value does not affect performance because it is used with a completion. Similar formula is used in other drivers e.g. sun4i, sun6i. Signed-off-by: Ɓukasz Stelmach --- drivers/spi/spi-s3c64xx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c index 89c162efe355..ea5a22dec53d 100644 --- a/drivers/spi/spi-s3c64xx.c +++ b/drivers/spi/spi-s3c64xx.c @@ -473,7 +473,8 @@ static int s3c64xx_wait_for_dma(struct s3c64xx_spi_driver_data *sdd, /* millisecs to xfer 'len' bytes @ 'cur_speed' */ ms = xfer->len * 8 * 1000 / sdd->cur_speed; - ms += 10; /* some tolerance */ + ms += 30; /* some tolerance */ + ms = max(ms, 100); /* minimum timeout */ val = msecs_to_jiffies(ms) + 10; val = wait_for_completion_timeout(&sdd->xfer_completion, val); -- 2.26.2