From patchwork Wed Feb 20 15:05:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 10822291 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 212146C2 for ; Wed, 20 Feb 2019 15:06:06 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0BB4F2E8AE for ; Wed, 20 Feb 2019 15:06:06 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 001E62E928; Wed, 20 Feb 2019 15:06:05 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 81DD92E918 for ; Wed, 20 Feb 2019 15:06:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727014AbfBTPFh (ORCPT ); Wed, 20 Feb 2019 10:05:37 -0500 Received: from xavier.telenet-ops.be ([195.130.132.52]:35270 "EHLO xavier.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725961AbfBTPFh (ORCPT ); Wed, 20 Feb 2019 10:05:37 -0500 Received: from ramsan ([84.194.111.163]) by xavier.telenet-ops.be with bizsmtp id f35a1z00d3XaVaC0135bmH; Wed, 20 Feb 2019 16:05:35 +0100 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1gwTRG-0002I7-S9; Wed, 20 Feb 2019 16:05:34 +0100 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1gwTRG-0000eh-Pe; Wed, 20 Feb 2019 16:05:34 +0100 From: Geert Uytterhoeven To: Joerg Roedel , Magnus Damm Cc: Laurent Pinchart , iommu@lists.linux-foundation.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 0/7] iommu/ipmmu-vmsa: Suspend/resume support and assorted cleanups Date: Wed, 20 Feb 2019 16:05:24 +0100 Message-Id: <20190220150531.2462-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Hi Jörg, Magnus, On R-Car Gen3 systems with PSCI, PSCI may power down the SoC during system suspend, thus losing all IOMMU state. Hence after s2ram, devices behind an IPMMU (e.g. SATA), and configured to use it, will fail to complete their I/O operations. This patch series adds suspend/resume support to the Renesas IPMMU-VMSA IOMMU driver, and performs some smaller cleanups and fixes during the process. Most patches are fairly independent, except for patch 7/7, which depends on patches 5/7 and 6/7. This has been tested on Salvator-XS with R-Car H3 ES2.0, with IPMMU suport for SATA enabled. To play safe, the resume operation has also been tested on R-Car M2-W, where it is currently not enabled due to the absence of PSCI in the firmware. Thanks for your comments! Geert Uytterhoeven (7): iommu/ipmmu-vmsa: Link IOMMUs and devices in sysfs iommu/ipmmu-vmsa: Call ipmmu_ctx_write_root() instead of open coding iommu/ipmmu-vmsa: Prepare to handle 40-bit error addresses iommu/ipmmu-vmsa: Make IPMMU_CTX_MAX unsigned iommu/ipmmu-vmsa: Move num_utlbs to SoC-specific features iommu/ipmmu-vmsa: Extract hardware context initialization iommu/ipmmu-vmsa: Add suspend/resume support drivers/iommu/ipmmu-vmsa.c | 194 +++++++++++++++++++++++++------------ 1 file changed, 131 insertions(+), 63 deletions(-)