All of lore.kernel.org
 help / color / mirror / Atom feed
From: BhuvanChandra.DV <bhuvanchandra.dv@toradex.com>
To: Mark Brown <broonie@kernel.org>
Cc: "mark.rutland@arm.com" <mark.rutland@arm.com>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux@arm.linux.org.uk" <linux@arm.linux.org.uk>,
	"B44548@freescale.com" <B44548@freescale.com>,
	"pawel.moll@arm.com" <pawel.moll@arm.com>,
	"ijc+devicetree@hellion.org.uk" <ijc+devicetree@hellion.org.uk>,
	"Li.Xiubo@freescale.com" <Li.Xiubo@freescale.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stefan@agner.ch" <stefan@agner.ch>,
	"linux-spi@vger.kernel.org" <linux-spi@vger.kernel.org>,
	"robh+dt@kernel.org" <robh+dt@kernel.org>,
	"galak@codeaurora.org" <galak@codeaurora.org>,
	"shawn.guo@linaro.org" <shawn.guo@linaro.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>
Subject: Re: [PATCH 4/7] spi: spi-fsl-dspi: avoid preparing the clock two times
Date: Wed, 28 Jan 2015 06:58:33 +0000	[thread overview]
Message-ID: <1422428658040.88027@toradex.com> (raw)
In-Reply-To: <20150127130117.GU21293@sirena.org.uk>


On 01/27/2015 06:31 PM, Mark Brown wrote:
> On Tue, Jan 27, 2015 at 04:27:21PM +0530, Bhuvanchandra DV wrote:
>> regmap_read/regmap_write will expect the peripheral clock
>> to be enabled before accessing the registers of the peripheral.
>> Since the peripheral clock is enabled separatly, avoid redundant clock
>> prepare (with devm_regmap_init_mmio_clk) and use devm_regmap_init_mmio instead.
> What's the advantage of this?  The clock API is refcounted so there
> should be no issue with this and it seems like it's opening us up to
> bugs if there's a path where we interact with the registers without
> enabling the clocks.

My initial thought was that, since regmap_mmio_init_clk() does call
clk_prepare(), to go with regmap_mmio_init() as clk_prepare_enable()
is called at a later stage in the probe().

WARNING: multiple messages have this Message-ID (diff)
From: bhuvanchandra.dv@toradex.com (BhuvanChandra.DV)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 4/7] spi: spi-fsl-dspi: avoid preparing the clock two times
Date: Wed, 28 Jan 2015 06:58:33 +0000	[thread overview]
Message-ID: <1422428658040.88027@toradex.com> (raw)
In-Reply-To: <20150127130117.GU21293@sirena.org.uk>


On 01/27/2015 06:31 PM, Mark Brown wrote:
> On Tue, Jan 27, 2015 at 04:27:21PM +0530, Bhuvanchandra DV wrote:
>> regmap_read/regmap_write will expect the peripheral clock
>> to be enabled before accessing the registers of the peripheral.
>> Since the peripheral clock is enabled separatly, avoid redundant clock
>> prepare (with devm_regmap_init_mmio_clk) and use devm_regmap_init_mmio instead.
> What's the advantage of this?  The clock API is refcounted so there
> should be no issue with this and it seems like it's opening us up to
> bugs if there's a path where we interact with the registers without
> enabling the clocks.

My initial thought was that, since regmap_mmio_init_clk() does call
clk_prepare(), to go with regmap_mmio_init() as clk_prepare_enable()
is called at a later stage in the probe().

  reply	other threads:[~2015-01-28  6:58 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-27 10:57 [PATCH 0/7] Add SPI support for Colibri modules and DSPI driver fixes Bhuvanchandra DV
2015-01-27 10:57 ` Bhuvanchandra DV
2015-01-27 10:57 ` Bhuvanchandra DV
2015-01-27 10:57 ` Bhuvanchandra DV
2015-01-27 10:57 ` [PATCH 1/7] ARM: vf610: add second DSPI instance Bhuvanchandra DV
2015-01-27 10:57   ` Bhuvanchandra DV
2015-01-27 10:57   ` Bhuvanchandra DV
2015-01-28  9:08   ` Stefan Agner
2015-01-28  9:08     ` Stefan Agner
2015-01-28  9:08     ` Stefan Agner
2015-02-26  8:02   ` Shawn Guo
2015-02-26  8:02     ` Shawn Guo
2015-02-26  8:02     ` Shawn Guo
2015-01-27 10:57 ` [PATCH 2/7] ARM: vf-colibri: add SPI support and enable MCP2515 CAN Bhuvanchandra DV
2015-01-27 10:57   ` Bhuvanchandra DV
2015-01-27 10:57   ` Bhuvanchandra DV
2015-01-28  9:55   ` Stefan Agner
2015-01-28  9:55     ` Stefan Agner
2015-01-28  9:55     ` Stefan Agner
2015-01-27 10:57 ` [PATCH 3/7] spi: spi-fsl-dspi: Remove usage of devm_kzalloc Bhuvanchandra DV
2015-01-27 10:57   ` Bhuvanchandra DV
2015-01-27 10:57   ` Bhuvanchandra DV
2015-01-27 18:50   ` Aaron Brice
2015-01-27 18:50     ` Aaron Brice
2015-01-27 18:50     ` Aaron Brice
2015-01-27 19:52   ` Mark Brown
2015-01-27 19:52     ` Mark Brown
2015-01-28  7:05     ` BhuvanChandra.DV
2015-01-28  7:05       ` BhuvanChandra.DV
2015-01-27 10:57 ` [PATCH 4/7] spi: spi-fsl-dspi: avoid preparing the clock two times Bhuvanchandra DV
2015-01-27 10:57   ` Bhuvanchandra DV
2015-01-27 10:57   ` Bhuvanchandra DV
2015-01-27 13:01   ` Mark Brown
2015-01-27 13:01     ` Mark Brown
2015-01-27 13:01     ` Mark Brown
2015-01-28  6:58     ` BhuvanChandra.DV [this message]
2015-01-28  6:58       ` BhuvanChandra.DV
2015-01-27 10:57 ` [PATCH 5/7] spi: spi-fsl-dspi: Remove spi-bitbang Bhuvanchandra DV
2015-01-27 10:57   ` Bhuvanchandra DV
2015-01-27 10:57   ` Bhuvanchandra DV
2015-01-28 19:25   ` Mark Brown
2015-01-28 19:25     ` Mark Brown
2015-01-28 19:25     ` Mark Brown

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=1422428658040.88027@toradex.com \
    --to=bhuvanchandra.dv@toradex.com \
    --cc=B44548@freescale.com \
    --cc=Li.Xiubo@freescale.com \
    --cc=broonie@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=galak@codeaurora.org \
    --cc=ijc+devicetree@hellion.org.uk \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=mark.rutland@arm.com \
    --cc=pawel.moll@arm.com \
    --cc=robh+dt@kernel.org \
    --cc=shawn.guo@linaro.org \
    --cc=stefan@agner.ch \
    /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.