Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp3599365ybx; Sun, 3 Nov 2019 23:06:12 -0800 (PST) X-Google-Smtp-Source: APXvYqy5mh6QSTd9MgZEzv3VjEp72JTcSzbSanQwSxpnr/L2vyBuEVw3057+xKrFHpp7rcUQEngy X-Received: by 2002:aa7:c1d4:: with SMTP id d20mr28092135edp.47.1572851171904; Sun, 03 Nov 2019 23:06:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572851171; cv=none; d=google.com; s=arc-20160816; b=g2euew97551YD+izIJpLagJI8j/jx2g3jKOQ2J0NSn+m603+FWNOIfG18P9neFGOjc vxwcAxpUahs71VGrP2JKJN4evaZma1WZ4AU+kW9eOVMrRTtMCQv5xnkygA0g+Gw0YkOM i7U6goT+hQ/arzvbwchdyjIAfDSsDJkJUrx5iFqsjUVHlsqKHfK0xD+WkUGgpuboTFBu ++Wo+q0OtoLPOB17uiCQBQ+1RQmreNW87eKiOMeBdbP8H5D2vfQ0/Jj2fqRb9wBLCcIw 5fL0O4E0VPKyNssCZ+d8nRlaZrbfswZcfIdj4gCXd1R3yD3y4EooSSqBy4tL5Z1B4hAJ SO+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from; bh=8xkWp/fym/hn1J5Ycq6ZsJPDmGeIdBQmXmVuEJDwOQI=; b=TZCUyl2lxA/vo1sr8mx6/Q6bTFSEhrqL8fYBvOzOetOf6pwN7qnnIu03ubOnMefvIB zYJu3P+7YC0PGjdsoYdNtgTR4kAY7o/wJiWwvd+SFGWvZ1N+XsBF6x5GeKt2cvJyO0pB HUVH5rJAGwX6EkjPzI1uHrYMaa6hY4huojnujIBzQOqgtu4SyGR0zqgUs6GLtHf7NVtC AvMuOgFnUfph7KORKfoZnfiWuhdwzw95A8lb4Cwjugxj3/EHfkZLKS9rT39o6khO15pE /NKx7+dxmKpRbsiUHNHKRuegRGxr15hdMCBcWuo/7CO7deKD4kk7a9w1IJ8aC2Ov4C6R uUqw== 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=mediatek.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d10si6867751edb.226.2019.11.03.23.05.48; Sun, 03 Nov 2019 23:06:11 -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=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728428AbfKDHC0 (ORCPT + 99 others); Mon, 4 Nov 2019 02:02:26 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:38627 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1727588AbfKDHCZ (ORCPT ); Mon, 4 Nov 2019 02:02:25 -0500 X-UUID: d152db2b570546fd840f1143fc24f6d4-20191104 X-UUID: d152db2b570546fd840f1143fc24f6d4-20191104 Received: from mtkcas08.mediatek.inc [(172.21.101.126)] by mailgw02.mediatek.com (envelope-from ) (Cellopoint E-mail Firewall v4.1.10 Build 0809 with TLS) with ESMTP id 260131558; Mon, 04 Nov 2019 15:02:21 +0800 Received: from mtkcas09.mediatek.inc (172.21.101.178) by mtkmbs07n2.mediatek.inc (172.21.101.141) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Mon, 4 Nov 2019 15:02:18 +0800 Received: from localhost.localdomain (10.17.3.153) by mtkcas09.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Mon, 4 Nov 2019 15:02:17 +0800 From: Yong Wu To: Matthias Brugger , Joerg Roedel , Will Deacon CC: Evan Green , Robin Murphy , Tomasz Figa , , , , , , , , Nicolas Boichat , , , , Subject: [PATCH v5 7/7] iommu/mediatek: Reduce the tlb flush timeout value Date: Mon, 4 Nov 2019 15:01:08 +0800 Message-ID: <1572850868-22315-8-git-send-email-yong.wu@mediatek.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1572850868-22315-1-git-send-email-yong.wu@mediatek.com> References: <1572850868-22315-1-git-send-email-yong.wu@mediatek.com> MIME-Version: 1.0 Content-Type: text/plain X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Reduce the tlb timeout value from 100000us to 1000us. The original value would make the kernel stuck for 100 ms with interrupts disabled, which could have other side effects. The flush is expected to always take much less than 1 ms, so use that instead. Signed-off-by: Yong Wu --- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c index c2b7ed5..8ca2e99 100644 --- a/drivers/iommu/mtk_iommu.c +++ b/drivers/iommu/mtk_iommu.c @@ -192,7 +192,7 @@ static void mtk_iommu_tlb_flush_range_sync(unsigned long iova, size_t size, /* tlb sync */ ret = readl_poll_timeout_atomic(data->base + REG_MMU_CPE_DONE, - tmp, tmp != 0, 10, 100000); + tmp, tmp != 0, 10, 1000); if (ret) { dev_warn(data->dev, "Partial TLB flush timed out, falling back to full flush\n"); -- 1.9.1