Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1615640
| Path | csiph.com!news.redatomik.org!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Daniel Axtens <dja@axtens.net> |
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v6 02/11] powerpc/powernv: Autoload IMC device driver module |
| Date | Tue, 04 Apr 2017 03:00:01 +0200 |
| Message-ID | <tskZb-5T4-3@gated-at.bofh.it> (permalink) |
| References | <tsbCx-8d5-7@gated-at.bofh.it> <tsbMe-8vF-9@gated-at.bofh.it> |
| Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=axtens.net; s=google; h=from:to:cc:subject:in-reply-to:references:user-agent:date :message-id:mime-version; bh=c8PhgcK6TEJ47QLaXxSXQ2TZ5vuKO9AQ54AHOFnyG3Y=; b=myeEulgYTJpDr5A90xugOvvd/pZCB5xsvIO8G3FUT5EtQffx5EJ2xowEYDgXMRjZum 8jdsMzMbNo75lVX/Mbe7pCmzaE4lJjciqBodlQInZdR+mzKF3/qkUnmmZ2ZlUOta2uYw B1P5gWn9ZPkg6n3NTRKtSH5HZIiahCjBpUCBc= |
| X-Google-Dkim-Signature | v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:in-reply-to:references :user-agent:date:message-id:mime-version; bh=c8PhgcK6TEJ47QLaXxSXQ2TZ5vuKO9AQ54AHOFnyG3Y=; b=FEMVEKGrizK4Eo/OqV8OwUqmTk+MyYHvCX0J7nUiDE7ixNO7qcFdeNJPlUQvrtATGI HstZudEreKQ0ytEyHS6vzNNvQz29n9VdnDHiMgd7QzpeczSOxaFw137NJrIh0AjbSWIB PXbsmLnmV7uIz0VlxvlOyHpkojm+UJNf7JhrOtpH/ft9SAQe6EdYMpE8x47j0sE0rCOA IeyIaAqd1ANwAHTLIsz9lDMUI8+gcvblqnPcR0oEvjCMfSKEdmROMwo/p57mwClCeNVd QmblInVAx6zbP1ea/ZXFMW0+Wo+hakCp8zDdnAWWcesL8Lt+kV7fXdnfUCCK6X/Xqxzt 0ISA== |
| X-Gm-Message-State | AFeK/H0gbpEDApkJe50EIcDav1DGNzSWn180dv1qIGpxXWwezH4t7BodxGQJNyGQLP0ntA== |
| X-Received | by 10.98.16.137 with SMTP id 9mr19951236pfq.104.1491267532476; Mon, 03 Apr 2017 17:58:52 -0700 (PDT) |
| User-Agent | Notmuch/0.22.1 (http://notmuchmail.org) Emacs/24.5.1 (x86_64-pc-linux-gnu) |
| MIME-Version | 1.0 |
| Content-Type | text/plain |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 107 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org, ego@linux.vnet.ibm.com, bsingharora@gmail.com, benh@kernel.crashing.org, paulus@samba.org, anton@samba.org, sukadev@linux.vnet.ibm.com, mikey@neuling.org, stewart@linux.vnet.ibm.com, eranian@google.com, Hemant Kumar <hemant@linux.vnet.ibm.com>, Anju T Sudhakar <anju@linux.vnet.ibm.com>, Madhavan Srinivasan <maddy@linux.vnet.ibm.com> |
| X-Original-Date | Tue, 04 Apr 2017 10:58:48 +1000 |
| X-Original-Message-ID | <87pogtkmyf.fsf@possimpible.ozlabs.ibm.com> |
| X-Original-References | <1491231308-15282-1-git-send-email-maddy@linux.vnet.ibm.com> <1491231308-15282-3-git-send-email-maddy@linux.vnet.ibm.com> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1615640 |
Show key headers only | View raw
Hi all,
I'm trying to get my head around these patches - at this point I'm just
doing a first pass, so I may have more substantive structural comments
later on. In the mean time - here are some minor C nits:
> + * Copyright (C) 2016 Madhavan Srinivasan, IBM Corporation.
> + * (C) 2016 Hemant K Shaw, IBM Corporation.
Should these be bumped to 2017?
> +
> + do {
> + pages = PAGE_SIZE * i;
> + pcni->vbase[i++] = (u64)phys_to_virt(pcni->pbase +
> + pages);
> + } while (i < (pcni->size / PAGE_SIZE));
> + }
I had to scroll back up to the top of this function to make sure I
understood what this loop does. Would it be better to write it as:
for (i = 0; i < (pcni->size / PAGE_SIZE); i++) {
pages = PAGE_SIZE * i;
pcni->vbase[i] = (u64)....
}
And, just checking - this is expected to work on both 4 and 64kB pages?
> +
> + return 0;
> +err:
> + return -ENODEV;
You're not releasing any resources here - would it be better to just
replace the gotos with this return? I haven't checked to see if you
change the function later on to allocate memory - if so please ignore :)
> +}
> +
> +static const struct of_device_id opal_imc_match[] = {
> + { .compatible = IMC_DTB_COMPAT },
> + {},
> +};
> +
> +static struct platform_driver opal_imc_driver = {
> + .driver = {
> + .name = "opal-imc-counters",
> + .of_match_table = opal_imc_match,
> + },
> + .probe = opal_imc_counters_probe,
> +};
> +
> +MODULE_DEVICE_TABLE(of, opal_imc_match);
> +module_platform_driver(opal_imc_driver);
> +MODULE_DESCRIPTION("PowerNV OPAL IMC driver");
> +MODULE_LICENSE("GPL");
> diff --git a/arch/powerpc/platforms/powernv/opal.c b/arch/powerpc/platforms/powernv/opal.c
> index e0f856bfbfe8..85ea1296f030 100644
> --- a/arch/powerpc/platforms/powernv/opal.c
> +++ b/arch/powerpc/platforms/powernv/opal.c
> @@ -14,6 +14,7 @@
> #include <linux/printk.h>
> #include <linux/types.h>
> #include <linux/of.h>
> +#include <linux/of_address.h>
> #include <linux/of_fdt.h>
> #include <linux/of_platform.h>
> #include <linux/interrupt.h>
> @@ -30,6 +31,7 @@
> #include <asm/opal.h>
> #include <asm/firmware.h>
> #include <asm/mce.h>
> +#include <asm/imc-pmu.h>
>
> #include "powernv.h"
>
> @@ -631,6 +633,15 @@ static void opal_pdev_init(const char *compatible)
> of_platform_device_create(np, NULL, NULL);
> }
>
> +static void opal_imc_init_dev(void)
> +{
> + struct device_node *np;
> +
> + np = of_find_compatible_node(NULL, NULL, IMC_DTB_COMPAT);
> + if (np)
> + of_platform_device_create(np, NULL, NULL);
> +}
Should this function be tagged __init?
> +
> static int kopald(void *unused)
> {
> unsigned long timeout = msecs_to_jiffies(opal_heartbeat) + 1;
> @@ -704,6 +715,9 @@ static int __init opal_init(void)
> /* Setup a heatbeat thread if requested by OPAL */
> opal_init_heartbeat();
>
> + /* Detect IMC pmu counters support and create PMUs */
> + opal_imc_init_dev();
> +
> /* Create leds platform devices */
> leds = of_find_node_by_path("/ibm,opal/leds");
> if (leds) {
> --
> 2.7.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v6 00/11] IMC Instrumentation Support Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2017-04-03 17:10 +0200
[PATCH v6 02/11] powerpc/powernv: Autoload IMC device driver module Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2017-04-03 17:10 +0200
Re: [PATCH v6 02/11] powerpc/powernv: Autoload IMC device driver module Daniel Axtens <dja@axtens.net> - 2017-04-04 03:00 +0200
Re: [PATCH v6 02/11] powerpc/powernv: Autoload IMC device driver module Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2017-04-05 08:40 +0200
Re: [PATCH v6 02/11] powerpc/powernv: Autoload IMC device driver module Daniel Axtens <dja@axtens.net> - 2017-04-04 03:50 +0200
Re: [PATCH v6 02/11] powerpc/powernv: Autoload IMC device driver module Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2017-04-05 08:40 +0200
Re: [PATCH v6 02/11] powerpc/powernv: Autoload IMC device driver module Stewart Smith <stewart@linux.vnet.ibm.com> - 2017-04-06 09:10 +0200
[PATCH v6 01/11] powerpc/powernv: Data structure and macros definitions Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2017-04-03 17:10 +0200
Re: [PATCH v6 01/11] powerpc/powernv: Data structure and macros definitions Daniel Axtens <dja@axtens.net> - 2017-04-04 03:50 +0200
Re: [PATCH v6 01/11] powerpc/powernv: Data structure and macros definitions Madhavan Srinivasan <maddy@linux.vnet.ibm.com> - 2017-04-05 06:30 +0200
Re: [PATCH v6 01/11] powerpc/powernv: Data structure and macros definitions Stewart Smith <stewart@linux.vnet.ibm.com> - 2017-04-06 10:10 +0200
Re: [PATCH v6 01/11] powerpc/powernv: Data structure and macros definitions Stewart Smith <stewart@linux.vnet.ibm.com> - 2017-04-06 10:50 +0200
csiph-web