From patchwork Thu Oct 13 18:12:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Jernej_=C5=A0krabec?= X-Patchwork-Id: 78 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4ac7:0:0:0:0:0 with SMTP id y7csp427995wrs; Thu, 13 Oct 2022 11:50:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM49BVNmvCBqeyB9h1OIxsaZyWsCrAYwHvrHO7XspikN2ppSY8NZwoWAsCTFR8LGzER8IiOV X-Received: by 2002:a17:90b:350d:b0:20d:5438:f594 with SMTP id ls13-20020a17090b350d00b0020d5438f594mr12983481pjb.216.1665687045074; Thu, 13 Oct 2022 11:50:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665687045; cv=none; d=google.com; s=arc-20160816; b=QStLa72ubCZiMX4I8xlK7w3xir5NDb2Kzr0BD1lzcS2xvDpqKCQ1IqObGMPa08eHBA OBnawD6qefzKlnO9dRbtNZd6a0ETPQCg6WKIXAt8NX44BRBSqPKzZsJTvRrNcKWQsOaS 2xve3Om+k+O2yf0hjy3FjmffG4lJdUDNa0O74cmccwYUmZLV369RObtXivOQ21YJzekf TA61fZx40ccN7D+3n1BWF1xg1QhRGdfAVszH9Sz40SnYIcDFXVt4U0BM8aZpygTXvhuB tPOpRMh77Zd5kP4Zzk38KKgq04pyYfA1wPsZajw2SDuDTjIlsTTiQiGesPL2Th4Y6YVp IorQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=k+VQ8PIgKw2wXGL8CyxmdjJZoYsv8YucY3sAmtvnacY=; b=MjisXnB4bzhdGQH1Nmyh4ailZHAx6WXne/AcQ8LfkNP62EMEv50l7LCKcjzK+U8TIE j0ReBlnzjFqb9HY3jPLl/CuITrK4KPC9dxHuksb8BCbk0HCP8GCMh+GLHsVE+N2Eigl1 VkBMg4G+5pGvGBF3kVPlGXQ3tNWx0VNlL3OG6mxlDkCvwKlXs9bJ0sZ2veFgXr2l8tst D5r0h3LFMl4m/y8kjZTHcdMo606ZITXCr9J4FAw7RgspBfifZl3IPhXYpYmto5KJaFZl 2hcGXRNBhdQeDm/u0ZOi+G1oz0TOMWC04+tUZ+/0HMf3JvGPdtx9JguZJAnCjagOClY9 Bh3g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DDVWrlzP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s3-20020a170902ea0300b001853a1fddecsi506558plg.403.2022.10.13.11.50.31; Thu, 13 Oct 2022 11:50:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=DDVWrlzP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229533AbiJMSb4 (ORCPT + 99 others); Thu, 13 Oct 2022 14:31:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231869AbiJMSbf (ORCPT ); Thu, 13 Oct 2022 14:31:35 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2FBAD18DC02 for ; Thu, 13 Oct 2022 11:26:38 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id b18so3328717ljr.13 for ; Thu, 13 Oct 2022 11:26:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=k+VQ8PIgKw2wXGL8CyxmdjJZoYsv8YucY3sAmtvnacY=; b=DDVWrlzPxXMsngCDo/QcByWaD1OiWqjlNo0qm2fhXYTe6IpxdiNpfJhoQ/XRHqkNH/ ZL8aGReXB//kbbUw2a2BpQbb+im3SQb+37YiU6sDPOFlAKSG3BIPbwgt2/nIyQlKaGJH uzCbiOq+YopE+Igm4SZFz95FNkQx2jKOZlrXdAdvRC52OhIFclBz7Ejq9Ry5EnUpU188 taWgVhbhdQTEtx7KNLnZl8GOg+grIzHwF57Bkk9JwW7l+lT8lr7kfOn2yr1YCDW00lvy A8vWb9Y58cJMm/F8YEXB5QEawLZN685VujBFaZC76ctrWAr/uUU0GHqJrTOrt1KkmLVW qJKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=k+VQ8PIgKw2wXGL8CyxmdjJZoYsv8YucY3sAmtvnacY=; b=636XDVthnGL503eXMcl5NDeLc+7ZUyiWn71uWg4JQ+bspt9JlzWH3X80SYGxXbQb7s QR54jkReg1IHVbJc2xGGzLIQJjEDJKAfmqf7GAMByXjmslpbR5z5Ivhp2yS2mPOUV0Ew q3EOhbfwr8MAOwtVtU9Wz7STsyaW12WtvZpIvM/+78eJ0Pj1A1O5WDxolr2qX3taLxw0 qqaS3WTUTQKnkge1GoZES5thhdgEiLZKmOB0Tf/OZDUDGvCTdmjphvcRI1S/rkMi/M62 tGpmHUGOjdY/VUCNUWj91IaIunqkvze2YnQ5hRNNxW5G5VcKseAXAqCcPZF1bTwJleGQ bQAg== X-Gm-Message-State: ACrzQf1J35Xr+5zoqv2/Ltiqdr8NE9F7p+/0m3BDIGN3ibUbSszOoL1I rA3jY1Q4f7n3swLiWR3mhRXiw55bRgHrCXys X-Received: by 2002:a17:906:7308:b0:78e:191e:8389 with SMTP id di8-20020a170906730800b0078e191e8389mr759810ejc.170.1665684764848; Thu, 13 Oct 2022 11:12:44 -0700 (PDT) Received: from kista.localdomain (82-149-19-102.dynamic.telemach.net. [82.149.19.102]) by smtp.gmail.com with ESMTPSA id ku15-20020a170907788f00b0078b551d2fa3sm211109ejc.103.2022.10.13.11.12.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 13 Oct 2022 11:12:44 -0700 (PDT) From: Jernej Skrabec To: maxime@cerno.tech, joro@8bytes.org, will@kernel.org, robin.murphy@arm.com, wens@csie.org, samuel@sholland.org Cc: iommu@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-sunxi@lists.linux.dev, linux-kernel@vger.kernel.org, Jernej Skrabec Subject: [PATCH 0/5] iommu/sun50i: Fix various issues Date: Thu, 13 Oct 2022 20:12:15 +0200 Message-Id: <20221013181221.3247429-1-jernej.skrabec@gmail.com> X-Mailer: git-send-email 2.38.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1746599458822431286?= X-GMAIL-MSGID: =?utf-8?q?1746599458822431286?= Testing IOMMU together with video decoder (Cedrus) exposed many bugs in sun50i-iommu driver. This series addresses all issues so video decoder works well with IOMMU. First two patches address recovery issues in interrupt when either page faults or permission errors were reported. Third patch fixes permission domain assignment. Fourth patch fixes dma sync size. Sometimes sync also touched some other buffers and kernel generated warning in dmesg. Fifth patch fixes issue with synching PDE and PTE tables. Without it, page faults were randomly generated even with valid iova addresses. Please take a look. Best regards, Jernej Jernej Skrabec (5): iommu/sun50i: Fix reset release iommu/sun50i: Consider all fault sources for reset iommu/sun50i: Fix R/W permission check iommu/sun50i: Fix flush size iommu/sun50i: Invalidate iova in map and unmap callback drivers/iommu/sun50i-iommu.c | 66 +++++++++++++++++++++++++++++++++--- 1 file changed, 61 insertions(+), 5 deletions(-) --- 2.38.0