1. 14 Aug, 2015 14 commits
    • Peter Chen's avatar
      usb: chipidea: define stream mode disable for both roles · 8022d3d5
      Peter Chen authored
      The system bus and chipidea IP have different limitations for
      both host and device mode.
      For example, with below errata, we need to enable SDIS(Stream Disable
      Mode) at host mode. But we don't want it for device mode at the
      same system.
      
      TAR 9000378958
      Title: Non-Double Word Aligned Buffer Address Sometimes Causes Host to
      Hang on OUT Retry
      Impacted Configuration: Host mode, all transfer types
      Description:
      The host core operating in streaming mode may under run while sending
      the data packet of an OUT transaction. This under run can occur if
      there are unexpected system delays in fetching the remaining packet
      data from memory. The host forces a bad CRC on the packet, the device
      detects the error and discards the packet. The host then retries a Bulk,
      Interrupt, or Control transfer if an under run occurs according to the
      USB specification. During simulations, it was found that the host does
      not issue the retry of the failed bulk OUT. It does not issue any other
      transactions except SOF packets that have incorrect frame numbers.
      
      The second failure mode occurs if the under run occurs on an ISO OUT
      transaction and the next ISO transaction is a zero byte packet. The host
      does not issue any transactions (including SOFs). The device detects a
      Suspend condition, reverts to full speed, and waits for resume signaling.
      
      A third failure mode occurs when the host under runs on an ISO OUT and
      the next ISO in the schedule is an ISO OUT with two max packets of 1024
      bytes each. The host should issue MDATA for the first OUT followed by
      DATA1 for the second. However, it drops the MDATA transaction, and
      issues the DATA1 transaction.
      
      The system impact of this bug is the same regardless of the failure mode
      observed. The host core hangs, the ehci_ctrl state machine waits for the
      protocol engine to send the completion status for the corrupted
      transaction, which never occurs. No indication is sent to the host
      controller driver, no register bits change and no interrupts occur.
      Eventually the requesting application times out.
      
      Detailed internal behavior:
      The EHCI control state machine (ehci_ctrl) in the DMA block is responsible
      for parsing the schedules and initiating all transactions. The ehci_ctrl
      state machine passes the transaction details to the protocol block by
      writing the transaction information in to the TxFIFO. It then asserts
      the pe_hst_run_pkt signal to inform the host protocol state machine
      (pe_hst_state) that there is a packet in the TxFIFO.
      A tag of 0x0 indicates a start of packet with the data providing the
      following information:
      
      35:32 Tag
      31:30 Reserved
      29:23 Endpoint (lowest 4 bits)
      22:16 Address
      15:10 Reserved
      9:8 Endpoint speed
      7:6 Endpoint type
      5:6 Data Toggle
      3:0 PID
      The pe_hst_state reads the packet information and constructs the packet
      and issues it to the PHY interface.
      The ehci_ctrl state machine writes the start transaction information in
      to the TxFIFO as 0x03002910c for the OUT packet that had the under run
      error. However, it writes 0xC3002910C for the retry of the Out
      transaction, which is incorrect.
      The pe_hst_state enters a bus timeout state after sending the bad CRC
      for the packet that under ran. It then purges any data that was back
      filled in to the TxFIFO for the packet that under ran. The pe_hst_state
      machine stops purging the TxFIFO when it is empty or if it reads a
      location that has a tag of 0x0, indicating a start of packet command.
      
      The pe_hst_state reads 0xC3002910C and discards it as it does not decode
      to a start of packet command. It continues to purge the OUT data that
      has been pre-buffered for the OUT retry . The pe_hst_state detects the
      hst_packet_run signal and attempts to read the PID and address
      information from the TxFIFO. This location has packet data and so does
      not decode to a valid PID and so falls through to the PE_HST_SOF_LOAD
      state where the frame_num_counter is updated. The frame_num_counter
      is updated with the data in the TxFIFO. In this case, the data is
      incorrect as the ehci_ctrl state machine did not initiate the load.
      The hst_pe_state machine detects the SOF request signal and sends an
      SOF with the bad frame number. Meanwhile, the ehci_ctrl state machine
      waits indefinitely in the run_pkt state waiting for the completion
      status from pe_hst_state machine, which will never happen.
      
      The ISO failure case is similar except that there is no retry for ISO.
      The ehci_ctrl state machine moves to the next transfer in the periodic
      schedule. If the under run occurs on the last entry of the periodic
      list then it moves to the Async schedule.
      
      In the case of ISO OUT simulations, the next ISO is a zero byte OUT
      and again the start of packet command gets corrupted. The TxFIFO is
      empty when the hst_pe_state attempts to read the Address and PID
      information as the transaction is a zero byte packet. This results
      in the hst_pe_state machine staying in the GET_PID state, which means
      that it does not issue any transactions (including SOFs). The device
      detects a Suspend condition and reverts to full speed mode and waits
      for a Resume or Reset signal.
      
      The EHCI specification allows a Non-DoubleWord (32 bits) offset to
      be used as a current offset for Buffer Pointer Page 0 of the qTD.
      In Non-DoubleWord aligned cases, the core reads the packet data
      from the AHB memory, performs the alignment operation before writing
      it in to the TxFIFO as a 32 bit data word. An End Of Packet tag (EOP)
      is written to the TxFIFO after all the packet data has been written
      in to the TxFIFO. The alignment function is reset to Idle by the EOP
      tag. The corruption of the start of packet command arises because the
      packet buffer for the OUT transaction that under ran is not aligned
      to a DoubleWord, and hence no EOP tag is written to the TxFIFO. The
      alignment function is still active when the start packet information
      is written in to the TxFIFO for the retry of the bulk packet or for
      the next transaction in the case of an under run on an ISO. This
      results in the corruption of the start tag and the transaction
      information.
      
      Click for waveform showing the command 0x 0000300291 being written in
      to the TX FIFO for the Out that under ran.
      Click for waveform showing the command 0xC3002910C written to the
      TxFIFO instead of 0x 0000300291
      Versions affected: Versions 2.10a and previous versions
      How discovered: Customer simulation
      
      Workaround:
      1- The EHCI specification allows a non-DoubleWord offset to be used
      as a current offset for Buffer Pointer Page 0 of the qTD. However,
      if a DoubleWord offset is used then this issue does not arise.
      2- Use non streaming mode to eliminate under runs.
      
      Resolution:
      The fix involves changes to the traffic state machine in the
      vusb_hs_dma_traf block. The ehci_ctrl state machine updates the context
      information by encoding the transaction results on the
      hst_op_context_update signals at the end of a transaction. The signal
      hst_op_context_update is added to the traffic state machine, and the
      tx_fifo_under_ran_r signal is generated if the transaction results in
      an under run error. Click for waveform
      
      The traffic state machine then traverses to the do_eop states if the
      tx_fifo_under_ran error is asserted. Thus an EOP tag is written in to
      the TxFIFO as shown in this waveform .
      
      The EOP tag resets the align state machine to the Idle state ensuring
      that the next command written by the echi_ctrl state machine does not
      get corrupted.
      
      File(s) modified:
      RTL code fixed: …..
      Method of reproducing: This failure cannot be reproduced in the current
      test bench.
      Date Found: March 2010
      Date Fixed: June 2010
      Update information:
      Added the RTL code fix
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      8022d3d5
    • Peter Chen's avatar
      usb: chipidea: udc: zero-length packet is only needed for TX · a4da4f12
      Peter Chen authored
      The zero-length packet is the sendor tells the receiver that there
      is no more data, so it is only needed at the TX side.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      a4da4f12
    • Peter Chen's avatar
      usb: chipidea: host: override hcd reset API · 11a27098
      Peter Chen authored
      The system configuration API should be called before the controller
      run, otherwise, undefined results may occur. So, we override hcd
      reset API, and add system configuration API after controller reset.
      
      Cc: Li Jun <peter.chen@freescale.com>
      Cc: Alan Stern <stern@rowland.harvard.edu>
      Acked-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      11a27098
    • Tomeu Vizoso's avatar
      usb: chipidea: imx: properly check for usbmisc · ef12da91
      Tomeu Vizoso authored
      If usbmisc hasn't probed yet, defer the probe.
      
      It's not enough to check if the platform device for the OF node of the
      usbmisc has been registered, but it also needs to have been probed
      already before we can call imx_usbmisc_init().
      
      This can happen if the order in which devices are probed change due to
      async probing or on-demand probing of dependencies.
      Signed-off-by: default avatarTomeu Vizoso <tomeu.vizoso@collabora.com>
      ef12da91
    • Li Jun's avatar
      usb: chipidea: debug: add runtime pm for register access · bc249379
      Li Jun authored
      Add runtime pm operations for registers access to avoid system hang.
      Signed-off-by: default avatarLi Jun <jun.li@freescale.com>
      bc249379
    • Nicholas Krause's avatar
      usb:chipidea:Make the function hw_alloc_repmap have a return type of void · 158ec071
      Nicholas Krause authored
      This makes the function hw_alloc_repmap be declared to have a return
      type of void now due to this particular function never returning
      a error code to its caller due to this function always running
      successfully to completion nor it's caller putting the return
      value into a variable in order to check if a error code is passed
      from the function hw_alloc_repmap when calling this function.
      Signed-off-by: default avatarNicholas Krause <xerofoify@gmail.com>
      158ec071
    • Peter Chen's avatar
      usb: chipidea: host: delete the redundancy ci_hdrc struct · 1311d6e3
      Peter Chen authored
      The struct ci_hdrc is the drvdata for hcd device, so we don't
      need to introduce extra ci_hdrc structure for ehci.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      1311d6e3
    • Peter Chen's avatar
      usb: chipidea: introduce ITC tuning interface · df96ed8d
      Peter Chen authored
      ITC (Interrupt Threshold Control) is used to set the maximum rate at which
      the host/device controller will issue interrupts. The default value is 8 (1ms)
      for it. EHCI core will modify it to 1, but device mode keeps it as default
      value.
      
      In some use cases like Android ADB, it only has one usb request for each
      direction, and maximum payload data is only 4KB, so the speed is 4MB/s
      at most, it needs controller to trigger interrupt as fast as possible
      to increase the speed. The USB performance will be better if the interrupt
      can be triggered faster.
      
      Reduce ITC value is benefit for USB performance, but the interrupt number
      is increased at the same time, it may increase cpu utilization too.
      Most of use case cares about performance, but some may care about
      cpu utilization, so, we leave a platform interface for user.
      We set ITC as 1 (1 micro-frame) as default value which is aligned
      with ehci core default value.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      df96ed8d
    • Peter Chen's avatar
      Doc: usb: ci-hdrc-usb2: add itc-setting at binding doc · 1bd57127
      Peter Chen authored
      It is used to configure the ITC (in register USBCMD) value
      for kinds of applications.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      1bd57127
    • Peter Chen's avatar
      usb: chipidea: introduce ci_platform_configure · bf9c85e7
      Peter Chen authored
      It is used to configure controller parameters according to
      platform data, like speed, stream mode, etc, both host and
      device's initialization need it, most of code are the
      same for both roles, with this new interface, it can reduce
      the duplicated code and be easy to maintain in future.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      bf9c85e7
    • Peter Chen's avatar
      usb: chipidea: otg_fsm: delete the duplicated reset controller operation · 9d2effea
      Peter Chen authored
      At host_stop, it will call usb_remove_hcd, and reset controller later.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      9d2effea
    • Peter Chen's avatar
      usb: chipidea: udc: add USB_DEVICE_A_HNP_SUPPORT request support · 3520d462
      Peter Chen authored
      We can support USB OTG 1.3 USB_DEVICE_A_HNP_SUPPORT request when
      the driver supports OTG FSM mode.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      3520d462
    • Peter Chen's avatar
      usb: chipidea: imx: enable CI_HDRC_SET_NON_ZERO_TTHA · e765bfb7
      Peter Chen authored
      For i.mx platform, set ttctrl.ttha with non-zero value only affects
      sitd, and ehci core makes sure the schedule is not full when accepts
      new request, so it will not occur the transaction which will acorss
      the SoF.
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      e765bfb7
    • Peter Chen's avatar
      usb: chipidea: add ttctrl.ttha control interface · 28362673
      Peter Chen authored
      The register of ttctrl.ttha describes like below:
      - Internal TT Hub Address Representation
      - RW
      - Default = 0000000b
      This field is used to match against the Hub Address field in QH & siTD
      to determine if the packet is routed to the internal TT for directly
      attached FS/LS devices. If the Hub Address in the QH or siTD does not
      match this address then the packet will be broadcast on the High Speed
      ports destined for a downstream High Speed hub with the address in the QH/siTD.
      
      In silicon RTL, this entry only affects QH and siTD, and the hub.addr at
      both QH and siTD are 0 in ehci core for chipidea (with hcd->has_tt = 1).
      
      So, for QH, if the "usage_tt" flag at RTL is 0, set CI_HDRC_SET_NON_ZERO_TTHA
      will not affect QH (with non-hs device); for siTD, set this flag
      will change remaining space requirement for the last transaction from 1023
      bytes to 188 bytes, it can increase the number of transactions within one
      frame, ehci periodic schedule code will not queue the packet if the frame space
      is full, so it is safe to set this flag for siTD.
      
      With this flag, it can fix the problem Alan Stern reported below:
      http://www.spinics.net/lists/linux-usb/msg123125.html
      And may fix Michael Tessier's problem too.
      http://www.spinics.net/lists/linux-usb/msg118679.html
      
      CC: stern@rowland.harvard.edu
      CC: michael.tessier@axiontech.ca
      Signed-off-by: default avatarPeter Chen <peter.chen@freescale.com>
      28362673
  2. 10 Aug, 2015 1 commit
  3. 09 Aug, 2015 5 commits
    • Linus Torvalds's avatar
      Linux 4.2-rc6 · f7644cbf
      Linus Torvalds authored
      f7644cbf
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · a230e95c
      Linus Torvalds authored
      Pull input subsystem fixes from Dmitry Torokhov:
       "Just small ALPS and Elan touchpads, and other driver fixups"
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: elantech - add special check for fw_version 0x470f01 touchpad
        Input: twl4030-vibra - fix ERROR: Bad of_node_put() warning
        Input: alps - only Dell laptops have separate button bits for v2 dualpoint sticks
        Input: axp20x-pek - add module alias
        Input: turbografx - fix potential out of bound access
      a230e95c
    • Linus Torvalds's avatar
      Merge branch 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus · 3fbdc379
      Linus Torvalds authored
      Pull MIPS fixes from Ralf Baechle:
       "Another round of MIPS fixes for 4.2.  No area does particularly stand
        out but we have a two unpleasant ones:
      
         - Kernel ptes are marked with a global bit which allows the kernel to
           share kernel TLB entries between all processes.  For this to work
           both entries of an adjacent even/odd pte pair need to have the
           global bit set.  There has been a subtle race in setting the other
           entry's global bit since ~ 2000 but it take particularly
           pathological workloads that essentially do mostly vmalloc/vfree to
           trigger this.
      
           This pull request fixes the 64-bit case but leaves the case of 32
           bit CPUs with 64 bit ptes unsolved for now.  The unfixed cases
           affect hardware that is not available in the field yet.
      
         - Instruction emulation requires loading instructions from user space
           but the current fast but simplistic approach will fail on pages
           that are PROT_EXEC but !PROT_READ.  For this reason we temporarily
           do not permit this permission and will map pages with PROT_EXEC |
           PROT_READ.
      
        The remainder of this pull request is more or less across the field
        and the short log explains them well"
      
      * 'upstream' of git://git.linux-mips.org/pub/scm/ralf/upstream-linus:
        MIPS: Make set_pte() SMP safe.
        MIPS: Replace add and sub instructions in relocate_kernel.S with addiu
        MIPS: Flush RPS on kernel entry with EVA
        Revert "MIPS: BCM63xx: Provide a plat_post_dma_flush hook"
        MIPS: BMIPS: Delete unused Kconfig symbol
        MIPS: Export get_c0_perfcount_int()
        MIPS: show_stack: Fix stack trace with EVA
        MIPS: do_mcheck: Fix kernel code dump with EVA
        MIPS: SMP: Don't increment irq_count multiple times for call function IPIs
        MIPS: Partially disable RIXI support.
        MIPS: Handle page faults of executable but unreadable pages correctly.
        MIPS: Malta: Don't reinitialise RTC
        MIPS: unaligned: Fix build error on big endian R6 kernels
        MIPS: Fix sched_getaffinity with MT FPAFF enabled
        MIPS: Fix build with CONFIG_OF=y for non OF-enabled targets
        CPUFREQ: Loongson2: Fix broken build due to incorrect include.
      3fbdc379
    • Linus Torvalds's avatar
      Merge branch 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs · af0b3152
      Linus Torvalds authored
      Pull btrfs fix from Chris Mason:
       "We have a btrfs quota regression fix.
      
        I merged this one on Thursday and have run it through tests against
        current master.
      
        Normally I wouldn't have sent this while you were finalizing rc6, but
        I'm feeding mosquitoes in the adirondacks next week, so I wanted to
        get this one out before leaving.  I'll leave longer tests running and
        check on things during the week, but I don't expect any problems"
      
      * 'for-linus-4.2' of git://git.kernel.org/pub/scm/linux/kernel/git/mason/linux-btrfs:
        btrfs: qgroup: Fix a regression in qgroup reserved space.
      af0b3152
    • Linus Torvalds's avatar
      Merge branch 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux · bae1577e
      Linus Torvalds authored
      Pull thermal management fixes from Zhang Rui:
       "Specifics:
      
         - fix an error that "weight_attr" sysfs attribute is not removed
           while unbinding.  From: Viresh Kumar.
      
         - fix power allocator governor tracing to return the real request.
           From Javi Merino.
      
         - remove redundant owner assignment of hisi platform thermal driver.
           From Krzysztof Kozlowski.
      
         - a couple of small fixes of Exynos thermal driver.  From Krzysztof
           Kozlowski and Chanwoo Choi"
      
      * 'for-rc' of git://git.kernel.org/pub/scm/linux/kernel/git/rzhang/linux:
        thermal: Drop owner assignment from platform_driver
        thermal: exynos: Remove unused code related to platform_data on probe()
        thermal: exynos: Add the dependency of CONFIG_THERMAL_OF instead of CONFIG_OF
        thermal: exynos: Disable the regulator on probe failure
        thermal: power_allocator: trace the real requested power
        thermal: remove dangling 'weight_attr' device file
      bae1577e
  4. 08 Aug, 2015 16 commits
  5. 07 Aug, 2015 4 commits