From: Felipe Balbi <balbi@ti.com>
To: Sourav Poddar <sourav.poddar@ti.com>
Cc: balbi@ti.com, broonie@kernel.org,
spi-devel-general@lists.sourceforge.net, grant.likely@linaro.org,
linux-omap@vger.kernel.org, rnayak@ti.com
Subject: Re: [PATCHv6 1/2] drivers: spi: Add qspi flash controller
Date: Tue, 30 Jul 2013 10:38:21 +0300 [thread overview]
Message-ID: <20130730073821.GF16441@radagast> (raw)
In-Reply-To: <51F76C84.8080601@ti.com>
[-- Attachment #1: Type: text/plain, Size: 3022 bytes --]
Hi,
On Tue, Jul 30, 2013 at 01:04:28PM +0530, Sourav Poddar wrote:
> Hi Felipe,
> On Monday 29 July 2013 06:05 PM, Felipe Balbi wrote:
> >Hi,
> >
> >On Mon, Jul 29, 2013 at 04:45:02PM +0530, Sourav Poddar wrote:
> >>>>>>>>+ irq = platform_get_irq(pdev, 0);
> >>>>>>>>+ if (irq< 0) {
> >>>>>>>>+ dev_err(&pdev->dev, "no irq resource?\n");
> >>>>>>>>+ return irq;
> >>>>>>>>+ }
> >>>>>>>>+
> >>>>>>>>+ spin_lock_init(&qspi->lock);
> >>>>>>>>+
> >>>>>>>>+ qspi->base = devm_ioremap_resource(&pdev->dev, r);
> >>>>>>>>+ if (IS_ERR(qspi->base)) {
> >>>>>>>>+ ret = PTR_ERR(qspi->base);
> >>>>>>>>+ goto free_master;
> >>>>>>>>+ }
> >>>>>>>>+
> >>>>>>>>+ ret = devm_request_threaded_irq(&pdev->dev, irq, ti_qspi_isr,
> >>>>>>>>+ ti_qspi_threaded_isr, IRQF_NO_SUSPEND | IRQF_ONESHOT,
> >>>>>>>why do you need IRQF_NO_SUSPEND ?
> >>>>>>>
> >>>>>>I should get away with this.
> >>>>>why ? Do you need or do you *not* need it ? And in either case, why ?
> >>>>>
> >>>>I was thinking, this will keep the irqs up even when we are
> >>>>hitting suspend, we will not be prepared to handle it. ?
> >>>won't be prepared in what way ?
> >>>
> >>Our driver will be down, so the irq might go un-serviced.
> >only if you wrote the driver that way. IRQ subsystem doesn't know the
> >state of the device, all it knows is that in case an IRQ fires, it needs
> >to call the registered IRQ handler.
> >
> >Now the thing is:
> >
> >Initially you had the flag setup, so I asked why you needed it. I
> >expected you to tell me why you think QSPI's IRQ shouldn't be disabled
> >during suspend and the implications of disabling it.
> >
> >Instead you just changed your mind and decided to remove the flag.
> >
> >Because you changed your mind with no explanation, that tells me you
> >haven't fully grasped how that flag works and what it means to set (or
> >not set) it.
> >
> >My question now is simply: why don't you need that flag ? What are the
> >implications of setting that flag ? How would your driver behave if an
> >IRQ fired while your driver was suspended ? Unless you understand what
> >it does, how can you understand the behavior or the driver ?
> >
> >cheers
> >
> We dont need IRQF_NO_SUSPEND flag in our qspi controller.
>
> Qspi driver need to be prevented from receiving interrupts during
> system wide suspend/hibernation.
> "suspend_device_irqs" in kernel/irq/pm.c marks interrupt line in use
> and sets IRQS_SUSPENDED
> for them.
> If we use "IRQF_NO_SUSPEND", we will bypass setting this
> IRQS_SUSPENDED flag, which is not.
> desired
>
>
> For this, interrupt lines need to
> and this function is provided for this purpose.
> * It marks all interrupt lines in use, except for the timer ones, as
> disabled
> * and sets the IRQS_SUSPENDED flag for each of them.
>
> This flag gets used in __disable_irq api(kernel/irq/manage.c) which
some formatting issues in the mail, but good that you looked at the
code. Cheers
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
WARNING: multiple messages have this Message-ID (diff)
From: Felipe Balbi <balbi@ti.com>
To: Sourav Poddar <sourav.poddar@ti.com>
Cc: <balbi@ti.com>, <broonie@kernel.org>,
<spi-devel-general@lists.sourceforge.net>,
<grant.likely@linaro.org>, <linux-omap@vger.kernel.org>,
<rnayak@ti.com>
Subject: Re: [PATCHv6 1/2] drivers: spi: Add qspi flash controller
Date: Tue, 30 Jul 2013 10:38:21 +0300 [thread overview]
Message-ID: <20130730073821.GF16441@radagast> (raw)
In-Reply-To: <51F76C84.8080601@ti.com>
[-- Attachment #1: Type: text/plain, Size: 3022 bytes --]
Hi,
On Tue, Jul 30, 2013 at 01:04:28PM +0530, Sourav Poddar wrote:
> Hi Felipe,
> On Monday 29 July 2013 06:05 PM, Felipe Balbi wrote:
> >Hi,
> >
> >On Mon, Jul 29, 2013 at 04:45:02PM +0530, Sourav Poddar wrote:
> >>>>>>>>+ irq = platform_get_irq(pdev, 0);
> >>>>>>>>+ if (irq< 0) {
> >>>>>>>>+ dev_err(&pdev->dev, "no irq resource?\n");
> >>>>>>>>+ return irq;
> >>>>>>>>+ }
> >>>>>>>>+
> >>>>>>>>+ spin_lock_init(&qspi->lock);
> >>>>>>>>+
> >>>>>>>>+ qspi->base = devm_ioremap_resource(&pdev->dev, r);
> >>>>>>>>+ if (IS_ERR(qspi->base)) {
> >>>>>>>>+ ret = PTR_ERR(qspi->base);
> >>>>>>>>+ goto free_master;
> >>>>>>>>+ }
> >>>>>>>>+
> >>>>>>>>+ ret = devm_request_threaded_irq(&pdev->dev, irq, ti_qspi_isr,
> >>>>>>>>+ ti_qspi_threaded_isr, IRQF_NO_SUSPEND | IRQF_ONESHOT,
> >>>>>>>why do you need IRQF_NO_SUSPEND ?
> >>>>>>>
> >>>>>>I should get away with this.
> >>>>>why ? Do you need or do you *not* need it ? And in either case, why ?
> >>>>>
> >>>>I was thinking, this will keep the irqs up even when we are
> >>>>hitting suspend, we will not be prepared to handle it. ?
> >>>won't be prepared in what way ?
> >>>
> >>Our driver will be down, so the irq might go un-serviced.
> >only if you wrote the driver that way. IRQ subsystem doesn't know the
> >state of the device, all it knows is that in case an IRQ fires, it needs
> >to call the registered IRQ handler.
> >
> >Now the thing is:
> >
> >Initially you had the flag setup, so I asked why you needed it. I
> >expected you to tell me why you think QSPI's IRQ shouldn't be disabled
> >during suspend and the implications of disabling it.
> >
> >Instead you just changed your mind and decided to remove the flag.
> >
> >Because you changed your mind with no explanation, that tells me you
> >haven't fully grasped how that flag works and what it means to set (or
> >not set) it.
> >
> >My question now is simply: why don't you need that flag ? What are the
> >implications of setting that flag ? How would your driver behave if an
> >IRQ fired while your driver was suspended ? Unless you understand what
> >it does, how can you understand the behavior or the driver ?
> >
> >cheers
> >
> We dont need IRQF_NO_SUSPEND flag in our qspi controller.
>
> Qspi driver need to be prevented from receiving interrupts during
> system wide suspend/hibernation.
> "suspend_device_irqs" in kernel/irq/pm.c marks interrupt line in use
> and sets IRQS_SUSPENDED
> for them.
> If we use "IRQF_NO_SUSPEND", we will bypass setting this
> IRQS_SUSPENDED flag, which is not.
> desired
>
>
> For this, interrupt lines need to
> and this function is provided for this purpose.
> * It marks all interrupt lines in use, except for the timer ones, as
> disabled
> * and sets the IRQS_SUSPENDED flag for each of them.
>
> This flag gets used in __disable_irq api(kernel/irq/manage.c) which
some formatting issues in the mail, but good that you looked at the
code. Cheers
--
balbi
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
next prev parent reply other threads:[~2013-07-30 7:38 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-29 7:22 [PATCHv6 0/2] Add ti qspi controller Sourav Poddar
2013-07-29 7:22 ` Sourav Poddar
2013-07-29 7:22 ` [PATCHv6 1/2] drivers: spi: Add qspi flash controller Sourav Poddar
2013-07-29 7:22 ` Sourav Poddar
2013-07-29 9:31 ` Felipe Balbi
2013-07-29 9:31 ` Felipe Balbi
2013-07-29 10:12 ` Sourav Poddar
2013-07-29 10:12 ` Sourav Poddar
2013-07-29 10:20 ` Felipe Balbi
2013-07-29 10:20 ` Felipe Balbi
2013-07-29 11:04 ` Sourav Poddar
2013-07-29 11:04 ` Sourav Poddar
2013-07-29 11:09 ` Felipe Balbi
2013-07-29 11:09 ` Felipe Balbi
2013-07-29 11:15 ` Sourav Poddar
2013-07-29 11:15 ` Sourav Poddar
2013-07-29 12:35 ` Felipe Balbi
2013-07-29 12:35 ` Felipe Balbi
2013-07-30 7:34 ` Sourav Poddar
2013-07-30 7:34 ` Sourav Poddar
2013-07-30 7:38 ` Felipe Balbi [this message]
2013-07-30 7:38 ` Felipe Balbi
2013-07-29 7:22 ` [RFC/PATCH 2/2] driver: spi: Add quad spi read support Sourav Poddar
2013-07-29 7:22 ` Sourav Poddar
2013-07-29 9:32 ` Felipe Balbi
2013-07-29 9:32 ` Felipe Balbi
2013-07-29 9:43 ` Sourav Poddar
2013-07-29 9:43 ` Sourav Poddar
2013-07-29 9:59 ` Felipe Balbi
2013-07-29 9:59 ` Felipe Balbi
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=20130730073821.GF16441@radagast \
--to=balbi@ti.com \
--cc=broonie@kernel.org \
--cc=grant.likely@linaro.org \
--cc=linux-omap@vger.kernel.org \
--cc=rnayak@ti.com \
--cc=sourav.poddar@ti.com \
--cc=spi-devel-general@lists.sourceforge.net \
/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.