02 Mar, 2012

2 commits

  • This provides a single centralized name for the default state.

    Update PIN_MAP_* macros to use this state name, instead of requiring the
    user to pass a state name in.

    With this change, hog entries in the mapping table are defined as those
    with state name PINCTRL_STATE_DEFAULT, i.e. all entries have the same
    name. This interacts badly with the nested iteration over mapping table
    entries in pinctrl_hog_maps() and pinctrl_hog_map() which would now
    attempt to claim each hog mapping table entry multiple times. Replacing
    the custom hog code with a simple pinctrl_get()/pinctrl_enable().

    Update documentation and mapping tables to use this.

    Signed-off-by: Stephen Warren
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • At present, pinctrl_get() assumes that all matching mapping table entries
    have the same "function" value, albeit potentially applied to different
    pins/groups.

    This change removes this restriction; pinctrl_get() can now handle a set
    of mapping tables where different functions are applied to the various
    pins/groups.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     

01 Mar, 2012

3 commits

  • The debugfs file pinctrl-maps is a system-wide file, not specific to any
    pin controller, so place it in the top-level directory.

    Also, move the code implementing the file to keep the order of all the
    functions matching the order they're created in pinctrl_init_*debugfs().
    The only non-obvious change here is no private data is passed to
    debugfs_create_file() or single_open().

    Signed-off-by: Stephen Warren
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • The lookup key in struct pinctrl_map is (.dev_name, .name). Re-order the
    struct definition to put the lookup key fields first, and the result
    values afterwards. To me at least, this slightly better reflects the
    lookup process.

    Update the documentation in a similar fashion.

    Note: PIN_MAP*() macros aren't updated; I plan to update this once later
    when enhancing the mapping table format to support pin config to reduce
    churn.

    Signed-off-by: Stephen Warren
    Acked-by: Dong Aisheng
    [Rebased for cherry-picking]
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • The debugfs file pinmux-pins used to tell which function was
    enabled but now states simply which device owns the pin. Being
    owned by the pinctrl driver itself means just that it's hogged
    so be a bit more helpful by printing that.

    ChangeLog v1->v2:
    - Preserve the self-referential owner field, just clarify that
    when the pin controller states itself as owner this means
    that it's hogged.

    Acked-by: Dong Aisheng
    Acked-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Linus Walleij
     

24 Feb, 2012

4 commits

  • struct pinctrl_dev's pin_desc_tree_lock and pinctrl_hogs_lock aren't
    useful; the data they protect is read-only except when registering or
    unregistering a pinctrl_dev, and at those times, it doesn't make sense to
    protect one part of the structure independently from the rest.

    Move pinctrl_init_device_debugfs() to the end of pinctrl_register() so
    that debugfs can't access the struct pinctrl_dev until it's fully
    initialized, i.e. after the hogs are set up.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • This hopefully makes it harder to take the sizeof the wrong type.

    Signed-off-by: Stephen Warren
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • e.g. dev_err instead of pr_err prints messages in a slightly more
    standardized format.

    Also, add a few more error messages to track down errors.

    Also, some small cleanups of messages.

    Signed-off-by: Stephen Warren
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Hog entries are mapping table entries with .ctrl_dev_name == .dev_name.
    All other mapping table entries need .dev_name set so that they will
    match some pinctrl_get() call. All extant PIN_MAP*() macros set
    .dev_name.

    So, there is no reason to allow mapping table entries without .dev_name
    set. Update the code and documentation to disallow this.

    Signed-off-by: Stephen Warren
    Acked-by: Dong Aisheng
    Signed-off-by: Linus Walleij

    Stephen Warren
     

23 Feb, 2012

14 commits

  • pinconf_groups_show() wrote all debug information on one line. Fix it to
    match pinconf_pins_show() and be legible.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • When pins are requested/acquired/got, some device becomes the owner of
    their mux setting. At this point, it isn't certain which mux function
    will be selected for the pin, since this may vary between each of the
    device's states in the pinctrl mapping table. As such, we should record
    the owning device, not what we think the initial mux setting will be,
    when requesting pins.

    This doesn't make a lot of difference right now since pinctrl_get gets
    only one single device/state combination, but this will make a difference
    when pinctrl_get gets all states, and pinctrl_select_state can switch
    between states.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • This is a serious error, and the pin control system will not function
    correctly if it ends up not programing the mapping table entries into
    the HW. Instead of just ignoring this, error out.

    Signed-off-by: Stephen Warren
    [rebased to fit the applied patch series, cast error to pointer]
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • This may be perfectly legitimate. An IP block may get re-used
    across SoCs. Not all of those SoCs may need pinmux settings for the
    IP block, e.g. if one SoC dedicates pins to that function but
    another doesn't. The driver won't know this, and will always
    attempt to set up the pinmux. The mapping table defines whether any
    HW programming is actually needed.

    Acked-by: Shawn Guo
    Signed-off-by: Stephen Warren
    [rebased to fit the applied patch series]
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • These are already disallowed. Clean up some code that doesn't assume this.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • This solves the riddle on how the U300 pin controller shall be
    able to reference the struct gpio_chip even though these are
    two separate drivers: spawn the pinctrl child from the GPIO
    driver and pass in the struct gpio_chip as platform data.
    In the process we rename the U300 "pinmux-u300" to
    "pinctrl-u300" so as not to confuse.

    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • * Make all functions internal to core.c static. Remove any of these from
    core.h.
    * Add any missing EXPORT_SYMBOL_GPL().

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Modify the two files so that the order of function prototypes in the
    header matches the order of implementations in the .c file.

    Don't prototype a couple of internal functions.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Modify the two files so that the order of function prototypes in the
    header matches the order of implementations in the .c file.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Instead of storing a single array of mapping table entries, which
    requires realloc()ing that array each time it's extended and copying
    the new data, simply store a list of pointers to the individual chunks.
    This also removes the need to copy the mapping table at all; a pointer
    is maintained to the original table, this saving memory.

    A macro for_each_maps() is introduced to hide the additional complexity
    of iterating over the map entries.

    This change will also simplify removing chunks of entries from the mapping
    table. This isn't important right now, but will be in the future, when
    mapping table entries are dynamically added when parsing them from the
    device tree, and removed when drivers no longer need to interact with
    pinctrl.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • This mostly makes debugfs files print things in the order that they
    were added or acquired, which just feels a little more consistent.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • It may be common for pinctrl_register_mappings() to be used from __init
    context, but there's no reason that additional mappings shouldn't be
    added at a later point, e.g. if loading modules that add pin controllers
    and their mapping tables.

    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • Commit 77a5988 "pinctrl: changes hog mechanism to be self-referential"
    modified the way "hog" entries were represented in the mapping table.
    However, the new representation failed some error checks in
    pinctrl_hog_map(). Remove the now-bogus error-check, and fix the code
    to solve the issue the error-check used to avoid.

    Acked-by: Dong Aisheng
    Signed-off-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Stephen Warren
     
  • We changed the signature of the pin multiplexing functions to
    handle any pin business, so fix up the Sirf driver to call this
    new interface and rename some variables to make the semantics
    understandable.

    Cc: linux-serial@vger.kernel.org
    Acked-by: Greg Kroah-Hartman
    Acked-by: Barry Song
    Signed-off-by: Linus Walleij

    Linus Walleij
     

11 Feb, 2012

4 commits

  • Instead of a specific boolean field to indicate if a map entry shall
    be hogged, treat self-reference as an indication of desired hogging.
    This drops one field off the map struct and has a nice Douglas R.
    Hofstadter-feel to it.

    Acked-by: Dong Aisheng
    Acked-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • This moves the per-devices struct pinctrl handles and device map
    over from the pinmux part of the subsystem to the core pinctrl part.
    This makes the device handles core infrastructure with the goal of
    using these handles also for pin configuration, so that device
    drivers (or boards etc) will need one and only one handle to the
    pin control core.

    Acked-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • Since we want to use the former pinmux handles and mapping tables for
    generic control involving both muxing and configuration we begin
    refactoring by renaming them from pinmux_* to pinctrl_*.

    ChangeLog v1->v2:
    - Also rename the PINMUX_* macros in machine.h to PIN_ as indicated
    in the documentation so as to reflect the generic nature of these
    mapping entries from now on.

    Acked-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • This breaks out a header to be used by
    all pinmux and pinconfig alike, so drivers needing services from
    pinctrl does not need to include different headers. This is similar
    to the approach taken by the regulator API.

    Acked-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Linus Walleij
     

02 Feb, 2012

3 commits

  • Support PXA168/PXA910/MMP2 pinmux. Now only support function switch.

    Signed-off-by: Haojian Zhuang
    [Rebase and fix some whitespace issues]
    Signed-off-by: Linus Walleij

    Haojian Zhuang
     
  • After discussion with Mark Brown in an unrelated thread about
    ADC lookups, it came to my knowledge that the ability to pass
    a struct device * in the regulator consumers is just a
    historical artifact, and not really recommended. Since there
    are no in-kernel users of these pointers, we just kill them
    right now, before someone starts to use them.

    Reviewed-by: Mark Brown
    Signed-off-by: Linus Walleij

    Linus Walleij
     
  • Commit ca53c5f1ca5c936777caca46b7c716a40682ce83
    ("pinctrl: conjure names for unnamed pins") made pins lose
    their identity and only get autogenerated names.

    Acked-by: Stephen Warren
    Signed-off-by: Linus Walleij

    Linus Walleij
     

01 Feb, 2012

2 commits

  • Linus Torvalds
     
  • There are few important bug fixes for LogFS

    * tag 'for-linus' of git://github.com/prasad-joshi/logfs_upstream:
    Logfs: Allow NULL block_isbad() methods
    logfs: Grow inode in delete path
    logfs: Free areas before calling generic_shutdown_super()
    logfs: remove useless BUG_ON
    MAINTAINERS: Add Prasad Joshi in LogFS maintiners
    logfs: Propagate page parameter to __logfs_write_inode
    logfs: set superblock shutdown flag after generic sb shutdown
    logfs: take write mutex lock during fsync and sync
    logfs: Prevent memory corruption
    logfs: update page reference count for pined pages

    Fix up conflict in fs/logfs/dev_mtd.c due to semantic change in what
    "mtd->block_isbad" means in commit f2933e86ad93: "Logfs: Allow NULL
    block_isbad() methods" clashing with the abstraction changes in the
    commits 7086c19d0742: "mtd: introduce mtd_block_isbad interface" and
    d58b27ed58a3: "logfs: do not use 'mtd->block_isbad' directly".

    This resolution takes the semantics from commit f2933e86ad93, and just
    makes mtd_block_isbad() return zero (false) if the 'block_isbad'
    function is NULL. But that also means that now "mtd_can_have_bb()"
    always returns 0.

    Now, "mtd_block_markbad()" will obviously return an error if the
    low-level driver doesn't support bad blocks, so this is somewhat
    non-symmetric, but it actually makes sense if a NULL "block_isbad"
    function is considered to mean "I assume that all my blocks are always
    good".

    Linus Torvalds
     

31 Jan, 2012

8 commits

  • * 'hwmon-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
    hwmon: (w83627ehf) Disable setting DC mode for pwm2, pwm3 on NCT6776F
    hwmon: (sht15) fix bad error code
    MAINTAINERS: Drop maintainer for MAX1668 hwmon driver
    MAINTAINERS: Add hwmon entries for Wolfson
    hwmon: (f71805f) Fix clamping of temperature limits

    Linus Torvalds
     
  • Here are some fixes to the pin control system that has accumulated since
    -rc1. Mainly Tony Lindgren fixed the module load/unload logic and the
    rest are minor fixes and documentation.

    * 'for-torvalds' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl:
    pinctrl: add checks for empty function names
    pinctrl: fix pinmux_hog_maps when ctrl_dev_name is not set
    pinctrl: fix some pinmux typos
    pinctrl: free debugfs entries when unloading a pinmux driver
    pinctrl: unbreak error messages
    Documentation/pinctrl: fix a few syntax errors in code examples
    pinctrl: fix pinconf_pins_show iteration

    Linus Torvalds
     
  • Here are some tty/serial patches for 3.3-rc1

    Big thing here is the movement of the 8250 serial drivers to their own
    directory, now that the patch churn has calmed down.

    Other than that, only minor stuff (omap patches were reverted as they
    were found to be wrong), and another broken driver removed from the
    system.

    Signed-off-by: Greg Kroah-Hartman

    * tag 'tty-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
    serial: Kill off Moorestown code
    Revert "tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA mode"
    Revert "tty: serial: OMAP: transmit FIFO threshold interrupts don't wake the chip"
    serial: Fix wakeup init logic to speed up startup
    docbook: don't use serial_core.h in device-drivers book
    serial: amba-pl011: lock console writes against interrupts
    amba-pl011: do not disable RTS during shutdown
    tty: serial: OMAP: transmit FIFO threshold interrupts don't wake the chip
    tty: serial: OMAP: ensure FIFO levels are set correctly in non-DMA mode
    omap-serial: make serial_omap_restore_context depend on CONFIG_PM_RUNTIME
    omap-serial :Make the suspend/resume functions depend on CONFIG_PM_SLEEP.
    TTY: fix UV serial console regression
    jsm: Fixed EEH recovery error
    Updated TTY MAINTAINERS info
    serial: group all the 8250 related code together

    Linus Torvalds
     
  • Here are a bunch of USB patches for 3.3-rc1.

    Nothing major, largest thing here is the removal of some drivers that
    did not work at all. Other than that, the normal collection of bugfixes
    and new device ids.

    Signed-off-by: Greg Kroah-Hartman

    * tag 'usb-3.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (52 commits)
    uwb & wusb: fix kconfig error
    USB: Realtek cr: fix autopm scheduling while atomic
    USB: ftdi_sio: Add more identifiers
    xHCI: Cleanup isoc transfer ring when TD length mismatch found
    usb: musb: omap2430: minor cleanups.
    qcaux: add more Pantech UML190 and UML290 ports
    Revert "drivers: usb: Fix dependency for USB_HWA_HCD"
    usb: mv-otg - Fix build if CONFIG_USB is not set
    USB: cdc-wdm: Avoid hanging on interface with no USB_CDC_DMM_TYPE
    usb: add support for STA2X11 host driver
    drivers: usb: Fix dependency for USB_HWA_HCD
    kernel-doc: fix new warning in usb.h
    USB: OHCI: fix new compiler warnings
    usb: serial: kobil_sct: fix compile warning:
    drivers/usb/host/ehci-fsl.c: add missing iounmap
    USB: cdc-wdm: better allocate a buffer that is at least as big as we tell the USB core
    USB: cdc-wdm: call wake_up_all to allow driver to shutdown on device removal
    USB: cdc-wdm: use two mutexes to allow simultaneous read and write
    USB: cdc-wdm: updating desc->length must be protected by spin_lock
    USB: usbsevseg: fix max length
    ...

    Linus Torvalds
     
  • 1) Setting link attributes can modify the size of the attributes that
    would be reported on a subsequent getlink netlink operation,
    therefore min_ifinfo_dump_size needs to be adjusted. From Stefan
    Gula.

    2) Resegmentation of TSO frames while trimming can violate invariants
    expected by callers, namely that the number of segments can only stay
    the same or decrease, never increase. If MSS changes, however, we
    can trim data but then end up with more segments. Fix this by only
    segmenting to the MSS already recorded in the SKB. That's the
    simplest fix for now and if we want to get more fancy in the future
    that's a more involved change.

    This probably explains some retransmit counter inaccuracies.

    From Neal Cardwell.

    3) Fix too-many-wakeups in POLL with AF_UNIX sockets, from Eric Dumazet.

    4) Fix CAIF crashes wrt. namespace handling. From Eric Dumazet and
    Eric W. Biederman.

    5) TCP port selection fixes from Flavio Leitner.

    6) More socket memory cgroup build fixes in certain randonfig
    situations. From Glauber Costa.

    7) Fix TCP memory sysctl regression reported by Ingo Molnar, also from
    Glauber Costa.

    * git://git.kernel.org/pub/scm/linux/kernel/git/davem/net:
    af_unix: fix EPOLLET regression for stream sockets
    tcp: fix tcp_trim_head() to adjust segment count with skb MSS
    net/tcp: Fix tcp memory limits initialization when !CONFIG_SYSCTL
    net caif: Register properly as a pernet subsystem.
    netns: Fail conspicously if someone uses net_generic at an inappropriate time.
    net: explicitly add jump_label.h header to sock.h
    net: RTNETLINK adjusting values of min_ifinfo_dump_size
    ipv6: Fix ip_gre lockless xmits.
    xen-netfront: correct MAX_TX_TARGET calculation.
    netns: fix net_alloc_generic()
    tcp: bind() optimize port allocation
    tcp: bind() fix autoselection to share ports
    l2tp: l2tp_ip - fix possible oops on packet receive
    iwlwifi: fix PCI-E transport "inta" race
    mac80211: set bss_conf.idle when vif is connected
    mac80211: update oper_channel on ibss join

    Linus Torvalds
     
  • This fixes an integration issue with the regulator device tree bindings
    which shook out in -rc. The bindings were overly enthusiatic when
    deciding to set a voltage on a regulator and would try to set zero volts
    on an unconfigured regulator which isn't supported.

    * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/regulator:
    regulator: Set apply_uV only when min and max voltages are defined

    Linus Torvalds
     
  • Commit 0884d7aa24 (AF_UNIX: Fix poll blocking problem when reading from
    a stream socket) added a regression for epoll() in Edge Triggered mode
    (EPOLLET)

    Appropriate fix is to use skb_peek()/skb_unlink() instead of
    skb_dequeue(), and only call skb_unlink() when skb is fully consumed.

    This remove the need to requeue a partial skb into sk_receive_queue head
    and the extra sk->sk_data_ready() calls that added the regression.

    This is safe because once skb is given to sk_receive_queue, it is not
    modified by a writer, and readers are serialized by u->readlock mutex.

    This also reduce number of spinlock acquisition for small reads or
    MSG_PEEK users so should improve overall performance.

    Reported-by: Nick Mathewson
    Signed-off-by: Eric Dumazet
    Cc: Alexey Moiseytsev
    Signed-off-by: David S. Miller

    Eric Dumazet
     
  • This commit fixes tcp_trim_head() to recalculate the number of
    segments in the skb with the skb's existing MSS, so trimming the head
    causes the skb segment count to be monotonically non-increasing - it
    should stay the same or go down, but not increase.

    Previously tcp_trim_head() used the current MSS of the connection. But
    if there was a decrease in MSS between original transmission and ACK
    (e.g. due to PMTUD), this could cause tcp_trim_head() to
    counter-intuitively increase the segment count when trimming bytes off
    the head of an skb. This violated assumptions in tcp_tso_acked() that
    tcp_trim_head() only decreases the packet count, so that packets_acked
    in tcp_tso_acked() could underflow, leading tcp_clean_rtx_queue() to
    pass u32 pkts_acked values as large as 0xffffffff to
    ca_ops->pkts_acked().

    As an aside, if tcp_trim_head() had really wanted the skb to reflect
    the current MSS, it should have called tcp_set_skb_tso_segs()
    unconditionally, since a decrease in MSS would mean that a
    single-packet skb should now be sliced into multiple segments.

    Signed-off-by: Neal Cardwell
    Acked-by: Nandita Dukkipati
    Acked-by: Ilpo Järvinen
    Signed-off-by: David S. Miller

    Neal Cardwell