public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo2.kernel.org@gmail.com>
To: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Cc: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com,
	x86@kernel.org, linux-kernel@vger.kernel.org, pebolle@tiscali.nl
Subject: Re: [PATCH v3] x86: punit_atom: punit device state debug driver
Date: Wed, 6 May 2015 09:16:27 +0200	[thread overview]
Message-ID: <20150506071627.GA28964@gmail.com> (raw)
In-Reply-To: <1430772593-20204-2-git-send-email-srinivas.pandruvada@linux.intel.com>


* Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> wrote:

> The patch adds a debug driver, which dumps the power states of all 
> the North complex (NC) devices. This debug interface is useful to 
> figure out the devices, which blocks the S0ix transitions on the 
> platform. This is extremely useful during enabling PM on customer 
> platforms and derivatives.

Looks mostly good. Small nits:

> +config PUNIT_ATOM_DEBUG
> +	tristate "ATOM Punit debug driver"
> +	depends on DEBUG_FS
> +	select IOSF_MBI

I suspect you could select DEBUG_FS as well? Half of the drivers seem 
to do that.

> +	---help---
> +	  This is a debug driver, which gets the power states
> +	  of all Punit North Complex devices. The power states of
> +	  each device is exposed as part of the debugfs interface.

Might as well mention the path of the file? To keep people from 
guessing and so.

> +static int punit_dev_state_show(struct seq_file *seq_file, void *unused)
> +{
> +	u32 punit_pwr_status;
> +	struct punit_device *punit_devp = punit_device;

You could stick stick 'punit_device' into s->private? You do that by 
passing it to debugfs_create_file(). That way you could avoid the 
fugly static allocation of 'punit_device' and its global setting in 
punit_atom_debug_init().

> +	int index;
> +	int status;
> +
> +	seq_puts(seq_file, "\n\nPUNIT NORTH COMPLEX DEVICES :\n");
> +	while (punit_devp->name) {
> +		status = iosf_mbi_read(PUNIT_PORT, BT_MBI_PMC_READ,
> +				       punit_devp->reg,
> +				       &punit_pwr_status);
> +		if (status)
> +			seq_printf(seq_file, "%9s : Read Failed\n",
> +				   punit_devp->name);
> +		else  {
> +			index = (punit_pwr_status >> punit_devp->sss_pos) & 3;
> +			seq_printf(seq_file, "%9s : %s\n", punit_devp->name,
> +				   dstates[index]);
> +		}

We only use symmetric curly braces in the kernel.

> +#define ICPU(model, drv_data) \
> +	{ X86_VENDOR_INTEL, 6, model, X86_FEATURE_MWAIT,\
> +	  (kernel_ulong_t)&drv_data }
> +
> +static const struct x86_cpu_id intel_punit_cpu_ids[] = {
> +	ICPU(0x4c, punit_device_cht),
> +	ICPU(0x37, punit_device_byt),
> +	{}
> +};

So should the models be listed in increasing order?

Also, I'd use decimal, as we do for models typically. Also, might as 
well mention which Intel Atom models those are: 22nm Atom "Silvermont" 
and 14nm Atom "Airmont", right?

Thanks,

	Ingo

  reply	other threads:[~2015-05-06  7:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-04 20:49 [PATCH v3] x86: punit_atom: punit device state debug driver Srinivas Pandruvada
2015-05-04 20:49 ` Srinivas Pandruvada
2015-05-06  7:16   ` Ingo Molnar [this message]
2015-05-04 21:05 ` Srinivas Pandruvada

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150506071627.GA28964@gmail.com \
    --to=mingo2.kernel.org@gmail.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=pebolle@tiscali.nl \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox