From: "Samuel Iglesias Gonsálvez" <siglesias@igalia.com>
To: Federico Vaga <federico.vaga@cern.ch>
Cc: Jens Taprogge <jens.taprogge@taprogge.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
industrypack-devel@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ipoctal: clear break interrupt as soon as it occurs
Date: Mon, 01 Sep 2014 14:42:05 +0200 [thread overview]
Message-ID: <1409575325.8116.0.camel@fourier> (raw)
In-Reply-To: <1409572196-15015-1-git-send-email-federico.vaga@cern.ch>
[-- Attachment #1: Type: text/plain, Size: 1897 bytes --]
On Mon, 2014-09-01 at 13:49 +0200, Federico Vaga wrote:
> In some condition we receive the break interrupt but nothing is putted
> in the Rx FIFO and the correspondend bit in the status register is not
> set. Thus, no-one clear the interrupt and the handler will be called
> forever.
>
> This patch clear the break interrupt as soon as it occurs. Then, if the
> break character '\0' is putted in the fifo we will manage it.
>
> We can also unmask the Break interrupt but its bit in ISR is still set
> on break. So I think is better to keep the registers clean.
>
> Signed-off-by: Federico Vaga <federico.vaga@cern.ch>
> ---
> drivers/ipack/devices/ipoctal.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/ipack/devices/ipoctal.c b/drivers/ipack/devices/ipoctal.c
> index e41bef0..90b96a1b 100644
> --- a/drivers/ipack/devices/ipoctal.c
> +++ b/drivers/ipack/devices/ipoctal.c
> @@ -151,7 +151,6 @@ static void ipoctal_irq_rx(struct ipoctal_channel *channel, u8 sr)
> flag = TTY_FRAME;
> }
> if (sr & SR_RECEIVED_BREAK) {
> - iowrite8(CR_CMD_RESET_BREAK_CHANGE, &channel->regs->w.cr);
> channel->stats.rcv_break++;
> flag = TTY_BREAK;
> }
> @@ -196,6 +195,9 @@ static void ipoctal_irq_channel(struct ipoctal_channel *channel)
> isr = ioread8(&channel->block_regs->r.isr);
> sr = ioread8(&channel->regs->r.sr);
>
> + if (isr & (IMR_DELTA_BREAK_A | IMR_DELTA_BREAK_B))
> + iowrite8(CR_CMD_RESET_BREAK_CHANGE, &channel->regs->w.cr);
> +
> if ((sr & SR_TX_EMPTY) && (channel->nb_bytes == 0)) {
> iowrite8(CR_DISABLE_TX, &channel->regs->w.cr);
> /* In case of RS-485, change from TX to RX when finishing TX.
Acked-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Thanks for the patch!
Greg, Would you mind picking this patch through your char-misc tree?
Sam
[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
prev parent reply other threads:[~2014-09-01 12:42 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-01 11:49 [PATCH] ipoctal: clear break interrupt as soon as it occurs Federico Vaga
2014-09-01 12:42 ` Samuel Iglesias Gonsálvez [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=1409575325.8116.0.camel@fourier \
--to=siglesias@igalia.com \
--cc=federico.vaga@cern.ch \
--cc=gregkh@linuxfoundation.org \
--cc=industrypack-devel@lists.sourceforge.net \
--cc=jens.taprogge@taprogge.org \
--cc=linux-kernel@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox