Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux...
authorGrazvydas Ignotas <notasas@gmail.com>
Fri, 7 May 2010 13:52:18 +0000 (16:52 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Fri, 7 May 2010 13:52:18 +0000 (16:52 +0300)
Conflicts:
drivers/usb/musb/davinci.c
security/Kconfig

1  2 
Makefile
drivers/gpio/gpiolib.c
drivers/i2c/i2c-core.c
drivers/misc/Kconfig
drivers/net/Kconfig
drivers/serial/8250.c
drivers/usb/host/Kconfig
drivers/usb/host/ehci-hcd.c
drivers/usb/musb/davinci.c
kernel/printk.c
security/Kconfig

diff --combined Makefile
+++ b/Makefile
@@@ -1,8 -1,8 +1,8 @@@
  VERSION = 2
  PATCHLEVEL = 6
  SUBLEVEL = 27
- EXTRAVERSION =
- NAME = Rotary Wombat
+ EXTRAVERSION = .46
+ NAME = Trembling Tortoise
  
  # *DOCUMENTATION*
  # To see a list of typical targets execute "make help"
@@@ -16,9 -16,6 +16,9 @@@
  # o  print "Entering directory ...";
  MAKEFLAGS += -rR --no-print-directory
  
 +# Add custom flags here to avoid conflict with updates
 +EXTRAVERSION := $(EXTRAVERSION)-omap1
 +
  # We are using a recursive build, so we need to do a little thinking
  # to get the ordering right.
  #
@@@ -174,8 -171,6 +174,8 @@@ SUBARCH := $(shell uname -m | sed -e s/
                                  -e s/ppc.*/powerpc/ -e s/mips.*/mips/ \
                                  -e s/sh.*/sh/ )
  
 +SUBARCH := arm
 +
  # Cross compiling and selecting different set of gcc/bin-utils
  # ---------------------------------------------------------------------------
  #
  # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile
  export KBUILD_BUILDHOST := $(SUBARCH)
  ARCH          ?= $(SUBARCH)
 -CROSS_COMPILE ?=
 +CROSS_COMPILE ?= arm-linux-
  
  # Architecture as present in compile.h
  UTS_MACHINE   := $(ARCH)
@@@ -345,7 -340,8 +345,8 @@@ KBUILD_CPPFLAGS := -D__KERNEL__ $(LINUX
  
  KBUILD_CFLAGS   := -Wall -Wundef -Wstrict-prototypes -Wno-trigraphs \
                   -fno-strict-aliasing -fno-common \
-                  -Werror-implicit-function-declaration
+                  -Werror-implicit-function-declaration \
+                  -fno-delete-null-pointer-checks
  KBUILD_AFLAGS   := -D__ASSEMBLY__
  
  # Read KERNELRELEASE from include/config/kernel.release (if it exists)
@@@ -560,6 -556,9 +561,9 @@@ KBUILD_CFLAGS += $(call cc-option,-Wdec
  # disable pointer signed / unsigned warnings in gcc 4.0
  KBUILD_CFLAGS += $(call cc-option,-Wno-pointer-sign,)
  
+ # disable invalid "can't wrap" optimzations for signed / pointers
+ KBUILD_CFLAGS += $(call cc-option,-fno-strict-overflow)
  # Add user supplied CPPFLAGS, AFLAGS and CFLAGS as the last assignments
  # But warn user when we do so
  warn-assign = \
diff --combined drivers/gpio/gpiolib.c
@@@ -67,28 -67,17 +67,28 @@@ static inline void desc_set_label(struc
   * when setting direction, and otherwise illegal.  Until board setup code
   * and drivers use explicit requests everywhere (which won't happen when
   * those calls have no teeth) we can't avoid autorequesting.  This nag
 - * message should motivate switching to explicit requests...
 + * message should motivate switching to explicit requests... so should
 + * the weaker cleanup after faults, compared to gpio_request().
   */
 -static void gpio_ensure_requested(struct gpio_desc *desc)
 +static int gpio_ensure_requested(struct gpio_desc *desc, unsigned offset)
  {
        if (test_and_set_bit(FLAG_REQUESTED, &desc->flags) == 0) {
 -              pr_warning("GPIO-%d autorequested\n", (int)(desc - gpio_desc));
 +              struct gpio_chip *chip = desc->chip;
 +              int gpio = chip->base + offset;
 +
 +              if (!try_module_get(chip->owner)) {
 +                      pr_err("GPIO-%d: module can't be gotten \n", gpio);
 +                      clear_bit(FLAG_REQUESTED, &desc->flags);
 +                      /* lose */
 +                      return -EIO;
 +              }
 +              pr_warning("GPIO-%d autorequested\n", gpio);
                desc_set_label(desc, "[auto]");
 -              if (!try_module_get(desc->chip->owner))
 -                      pr_err("GPIO-%d: module can't be gotten \n",
 -                                      (int)(desc - gpio_desc));
 +              /* caller must chip->request() w/o spinlock */
 +              if (chip->request)
 +                      return 1;
        }
 +      return 0;
  }
  
  /* caller holds gpio_lock *OR* gpio is marked as requested */
@@@ -763,7 -752,6 +763,7 @@@ EXPORT_SYMBOL_GPL(gpiochip_remove)
  int gpio_request(unsigned gpio, const char *label)
  {
        struct gpio_desc        *desc;
 +      struct gpio_chip        *chip;
        int                     status = -EINVAL;
        unsigned long           flags;
  
        if (!gpio_is_valid(gpio))
                goto done;
        desc = &gpio_desc[gpio];
 -      if (desc->chip == NULL)
 +      chip = desc->chip;
 +      if (chip == NULL)
                goto done;
  
 -      if (!try_module_get(desc->chip->owner))
 +      if (!try_module_get(chip->owner))
                goto done;
  
        /* NOTE:  gpio_request() can be called in early boot,
 -       * before IRQs are enabled.
 +       * before IRQs are enabled, for non-sleeping (SOC) GPIOs.
         */
  
        if (test_and_set_bit(FLAG_REQUESTED, &desc->flags) == 0) {
                status = 0;
        } else {
                status = -EBUSY;
 -              module_put(desc->chip->owner);
 +              module_put(chip->owner);
 +      }
 +
 +      if (chip->request) {
 +              /* chip->request may sleep */
 +              spin_unlock_irqrestore(&gpio_lock, flags);
 +              status = chip->request(chip, gpio - chip->base);
 +              spin_lock_irqsave(&gpio_lock, flags);
 +
 +              if (status < 0) {
 +                      desc_set_label(desc, NULL);
 +                      module_put(chip->owner);
 +                      clear_bit(FLAG_REQUESTED, &desc->flags);
 +              }
        }
  
  done:
@@@ -817,7 -791,6 +817,7 @@@ void gpio_free(unsigned gpio
  {
        unsigned long           flags;
        struct gpio_desc        *desc;
 +      struct gpio_chip        *chip;
  
        if (!gpio_is_valid(gpio)) {
                WARN_ON(extra_checks);
        spin_lock_irqsave(&gpio_lock, flags);
  
        desc = &gpio_desc[gpio];
 -      if (desc->chip && test_and_clear_bit(FLAG_REQUESTED, &desc->flags)) {
 +      chip = desc->chip;
 +      if (chip && test_bit(FLAG_REQUESTED, &desc->flags)) {
 +              if (chip->free) {
 +                      spin_unlock_irqrestore(&gpio_lock, flags);
 +                      might_sleep_if(extra_checks && chip->can_sleep);
 +                      chip->free(chip, gpio - chip->base);
 +                      spin_lock_irqsave(&gpio_lock, flags);
 +              }
                desc_set_label(desc, NULL);
                module_put(desc->chip->owner);
 +              clear_bit(FLAG_REQUESTED, &desc->flags);
        } else
                WARN_ON(extra_checks);
  
@@@ -904,9 -869,7 +904,9 @@@ int gpio_direction_input(unsigned gpio
        gpio -= chip->base;
        if (gpio >= chip->ngpio)
                goto fail;
 -      gpio_ensure_requested(desc);
 +      status = gpio_ensure_requested(desc, gpio);
 +      if (status < 0)
 +              goto fail;
  
        /* now we know the gpio is valid and chip won't vanish */
  
  
        might_sleep_if(extra_checks && chip->can_sleep);
  
 +      if (status) {
 +              status = chip->request(chip, gpio);
 +              if (status < 0) {
 +                      pr_debug("GPIO-%d: chip request fail, %d\n",
 +                              chip->base + gpio, status);
 +                      /* and it's not available to anyone else ...
 +                       * gpio_request() is the fully clean solution.
 +                       */
 +                      goto lose;
 +              }
 +      }
 +
        status = chip->direction_input(chip, gpio);
        if (status == 0)
                clear_bit(FLAG_IS_OUT, &desc->flags);
 +lose:
        return status;
  fail:
        spin_unlock_irqrestore(&gpio_lock, flags);
@@@ -957,9 -907,7 +957,9 @@@ int gpio_direction_output(unsigned gpio
        gpio -= chip->base;
        if (gpio >= chip->ngpio)
                goto fail;
 -      gpio_ensure_requested(desc);
 +      status = gpio_ensure_requested(desc, gpio);
 +      if (status < 0)
 +              goto fail;
  
        /* now we know the gpio is valid and chip won't vanish */
  
  
        might_sleep_if(extra_checks && chip->can_sleep);
  
 +      if (status) {
 +              status = chip->request(chip, gpio);
 +              if (status < 0) {
 +                      pr_debug("GPIO-%d: chip request fail, %d\n",
 +                              chip->base + gpio, status);
 +                      /* and it's not available to anyone else ...
 +                       * gpio_request() is the fully clean solution.
 +                       */
 +                      goto lose;
 +              }
 +      }
 +
        status = chip->direction_output(chip, gpio, value);
        if (status == 0)
                set_bit(FLAG_IS_OUT, &desc->flags);
 +lose:
        return status;
  fail:
        spin_unlock_irqrestore(&gpio_lock, flags);
@@@ -1073,24 -1008,6 +1073,24 @@@ int __gpio_cansleep(unsigned gpio
  }
  EXPORT_SYMBOL_GPL(__gpio_cansleep);
  
 +/**
 + * __gpio_to_irq() - return the IRQ corresponding to a GPIO
 + * @gpio: gpio whose IRQ will be returned (already requested)
 + * Context: any
 + *
 + * This is used directly or indirectly to implement gpio_to_irq().
 + * It returns the number of the IRQ signaled by this (input) GPIO,
 + * or a negative errno.
 + */
 +int __gpio_to_irq(unsigned gpio)
 +{
 +      struct gpio_chip        *chip;
 +
 +      chip = gpio_to_chip(gpio);
 +      return chip->to_irq ? chip->to_irq(chip, gpio - chip->base) : -ENXIO;
 +}
 +EXPORT_SYMBOL_GPL(__gpio_to_irq);
 +
  
  
  /* There's no value in making it easy to inline GPIO calls that may sleep.
@@@ -1103,7 -1020,7 +1103,7 @@@ int gpio_get_value_cansleep(unsigned gp
  
        might_sleep_if(extra_checks);
        chip = gpio_to_chip(gpio);
-       return chip->get(chip, gpio - chip->base);
+       return chip->get ? chip->get(chip, gpio - chip->base) : 0;
  }
  EXPORT_SYMBOL_GPL(gpio_get_value_cansleep);
  
@@@ -1132,7 -1049,7 +1132,7 @@@ static void gpiolib_dbg_show(struct seq
                        continue;
  
                is_out = test_bit(FLAG_IS_OUT, &gdesc->flags);
-               seq_printf(s, " gpio-%-3d (%-12s) %s %s",
+               seq_printf(s, " gpio-%-3d (%-20.20s) %s %s",
                        gpio, gdesc->label,
                        is_out ? "out" : "in ",
                        chip->get
diff --combined drivers/i2c/i2c-core.c
@@@ -644,6 -644,9 +644,9 @@@ int i2c_del_adapter(struct i2c_adapter 
                }
        }
  
+       /* device name is gone after device_unregister */
+       dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name);
        /* clean up the sysfs representation */
        init_completion(&adap->dev_released);
        device_unregister(&adap->dev);
        /* free bus id */
        idr_remove(&i2c_adapter_idr, adap->nr);
  
-       dev_dbg(&adap->dev, "adapter [%s] unregistered\n", adap->name);
        /* Clear the device structure in case this adapter is ever going to be
           added again */
        memset(&adap->dev, 0, sizeof(adap->dev));
@@@ -978,7 -979,7 +979,7 @@@ static void __exit i2c_exit(void
        bus_unregister(&i2c_bus_type);
  }
  
 -subsys_initcall(i2c_init);
 +postcore_initcall(i2c_init);
  module_exit(i2c_exit);
  
  /* ----------------------------------------------------
@@@ -1795,7 -1796,8 +1796,8 @@@ static s32 i2c_smbus_xfer_emulated(stru
        case I2C_SMBUS_QUICK:
                msg[0].len = 0;
                /* Special case: The read/write field is used as data */
-               msg[0].flags = flags | (read_write==I2C_SMBUS_READ)?I2C_M_RD:0;
+               msg[0].flags = flags | (read_write == I2C_SMBUS_READ ?
+                                       I2C_M_RD : 0);
                num = 1;
                break;
        case I2C_SMBUS_BYTE:
diff --combined drivers/misc/Kconfig
@@@ -321,6 -321,7 +321,7 @@@ config THINKPAD_ACPI_DOC
        bool "Legacy Docking Station Support"
        depends on THINKPAD_ACPI
        depends on ACPI_DOCK=n
+       depends on BROKEN
        default n
        ---help---
          Allows the thinkpad_acpi driver to handle docking station events.
  config THINKPAD_ACPI_BAY
        bool "Legacy Removable Bay Support"
        depends on THINKPAD_ACPI
-       default y
+       depends on BROKEN
+       default n
        ---help---
          Allows the thinkpad_acpi driver to handle removable bays.  It will
          electrically disable the device in the bay, and also generate
@@@ -409,24 -411,11 +411,24 @@@ config EEEPC_LAPTO
        depends on BACKLIGHT_CLASS_DEVICE
        depends on HWMON
        depends on EXPERIMENTAL
 +
        ---help---
          This driver supports the Fn-Fx keys on Eee PC laptops.
          It also adds the ability to switch camera/wlan on/off.
  
 -        If you have an Eee PC laptop, say Y or M here.
 +config OMAP_STI
 +      bool "Serial Trace Interface support"
 +      depends on ARCH_OMAP16XX || ARCH_OMAP24XX || ARCH_OMAP34XX
 +      default n
 +      help
 +        Serial Trace Interface. The protocols suported for OMAP1/2/3 are
 +        STI/CSTI/XTIv2 correspondingly.
 +
 +config OMAP_STI_CONSOLE
 +      bool "STI console support"
 +      depends on OMAP_STI
 +      help
 +        This enables a console driver by way of STI/XTI.
  
  config ENCLOSURE_SERVICES
        tristate "Enclosure Services"
diff --combined drivers/net/Kconfig
@@@ -960,7 -960,7 +960,7 @@@ config SMC911
        tristate "SMSC LAN911[5678] support"
        select CRC32
        select MII
 -      depends on ARCH_PXA || SUPERH
 +      depends on ARCH_PXA || SUPERH || SH_MAGIC_PANEL_R2 || ARCH_OMAP24XX || ARCH_OMAP34XX
        help
          This is a driver for SMSC's LAN911x series of Ethernet chipsets
          including the new LAN9115, LAN9116, LAN9117, and LAN9118.
@@@ -2046,6 -2046,7 +2046,7 @@@ config R816
        tristate "Realtek 8169 gigabit ethernet support"
        depends on PCI
        select CRC32
+       select MII
        ---help---
          Say Y here if you have a Realtek 8169 PCI Gigabit Ethernet adapter.
  
diff --combined drivers/serial/8250.c
@@@ -70,6 -70,9 +70,9 @@@ static unsigned int nr_uarts = CONFIG_S
  
  #define PASS_LIMIT    256
  
+ #define BOTH_EMPTY    (UART_LSR_TEMT | UART_LSR_THRE)
  /*
   * We default to IRQ0 for the "no irq" hack.   Some
   * machine types want others as well - they're free
@@@ -1513,11 -1516,7 +1516,11 @@@ static irqreturn_t serial8250_interrupt
  
        DEBUG_INTR("end.\n");
  
 +#ifdef CONFIG_ARCH_OMAP15XX
 +      return IRQ_HANDLED;     /* FIXME: iir status not ready on 1510 */
 +#else
        return IRQ_RETVAL(handled);
 +#endif
  }
  
  /*
@@@ -1660,7 -1659,7 +1663,7 @@@ static unsigned int serial8250_tx_empty
        up->lsr_saved_flags |= lsr & LSR_SAVE_FLAGS;
        spin_unlock_irqrestore(&up->port.lock, flags);
  
-       return lsr & UART_LSR_TEMT ? TIOCSER_TEMT : 0;
+       return (lsr & BOTH_EMPTY) == BOTH_EMPTY ? TIOCSER_TEMT : 0;
  }
  
  static unsigned int serial8250_get_mctrl(struct uart_port *port)
@@@ -1718,8 -1717,6 +1721,6 @@@ static void serial8250_break_ctl(struc
        spin_unlock_irqrestore(&up->port.lock, flags);
  }
  
- #define BOTH_EMPTY (UART_LSR_TEMT | UART_LSR_THRE)
  /*
   *    Wait for transmitter & holding register to empty
   */
@@@ -1960,6 -1957,20 +1961,20 @@@ static int serial8250_startup(struct ua
  
        serial8250_set_mctrl(&up->port, up->port.mctrl);
  
+       /* Serial over Lan (SoL) hack:
+          Intel 8257x Gigabit ethernet chips have a
+          16550 emulation, to be used for Serial Over Lan.
+          Those chips take a longer time than a normal
+          serial device to signalize that a transmission
+          data was queued. Due to that, the above test generally
+          fails. One solution would be to delay the reading of
+          iir. However, this is not reliable, since the timeout
+          is variable. So, let's just don't test if we receive
+          TX irq. This way, we'll never enable UART_BUG_TXEN.
+        */
+       if (up->port.flags & UPF_NO_TXEN_TEST)
+               goto dont_test_tx_en;
        /*
         * Do a quick test to see if we receive an
         * interrupt when we enable the TX irq.
                up->bugs &= ~UART_BUG_TXEN;
        }
  
+ dont_test_tx_en:
        spin_unlock_irqrestore(&up->port.lock, flags);
  
        /*
@@@ -2215,9 -2227,9 +2231,9 @@@ serial8250_set_termios(struct uart_por
                serial_outp(up, UART_EFR, efr);
        }
  
 -#ifdef CONFIG_ARCH_OMAP15XX
 +#ifdef CONFIG_ARCH_OMAP
        /* Workaround to enable 115200 baud on OMAP1510 internal ports */
 -      if (cpu_is_omap1510() && is_omap_port((unsigned int)up->port.membase)) {
 +      if (cpu_is_omap1510() && is_omap_port(up)) {
                if (baud == 115200) {
                        quot = 1;
                        serial_out(up, UART_OMAP_OSC_12M_SEL, 1);
                        /* emulated UARTs (Lucent Venus 167x) need two steps */
                        serial_outp(up, UART_FCR, UART_FCR_ENABLE_FIFO);
                }
 +
 +              /* Note that we need to set ECB to access write water mark
 +               * bits. First allow FCR tx fifo write, then set fcr with
 +               * possible TX fifo settings. */
 +              if (uart_config[up->port.type].flags & UART_CAP_EFR) {
 +                      serial_outp(up, UART_LCR, 0xbf);        /* Access EFR */
 +                      serial_outp(up, UART_EFR, UART_EFR_ECB);
 +                      serial_outp(up, UART_LCR, 0x0);         /* Access FCR */
 +                      serial_outp(up, UART_FCR, fcr);
 +                      serial_outp(up, UART_LCR, 0xbf);        /* Access EFR */
 +                      serial_outp(up, UART_EFR, 0);
 +                      serial_outp(up, UART_LCR, cval);        /* Access FCR */
 +        } else
                serial_outp(up, UART_FCR, fcr);         /* set fcr */
        }
        serial8250_set_mctrl(&up->port, up->port.mctrl);
@@@ -2283,27 -2282,18 +2299,27 @@@ serial8250_pm(struct uart_port *port, u
                p->pm(port, state, oldstate);
  }
  
 +static unsigned int serial8250_port_size(struct uart_8250_port *pt)
 +{
 +      if (pt->port.iotype == UPIO_AU)
 +              return 0x100000;
 +#ifdef CONFIG_ARCH_OMAP
 +      if (is_omap_port(pt))
 +              return 0x16 << pt->port.regshift;
 +#endif
 +      return 8 << pt->port.regshift;
 +}
 +
  /*
   * Resource handling.
   */
  static int serial8250_request_std_resource(struct uart_8250_port *up)
  {
 -      unsigned int size = 8 << up->port.regshift;
 +      unsigned int size = serial8250_port_size(up);
        int ret = 0;
  
        switch (up->port.iotype) {
        case UPIO_AU:
 -              size = 0x100000;
 -              /* fall thru */
        case UPIO_TSI:
        case UPIO_MEM32:
        case UPIO_MEM:
  
  static void serial8250_release_std_resource(struct uart_8250_port *up)
  {
 -      unsigned int size = 8 << up->port.regshift;
 +      unsigned int size = serial8250_port_size(up);
  
        switch (up->port.iotype) {
        case UPIO_AU:
 -              size = 0x100000;
 -              /* fall thru */
        case UPIO_TSI:
        case UPIO_MEM32:
        case UPIO_MEM:
diff --combined drivers/usb/host/Kconfig
@@@ -41,25 -41,6 +41,25 @@@ config USB_EHCI_HC
  
          To compile this driver as a module, choose M here: the
          module will be called ehci-hcd.
 +choice
 +      prompt "PHY/TLL mode"
 +      depends on USB_EHCI_HCD && EXPERIMENTAL && ARCH_OMAP34XX
 +      ---help---
 +      Choose PHY or TLL mode of operation
 +
 +config OMAP_EHCI_PHY_MODE
 +      bool "PHY mode: ISP1504 on Port1/2 (NEW 3430ES2.0)"
 +      depends on USB_EHCI_HCD && EXPERIMENTAL && ARCH_OMAP34XX
 +      ---help---
 +        EHCI PHY mode. Port1 and Port2 are connected to ISP1504 transcievers
 +
 +config OMAP_EHCI_TLL_MODE
 +      bool "TLL mode: (EXPERIMENTAL)"
 +      depends on USB_EHCI_HCD && EXPERIMENTAL && ARCH_OMAP34XX
 +      ---help---
 +      OMAP EHCI controller has TLL mode of operation for all 3 ports.
 +      Use this mode when no transciever is present
 +endchoice
  
  config USB_EHCI_ROOT_HUB_TT
        bool "Root Hub Transaction Translators"
@@@ -129,29 -110,18 +129,18 @@@ config USB_ISP116X_HC
  
  config USB_ISP1760_HCD
        tristate "ISP 1760 HCD support"
-       depends on USB && EXPERIMENTAL
+       depends on USB && EXPERIMENTAL && (PCI || PPC_OF)
        ---help---
          The ISP1760 chip is a USB 2.0 host controller.
  
          This driver does not support isochronous transfers or OTG.
+         This USB controller is usually attached to a non-DMA-Master
+         capable bus. NXP's eval kit brings this chip on PCI card
+         where the chip itself is behind a PLB to simulate such
+         a bus.
  
          To compile this driver as a module, choose M here: the
-         module will be called isp1760-hcd.
- config USB_ISP1760_PCI
-       bool "Support for the PCI bus"
-       depends on USB_ISP1760_HCD && PCI
-       ---help---
-         Enables support for the device present on the PCI bus.
-         This should only be required if you happen to have the eval kit from
-         NXP and you are going to test it.
- config USB_ISP1760_OF
-       bool "Support for the OF platform bus"
-       depends on USB_ISP1760_HCD && PPC_OF
-       ---help---
-         Enables support for the device present on the PowerPC
-         OpenFirmware platform bus.
+         module will be called isp1760.
  
  config USB_OHCI_HCD
        tristate "OHCI HCD support"
@@@ -485,6 -485,7 +485,7 @@@ static int ehci_init(struct usb_hcd *hc
         * periodic_size can shrink by USBCMD update if hcc_params allows.
         */
        ehci->periodic_size = DEFAULT_I_TDPS;
+       INIT_LIST_HEAD(&ehci->cached_itd_list);
        if ((retval = ehci_mem_init(ehci, GFP_KERNEL)) < 0)
                return retval;
  
  
        ehci->reclaim = NULL;
        ehci->next_uframe = -1;
+       ehci->clock_frame = -1;
  
        /*
         * dedicate a qh for the async ring head, since we couldn't unlink
@@@ -643,7 -645,7 +645,7 @@@ static int ehci_run (struct usb_hcd *hc
  static irqreturn_t ehci_irq (struct usb_hcd *hcd)
  {
        struct ehci_hcd         *ehci = hcd_to_ehci (hcd);
-       u32                     status, pcd_status = 0, cmd;
+       u32                     status, masked_status, pcd_status = 0, cmd;
        int                     bh;
  
        spin_lock (&ehci->lock);
                goto dead;
        }
  
-       status &= INTR_MASK;
-       if (!status) {                  /* irq sharing? */
+       masked_status = status & INTR_MASK;
+       if (!masked_status) {           /* irq sharing? */
                spin_unlock(&ehci->lock);
                return IRQ_NONE;
        }
  
        /* clear (just) interrupts */
-       ehci_writel(ehci, status, &ehci->regs->status);
+       ehci_writel(ehci, masked_status, &ehci->regs->status);
        cmd = ehci_readl(ehci, &ehci->regs->command);
        bh = 0;
  
  
                        /* start 20 msec resume signaling from this port,
                         * and make khubd collect PORT_STAT_C_SUSPEND to
-                        * stop that signaling.
+                        * stop that signaling.  Use 5 ms extra for safety,
+                        * like usb_port_resume() does.
                         */
-                       ehci->reset_done [i] = jiffies + msecs_to_jiffies (20);
+                       ehci->reset_done[i] = jiffies + msecs_to_jiffies(25);
                        ehci_dbg (ehci, "port %d remote wakeup\n", i + 1);
                        mod_timer(&hcd->rh_timer, ehci->reset_done[i]);
                }
  
        /* PCI errors [4.15.2.4] */
        if (unlikely ((status & STS_FATAL) != 0)) {
+               ehci_err(ehci, "fatal error\n");
                dbg_cmd (ehci, "fatal", ehci_readl(ehci,
                                                   &ehci->regs->command));
                dbg_status (ehci, "fatal", status);
-               if (status & STS_HALT) {
-                       ehci_err (ehci, "fatal error\n");
+               ehci_halt(ehci);
  dead:
-                       ehci_reset (ehci);
-                       ehci_writel(ehci, 0, &ehci->regs->configured_flag);
-                       /* generic layer kills/unlinks all urbs, then
-                        * uses ehci_stop to clean up the rest
-                        */
-                       bh = 1;
-               }
+               ehci_reset(ehci);
+               ehci_writel(ehci, 0, &ehci->regs->configured_flag);
+               /* generic layer kills/unlinks all urbs, then
+                * uses ehci_stop to clean up the rest
+                */
+               bh = 1;
        }
  
        if (bh)
@@@ -1015,11 -1017,6 +1017,11 @@@ MODULE_LICENSE ("GPL")
  #define       PLATFORM_DRIVER         ehci_hcd_au1xxx_driver
  #endif
  
 +#ifdef CONFIG_ARCH_OMAP34XX
 +#include "ehci-omap.c"
 +#define       PLATFORM_DRIVER         ehci_hcd_omap_driver
 +#endif
 +
  #ifdef CONFIG_PPC_PS3
  #include "ehci-ps3.c"
  #define       PS3_SYSTEM_BUS_DRIVER   ps3_ehci_driver
@@@ -1054,6 -1051,12 +1056,12 @@@ static int __init ehci_hcd_init(void
  {
        int retval = 0;
  
+       set_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
+       if (test_bit(USB_UHCI_LOADED, &usb_hcds_loaded) ||
+                       test_bit(USB_OHCI_LOADED, &usb_hcds_loaded))
+               printk(KERN_WARNING "Warning! ehci_hcd should always be loaded"
+                               " before uhci_hcd and ohci_hcd, not after\n");
        pr_debug("%s: block sizes: qh %Zd qtd %Zd itd %Zd sitd %Zd\n",
                 hcd_name,
                 sizeof(struct ehci_qh), sizeof(struct ehci_qtd),
  
  #ifdef DEBUG
        ehci_debug_root = debugfs_create_dir("ehci", NULL);
-       if (!ehci_debug_root)
-               return -ENOENT;
+       if (!ehci_debug_root) {
+               retval = -ENOENT;
+               goto err_debug;
+       }
  #endif
  
  #ifdef PLATFORM_DRIVER
@@@ -1109,7 -1114,9 +1119,9 @@@ clean0
  #ifdef DEBUG
        debugfs_remove(ehci_debug_root);
        ehci_debug_root = NULL;
+ err_debug:
  #endif
+       clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
        return retval;
  }
  module_init(ehci_hcd_init);
@@@ -1131,6 -1138,7 +1143,7 @@@ static void __exit ehci_hcd_cleanup(voi
  #ifdef DEBUG
        debugfs_remove(ehci_debug_root);
  #endif
+       clear_bit(USB_EHCI_LOADED, &usb_hcds_loaded);
  }
  module_exit(ehci_hcd_cleanup);
  
  #include <linux/delay.h>
  #include <linux/clk.h>
  #include <linux/io.h>
+ #include <linux/gpio.h>
  
 -#include <asm/arch/hardware.h>
 -#include <asm/arch/memory.h>
 -#include <asm/arch/gpio.h>
 +#include <mach/hardware.h>
 +#include <mach/gpio.h>
 +#include <asm/memory.h>
  #include <asm/mach-types.h>
  
  #include "musb_core.h"
  
  #ifdef CONFIG_MACH_DAVINCI_EVM
- #include <mach/i2c-client.h>
+ #define GPIO_nVBUS_DRV                87
  #endif
  
  #include "davinci.h"
@@@ -138,7 -139,6 +139,6 @@@ static int vbus_state = -1
  /* VBUS SWITCHING IS BOARD-SPECIFIC */
  
  #ifdef CONFIG_MACH_DAVINCI_EVM
- #ifndef CONFIG_MACH_DAVINCI_EVM_OTG
  
  /* I2C operations are always synchronous, and require a task context.
   * With unloaded systems, using the shared workqueue seems to suffice
   */
  static void evm_deferred_drvvbus(struct work_struct *ignored)
  {
-       davinci_i2c_expander_op(0x3a, USB_DRVVBUS, vbus_state);
+       gpio_set_value_cansleep(GPIO_nVBUS_DRV, vbus_state);
        vbus_state = !vbus_state;
  }
  static DECLARE_WORK(evm_vbus_work, evm_deferred_drvvbus);
  
- #endif        /* modified board */
  #endif        /* EVM */
  
  static void davinci_source_power(struct musb *musb, int is_on, int immediate)
  
  #ifdef CONFIG_MACH_DAVINCI_EVM
        if (machine_is_davinci_evm()) {
- #ifdef CONFIG_MACH_DAVINCI_EVM_OTG
-               /* modified EVM board switching VBUS with GPIO(6) not I2C
-                * NOTE:  PINMUX0.RGB888 (bit23) must be clear
-                */
-               if (is_on)
-                       gpio_set(GPIO(6));
-               else
-                       gpio_clear(GPIO(6));
-               immediate = 1;
- #else
                if (immediate)
-                       davinci_i2c_expander_op(0x3a, USB_DRVVBUS, !is_on);
+                       gpio_set_value_cansleep(GPIO_nVBUS_DRV, vbus_state);
                else
                        schedule_work(&evm_vbus_work);
- #endif
        }
  #endif
        if (immediate)
diff --combined kernel/printk.c
@@@ -44,10 -44,6 +44,10 @@@ void asmlinkage __attribute__((weak)) e
  
  #define __LOG_BUF_LEN (1 << CONFIG_LOG_BUF_SHIFT)
  
 +#ifdef CONFIG_DEBUG_LL
 +extern void printascii(char *);
 +#endif
 +
  /* printk's without a loglevel use this.. */
  #define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */
  
@@@ -425,7 -421,7 +425,7 @@@ out
        return error;
  }
  
asmlinkage long sys_syslog(int type, char __user *buf, int len)
SYSCALL_DEFINE3(syslog, int, type, char __user *, buf, int, len)
  {
        return do_syslog(type, buf, len);
  }
@@@ -712,9 -708,6 +712,9 @@@ asmlinkage int vprintk(const char *fmt
        printed_len += vscnprintf(printk_buf + printed_len,
                                  sizeof(printk_buf) - printed_len, fmt, args);
  
 +#ifdef        CONFIG_DEBUG_LL
 +      printascii(printk_buf);
 +#endif
  
        /*
         * Copy the output into log_buf.  If the caller didn't provide
@@@ -789,11 -782,6 +789,6 @@@ EXPORT_SYMBOL(vprintk)
  
  #else
  
- asmlinkage long sys_syslog(int type, char __user *buf, int len)
- {
-       return -ENOSYS;
- }
  static void call_console_drivers(unsigned start, unsigned end)
  {
  }
@@@ -989,10 -977,25 +984,25 @@@ int is_console_locked(void
        return console_locked;
  }
  
- void wake_up_klogd(void)
+ static DEFINE_PER_CPU(int, printk_pending);
+ void printk_tick(void)
  {
-       if (!oops_in_progress && waitqueue_active(&log_wait))
+       if (__get_cpu_var(printk_pending)) {
+               __get_cpu_var(printk_pending) = 0;
                wake_up_interruptible(&log_wait);
+       }
+ }
+ int printk_needs_cpu(int cpu)
+ {
+       return per_cpu(printk_pending, cpu);
+ }
+ void wake_up_klogd(void)
+ {
+       if (waitqueue_active(&log_wait))
+               __raw_get_cpu_var(printk_pending) = 1;
  }
  
  /**
diff --combined security/Kconfig
@@@ -92,36 -92,8 +92,37 @@@ config SECURITY_ROOTPLU
  
          See <http://www.linuxjournal.com/article.php?sid=6279> for
          more information about this module.
 +        
 +        If you are unsure how to answer this question, answer N.
 +
 +config SECURITY_LOWMEM
 +      tristate "Low memory watermark support"
 +      depends on SECURITY
 +      help
 +        Implements low memory watermark support
 +
 +        If you are unsure how to answer this question, answer N.
 +
 +config SECURITY_DEFAULT_MMAP_MIN_ADDR
 +        int "Low address space to protect from user allocation"
 +        depends on SECURITY
 +        default 0
 +        help
 +        This is the portion of low virtual memory which should be protected
 +        from userspace allocation.  Keeping a user from writing to low pages
 +        can help reduce the impact of kernel NULL pointer bugs.
 +
 +        For most ia64, ppc64 and x86 users with lots of address space
 +        a value of 65536 is reasonable and should cause no problems.
 +        On arm and other archs it should not be higher than 32768.
 +        Programs which use vm86 functionality would either need additional
 +        permissions from either the LSM or the capabilities module or have
 +        this protection disabled.
 +
 +        This value can be changed after boot using the
 +        /proc/sys/vm/mmap_min_addr tunable.
  
+         If you are unsure how to answer this question, answer N.
  
  source security/selinux/Kconfig
  source security/smack/Kconfig