From: Tilman Schmidt <tilman@imap.cc>
To: Karsten Keil <isdn@linux-pingi.de>, David Miller <davem@davemloft.net>
Cc: Hansjoerg Lipp <hjlipp@web.de>, Karsten Keil <keil@b1-systems.de>,
i4ldeveloper@listserv.isdn4linux.de, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH 7/9] isdn/gigaset: unclog bas_gigaset AT response pipe
Date: Fri, 1 Oct 2010 01:35:31 +0200 (CEST) [thread overview]
Message-ID: <20100930-patch-gigaset-07.tilman@imap.cc> (raw)
In-Reply-To: <20100930-patch-gigaset-00.tilman@imap.cc>
Recover from a lost HD_RECEIVEATDATA_ACK message by sending a
zero-length HD_READ_ATMESSAGE command when ev_layer sends "+++".
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
---
drivers/isdn/gigaset/bas-gigaset.c | 22 ++++++++++++++++++++++
1 files changed, 22 insertions(+), 0 deletions(-)
diff --git a/drivers/isdn/gigaset/bas-gigaset.c b/drivers/isdn/gigaset/bas-gigaset.c
index 7520bc6..540f6d0 100644
--- a/drivers/isdn/gigaset/bas-gigaset.c
+++ b/drivers/isdn/gigaset/bas-gigaset.c
@@ -1896,6 +1896,28 @@ static int gigaset_write_cmd(struct cardstate *cs, struct cmdbuf_t *cb)
* The next command will reopen the AT channel automatically.
*/
if (cb->len == 3 && !memcmp(cb->buf, "+++", 3)) {
+ /* If an HD_RECEIVEATDATA_ACK message remains unhandled
+ * because of an error, the base never sends another one.
+ * The response channel is thus effectively blocked.
+ * Closing and reopening the AT channel does *not* clear
+ * this condition.
+ * As a stopgap measure, submit a zero-length AT read
+ * before closing the AT channel. This has the undocumented
+ * effect of triggering a new HD_RECEIVEATDATA_ACK message
+ * from the base if necessary.
+ * The subsequent AT channel close then discards any pending
+ * messages.
+ */
+ spin_lock_irqsave(&cs->lock, flags);
+ if (!(cs->hw.bas->basstate & BS_ATRDPEND)) {
+ kfree(cs->hw.bas->rcvbuf);
+ cs->hw.bas->rcvbuf = NULL;
+ cs->hw.bas->rcvbuf_size = 0;
+ cs->hw.bas->retry_cmd_in = 0;
+ atread_submit(cs, 0);
+ }
+ spin_unlock_irqrestore(&cs->lock, flags);
+
rc = req_submit(cs->bcs, HD_CLOSE_ATCHANNEL, 0, BAS_TIMEOUT);
if (cb->wake_tasklet)
tasklet_schedule(cb->wake_tasklet);
--
1.7.3.15.g442cb
next prev parent reply other threads:[~2010-10-01 0:31 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-30 23:34 [PATCH 0/9] Gigaset patches for net-next Tilman Schmidt
2010-09-30 23:34 ` [PATCH 1/9] isdn/gigaset: bas_gigaset locking fix Tilman Schmidt
2010-09-30 23:34 ` [PATCH 2/9] isdn/gigaset: fix bas_gigaset AT read error handling Tilman Schmidt
2010-09-30 23:34 ` [PATCH 3/9] isdn/gigaset: correct bas_gigaset rx buffer handling Tilman Schmidt
2010-09-30 23:35 ` [PATCH 4/9] isdn/gigaset: drop obsolete debug option Tilman Schmidt
2010-09-30 23:35 ` [PATCH 5/9] isdn/gigaset: bas_gigaset timer cleanup Tilman Schmidt
2010-09-30 23:35 ` [PATCH 6/9] isdn/gigaset: try USB reset for bas_gigaset error recovery Tilman Schmidt
2010-09-30 23:35 ` Tilman Schmidt [this message]
2010-09-30 23:35 ` [PATCH 8/9] isdn/gigaset: fix bas_gigaset interrupt read error handling Tilman Schmidt
2010-09-30 23:35 ` [PATCH 9/9] isdn/gigaset: improve bas_gigaset USB error reporting Tilman Schmidt
2010-10-01 7:35 ` [PATCH 0/9] Gigaset patches for net-next David Miller
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=20100930-patch-gigaset-07.tilman@imap.cc \
--to=tilman@imap.cc \
--cc=davem@davemloft.net \
--cc=hjlipp@web.de \
--cc=i4ldeveloper@listserv.isdn4linux.de \
--cc=isdn@linux-pingi.de \
--cc=keil@b1-systems.de \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@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;
as well as URLs for NNTP newsgroup(s).