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");