]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - android-sdk/kernel-video.git/commitdiff
Merge tag 'v3.8.2' into connectivity-linux-3.8.y
authorFelipe Balbi <balbi@ti.com>
Tue, 5 Mar 2013 14:00:56 +0000 (16:00 +0200)
committerFelipe Balbi <balbi@ti.com>
Tue, 5 Mar 2013 14:00:56 +0000 (16:00 +0200)
This is the 3.8.2 stable release

* tag 'v3.8.2': (79 commits)
  Linux 3.8.2
  xfs: xfs_bmap_add_attrfork_local is too generic
  efivarfs: guid part of filenames are case-insensitive
  efivarfs: Validate filenames much more aggressively
  ACPI: Overriding ACPI tables via initrd only works with an initrd and on X86
  x86, efi: Allow slash in file path of initrd
  usb hid quirks for Masterkit MA901 usb radio
  ahci: Add Device IDs for Intel Wellsburg PCH
  ahci: AHCI-mode SATA patch for Intel Avoton DeviceIDs
  ata_piix: Add Device IDs for Intel Wellsburg PCH
  ata_piix: IDE-mode SATA patch for Intel Avoton DeviceIDs
  staging: comedi: check s->async for poll(), read() and write()
  ACPI: Add DMI entry for Sony VGN-FW41E_H
  ab8500_btemp: Demote initcall sequence
  ab8500-chargalg: Only root should have write permission on sysfs file
  bq27x00_battery: Fix bugs introduced with BQ27425 support
  cgroup: fix exit() vs rmdir() race
  cpuset: fix cpuset_print_task_mems_allowed() vs rename() race
  pstore: Avoid deadlock in panic and emergency-restart path
  workqueue: consider work function when searching for busy work items
  ...

1  2 
drivers/usb/dwc3/gadget.c
mm/mmap.c

index 929b50c9b167afb2f217c014093f7eb0a78c944e,09835b667ae04b4184f0cf7f855572bbc1732553..cb47bf2f929a842c73809e59b4ccff43c20539a2
@@@ -754,21 -754,18 +754,18 @@@ static void dwc3_prepare_one_trb(struc
        struct dwc3             *dwc = dep->dwc;
        struct dwc3_trb         *trb;
  
-       unsigned int            cur_slot;
        dev_vdbg(dwc->dev, "%s: req %p dma %08llx length %d%s%s\n",
                        dep->name, req, (unsigned long long) dma,
                        length, last ? " last" : "",
                        chain ? " chain" : "");
  
-       trb = &dep->trb_pool[dep->free_slot & DWC3_TRB_MASK];
-       cur_slot = dep->free_slot;
-       dep->free_slot++;
        /* Skip the LINK-TRB on ISOC */
-       if (((cur_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
+       if (((dep->free_slot & DWC3_TRB_MASK) == DWC3_TRB_NUM - 1) &&
                        usb_endpoint_xfer_isoc(dep->endpoint.desc))
-               return;
+               dep->free_slot++;
+       trb = &dep->trb_pool[dep->free_slot & DWC3_TRB_MASK];
+       dep->free_slot++;
  
        if (!req->trb) {
                dwc3_gadget_move_request_queued(req);
@@@ -1091,7 -1088,10 +1088,10 @@@ static int __dwc3_gadget_ep_queue(struc
                 * notion of current microframe.
                 */
                if (usb_endpoint_xfer_isoc(dep->endpoint.desc)) {
-                       dwc3_stop_active_transfer(dwc, dep->number);
+                       if (list_empty(&dep->req_queued)) {
+                               dwc3_stop_active_transfer(dwc, dep->number);
+                               dep->flags = DWC3_EP_ENABLED;
+                       }
                        return 0;
                }
  
                                        dep->name);
        }
  
-       /*
-        * 3. Missed ISOC Handling. We need to start isoc transfer on the saved
-        * uframe number.
-        */
-       if (usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
-               (dep->flags & DWC3_EP_MISSED_ISOC)) {
-                       __dwc3_gadget_start_isoc(dwc, dep, dep->current_uf);
-                       dep->flags &= ~DWC3_EP_MISSED_ISOC;
-       }
        return 0;
  }
  
@@@ -1689,14 -1679,29 +1679,29 @@@ static int dwc3_cleanup_done_reqs(struc
                                if (trb_status == DWC3_TRBSTS_MISSED_ISOC) {
                                        dev_dbg(dwc->dev, "incomplete IN transfer %s\n",
                                                        dep->name);
-                                       dep->current_uf = event->parameters &
-                                               ~(dep->interval - 1);
+                                       /*
+                                        * If missed isoc occurred and there is
+                                        * no request queued then issue END
+                                        * TRANSFER, so that core generates
+                                        * next xfernotready and we will issue
+                                        * a fresh START TRANSFER.
+                                        * If there are still queued request
+                                        * then wait, do not issue either END
+                                        * or UPDATE TRANSFER, just attach next
+                                        * request in request_list during
+                                        * giveback.If any future queued request
+                                        * is successfully transferred then we
+                                        * will issue UPDATE TRANSFER for all
+                                        * request in the request_list.
+                                        */
                                        dep->flags |= DWC3_EP_MISSED_ISOC;
                                } else {
                                        dev_err(dwc->dev, "incomplete IN transfer %s\n",
                                                        dep->name);
                                        status = -ECONNRESET;
                                }
+                       } else {
+                               dep->flags &= ~DWC3_EP_MISSED_ISOC;
                        }
                } else {
                        if (count && (event->status & DEPEVT_STATUS_SHORT))
                        break;
        } while (1);
  
+       if (usb_endpoint_xfer_isoc(dep->endpoint.desc) &&
+                       list_empty(&dep->req_queued)) {
+               if (list_empty(&dep->request_list)) {
+                       /*
+                        * If there is no entry in request list then do
+                        * not issue END TRANSFER now. Just set PENDING
+                        * flag, so that END TRANSFER is issued when an
+                        * entry is added into request list.
+                        */
+                       dep->flags = DWC3_EP_PENDING_REQUEST;
+               } else {
+                       dwc3_stop_active_transfer(dwc, dep->number);
+                       dep->flags = DWC3_EP_ENABLED;
+               }
+               return 1;
+       }
        if ((event->status & DEPEVT_STATUS_IOC) &&
                        (trb->ctrl & DWC3_TRB_CTRL_IOC))
                return 0;
@@@ -2101,6 -2123,7 +2123,6 @@@ static void dwc3_gadget_phy_suspend(str
  
  static void dwc3_gadget_conndone_interrupt(struct dwc3 *dwc)
  {
 -      struct dwc3_gadget_ep_cmd_params params;
        struct dwc3_ep          *dep;
        int                     ret;
        u32                     reg;
  
        dev_vdbg(dwc->dev, "%s\n", __func__);
  
 -      memset(&params, 0x00, sizeof(params));
 -
        reg = dwc3_readl(dwc->regs, DWC3_DSTS);
        speed = reg & DWC3_DSTS_CONNECTSPD;
        dwc->speed = speed;
                break;
        }
  
+       /* Enable USB2 LPM Capability */
+       if ((dwc->revision > DWC3_REVISION_194A)
+                       && (speed != DWC3_DCFG_SUPERSPEED)) {
+               reg = dwc3_readl(dwc->regs, DWC3_DCFG);
+               reg |= DWC3_DCFG_LPM_CAP;
+               dwc3_writel(dwc->regs, DWC3_DCFG, reg);
+               reg = dwc3_readl(dwc->regs, DWC3_DCTL);
+               reg &= ~(DWC3_DCTL_HIRD_THRES_MASK | DWC3_DCTL_L1_HIBER_EN);
+               /*
+                * TODO: This should be configurable. For now using
+                * maximum allowed HIRD threshold value of 0b1100
+                */
+               reg |= DWC3_DCTL_HIRD_THRES(12);
+               dwc3_writel(dwc->regs, DWC3_DCTL, reg);
+       }
        /* Recent versions support automatic phy suspend and don't need this */
        if (dwc->revision < DWC3_REVISION_194A) {
                /* Suspend unneeded PHY */
@@@ -2460,20 -2505,8 +2502,8 @@@ int dwc3_gadget_init(struct dwc3 *dwc
                        DWC3_DEVTEN_DISCONNEVTEN);
        dwc3_writel(dwc->regs, DWC3_DEVTEN, reg);
  
-       /* Enable USB2 LPM and automatic phy suspend only on recent versions */
+       /* automatic phy suspend only on recent versions */
        if (dwc->revision >= DWC3_REVISION_194A) {
-               reg = dwc3_readl(dwc->regs, DWC3_DCFG);
-               reg |= DWC3_DCFG_LPM_CAP;
-               dwc3_writel(dwc->regs, DWC3_DCFG, reg);
-               reg = dwc3_readl(dwc->regs, DWC3_DCTL);
-               reg &= ~(DWC3_DCTL_HIRD_THRES_MASK | DWC3_DCTL_L1_HIBER_EN);
-               /* TODO: This should be configurable */
-               reg |= DWC3_DCTL_HIRD_THRES(28);
-               dwc3_writel(dwc->regs, DWC3_DCTL, reg);
                dwc3_gadget_usb2_phy_suspend(dwc, false);
                dwc3_gadget_usb3_phy_suspend(dwc, false);
        }
diff --combined mm/mmap.c
index e262710ae2484ee943784d285350ace3e394b679,8832b879c6b8d7e468cfcc1ea444c2874495ba8c..23caaa3ae33a63636bc20c09b62827fd7299319d
+++ b/mm/mmap.c
@@@ -2169,9 -2169,28 +2169,28 @@@ int expand_downwards(struct vm_area_str
        return error;
  }
  
+ /*
+  * Note how expand_stack() refuses to expand the stack all the way to
+  * abut the next virtual mapping, *unless* that mapping itself is also
+  * a stack mapping. We want to leave room for a guard page, after all
+  * (the guard page itself is not added here, that is done by the
+  * actual page faulting logic)
+  *
+  * This matches the behavior of the guard page logic (see mm/memory.c:
+  * check_stack_guard_page()), which only allows the guard page to be
+  * removed under these circumstances.
+  */
  #ifdef CONFIG_STACK_GROWSUP
  int expand_stack(struct vm_area_struct *vma, unsigned long address)
  {
+       struct vm_area_struct *next;
+       address &= PAGE_MASK;
+       next = vma->vm_next;
+       if (next && next->vm_start == address + PAGE_SIZE) {
+               if (!(next->vm_flags & VM_GROWSUP))
+                       return -ENOMEM;
+       }
        return expand_upwards(vma, address);
  }
  
@@@ -2194,6 -2213,14 +2213,14 @@@ find_extend_vma(struct mm_struct *mm, u
  #else
  int expand_stack(struct vm_area_struct *vma, unsigned long address)
  {
+       struct vm_area_struct *prev;
+       address &= PAGE_MASK;
+       prev = vma->vm_prev;
+       if (prev && prev->vm_end == address) {
+               if (!(prev->vm_flags & VM_GROWSDOWN))
+                       return -ENOMEM;
+       }
        return expand_downwards(vma, address);
  }
  
@@@ -2262,7 -2289,7 +2289,7 @@@ static void unmap_region(struct mm_stru
        update_hiwater_rss(mm);
        unmap_vmas(&tlb, vma, start, end);
        free_pgtables(&tlb, vma, prev ? prev->vm_end : FIRST_USER_ADDRESS,
 -                               next ? next->vm_start : 0);
 +                               next ? next->vm_start : USER_PGTABLES_CEILING);
        tlb_finish_mmu(&tlb, start, end);
  }
  
@@@ -2640,7 -2667,7 +2667,7 @@@ void exit_mmap(struct mm_struct *mm
        /* Use -1 here to ensure all VMAs in the mm are unmapped */
        unmap_vmas(&tlb, vma, 0, -1);
  
 -      free_pgtables(&tlb, vma, FIRST_USER_ADDRESS, 0);
 +      free_pgtables(&tlb, vma, FIRST_USER_ADDRESS, USER_PGTABLES_CEILING);
        tlb_finish_mmu(&tlb, 0, -1);
  
        /*