From: Timur Tabi <timur@freescale.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: York Sun <yorksun@freescale.com>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
galak@kernel.crashing.org,
linux-fbdev-devel@lists.sourceforge.net,
Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU
Date: Fri, 21 Mar 2008 11:12:30 -0500 [thread overview]
Message-ID: <47E3DE6E.2050801@freescale.com> (raw)
In-Reply-To: <20080320152708.23c6c734.akpm@linux-foundation.org>
Andrew Morton wrote:
>> +static struct diu_hw dr = {
>> + .mode = MFB_MODE1,
>> + .reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init),
>> +};
>
> I'm not clear on what's supposed to happen with __SPIN_LOCK_UNLOCKED(). I
> do know that its documentation is crap.
Yes, "__SPIN_LOCK_UNLOCKED(old_style_spin_init)" is wrong. We'll fix it.
> static struct diu_hw dr = {
> .mode = MFB_MODE1,
> - .reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init),
> + .reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock),
> };
Yes, this is better. Did you already make this change when you applied it to
your -mm repo?
> GFP_DMA implies GFP_ATOMIC, but it's appropriate for documentation purposes.
So does that mean that "GFP_DMA | GFP_KERNEL" is always wrong? If so, this
combination is used a lot in the kernel today.
>> + if (virt) {
>> + *phys = virt_to_phys(virt);
>> + pr_debug("virt %p, phys=%llx\n", virt, (uint64_t) *phys);
>> + memset(virt, 0, size);
>
> Could have used __GFP_ZERO, I guess.
I had completely forgotten about __GFP_ZERO. Thanks.
>> + virt = (void *) rh_alloc(&diu_ops.diu_rh_info, size, "DIU");
>
> hm, I'd have expected checkpatch to whine about the space after the cast
> there. Whatever.
I thought a space after a cast is the right thing to do?
> please take a look, and please use checkpatch on all future patches.
Sorry, we forgot to run it again after our second version of the patch.
>> +static void free_irq_local(int irq)
>> +{
>> + struct diu *hw = dr.diu_reg;
>> +
>> + /* Disable all LCDC interrupt */
>> + out_be32(&(hw->int_mask), 0x1f);
>> +
>> + free_irq(irq, 0);
>> +}
>
> and the free_irq() will go splat?
Sorry, but I don't understand what's wrong with this code.
We'll make the other changes you've suggested and repost.
--
Timur Tabi
Linux kernel developer at Freescale
WARNING: multiple messages have this Message-ID (diff)
From: Timur Tabi <timur@freescale.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-fbdev-devel@lists.sourceforge.net,
Peter Zijlstra <a.p.zijlstra@chello.nl>,
linux-kernel@vger.kernel.org, linuxppc-dev@ozlabs.org,
York Sun <yorksun@freescale.com>
Subject: Re: [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU
Date: Fri, 21 Mar 2008 11:12:30 -0500 [thread overview]
Message-ID: <47E3DE6E.2050801@freescale.com> (raw)
In-Reply-To: <20080320152708.23c6c734.akpm@linux-foundation.org>
Andrew Morton wrote:
>> +static struct diu_hw dr = {
>> + .mode = MFB_MODE1,
>> + .reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init),
>> +};
>
> I'm not clear on what's supposed to happen with __SPIN_LOCK_UNLOCKED(). I
> do know that its documentation is crap.
Yes, "__SPIN_LOCK_UNLOCKED(old_style_spin_init)" is wrong. We'll fix it.
> static struct diu_hw dr = {
> .mode = MFB_MODE1,
> - .reg_lock = __SPIN_LOCK_UNLOCKED(old_style_spin_init),
> + .reg_lock = __SPIN_LOCK_UNLOCKED(diu_hw.reg_lock),
> };
Yes, this is better. Did you already make this change when you applied it to
your -mm repo?
> GFP_DMA implies GFP_ATOMIC, but it's appropriate for documentation purposes.
So does that mean that "GFP_DMA | GFP_KERNEL" is always wrong? If so, this
combination is used a lot in the kernel today.
>> + if (virt) {
>> + *phys = virt_to_phys(virt);
>> + pr_debug("virt %p, phys=%llx\n", virt, (uint64_t) *phys);
>> + memset(virt, 0, size);
>
> Could have used __GFP_ZERO, I guess.
I had completely forgotten about __GFP_ZERO. Thanks.
>> + virt = (void *) rh_alloc(&diu_ops.diu_rh_info, size, "DIU");
>
> hm, I'd have expected checkpatch to whine about the space after the cast
> there. Whatever.
I thought a space after a cast is the right thing to do?
> please take a look, and please use checkpatch on all future patches.
Sorry, we forgot to run it again after our second version of the patch.
>> +static void free_irq_local(int irq)
>> +{
>> + struct diu *hw = dr.diu_reg;
>> +
>> + /* Disable all LCDC interrupt */
>> + out_be32(&(hw->int_mask), 0x1f);
>> +
>> + free_irq(irq, 0);
>> +}
>
> and the free_irq() will go splat?
Sorry, but I don't understand what's wrong with this code.
We'll make the other changes you've suggested and repost.
--
Timur Tabi
Linux kernel developer at Freescale
next prev parent reply other threads:[~2008-03-21 16:12 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-03-19 18:50 v2 patch for Freescale DIU driver York Sun
2008-03-19 18:50 ` York Sun
2008-03-19 18:50 ` [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU York Sun
2008-03-19 18:50 ` York Sun
2008-03-19 18:50 ` [PATCH 2/2 v2] Add DIU platform code for MPC8610HPCD York Sun
2008-03-19 18:50 ` York Sun
2008-03-20 22:33 ` Andrew Morton
2008-03-20 22:33 ` Andrew Morton
2008-03-20 22:33 ` Andrew Morton
2008-03-25 12:43 ` Andy Whitcroft
2008-03-25 12:43 ` Andy Whitcroft
2008-03-25 19:18 ` Andrew Morton
2008-03-25 19:18 ` Andrew Morton
2008-03-25 19:18 ` Andrew Morton
2008-03-20 22:27 ` [PATCH 1/2 v2] Driver for Freescale 8610 and 5121 DIU Andrew Morton
2008-03-20 22:27 ` Andrew Morton
2008-03-20 22:27 ` Andrew Morton
2008-03-20 23:02 ` Peter Zijlstra
2008-03-20 23:02 ` Peter Zijlstra
2008-03-21 16:12 ` Timur Tabi [this message]
2008-03-21 16:12 ` Timur Tabi
2008-03-21 18:12 ` Andrew Morton
2008-03-21 18:12 ` Andrew Morton
2008-03-21 18:12 ` Andrew Morton
2008-03-24 14:53 ` Timur Tabi
2008-03-24 14:53 ` Timur Tabi
2008-03-24 14:53 ` Timur Tabi
2008-03-24 18:47 ` Andrew Morton
2008-03-24 18:47 ` Andrew Morton
2008-03-24 18:47 ` Andrew Morton
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=47E3DE6E.2050801@freescale.com \
--to=timur@freescale.com \
--cc=a.p.zijlstra@chello.nl \
--cc=akpm@linux-foundation.org \
--cc=galak@kernel.crashing.org \
--cc=linux-fbdev-devel@lists.sourceforge.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=yorksun@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 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.