Received: by 10.223.185.116 with SMTP id b49csp4467902wrg; Mon, 26 Feb 2018 19:08:35 -0800 (PST) X-Google-Smtp-Source: AH8x227lQp7uK1OWBsPnvsa2NDEH4KM8Emkjy+DB0ZO8DtAH0PhMtQj61y8+wd/iljosTmdZ/uxI X-Received: by 10.99.137.195 with SMTP id v186mr10069984pgd.90.1519700915490; Mon, 26 Feb 2018 19:08:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519700915; cv=none; d=google.com; s=arc-20160816; b=vuiA0zkWJEGBwp7aLvKj+bcs4jUIDA7giUY0ZdL6Jw0VixWXslzAoWanUBC/xxZF3x 7kaHr/sdHbs8ixp1unQzjgg8LdQQB2A/Ui4sNe1FBf4UW31fZr/qxdycLCnmg61gPnh3 7jzkPAtzVUtFH4vWrNb8UxcV1JKtMF58U/LOca0ea4cs2/t1nHhWrjRqmxketCataRll Q+ShCkTObIbt/pW7/Z9nInrgrqvb3P6jOI0N4kfMku5IUvw/Q9hiWTYnIuRcOABZy78s 1CmqSDYZRer2FbHMBpvISVruWHImKw+FvhSyZXfNvz5vQQgoKDqkL7cztPGsnMRTwL1P kXGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:spamdiagnosticmetadata :spamdiagnosticoutput:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature:arc-authentication-results; bh=2olEaU1CR9Zmvz2BZbMZmM6hLll8SeGjacqHlJc65sI=; b=WaJefbseh/j8Aqx4kehCx/zk7vfAQ4TINybM3WPp+lY6uMyhbCBtg4xA+oS1OqDexH eECPZbK6Nr2bIDeZ/HFesmBlbhMqYtrPfqw9Kw6smjzb096Nl64sHTeRUX2bwfoGHA09 5UdL2LFHCEuZIt6vEkfhZphNscFvlY+WcpdJGibfSo1+Jt3aed5ZGvheZizaj5k27XJY ZziRpUebSCEYUt48coovrkI0ljFYEVOuynjo7wqCGHUpYreIDl2itI7GYm7Ik+mrKRqd SXrnRyAwYGPZ2Zc4XORypf8lbND37wTxkoKGIwUlFmqFhpvrNddFIy+lIHV3zkH2OMW5 DJZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=C5Xp1DmB; 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 a13si7783752pfc.255.2018.02.26.19.08.21; Mon, 26 Feb 2018 19:08:35 -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; dkim=pass header.i=@Synaptics.onmicrosoft.com header.s=selector1-synaptics-com header.b=C5Xp1DmB; 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 S1751634AbeB0DHj (ORCPT + 99 others); Mon, 26 Feb 2018 22:07:39 -0500 Received: from mail-sn1nam02on0067.outbound.protection.outlook.com ([104.47.36.67]:1754 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751411AbeB0DHh (ORCPT ); Mon, 26 Feb 2018 22:07:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Synaptics.onmicrosoft.com; s=selector1-synaptics-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=2olEaU1CR9Zmvz2BZbMZmM6hLll8SeGjacqHlJc65sI=; b=C5Xp1DmBT9nHfropB1Bs/JaMb4bUAwPDiQAUO99RjwqSJgcZ2o8zL/zNixJiWjWkBmuKPaiCQ2S+BwaZI9kqTC0dPxxhAy4xmPLOOIM20paI9j05VZIl7yLLZhjiW3sfzyuj6gNXTSQcS8GOwheDrSK3OUp2soLfJKpKZ5ryL9o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=Jisheng.Zhang@synaptics.com; Received: from xhacker.debian (124.74.246.114) by CY4PR03MB2632.namprd03.prod.outlook.com (2603:10b6:903:75::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.527.15; Tue, 27 Feb 2018 03:07:33 +0000 Date: Tue, 27 Feb 2018 11:02:45 +0800 From: Jisheng Zhang To: Evgeniy Didin Cc: , Alexey Brodkin , Eugeniy Paltsev , Douglas Anderson , "Ulf Hansson" , , , , Vineet Gupta Subject: Re: [PATCH 0/2 v3] mmc: dw_mmc: Fix DTO/STO timeout overflow calculation Message-ID: <20180227110245.6d78ff23@xhacker.debian> In-Reply-To: <20180226143413.44134-1-Evgeniy.Didin@synopsys.com> References: <20180226143413.44134-1-Evgeniy.Didin@synopsys.com> X-Mailer: Claws Mail 3.16.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Originating-IP: [124.74.246.114] X-ClientProxiedBy: HK2PR04CA0090.apcprd04.prod.outlook.com (2603:1096:202:15::34) To CY4PR03MB2632.namprd03.prod.outlook.com (2603:10b6:903:75::11) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6b5214a4-62c3-437c-5219-08d57d8f4061 X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(7020095)(4652020)(4534165)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020);SRVR:CY4PR03MB2632; X-Microsoft-Exchange-Diagnostics: 1;CY4PR03MB2632;3:TsXWYtxvQ81fkHZYDVvojQqP3q4x5AlVuDnr6mNdNfserK085XPT8YP9lpqbloY+d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LEqxb7PpWqE5SnizHFn8OZ89Q3DCGGqdbNR0awy3BqKwzTPaz+zHCvyx/sN+azW9R6gUjZMfPuNDtUpFblGdT9lhxwXVk9JjmhqLyBT25Cl9ZbaGPsS2xg0D0o+Gv7EiEuRqtSqHvNHA42RAPRmnS7RTHSXbr2lEcULxOAblJtssIh6C/ek+J+OkDAFdCo6Mk=;4:jVKQ89jT/tAHGwQIcFONApRQmYUXXD9unD8B355Jhx+Mi1HoxnvmePPiaBY7QsGf2AqROKRQx8ZLJaQ9NK8kHcUdkxM7O/qdn2N+27SEi3BWPEPUvI3uUXxP6CeQVSRuCMWpYoFqN/eTvcA9t7MEAARc+2NjEUTbIt0csFJoL85fe13WahBFjYftN6wnJ+V4Xi+hdDsmIdWC+OYCH0tlv6oSEQVqaQjWM5kMPvp91WKXicRYYALCRmGml3QX5oiF/RtedsDiZ1vmYVST6MtivQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(6040501)(2401047)(5005006)(8121501046)(10201501046)(3231220)(944501161)(52105095)(3002001)(93006095)(93001095)(6041288)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011);SRVR:CY4PR03MB2632;BCL:0;PCL:0;RULEID:;SRVR:CY4PR03MB2632; X-Forefront-PRVS: 05961EBAFC X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(39380400002)(376002)(346002)(396003)(39840400004)(366004)(199004)(189003)(97736004)(33896004)(6506007)(386003)(4326008)(72206003)(47776003)(478600001)(66066001)(25786009)(186003)(26005)(106356001)(68736007)(5660300001)(1076002)(7416002)(6116002)(23726003)(3846002)(2950100002)(16526019)(6916009)(7736002)(305945005)(50466002)(229853002)(2906002)(105586002)(50226002)(230700001)(86362001)(81156014)(53936002)(55016002)(8936002)(6246003)(7696005)(8676002)(9686003)(52116002)(76176011)(54906003)(316002)(81166006)(6666003)(39210200001);DIR:OUT;SFP:1101;SCL:1;SRVR:CY4PR03MB2632;H:xhacker.debian;FPR:;SPF:None;PTR:InfoNoRecords;A:1;MX:1;LANG:en; Received-SPF: None (protection.outlook.com: synaptics.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;CY4PR03MB2632;23:f9eyXrvMzZQ9vmW8FWG0cXWpRo32w4woKlYQSluwM?= =?us-ascii?Q?jrGvOvqp46KVdaSMIMet0/LeOFSxNa1G8dXUzAuFx7UI4jDZialqc4kD1ENO?= =?us-ascii?Q?iPXqGRPvTVt8ySoP/GmAzVhmwQRBvf9XiUWABxq9vcjQ1mWliPmbJY00vMPr?= =?us-ascii?Q?cMMOd2zR9UWLC1S5v+R+eVEQC2NKmCtfMRMjlf8jTtpfRIeoPLrJsVemWNYO?= =?us-ascii?Q?a2msMTrjUm1bBTy9gIzXYr8/olmPEBlV18JUIBcMJYIXxRW5a22MBUH+BSr0?= =?us-ascii?Q?9OdU8zlpuZSQwj5d9fBIWFW/fgZIBKDeH/bBWn/2I3W3GUosC180l0P1UcGw?= =?us-ascii?Q?YbazD7RLufcJDvxUCfNpCLh+AIajWz+heZeFnK9DrjJmpf+xJVqziu+mZV3B?= =?us-ascii?Q?h2nXlzS0232kwXsgcxSHeojtNrEcPoN66buB4Vyz3ITPUcnivhPNmY98gg98?= =?us-ascii?Q?ed7jH1e2p0DH2TCnc461Awd5CrKaUpyIZYxKu5nr7e4gjVPYcAOqTYcchNpg?= =?us-ascii?Q?Nmh9VEiWakC8V8meJ/nWRYfvXwYxHwi8XHO0/B0KVPV3RmoutigRwiIGJt8s?= =?us-ascii?Q?6YIx2CIBpUWX/zVFuqhRYjs/c5h9Siru5ZLpSlXOvaIjKsbRCpcbIO7WGLfo?= =?us-ascii?Q?CBdb+2klTSdeoYLhaaKTIMiUgVXTql7dg7/4Tjw0qKtfTdQdYbcsKabhuSzU?= =?us-ascii?Q?0JXfhBA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;5:KPzEty6wwtQxGnBzP378JXEFs4p6Yy5VnTzPfhvPv26f7pyrmxaIgCnstKG+tjQ2cXL//cyjqlvpD7qXYw5R/Qag+FWCCjXxn7nWqgocWJb7l0pH8WUUBvcclIZbqYrcPmAAPGcWpXCwve2nLe3tOPRtnlWO3e++l7AGkCq2ovs=;24:cwMQPwSQeCUMiHv58obPijmPnTD7i57E79QVOANYEZOGfuLDcN2ApXW1n6bWUJCrhmpcK6sF6gPWYoqB2vQwmDm8gsxaUrb85FWeWYY7C2A=;7:t5I8FLEZDvTgxydEQf1T/PDfUsYG6fTH5mP9dpp4TGs2Oon4TRJsXwnm1f8f/1SfErPl43CKokjOyLSa28gzLjvuPkgIGvmpZt5C+x1Q/g/Bo3EKh+3iP7ZntWzRWdji8/XvbRxSWOhdD3pTiG4gaj4ZPvYtdlpIjOs2YSNukGpP/U0Z78roBNgQmXeNBDYztKkHKiTHpfrI0n21hxYoUayXcFVgmrssOhcm/wdRxn/eOYOs6GQe9H/Pq46DkcCt SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: synaptics.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 Feb 2018 03:07:33.3270 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6b5214a4-62c3-437c-5219-08d57d8f4061 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 335d1fbc-2124-4173-9863-17e7051a2a0e X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR03MB2632 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 26 Feb 2018 17:34:11 +0300 Evgeniy Didin wrote: > For some 32-bit architectures calculation of DTO and STO timeout can be incorrect > due to multiply overflow. Lets prevent this by casting multiply and result to u64. > > Suggested by Jisheng Zhang. > Switch DIV_ROUND_UP macro to DIV_ROUND_UP_ULL is not reasonable > because overflow happens on multiply and DIV_ROUND_UP_ULL helps > with sum overflow. hmmm, I mean something as below: -cto_ms = DIV_ROUND_UP(MSEC_PER_SEC * cto_clks * cto_div, host->bus_hz); +cto_ms = DIV_ROUND_UP_ULL((u64)MSEC_PER_SEC * cto_clks * cto_div, host->bus_hz); This could avoid build error in arm case. > > --- > Changes since v2: > -add fix for cto_ms > > Evgeniy Didin (2): > mmc: dw_mmc: Fix the DTO timeout overflow calculation for 32-bit > systems > mmc: dw_mmc: Fix the CTO overflow calculation for 32-bit systems These two patches could be folded into one patch? Thanks