Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp256109rwe; Tue, 23 Aug 2022 23:45:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR5S15+C1CsiiA/wFNEaUwBz3U7FtVca+lNsWu2Lb/3kCfWlmzIY4EJoI5J/JAM57wDJn2Gh X-Received: by 2002:a17:90b:2390:b0:1fa:c680:1f63 with SMTP id mr16-20020a17090b239000b001fac6801f63mr6712712pjb.16.1661323535573; Tue, 23 Aug 2022 23:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661323535; cv=none; d=google.com; s=arc-20160816; b=YACvXm5Qkk9NDdcIsM4pOk7ApqvHALJH2ct7O/hyn0NqJ6QYaHtcPyCxY3vWTC7pfV 8l3RhX49tLHjIVelsQdOUsUNmkx0QP0+xtexikZJd7we48xx/xxYcUAb/EDTKCeUe5jQ VoyXcuO5tj8y0j9gCQO9vercf0o4YpV2RpxfklKTdfi1mNI3lc6MBOonh0Tw34fKUDnV 5tzBSSkgYsoYwglqNNaVkHawsw5gEyrN/vq7CawUdA41qFa2NAIir3vQlAdwxN/yF3zO ynzgBFsGtyWYN076wMMs5kltjL4R/AkQRZV59ogvM7MMauFNPl54g4RZSe1xrFZ6aUwe Eaqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:subject:cc:to:from :dkim-signature; bh=3mv7nC1GidQo3pcX1jLcFhAjG/DTVYdU2ZAAfY1xEIw=; b=IKqZGaSqCi9e4kQfXkpuKMiNaQ4UBB3S7/ku2wnCHghqewhgm/CwOr4AxpzJDYqvLB IEM1IkJqohif2pdYwBAdl8YyvySzR8479a51IR2dz+LVJyjsd+/XJEVqKMCZTFLOVaVg +rHaK6Ss1rCxJ1NOJZcEnKXbTAMPGvtatLVeZIzoMG1D6I5Yd0FKFnJDl7I6I/15fNeC zSgOE3zjqNwyohL6hc7ewWzHvOyLF5yNubScqYwSiuxStJ9g0I3zwdQiMEaqU3LFqLea D4jZCOkIFgUGrcGmY1JMighf3xoIG0Cu1VcC6qfaHgVFeTbll9PDAwJUVDDp73ByfeYY ytgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=odpjMI4Y; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id bc22-20020a656d96000000b0041cef94f2cfsi19784700pgb.836.2022.08.23.23.45.23; Tue, 23 Aug 2022 23:45:35 -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=@mediatek.com header.s=dk header.b=odpjMI4Y; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=mediatek.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234469AbiHXGn3 (ORCPT + 99 others); Wed, 24 Aug 2022 02:43:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49062 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229954AbiHXGn1 (ORCPT ); Wed, 24 Aug 2022 02:43:27 -0400 Received: from mailgw01.mediatek.com (unknown [60.244.123.138]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CCED485F8D for ; Tue, 23 Aug 2022 23:43:20 -0700 (PDT) X-UUID: e57474ee5ef84577919834fa31b49619-20220824 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mediatek.com; s=dk; h=Content-Type:MIME-Version:Message-ID:Date:Subject:CC:To:From; bh=3mv7nC1GidQo3pcX1jLcFhAjG/DTVYdU2ZAAfY1xEIw=; b=odpjMI4YTQ1nbivMO25ukzYX/DQJ9wmCVai8UeHDHDpL8S1Uoy3L2lwTj0HvHeLunYdJpKrTNAybZRB6vFwTQ3dhXgyMHyGEX4sjHrD2HscC7rfMSiM9bsF/CvFNTzMxo+hFxDgp4Fac9SkUmj/vY86aO3K7Apkg7pIdFRGKWhA=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.10,REQID:5ded68cf-32af-4e21-a85d-85b86f24ddcb,OB:0,L OB:0,IP:0,URL:0,TC:0,Content:-5,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release _Ham,ACTION:release,TS:-5 X-CID-META: VersionHash:84eae18,CLOUDID:821372cf-20bd-4e5e-ace8-00692b7ab380,C OID:IGNORED,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,URL:1,File:nil ,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: e57474ee5ef84577919834fa31b49619-20220824 Received: from mtkexhb01.mediatek.inc [(172.21.101.102)] by mailgw01.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 764288183; Wed, 24 Aug 2022 14:43:12 +0800 Received: from mtkmbs11n2.mediatek.inc (172.21.101.187) by mtkmbs10n2.mediatek.inc (172.21.101.183) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.792.3; Wed, 24 Aug 2022 14:43:11 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkmbs11n2.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.2.792.15 via Frontend Transport; Wed, 24 Aug 2022 14:43:10 +0800 From: Yong Wu To: Joerg Roedel , Matthias Brugger , Will Deacon CC: Robin Murphy , , , , , , "Yong Wu" , AngeloGioacchino Del Regno , , , , , , , , Guenter Roeck , "Dan Carpenter" Subject: [PATCH v4 0/6] iommu/mediatek: Improve safety from invalid dts input Date: Wed, 24 Aug 2022 14:43:00 +0800 Message-ID: <20220824064306.21495-1-yong.wu@mediatek.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 Content-Type: text/plain X-MTK: N X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE,UNPARSEABLE_RELAY,URIBL_BLOCKED autolearn=no 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 This patchset contains misc improve patches. Mainly to improve safety from invalid dts input. Change notes: v4: a) Just remove the first patch about dev_err_probe since it was merged. b) Rebase v6.0-rc1 v3: https://lore.kernel.org/linux-mediatek/20220701053942.3266-1-yong.wu@mediatek.com/ a) Add platform_device_put from Robin. b) Use component_match_add instead component_match_add_release suggested from Robin. v2: https://lore.kernel.org/linux-mediatek/20220616054203.11365-1-yong.wu@mediatek.com/ a) Rebase on v5.19-rc1. b) Add a New patch [5/5] just remove a variable that only is for v1. v1: https://lore.kernel.org/linux-mediatek/20220511064920.18455-1-yong.wu@mediatek.com/ Base on linux-next-20220510. the improve safety from dts is base on: https://lore.kernel.org/linux-mediatek/20211210205704.1664928-1-linux@roeck-us.net/ Guenter Roeck (1): iommu/mediatek: Validate number of phandles associated with "mediatek,larbs" Yong Wu (5): iommu/mediatek: Add platform_device_put for recovering the device refcnt iommu/mediatek: Use component_match_add iommu/mediatek: Add error path for loop of mm_dts_parse iommu/mediatek: Improve safety for mediatek,smi property in larb nodes iommu/mediatek: Remove unused "mapping" member from mtk_iommu_data drivers/iommu/mtk_iommu.c | 115 +++++++++++++++++++++++++++----------- 1 file changed, 83 insertions(+), 32 deletions(-) -- 2.18.0