Devicetree
 help / color / mirror / Atom feed
From: Maxime Ripard <maxime.ripard-wi1+55ScJUtKEb57/3fJTNBPR1lH4CV8@public.gmane.org>
To: Icenowy Zheng <icenowy-ymACFijhrKM@public.gmane.org>
Cc: Srinivas Kandagatla
	<srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>,
	Rob Herring <robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Chen-Yu Tsai <wens-jdAy2FN1RRM@public.gmane.org>,
	"devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org"
	<linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org>,
	"linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org"
	<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	"linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org"
	<linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org>
Subject: Re: [PATCH v3 2/3] nvmem: sunxi-sid: add support for H3's SID controller
Date: Fri, 10 Feb 2017 09:05:14 +0100	[thread overview]
Message-ID: <20170210080514.nrryisw4y2wbs5wk@lukather> (raw)
In-Reply-To: <4664661486474595-O40pVLQIipZxpj1cXAZ9Bg@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 1524 bytes --]

On Tue, Feb 07, 2017 at 09:36:35PM +0800, Icenowy Zheng wrote:
> >>  >>  @@ -51,7 +64,8 @@ static u8 sunxi_sid_read_byte(const struct sunxi_sid *sid,
> >>  >>   {
> >>  >>           u32 sid_key;
> >>  >>
> >>  >>  - sid_key = ioread32be(sid->base + round_down(offset, 4));
> >>  >>  + sid_key = ioread32be(sid->base + sid->value_offset +
> >>  >>  + round_down(offset, 4));
> >>  >
> >>  > This would probably be more logical to have this in sunxi_sid_read.
> >>
> >>  But it's here which really access the memory...
> >
> > This function is made to read a single register. What you want is to
> > offset all reads, and all the reads are made in sunxi_sid_read.
> 
> I think the semantic of this function is to read out one byte from SID,
> not read out a single register from SID; the parameter passed into it is
> also a const struct *sunxi_sid, so I think make the offset here is right.

You need to offset *all* register reads, it makes much more sense to
do that offset in the function that reads all the registers, and not
just one.

Maxime

-- 
Maxime Ripard, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

-- 
You received this message because you are subscribed to the Google Groups "linux-sunxi" group.
To unsubscribe from this group and stop receiving emails from it, send an email to linux-sunxi+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org
For more options, visit https://groups.google.com/d/optout.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 801 bytes --]

  parent reply	other threads:[~2017-02-10  8:05 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-02 13:13 [PATCH v3 1/3] nvmem: sunxi-sid: read NVMEM size from device compatible Icenowy Zheng
     [not found] ` <20170202131338.20234-1-icenowy-ymACFijhrKM@public.gmane.org>
2017-02-02 13:13   ` [PATCH v3 2/3] nvmem: sunxi-sid: add support for H3's SID controller Icenowy Zheng
     [not found]     ` <20170202131338.20234-2-icenowy-ymACFijhrKM@public.gmane.org>
2017-02-06  8:54       ` Maxime Ripard
2017-02-06  8:56         ` Icenowy Zheng
     [not found]           ` <5119511486371415-pc6iqGSXq09xpj1cXAZ9Bg@public.gmane.org>
2017-02-07  9:25             ` Maxime Ripard
2017-02-07 13:36               ` Icenowy Zheng
     [not found]                 ` <4664661486474595-O40pVLQIipZxpj1cXAZ9Bg@public.gmane.org>
2017-02-10  8:05                   ` Maxime Ripard [this message]
2017-02-02 13:13   ` [PATCH v3 3/3] ARM: dts: sun8i: enable SID on Allwinner H3 SoC Icenowy Zheng
2017-02-06  8:48   ` [PATCH v3 1/3] nvmem: sunxi-sid: read NVMEM size from device compatible Maxime Ripard

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=20170210080514.nrryisw4y2wbs5wk@lukather \
    --to=maxime.ripard-wi1+55scjutkeb57/3fjtnbpr1lh4cv8@public.gmane.org \
    --cc=devicetree-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=icenowy-ymACFijhrKM@public.gmane.org \
    --cc=linux-arm-kernel-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-sunxi-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org \
    --cc=robh+dt-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=srinivas.kandagatla-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=wens-jdAy2FN1RRM@public.gmane.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