From patchwork Sun Jun 28 18:08:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11630255 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CECB813B4 for ; Sun, 28 Jun 2020 18:10:55 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 9B32120773 for ; Sun, 28 Jun 2020 18:10:55 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="i8JfVuJ9"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="MfOUxTK+"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="HGjOcyWC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9B32120773 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To:From: Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From:Resent-Sender :Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References:List-Owner; bh=Uk7OFq5xLjY1Ui30ZtFO2iawA+V0wRzUqeT0+LpigUQ=; b=i8JfVuJ99aP6M4utV6rGo16z7+ 00er8w8Txfwvp7ItG41YpPnVt59nMmhHV6xy4gpn7zmGxYPGKv4TMYIppBn52pnY2grSZWd/mFf8b 2d865TXboVmzy8umk1prc17zj8UGEjKxK1iF8ytZHIHOZfAwrDARfIEpqbwtyzRC5X9RfWCm+TUIp ZiVD3ego8mD5eXzHEks7v3eCUoy8ofqYFejsFZjZpKa1eHmjgHvg0dMNW0/sNah9Ys0rh/f5QbBps gNhCYrmt7xNLNTbb+bwjUdF4oqFvfRwxmttBLnBC4v4utBq5tkEOVjGQjR3ZP7zhRwFvQcmJTAr+/ u1mSMH8A==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpbjY-0000dY-1L; Sun, 28 Jun 2020 18:08:52 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpbjV-0000cv-3C for linux-arm-kernel@lists.infradead.org; Sun, 28 Jun 2020 18:08:50 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id D0B44B70; Sun, 28 Jun 2020 14:08:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sun, 28 Jun 2020 14:08:48 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=f7le4kzlMY3HxfADRkf0izXbbt zHcsMuuVeVp0nsTiU=; b=MfOUxTK+vUGNnoDL5FisZCKE64mDIRCh8jBka0wbAw /rCyUnGQQf90r7t5zTrHcPAVkFudQ602JvPkc4N3W58z+CaErPCqqfR5fBc+vweh L+B2f0q4RxkAtXyRSj3upye4k/5Nsm6tl6nXcYIhoKAz66xhQkRsl8mUFd/n6FFk KKuEHT2icZw8gh1V1GPHq2HeJ3Zmc1JG1fUzb7aqKmyO8avSrGrAPylWHwR8Q4+E Ugpn5bGuWPlKwFsEZrdYyQVDr5GwANbIDM4Gx/GrpbbILdrc3sJ26FFdaSIFv39M MBM1GL0sjgDRc2zzJpaGUCr4pa3wRwjK0mJn0Tg9h8DQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=f7le4kzlMY3HxfADR kf0izXbbtzHcsMuuVeVp0nsTiU=; b=HGjOcyWC5iESKoUT0CT+/2TJ9+QxdSSsN fi1q0TEUljRhjOaG7c07wAqXNMIU0oYs2CsU2Dho0wY1Xpd4NI8Q+is1PU8cWKMY v8CLT4ddwzSzSsPLpJkix5Tue5CGJB8Us8roYVH+KxtEGZhDImim+8Ziwab08MoZ bkLfxSVa6CR1uM/jM4jzod8S/9q9kTZZYlJa+2eTrvfzYUghkZUuBqSAiWwLOwNQ QwX7nRtq0IOhHkTtPRk+d9qSB2w5ZXIl6lNBdtXNoVCd2E2oa437hktcvGiEFtq4 JVaXl8BzNW9C7zOVJ65SCXv44STzhQYwmWfM5pMjH0a2zEQKMC43w== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeliedguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgggfestdekredtredttdenucfhrhhomhepofgrgihimhgv ucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrghtth gvrhhnpeejffehuddvvddvlefhgeelleffgfeijedvhefgieejtdeiueetjeetfeeukeej geenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedunecurf grrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id E00343067BB0; Sun, 28 Jun 2020 14:08:46 -0400 (EDT) From: Maxime Ripard To: Joerg Roedel , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH 1/2] iommu/sun50i: Change the readl timeout to the atomic variant Date: Sun, 28 Jun 2020 20:08:43 +0200 Message-Id: <20200628180844.79205-1-maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [64.147.123.19 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [64.147.123.19 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: iommu@lists.linux-foundation.org, linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The flush_all_tlb call back can be called from an atomic context, so using readl_poll_timeout that embeds a udelay doesn't work. Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") Signed-off-by: Maxime Ripard --- drivers/iommu/sun50i-iommu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index fce605e96aa2..a1563b54c743 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -313,9 +313,9 @@ static int sun50i_iommu_flush_all_tlb(struct sun50i_iommu *iommu) IOMMU_TLB_FLUSH_MICRO_TLB(1) | IOMMU_TLB_FLUSH_MICRO_TLB(0)); - ret = readl_poll_timeout(iommu->base + IOMMU_TLB_FLUSH_REG, - reg, !reg, - 1, 2000); + ret = readl_poll_timeout_atomic(iommu->base + IOMMU_TLB_FLUSH_REG, + reg, !reg, + 1, 2000); if (ret) dev_warn(iommu->dev, "TLB Flush timed out!\n"); From patchwork Sun Jun 28 18:08:44 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Maxime Ripard X-Patchwork-Id: 11630259 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E5337912 for ; Sun, 28 Jun 2020 18:10:59 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id BF44220773 for ; Sun, 28 Jun 2020 18:10:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Z5/JNyeI"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=cerno.tech header.i=@cerno.tech header.b="n6mDJeF0"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=messagingengine.com header.i=@messagingengine.com header.b="S6HNM78s" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org BF44220773 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=cerno.tech Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=ce++ou2CntcTH2LLnL/anisV7Wlx7TA7z8IlPO525XM=; b=Z5/JNyeIx4pPexoKV6I9a6PU1 iWh2xldsDteECSzVum1qC+widG8QjuNiEzi0m+zxlnPjAJ2PDo76/VR4ISjwbRW9gdDQqKxCNaq7D 5JXdLNNPtklNAlAHtpxkuoOldwFlNXc2g3AT7lI6Sw0KlQTrN+0lbuhHV3FqgZh2E/7Cl7mxPPJ3Z EKx/CazZdGNQi/JGSPjnho9DEfrVUF+SslTHDgI8UJKONsb1gqnD5Cq6Kt/yjPlbj9NOof76mFXH9 EcuH4Rh1SVwS3dALH5KiqdsKJ+CrML4/hMLqt2exh317V3iVy3QIJpuVCLJIcmS/zMabTMeot1MT1 cn5zO4bGQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpbja-0000eC-RR; Sun, 28 Jun 2020 18:08:54 +0000 Received: from wout3-smtp.messagingengine.com ([64.147.123.19]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1jpbjW-0000dT-VJ for linux-arm-kernel@lists.infradead.org; Sun, 28 Jun 2020 18:08:51 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id EEE34B74; Sun, 28 Jun 2020 14:08:49 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Sun, 28 Jun 2020 14:08:50 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cerno.tech; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; s=fm3; bh=aheclahDk///5 GhRrTGqTdZ5+2m4zl5MerfwfprpZmU=; b=n6mDJeF0uSkHbsARTbsLiKs7n0AaN J6JjhOVdZeFAZitxC1DvAcC+x/jjChjkOyTVPYZuCFFVJEe/zQPsRLeOjB48RYsR wyxW+s3Sa2MBRIDSSIQrioEpRjmbIGFzblQnIM43EUkKgi3CrU+EO3yGz/sNH2KZ MDPgH2kRh0TLN1dRpwQTZeDaRNUmTP5X8msgYWGXRWHog7k8mXYoB+df4N5iO645 5H9hERZJHU8ZUt6EWGZ8V51mb5XvkOruZ7x5Obch4LzRh7Gc6xGy/bRHVweKgUHL 9vPyyYxthF2OzpDPjw51bVG8/5spGxUiWIeAtGnPxsWiLgjh3hZDj2txQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :in-reply-to:message-id:mime-version:references:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=aheclahDk///5GhRrTGqTdZ5+2m4zl5MerfwfprpZmU=; b=S6HNM78s DaJ3zOUWR+Lrwj8MPazuwzXi/6t4e6pFXGElt033xRWrY0yIdpNcl/ruE0w1Axlo L7/u9ucx3Wt/tcqHHpixfsMXA4jxRRECZoL7Ko0/Ivw2mMXvASdBlmg2QwhdxO+/ BCCG0x0DHj8bturT6X2P/u9onWgk4lxrEwK39jQDSDO+P0LGTa0qhqMIRfJcKhCy OJe2LpKTsHFm7hgNRqDURSEWkhRw4bEpxWHECW6RUIqn9t0uPZqwBkw0+hK3T+qh KIM++z6VwtRlJXGpFD4fwGq9i8z3gqh0qkRG5ajz1ygXUwtzxXhWbUwC9DNWFd47 9WdQRS0Ctx8CKg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduhedrudeliedguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefhvffufffkofgjfhgggfestdekredtredttdenucfhrhhomhepofgrgihi mhgvucftihhprghrugcuoehmrgigihhmvgestggvrhhnohdrthgvtghhqeenucggtffrrg htthgvrhhnpedvkeelveefffekjefhffeuleetleefudeifeehuddugffghffhffehveev heehvdenucfkphepledtrdekledrieekrdejieenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmrgigihhmvgestggvrhhnohdrthgvtghh X-ME-Proxy: Received: from localhost (lfbn-tou-1-1502-76.w90-89.abo.wanadoo.fr [90.89.68.76]) by mail.messagingengine.com (Postfix) with ESMTPA id 1FB0F3280059; Sun, 28 Jun 2020 14:08:49 -0400 (EDT) From: Maxime Ripard To: Joerg Roedel , Chen-Yu Tsai , Maxime Ripard Subject: [PATCH 2/2] iommu/sun50i: Remove unused variable Date: Sun, 28 Jun 2020 20:08:44 +0200 Message-Id: <20200628180844.79205-2-maxime@cerno.tech> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200628180844.79205-1-maxime@cerno.tech> References: <20200628180844.79205-1-maxime@cerno.tech> MIME-Version: 1.0 X-Spam-Note: CRM114 invocation failed X-Spam-Score: -0.9 (/) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-0.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at https://www.dnswl.org/, low trust [64.147.123.19 listed in list.dnswl.org] -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [64.147.123.19 listed in wl.mailspike.net] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: iommu@lists.linux-foundation.org, kernel test robot , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The pte_dma variable in the unmap callback is set but never used. Remove it. Fixes: 4100b8c229b3 ("iommu: Add Allwinner H6 IOMMU driver") Reported-by: kernel test robot Signed-off-by: Maxime Ripard --- drivers/iommu/sun50i-iommu.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/iommu/sun50i-iommu.c b/drivers/iommu/sun50i-iommu.c index a1563b54c743..3b1bf2fb94f5 100644 --- a/drivers/iommu/sun50i-iommu.c +++ b/drivers/iommu/sun50i-iommu.c @@ -556,7 +556,6 @@ static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova { struct sun50i_iommu_domain *sun50i_domain = to_sun50i_domain(domain); phys_addr_t pt_phys; - dma_addr_t pte_dma; u32 *pte_addr; u32 dte; @@ -566,7 +565,6 @@ static size_t sun50i_iommu_unmap(struct iommu_domain *domain, unsigned long iova pt_phys = sun50i_dte_get_pt_address(dte); pte_addr = (u32 *)phys_to_virt(pt_phys) + sun50i_iova_get_pte_index(iova); - pte_dma = pt_phys + sun50i_iova_get_pte_index(iova) * PT_ENTRY_SIZE; if (!sun50i_pte_is_page_valid(*pte_addr)) return 0;