From: "Ji-Ze Hong (Peter Hong)" <hpeter@gmail.com>
To: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com>
Cc: "Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
jslaby@suse.com, "Alan Cox" <alan@linux.intel.com>,
"Peter Hurley" <peter@hurleysoftware.com>,
"PA20 TOM TSAI 蔡宗佑" <tom_tsai@fintek.com.tw>,
"Peter H" <peter_hong@fintek.com.tw>,
linux-serial@vger.kernel.org, LKML <linux-kernel@vger.kernel.org>,
"Ji-Ze Hong (Peter Hong)" <hpeter+linux_kernel@gmail.com>
Subject: Re: [PATCH] serial: 8250_fintek: fix the mismatched IRQ mode
Date: Tue, 28 Jun 2016 08:51:38 +0800 [thread overview]
Message-ID: <430c447a-bf8f-6268-9d55-e29ada539ea2@gmail.com> (raw)
In-Reply-To: <CAPybu_2BM-Nm02Y6xv-jg0MMaNGuEgmG6=5S3OO3KuwDUPmHMg@mail.gmail.com>
Hi Ricardo & Greg,
Ricardo Ribalda Delgado 於 2016/6/27 下午 06:25 寫道:
> Hi Peter,. Hi Greg
> On Fri, May 27, 2016 at 4:02 AM, Ji-Ze Hong (Peter Hong)
>> + struct irq_data *irq_data = irq_get_irq_data(uart->port.irq);
>> + bool level_mode = irqd_is_level_type(irq_data);
>
> I see a potential problem with this patch:
>
> If irq_get_irq_data fails, it will return NULL, resulting on a
> segmentation fault on irqd_is_level_type:
>
> #define __irqd_to_state(d) ACCESS_PRIVATE((d)->common, state_use_accessors)
>
>
> I believe that we need to add error checks here
I'll try to send a patch to add more checks.
>> - return 0;
>> + return fintek_8250_set_irq_mode(pdata, level_mode);
>
> Also why do not call irq_get_irq_data() and irqd_is_level_type()
> before return? There is no need to do that work if the probe
> determines that it is not a fintek chip.
>
Also determine the IRQ mode when found a fintek chip.
Thanks to point out the potential issue.
--
With Best Regards,
Peter Hung
prev parent reply other threads:[~2016-06-28 0:51 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-27 2:02 [PATCH] serial: 8250_fintek: fix the mismatched IRQ mode Ji-Ze Hong (Peter Hong)
2016-06-27 10:25 ` Ricardo Ribalda Delgado
2016-06-28 0:51 ` Ji-Ze Hong (Peter Hong) [this message]
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=430c447a-bf8f-6268-9d55-e29ada539ea2@gmail.com \
--to=hpeter@gmail.com \
--cc=alan@linux.intel.com \
--cc=gregkh@linuxfoundation.org \
--cc=hpeter+linux_kernel@gmail.com \
--cc=jslaby@suse.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=peter@hurleysoftware.com \
--cc=peter_hong@fintek.com.tw \
--cc=ricardo.ribalda@gmail.com \
--cc=tom_tsai@fintek.com.tw \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).