/*
* Definitions for the KLSI KL5KUSB105 serial port adapter
*/
/* vendor/product pairs that are known to contain this chipset */
#define PALMCONNECT_VID 0x0830
#define PALMCONNECT_PID 0x0080
#define KLSI_VID 0x05e9
#define KLSI_KL5KUSB105D_PID 0x00c0
/* Vendor commands: */
/* port table -- the chip supports up to 4 channels */
/* baud rates */
enum {
kl5kusb105a_sio_b115200 = 0,
kl5kusb105a_sio_b57600 = 1,
kl5kusb105a_sio_b38400 = 2,
kl5kusb105a_sio_b19200 = 4,
kl5kusb105a_sio_b14400 = 5,
kl5kusb105a_sio_b9600 = 6,
kl5kusb105a_sio_b4800 = 8, /* unchecked */
kl5kusb105a_sio_b2400 = 9, /* unchecked */
kl5kusb105a_sio_b1200 = 0xa, /* unchecked */
kl5kusb105a_sio_b600 = 0xb /* unchecked */
};
/* data bits */
#define kl5kusb105a_dtb_7 7
#define kl5kusb105a_dtb_8 8
/* requests: */
#define KL5KUSB105A_SIO_SET_DATA 1
#define KL5KUSB105A_SIO_POLL 2
#define KL5KUSB105A_SIO_CONFIGURE 3
/* values used for request KL5KUSB105A_SIO_CONFIGURE */
#define KL5KUSB105A_SIO_CONFIGURE_READ_ON 3
#define KL5KUSB105A_SIO_CONFIGURE_READ_OFF 2
/* Interpretation of modem status lines */
/* These need sorting out by individually connecting pins and checking
* results. FIXME!
* When data is being sent we see 0x30 in the lower byte; this must
* contain DSR and CTS ...
*/
#define KL5KUSB105A_DSR ((1<<4) | (1<<5))
#define KL5KUSB105A_CTS ((1<<5) | (1<<4))
#define KL5KUSB105A_WANTS_TO_SEND 0x30
#if 0
#define KL5KUSB105A_DTR /* Data Terminal Ready */
#define KL5KUSB105A_CTS /* Clear To Send */
#define KL5KUSB105A_CD /* Carrier Detect */
#define KL5KUSB105A_DSR /* Data Set Ready */
#define KL5KUSB105A_RxD /* Receive pin */
#define KL5KUSB105A_LE
#define KL5KUSB105A_RTS
#define KL5KUSB105A_ST
#define KL5KUSB105A_SR
#define KL5KUSB105A_RI /* Ring Indicator */
#endif
/linux/net-next.git/tree/include/uapi/mtd?h=nds-private-remove&id=ae4a3e028bb8b59e7cfeb0cc9ef03d885182ce8b'>treecommitdiff
dmaengine: cppi41: Fix runtime PM timeouts with USB mass storage
Commit fdea2d09b997 ("dmaengine: cppi41: Add basic PM runtime support")
added runtime PM support for cppi41, but had corner case issues. Some of
the issues were fixed with commit 098de42ad670 ("dmaengine: cppi41: Fix
unpaired pm runtime when only a USB hub is connected"). That fix however
caused a new regression where we can get error -115 messages with USB on
BeagleBone when connecting a USB mass storage device to a hub.
This is because when connecting a USB mass storage device to a hub, the
initial DMA transfers can take over 200ms to complete and cppi41
autosuspend delay times out.
To fix the issue, we want to implement refcounting for chan_busy array
that contains the active dma transfers. Increasing the autosuspend delay
won't help as that the delay could be potentially seconds, and it's best
to let the USB subsystem to deal with the timeouts on errors.
The earlier attempt for runtime PM was buggy as the pm_runtime_get/put()
calls could get unpaired easily as they did not follow the state of
the chan_busy array as described in commit 098de42ad670 ("dmaengine:
cppi41: Fix unpaired pm runtime when only a USB hub is connected".
Let's fix the issue by adding pm_runtime_get() to where a new transfer
is added to the chan_busy array, and calls to pm_runtime_put() where
chan_busy array entry is cleared. This prevents any autosuspend timeouts
from happening while dma transfers are active.
Fixes: 098de42ad670 ("dmaengine: cppi41: Fix unpaired pm runtime when
only a USB hub is connected")
Fixes: fdea2d09b997 ("dmaengine: cppi41: Add basic PM runtime support")
Cc: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Bin Liu <b-liu@ti.com>
Cc: Grygorii Strashko <grygorii.strashko@ti.com>
Cc: Kevin Hilman <khilman@baylibre.com>
Cc: Patrick Titiano <ptitiano@baylibre.com>
Cc: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Tested-by: Bin Liu <b-liu@ti.com>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>