Received: by 2002:ac0:8845:0:0:0:0:0 with SMTP id g63csp11594img; Mon, 25 Feb 2019 16:27:24 -0800 (PST) X-Google-Smtp-Source: AHgI3IYGji8xHxm4paz1tfXlbY7U3ODC63ud1zrxoS1jkqrV1koeTecMyIsSpJMmBkAP3UuRwtbr X-Received: by 2002:a65:51ca:: with SMTP id i10mr21224468pgq.371.1551140844232; Mon, 25 Feb 2019 16:27:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551140844; cv=none; d=google.com; s=arc-20160816; b=sQRE8ZvhyJ1lJKCrNtp8VHrZrFbEYpAmaskn97yG3Q+Db1YakFix6TI6DB0kYqV+gG sD9d21SCMoR0/oZPd/9Sgg+yYaYAayIHLCV9Cyls1X4sUVwtw9CcDWmxQ618os/4yWbU /i0oSNRKGpDeF9yV/OcjOdlPJfpXK5a+exxFFRznbDeEqrvM/1owMj08VQLD3W/m2ZSQ p9RUmPXHMcvh7UVFT/DrfzfLPj7BsrPZSrHp5o8+Tg2r592h9DYxuWnHHA00UAfK9BYN JS3OXxpwmLB5S0/PwlMUTOBWc2A0h0kHJ4yGUiMn64XYI2H8jqVHnajCyEe/gCDYY9ev zXnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=/cHvJz/lFIgbpCR1endu87T6pP0PHpJtFHp0QcdQTyo=; b=WyffGsarqQs4AJ2oGW6NssdTJc7WLrYrJKpVWp3Jp+djD3a1kKaKj/Voz+Ijb8yAF+ JMzjRjDio2SlyZOthc7dD5zyDUl2AYgPjY/bGOkymodZlbnnueb4wvb8ip6TNTX1fJ+O 5YqctwLvfXe86jzp7xs/0SYlq6a2o7OuA5GLBHhkG6MMyEcQKEMjTrg2pyZxAZN4/JsD AmrzYBBhQFZIGLmInHwzGoNqsKcI59p1XpRG0NYsrmCPQ8QuEPFLEFKzlZKS5FtiJdK+ cJrpdw/D8byGz7W7uHu2QqqNhHIo0Ry0xISU8eUMu1mv3D/a9nV+VRjVGDypm8dUiKfR GA7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MO2mrfIG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d16si10707902pll.236.2019.02.25.16.27.09; Mon, 25 Feb 2019 16:27:24 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=MO2mrfIG; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729288AbfBZA0c (ORCPT + 99 others); Mon, 25 Feb 2019 19:26:32 -0500 Received: from mail-lf1-f65.google.com ([209.85.167.65]:40498 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727406AbfBZA0c (ORCPT ); Mon, 25 Feb 2019 19:26:32 -0500 Received: by mail-lf1-f65.google.com with SMTP id a8so2512319lfi.7 for ; Mon, 25 Feb 2019 16:26:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=/cHvJz/lFIgbpCR1endu87T6pP0PHpJtFHp0QcdQTyo=; b=MO2mrfIGnMt0DrgiT3cbOzkV8YHPyYhrBJ4ZMTuNLD2o3UtuIo6Q+7rprD6GIw+y/c edfwxRfiVaLszBWXr0qn8UAToIcRs3wJwSD30LRc/f08p8VVfqakAxaARyXDO4YUdgBY THuRgKZxfjnQ5Y9SX4lGZU+RkZyVyOxwR4HOY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=/cHvJz/lFIgbpCR1endu87T6pP0PHpJtFHp0QcdQTyo=; b=Ck2WWwF448KUiSW2pWbXSp/LuZvvKjpVRV1LWfi3ilQURG5i1s6V2mu8nbDJVGMR7V hNbvXxh/fkmrNJzTsQ56wQOPXjRmXnhR7koJ/CfPvAAxqcKxk9AIXdG5UrtjdyoHa0iL qtU2EsrDXuGmMLTZs4gzmKLgCuufmHMHSu6i1axdEIaWg8ZgAJJoU6R6TV/ucnJojHz/ 0lVsMoKUFq/Cb+pDWF4yI3F2dOxS7UkSiH/z3gahQaGQRBDiN9SdlSLA1q6RTZwsoF7s P87G86VC74tuTx/36rwdVWnSv+ONHxaeujrh+ZRayzBDEnFWZjS9esc/JBYALjtBj6I7 Aggw== X-Gm-Message-State: AHQUAuYnctIeppdqtgy7O3Gavyd5/xvFOaZkBkKcvhB0VHIQlaXGoegc vitKjTK6pHPj4SvwlkfergRq31faVeQ= X-Received: by 2002:a19:ec0c:: with SMTP id b12mr12506486lfa.27.1551140790066; Mon, 25 Feb 2019 16:26:30 -0800 (PST) Received: from mail-lj1-f179.google.com (mail-lj1-f179.google.com. [209.85.208.179]) by smtp.gmail.com with ESMTPSA id u15sm1640936lja.73.2019.02.25.16.26.29 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Feb 2019 16:26:30 -0800 (PST) Received: by mail-lj1-f179.google.com with SMTP id d24so8871904ljc.12 for ; Mon, 25 Feb 2019 16:26:29 -0800 (PST) X-Received: by 2002:a2e:99c9:: with SMTP id l9mr11485651ljj.60.1551139025774; Mon, 25 Feb 2019 15:57:05 -0800 (PST) MIME-Version: 1.0 References: <1546318276-18993-1-git-send-email-yong.wu@mediatek.com> <1546318276-18993-12-git-send-email-yong.wu@mediatek.com> In-Reply-To: <1546318276-18993-12-git-send-email-yong.wu@mediatek.com> From: Evan Green Date: Mon, 25 Feb 2019 15:56:29 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 11/13] iommu/mediatek: Use builtin_platform_driver To: Yong Wu Cc: Joerg Roedel , Greg Kroah-Hartman , Matthias Brugger , Rob Herring , Robin Murphy , Tomasz Figa , Will Deacon , linux-mediatek@lists.infradead.org, srv_heupstream@mediatek.com, "open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" , LKML , linux-arm-kernel@lists.infradead.org, iommu@lists.linux-foundation.org, Arnd Bergmann , yingjoe.chen@mediatek.com, youlin.pei@mediatek.com, Nicolas Boichat Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Dec 31, 2018 at 8:53 PM Yong Wu wrote: > > MediaTek IOMMU should wait for smi larb which need wait for the > power domain(mtk-scpsys.c) and the multimedia ccf who both are > module init. Thus, subsys_initcall for MediaTek IOMMU is not helpful. > Switch to builtin_platform_driver. > > Meanwhile, the ".remove" can be removed. Move its content to > ".shutdown". > > Signed-off-by: Yong Wu > --- > drivers/iommu/mtk_iommu.c | 23 ++--------------------- > drivers/iommu/mtk_iommu_v1.c | 16 ++-------------- > 2 files changed, 4 insertions(+), 35 deletions(-) > > diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c > index 735ae8d..2798b12 100644 > --- a/drivers/iommu/mtk_iommu.c > +++ b/drivers/iommu/mtk_iommu.c > @@ -690,7 +690,7 @@ static int mtk_iommu_probe(struct platform_device *pdev) > return component_master_add_with_match(dev, &mtk_iommu_com_ops, match); > } > > -static int mtk_iommu_remove(struct platform_device *pdev) > +static void mtk_iommu_shutdown(struct platform_device *pdev) > { > struct mtk_iommu_data *data = platform_get_drvdata(pdev); > > @@ -703,12 +703,6 @@ static int mtk_iommu_remove(struct platform_device *pdev) > clk_disable_unprepare(data->bclk); > devm_free_irq(&pdev->dev, data->irq, data); > component_master_del(&pdev->dev, &mtk_iommu_com_ops); > - return 0; > -} > - > -static void mtk_iommu_shutdown(struct platform_device *pdev) > -{ > - mtk_iommu_remove(pdev); Is there a reason all these things are happening in shutdown()? Don't we normally just not clean things up and let the machine turn off? Normally I'm a big advocate of proper symmetric teardown, so it hurts a little to ask.