xHCI trivial fixes for 3.7
Hi Greg, Here's four trivial xHCI bug fixes for 3.7. They clean up some issues found while running Coverity across the xHCI driver. One is marked for stable. Sarah Sharp -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.11 (GNU/Linux) iQIcBAABAgAGBQJQiZ5JAAoJEBMGWMLi1Gc5UsQQAKcZfrAHPGwT768YthCJNOCM W0ec/n5mVdp6sbXVkDltC2mfJoPrykZlr/hL9Rie9q/i1QFLEW8ig0/LQrPSq9OO 4aE4+n1tDCi4Mdo/ABT6orOhqTo2+5J5dErzFbpzFuZl1vELtZBe+FTKj5D04KlZ NlUyKuqRlVuVLPIt0Wmsbxt6vaQAAe2tNNWlUC/+TG9QQnZpmJi/BKIztF/uTRlZ O3Mk0KtW3rLBUU2lxJR6cq7BxH3d2mL2MCDfSZ7tjciJQID8mtb11Q+9yWx2Xy3N VJ/gCvzAFPAWyFKffeBCE28B/IKtS4hHi/sxBKZvojzP0aFOwUQnTK6Te+VxR+uL 4tF9Z54QP6nONAswSyTPpWvBDHKCBt85P2kD2ynVP95Bh8HzSKofZu25jdQkdBVN 1zZfu2o/xxY+lK6e4BE75mEo33A1y65JqMaZoo/qYxvckRgUOFfK3KVs4WyGmaMN HHVZThFAZ10b0WDCULt2cHCsQmVbWQANR8hDynppMc0IiYv5fUmuRqzrX+PEJCiD CzmTXyDvI5IC4XJIpHHUIFQYHf5VL5A9Rt5dEFCR1mkhnNstJTRqHIFfE8X9fAM8 boo9378k1J3N5HBLrZJ1HkT1/lzBTC+RkkaVVP7zki/lGS+aRxdKoZ6RVs9Upfzb v4SUugrYBxMDrGHeuEGz =4I1Y -----END PGP SIGNATURE----- Merge tag 'for-usb-linus-2012-10-25' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-linus xHCI trivial fixes for 3.7 Hi Greg, Here's four trivial xHCI bug fixes for 3.7. They clean up some issues found while running Coverity across the xHCI driver. One is marked for stable. Sarah Sharp
This commit is contained in:
commit
1d63f24697
@ -544,7 +544,6 @@ void xhci_dbg_ctx(struct xhci_hcd *xhci,
|
||||
int i;
|
||||
/* Fields are 32 bits wide, DMA addresses are in bytes */
|
||||
int field_size = 32 / 8;
|
||||
struct xhci_slot_ctx *slot_ctx;
|
||||
dma_addr_t dma = ctx->dma;
|
||||
int csz = HCC_64BYTE_CONTEXT(xhci->hcc_params);
|
||||
|
||||
@ -570,7 +569,6 @@ void xhci_dbg_ctx(struct xhci_hcd *xhci,
|
||||
dbg_rsvd64(xhci, (u64 *)ctrl_ctx, dma);
|
||||
}
|
||||
|
||||
slot_ctx = xhci_get_slot_ctx(xhci, ctx);
|
||||
xhci_dbg_slot_ctx(xhci, ctx);
|
||||
xhci_dbg_ep_ctx(xhci, ctx, last_ep);
|
||||
}
|
||||
|
@ -1228,6 +1228,17 @@ static void xhci_cmd_to_noop(struct xhci_hcd *xhci, struct xhci_cd *cur_cd)
|
||||
cur_seg = find_trb_seg(xhci->cmd_ring->first_seg,
|
||||
xhci->cmd_ring->dequeue, &cycle_state);
|
||||
|
||||
if (!cur_seg) {
|
||||
xhci_warn(xhci, "Command ring mismatch, dequeue = %p %llx (dma)\n",
|
||||
xhci->cmd_ring->dequeue,
|
||||
(unsigned long long)
|
||||
xhci_trb_virt_to_dma(xhci->cmd_ring->deq_seg,
|
||||
xhci->cmd_ring->dequeue));
|
||||
xhci_debug_ring(xhci, xhci->cmd_ring);
|
||||
xhci_dbg_ring_ptrs(xhci, xhci->cmd_ring);
|
||||
return;
|
||||
}
|
||||
|
||||
/* find the command trb matched by cd from command ring */
|
||||
for (cmd_trb = xhci->cmd_ring->dequeue;
|
||||
cmd_trb != xhci->cmd_ring->enqueue;
|
||||
|
@ -1627,7 +1627,6 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
|
||||
struct xhci_hcd *xhci;
|
||||
struct xhci_container_ctx *in_ctx, *out_ctx;
|
||||
unsigned int ep_index;
|
||||
struct xhci_ep_ctx *ep_ctx;
|
||||
struct xhci_slot_ctx *slot_ctx;
|
||||
struct xhci_input_control_ctx *ctrl_ctx;
|
||||
u32 added_ctxs;
|
||||
@ -1663,7 +1662,6 @@ int xhci_add_endpoint(struct usb_hcd *hcd, struct usb_device *udev,
|
||||
out_ctx = virt_dev->out_ctx;
|
||||
ctrl_ctx = xhci_get_input_control_ctx(xhci, in_ctx);
|
||||
ep_index = xhci_get_endpoint_index(&ep->desc);
|
||||
ep_ctx = xhci_get_ep_ctx(xhci, out_ctx, ep_index);
|
||||
|
||||
/* If this endpoint is already in use, and the upper layers are trying
|
||||
* to add it again without dropping it, reject the addition.
|
||||
@ -1817,6 +1815,8 @@ static int xhci_evaluate_context_result(struct xhci_hcd *xhci,
|
||||
case COMP_EBADSLT:
|
||||
dev_warn(&udev->dev, "WARN: slot not enabled for"
|
||||
"evaluate context command.\n");
|
||||
ret = -EINVAL;
|
||||
break;
|
||||
case COMP_CTX_STATE:
|
||||
dev_warn(&udev->dev, "WARN: invalid context state for "
|
||||
"evaluate context command.\n");
|
||||
|
Loading…
x
Reference in New Issue
Block a user