All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jarkko Nikula <jarkko.nikula@linux.intel.com>
To: Jonathan Cameron <jic23@kernel.org>
Cc: linux-iio@vger.kernel.org,
	William Breathitt Gray <vilhelm.gray@gmail.com>,
	Felipe Balbi <balbi@kernel.org>,
	Raymond Tan <raymond.tan@intel.com>
Subject: Re: [PATCH v4] counter: Add support for Intel Quadrature Encoder Peripheral
Date: Fri, 4 Jun 2021 16:57:24 +0300	[thread overview]
Message-ID: <fbca9d99-07b9-0150-ef9e-15eaa867ac8b@linux.intel.com> (raw)
In-Reply-To: <20210603171233.37009042@jic23-huawei>

Hi

On 6/3/21 7:12 PM, Jonathan Cameron wrote:
> Given all my comments are either minor or not specifically about code here,
> feel free to send a follow up if you want to tidy them up.
> 
Thanks, point taken. Commenting two of those below.

>> +
>> +	pm_runtime_forbid(dev);
>> +	if (!qep->enabled)
>> +		pm_runtime_get(dev);
> 
> Ouch, I'd not encountered this pci related weirdness before
> (All about overriding the fact PCI opts out of runtime)
> 
Yeah this conditional pm_runtime_get() doesn't look optimal in remove(). 
PCI devices must be in D0 when not bound but don't remember now does PCI 
core it anyway after remove or not but pm_runtime_get() must be here for 
balancing the runtime PM usage count due pm_runtime_put() in probe(), 
i.e. device is suspended after probe(),

Exception here is if peripheral is enabled and already powered when 
coming here. Which makes me thinking counting is perhaps good to 
disable. Kind of pointless to let it count if there is no driver.

>> +
>> +	intel_qep_writel(qep, INTEL_QEPCON, 0);
>> +}
>> +
>> +#ifdef CONFIG_PM
> 
> Up to William and yourself, but I would prefer not to see these ifdefs
> but instead mark the functions __maybe_unused and let the linker
> drop them.  It tends to be less error prone if the pm handling gets
> more complex in future.
> 
I obviously will follow the style here. I remember some maintainers 
prefer explicit #ifdef over __maybe_unused.

Jarkko

  reply	other threads:[~2021-06-04 13:57 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-02 11:32 [PATCH v4] counter: Add support for Intel Quadrature Encoder Peripheral Jarkko Nikula
2021-06-02 14:20 ` William Breathitt Gray
2021-06-03 16:12 ` Jonathan Cameron
2021-06-04 13:57   ` Jarkko Nikula [this message]
2021-06-11 11:56   ` Jarkko Nikula

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=fbca9d99-07b9-0150-ef9e-15eaa867ac8b@linux.intel.com \
    --to=jarkko.nikula@linux.intel.com \
    --cc=balbi@kernel.org \
    --cc=jic23@kernel.org \
    --cc=linux-iio@vger.kernel.org \
    --cc=raymond.tan@intel.com \
    --cc=vilhelm.gray@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.