From patchwork Thu Mar 30 13:17:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jagan Teki X-Patchwork-Id: 13194157 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B97CAC761A6 for ; Thu, 30 Mar 2023 13:20:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :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=DyNSDm0ao5ucC7zgsp8mOEj5Lg0XuBHmCVJK2Ta9Az8=; b=EpK1GNclaES781 I7ALwrknCga9EZCqWAuDpPNrVJu5yKArON+QYzwLx5fBI5Q9SzU2lvup8wfnFNbPZYDHW94f89BcB 1aB/L2mzOSFe1CWbZndyGmVs99EiKwgAASozZFbHIsk4d5s98RSaBLiJnrE/uDYbE0xUZ7GjRbms5 FNZvjNgs3TwJbHIJSYa0yavRc4odwNLaspQj9YmE3O0bsl30Wqx2WVyUD8h3Zj9wOaMae5b7kHZsp ovREkthEgyV34Eke+kDUf3zwOHulxtcD6kHx3/Z2GoWK+PRiyX5HBNDTqbdj8x5TIh263nj0JjpF5 H+dFOZqrhHQv8ifhY89A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1phsBk-003rYc-0x; Thu, 30 Mar 2023 13:19:36 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1phsBh-003rXc-1q for linux-arm-kernel@lists.infradead.org; Thu, 30 Mar 2023 13:19:34 +0000 Received: by mail-pl1-x635.google.com with SMTP id iw3so18038592plb.6 for ; Thu, 30 Mar 2023 06:19:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amarulasolutions.com; s=google; t=1680182372; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=S6l/tdN4cMocc6YNsFbnVaBOI5uqYV8apPR4ELkkR1Q=; b=pPb+W1QgZUk+g/DFt0UfL4wvFYJaRRtQKymjwO8tr2syCrw2bxdSdsGsBmOTjBJJOU GRkmAqZZoHB6hOnkhqHnThpioBHtq3jivXAPFWke4uyOwhdORNZqKIRxvMGCS19DhfLI ggM0uxvrKrxdJXxG2mJiCNE9dRLCUBp2M7iFs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680182372; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=S6l/tdN4cMocc6YNsFbnVaBOI5uqYV8apPR4ELkkR1Q=; b=iYTrM6lC9jFORQEDjBGHtGR4VLk10OZQVDyl32lB/gxfFRslShneNYhMjUqFkrBcW3 woXB6TlrZ2hFaUz0mqnNJI30YUC+PFiqvIFZm+BMJp+MYr4gmRJQ/WwKlfrpruzkUtHn phzGnK9S1etE/7oZrmyLO6wnOucQaNyFLEzP5aqjtywWLPaXs4MwHjeHKL5tDtuDFCZN QV4WvzGg++OVbbQVvbeHBJc0dk2qsqGUJf0G4OqAUWyTjne0KPzb0KQcsU5cqvuOmrWD cNkAK01dzBXYbXweEUfu0OoL2/CHS30Oy9UE4gHS7G/hWZXNYEWXV+thW03ycE0fdKCT zmag== X-Gm-Message-State: AO0yUKUdiTbwMYKPFWiT+wxdKndQbiGmV6siJFq5GRxrqMCxmJ50nnhx thL+GJUvhGpvJHTEavRtHA8yDA== X-Google-Smtp-Source: AK7set+nB3B4s6QuXUMw7fa8+aYurUZsFGiWJkTcqxFTLaUpIGoGauwzQvHyFwb4bsvlmviF5TolgQ== X-Received: by 2002:a05:6a20:ce22:b0:d9:8b07:eb0a with SMTP id ic34-20020a056a20ce2200b000d98b07eb0amr22599282pzb.24.1680182372424; Thu, 30 Mar 2023 06:19:32 -0700 (PDT) Received: from localhost.localdomain ([2405:201:c00a:a047:8bc3:c2fc:8dab:d912]) by smtp.gmail.com with ESMTPSA id e15-20020a62aa0f000000b006259e883ee9sm22473622pff.189.2023.03.30.06.19.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Mar 2023 06:19:31 -0700 (PDT) From: Jagan Teki To: Heiko Stuebner , Joerg Roedel , Will Deacon , Robin Murphy , Rob Herring , Krzysztof Kozlowski Cc: iommu@lists.linux.dev, linux-rockchip@lists.infradead.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, linux-amarula , Jagan Teki Subject: [PATCH 1/3] dt-bindings: iommu: rockchip: Add rockchip,disable-device-link-resume Date: Thu, 30 Mar 2023 18:47:44 +0530 Message-Id: <20230330131746.1475514-1-jagan@amarulasolutions.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230330_061933_629411_4ABA2C9E X-CRM114-Status: GOOD ( 12.26 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Rockchip iommu is trying to enable the associated device at runtime resume however some devices might enable the iommu during their pm runtime resume operation which indeed leads iommu to use the wrong domain and this leads to device iommu page fault. Add rockchip,disable-device-link-resume flag and give an option for those devices to disable the device link during Rockchip iommu pm runtime operation. This makes the device enablement for that iommu domain ignored during the rk_iommu_resume call as it assumes it handled iommu device attachment in the associated device itself. Document rockchip,disable-device-link-resume flag. Signed-off-by: Jagan Teki --- .../devicetree/bindings/iommu/rockchip,iommu.yaml | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml b/Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml index ba9124f721f1..ac8b03806cb3 100644 --- a/Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml +++ b/Documentation/devicetree/bindings/iommu/rockchip,iommu.yaml @@ -58,6 +58,15 @@ properties: Some mmu instances may produce unexpected results when the reset operation is used. + rockchip,disable-device-link-resume: + $ref: /schemas/types.yaml#/definitions/flag + description: | + Do not link the device during runtime resume operation. + Some devices might enable the iommu during their pm runtime + resume operation, so disable the device link for those devices + otherwise iommu use the wrong domain and that leads to device + iommu page fault. + required: - compatible - reg