public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Williams <dcbw@redhat.com>
To: David Miller <davem@davemloft.net>
Cc: hns@goldelico.com, j.dumon@option.com, linux-usb@vger.kernel.org,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	marek.belisko@gmail.com, e.verdonck@option.com
Subject: Re: [PATCH] hso: fix handling of modem port SERIAL_STATE notifications
Date: Mon, 06 Jan 2014 15:39:40 -0600	[thread overview]
Message-ID: <1389044380.15419.4.camel@dcbw.local> (raw)
In-Reply-To: <20140106.163036.1031013112322786.davem@davemloft.net>

On Mon, 2014-01-06 at 16:30 -0500, David Miller wrote:
> From: Dan Williams <dcbw@redhat.com>
> Date: Mon, 06 Jan 2014 10:07:29 -0600
> 
> > The existing serial state notification handling expected older Option
> > devices, having a hardcoded assumption that the Modem port was always
> > USB interface #2.  That isn't true for devices from the past few years.
> > 
> > hso_serial_state_notification is a local cache of a USB Communications
> > Interface Class SERIAL_STATE notification from the device, and the
> > USB CDC specification (section 6.3, table 67 "Class-Specific Notifications")
> > defines wIndex as the USB interface the event applies to.  For hso
> > devices this will always be the Modem port, as the Modem port is the
> > only port which is set up to receive them by the driver.
> > 
> > So instead of always expecting USB interface #2, instead validate the
> > notification with the actual USB interface number of the Modem port.
> > 
> > Signed-off-by: Dan Williams <dcbw@redhat.com>
> > Tested-by: H. Nikolaus Schaller <hns@goldelico.com>
> 
> Applied, although that BUG_ON() is a bit harsh.  It might have been
> cleaner to just dev_warn() ratelimited or similar and return.

If the driver ever gets to that callback for any !Modem port, something
is horribly wrong, which the BUG_ON() was attempting to make explicit.
The driver only enables that callback for the Modem port, so yeah, it's
somewhat defensive.  I'm happy to send a fixup if you like?

Dan



  reply	other threads:[~2014-01-06 21:37 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-02  7:00 [PATCH 1/1] hso: fix problem with wrong status code sent by OPTION GTM601 during RING indication Dr. H. Nikolaus Schaller
2013-10-03 19:29 ` David Miller
2013-10-03 19:40   ` Dr. H. Nikolaus Schaller
2013-10-03 20:00     ` David Miller
2013-10-04  6:22       ` Dr. H. Nikolaus Schaller
2013-12-13 14:43 ` Dr. H. Nikolaus Schaller
2013-12-16 19:40   ` Dan Williams
2013-12-17 19:56     ` Dr. H. Nikolaus Schaller
2013-12-17 22:27       ` Dan Williams
2013-12-18 13:16         ` Dr. H. Nikolaus Schaller
2013-12-18 17:49           ` Dan Williams
2013-12-19  7:48             ` Dr. H. Nikolaus Schaller
2014-01-06 16:07               ` [PATCH] hso: fix handling of modem port SERIAL_STATE notifications Dan Williams
2014-01-06 21:30                 ` David Miller
2014-01-06 21:39                   ` Dan Williams [this message]
2014-01-06 21:39                     ` 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=1389044380.15419.4.camel@dcbw.local \
    --to=dcbw@redhat.com \
    --cc=davem@davemloft.net \
    --cc=e.verdonck@option.com \
    --cc=hns@goldelico.com \
    --cc=j.dumon@option.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=marek.belisko@gmail.com \
    --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