From: Mark Brown <broonie@kernel.org>
To: "Ivan T. Ivanov" <iivanov@mm-sol.com>
Cc: Grant Likely <grant.likely@linaro.org>,
Rob Herring <robh+dt@kernel.org>,
linux-spi@vger.kernel.org, linux-arm-msm@vger.kernel.org,
linux-kernel@vger.kernel.org, devicetree@vger.kernel.org,
Alok Chauhan <alokc@codeaurora.org>,
Gilad Avidov <gavidov@codeaurora.org>,
Kiran Gunda <kgunda@codeaurora.org>,
Sagar Dharia <sdharia@codeaurora.org>
Subject: Re: [PATCH 2/2] spi: Add Qualcomm QUP SPI controller support
Date: Mon, 10 Feb 2014 17:09:00 +0000 [thread overview]
Message-ID: <20140210170900.GC13533@sirena.org.uk> (raw)
In-Reply-To: <1392049766.2853.43.camel@iivanov-dev>
[-- Attachment #1: Type: text/plain, Size: 1806 bytes --]
On Mon, Feb 10, 2014 at 06:29:26PM +0200, Ivan T. Ivanov wrote:
> On Fri, 2014-02-07 at 17:12 +0000, Mark Brown wrote:
> > > + if (!xfer)
> > > + return IRQ_HANDLED;
> > Are you sure? It seems wrong to just ignore interrupts, some comments
> > would help explain why.
> Of course this should never happen. This was left from initial stage
> of the implementation.
OK, so reporting them as errors seems better then.
> > > + if (controller->speed_hz != chip->speed_hz) {
> > > + ret = clk_set_rate(controller->cclk, chip->speed_hz);
> > > + if (ret) {
> > > + dev_err(controller->dev, "fail to set frequency %d",
> > > + chip->speed_hz);
> > > + return -EIO;
> > > + }
> > > + }
> > Is calling into the clock framework really so expensive that we need to
> > avoid doing it?
> Probably not. But why to call it if the frequency is the same.
It's less code that could go wrong and the check is already there in the
clock framework hopefully.
> > You also shouldn't be interacting with the hardware in
> > setup().
> This is internal hw-setup, not master::setup() or I am
> missing something?
The naming could probably be clearer then - config or something.
> > > + if (chip->bits_per_word <= 8)
> > > + controller->bytes_per_word = 1;
> > > + else if (chip->bits_per_word <= 16)
> > > + controller->bytes_per_word = 2;
> > > + else
> > > + controller->bytes_per_word = 4;
> > This looks like a switch statement, and looking at the above it's not
> > clear that the device actually supports anything other than whole bytes.
> > I'm not sure what that would mean from an API point of view.
> SPI API didn't validate struct spi_transfer::len field.
It's supposed to; if the validation is incomplete then that should be
fixed.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2014-02-10 17:09 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-06 16:57 [PATCH 0/2] " Ivan T. Ivanov
2014-02-06 16:57 ` [PATCH 1/2] spi: qup: Add device tree bindings information Ivan T. Ivanov
2014-02-07 7:43 ` Andy Gross
2014-02-06 16:57 ` [PATCH 2/2] spi: Add Qualcomm QUP SPI controller support Ivan T. Ivanov
2014-02-07 7:39 ` Andy Gross
2014-02-07 9:52 ` Ivan T. Ivanov
2014-02-07 17:32 ` Andy Gross
2014-02-07 17:52 ` Mark Brown
2014-02-07 19:12 ` Andy Gross
2014-02-10 16:55 ` Ivan T. Ivanov
2014-02-10 17:47 ` Andy Gross
2014-02-10 19:41 ` Ivan T. Ivanov
2014-02-10 20:29 ` Courtney Cavin
2014-02-10 20:59 ` Ivan T. Ivanov
2014-02-10 21:40 ` Mark Brown
2014-02-11 15:46 ` Ivan T. Ivanov
2014-02-07 16:51 ` Josh Cartwright
2014-02-07 17:18 ` Mark Brown
2014-02-07 17:20 ` Josh Cartwright
2014-02-07 17:31 ` Mark Brown
2014-02-07 17:46 ` Josh Cartwright
2014-02-07 17:57 ` Mark Brown
2014-02-07 17:12 ` Mark Brown
2014-02-10 16:29 ` Ivan T. Ivanov
2014-02-10 17:09 ` Mark Brown [this message]
2014-02-06 17:50 ` [PATCH 0/2] " Mark Brown
2014-02-07 7:43 ` [PATCH RESEND 1/2] spi: qup: Add device tree bindings information Ivan T. Ivanov
2014-02-07 12:27 ` Mark Brown
2014-02-07 13:00 ` Ivan T. Ivanov
2014-02-07 13:13 ` Mark Brown
2014-02-07 13:35 ` Ivan T. Ivanov
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=20140210170900.GC13533@sirena.org.uk \
--to=broonie@kernel.org \
--cc=alokc@codeaurora.org \
--cc=devicetree@vger.kernel.org \
--cc=gavidov@codeaurora.org \
--cc=grant.likely@linaro.org \
--cc=iivanov@mm-sol.com \
--cc=kgunda@codeaurora.org \
--cc=linux-arm-msm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-spi@vger.kernel.org \
--cc=robh+dt@kernel.org \
--cc=sdharia@codeaurora.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
all inboxes | Powered by JetHome®