aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-08 19:40:19 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-08 19:40:19 -0400
commite5ab9f1863e59ebb267eebf08a714647484f55a5 (patch)
tree56b619c66771de31e564ba1598a747407f70dfb5
parent8c68e84f3a0361bf6053a055643a6ff18c7d86d4 (diff)
parent58b1d7999e15e61f314c2ff746ffb9dd8e07eba6 (diff)
Merge tag 'for-usb-next-2012-04-08' of git://git.kernel.org/pub/scm/linux/kernel/git/sarah/xhci into usb-next
Sarah writes: xHCI misc cleanup patches for 3.10 Hi Greg, Here's three cleanup patches for 3.10. Nothing big here, just some debugging output changes, a macro rename, and a math macro change that should have no behavioral effects. Tested on the Intel Panther Point xHCI host, with USB storage and mouse, with xHCI debugging turned on. I don't have the TI host that causes the debugging output changes to trigger. Sarah Sharp
-rw-r--r--drivers/usb/host/xhci-mem.c16
-rw-r--r--drivers/usb/host/xhci.c14
-rw-r--r--drivers/usb/host/xhci.h4
3 files changed, 19 insertions, 15 deletions
diff --git a/drivers/usb/host/xhci-mem.c b/drivers/usb/host/xhci-mem.c
index 6dc238c592bc..965b539bc474 100644
--- a/drivers/usb/host/xhci-mem.c
+++ b/drivers/usb/host/xhci-mem.c
@@ -51,7 +51,7 @@ static struct xhci_segment *xhci_segment_alloc(struct xhci_hcd *xhci,
51 return NULL; 51 return NULL;
52 } 52 }
53 53
54 memset(seg->trbs, 0, SEGMENT_SIZE); 54 memset(seg->trbs, 0, TRB_SEGMENT_SIZE);
55 /* If the cycle state is 0, set the cycle bit to 1 for all the TRBs */ 55 /* If the cycle state is 0, set the cycle bit to 1 for all the TRBs */
56 if (cycle_state == 0) { 56 if (cycle_state == 0) {
57 for (i = 0; i < TRBS_PER_SEGMENT; i++) 57 for (i = 0; i < TRBS_PER_SEGMENT; i++)
@@ -467,7 +467,7 @@ struct xhci_ring *xhci_dma_to_transfer_ring(
467{ 467{
468 if (ep->ep_state & EP_HAS_STREAMS) 468 if (ep->ep_state & EP_HAS_STREAMS)
469 return radix_tree_lookup(&ep->stream_info->trb_address_map, 469 return radix_tree_lookup(&ep->stream_info->trb_address_map,
470 address >> SEGMENT_SHIFT); 470 address >> TRB_SEGMENT_SHIFT);
471 return ep->ring; 471 return ep->ring;
472} 472}
473 473
@@ -478,7 +478,7 @@ static struct xhci_ring *dma_to_stream_ring(
478 u64 address) 478 u64 address)
479{ 479{
480 return radix_tree_lookup(&stream_info->trb_address_map, 480 return radix_tree_lookup(&stream_info->trb_address_map,
481 address >> SEGMENT_SHIFT); 481 address >> TRB_SEGMENT_SHIFT);
482} 482}
483#endif /* CONFIG_USB_XHCI_HCD_DEBUGGING */ 483#endif /* CONFIG_USB_XHCI_HCD_DEBUGGING */
484 484
@@ -514,7 +514,7 @@ static int xhci_test_radix_tree(struct xhci_hcd *xhci,
514 514
515 cur_ring = stream_info->stream_rings[cur_stream]; 515 cur_ring = stream_info->stream_rings[cur_stream];
516 for (addr = cur_ring->first_seg->dma; 516 for (addr = cur_ring->first_seg->dma;
517 addr < cur_ring->first_seg->dma + SEGMENT_SIZE; 517 addr < cur_ring->first_seg->dma + TRB_SEGMENT_SIZE;
518 addr += trb_size) { 518 addr += trb_size) {
519 mapped_ring = dma_to_stream_ring(stream_info, addr); 519 mapped_ring = dma_to_stream_ring(stream_info, addr);
520 if (cur_ring != mapped_ring) { 520 if (cur_ring != mapped_ring) {
@@ -662,7 +662,7 @@ struct xhci_stream_info *xhci_alloc_stream_info(struct xhci_hcd *xhci,
662 cur_stream, (unsigned long long) addr); 662 cur_stream, (unsigned long long) addr);
663 663
664 key = (unsigned long) 664 key = (unsigned long)
665 (cur_ring->first_seg->dma >> SEGMENT_SHIFT); 665 (cur_ring->first_seg->dma >> TRB_SEGMENT_SHIFT);
666 ret = radix_tree_insert(&stream_info->trb_address_map, 666 ret = radix_tree_insert(&stream_info->trb_address_map,
667 key, cur_ring); 667 key, cur_ring);
668 if (ret) { 668 if (ret) {
@@ -693,7 +693,7 @@ cleanup_rings:
693 if (cur_ring) { 693 if (cur_ring) {
694 addr = cur_ring->first_seg->dma; 694 addr = cur_ring->first_seg->dma;
695 radix_tree_delete(&stream_info->trb_address_map, 695 radix_tree_delete(&stream_info->trb_address_map,
696 addr >> SEGMENT_SHIFT); 696 addr >> TRB_SEGMENT_SHIFT);
697 xhci_ring_free(xhci, cur_ring); 697 xhci_ring_free(xhci, cur_ring);
698 stream_info->stream_rings[cur_stream] = NULL; 698 stream_info->stream_rings[cur_stream] = NULL;
699 } 699 }
@@ -764,7 +764,7 @@ void xhci_free_stream_info(struct xhci_hcd *xhci,
764 if (cur_ring) { 764 if (cur_ring) {
765 addr = cur_ring->first_seg->dma; 765 addr = cur_ring->first_seg->dma;
766 radix_tree_delete(&stream_info->trb_address_map, 766 radix_tree_delete(&stream_info->trb_address_map,
767 addr >> SEGMENT_SHIFT); 767 addr >> TRB_SEGMENT_SHIFT);
768 xhci_ring_free(xhci, cur_ring); 768 xhci_ring_free(xhci, cur_ring);
769 stream_info->stream_rings[cur_stream] = NULL; 769 stream_info->stream_rings[cur_stream] = NULL;
770 } 770 }
@@ -2305,7 +2305,7 @@ int xhci_mem_init(struct xhci_hcd *xhci, gfp_t flags)
2305 * so we pick the greater alignment need. 2305 * so we pick the greater alignment need.
2306 */ 2306 */
2307 xhci->segment_pool = dma_pool_create("xHCI ring segments", dev, 2307 xhci->segment_pool = dma_pool_create("xHCI ring segments", dev,
2308 SEGMENT_SIZE, 64, xhci->page_size); 2308 TRB_SEGMENT_SIZE, 64, xhci->page_size);
2309 2309
2310 /* See Table 46 and Note on Figure 55 */ 2310 /* See Table 46 and Note on Figure 55 */
2311 xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev, 2311 xhci->device_pool = dma_pool_create("xHCI input/output contexts", dev,
diff --git a/drivers/usb/host/xhci.c b/drivers/usb/host/xhci.c
index 5156b720a53a..b4aa79d154b2 100644
--- a/drivers/usb/host/xhci.c
+++ b/drivers/usb/host/xhci.c
@@ -417,9 +417,9 @@ static void compliance_mode_recovery(unsigned long arg)
417 * Compliance Mode Detected. Letting USB Core 417 * Compliance Mode Detected. Letting USB Core
418 * handle the Warm Reset 418 * handle the Warm Reset
419 */ 419 */
420 xhci_dbg(xhci, "Compliance Mode Detected->Port %d!\n", 420 xhci_dbg(xhci, "Compliance mode detected->port %d\n",
421 i + 1); 421 i + 1);
422 xhci_dbg(xhci, "Attempting Recovery routine!\n"); 422 xhci_dbg(xhci, "Attempting compliance mode recovery\n");
423 hcd = xhci->shared_hcd; 423 hcd = xhci->shared_hcd;
424 424
425 if (hcd->state == HC_STATE_SUSPENDED) 425 if (hcd->state == HC_STATE_SUSPENDED)
@@ -457,7 +457,7 @@ static void compliance_mode_recovery_timer_init(struct xhci_hcd *xhci)
457 set_timer_slack(&xhci->comp_mode_recovery_timer, 457 set_timer_slack(&xhci->comp_mode_recovery_timer,
458 msecs_to_jiffies(COMP_MODE_RCVRY_MSECS)); 458 msecs_to_jiffies(COMP_MODE_RCVRY_MSECS));
459 add_timer(&xhci->comp_mode_recovery_timer); 459 add_timer(&xhci->comp_mode_recovery_timer);
460 xhci_dbg(xhci, "Compliance Mode Recovery Timer Initialized.\n"); 460 xhci_dbg(xhci, "Compliance mode recovery timer initialized\n");
461} 461}
462 462
463/* 463/*
@@ -733,8 +733,11 @@ void xhci_stop(struct usb_hcd *hcd)
733 733
734 /* Deleting Compliance Mode Recovery Timer */ 734 /* Deleting Compliance Mode Recovery Timer */
735 if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && 735 if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) &&
736 (!(xhci_all_ports_seen_u0(xhci)))) 736 (!(xhci_all_ports_seen_u0(xhci)))) {
737 del_timer_sync(&xhci->comp_mode_recovery_timer); 737 del_timer_sync(&xhci->comp_mode_recovery_timer);
738 xhci_dbg(xhci, "%s: compliance mode recovery timer deleted\n",
739 __func__);
740 }
738 741
739 if (xhci->quirks & XHCI_AMD_PLL_FIX) 742 if (xhci->quirks & XHCI_AMD_PLL_FIX)
740 usb_amd_dev_put(); 743 usb_amd_dev_put();
@@ -930,7 +933,8 @@ int xhci_suspend(struct xhci_hcd *xhci)
930 if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) && 933 if ((xhci->quirks & XHCI_COMP_MODE_QUIRK) &&
931 (!(xhci_all_ports_seen_u0(xhci)))) { 934 (!(xhci_all_ports_seen_u0(xhci)))) {
932 del_timer_sync(&xhci->comp_mode_recovery_timer); 935 del_timer_sync(&xhci->comp_mode_recovery_timer);
933 xhci_dbg(xhci, "Compliance Mode Recovery Timer Deleted!\n"); 936 xhci_dbg(xhci, "%s: compliance mode recovery timer deleted\n",
937 __func__);
934 } 938 }
935 939
936 /* step 5: remove core well power */ 940 /* step 5: remove core well power */
diff --git a/drivers/usb/host/xhci.h b/drivers/usb/host/xhci.h
index 63582719e0fb..29c978e37135 100644
--- a/drivers/usb/host/xhci.h
+++ b/drivers/usb/host/xhci.h
@@ -1238,8 +1238,8 @@ union xhci_trb {
1238#define TRBS_PER_SEGMENT 64 1238#define TRBS_PER_SEGMENT 64
1239/* Allow two commands + a link TRB, along with any reserved command TRBs */ 1239/* Allow two commands + a link TRB, along with any reserved command TRBs */
1240#define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3) 1240#define MAX_RSVD_CMD_TRBS (TRBS_PER_SEGMENT - 3)
1241#define SEGMENT_SIZE (TRBS_PER_SEGMENT*16) 1241#define TRB_SEGMENT_SIZE (TRBS_PER_SEGMENT*16)
1242#define SEGMENT_SHIFT (__ffs(SEGMENT_SIZE)) 1242#define TRB_SEGMENT_SHIFT (ilog2(TRB_SEGMENT_SIZE))
1243/* TRB buffer pointers can't cross 64KB boundaries */ 1243/* TRB buffer pointers can't cross 64KB boundaries */
1244#define TRB_MAX_BUFF_SHIFT 16 1244#define TRB_MAX_BUFF_SHIFT 16
1245#define TRB_MAX_BUFF_SIZE (1 << TRB_MAX_BUFF_SHIFT) 1245#define TRB_MAX_BUFF_SIZE (1 << TRB_MAX_BUFF_SHIFT)