M7350v2_en_gpl
This commit is contained in:
@ -1218,7 +1218,21 @@ static int usb_suspend_both(struct usb_device *udev, pm_message_t msg)
|
||||
} else {
|
||||
udev->can_submit = 0;
|
||||
for (i = 0; i < 16; ++i) {
|
||||
usb_hcd_flush_endpoint(udev, udev->ep_out[i]);
|
||||
struct urb *urb;
|
||||
struct usb_host_endpoint *ep = udev->ep_out[i];
|
||||
bool hbm_enabled_ep = false;
|
||||
if (ep && !list_empty(&ep->urb_list)) {
|
||||
urb = list_first_entry(&ep->urb_list,
|
||||
struct urb, urb_list);
|
||||
if (urb->priv_data)
|
||||
hbm_enabled_ep = true;
|
||||
}
|
||||
if (hbm_enabled_ep) {
|
||||
pr_info("Not flushing HBM-EP on susp:%p:%p\n",
|
||||
urb, urb->priv_data);
|
||||
} else {
|
||||
usb_hcd_flush_endpoint(udev, udev->ep_out[i]);
|
||||
}
|
||||
usb_hcd_flush_endpoint(udev, udev->ep_in[i]);
|
||||
}
|
||||
}
|
||||
|
@ -53,7 +53,7 @@
|
||||
|
||||
#define MSM_USB_BASE (hcd->regs)
|
||||
#define USB_REG_START_OFFSET 0x90
|
||||
#define USB_REG_END_OFFSET 0x250
|
||||
#define USB_REG_END_OFFSET 0x324
|
||||
|
||||
static struct workqueue_struct *ehci_wq;
|
||||
struct ehci_timer {
|
||||
@ -127,6 +127,9 @@ module_param(ep_addr_rxdbg_mask, uint, S_IRUGO | S_IWUSR);
|
||||
static unsigned int ep_addr_txdbg_mask = 9;
|
||||
module_param(ep_addr_txdbg_mask, uint, S_IRUGO | S_IWUSR);
|
||||
|
||||
static unsigned int dbg_qh_addr;
|
||||
module_param(dbg_qh_addr, uint, S_IRUGO | S_IWUSR);
|
||||
|
||||
/* Maximum debug message length */
|
||||
#define DBG_MSG_LEN 128UL
|
||||
|
||||
@ -318,6 +321,44 @@ static inline struct usb_hcd *hsic_to_hcd(struct msm_hsic_hcd *mehci)
|
||||
return container_of((void *) mehci, struct usb_hcd, hcd_priv);
|
||||
}
|
||||
|
||||
static void dbg_msm_qh(struct ehci_hcd *ehci, struct ehci_qh *qh)
|
||||
{
|
||||
struct ehci_qh_hw *hw = qh->hw;
|
||||
|
||||
pr_info("EP:%x qh %p info %x %x c_qtd-%08x\n",
|
||||
(hw->hw_info1 & 0xF00) >> 8, qh, hw->hw_info1,
|
||||
hw->hw_info2, hw->hw_current);
|
||||
pr_info("overlay n%08x %08x t-%08x nak-%x c_err %x\n",
|
||||
hw->hw_qtd_next, hw->hw_alt_next,
|
||||
hw->hw_token,
|
||||
(hw->hw_alt_next & 0xE)>>1, (hw->hw_token & 0xC00) >> 10);
|
||||
}
|
||||
|
||||
static void dump_msm_qhs(struct usb_hcd *hcd)
|
||||
{
|
||||
struct ehci_hcd *ehci = hcd_to_ehci(hcd);
|
||||
struct ehci_qh *qh, *qh_next;
|
||||
unsigned long flags;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < 5; i++) {
|
||||
pr_info("Dump QHs, iteration:%d\n", i);
|
||||
spin_lock_irqsave(&ehci->lock, flags);
|
||||
qh_next = ehci->async->qh_next.qh;
|
||||
while (qh_next) {
|
||||
qh = qh_next;
|
||||
qh_next = qh->qh_next.qh;
|
||||
|
||||
if (!dbg_qh_addr ||
|
||||
((struct ehci_qh *)dbg_qh_addr) == qh)
|
||||
dbg_msm_qh(ehci, qh);
|
||||
}
|
||||
spin_unlock_irqrestore(&ehci->lock, flags);
|
||||
usleep_range(5000, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
static void dump_hsic_regs(struct usb_hcd *hcd)
|
||||
{
|
||||
int i;
|
||||
@ -1799,6 +1840,27 @@ const struct file_operations ehci_hsic_msm_dbg_ctrl_fops = {
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static int ehci_hsic_msm_qh_show(struct seq_file *s, void *unused)
|
||||
{
|
||||
struct msm_hsic_hcd *mehci = s->private;
|
||||
|
||||
dump_msm_qhs(hsic_to_hcd(mehci));
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int ehci_hsic_msm_qh_open(struct inode *inode, struct file *f)
|
||||
{
|
||||
return single_open(f, ehci_hsic_msm_qh_show, inode->i_private);
|
||||
}
|
||||
|
||||
const struct file_operations ehci_hsic_msm_qh_fops = {
|
||||
.open = ehci_hsic_msm_qh_open,
|
||||
.read = seq_read,
|
||||
.llseek = seq_lseek,
|
||||
.release = single_release,
|
||||
};
|
||||
|
||||
static struct dentry *ehci_hsic_msm_dbg_root;
|
||||
static int ehci_hsic_msm_debugfs_init(struct msm_hsic_hcd *mehci)
|
||||
{
|
||||
@ -1849,6 +1911,16 @@ static int ehci_hsic_msm_debugfs_init(struct msm_hsic_hcd *mehci)
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
ehci_hsic_msm_dentry = debugfs_create_file("show_hsic_qh",
|
||||
S_IRUGO,
|
||||
ehci_hsic_msm_dbg_root, mehci,
|
||||
&ehci_hsic_msm_qh_fops);
|
||||
|
||||
if (!ehci_hsic_msm_dentry) {
|
||||
debugfs_remove_recursive(ehci_hsic_msm_dbg_root);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -170,10 +170,10 @@ int hbm_pipe_init(u32 QH_addr, u32 pipe_num, bool is_consumer)
|
||||
1 << pipe_num, 0);
|
||||
|
||||
/* Reset HBM SideBand */
|
||||
hbm_msm_write_reg_field(hbm_ctx->base, USB_OTG_HS_HBM_SB_SW_RST, 1 << 0,
|
||||
1);
|
||||
hbm_msm_write_reg_field(hbm_ctx->base, USB_OTG_HS_HBM_SB_SW_RST, 1 << 0,
|
||||
0);
|
||||
hbm_msm_write_reg_field(hbm_ctx->base, USB_OTG_HS_HBM_SB_SW_RST,
|
||||
1 << pipe_num, 1);
|
||||
hbm_msm_write_reg_field(hbm_ctx->base, USB_OTG_HS_HBM_SB_SW_RST,
|
||||
1 << pipe_num, 0);
|
||||
|
||||
/* map QH(ep) <> pipe */
|
||||
hbm_msm_write_reg(hbm_ctx->base,
|
||||
@ -230,7 +230,7 @@ static int hbm_submit_async(struct ehci_hcd *ehci, struct urb *urb,
|
||||
{
|
||||
int epnum;
|
||||
unsigned long flags;
|
||||
struct ehci_qh *qh = NULL;
|
||||
struct ehci_qh *qh = (struct ehci_qh *) urb->ep->hcpriv;
|
||||
int rc;
|
||||
struct usb_host_bam_type *bam =
|
||||
(struct usb_host_bam_type *)urb->priv_data;
|
||||
@ -247,6 +247,9 @@ static int hbm_submit_async(struct ehci_hcd *ehci, struct urb *urb,
|
||||
if (unlikely(rc))
|
||||
goto done;
|
||||
|
||||
if (qh != NULL)
|
||||
pr_debug("%s: QH NOT NULL (%p)\n", __func__, qh);
|
||||
|
||||
qh = qh_append_tds(ehci, urb, qtd_list, epnum, &urb->ep->hcpriv);
|
||||
if (unlikely(qh == NULL)) {
|
||||
usb_hcd_unlink_urb_from_ep(ehci_to_hcd(ehci), urb);
|
||||
@ -263,8 +266,10 @@ static int hbm_submit_async(struct ehci_hcd *ehci, struct urb *urb,
|
||||
|
||||
hbm_pipe_init(qh->qh_dma, bam->pipe_num, bam->dir);
|
||||
|
||||
if (likely(qh->qh_state == QH_STATE_IDLE))
|
||||
if (likely(qh->qh_state == QH_STATE_IDLE)) {
|
||||
pr_debug("%s: QH was IDLE (%p)\n", __func__, qh);
|
||||
qh_link_async(ehci, qh);
|
||||
}
|
||||
|
||||
/* Start Async Scheduler */
|
||||
cmd = ehci_readl(ehci, &ehci->regs->command);
|
||||
@ -277,8 +282,13 @@ static int hbm_submit_async(struct ehci_hcd *ehci, struct urb *urb,
|
||||
|
||||
done:
|
||||
spin_unlock_irqrestore(&ehci->lock, flags);
|
||||
|
||||
pr_debug("QH:%p urb:%p <--> pipe:%u ep:%d(out:%u)\n",
|
||||
urb->ep->hcpriv, urb, bam->pipe_num, epnum, bam->dir);
|
||||
|
||||
if (unlikely(qh == NULL))
|
||||
qtd_list_free(ehci, urb, qtd_list);
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user