Received: by 10.223.185.116 with SMTP id b49csp202877wrg; Tue, 13 Feb 2018 19:53:49 -0800 (PST) X-Google-Smtp-Source: AH8x227T5nLpmUgDhu8QMftcR7zs6Eb99r7+zTZdjf5MWrPYdSlcnqUZVfxqbXz8pJkVF4NkeZF4 X-Received: by 2002:a17:902:c81:: with SMTP id 1-v6mr3165987plt.281.1518580429767; Tue, 13 Feb 2018 19:53:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518580429; cv=none; d=google.com; s=arc-20160816; b=AJIEtYLr8TxoRMZiLWj8DIDF0sszrAvLgitqwqEax3uMXY72TtMnxYJFSo5B6Eclx7 NjYsb9rX1zkeN7vLDKaUvqa6Ttm9jLd5HvIMEot+6x366xEXrfxIlKNIwWJrQHcagCUM zYrdpgo4BraOa9Lh2gNAgNFU7Zfow2pxDfvaKF4A28UVr+AumUFqRd8Jmat0qvrLql/h LcnckBqmNWsjRTLk97Tzv1ZAGNBSpYUxImRCFp55oe+dPeSvqGuDe49yw/EprBZfXMVn y15QJenAwCvCR4/r+JuPMhP14YpSBQkFnCSVeVYzdU+JFOMCHRqEYEgUy2z7L/sHKOUj lV+Q== 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 :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=2pvZohrK+95xGqEIlkXKzdUX0yhhrvFu0ruJR5T9nVI=; b=EQYryUczUGn8Sj/SL6EQZ6zaxlR359LqkeGrI00E/0PW2Pzzo18bnKxyUAWjmbVGGD oTWppwf4uZJegZMYW7bAzTigTAiu5K2kA+mr8mNfwJ9V9mlwy3pcukDhu9g+6UJ7Kfe8 0WDWExRCKWanPnRsk5gEkDsuPk9X6hQkKwu6ux8CGzJu17m8zORx8n+5DLqYLKLak8Rb Gy50Wrlk4MwhL2uafk3j5bY4rfScYnKxX5IFd+6Lk6Oo8WsKGkoFeh6mH4N3R45i2e1a 9fa7rb8nzZBqUVDwcq/2cIcjanIP7YDHIQgOd2wmE8htD4CJILwjITMrgU8lEFCcwBh7 b+sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=eLg3iSsE; 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 c3si621825pfi.404.2018.02.13.19.53.35; Tue, 13 Feb 2018 19:53:49 -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=eLg3iSsE; 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 S966857AbeBNDvF (ORCPT + 99 others); Tue, 13 Feb 2018 22:51:05 -0500 Received: from mail-ua0-f169.google.com ([209.85.217.169]:44836 "EHLO mail-ua0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966777AbeBNDvD (ORCPT ); Tue, 13 Feb 2018 22:51:03 -0500 Received: by mail-ua0-f169.google.com with SMTP id x4so12867476uaj.11 for ; Tue, 13 Feb 2018 19:51:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=2pvZohrK+95xGqEIlkXKzdUX0yhhrvFu0ruJR5T9nVI=; b=eLg3iSsE++7oBJ9Atqj7fgUMGMvPKItlW/xT3oq/RXQEYo1M/o8VDwetiRbCGgWhqk Ksv7h+GXSJOD3hYj3H8657HkXwW675x6dH+0JqFXO7lHsuZ+hFgPtZWTKs74ynzHnwl1 5LcUaGQyki9iV0FCAJK+D60CHCofWqABCUCyM= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=2pvZohrK+95xGqEIlkXKzdUX0yhhrvFu0ruJR5T9nVI=; b=bRh/WLYzbdCT7pfUeEu/H7P4nZGRHyRz9CgyL0ZbvUCZ1TDE05ajQ5NT2T8s9vL0kI GeUuRiB68nC/VdSTR6U7cw0xm8ROJdtiWmbPRFa7z/Wq0oeca3evnByuq/Nxyw9+ASVN box2e9GILZxwrE2IrRQLzFC12D3H+azLjjC9iVGvWtmOYFkVrVkrLi/TDFURyajdvxVa rLat6t5BJNvD6E8umiTeOGHMDm+68NS1e0LktbVw7I4UIVgCg1pkJA4Gv1xcEejtL1hN lDhz4RmuG4y+4p3IDigwg/d2rg/XhwawxqN2MDrHA16unLLSCvtNF3y/kNy2JDtL+tAH xr4Q== X-Gm-Message-State: APf1xPC9Wkbm3mhvCGfNy49ZzR0aCSLdEpWfgeox6GlYegZMm/kAwVwB M9BU+tMxnaXg+PE49pz/Qhs29JEC2iQ= X-Received: by 10.176.20.77 with SMTP id c13mr3324105uae.12.1518580262385; Tue, 13 Feb 2018 19:51:02 -0800 (PST) Received: from mail-vk0-f54.google.com (mail-vk0-f54.google.com. [209.85.213.54]) by smtp.gmail.com with ESMTPSA id m194sm591080vkf.4.2018.02.13.19.51.02 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Feb 2018 19:51:02 -0800 (PST) Received: by mail-vk0-f54.google.com with SMTP id z9so12110520vkd.5 for ; Tue, 13 Feb 2018 19:51:02 -0800 (PST) X-Received: by 10.31.77.135 with SMTP id a129mr3368341vkb.36.1518579929910; Tue, 13 Feb 2018 19:45:29 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.0.68 with HTTP; Tue, 13 Feb 2018 19:45:09 -0800 (PST) In-Reply-To: References: <1517999482-17317-1-git-send-email-vivek.gautam@codeaurora.org> <1517999482-17317-3-git-send-email-vivek.gautam@codeaurora.org> From: Tomasz Figa Date: Wed, 14 Feb 2018 12:45:09 +0900 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v7 2/6] iommu/arm-smmu: Add pm_runtime/sleep ops To: Vivek Gautam Cc: "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , Rob Herring , Mark Rutland , "Rafael J. Wysocki" , Robin Murphy , Will Deacon , Rob Clark , "list@263.net:IOMMU DRIVERS , Joerg Roedel ," , devicetree@vger.kernel.org, open list , Linux PM , dri-devel , freedreno , David Airlie , Greg KH , Stephen Boyd , linux-arm-msm 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 Tue, Feb 13, 2018 at 7:25 PM, Vivek Gautam wrote: >>> +static int arm_smmu_init_clks(struct arm_smmu_device *smmu) >>> +{ >>> + int i; >>> + int num = smmu->num_clks; >>> + const struct arm_smmu_match_data *data; >>> + >>> + if (num < 1) >>> + return 0; >>> + >>> + smmu->clocks = devm_kcalloc(smmu->dev, num, >>> + sizeof(*smmu->clocks), GFP_KERNEL); >>> + if (!smmu->clocks) >>> + return -ENOMEM; >>> + >>> + data = of_device_get_match_data(smmu->dev); >>> + >>> + for (i = 0; i < num; i++) >>> + smmu->clocks[i].id = data->clks[i]; >> >> I'd argue that arm_smmu_device_dt_probe() is a better place for all >> the code above, since this function is called regardless of whether >> the device is probed from DT or not. Going further, >> arm_smmu_device_acpi_probe() could fill smmu->num_clks and ->clocks >> using ACPI-like way (as opposed to OF match data) if necessary. > > Right, it's valid to fill the data in arm_smmu_device_dt_probe(). > Perhaps we can just keep the devm_clk_bulk_get() in arm_smmu_device_probe() > at the point where we are currently doing arm_smmu_init_clks(). Sounds good to me. Thanks. Best regards, Tomasz