1. 11 Jun, 2009 40 commits
    • Eric Paris's avatar
      fsnotify: include pathnames with entries when possible · 62ffe5df
      Eric Paris authored
      When inotify wants to send events to a directory about a child it includes
      the name of the original file.  This patch collects that filename and makes
      it available for notification.
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: Christoph Hellwig <hch@lst.de>
      62ffe5df
    • Eric Paris's avatar
      fsnotify: generic notification queue and waitq · a2d8bc6c
      Eric Paris authored
      inotify needs to do asyc notification in which event information is stored
      on a queue until the listener is ready to receive it.  This patch
      implements a generic notification queue for inotify (and later fanotify) to
      store events to be sent at a later time.
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: Christoph Hellwig <hch@lst.de>
      a2d8bc6c
    • Eric Paris's avatar
      dnotify: reimplement dnotify using fsnotify · 3c5119c0
      Eric Paris authored
      Reimplement dnotify using fsnotify.
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: Christoph Hellwig <hch@lst.de>
      3c5119c0
    • Eric Paris's avatar
      fsnotify: parent event notification · c28f7e56
      Eric Paris authored
      inotify and dnotify both use a similar parent notification mechanism.  We
      add a generic parent notification mechanism to fsnotify for both of these
      to use.  This new machanism also adds the dentry flag optimization which
      exists for inotify to dnotify.
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: Christoph Hellwig <hch@lst.de>
      c28f7e56
    • Eric Paris's avatar
      fsnotify: add marks to inodes so groups can interpret how to handle those inodes · 3be25f49
      Eric Paris authored
      This patch creates a way for fsnotify groups to attach marks to inodes.
      These marks have little meaning to the generic fsnotify infrastructure
      and thus their meaning should be interpreted by the group that attached
      them to the inode's list.
      
      dnotify and inotify  will make use of these markings to indicate which
      inodes are of interest to their respective groups.  But this implementation
      has the useful property that in the future other listeners could actually
      use the marks for the exact opposite reason, aka to indicate which inodes
      it had NO interest in.
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: Christoph Hellwig <hch@lst.de>
      3be25f49
    • Eric Paris's avatar
      fsnotify: unified filesystem notification backend · 90586523
      Eric Paris authored
      fsnotify is a backend for filesystem notification.  fsnotify does
      not provide any userspace interface but does provide the basis
      needed for other notification schemes such as dnotify.  fsnotify
      can be extended to be the backend for inotify or the upcoming
      fanotify.  fsnotify provides a mechanism for "groups" to register for
      some set of filesystem events and to then deliver those events to
      those groups for processing.
      
      fsnotify has a number of benefits, the first being actually shrinking the size
      of an inode.  Before fsnotify to support both dnotify and inotify an inode had
      
              unsigned long           i_dnotify_mask; /* Directory notify events */
              struct dnotify_struct   *i_dnotify; /* for directory notifications */
              struct list_head        inotify_watches; /* watches on this inode */
              struct mutex            inotify_mutex;  /* protects the watches list
      
      But with fsnotify this same functionallity (and more) is done with just
      
              __u32                   i_fsnotify_mask; /* all events for this inode */
              struct hlist_head       i_fsnotify_mark_entries; /* marks on this inode */
      
      That's right, inotify, dnotify, and fanotify all in 64 bits.  We used that
      much space just in inotify_watches alone, before this patch set.
      
      fsnotify object lifetime and locking is MUCH better than what we have today.
      inotify locking is incredibly complex.  See 8f7b0ba1 as an example of
      what's been busted since inception.  inotify needs to know internal semantics
      of superblock destruction and unmounting to function.  The inode pinning and
      vfs contortions are horrible.
      
      no fsnotify implementers do allocation under locks.  This means things like
      f04b30de which (due to an overabundance of caution) changes GFP_KERNEL to
      GFP_NOFS can be reverted.  There are no longer any allocation rules when using
      or implementing your own fsnotify listener.
      
      fsnotify paves the way for fanotify.  In brief fanotify is a notification
      mechanism that delivers the lisener both an 'event' and an open file descriptor
      to the object in question.  This means that fanotify is pathname agnostic.
      Some on lkml may not care for the original companies or users that pushed for
      TALPA, but fanotify was designed with flexibility and input for other users in
      mind.  The readahead group expressed interest in fanotify as it could be used
      to profile disk access on boot without breaking the audit system.  The desktop
      search groups have also expressed interest in fanotify as it solves a number
      of the race conditions and problems present with managing inotify when more
      than a limited number of specific files are of interest.  fanotify can provide
      for a userspace access control system which makes it a clean interface for AV
      vendors to hook without trying to do binary patching on the syscall table,
      LSM, and everywhere else they do their things today.  With this patch series
      fanotify can be implemented in less than 1200 lines of easy to review code.
      Almost all of which is the socket based user interface.
      
      This patch series builds fsnotify to the point that it can implement
      dnotify and inotify_user.  Patches exist and will be sent soon after
      acceptance to finish the in kernel inotify conversion (audit) and implement
      fanotify.
      Signed-off-by: default avatarEric Paris <eparis@redhat.com>
      Acked-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Cc: Christoph Hellwig <hch@lst.de>
      90586523
    • Linus Torvalds's avatar
      Merge branch 'for-2.6.31' of git://git.kernel.dk/linux-2.6-block · c9059598
      Linus Torvalds authored
      * 'for-2.6.31' of git://git.kernel.dk/linux-2.6-block: (153 commits)
        block: add request clone interface (v2)
        floppy: fix hibernation
        ramdisk: remove long-deprecated "ramdisk=" boot-time parameter
        fs/bio.c: add missing __user annotation
        block: prevent possible io_context->refcount overflow
        Add serial number support for virtio_blk, V4a
        block: Add missing bounce_pfn stacking and fix comments
        Revert "block: Fix bounce limit setting in DM"
        cciss: decode unit attention in SCSI error handling code
        cciss: Remove no longer needed sendcmd reject processing code
        cciss: change SCSI error handling routines to work with interrupts enabled.
        cciss: separate error processing and command retrying code in sendcmd_withirq_core()
        cciss: factor out fix target status processing code from sendcmd functions
        cciss: simplify interface of sendcmd() and sendcmd_withirq()
        cciss: factor out core of sendcmd_withirq() for use by SCSI error handling code
        cciss: Use schedule_timeout_uninterruptible in SCSI error handling code
        block: needs to set the residual length of a bidi request
        Revert "block: implement blkdev_readpages"
        block: Fix bounce limit setting in DM
        Removed reference to non-existing file Documentation/PCI/PCI-DMA-mapping.txt
        ...
      
      Manually fix conflicts with tracing updates in:
      	block/blk-sysfs.c
      	drivers/ide/ide-atapi.c
      	drivers/ide/ide-cd.c
      	drivers/ide/ide-floppy.c
      	drivers/ide/ide-tape.c
      	include/trace/events/block.h
      	kernel/trace/blktrace.c
      c9059598
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw · 0a33f80a
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/steve/gfs2-2.6-nmw: (25 commits)
        GFS2: Merge gfs2_get_sb into gfs2_get_sb_meta
        GFS2: Fix cache coherency between truncate and O_DIRECT read
        GFS2: Fix locking issue mounting gfs2meta fs
        GFS2: Remove unused variable
        GFS2: smbd proccess hangs with flock() call.
        GFS2: Remove args subdir from gfs2 sysfs files
        GFS2: Remove lockstruct subdir from gfs2 sysfs files
        GFS2: Move gfs2_unlink_ok into ops_inode.c
        GFS2: Move gfs2_readlinki into ops_inode.c
        GFS2: Move gfs2_rmdiri into ops_inode.c
        GFS2: Merge mount.c and ops_super.c into super.c
        GFS2: Clean up some file names
        GFS2: Be more aggressive in reclaiming unlinked inodes
        GFS2: Add a rgrp bitmap full flag
        GFS2: Improve resource group error handling
        GFS2: Don't warn when delete inode fails on ro filesystem
        GFS2: Update docs
        GFS2: Umount recovery race fix
        GFS2: Remove a couple of unused sysfs entries
        GFS2: Add commit= mount option
        ...
      0a33f80a
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp · c29f5ec0
      Linus Torvalds authored
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp: (26 commits)
        amd64_edac: add MAINTAINERS entry
        EDAC: do not enable modules by default
        amd64_edac: do not enable module by default
        amd64_edac: add module registration routines
        amd64_edac: add ECC reporting initializers
        amd64_edac: add EDAC core-related initializers
        amd64_edac: add error decoding logic
        amd64_edac: add ECC chipkill syndrome mapping table
        amd64_edac: add per-family descriptors
        amd64_edac: add F10h-and-later methods-p3
        amd64_edac: add F10h-and-later methods-p2
        amd64_edac: add F10h-and-later methods-p1
        amd64_edac: add k8-specific methods
        amd64_edac: assign DRAM chip select base and mask in a family-specific way
        amd64_edac: add helper to dump relevant registers
        amd64_edac: add DRAM address type conversion facilities
        amd64_edac: add functionality to compute the DRAM hole
        amd64_edac: add sys addr to memory controller mapping helpers
        amd64_edac: add memory scrubber interface
        amd64_edac: add MCA error types
        ...
      c29f5ec0
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6 · d3d07d94
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (266 commits)
        sh: Tie sparseirq in to Kconfig.
        sh: Wire up sys_rt_tgsigqueueinfo.
        sh: Fix sys_pwritev() syscall table entry for sh32.
        sh: Fix sh4a llsc-based cmpxchg()
        sh: sh7724: Add JPU support
        sh: sh7724: INTC setting update
        sh: sh7722 clock framework rewrite
        sh: sh7366 clock framework rewrite
        sh: sh7343 clock framework rewrite
        sh: sh7724 clock framework rewrite V3
        sh: sh7723 clock framework rewrite V2
        sh: add enable()/disable()/set_rate() to div6 code
        sh: add AP325RXA mode pin configuration
        sh: add Migo-R mode pin configuration
        sh: sh7722 mode pin definitions
        sh: sh7724 mode pin comments
        sh: sh7723 mode pin V2
        sh: rework mode pin code
        sh: clock div6 helper code
        sh: clock div4 frequency table offset fix
        ...
      d3d07d94
    • Linus Torvalds's avatar
      Merge branch 'kvm-updates/2.6.31' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 6cd8e300
      Linus Torvalds authored
      * 'kvm-updates/2.6.31' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (138 commits)
        KVM: Prevent overflow in largepages calculation
        KVM: Disable large pages on misaligned memory slots
        KVM: Add VT-x machine check support
        KVM: VMX: Rename rmode.active to rmode.vm86_active
        KVM: Move "exit due to NMI" handling into vmx_complete_interrupts()
        KVM: Disable CR8 intercept if tpr patching is active
        KVM: Do not migrate pending software interrupts.
        KVM: inject NMI after IRET from a previous NMI, not before.
        KVM: Always request IRQ/NMI window if an interrupt is pending
        KVM: Do not re-execute INTn instruction.
        KVM: skip_emulated_instruction() decode instruction if size is not known
        KVM: Remove irq_pending bitmap
        KVM: Do not allow interrupt injection from userspace if there is a pending event.
        KVM: Unprotect a page if #PF happens during NMI injection.
        KVM: s390: Verify memory in kvm run
        KVM: s390: Sanity check on validity intercept
        KVM: s390: Unlink vcpu on destroy - v2
        KVM: s390: optimize float int lock: spin_lock_bh --> spin_lock
        KVM: s390: use hrtimer for clock wakeup from idle - v2
        KVM: s390: Fix memory slot versus run - v3
        ...
      6cd8e300
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6 · ddbb8684
      Linus Torvalds authored
      * git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6:
        cifs: remove never-used in6_addr option
        cifs: add addr= mount option alias for ip=
        [CIFS] Add mention of new mount parm (forceuid) to cifs readme
        cifs: make overriding of ownership conditional on new mount options
        cifs: fix IPv6 address length check
        cifs: clean up set_cifs_acl interfaces
        cifs: reorganize get_cifs_acl
        [CIFS] Update readme to indicate change to default mount (serverino)
        cifs: make serverino the default when mounting
        cifs: rename cifs_iget to cifs_root_iget
        cifs: make cnvrtDosUnixTm take a little-endian args and an offset
        cifs: have cifs_NTtimeToUnix take a little-endian arg
        cifs: tighten up default file_mode/dir_mode
        cifs: fix artificial limit on reading symlinks
      ddbb8684
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of... · 3296ca27
      Linus Torvalds authored
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris/security-testing-2.6: (44 commits)
        nommu: Provide mmap_min_addr definition.
        TOMOYO: Add description of lists and structures.
        TOMOYO: Remove unused field.
        integrity: ima audit dentry_open failure
        TOMOYO: Remove unused parameter.
        security: use mmap_min_addr indepedently of security models
        TOMOYO: Simplify policy reader.
        TOMOYO: Remove redundant markers.
        SELinux: define audit permissions for audit tree netlink messages
        TOMOYO: Remove unused mutex.
        tomoyo: avoid get+put of task_struct
        smack: Remove redundant initialization.
        integrity: nfsd imbalance bug fix
        rootplug: Remove redundant initialization.
        smack: do not beyond ARRAY_SIZE of data
        integrity: move ima_counts_get
        integrity: path_check update
        IMA: Add __init notation to ima functions
        IMA: Minimal IMA policy and boot param for TCB IMA policy
        selinux: remove obsolete read buffer limit from sel_read_bool
        ...
      3296ca27
    • Linus Torvalds's avatar
      Merge branch 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4 · e893123c
      Linus Torvalds authored
      * 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4: (49 commits)
        ext4: Avoid corrupting the uninitialized bit in the extent during truncate
        ext4: Don't treat a truncation of a zero-length file as replace-via-truncate
        ext4: fix dx_map_entry to support 256k directory blocks
        ext4: truncate the file properly if we fail to copy data from userspace
        ext4: Avoid leaking blocks after a block allocation failure
        ext4: Change all super.c messages to print the device
        ext4: Get rid of EXTEND_DISKSIZE flag of ext4_get_blocks_handle()
        ext4: super.c whitespace cleanup
        jbd2: Fix minor typos in comments in fs/jbd2/journal.c
        ext4: Clean up calls to ext4_get_group_desc()
        ext4: remove unused function __ext4_write_dirty_metadata
        ext2: Fix memory leak in ext2_fill_super() in case of a failed mount
        ext3: Fix memory leak in ext3_fill_super() in case of a failed mount
        ext4: Fix memory leak in ext4_fill_super() in case of a failed mount
        ext4: down i_data_sem only for read when walking tree for fiemap
        ext4: Add a comprehensive block validity check to ext4_get_blocks()
        ext4: Clean up ext4_get_blocks() so it does not depend on bh_result->b_state
        ext4: Merge ext4_da_get_block_write() into mpage_da_map_blocks()
        ext4: Add BUG_ON debugging checks to noalloc_get_block_write()
        ext4: Add documentation to the ext4_*get_block* functions
        ...
      e893123c
    • Linus Torvalds's avatar
      Merge branch 'for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6 · 27951daa
      Linus Torvalds authored
      * 'for-2.6.31' of git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (28 commits)
        ide-tape: fix debug call
        alim15x3: Remove historical hacks, re-enable init_hwif for PowerPC
        ide-dma: don't reset request fields on dma_timeout_retry()
        ide: drop rq->data handling from ide_map_sg()
        ide-atapi: kill unused fields and callbacks
        ide-tape: simplify read/write functions
        ide-tape: use byte size instead of sectors on rw issue functions
        ide-tape: unify r/w init paths
        ide-tape: kill idetape_bh
        ide-tape: use standard data transfer mechanism
        ide-tape: use single continuous buffer
        ide-atapi,tape,floppy: allow ->pc_callback() to change rq->data_len
        ide-tape,floppy: fix failed command completion after request sense
        ide-pm: don't abuse rq->data
        ide-cd,atapi: use bio for internal commands
        ide-atapi: convert ide-{floppy,tape} to using preallocated sense buffer
        ide-cd: convert to using generic sense request
        ide: add helpers for preparing sense requests
        ide-cd: don't abuse rq->buffer
        ide-atapi: don't abuse rq->buffer
        ...
      27951daa
    • Linus Torvalds's avatar
      Merge branches 'frv' and 'mn10300' · 59c288ff
      Linus Torvalds authored
      * frv:
        FRV: Implement new-style ptrace
        FRV: Don't turn on TIF_SYSCALL_TRACE unconditionally in syscall prologue
        FRV: Implement TIF_NOTIFY_RESUME
        FRV: Remove in-kernel strace code
        FRV: BUG to BUG_ON changes
        FRV: bitops: Change the bitmap index from int to unsigned long
      
      * mn10300:
        MN10300: Add utrace/tracehooks support
        MN10300: Don't set the dirty bit in the DTLB entries in the TLB-miss handler
      59c288ff
    • David Howells's avatar
      MN10300: Add utrace/tracehooks support · 5d289964
      David Howells authored
      Add utrace/tracehooks support to MN10300.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5d289964
    • David Howells's avatar
      MN10300: Don't set the dirty bit in the DTLB entries in the TLB-miss handler · fd4f683d
      David Howells authored
      Remove the special handling for the Data TLB entry dirty bit in the TLB-miss
      handler.  As the code stands, all that it does is to cause us to take a second
      data address exception to set the dirty bit.  Instead, we can just let
      pte_mkdirty() set the bit.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      fd4f683d
    • David Howells's avatar
      FRV: Implement new-style ptrace · 4a3b9893
      David Howells authored
      Implement the new-style ptrace for FRV, including adding appropriate
      tracehooks.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4a3b9893
    • David Howells's avatar
      FRV: Don't turn on TIF_SYSCALL_TRACE unconditionally in syscall prologue · 24ceb7e8
      David Howells authored
      Don't turn on TIF_SYSCALL_TRACE unconditionally in syscall prologue in FRV's
      entry.S.  This was originally for debugging stuff and should have been removed
      a long time ago.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      24ceb7e8
    • David Howells's avatar
      FRV: Implement TIF_NOTIFY_RESUME · b7bab880
      David Howells authored
      Implement the TIF_NOTIFY_RESUME thread flag, making it call do_notify_resume()
      which then clears it.  This will be made use of later by tracehooks in the
      new-style ptrace implementation
      
      Also discard TIF_IRET as that's not used by FRV.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b7bab880
    • David Howells's avatar
      FRV: Remove in-kernel strace code · aa1913c0
      David Howells authored
      Remove in-kernel strace code from the FRV arch as it's not really needed any
      more.
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      aa1913c0
    • Stoyan Gaydarov's avatar
      FRV: BUG to BUG_ON changes · db5c444e
      Stoyan Gaydarov authored
      Change some BUG()'s to BUG_ON()'s.
      Signed-off-by: default avatarStoyan Gaydarov <stoyboyker@gmail.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      db5c444e
    • Justin Chen's avatar
      FRV: bitops: Change the bitmap index from int to unsigned long · d2f11bf7
      Justin Chen authored
      Change the index to unsigned long in all bitops for [frv]
      Signed-off-by: default avatarJustin Chen <justin.chen@hp.com>
      Reviewed-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d2f11bf7
    • Linus Torvalds's avatar
      Merge branch 'serial-from-alan' · 49c35561
      Linus Torvalds authored
      * serial-from-alan: (79 commits)
        moxa: prevent opening unavailable ports
        imx: serial: use tty_encode_baud_rate to set true rate
        imx: serial: add IrDA support to serial driver
        imx: serial: use rational library function
        lib: isolate rational fractions helper function
        imx: serial: handle initialisation failure correctly
        imx: serial: be sure to stop xmit upon shutdown
        imx: serial: notify higher layers in case xmit IRQ was not called
        imx: serial: fix one bit field type
        imx: serial: fix whitespaces (no changes in functionality)
        tty: use prepare/finish_wait
        tty: remove sleep_on
        sierra: driver interface blacklisting
        sierra: driver urb handling improvements
        tty: resolve some sierra breakage
        timbuart: Fix the termios logic
        serial: Added Timberdale UART driver
        tty: Add URL for ttydev queue
        devpts: unregister the file system on error
        tty: Untangle termios and mm mutex dependencies
        ...
      49c35561
    • Dirk Eibach's avatar
      moxa: prevent opening unavailable ports · f0e85277
      Dirk Eibach authored
      In moxa.c there are 32 minor numbers reserved for each device. The
      number of ports actually available per device is stored in
      moxa_board_conf->numPorts. This number is not considered in moxa_open().
      Opening a port that is not available results in a kernel oops.
      This patch adds a test to moxa_open() that prevents opening unavailable
      ports.
      Signed-off-by: default avatarDirk Eibach <eibach@gdsys.de>
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f0e85277
    • Oskar Schirmer's avatar
      imx: serial: use tty_encode_baud_rate to set true rate · d7f8d437
      Oskar Schirmer authored
      real baud rate may be different from the one requested.
      for upper layers, set the nearest value to the real rate
      in favour of the rate previously requested.
      Signed-off-by: default avatarOskar Schirmer <os@emlix.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      d7f8d437
    • Fabian Godehardt's avatar
      imx: serial: add IrDA support to serial driver · b6e49138
      Fabian Godehardt authored
      Using the iMX serial driver with an IrDA device
      needs extra peripheral settings and specific
      timing depending on the transmitter circuitry used.
      Signed-off-by: default avatarFabian Godehardt <fg@emlix.com>
      Signed-off-by: default avatarOskar Schirmer <os@emlix.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b6e49138
    • Oskar Schirmer's avatar
      imx: serial: use rational library function · 534fca06
      Oskar Schirmer authored
      for calculation of numerator and denominator
      used in baud rate setting, use generic library function
      for optimum settings.
      Signed-off-by: default avatarOskar Schirmer <os@emlix.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      534fca06
    • Oskar Schirmer's avatar
      lib: isolate rational fractions helper function · 8759ef32
      Oskar Schirmer authored
      Provide a helper function to determine optimum numerator
      denominator value pairs taking into account restricted
      register size. Useful especially with PLL and other clock
      configurations.
      Signed-off-by: default avatarOskar Schirmer <os@emlix.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      8759ef32
    • Daniel Glöckner's avatar
      imx: serial: handle initialisation failure correctly · 9f322ad0
      Daniel Glöckner authored
      correctly de-initialise device when setting up failed,
      call to pdata->exit() was missing.
      Signed-off-by: default avatarDaniel Glöckner <dg@emlix.com>
      Signed-off-by: default avatarOskar Schirmer <os@emlix.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9f322ad0
    • Fabian Godehardt's avatar
      imx: serial: be sure to stop xmit upon shutdown · 2e146392
      Fabian Godehardt authored
      needed to avoid continued transmission by hardware
      while software already shuts down, which might
      cause dangling characters to show up in hardware
      queues when restarting the device.
      Signed-off-by: default avatarFabian Godehardt <fg@emlix.com>
      Signed-off-by: default avatarOskar Schirmer <os@emlix.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      2e146392
    • Fabian Godehardt's avatar
      imx: serial: notify higher layers in case xmit IRQ was not called · 97775731
      Fabian Godehardt authored
      upper layers, namely line discipline, need to be notified
      when transmission of more data is possible. For spurious
      cases, where IRQ handling does not supply notification
      for sure, it is given additionally here, when data has just
      been transmitted and space in the buffer will most probably
      be available.
      Signed-off-by: default avatarFabian Godehardt <fg@emlix.com>
      Signed-off-by: default avatarOskar Schirmer <os@emlix.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      97775731
    • Daniel Glöckner's avatar
      imx: serial: fix one bit field type · 26bbb3ff
      Daniel Glöckner authored
      "have_rtscts" is assigned 1, while it is declared
      int:1, two's complement, which can hold 0 and -1
      only. The code works, as the upper bits are cut
      off, and tests are done against 0 only.
      
      Nonetheless, correctly declaring the bit field
      as unsigned int:1 renders the code more robust.
      Signed-off-by: default avatarDaniel Glöckner <dg@emlix.com>
      Signed-off-by: default avatarOskar Schirmer <os@emlix.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      26bbb3ff
    • Oskar Schirmer's avatar
    • Jiri Slaby's avatar
      tty: use prepare/finish_wait · 3e3b5c08
      Jiri Slaby authored
      Use prepare_to_wait and finish_wait instead of add_wait_queue and
      remove_wait_queue.
      
      This avoids us setting a task state.
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      3e3b5c08
    • Jiri Slaby's avatar
      tty: remove sleep_on · 5fc5b42a
      Jiri Slaby authored
      Use wait_event instead of sleep_on in tty_block_til_ready.
      
      Wait for ASYNC_CLOSING flag being 0.
      Signed-off-by: default avatarJiri Slaby <jirislaby@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      5fc5b42a
    • Elina Pasheva's avatar
      sierra: driver interface blacklisting · 4db2299d
      Elina Pasheva authored
      Interface blacklisting is necessary for non-serial interfaces that are handled
      by a different driver. The interface blacklisting is implemented in sierra
      driver per device. Each device in need of a blacklist has a static information
      array kept in the driver. This array contains the interface numbers that are
      blacklisted. The pointer for each blacklist array and the length
      of that blacklist are 'bundled' in data structure sierra_iface_info. A pointer
      to this information is set in id_table when the device is added to the id_table.
      
      The following is summary of changes we have made to sierra.c driver in
      this patch dealing with interface blacklisting support:
      - Added data structure sierra_iface_info and function is_blacklisted()
      to support blacklisting
      - Modified sierra_probe() to handle blacklisted interfaces accordingly
      - Improved comments in id_table
      - Added new device in id_table with blacklist interface support
      Signed-off-by: default avatarElina Pasheva <epasheva@sierrawireless.com>
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4db2299d
    • Elina Pasheva's avatar
      sierra: driver urb handling improvements · b9a44bc1
      Elina Pasheva authored
      [Folded from eight patches into one as the original set according to the
       author "All of the patches need to be applied to obtain a working product"
       so keeping them split seems unhelpful
      
       Merge fixes done versus other conflicting changes and moved the
       spin_lock_init from open to setup time -- Alan]
      
      Summary of the changes and code re-organization in this patch:
      
      - The memory for urbs is allocated and urbs are submitted only for the active
        interfaces (instead of pre-allocating these for all interfaces). This will
        save memory especially in the case of using composite devices.
      - The code has been re-organized and functionality has been extracted from
        sierra_startup(), sierra_shutdown(), sierra_open(), sierra_close() and added
        in helper functions sierra_release_urb(), sierra_stop_rx_urbs(),
        sierra_submit_rx_urbs() and sierra_setup_urb()
      
      - Added function sierra_release_urb() to free an urb and its transfer
      buffer.
      - Removed unecessary include file reference and comment.
      - Added function sierra_stop_rx_urbs() that takes care of the release of
      receive and interrupt urbs. This function is to be called by sierra_close()
      whenever an interface is de-activated.
      - Added new function sierra_submit_rx_urbs() that handles the submission of
      receive urbs and interrupt urbs (if any) during the interface activation.
      This function is to be called by sierra_open(). Added a second parameter to
      pass the memory allocation (as suggested by Oliver Neukum) so that this
      function can be used in post_reset() and resume().
      - Added new function sierra_setup_urb() that contains the functionality to
      allocate an urb, fill bulk urb using the supplied memory allocation flag
      and release urb upon error. Added parameter so that the caller pass the
      memory allocation flag for flexibility.
      - Moved sierra_close() before sierra_open() to resolve dependencies
      introduced by the code reorganization.
      - Modified sierra_close() to call sierra_stop_rx_urbs() and
      sierra_release_urb() functions added in previous patch.
      - Modified sierra_open() to call sierra_setup_urb() and sierra_submit_rx_urbs()
      functions; note urbs are allocated and submitted for each activated interface.
      - Modified sierra_startup() so that allocation of urbs happens whenever an
      interface is activated (urb allocation is moved to sierra_open()).
      - Modified sierra_shutdown() so that urbs are freed whenever an interface is
      de-activated (urb freeing moved to sierra_close() as shown in previous patch
      from the series)
      - Removed unecessary data structure from sierra_port_private_data
      - Suppress an entry in logs by not re-submitting an urb when usb_submit_urb()
      returns -EPERM, as this shows that usb_kill_urb() is running (as suggested by
      Oliver Neukum)
      Signed-off-by: default avatarElina Pasheva <epasheva@sierrawireless.com>
      Signed-off-by: default avatarAlan Cox <alan.cox@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b9a44bc1
    • Alan Cox's avatar
      tty: resolve some sierra breakage · 00b040de
      Alan Cox authored
      The various merges into the sierra driver inadvertently undid
      commit 212b8f0c by Elina Pasheva
      <epasheva@sierrawireless.com>. Put it back so the OBEX port works again.
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      00b040de