Received: by 10.223.185.116 with SMTP id b49csp4395171wrg; Mon, 26 Feb 2018 17:16:34 -0800 (PST) X-Google-Smtp-Source: AG47ELtJcN62PYms7AqolzznxgCTyiGOOStv3CyqMcmO1cXhWsY3SP7n9RBluXjDMCnyq8Cj2UjC X-Received: by 10.98.68.154 with SMTP id m26mr1466582pfi.171.1519694194609; Mon, 26 Feb 2018 17:16:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519694194; cv=none; d=google.com; s=arc-20160816; b=qYaRZVJsxQ5TTeXgEyPXPCTT9ZrZPQc6STNsWtzFqhtkVbh8yQOj5Ythb+WAntjoUJ ymFEdV8KdS3mc4w9lEOdaX64tKVpfl4LNlkGErcYhQjikHE8vRIGiwCZ6SNTts+6/m2f Yp4lVtaugxhD8nd6I0cARHExdjODXoFnjnU3Jus+5me//CUkbwQ+IIYXOw2/hDXkpD/W UfziQz0yeADKC7kj470IALmtg2wegP8EJj4MfUpQODRuBjOFxUIrqlcKslufl5mRsHFm Ksx1AleB7AvVOoSArwhjG/b7IjAVxDg1dnJu9R8gYow4sW7Aaiaol0wLxfhsZAemDIYv P8oA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:to:subject :cc:arc-authentication-results; bh=9rf1etHn+fQjEvha65G8LDDPlRpRSM/6qOStiUe+xow=; b=goc8z2BrTVh2oij9PLM9xpDyz69npy6pZK9H3ukIUA914JhwhtJI5dQZUSmvxlnfvU GmWRXndwSpQ6jqPWFQidxTztalwskLIwmyac7RdOj1VzsfTBpm5c+fn7hnQuaaXVbJER B6ryPLGTwFPnlyeRhDarcMGqjRZdfTLTns2zf4MlOPD0SOEXfVRwFGei+0ytxYF6xPl8 CWuDZuZbb2CA9uliqA7BrPOOoB7fzkAPIEOTW8aOOKdGdoaaBq37z2LytKoC068QhdT+ yQvqLPCWOSDPaDsFHJa3P3u09+BELoO1aIjuVrBlA3lDGE4nPWtAJ1KJVpndFoiZS8v8 DO/A== 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 e28si6316187pgn.311.2018.02.26.17.16.20; Mon, 26 Feb 2018 17:16:34 -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 S1751745AbeB0BOw (ORCPT + 99 others); Mon, 26 Feb 2018 20:14:52 -0500 Received: from lucky1.263xmail.com ([211.157.147.130]:41694 "EHLO lucky1.263xmail.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751396AbeB0BOu (ORCPT ); Mon, 26 Feb 2018 20:14:50 -0500 Received: from shawn.lin?rock-chips.com (unknown [192.168.167.87]) by lucky1.263xmail.com (Postfix) with ESMTP id C9A3D1F59E4; Tue, 27 Feb 2018 09:14:46 +0800 (CST) X-263anti-spam: KSV:0; X-MAIL-GRAY: 1 X-MAIL-DELIVERY: 0 X-KSVirus-check: 0 X-ABS-CHECKED: 4 Received: from [172.16.12.51] (localhost [127.0.0.1]) by smtp.263.net (Postfix) with ESMTPA id 5DF673DC; Tue, 27 Feb 2018 09:14:22 +0800 (CST) X-RL-SENDER: shawn.lin@rock-chips.com X-FST-TO: vineet.gupta1@synopsys.com X-SENDER-IP: 58.22.7.114 X-LOGIN-NAME: shawn.lin@rock-chips.com X-UNIQUE-TAG: <9ceb694a5a29c582a22539b72e91f653> X-ATTACHMENT-NUM: 0 X-SENDER: lintao@rock-chips.com X-DNS-TYPE: 0 Received: from [172.16.12.51] (unknown [58.22.7.114]) by smtp.263.net (Postfix) whith ESMTP id 80562QIKLV; Tue, 27 Feb 2018 09:14:36 +0800 (CST) Cc: shawn.lin@rock-chips.com, Alexey Brodkin , Eugeniy Paltsev , Douglas Anderson , Ulf Hansson , linux-kernel@vger.kernel.org, linux-snps-arc@lists.infradead.org, stable@vger.kernel.org, Vineet Gupta Subject: Re: [PATCH 1/2 v3] mmc: dw_mmc: Fix the DTO timeout overflow calculation for 32-bit systems To: Evgeniy Didin , linux-mmc@vger.kernel.org References: <20180226143413.44134-1-Evgeniy.Didin@synopsys.com> <20180226143413.44134-2-Evgeniy.Didin@synopsys.com> From: Shawn Lin Message-ID: Date: Tue, 27 Feb 2018 09:14:23 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180226143413.44134-2-Evgeniy.Didin@synopsys.com> Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > Tested-by: Vineet Gupta > Fixes: ARC STAR 9001306872 HSDK, sdio: board crashes when copying big files > > Signed-off-by: Evgeniy Didin > > CC: Alexey Brodkin > CC: Eugeniy Paltsev > CC: Douglas Anderson > CC: Ulf Hansson > CC: linux-kernel@vger.kernel.org > CC: linux-snps-arc@lists.infradead.org > Cc: # 9d9491a7da2a mmc: dw_mmc: Fix the DTO timeout calculation As I said, the correct tag may be: Reported-by: Vineet Gupta # ARC STAR 9001306872 HSDK, sdio: board crashes when copying big files Tested-by: Vineet Gupta Fixes: 9d9491a7da2a ("mmc: dw_mmc: Fix the DTO timeout calculation") Cc: Signed-off-by: Evgeniy Didin ... ... > --- > Nothing changed since v2. > drivers/mmc/host/dw_mmc.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > - drto_ms = DIV_ROUND_UP(MSEC_PER_SEC * drto_clks * drto_div, > + > + drto_ms = DIV_ROUND_UP((u64)MSEC_PER_SEC * drto_clks * drto_div, > host->bus_hz); > Hmm? #define DIV_ROUND_DOWN_ULL(ll, d) \ ({ unsigned long long _tmp = (ll); do_div(_tmp, d); _tmp; }) #define DIV_ROUND_UP_ULL(ll, d) DIV_ROUND_DOWN_ULL((ll) + (d) - 1, (d)) It uses intermediate unsigned long long _tmp for your "multiply", namely MSEC_PER_SEC * drto_clks * drto_div, which could solves the problem. So I don't see why DIV_ROUND_UP_ULL can't work for you? > /* add a bit spare time */ >