Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp87379pxa; Fri, 21 Aug 2020 01:47:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKd4r+VxP7P5S4IY6HbaAhJa4RHHIY9dv9i7lgdQEepaNMrpQFvO852DfL87kIDSyGMFPx X-Received: by 2002:a17:906:6859:: with SMTP id a25mr1817962ejs.524.1597999643585; Fri, 21 Aug 2020 01:47:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597999643; cv=none; d=google.com; s=arc-20160816; b=G5lLScDNKQEJiNn0dnaoemYCextW0BkOsROG8MIF5lWmTQlO/L55jdsEDZCwv3U6iD aE+swGY0fY41ORpczm1CEADRynIMYVwcH8TQfYUk3A3Hstliug27EuwdrRo6W/wgo2wc 00xUcrHaIVpILg5EIsJFUTnxTMZJ4EkbL00Gp07fCoC2dAD3ssXfH/CyY4t2zqInMktf Ccvpyf6lIDbvESoWlwAHLu6oAib0kJj1A5cbfEa3ks61Td6BVaFudTOpexRKmOymc0ms NRpdCLo+4OjSpey5hr8dDDNLC80093uWZY0dj1o9oDO+tyVzbVAeI+vvLdb+BqD8i5rK fR9Q== 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 :in-reply-to:references:mime-version:dkim-signature; bh=FBSyf+yXd7kiYAF9BZfiPGXH0tN6S8pKBPuNovCFIWg=; b=QNiC/4Bt+F1S/SS7YZop2EY5NV0KS2MNPNu/vCDXiBc/fPLyo1Qg2qTjvV+zc9frdv Y9ZWyKMmsrZFSG/cJlsdXAYgDoQCK6gB43ZOjJ1GJuxMk5z/dQydfHLIudBI2Znyaf0g 76pa2QDIa8AA29CVRfiaOT+uz4Wp6Yxf9EaQ5dpP+ww5KsV7A9SR3FFsCc5iOKnZfRMN XlKFMDyy58XqxwgVbGUlJlYMAlZkL3n6/qZHKY5wvwS/1b/q/TcNNW/AQL2e9u7O+BMh IGp6abcKK9bvLE6LHpvMdKtsrqjxYgQP94ysxvq113PUILTutqbp6fYWRkn4Mg3MQMrl xgXg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=bzUnGTMp; 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=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id u22si692656eja.418.2020.08.21.01.46.59; Fri, 21 Aug 2020 01:47:23 -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=@linaro.org header.s=google header.b=bzUnGTMp; 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=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728036AbgHUIqM (ORCPT + 99 others); Fri, 21 Aug 2020 04:46:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47400 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728000AbgHUIqL (ORCPT ); Fri, 21 Aug 2020 04:46:11 -0400 Received: from mail-ua1-x941.google.com (mail-ua1-x941.google.com [IPv6:2607:f8b0:4864:20::941]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 992EAC061386 for ; Fri, 21 Aug 2020 01:46:09 -0700 (PDT) Received: by mail-ua1-x941.google.com with SMTP id u15so324498uau.10 for ; Fri, 21 Aug 2020 01:46:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=FBSyf+yXd7kiYAF9BZfiPGXH0tN6S8pKBPuNovCFIWg=; b=bzUnGTMpFMBlKFRo4KHl6EmHFbz2NNiN55TErkmKGkClkdBPW7M8o/cmJou7X3zh0E v5/1DmgNBKJFGQftdVexRCnYxq9PSrmpRxK9hFhyuewGRT8Q8cFKzskZTQqdYYppLPk0 PZiCmQp/v/qeABwXaKmgFTkeK7NPzfMpZYgDekBA3fbM0fUDL2rGNjmycIungSLFP3l1 Ixq4N3ChAyrt0ePjJF0OAvJhHeFgIx+uaM3OpcHRf3zaL08JxrD+npAW6F+jBN6DIat6 s1CYxZufog8kBKhFOL9J93G+rlVALXH/IVTc4E4FDU3BbV9XSNuz+ZrIyb/g625Sc+bI A64Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=FBSyf+yXd7kiYAF9BZfiPGXH0tN6S8pKBPuNovCFIWg=; b=oIu374PN1Op1ycE0m6MQ4Otv6sTjDxGiYU7nz5UPvBnMP3tDnD9MIxWC6PXnOJsZ1d ByE1rxxG6Xt/B30ESFWyR79GfyG9aT9NHtxziGc8ndEStrPsoQWjl32AKH/Qo/tQtF3c 31QQQ/DQnzHLOaATcri+V6f9Ufwwf/EZPWG/se0IOYqzE2R2SXeYjVPOpXosmQXIZVUl gykFMESApHmavv4nA6gAR6TgEqQIgjMva38hCKC0LAHS6Cdf6p3B8NIgrxXAEthciQ0i +XM0SKFkvuKSekrKp4RSbLW4kzKjvG6FgudsNya/vQ0kCvrjmw1uSkRDA5Ulzy4Pfk0H 9H1w== X-Gm-Message-State: AOAM531SL2MVCJr2vfUjLZ45ja1iNTqd+4HVs2Jz5wJHxY1nSfa3zuN9 r7OsOydlDTx+5x0sZyF/0PppEwdlZgJ/NO6aYlRT5A== X-Received: by 2002:ab0:6341:: with SMTP id f1mr778421uap.19.1597999568563; Fri, 21 Aug 2020 01:46:08 -0700 (PDT) MIME-Version: 1.0 References: <20200814185011.3252020-1-t.schramm@manjaro.org> In-Reply-To: <20200814185011.3252020-1-t.schramm@manjaro.org> From: Ulf Hansson Date: Fri, 21 Aug 2020 10:45:31 +0200 Message-ID: Subject: Re: [PATCH] mmc: mmc_spi: fix timeout calculation To: Tobias Schramm Cc: "linux-mmc@vger.kernel.org" , 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 Fri, 14 Aug 2020 at 20:50, Tobias Schramm wrote: > > Previously the cycle timeout was converted to a microsecond value but > then incorrectly treated as a nanosecond timeout. This patch changes > the code to convert both the nanosecond timeout and the cycle timeout > to a microsecond value and use that directly. > > Signed-off-by: Tobias Schramm This looks good to me, but before applying just wanted to check that you tested this on some HW, to make sure it doesn't break anything? Kind regards Uffe > --- > drivers/mmc/host/mmc_spi.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c > index 39bb1e30c2d7..f85e0ad896a9 100644 > --- a/drivers/mmc/host/mmc_spi.c > +++ b/drivers/mmc/host/mmc_spi.c > @@ -882,9 +882,9 @@ mmc_spi_data_do(struct mmc_spi_host *host, struct mmc_command *cmd, > else > clock_rate = spi->max_speed_hz; > > - timeout = data->timeout_ns + > + timeout = data->timeout_ns / 1000 + > data->timeout_clks * 1000000 / clock_rate; > - timeout = usecs_to_jiffies((unsigned int)(timeout / 1000)) + 1; > + timeout = usecs_to_jiffies((unsigned int)timeout) + 1; > > /* Handle scatterlist segments one at a time, with synch for > * each 512-byte block > -- > 2.28.0 >