Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2622171rwb; Mon, 19 Sep 2022 07:40:20 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5rRbkcLLEpiEt/GzlFUWGYktSNYBGUElPBvfOsazr0NlSTs6slvFO62JFXbvMfVID1hEUJ X-Received: by 2002:a17:907:a06a:b0:77d:2f20:69c0 with SMTP id ia10-20020a170907a06a00b0077d2f2069c0mr12923863ejc.40.1663598420561; Mon, 19 Sep 2022 07:40:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663598420; cv=none; d=google.com; s=arc-20160816; b=OmiexrnetUsbKq+RbY5gx/iWuPQRV+m2yhD5BZjE1M99+SVIW7KMqhxCLKgfThtnAx 9Fv2JkQFfoyHaHgRS0wP2JgjTNmD6X76ZezA6FmEf72+ZdzT3nskDbKp7pi9AarU3FGY NeRJ27fw4krzDvribNjWNsIUDwFzVvt9a9JCrufGA74ckFPGpFOWlFswU9V6gZcF+k+b te+TPnsgfXuw7FGn577KteHfgQtQ25cU3c/qtWvMZ4Ah3JbfRR0g+WMho7QnrgoN+U06 2arOfo3xzVEKBRTowce3n80PNDfWZ4am4WpGWGeSr3MHtTOTvQiZBiK8bMpI6nez4oRq bXkQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=R6DICuotm8vGwjU2DpB6zrDRD6phZDhtkJSCVVMN0Rc=; b=l78l/D6B85AXJTcej6hTPzackwPiarlGiEhdB7CgEh9gJoEBfphKzrSC1d6RAo6oKf zql4qpjbXB6qeMCcpofSNkrU69cINh5FSQtbyu/JzVOqOiaI6c6QrywZNFSse6FoOdAR UgZ2vr46s4aHDbjFvc0e3BDgvg9juEmSrhnOhYlaQmoQoGkptO9wKr1WhNf7ufkWi0JQ iet2eQ9JuHDP0CQeEWn64Xc+qilnfLj59fXLMVf5LDVQi3VimbVQrSSaApYTV+MOvm8X ABBvyi8g4OUOaCcmUy7Iti6z66vpwpEQW/wNGh/ZWzXS0CgjK5sm5F4uE3gYXfJHiXxF 3P3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@collabora.com header.s=mail header.b=SQ7VvYPd; 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=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id ww4-20020a170907084400b0077fb99b8cfcsi6606736ejb.301.2022.09.19.07.39.55; Mon, 19 Sep 2022 07:40:20 -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=@collabora.com header.s=mail header.b=SQ7VvYPd; 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=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229779AbiISOUm (ORCPT + 99 others); Mon, 19 Sep 2022 10:20:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229735AbiISOUk (ORCPT ); Mon, 19 Sep 2022 10:20:40 -0400 Received: from madras.collabora.co.uk (madras.collabora.co.uk [46.235.227.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C3CE31A05C for ; Mon, 19 Sep 2022 07:20:39 -0700 (PDT) Received: from [192.168.1.100] (2-237-20-237.ip236.fastwebnet.it [2.237.20.237]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) (Authenticated sender: kholk11) by madras.collabora.co.uk (Postfix) with ESMTPSA id A22876601D86; Mon, 19 Sep 2022 15:20:37 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=collabora.com; s=mail; t=1663597238; bh=jIZlUsaX0uvAy6EJmiw/8+y97dq2zwl8I5cLD0c39OI=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=SQ7VvYPduvIrRs6DMj9+FxF1aaVnxSv9+YE1wxv/WsMklK9qkdjwOKMirDr2A5/WT YwtqA/RlIZkghg+Xt0Xe4Kw7UpuzjlIKETw+MAWyu8w88x3SDE0msOz1OwCMkLm2pJ dw85a6RhdrmKx5zUYwgshU487wXKJi9dE2pljIATIz1/NAWwgDwoWIBZLxVtRE+0Ba Ze+NqiqFCrQZJXCfQWB4JiO71p9mY2L6PhOjfH1QbAGYq8vSVKBt1UaDip+Hjkahxn FdtqjTWWIqOhEsl26Lw3Kx1NyeCo/sZhZM1c0+0KvL0mS/+U2tM8j7JeoFFMUduVHH rG8JRMAXxqzOw== Message-ID: <276a4a37-a98d-c59b-a967-db9f5b220077@collabora.com> Date: Mon, 19 Sep 2022 16:20:35 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.0 Subject: Re: [PATCH v5 3/6] iommu/mediatek: Add error path for loop of mm_dts_parse Content-Language: en-US To: Yong Wu , Joerg Roedel , Matthias Brugger , Will Deacon Cc: Robin Murphy , iommu@lists.linux.dev, linux-mediatek@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, mingyuan.ma@mediatek.com, yf.wang@mediatek.com, libo.kang@mediatek.com, chengci.xu@mediatek.com, youlin.pei@mediatek.com, anan.sun@mediatek.com, xueqi.zhang@mediatek.com, Guenter Roeck , Dan Carpenter References: <20220919092405.8256-1-yong.wu@mediatek.com> <20220919092405.8256-4-yong.wu@mediatek.com> From: AngeloGioacchino Del Regno In-Reply-To: <20220919092405.8256-4-yong.wu@mediatek.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,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 Il 19/09/22 11:24, Yong Wu ha scritto: > The mtk_iommu_mm_dts_parse will parse the smi larbs nodes. if the i+1 > larb is parsed fail, we should put_device for the 0..i larbs. If any v6 will be required... you forgot to update the commit description with "we should put_device for the i..0 larbs". > > There are two places need to comment: > 1) The larbid may be not linear mapping, we should loop whole > the array in the error path. > 2) I move this line position: "data->larb_imu[id].dev = &plarbdev->dev;" > before "if (!plarbdev->dev.driver)", That means set > data->larb_imu[id].dev before the error path. then we don't need > "platform_device_put(plarbdev)" again in probe_defer case. All depend > on "put_device" of the error path in error cases. > > Fixes: d2e9a1102cfc ("iommu/mediatek: Contain MM IOMMU flow with the MM TYPE") > Signed-off-by: Yong Wu In any case.... Reviewed-by: AngeloGioacchino Del Regno