From patchwork Tue Mar 22 15:04:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tomeu Vizoso X-Patchwork-Id: 8643591 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0C7859F6E1 for ; Tue, 22 Mar 2016 15:08:01 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 184E2202FE for ; Tue, 22 Mar 2016 15:07:58 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 338CA201DD for ; Tue, 22 Mar 2016 15:07:57 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aiNsM-0000eK-J4; Tue, 22 Mar 2016 15:05:42 +0000 Received: from mail-wm0-x229.google.com ([2a00:1450:400c:c09::229]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aiNsI-0000aQ-Oq; Tue, 22 Mar 2016 15:05:39 +0000 Received: by mail-wm0-x229.google.com with SMTP id r129so97739573wmr.1; Tue, 22 Mar 2016 08:05:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id; bh=Qs8i0WtXp9CLgKVA/9t4joJSctxPShJMxxuMGseBdUQ=; b=zoJV0nCQK0O+aM4KaYVYUpa8riTTmUAbdjYdB8b7vkOOJ/DWEgx9LStsUtOUScEEts jDQDF0lcdqmFLldqrrumFZ6Yy0M1NLlfha0w8NSls5bTveDbQ3140KL4QuC4zF8WCpSv Pyetk8jsH///FY+KTgNUsoA1Y/wyUnbg/Vx28aIXkV8GorPpfP/8nik9pIEIJcAaHEa0 Ez0SCQGjApqTPhERe0OsYW+Jtp5pWmAd0P4hYWJ62fXvvBJbHswz4hfL9UyZnw+deFQS xDKMbuRPDj7aVVmxwHV4e4YdKLPyrLMLyJS3bXLgLW1sEXZLaMqC4Lp2Gmc71UFn6ZEs shmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=Qs8i0WtXp9CLgKVA/9t4joJSctxPShJMxxuMGseBdUQ=; b=X4vyKqhsbgV3CDajKTooOhLq1p2aaikFHh/Zn/i6SckdsgV4MzCmgtI+YkN5mcm7/F 0TpvTo/Z3St6tCwhNAApM4JCkE/zqTQiFEv3Zk2e8CBHyblHsZeKa32mK5QZyVIJJ4By GhCXQeVn5l5jX1ut2lMH9w5RRR8L0Adsmq26qMt/lFBNJvbApTNvomcfQWq2jywDHGsq xqjFzaQzCyHjwSUtnLQ90/jHG7krrsCtXkjdIHJFEBkHTpstwBe/bW5XDbfd47C0a8Ig JW/c9WupHJ7VfZ/P+9/7bKOdvpS1WRHoRb/2gI0cUVTwvExl6aG8/zTMBVUpu90ygSic lTnQ== X-Gm-Message-State: AD7BkJK3qdhqYBaPgagZawAu0lERP37E/mrhj7mnCMIUQtdIuD6cTxhHa81bOPjZ9oFffg== X-Received: by 10.28.34.69 with SMTP id i66mr21177383wmi.91.1458659116696; Tue, 22 Mar 2016 08:05:16 -0700 (PDT) Received: from cizrna.lan ([109.72.12.28]) by smtp.gmail.com with ESMTPSA id h7sm17758521wmf.9.2016.03.22.08.05.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 22 Mar 2016 08:05:15 -0700 (PDT) From: Tomeu Vizoso To: linux-kernel@vger.kernel.org Subject: [PATCH] iommu/rockchip: Only log stall errors when attaching Date: Tue, 22 Mar 2016 16:04:33 +0100 Message-Id: <1458659073-13553-1-git-send-email-tomeu.vizoso@collabora.com> X-Mailer: git-send-email 2.5.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160322_080539_008771_9CD4D845 X-CRM114-Status: GOOD ( 12.10 ) X-Spam-Score: -2.4 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Heiko Stuebner , Tomeu Vizoso , Joerg Roedel , linux-rockchip@lists.infradead.org, iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Move the logging of timeouts when stalling the MMU to rk_iommu_attach_device, as it's expected that sometimes the MMU won't get stalled when detaching a device, and it's not a real problem that would need to be communicated to the user. Signed-off-by: Tomeu Vizoso --- drivers/iommu/rockchip-iommu.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/iommu/rockchip-iommu.c b/drivers/iommu/rockchip-iommu.c index 0253ab35c33b..65325b6742e6 100644 --- a/drivers/iommu/rockchip-iommu.c +++ b/drivers/iommu/rockchip-iommu.c @@ -346,13 +346,7 @@ static int rk_iommu_enable_stall(struct rk_iommu *iommu) rk_iommu_command(iommu, RK_MMU_CMD_ENABLE_STALL); - ret = rk_wait_for(rk_iommu_is_stall_active(iommu), 1); - if (ret) - for (i = 0; i < iommu->num_mmu; i++) - dev_err(iommu->dev, "Enable stall request timed out, status: %#08x\n", - rk_iommu_read(iommu->bases[i], RK_MMU_STATUS)); - - return ret; + return rk_wait_for(rk_iommu_is_stall_active(iommu), 1); } static int rk_iommu_disable_stall(struct rk_iommu *iommu) @@ -798,8 +792,12 @@ static int rk_iommu_attach_device(struct iommu_domain *domain, return 0; ret = rk_iommu_enable_stall(iommu); - if (ret) + if (ret) { + for (i = 0; i < iommu->num_mmu; i++) + dev_err(iommu->dev, "Enable stall request timed out, status: %#08x\n", + rk_iommu_read(iommu->bases[i], RK_MMU_STATUS)); return ret; + } ret = rk_iommu_force_reset(iommu); if (ret)