1. 16 Nov, 2012 11 commits
    • Daniel Kurtz's avatar
      i2c: s3c2410: use exponential back off while polling for bus idle · fe724bf9
      Daniel Kurtz authored
      Usually, the i2c controller has finished emitting the i2c STOP before the
      driver reaches the bus idle polling loop.  Optimize for this most common
      case by reading IICSTAT first and potentially skipping the loop.
      
      If the cpu is faster than the hardware, we wait for bus idle in a polling
      loop.  However, since the duration of one iteration of the loop is
      dependent on cpu freq, and this i2c IP is used on many different systems,
      use a time based loop timeout (5 ms).
      
      We would like very low latencies to detect bus idle for the normal
      'fast' case.  However, if a device is slow to release the bus for some
      reason, it could hold off the STOP generation for up to several
      milliseconds.  Rapidly polling for bus idle would seriously load the CPU
      while waiting for it to release the bus.  So, use a partial exponential
      backoff as a compromise between idle detection latency and cpu load.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: default avatarNaveen Krishna Chatradhi <ch.naveen@samsung.com>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      fe724bf9
    • Daniel Kurtz's avatar
      i2c: s3c2410: do not generate STOP for QUIRK_HDMIPHY · 0da2e776
      Daniel Kurtz authored
      The datasheet says that the STOP sequence should be:
       1) I2CSTAT.5 = 0	- Clear BUSY (or 'generate STOP')
       2) I2CCON.4 = 0	- Clear IRQPEND
       3) Wait until the stop condition takes effect.
       4*) I2CSTAT.4 = 0 	- Clear TXRXEN
      
      Where, step "4*" is only for buses with the "HDMIPHY" quirk.
      
      However, after much experimentation, it appears that:
       a) normal buses automatically clear BUSY and transition from
          Master->Slave when they complete generating a STOP condition.
          Therefore, step (3) can be done in doxfer() by polling I2CCON.4
          after starting the STOP generation here.
       b) HDMIPHY bus does neither, so there is no way to do step 3.
          There is no indication when this bus has finished generating STOP.
      
      In fact, we have found that as soon as the IRQPEND bit is cleared in
      step 2, the HDMIPHY bus generates the STOP condition, and then immediately
      starts transferring another data byte, even though the bus is supposedly
      stopped.  This is presumably because the bus is still in "Master" mode,
      and its BUSY bit is still set.
      
      To avoid these extra post-STOP transactions on HDMI phy devices, we just
      disable Serial Output on the bus (I2CSTAT.4 = 0) directly, instead of
      first generating a proper STOP condition.  This should float SDA & SCK
      terminating the transfer.  Subsequent transfers start with a proper START
      condition, and proceed normally.
      
      The HDMIPHY bus is an internal bus that always has exactly two devices,
      the host as Master and the HDMIPHY device as the slave. Skipping the STOP
      condition has been tested on this bus and works.
      
      Also, since we disable the bus directly from the isr, we can skip the bus
      idle polling loop at the end of doxfer().
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: default avatarNaveen Krishna Chatradhi <ch.naveen@samsung.com>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      0da2e776
    • Daniel Kurtz's avatar
      i2c: s3c2410: grab adapter lock while changing i2c clock · 9bcd04bf
      Daniel Kurtz authored
      We probably don't want to change I2C frequency while a transfer is in
      progress.  The current implementation grabs a spinlock, but that only
      protected the writes to IICCON when starting a message, it didn't protect
      against clock changes in the middle of a transaction.
      
      Note: The i2c-core already grabs the adapter lock before calling
      s3c24xx_i2c_doxfer(), which ensures that only one caller is issuing a
      xfer at a time. This means it is not necessary to disable interrupts
      (spin_lock_irqsave) when changing frequencies, since there won't be
      any i2c interrupts if there is no on-going xfer.
      
      Lastly, i2c_lock_adapter() may cause the cpufreq_transition to sleep if
      if a xfer is in progress, but this is ok since cpufreq notifiers are
      called in a kernel thread, and there are already cases where it could
      sleep, such as when using i2c to update the output of a voltage
      regulator.
      
      Note: the cpufreq part of this change has no functional affect on
      	exynos, where the i2c clock is independent of the cpufreq.
      	But, there is a slight perfomance boost since we no longer need to
      	lock/unlock an additional spinlock.
      Signed-off-by: default avatarDaniel Kurtz <djkurtz@chromium.org>
      Signed-off-by: default avatarNaveen Krishna Chatradhi <ch.naveen@samsung.com>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      9bcd04bf
    • Tomasz Figa's avatar
      i2c: s3c2410: Add support for pinctrl · 2693ac69
      Tomasz Figa authored
      This patch adds support for pin configuration using pinctrl subsystem
      to the i2c-s3c2410 driver.
      Signed-off-by: default avatarTomasz Figa <t.figa@samsung.com>
      Signed-off-by: default avatarKyungmin Park <kyungmin.park@samsung.com>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      2693ac69
    • Mark Brown's avatar
      i2c: s3c2410: Convert to devm_request_and_ioremap() · a72ad456
      Mark Brown authored
      A small code saving and less error handling to worry about.
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      a72ad456
    • Mark Brown's avatar
      i2c: s3c2410: Refactor ifdefs for PM_SLEEP · 2935e0e0
      Mark Brown authored
      Use the PM_SLEEP ifdef for system suspend and resume. This is partly
      in preparation for adding runtime operations and partly because a user
      may in theory choose to enable runtime suspend but not system suspend.
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Reviewed-by: default avatarShubhrajyoti D <shubhrajyoti@ti.com>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      2935e0e0
    • Maxime Ripard's avatar
      i2c: mux: Add dt support to i2c-mux-gpio driver · 9b7a0c40
      Maxime Ripard authored
      Allow the i2c-mux-gpio to be used by a device tree enabled device. The
      bindings are inspired by the one found in the i2c-mux-pinctrl driver.
      Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
      Reviewed-by: default avatarStephen Warren <swarren@nvidia.com>
      Acked-by: default avatarPeter Korsgaard <peter.korsgaard@barco.com>
      
      [wsa: fixed some whitespace]
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      9b7a0c40
    • Shinya Kuribayashi's avatar
      i2c: i2c-sh_mobile: fix spurious transfer request timed out · 29fb08c3
      Shinya Kuribayashi authored
      Ensure that any of preceding register write operations to the I2C
      hardware block reached the module, and the write data is reflected
      in the registers, before leaving the interrupt handler.
      
      Otherwise, we'll suffer from spurious WAIT interrupts that lead to
      'Transfer request timed out' message, and the transaction failed.
      Reported-by: default avatarTeppei Kamijou <teppei.kamijou.yb@renesas.com>
      Signed-off-by: default avatarShinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      29fb08c3
    • Shinya Kuribayashi's avatar
      i2c: i2c-sh_mobile: support I2C hardware block with a faster operating clock · ebd5ac16
      Shinya Kuribayashi authored
      On newer SH-/R-Mobile SoCs, a clock supply to the I2C hardware block,
      which is used to generate the SCL clock output, is getting faster than
      before, while on the other hand, the SCL clock control registers, ICCH
      and ICCL, stay unchanged in 9-bit-wide (8+1).
      
      On such silicons, the internal SCL clock counter gets incremented every
      2 clocks of the operating clock.
      
      This patch makes it configurable through platform data.
      Signed-off-by: default avatarShinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      ebd5ac16
    • Shinya Kuribayashi's avatar
      i2c: i2c-sh_mobile: optimize ICCH/ICCL values according to I2C bus speed · 23a61291
      Shinya Kuribayashi authored
      ICCH/ICCL values is supposed to be calculated/optimized to strictly meet
      the timing specs required by the I2C standard. The resulting I2C bus
      speed does not matter at all, if it's less than 100 or 400 kHz.
      
      With this change, sh_mobile_i2c_icch() is virtually identical to
      sh_mobile_i2c_iccl(), but they're providing good descriptions of
      SH-/R-Mobile I2C hardware spec, and I'd leave them as separated.
      
      Also fix a typo in the comment, print icch/iccl values at probe, etc.
      Signed-off-by: default avatarShinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
      
      [wsa: squashed two patches for bisectability]
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      23a61291
    • Shinya Kuribayashi's avatar
      i2c: i2c-sh_mobile: calculate clock parameters at driver probing time · 7b0e6292
      Shinya Kuribayashi authored
      Currently SCL clock parameters (ICCH/ICCL) are calculated in
      activate_ch(), which gets called every time sh_mobile_i2c_xfer() is
      processed, while each I2C bus speed is system-defined and in general
      those parameters do not have to be updated over I2C transactions.
      
      The only reason I could see having it transaction-time is to adjust
      ICCH/ICCL values according to the operating frequency of the I2C
      hardware block, in the face of DFS (Dynamic Frequency Scaling).
      
      However, this won't be necessary.
      
      The operating frequency of the I2C hardware block can change _even_
      in the middle of I2C transactions.  There is no way to prevent it
      from happening, and I2C hardware block can work with such dynamic
      frequency change, of course.
      
      Another is that ICCH/ICCL clock parameters optimized for the faster
      operating frequency, can also be applied to the slower operating
      frequency, as long as slave devices work.  However, the converse is
      not true.  It would violate SCL timing specs of the I2C standard.
      
      What we can do now is to calculate the ICCH/ICCL clock parameters
      according to the fastest operating clock of the I2C hardware block.
      And if that's the case, that calculation should be done just once
      at driver-module-init time.
      
      This patch moves ICCH/ICCL calculating part from activate_ch() into
      sh_mobile_i2c_init(), and call it from sh_mobile_i2c_probe().
      
      Note that sh_mobile_i2c_init() just prepares clock parameters using
      the clock rate and platform data provided, but does _not_ make any
      hardware I/O accesses.  We don't have to care about run-time PM
      maintenance here.
      Signed-off-by: default avatarShinya Kuribayashi <shinya.kuribayashi.px@renesas.com>
      Signed-off-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      7b0e6292
  2. 14 Nov, 2012 14 commits
  3. 13 Nov, 2012 3 commits
  4. 12 Nov, 2012 1 commit
  5. 11 Nov, 2012 1 commit
  6. 10 Nov, 2012 10 commits
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net · b251f0f3
      Linus Torvalds authored
      Pull networking fixes from David Miller:
       "Bug fixes galore, mostly in drivers as is often the case:
      
        1) USB gadget and cdc_eem drivers need adjustments to their frame size
           lengths in order to handle VLANs correctly.  From Ian Coolidge.
      
        2) TIPC and several network drivers erroneously call tasklet_disable
           before tasklet_kill, fix from Xiaotian Feng.
      
        3) r8169 driver needs to apply the WOL suspend quirk to more chipsets,
           fix from Cyril Brulebois.
      
        4) Fix multicast filters on RTL_GIGA_MAC_VER_35 r8169 chips, from
           Nathan Walp.
      
        5) FDB netlink dumps should use RTM_NEWNEIGH as the message type, not
           zero.  From John Fastabend.
      
        6) Fix smsc95xx tx checksum offload on big-endian, from Steve
           Glendinning.
      
        7) __inet_diag_dump() needs to repsect and report the error value
           returned from inet_diag_lock_handler() rather than ignore it.
           Otherwise if an inet diag handler is not available for a particular
           protocol, we essentially report success instead of giving an error
           indication.  Fix from Cyrill Gorcunov.
      
        8) When the QFQ packet scheduler sees TSO/GSO packets it does not
           handle things properly, and in fact ends up corrupting it's
           datastructures as well as mis-schedule packets.  Fix from Paolo
           Valente.
      
        9) Fix oopser in skb_loop_sk(), from Eric Leblond.
      
        10) CXGB4 passes partially uninitialized datastructures in to FW
            commands, fix from Vipul Pandya.
      
        11) When we send unsolicited ipv6 neighbour advertisements, we should
            send them to the link-local allnodes multicast address, as per
            RFC4861.  Fix from Hannes Frederic Sowa.
      
        12) There is some kind of bug in the usbnet's kevent deferral
            mechanism, but more immediately when it triggers an uncontrolled
            stream of kernel messages spam the log.  Rate limit the error log
            message triggered when this problem occurs, as sending thousands
            of error messages into the kernel log doesn't help matters at all,
            and in fact makes further diagnosis more difficult.
      
            From Steve Glendinning.
      
        13) Fix gianfar restore from hibernation, from Wang Dongsheng.
      
        14) The netlink message attribute sizes are wrong in the ipv6 GRE
            driver, it was using the size of ipv4 addresses instead of ipv6
            ones :-) Fix from Nicolas Dichtel."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
        gre6: fix rtnl dump messages
        gianfar: ethernet vanishes after restoring from hibernation
        usbnet: ratelimit kevent may have been dropped warnings
        ipv6: send unsolicited neighbour advertisements to all-nodes
        net: usb: cdc_eem: Fix rx skb allocation for 802.1Q VLANs
        usb: gadget: g_ether: fix frame size check for 802.1Q
        cxgb4: Fix initialization of SGE_CONTROL register
        isdn: Make CONFIG_ISDN depend on CONFIG_NETDEVICES
        cxgb4: Initialize data structures before using.
        af-packet: fix oops when socket is not present
        pkt_sched: enable QFQ to support TSO/GSO
        net: inet_diag -- Return error code if protocol handler is missed
        net: bnx2x: Fix typo in bnx2x driver
        smsc95xx: fix tx checksum offload for big endian
        rtnetlink: Use nlmsg type RTM_NEWNEIGH from dflt fdb dump
        ptp: update adjfreq callback description
        r8169: allow multicast packets on sub-8168f chipset.
        r8169: Fix WoL on RTL8168d/8111d.
        drivers/net: use tasklet_kill in device remove/close process
        tipc: do not use tasklet_disable before tasklet_kill
      b251f0f3
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc · 2b1768f3
      Linus Torvalds authored
      Pull sparc fixes from David Miller:
       "Several build/bug fixes for sparc, including:
      
        1) Configuring a mix of static vs.  modular sparc64 crypto modules
           didn't work, remove an ill-conceived attempt to only have to build
           the device match table for these drivers once to fix the problem.
      
           Reported by Meelis Roos.
      
        2) Make the montgomery multiple/square and mpmul instructions actually
           usable in 32-bit tasks.  Essentially this involves providing 32-bit
           userspace with a way to use a 64-bit stack when it needs to.
      
        3) Our sparc64 atomic backoffs don't yield cpu strands properly on
           Niagara chips.  Use pause instruction when available to achieve
           this, otherwise use a benign instruction we know blocks the strand
           for some time.
      
        4) Wire up kcmp
      
        5) Fix the build of various drivers by removing the unnecessary
           blocking of OF_GPIO when SPARC.
      
        6) Fix unintended regression wherein of_address_to_resource stopped
           being provided.  Fix from Andreas Larsson.
      
        7) Fix NULL dereference in leon_handle_ext_irq(), also from Andreas
           Larsson."
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc:
        sparc64: Fix build with mix of modular vs. non-modular crypto drivers.
        sparc: Support atomic64_dec_if_positive properly.
        of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again
        sparc32, leon: Check for existent irq_map entry in leon_handle_ext_irq
        sparc: Add sparc support for platform_get_irq()
        sparc: Allow OF_GPIO on sparc.
        qlogicpti: Fix build warning.
        sparc: Wire up sys_kcmp.
        sparc64: Improvde documentation and readability of atomic backoff code.
        sparc64: Use pause instruction when available.
        sparc64: Fix cpu strand yielding.
        sparc64: Make montmul/montsqr/mpmul usable in 32-bit threads.
      2b1768f3
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.samba.org/sfrench/cifs-2.6 · affd9a8d
      Linus Torvalds authored
      Pull cifs fixes from Jeff Layton.
      
      * 'for-linus' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: Do not lookup hashed negative dentry in cifs_atomic_open
        cifs: fix potential buffer overrun in cifs.idmap handling code
      affd9a8d
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64 · 487bda54
      Linus Torvalds authored
      Pull arm64 fixes from Catalin Marinas:
       - correct argument type (pgprot_t) when calling __ioremap()
       - PCI_IOBASE virtual address change
       - use architected event for CPU cycle counter
       - fix ELF core dumping
       - select CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION
       - missing completion for secondary CPU boot
       - booting on systems with all memory beyond 4GB
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/cmarinas/linux-aarch64:
        arm64: mm: fix booting on systems with no memory below 4GB
        arm64: smp: add missing completion for secondary boot
        arm64: compat: select CONFIG_ARCH_WANT_COMPAT_IPC_PARSE_VERSION
        arm64: elf: fix core dumping definitions for GP and FP registers
        arm64: perf: use architected event for CPU cycle counter
        arm64: Move PCI_IOBASE closer to MODULES_VADDR
        arm64: Use pgprot_t as the last argument when invoking __ioremap()
      487bda54
    • Linus Torvalds's avatar
      Merge tag 'stable/for-linus-3.7-rc5-tag' of... · 0020dd0b
      Linus Torvalds authored
      Merge tag 'stable/for-linus-3.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen
      
      Pull Xen fixes from Konrad Rzeszutek Wilk:
       "There are three ARM compile fixes (we forgot to export certain
        functions and if the drivers are built as an module - we go belly-up).
      
        There is also an mismatch of irq_enter() / exit_idle() calls sequence
        which were fixed some time ago in other piece of codes, but failed to
        appear in the Xen code.
      
        Lastly a fix for to help in the field with troubleshooting in case we
        cannot get the appropriate parameter and also fallback code when
        working with very old hypervisors."
      
      Bug-fixes:
       - Fix compile issues on ARM.
       - Fix hypercall fallback code for old hypervisors.
       - Print out which HVM parameter failed if it fails.
       - Fix idle notifier call after irq_enter.
      
      * tag 'stable/for-linus-3.7-rc5-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/xen:
        xen/arm: Fix compile errors when drivers are compiled as modules (export more).
        xen/arm: Fix compile errors when drivers are compiled as modules.
        xen/generic: Disable fallback build on ARM.
        xen/events: fix RCU warning, or Call idle notifier after irq_enter()
        xen/hvm: If we fail to fetch an HVM parameter print out which flag it is.
        xen/hypercall: fix hypercall fallback code for very old hypervisors
      0020dd0b
    • David S. Miller's avatar
      sparc64: Fix build with mix of modular vs. non-modular crypto drivers. · 226f7cea
      David S. Miller authored
      We tried linking in a single built object to hold the device table,
      but only works if all of the sparc64 crypto modules get built the same
      way (modular vs. non-modular).
      
      Just include the device ID stub into each driver source file so that
      the table gets compiled into the correct result in all cases.
      Reported-by: default avatarMeelis Roos <mroos@linux.ee>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      226f7cea
    • David S. Miller's avatar
      sparc: Support atomic64_dec_if_positive properly. · 193d2aad
      David S. Miller authored
      Sparc32 already supported it, as a consequence of using the
      generic atomic64 implementation.  And the sparc64 implementation
      is rather trivial.
      
      This allows us to set ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE for all
      of sparc, and avoid the annoying warning from lib/atomic64_test.c
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      193d2aad
    • Andreas Larsson's avatar
      of/address: sparc: Declare of_address_to_resource() as an extern function for sparc again · 0bce04be
      Andreas Larsson authored
      This bug-fix makes sure that of_address_to_resource is defined extern for sparc
      so that the sparc-specific implementation of of_address_to_resource() is once
      again used when including include/linux/of_address.h in a sparc context. A
      number of drivers in mainline relies on this function working for sparc.
      
      The bug was introduced in a850a755, "of/address:
      add empty static inlines for !CONFIG_OF". Contrary to that commit title, the
      static inlines are added for !CONFIG_OF_ADDRESS, and CONFIG_OF_ADDRESS is never
      defined for sparc. This is good behavior for the other functions in
      include/linux/of_address.h, as the extern functions defined in
      drivers/of/address.c only gets linked when OF_ADDRESS is configured. However,
      for of_address_to_resource there exists a sparc-specific implementation in
      arch/sparc/arch/sparc/kernel/of_device_common.c
      
      Solution suggested by: Sam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
      Acked-by: default avatarRob Herring <rob.herring@calxeda.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      0bce04be
    • Andreas Larsson's avatar
      sparc32, leon: Check for existent irq_map entry in leon_handle_ext_irq · 20424d85
      Andreas Larsson authored
      If an irq is being unlinked concurrently with leon_handle_ext_irq,
      irq_map[eirq] might be null in leon_handle_ext_irq. Make sure that
      this is not dereferenced.
      Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
      Acked-by: default avatarSam Ravnborg <sam@ravnborg.org>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      20424d85
    • Andreas Larsson's avatar
      sparc: Add sparc support for platform_get_irq() · 5cf8f7db
      Andreas Larsson authored
      This adds sparc support for platform_get_irq that in the normal case use
      platform_get_resource() to get an irq. This standard approach fails for sparc as
      there are no resources of type IORESOURCE_IRQ for irqs for sparc.
      
      Cross platform drivers can then use this standard platform function and work on
      sparc instead of having to have a special case for sparc.
      Signed-off-by: default avatarAndreas Larsson <andreas@gaisler.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      5cf8f7db