Received: by 10.223.185.116 with SMTP id b49csp3816066wrg; Mon, 26 Feb 2018 06:35:24 -0800 (PST) X-Google-Smtp-Source: AH8x227xjKeW5H840z9x1LKtaGhNZxzteBEYyKLfYjuY1C7EXpdehMMqq8NxHx3os2/PkkJTCZK7 X-Received: by 2002:a17:902:24a5:: with SMTP id w34-v6mr10604846pla.221.1519655724805; Mon, 26 Feb 2018 06:35:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519655724; cv=none; d=google.com; s=arc-20160816; b=bO1DZ9EN2cgD7Aw8Tphq68pFPKP1yFTg9n4z46IA46Ft2yxhPHVCBE1fZUDWCLOPeQ t83xRoeyZzEWZ3HEHApOnVaXOfKgx2q5GUJG1ZY/X26MibMMema4ajmkf/ueFgOeLOCr 7pJaNp70LyQJ99BQ0AR4PG6Olv4q4GnVuJIARj06jNjd7KjvEZ7cXTe0Kgq8eTwimF0L jFON0bhVO4CNQrdMmFM9gluwxbUtxCMvFOyFavOtkjKckexV2NSPFYW6B+mj/kSQvDoT ZM+bPdy826l6N78gfUa5IPK9cjwYLILGJ9fDC4KIgI9SqXGdWeyJQ1GMGzhNjtc7rERt wbPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=iDBIRUDpKmh8dMmead54G44vrhPxLQcd2utBhT+GJ1I=; b=fwSYp0B1t5iurHulAVh7fzrSsVACNkc8ZKH7nV/kf/bL0GmEpmmbkBX5wfmReAn6rK fH8z9aKGKPtpcpyQHkKjq6wdodLiOC1aANEaFnJrN1gKmGiR2E1bdeuVLa5qGHqxwib2 7efTmMAuyiw18vJC1oN6QAjBFez0m/VM1N70L9a2Cra6UEJGNTRhtrST7FnULjjRMGd8 oDEYfvnWeYcS8JJLUqHYI9RKthKz0ve6MLLvb9BPDccesKzYmxXbTUeUKxP6ho9fRSNz Efuez3+WKaW/BmN9zvO2uWgtUd9zU7rDfDLdTSc2S6TzM7s18cJZvVpxFg+F6HFl1srX cPag== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q19si493925pgq.10.2018.02.26.06.35.09; Mon, 26 Feb 2018 06:35:24 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=synopsys.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753775AbeBZOeY (ORCPT + 99 others); Mon, 26 Feb 2018 09:34:24 -0500 Received: from smtprelay.synopsys.com ([198.182.47.9]:34148 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753298AbeBZOeW (ORCPT ); Mon, 26 Feb 2018 09:34:22 -0500 Received: from mailhost.synopsys.com (mailhost2.synopsys.com [10.13.184.66]) by smtprelay.synopsys.com (Postfix) with ESMTP id 3422C24E15AB; Mon, 26 Feb 2018 06:34:22 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 1FE2E3B89; Mon, 26 Feb 2018 06:34:22 -0800 (PST) Received: from ru20arcgnu1.internal.synopsys.com (ru20arcgnu1.internal.synopsys.com [10.121.9.48]) by mailhost.synopsys.com (Postfix) with ESMTP id A340E3B7B; Mon, 26 Feb 2018 06:34:19 -0800 (PST) From: Evgeniy Didin To: linux-mmc@vger.kernel.org Cc: 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: [PATCH 0/2 v3] mmc: dw_mmc: Fix DTO/STO timeout overflow calculation Date: Mon, 26 Feb 2018 17:34:11 +0300 Message-Id: <20180226143413.44134-1-Evgeniy.Didin@synopsys.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. --- 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 drivers/mmc/host/dw_mmc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) -- 2.11.0