All of lore.kernel.org
 help / color / mirror / Atom feed
From: Julien Grall <julien.grall@linaro.org>
To: vijay.kilari@gmail.com, Ian.Campbell@citrix.com,
	stefano.stabellini@eu.citrix.com, stefano.stabellini@citrix.com,
	tim@xen.org, xen-devel@lists.xen.org
Cc: Prasun.Kapoor@caviumnetworks.com, vijaya.kumar@caviumnetworks.com
Subject: Re: [PATCH v6a 05/17] xen/arm: use ioremap to map gic-v2 registers
Date: Thu, 26 Jun 2014 13:07:37 +0100	[thread overview]
Message-ID: <53AC0D09.4050405@linaro.org> (raw)
In-Reply-To: <1403760849-14627-6-git-send-email-vijay.kilari@gmail.com>

Hi Vijay,

On 06/26/2014 06:33 AM, vijay.kilari@gmail.com wrote:
> From: Vijaya Kumar K <Vijaya.Kumar@caviumnetworks.com>
> 
> gic-v2 driver uses fixmap to map the registers.
> Instead use ioremap to access mmio registers.
> 
> With this patch, gic-v2 register definitions are updated
> to use absolute offset address instead of dividing the
> register offset by 4.

I remembered I requested to made some changes in this patch. I saw you
did it but you didn't specify in the changelog. People may not be agree
with your new changes and you should notifying about any change in the code!

[..]

> @@ -229,8 +232,7 @@ static void gic_set_irq_properties(struct irq_desc *desc,
>                                     const cpumask_t *cpu_mask,
>                                     unsigned int priority)
>  {
> -    volatile unsigned char *bytereg;
> -    uint32_t cfg, edgebit;
> +    uint32_t cfg, edgebit, itarget, ipriority;
>      unsigned int mask;
>      unsigned int irq = desc->irq;
>      unsigned int type = desc->arch.type;
> @@ -243,21 +245,28 @@ static void gic_set_irq_properties(struct irq_desc *desc,
>      mask = gic_cpu_mask(cpu_mask);
>  
>      /* Set edge / level */
> -    cfg = GICD[GICD_ICFGR + irq / 16];
> +    cfg = readl_relaxed(GICD + GICD_ICFGR + (irq / 16) * 4);
>      edgebit = 2u << (2 * (irq % 16));
>      if ( type & DT_IRQ_TYPE_LEVEL_MASK )
>          cfg &= ~edgebit;
>      else if ( type & DT_IRQ_TYPE_EDGE_BOTH )
>          cfg |= edgebit;
> -    GICD[GICD_ICFGR + irq / 16] = cfg;
> +    writel_relaxed(cfg, GICD + GICD_ICFGR + (irq / 16) * 4);
>  
>      /* Set target CPU mask (RAZ/WI on uniprocessor) */
> -    bytereg = (unsigned char *) (GICD + GICD_ITARGETSR);
> -    bytereg[irq] = mask;
> -
> +    itarget = readl_relaxed(GICD + GICD_ITARGETSR + (irq / 4) * 4);
> +    /* Clear mask */
> +    itarget &= ~(0xffu << (8 * (irq % 4)));
> +    /* Set mask */
> +    itarget |=  mask << (8 * (irq % 4));
> +    writel_relaxed(itarget, GICD + GICD_ITARGETSR + (irq / 4) * 4);

Why didn't you use writeb_relaxed? This change is complex for nothing.

writeb_relaxed(mask, GICD + GICD_ITARGETSR + irq);

> +
> +    ipriority = readl_relaxed(GICD + GICD_IPRIORITYR + (irq / 4) * 4);
> +    /* Clear priority */
> +    ipriority &= ~(0xffu << (8 * (irq % 4)));
>      /* Set priority */
> -    bytereg = (unsigned char *) (GICD + GICD_IPRIORITYR);
> -    bytereg[irq] = priority;
> +    ipriority |=  priority << (8 * (irq % 4));
> +    writel_relaxed(ipriority, GICD + GICD_IPRIORITYR + (irq / 4) * 4);

writeb_relaxed(priority, GICD + GICD_IPRIORITYR + irq);

Regards,

-- 
Julien Grall

  reply	other threads:[~2014-06-26 12:07 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26  5:33 [PATCH v6a 00/17] GIC and VGIC code refactoring vijay.kilari
2014-06-26  5:33 ` [PATCH v6a 01/17] xen/arm: move io.h as mmio.h to include folder vijay.kilari
2014-06-26  5:33 ` [PATCH v6a 02/17] xen/arm: make mmio handlers domain specific vijay.kilari
2014-06-26  5:33 ` [PATCH v6a 03/17] xen/arm: make sgi handling generic vijay.kilari
2014-06-26 11:47   ` Julien Grall
2014-06-26 11:51     ` Ian Campbell
2014-06-27 12:42   ` Ian Campbell
2014-06-26  5:33 ` [PATCH v6a 04/17] xen/arm: remove unused parameter in do_sgi call vijay.kilari
2014-06-26  5:33 ` [PATCH v6a 05/17] xen/arm: use ioremap to map gic-v2 registers vijay.kilari
2014-06-26 12:07   ` Julien Grall [this message]
2014-06-26  5:33 ` [PATCH v6a 06/17] xen/arm: segregate and split GIC low level functionality vijay.kilari
2014-06-26 12:21   ` Julien Grall
2014-06-26  5:33 ` [PATCH v6a 07/17] arm/xen: move GIC context data structure to gic driver vijay.kilari
2014-06-26 12:26   ` Julien Grall
2014-06-26  5:34 ` [PATCH v6a 08/17] xen/arm: use device api to detect GIC version vijay.kilari
2014-06-26 12:29   ` Julien Grall
2014-06-26  5:34 ` [PATCH v6a 09/17] xen/arm: switch to dynamic allocation of vgic rank vijay.kilari
2014-06-26  5:34 ` [PATCH v6a 10/17] xen/arm: prefix byte_read and byte_write functions with vgic vijay.kilari
2014-06-26 12:37   ` Julien Grall
2014-06-26  5:34 ` [PATCH v6a 11/17] xen/arm: move vgic defines to vgic header file vijay.kilari
2014-06-26 12:40   ` Julien Grall
2014-06-26  5:34 ` [PATCH v6a 12/17] xen/arm: move and rename is_vcpu_running function to sched.h vijay.kilari
2014-06-26  9:41   ` Jan Beulich
2014-06-27 13:55     ` Ian Campbell
2014-06-27 14:05       ` Jan Beulich
2014-06-27 14:51         ` Ian Campbell
2014-06-26  5:34 ` [PATCH v6a 13/17] xen/arm: move pending_irq structure to vgic header file vijay.kilari
2014-06-26 12:46   ` Julien Grall
2014-06-26  5:34 ` [PATCH v6a 14/17] xen/arm: calculate vgic irq rank based on register size vijay.kilari
2014-06-26 12:58   ` Julien Grall
2014-06-27 13:57     ` Ian Campbell
2014-06-26  5:34 ` [PATCH v6a 15/17] xen/arm: Remove REG macro in vgic driver vijay.kilari
2014-06-26  5:34 ` [PATCH v6a 16/17] xen/arm: split vgic driver into generic and vgic-v2 driver vijay.kilari
2014-06-26 14:30   ` Julien Grall
2014-06-26  5:34 ` [PATCH v6a 17/17] xen/arm: Restrict saving of gic register for idle domain vijay.kilari
2014-06-26 14:33   ` Julien Grall
2014-06-27 14:45     ` Ian Campbell
2014-06-27 14:52       ` Ian Campbell
2014-06-27 15:03         ` Julien Grall
2014-06-27 14:58       ` Julien Grall
2014-07-01  6:24         ` Vijay Kilari
2014-07-02  9:43           ` Ian Campbell
2014-06-27 13:40 ` [PATCH v6a 00/17] GIC and VGIC code refactoring Ian Campbell

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=53AC0D09.4050405@linaro.org \
    --to=julien.grall@linaro.org \
    --cc=Ian.Campbell@citrix.com \
    --cc=Prasun.Kapoor@caviumnetworks.com \
    --cc=stefano.stabellini@citrix.com \
    --cc=stefano.stabellini@eu.citrix.com \
    --cc=tim@xen.org \
    --cc=vijay.kilari@gmail.com \
    --cc=vijaya.kumar@caviumnetworks.com \
    --cc=xen-devel@lists.xen.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 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.