From patchwork Thu Aug 9 11:48:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Leizhen \(ThunderTown\)" X-Patchwork-Id: 143822 Delivered-To: patch@linaro.org Received: by 2002:a2e:9754:0:0:0:0:0 with SMTP id f20-v6csp1994066ljj; Thu, 9 Aug 2018 04:50:39 -0700 (PDT) X-Google-Smtp-Source: AA+uWPy6fg8e/ISvGqridc3NGL9A6WrJ45WWWnpjDv+gOvAOKme7VstrG26lh+Bpld7PxRBxEPUK X-Received: by 2002:a63:ce12:: with SMTP id y18-v6mr1885464pgf.144.1533815439434; Thu, 09 Aug 2018 04:50:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533815439; cv=none; d=google.com; s=arc-20160816; b=oFwqlaW3Ug9HfqeTauhCgFsPE4GETvMunMbVHOO/KtK5THzup8AP7M28i9aTSWEra8 s8d32SfXQWEWRlcKaU+KO+5i8tCDchW7GKgZ1x44u1Hr+WftwGz8Rbwdmv6pfTJVDkiS PTq0D2FS80fv19lHTg2d4/1l++lnBRDQKHoMjJCrnhfS7tcfKo2vm0xEHb8jDmusIMf+ FphfEow2xhkOct6QmjTzQiAkn6HdKrhbOk5gS88Rmr9h8fgEdx7G+pm6cBahzVbh5Aiv +503+HYkRKyPtOAroL4tI02h+mz9vukBJEwUvzmVjK076WdQPHUjSE+qU5Vf2DIc/CRJ EOOg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=5CYbo91R2/4ovTizx783xz3mFsAmQp/aqOupn3YOF2I=; b=ksKfYv7wVnR+261S+Apk/HImnzuHjHbI7iSVCzBwEqlt6HFFgvLTtO3hDr2tzwKnXU Mry69cVfIok2dN3My17e57liRe7WHir5WF5QkK27VkMox9m15MFlasTL9lhW50uZYMEr QAi2nnwkVlICXX/MSnHR2zGWoBVL5eRPDl44c2Nl9js3/7iEwyWEMz4dPxC/ah1KGYi8 CzOlzfYxhmsjhNBkQc7X0R3qgJo9j0KKm6AuXVDorh27x7/ujeWl3Zu9DNgs7IwTsZwW IujFhRHH7rPONShAK4iIdy/ZlGuU/PqfvxmRMl9Ve6lnp6/CI5YMO4DdKaBDR/0Tf6ok o6Mg== 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 m7-v6si5659760plt.7.2018.08.09.04.50.38; Thu, 09 Aug 2018 04:50:39 -0700 (PDT) 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 S1730829AbeHIOPI (ORCPT + 31 others); Thu, 9 Aug 2018 10:15:08 -0400 Received: from szxga05-in.huawei.com ([45.249.212.191]:10689 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727768AbeHIOPH (ORCPT ); Thu, 9 Aug 2018 10:15:07 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id F025ECA327A32; Thu, 9 Aug 2018 19:50:32 +0800 (CST) Received: from localhost (10.177.23.164) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.399.0; Thu, 9 Aug 2018 19:50:26 +0800 From: Zhen Lei To: Robin Murphy , Will Deacon , Joerg Roedel , linux-arm-kernel , iommu , linux-kernel CC: Zhen Lei , LinuxArm , Hanjun Guo , Libin Subject: [PATCH v2 0/2] bugfix and optimization about CMD_SYNC Date: Thu, 9 Aug 2018 19:48:51 +0800 Message-ID: <1533815333-17320-1-git-send-email-thunder.leizhen@huawei.com> X-Mailer: git-send-email 1.9.5.msysgit.0 MIME-Version: 1.0 X-Originating-IP: [10.177.23.164] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org v1->v2: 1. move the call to arm_smmu_cmdq_build_cmd into the critical section, and keep itself unchange. 2. Although patch2 can make sure no two CMD_SYNCs will be adjacent, but patch1 is still needed, see below: cpu0 cpu1 cpu2 msidata=0 msidata=1 insert cmd1 insert a TLBI command insert cmd0 smmu execute cmd1 smmu execute TLBI smmu execute cmd0 poll timeout, because msidata=1 is overridden by cmd0, that means VAL=0, sync_idx=1. Zhen Lei (2): iommu/arm-smmu-v3: fix unexpected CMD_SYNC timeout iommu/arm-smmu-v3: avoid redundant CMD_SYNCs if possible drivers/iommu/arm-smmu-v3.c | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) -- 1.8.3