linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Lian Minghuan-b31939 <B31939@freescale.com>
To: Scott Wood <scottwood@freescale.com>
Cc: Minghuan Lian <Minghuan.Lian@freescale.com>,
	linuxppc-dev@lists.ozlabs.org,
	Zang Roy-R61911 <r61911@freescale.com>
Subject: Re: [PATCH 2/5] powerpc/fsl_msi: add MSIIR1 support for MPIC v4.3
Date: Tue, 18 Jun 2013 10:34:49 +0800	[thread overview]
Message-ID: <51BFC749.3080502@freescale.com> (raw)
In-Reply-To: <1371514512.9073.11@snotra>

Hi Soctt,

please see my comments inline.

On 06/18/2013 08:15 AM, Scott Wood wrote:
> On 06/16/2013 10:00:01 PM, Lian Minghuan-b31939 wrote:
>> Hi Scott,
>>
>> please see my comments inline.
>>
>> On 06/15/2013 06:09 AM, Scott Wood wrote:
>>> On 06/14/2013 02:15:56 AM, Minghuan Lian wrote:
>>>> diff --git a/arch/powerpc/sysdev/fsl_msi.h 
>>>> b/arch/powerpc/sysdev/fsl_msi.h
>>>> index 8225f86..43a9d99 100644
>>>> --- a/arch/powerpc/sysdev/fsl_msi.h
>>>> +++ b/arch/powerpc/sysdev/fsl_msi.h
>>>> @@ -16,7 +16,7 @@
>>>>  #include <linux/of.h>
>>>>  #include <asm/msi_bitmap.h>
>>>>
>>>> -#define NR_MSI_REG        8
>>>> +#define NR_MSI_REG        16
>>>>  #define IRQS_PER_MSI_REG    32
>>>>  #define NR_MSI_IRQS    (NR_MSI_REG * IRQS_PER_MSI_REG)
>>>
>>> I don't see where you update all_avail in fsl_of_msi_probe.
>>>
>>> We should also be bounds-checking the contents of msi-available-ranges.
>>> Currently it looks like we just silently overrun the bitmap if we 
>>> get bad
>>> input from the device tree.
>>>
>> [Minghuan] all_avail definition: static const u32 all_avail[] = { 0, 
>> NR_MSI_IRQS };
>> When changing NR_MSI_REG to 16, NR_MSI_IRQS has been changed to 
>> 16*32, and all_avail also is updated.
>
> That's my point.  It shouldn't change for older hardware.
[Minghaun] the older hardware has 8 registers, mipcv4.3 has 16 
registers. If we do not use 16*32 bitmap to indicate 8*32 irqs.(this way 
just only wastes some memory and has no other harm)
we have two choice I think.
1. Use a variable assigned value 8 or 16 based on compatible, then 
dynamically create bitmap
2. Add a new file for mpic v4.3.
What do you think?
>
>> Before calling fsl_msi_setup_hwirq(), the code has checked 
>> 'msi-available-ranges',  only the interrupts lied in 
>> 'msi-available-ranges' will be initialized by call 
>> fsl_msi_setup_hwirq() , and the corresponding bitmap will be freed. I 
>> moved msi_bitmap_free_hwirqs() to fsl_msi_setup_hwirq(), because the 
>> code would generate different bitmap when using MSIIR or MSIIR1.
>
> And what happens if msi-available-ranges is bad, and refers to 
> non-existent MSIs past the end of the bitmap?
[Minghuan] If msi-available-ranges is bad,  the below code will get error.
virt_msir = irq_of_parse_and_map(dev->dev.of_node, irq_index);
And the related error will be printed out and fsl_msi_setup_hwirq() will 
return error directly. There is no chance to set non-existent MSIs past 
the end of the bitmap.

>
> -Scott

  reply	other threads:[~2013-06-18  2:34 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-14  7:15 [PATCH 1/5] powerpc/dts: add MPIC v4.3 dts node Minghuan Lian
2013-06-14  7:15 ` [PATCH 2/5] powerpc/fsl_msi: add MSIIR1 support for MPIC v4.3 Minghuan Lian
2013-06-14 22:09   ` Scott Wood
2013-06-17  3:00     ` Lian Minghuan-b31939
2013-06-18  0:15       ` Scott Wood
2013-06-18  2:34         ` Lian Minghuan-b31939 [this message]
2013-06-18 18:08           ` Scott Wood
2013-06-14  7:15 ` [PATCH 3/5] powerpc/dts: update MSI bindings doc " Minghuan Lian
2013-06-14 22:06   ` Scott Wood
2013-06-17  5:07     ` Lian Minghuan-b31939
2013-06-18  0:28       ` Scott Wood
2013-06-18  0:42         ` Scott Wood
2013-06-18  2:49           ` Lian Minghuan-b31939
2013-06-18 16:21             ` Scott Wood
2013-06-14  7:15 ` [PATCH 4/5] powerpc/dts: remove msi-available-ranges property Minghuan Lian
2013-06-14 22:10   ` Scott Wood
2013-06-17  5:15     ` Lian Minghuan-b31939
2013-06-18  0:13       ` Scott Wood
2013-06-14  7:15 ` [PATCH 5/5] powerpc/fsl_msi: add 'msiregs' kernel parameter Minghuan Lian
2013-06-14 22:13   ` Scott Wood
2013-06-17  5:36     ` Lian Minghuan-b31939
2013-06-18  0:18       ` Scott Wood
2013-06-18  3:10         ` Lian Minghuan-b31939
2013-06-18 16:22           ` Scott Wood
2013-06-14 20:39 ` [PATCH 1/5] powerpc/dts: add MPIC v4.3 dts node Scott Wood
2013-06-14 21:53   ` Scott Wood
2013-06-17  2:23     ` Lian Minghuan-b31939
2013-06-18  0:18       ` Scott Wood

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=51BFC749.3080502@freescale.com \
    --to=b31939@freescale.com \
    --cc=Minghuan.Lian@freescale.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=r61911@freescale.com \
    --cc=scottwood@freescale.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).