* [PATCH 4/4] staging:iio:adc:ad7280a: Use GFP_ATOMIC in interrupt handler
@ 2018-06-28 23:49 Karim Eshapa
2018-06-29 7:45 ` Dan Carpenter
0 siblings, 1 reply; 3+ messages in thread
From: Karim Eshapa @ 2018-06-28 23:49 UTC (permalink / raw)
To: lars
Cc: Michael.Hennerich, jic23, knaack.h, pmeerw, gregkh, linux-iio,
devel, linux-kernel, Karim Eshapa
Use GFP_ATOMIC rather GFP_KERNEL in interrupt handler,
as GFP_KERNEL may sleep according to slab allocator.
Signed-off-by: Karim Eshapa <karim.eshapa@gmail.com>
---
drivers/staging/iio/adc/ad7280a.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/iio/adc/ad7280a.c b/drivers/staging/iio/adc/ad7280a.c
index b736275c10f5..25c4fbc303f7 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -692,7 +692,7 @@ static irqreturn_t ad7280_event_handler(int irq, void *private)
unsigned int *channels;
int i, ret;
- channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_KERNEL);
+ channels = kcalloc(st->scan_cnt, sizeof(*channels), GFP_ATOMIC);
if (!channels)
return IRQ_HANDLED;
--
2.17.1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH 4/4] staging:iio:adc:ad7280a: Use GFP_ATOMIC in interrupt handler
2018-06-28 23:49 [PATCH 4/4] staging:iio:adc:ad7280a: Use GFP_ATOMIC in interrupt handler Karim Eshapa
@ 2018-06-29 7:45 ` Dan Carpenter
2018-06-29 10:12 ` karim eshapa
0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2018-06-29 7:45 UTC (permalink / raw)
To: Karim Eshapa
Cc: lars, devel, Michael.Hennerich, linux-iio, gregkh, linux-kernel,
pmeerw, knaack.h, jic23
On Fri, Jun 29, 2018 at 01:49:28AM +0200, Karim Eshapa wrote:
> Use GFP_ATOMIC rather GFP_KERNEL in interrupt handler,
> as GFP_KERNEL may sleep according to slab allocator.
>
This is a threaded IRQ so it can sleep.
You should always think about the impact of a bug. If this were a bug
it would have showed up in testing right away. Most of my patches are
in error handling and so the impact is zero unless you deliberately try
to inject errors that's why they can go undetected for years.
Also you should always use the Fixes tag to see how the patch was
introduced. I often see bugs where the patch is new and it was
introduced by someone doing major subsystem cleanups and they don't have
the hardware so I know it hasn't been tested. If the patch is a couple
years old and the bug is in the success path which every one tests then
I wonder if I am misreading the code somehow.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH 4/4] staging:iio:adc:ad7280a: Use GFP_ATOMIC in interrupt handler
2018-06-29 7:45 ` Dan Carpenter
@ 2018-06-29 10:12 ` karim eshapa
0 siblings, 0 replies; 3+ messages in thread
From: karim eshapa @ 2018-06-29 10:12 UTC (permalink / raw)
To: Dan Carpenter
Cc: lars, devel, Michael.Hennerich, linux-iio, gregkh, linux-kernel,
Peter Meerwald-Stadler, knaack.h, Jonathan Cameron
[-- Attachment #1: Type: text/plain, Size: 1986 bytes --]
On Fri, 29 Jun 2018 00:45:54 -0700, Dan Carpenter wrote:
>This is a threaded IRQ so it can sleep.
>
>You should always think about the impact of a bug. If this were a bug
>it would have showed up in testing right away. Most of my patches are
>in error handling and so the impact is zero unless you deliberately try
>to inject errors that's why they can go undetected for years.
>
>Also you should always use the Fixes tag to see how the patch was
>introduced. I often see bugs where the patch is new and it was
>introduced by someone doing major subsystem cleanups and they don't have
>the hardware so I know it hasn't been tested. If the patch is a couple
>years old and the bug is in the success path which every one tests then
>I wonder if I am misreading the code somehow.
Thanks Dan for your precious advises, I'm always trying to find
where it may causes a problem or improve performance to make
the code looks good and bug free.
Thanks,
Karim
On 29 June 2018 at 09:45, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> On Fri, Jun 29, 2018 at 01:49:28AM +0200, Karim Eshapa wrote:
> > Use GFP_ATOMIC rather GFP_KERNEL in interrupt handler,
> > as GFP_KERNEL may sleep according to slab allocator.
> >
>
> This is a threaded IRQ so it can sleep.
>
> You should always think about the impact of a bug. If this were a bug
> it would have showed up in testing right away. Most of my patches are
> in error handling and so the impact is zero unless you deliberately try
> to inject errors that's why they can go undetected for years.
>
> Also you should always use the Fixes tag to see how the patch was
> introduced. I often see bugs where the patch is new and it was
> introduced by someone doing major subsystem cleanups and they don't have
> the hardware so I know it hasn't been tested. If the patch is a couple
> years old and the bug is in the success path which every one tests then
> I wonder if I am misreading the code somehow.
>
> regards,
> dan carpenter
>
>
[-- Attachment #2: Type: text/html, Size: 4910 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-06-29 10:12 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-06-28 23:49 [PATCH 4/4] staging:iio:adc:ad7280a: Use GFP_ATOMIC in interrupt handler Karim Eshapa
2018-06-29 7:45 ` Dan Carpenter
2018-06-29 10:12 ` karim eshapa
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox