Re: [PATCH 3/5] usb/dummy_hcd: add sg support

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 9 Jan 2012, Sebastian Andrzej Siewior wrote:

> On 01/09/2012 04:50 PM, Alan Stern wrote:
> > On Mon, 9 Jan 2012, Sebastian Andrzej Siewior wrote:
> >
> >> This patch adds sg support to dummy_hcd. It seems that uas is not able
> >> to work with a hcd which does not support sg only based transfers.
> >
> > Sometimes it helps to take a second look at things...
> >
> >> +	BUG_ON(!sg_miter_next(miter));
> > ...
> >> +		BUG_ON(!sg_miter_next(miter));
> >
> > BUG_ON is often a very bad idea.  It will hang the system if it ever
> > triggers in interrupt context.  Basically, BUG_ON should be used only
> > in situations where things are messed up so badly that crashing is
> > better than continuing execution.
> 
> This should not happen at all. It happened during testing while I
> forgot to advance the counter. If it happens again during testing, I'm
> fine with it because helps catching bugs early.
> You want them out? I actually have no idea how to recover except to
> give up the transfer.

WARN_ON would be okay, and fail the transfer.  Or just remove the tests 
entirely; that wouldn't be any worse than having them fire.  As you 
say, they should never happen.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux