Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp3528103rwb; Tue, 20 Sep 2022 00:32:23 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6nP+DRSOqleStzeGBYF4/oIaimI2PCsri8j0pQSW1o7ULMhGUdnJ98apIAmYn2a35tMaPK X-Received: by 2002:a17:90a:1b0a:b0:203:6731:4c98 with SMTP id q10-20020a17090a1b0a00b0020367314c98mr2424207pjq.10.1663659142918; Tue, 20 Sep 2022 00:32:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663659142; cv=none; d=google.com; s=arc-20160816; b=ZbtFye6+RP/qZu1hPGLzlfTDDrLAbtGrZfox/fBwDuswp8RLopomf8Xry+sDeXYdgN VLwcFeGjD4CdetknIgdfqKrvOX20v10oIpDK7CgI3zCp03lT5GFxr0DyzjKAW2HCLlxa u11dIzPRKEkYzFoNDdexst9xHOJEsRic9Zuyysg04PKjF7QH4z58KZOPL/6EWJf8YaBf hdTOmt62ZhBH098KUrH2uGDHj244geGS5sRskT6elT+h/BkjXDAGD4e2zBwRZ4BPr7E3 WcJrdKgBotrbIGmBJRx4DP48hJ/My9vZhLRZSXHI519OFEW4oq+HgRzsQFbCx1I7Zyzq Tltg== 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=iaGWTg4SYXTYA4D2V3LpizC530571lHR55QkrMBlyek=; b=Jrx6lJmMUiy90iG+AIseupBUNXRJXqKChz7+5zwatJgucXTMOnFpHKud5CsHBqf+ib VcYJDasf8ia9DzUcAWdNUAFiyium0Yzzhj+OxSy7fL1OWqFswhHfr1kC+AQJfojHDImU NNSpdtvR7dwZn2Tj1/OQYeg/rsAKnlQEPtQF7/WZQkgk2GLQ2q1xMcpBwBUPyJUthdib smZy/aNB+D2ZUDBzMnMuyFMxLKGG0gTQtjspm9a1nv/Z14lhlZcxWnjwWYaUqucWhNJi BnSN9B5+zQD+EH7wE/US8lpFkPRkc5/N9T6FmdXgjmmM4U8BiyoOmdrvNKyyq3PJtXBG 7k/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mediatek.com header.s=dk header.b=A1cDnnNc; 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 d12-20020a655acc000000b0043ae0533e2csi1089733pgt.246.2022.09.20.00.32.11; Tue, 20 Sep 2022 00:32:22 -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=A1cDnnNc; 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 S230304AbiITGj0 (ORCPT + 99 others); Tue, 20 Sep 2022 02:39:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230211AbiITGjC (ORCPT ); Tue, 20 Sep 2022 02:39:02 -0400 Received: from mailgw02.mediatek.com (unknown [210.61.82.184]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 013F95EDC4 for ; Mon, 19 Sep 2022 23:37:45 -0700 (PDT) X-UUID: 82d9155ee9344e1880f6cc316c1b4da3-20220920 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=iaGWTg4SYXTYA4D2V3LpizC530571lHR55QkrMBlyek=; b=A1cDnnNcedwcZHRlsnP/jI97ytUQLxamSnxfse27EIcx+kemhvPTr8lBcd5+tjORUqi5HE9awwS6QYP4LnesPX1NtoVTPQ4wG+M9AmyVyZUEFFb+ZmHVRFcUF+05kq/uyghSxPklheYpMg5HSTt1P+DGXEQpPvtDvL8n+fAEJy0=; X-CID-P-RULE: Release_Ham X-CID-O-INFO: VERSION:1.1.11,REQID:eb06de62-54b8-4561-82a7-24e3fde8e9f6,IP:0,U RL:0,TC:0,Content:-25,EDM:0,RT:0,SF:0,FILE:0,BULK:0,RULE:Release_Ham,ACTIO N:release,TS:-25 X-CID-META: VersionHash:39a5ff1,CLOUDID:356e3e5e-5ed4-4e28-8b00-66ed9f042fbd,B ulkID:nil,BulkQuantity:0,Recheck:0,SF:nil,TC:nil,Content:0,EDM:-3,IP:nil,U RL:1,File:nil,Bulk:nil,QS:nil,BEC:nil,COL:0 X-UUID: 82d9155ee9344e1880f6cc316c1b4da3-20220920 Received: from mtkexhb02.mediatek.inc [(172.21.101.103)] by mailgw02.mediatek.com (envelope-from ) (Generic MTA with TLSv1.2 ECDHE-RSA-AES256-SHA384 256/256) with ESMTP id 1174997965; Tue, 20 Sep 2022 14:37:42 +0800 Received: from mtkcas11.mediatek.inc (172.21.101.40) by mtkmbs13n1.mediatek.inc (172.21.101.193) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.2.792.15; Tue, 20 Sep 2022 14:37:41 +0800 Received: from localhost.localdomain (10.17.3.154) by mtkcas11.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1497.2 via Frontend Transport; Tue, 20 Sep 2022 14:37:39 +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 v6 0/6] iommu/mediatek: Improve safety from invalid dts input Date: Tue, 20 Sep 2022 14:37:27 +0800 Message-ID: <20220920063733.21770-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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS, T_SPF_TEMPERROR,UNPARSEABLE_RELAY,URIBL_CSS 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 This patchset contains misc improve patches. Mainly to improve safety from invalid dts input. Change notes: v6: No change code. just reword the commit message in [3/6] from Angelo. v5: https://lore.kernel.org/linux-mediatek/20220919092405.8256-1-yong.wu@mediatek.com/ a) Loop from MTK_LARB_NR_MAX in the error path from Angelo. b) Fix the redundant put_device for the error patch outside the loop from dan. v4: https://lore.kernel.org/linux-mediatek/20220824064306.21495-1-yong.wu@mediatek.com/ 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 | 106 +++++++++++++++++++++++++++----------- 1 file changed, 76 insertions(+), 30 deletions(-) -- 2.18.0