All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Shah, Nehal-bakulchandra" <Nehal-Bakulchandra.shah@amd.com>
To: Linus Walleij <linus.walleij@linaro.org>,
	"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Cc: "gnurou@gmail.com" <gnurou@gmail.com>,
	"S-k, Shyam-sundar" <Shyam-sundar.S-k@amd.com>
Subject: Re: [PATCH] pinctrl: amd: Add support for additional GPIO
Date: Tue, 22 Nov 2016 15:49:02 +0530	[thread overview]
Message-ID: <469f529e-818b-392f-9ddb-b02e87e50ca9@amd.com> (raw)
In-Reply-To: <CACRpkdbab3iEwLOucpAz38AJZaEgpO6mrZrLev+YSYuO7Ox_JA@mail.gmail.com>



On 11/14/2016 6:48 PM, Linus Walleij wrote:
> On Wed, Nov 9, 2016 at 11:28 AM, Shah, Nehal-bakulchandra
> <Nehal-bakulchandra.Shah@amd.com> wrote:
> 
>> This Provide IRQ sharing for AMD's GPIO devices.And set IRQCHIP_SKIP_SET_WAKE flag.
>>
>> Also, fix the build issue for devm_request_irq()
>>
>> Reviewed-by: S-k, Shyam-sundar <Shyam-sundar.S-k@amd.com>
>> Signed-off-by: Nehal Shah <Nehal-bakulchandra.Shah@amd.com>
> 
> This is not looking correct at all.
> 
>> @@ -529,16 +531,13 @@ static void amd_gpio_irq_handler(struct irq_desc *desc)
>>                 }
>>         }
>>
>> -       if (handled == 0)
>> -               handle_bad_irq(desc);
>> -
>>         spin_lock_irqsave(&gpio_dev->lock, flags);
>>         reg = readl(gpio_dev->base + WAKE_INT_MASTER_REG);
>>         reg |= EOI_MASK;
>>         writel(reg, gpio_dev->base + WAKE_INT_MASTER_REG);
>>         spin_unlock_irqrestore(&gpio_dev->lock, flags);
>>
>> -       chained_irq_exit(chip, desc);
>> +       return 0;
> 
> You are removing the chained interrupt handling for no good reason.
> The commit message does not say why this is being done.
> 
> It's especially erroneous to remove chained_irq_exit() but not
> chained_irq_enter(), but generally, NONE of them should be
> removed this *is* a chained interrupt handler.
> 
>>         gpiochip_set_chained_irqchip(&gpio_dev->gc,
>>                                  &amd_gpio_irqchip,
>>                                  irq_base,
>> -                                amd_gpio_irq_handler);
>> +                                NULL);
>> +
>> +       ret = devm_request_irq(&pdev->dev, irq_base, amd_gpio_irq_handler,
>> +                              IRQF_SHARED, dev_name(&pdev->dev), gpio_dev);
>> +       if (ret)
>> +               goto out2;
> 
> This is just wrong. The gpiochip_set_chained_irqchip() should not
> be called in combination with devm_request_irq() like this.
> 
> devm_request_irq() should not be used at all. Keep the chained
> handler.
> 
> I'm worried that this patch has a "trial-and-error" quality, it seems
> you don't really know what is going on.
> 
> Please investigate and send the patch with a commitlog that describes
> exactly why you are doing what you are doing.
> 
> Yours,
> Linus Walleij
> 
Hi Linus,
 
I understood that chained irq and devm_irq can't be used together. Surely, 
I will rework on the patch. The reason behind using devm_irq is that in our 
upcoming platform bios may report two gpio controllers. Both will have same IRQs. 
In my understanding if I use chained irq handler, it will not be clear interrupt 
is due to which gpio controller.It may lead to serve irq twice. 
Looking at this constrain we changed the logic to devm irq.

Please let me know if anything is incorrect in my understanding or if there is 
a better way to handle this situation.
 
Your valuable inputs will help us a lot.
 
Thanks and Regards
Nehal

  reply	other threads:[~2016-11-22 12:51 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-09 10:28 [PATCH] pinctrl: amd: Add support for additional GPIO Shah, Nehal-bakulchandra
2016-11-14 13:18 ` Linus Walleij
2016-11-22 10:19   ` Shah, Nehal-bakulchandra [this message]
2016-11-22 10:44     ` Linus Walleij
2016-11-28  9:57       ` Shah, Nehal-bakulchandra
2016-11-29  6:32       ` Shah, Nehal-bakulchandra
2016-11-30 13:10         ` Linus Walleij
2016-12-01  8:09           ` Shah, Nehal-bakulchandra
2016-12-01  8:13           ` Shah, Nehal-bakulchandra
2016-12-02 12:46             ` Linus Walleij
2016-12-06  6:47           ` Shah, Nehal-bakulchandra
2016-12-06 10:14             ` Shah, Nehal-bakulchandra
2016-12-28 12:26             ` Linus Walleij
  -- strict thread matches above, loose matches on Subject: below --
2016-11-04  3:46 Shah, Nehal-bakulchandra
2016-11-08  9:41 ` Linus Walleij
2016-11-08 13:13 ` Linus Walleij

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=469f529e-818b-392f-9ddb-b02e87e50ca9@amd.com \
    --to=nehal-bakulchandra.shah@amd.com \
    --cc=Shyam-sundar.S-k@amd.com \
    --cc=gnurou@gmail.com \
    --cc=linus.walleij@linaro.org \
    --cc=linux-gpio@vger.kernel.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.