[PATCH v2 3/7] OMAP4: hwmod data: add mailbox data
Ramirez Luna, Omar
omar.ramirez at ti.com
Mon Nov 8 11:55:50 EST 2010
Hi Benoit,
On Mon, Nov 8, 2010 at 2:56 AM, Cousson, Benoit <b-cousson at ti.com> wrote:
>> no, apart from the ordering of structure members, that I will change,
>
> If you do want to change a patch already submitted to loml, the least you
> can do is to comment on the mailing list, and afaik, you didn't provide any
> comment on this code.
> So do not change it without any explanation or any rational.
> That's the most basic rule of the patch submission / review process in
> Linux.
I'm submitting my changes to review, I accept that I should have put
loudly an clear the reasons why the ordering was changing. I guess you
are the maintainer of the code, right? so if you say the ordering
standard is omap4 then I'm fine with such triviality.
>> since keeping the order of the original structure doesn't fly, I don't
>> see anything that needs to be changed.
>>
>> - The magic numbers replaced for the defines, afaik it gives more clarity.
>
> No, since these are not magic numbers but physical address or dma number or
> irq channel.
> That does not give any more clarity to add a define, and in fact it adds an
> extra level of indirection for nothing.
> The hwmod file is "the" unique HW definition files. So all the information
> that used to be scattered all over various header files will have to be
> there.
> You should considered this file as a global SoC HW definition file.
Ok, I don't mind changing this too, I'm glad you clarify/review this
before more hwmods make it to the tree, following the same style I'm
using which is the one already there.
>> - mailbox irq has a name.
>
> Which is in the structure anyway, so again no need to add a define.
I didn't add a define for the irq name, I put the irq name because it
wasn't there.
> All the structure that are populated hrer are all unique to every IP, so
> having that kind of assignment does not seems very useful to me.
>
> omap44xx_mailbox_irq = OMAP44XX_MAILBOX_IRQ;
>
> whereas that:
> omap44xx_mailbox_irq = 20;
>
> Give you a little be more information, because you do not have have to read
> the TRM or another header file to get the real number.
>
> FYI, that was discussed at least 6 months ago during the submission of the
> early hwmod series.
>
>> - overall defining block was improved:
>>
>> class
>> ocp_if
>> slave ports
>> hwmod
>>
>> If you see, each dependent reference is right before the structure
>> that is using it, which at least to me establishes some order, as of
>> today this ordering doesn't exists.
>>
>> e.g. you are defining some hwmod and some how you are populating all
>> the members, if you are looking at your omap_hwmod struct and want to
>> see the irqs defined you need to scroll beyond the supposed first
>> reference in omap_hwmod (right now above ocp_if)
>
> So what? If you have any issue with the original order, please feel free to
> comment on the original patch.
> In case you didn't notice, all the OMAP4 data are following the same
> pattern. So any change to the structure should be applied everywhere.
>
> I do not have any issue to improve the overall readability if that make
> sense for everybody, but again, please comment first.
Again, I should have sent an RFC explaining such changes. will do.
I feel commenting in the original patch is useless because this code
is already in-tree, it might have already changed.
>> <quote>
>> /*
>> * 'mailbox' class
>> * mailbox module allowing communication between the on-chip processors
>> * useusing a queued mailbox-interrupt mechanism.
>> */
>> </quote>
>>
>> I don't think it adds anything to the patch, should we start
>> commenting on the functionality of the drivers for each hwmod?
>
> In that case, it does not hurt since this file is the C file version of the
> TRM. You might not care because you know what that module is doing, but most
> people don't.
Ok, then.
>>>> +static struct omap_hwmod omap44xx_mailbox_hwmod;
>>>> +
>>>> +static struct omap_hwmod_addr_space omap44xx_mailbox_addrs[] = {
>>>> + {
>>>> + .pa_start = OMAP44XX_MAILBOX_BASE,
>>>
>>> If that physical address is not used elsewhere, and it should be the
>>> case,
>>> there is no need to create a define for it. That's why the physical
>>> address
>>> was directly used here.
>>> There is no added value to create a define for that.
>>
>> yes there is, apart from readability where '0x4a0f4000' doesn't say much
>
> It says everything... when you use a debugger, what kind of information
> OMAP44XX_MAILBOX_BASE will give you? Nothing, you will have to check again
> the TRM or the define to get the real useful information.
Why is that? if you use a debugger you will see the address, if you
use an objdump you can easily traverse to the definition (with cscope,
ctags...). Again, I don't mind placing the hex number there, now that
there is an explanation for doing so.
Overall, I feel the lack of information made the code look as it is
right now for the existing LO hwmods, given that it is also a matter
of ordering stuff it should be pretty straight forward. I'll give you
my proposal offline, if you think it makes sense we can send it to LO
and avoid traffic of non-technical stuff.
Regards,
Omar
More information about the linux-arm-kernel
mailing list