12 Oct, 2016

1 commit

  • Kernel source files need not include explicitly
    because the top Makefile forces to include it with:

    -include $(srctree)/include/linux/kconfig.h

    This commit removes explicit includes except the following:

    * arch/s390/include/asm/facilities_src.h
    * tools/testing/radix-tree/linux/kernel.h

    These two are used for host programs.

    Link: http://lkml.kernel.org/r/1473656164-11929-1-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     

27 Jun, 2016

1 commit

  • The Kconfig currently controlling compilation of this code is:

    arch/x86/Kconfig.debug:config EARLY_PRINTK_DBGP
    arch/x86/Kconfig.debug: bool "Early printk via EHCI debug port"

    ...meaning that it currently is not being built as a module by anyone.

    Lets remove the couple traces of modularity so that when reading the
    driver there is no doubt it is builtin-only.

    Since module_init translates to device_initcall in the non-modular
    case, the init ordering remains unchanged with this commit.

    Cc: Greg Kroah-Hartman
    Cc: linux-usb@vger.kernel.org
    Signed-off-by: Paul Gortmaker
    Signed-off-by: Greg Kroah-Hartman

    Paul Gortmaker
     

27 Sep, 2013

1 commit

  • We can only reach this spot by breaking out of the scan loop,
    so by construction ret > 0.

    Found by Coverity, in a copy of this file in the Xen sources.

    Signed-off-by: Tim Deegan
    Signed-off-by: Greg Kroah-Hartman

    Tim Deegan
     

03 Nov, 2012

1 commit


31 Oct, 2012

1 commit

  • Since there's no possible caller of dbgp_external_startup() and
    dbgp_reset_prep() when !USB_EHCI_HCD, there's no point in building and
    exporting these functions in that case. This eliminates a build error
    under the conditions listed in the subject, introduced with the merge
    f1c6872e4980bc4078cfaead05f892b3d78dea64.

    Reported-by: Randy Dunlap
    Signed-off-by: Jan Beulich
    Cc: Stefano Stabellini
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Jan Beulich
     

19 Sep, 2012

1 commit

  • Just like for the in-tree early console debug port driver, the
    hypervisor - when using a debug port based console - also needs to be
    told about controller resets, so it can suppress using and then
    re-initialize the debug port accordingly.

    Other than the in-tree driver, the hypervisor driver actually cares
    about doing this only for the device where the debug is port actually
    in use, i.e. it needs to be told the coordinates of the device being
    reset (quite obviously, leveraging the addition done for that would
    likely benefit the in-tree driver too).

    Signed-off-by: Jan Beulich
    Acked-by: Konrad Rzeszutek Wilk
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Jan Beulich
     

04 Aug, 2012

1 commit

  • Pull KGDB/KDB/usb-dbgp fixes and cleanups from Jason Wessel:
    "There are no new features, those will be delayed to the 3.7 window.
    There are only fixes/cleanup against the usual kernel churn and we are
    removing more lines than we add:

    - usb-dbgp - increase the controller wait time to come out of halt.
    - kdb - Remove unused KDB_FLAG_ONLY_DO_DUMP code and cpu in more prompt
    - debug core - pass NMI type on archs that provide NMI types"

    * tag 'for_linux-3.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jwessel/kgdb:
    USB: echi-dbgp: increase the controller wait time to come out of halt.
    kernel/debug: Make use of KGDB_REASON_NMI
    kdb: Remove cpu from the more prompt
    kdb: Remove unused KDB_FLAG_ONLY_DO_DUMP

    Linus Torvalds
     

31 Jul, 2012

1 commit

  • The default 10 microsecond delay for the controller to come out of
    halt in dbgp_ehci_startup is too short, so increase it to 1 millisecond.

    This is based on emperical testing on various USB debug ports on
    modern machines such as a Lenovo X220i and an Ivybridge development
    platform that needed to wait ~450-950 microseconds.

    Cc:
    Signed-off-by: Colin Ian King
    Signed-off-by: Jason Wessel

    Colin Ian King
     

14 Jun, 2012

1 commit


04 May, 2011

1 commit

  • The two first HC capability registers (CAPLENGTH and HCIVERSION)
    are defined as one 8-bit and one 16-bit register. Most HC
    implementations have selected to treat these registers as part
    of a 32-bit register, giving the same layout for both big and
    small endian systems.

    This patch adds a new quirk, big_endian_capbase, to support
    controllers with big endian register interfaces that treat
    HCIVERSION and CAPLENGTH as individual registers.

    Signed-off-by: Jan Andersson
    Acked-by: Alan Stern
    Signed-off-by: Greg Kroah-Hartman

    Jan Andersson
     

31 Mar, 2011

1 commit


23 Jan, 2011

1 commit


23 Oct, 2010

1 commit

  • For all modules, change -objs to -y; remove
    if-statements and replace with lists using the kbuild idiom; move
    flags to the top of the file; and fix alignment while trying to
    maintain the original scheme in each file.

    None of the dependencies are modified.

    Signed-off-by: matt mooney
    Acked-by: Sam Ravnborg
    Acked-by: Felipe Balbi
    Signed-off-by: Greg Kroah-Hartman

    matt mooney
     

21 May, 2010

1 commit

  • This patch adds the capability to use the usb debug port with the
    kernel debugger. It is also still possible to use this functionality
    with or without the earlyprintk=dbgpX. It is possible to use the
    kgdbwait boot argument to debug very early in the kernel start up code.

    There are two ways to use this driver extension with a kernel boot argument.

    1) kgdbdbgp=# -- Where # is the number of the usb debug controller

    You must use sysrq-g to break into the kernel debugger on another
    connection type other than the dbgp.

    2) kgdbdbgp=#debugControlNum#,#Seconds#

    In this mode, the usb debug port is polled every #Seconds# for
    character input. It is possible to use gdb or press control-c to
    break into the kernel debugger.

    From the implementation perspective there are 3 high level changes.

    1) Allow variable retries for the the hardware via dbgp_bulk_read().

    The amount of retries for the dbgp_bulk_read() needed to be
    variable instead of fixed. We do not want to poll at all when the
    kernel is operating in interrupt driven mode. The polling only
    occurs if the kernel was booted when specifying some number of
    seconds via the kgdbdbgp boot argument (IE kgdbdbgp=0,1). In this
    case the loop count is reduced to 1 so as introduce the smallest
    amount of latency as possible.

    2) Save the bulk IN endpoint address for use by the kgdb code.

    3) The addition of the kgdb interface code.

    This consisted of adding in a character read function for the dbgp
    as well as a polling thread to allow the dbgp to interrupt the
    kernel execution. The rest is the typical kgdb I/O api.

    CC: Eric Biederman
    CC: Yinghai Lu
    CC: linux-usb@vger.kernel.org
    Signed-off-by: Jason Wessel
    Acked-by: Greg Kroah-Hartman

    Jason Wessel
     

03 Mar, 2010

1 commit

  • This patch addresses two problems:

    1) Bulk reads should always use the DATA0 for the pid, and the write
    PID should toggle between DATA0 and DATA1. The fix is using
    dbgp_pid_write_update() and dbgp_pid_read_update().

    2) The delay loop for waiting for a transaction was not long enough to
    always complete the initial handshake inside dbgp_wait_until_done().
    After the initial handshake the maximum delay length is never reached.

    The combined result of these two changes allows for the removal of the
    forced resynchronization where a bulk write was issued with a dummy
    data payload only to get the device to start accepting data writes
    again.

    CC: Eric Biederman
    CC: Yinghai Lu
    Signed-off-by: Jason Wessel
    Signed-off-by: Greg Kroah-Hartman

    Jason Wessel
     

24 Dec, 2009

1 commit

  • Commit 917778267fbe67703ab7d5c6f0b7a05d4c3df485 removed __init from
    ehci_wait_for_port(), but left it in place on ehci_reset_port(), which
    is being called from the former function.

    Signed-off-by: Jan Beulich
    Acked-by: Jason Wessel
    Signed-off-by: Greg Kroah-Hartman

    Jan Beulich
     

23 Sep, 2009

8 commits

  • On some EHCI debug controllers after the host controller driver is
    activated, the debug controller will occasionally fail to submit a
    bulk write URB. On controllers that exhibit this behavior a dummy
    bulk write must get submitted to resynchronize the device.

    The "dummy bulk write" does not get received by the host attached to
    the other end of the usb debug device. The usb debug device simply
    acknowledges the "dummy bulk write" and returns to a usable state.

    The behavior, without this patch is that you see missing text from a
    complete kernel boot when using the keep option to the earlyprintk
    kernel argument.

    Signed-off-by: Jason Wessel
    Cc: Ingo Molnar
    Cc: Andrew Morton
    Cc: Yinghai Lu
    Cc: "Eric W. Biederman"
    Signed-off-by: Greg Kroah-Hartman

    Jason Wessel
     
  • On some EHCI usb debug controllers, the EHCI debug device will fail to
    be seen after a port reset, after a warm reset. Two options exist to
    get the device to initialize correctly.

    Option 1 is to unplug and plug in the device.

    Option 2 is to use the EHCI port test to get the usb debug device to
    start talking again. At that point the debug controller port reset
    will succeed.

    Signed-off-by: Jason Wessel
    Cc: Ingo Molnar
    Cc: Andrew Morton
    Cc: Yinghai Lu
    Cc: "Eric W. Biederman"
    CC: dbrownell@users.sourceforge.net
    Signed-off-by: Greg Kroah-Hartman

    Jason Wessel
     
  • If the EHCI debug port is initialized and in use, the EHCI host
    controller driver must follow two rules.

    1) If the EHCI host driver issues a controller reset, the debug
    controller driver re-initialization must get called after the reset
    is completed.

    2) The EHCI host driver should ignore any requests to the physical
    EHCI debug port when the EHCI debug port is in use.

    The code to check for the debug port was moved from ehci_pci_reinit()
    to ehci_pci_setup because it must get called prior to ehci_reset()
    which will clear the debug port registers.

    Signed-off-by: Jason Wessel
    Cc: Alan Stern
    Cc: dbrownell@users.sourceforge.net
    Cc: Ingo Molnar
    Cc: Andrew Morton
    Cc: Yinghai Lu
    Cc: "Eric W. Biederman"
    Signed-off-by: Greg Kroah-Hartman

    Jason Wessel
     
  • This patch implements several changes:

    1) Improve the capability to debug the dbgp driver

    The dbgp_ehci_status() was added in a number of places to report
    the critical ehci registers to diagnose the cause of a failure of
    the ehci-dbgp driver.

    2) Capability to survive the host controller initialization

    The dbgp_external_startup(), dbgp_not_safe, and dbgp_phys_port were
    added so as to allow the ehci-dbgp to re-initialize after the ehci
    host controller is reset by the standard host controller driver.
    This same routine is common for the early startup or
    re-initialization.

    This resulted in the need to move some of the initialization code
    out of the __init section because the ehci driver has the
    possibility to be loaded later on as a kernel module.

    3) Stability improvements for device initialization

    The device enumeration from 0 to 127 has the possibility to fail
    the first time after a warm reset on some older EHCI debug
    controllers. The enumeration will be tried up to 3 times to
    account for this failure case.

    The dbg_wait_until_complete() was changed to wait up to 250 ms
    before failing which only comes into play during device
    initialization. The maximum delay will never get hit during the
    course of normal operation of the driver, unless the device got
    unplugged or there was a ehci controller failure, in which case the
    dbgp device driver will shut itself down.

    Signed-off-by: Jason Wessel
    Cc: Ingo Molnar
    Cc: Andrew Morton
    Cc: dbrownell@users.sourceforge.net
    Cc: Yinghai Lu
    Cc: "Eric W. Biederman"
    Signed-off-by: Greg Kroah-Hartman

    Jason Wessel
     
  • When using the EHCI host controller as a polled device, a bit more
    tolerance is required in terms of delays. On some 3+ghz systems the
    cpu loops were faster than the EHCI device mmio and resulted in the
    controller failing to initialize.

    On at least one first generation EHCI controller when it was not
    operating in interrupt mode, it would fail to report a port change
    status, but executing the port reset allowed the debug controller to
    work correctly anyway. This errata causes a one time 300ms delay in
    the boot time, where as the typical delay is 1-5ms for an EHCI
    controller that does not have this errata.

    The debug printk's were fixed to have the correct state messages, and
    there was a conversion from using early_printk to printk to avoid
    calling the dbgp driver while debugging the initialization.

    Signed-off-by: Jason Wessel
    Cc: Ingo Molnar
    Cc: Andrew Morton
    Cc: Yinghai Lu
    Cc: "Eric W. Biederman"
    Signed-off-by: Greg Kroah-Hartman

    Jason Wessel
     
  • The PCI quirk code executes a BIOS hand off to obtain full control of
    the EHCI host controller, the self contained ehci-dbgp driver must do
    the same thing using the early PCI API, else the BIOS can cause a
    fatal fault.

    Signed-off-by: Jason Wessel
    Cc: Ingo Molnar
    Cc: Andrew Morton
    Cc: dbrownell@users.sourceforge.net
    Cc: Yinghai Lu
    Cc: "Eric W. Biederman"
    Signed-off-by: Greg Kroah-Hartman

    Jason Wessel
     
  • The rs232 drivers send a carriage return prior to a new line in the
    early printk code.

    The usb debug driver should do the same because you want to be able to
    use the same terminal programs and tools for analysis of early printk
    data.

    Signed-off-by: Jason Wessel
    Cc: Ingo Molnar
    Cc: Andrew Morton
    Cc: Yinghai Lu
    Cc: "Eric W. Biederman"
    Signed-off-by: Greg Kroah-Hartman

    Jason Wessel
     
  • Move the dbgp early printk driver in advance of refactoring and adding
    new code, so the changes to this code are tracked separately from the
    move of the code.

    The drivers/usb/early directory will be the location of the current
    and future early usb code for driving usb devices prior initializing
    the standard interrupt driven USB drivers.

    Signed-off-by: Jason Wessel
    Cc: Ingo Molnar
    Cc: Andrew Morton
    Cc: Yinghai Lu
    Cc: "Eric W. Biederman"
    Signed-off-by: Greg Kroah-Hartman

    Jason Wessel