1. 03 Jun, 2012 1 commit
    • Nicholas Bellinger's avatar
      target/file: Use O_DSYNC by default for FILEIO backends · a4dff304
      Nicholas Bellinger authored
      Convert to use O_DSYNC for all cases at FILEIO backend creation time to
      avoid the extra syncing of pure timestamp updates with legacy O_SYNC during
      default operation as recommended by hch.  Continue to do this independently of
      Write Cache Enable (WCE) bit, as WCE=0 is currently the default for all backend
      devices and enabled by user on per device basis via attrib/emulate_write_cache.
      
      This patch drops the now unnecessary fd_buffered_io= token usage that was
      originally signalling when to explictly disable O_SYNC at backend creation
      time for buffered I/O operation.  This can end up being dangerous for a number
      of reasons during physical node failure, so go ahead and drop this option
      for now when O_DSYNC is used as the default.
      
      Also allow explict FUA WRITEs -> vfs_fsync_range() call to function in
      fd_execute_cmd() independently of WCE bit setting.
      Reported-by: default avatarChristoph Hellwig <hch@lst.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: <stable@vger.kernel.org>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      a4dff304
  2. 30 May, 2012 39 commits
    • Stefan Richter's avatar
      sbp-target: rename a variable to avoid name clash · 5f2a3d61
      Stefan Richter authored
      'int login_id' shadows 'static atomic_t login_id'.
      Seen as compilation warning on x86-32.
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Acked-by: default avatarChris Boot <bootc@bootc.net>
      Signed-off-by: default avatarNicholas Bellinger <nab@linux-iscsi.org>
      5f2a3d61
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client · af56e0aa
      Linus Torvalds authored
      Pull ceph updates from Sage Weil:
       "There are some updates and cleanups to the CRUSH placement code, a bug
        fix with incremental maps, several cleanups and fixes from Josh Durgin
        in the RBD block device code, a series of cleanups and bug fixes from
        Alex Elder in the messenger code, and some miscellaneous bounds
        checking and gfp cleanups/fixes."
      
      Fix up trivial conflicts in net/ceph/{messenger.c,osdmap.c} due to the
      networking people preferring "unsigned int" over just "unsigned".
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/sage/ceph-client: (45 commits)
        libceph: fix pg_temp updates
        libceph: avoid unregistering osd request when not registered
        ceph: add auth buf in prepare_write_connect()
        ceph: rename prepare_connect_authorizer()
        ceph: return pointer from prepare_connect_authorizer()
        ceph: use info returned by get_authorizer
        ceph: have get_authorizer methods return pointers
        ceph: ensure auth ops are defined before use
        ceph: messenger: reduce args to create_authorizer
        ceph: define ceph_auth_handshake type
        ceph: messenger: check return from get_authorizer
        ceph: messenger: rework prepare_connect_authorizer()
        ceph: messenger: check prepare_write_connect() result
        ceph: don't set WRITE_PENDING too early
        ceph: drop msgr argument from prepare_write_connect()
        ceph: messenger: send banner in process_connect()
        ceph: messenger: reset connection kvec caller
        libceph: don't reset kvec in prepare_write_banner()
        ceph: ignore preferred_osd field
        ceph: fully initialize new layout
        ...
      af56e0aa
    • Linus Torvalds's avatar
      Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 65a50c95
      Linus Torvalds authored
      Pull perf updates from Ingo Molnar.
      
      * 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip: (21 commits)
        perf ui browser: Stop using 'self'
        perf annotate browser: Read perf config file for settings
        perf config: Allow '_' in config file variable names
        perf annotate browser: Make feature toggles global
        perf annotate browser: The idx_asm field should be used in asm only view
        perf tools: Convert critical messages to ui__error()
        perf ui: Make --stdio default when TUI is not supported
        tools lib traceevent: Silence compiler warning on 32bit build
        perf record: Fix branch_stack type in perf_record_opts
        perf tools: Reconstruct event with modifiers from perf_event_attr
        perf top: Fix counter name fixup when fallbacking to cpu-clock
        perf tools: fix thread_map__new_by_pid_str() memory leak in error path
        perf tools: Do not use _FORTIFY_SOURCE when DEBUG=1 is specified
        tools lib traceevent: Fix signature of create_arg_item()
        tools lib traceevent: Use proper function parameter type
        tools lib traceevent: Fix freeing arg on process_dynamic_array()
        tools lib traceevent: Fix a possibly wrong memory dereference
        tools lib traceevent: Fix a possible memory leak
        tools lib traceevent: Allow expressions in __print_symbolic() fields
        perf evlist: Explicititely initialize input_name
        ...
      65a50c95
    • Linus Torvalds's avatar
      Merge branch 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging · 42fe55ce
      Linus Torvalds authored
      Pull i2c updates from Jean Delvare.
      
      * 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
        i2c: Split I2C_M_NOSTART support out of I2C_FUNC_PROTOCOL_MANGLING
        i2c-dev: Add support for I2C_M_RECV_LEN
      42fe55ce
    • Linus Torvalds's avatar
      Merge git://www.linux-watchdog.org/linux-watchdog · 19ce0a99
      Linus Torvalds authored
      Pull second set of watchdog updates from Wim Van Sebroeck:
       "This changeset contains following changes:
         * Add support for multiple watchdog devices.  We use dynamically
           allocated device id's for this.
         * Add locking into the generic watchdog infrastructure.
         * Add support for dynamically allocated watchdog_device structs so
           that we can deal with devices that get unbound.
         * convert following drivers to the generic watchdog framework:
           sch5627, sch5636 and sp805_wdt.
         * Add DA9052/53 PMIC watchdog support
         * Fix printk format warnings for iTCO_wdt.c"
      
      * git://www.linux-watchdog.org/linux-watchdog:
        watchdog: iTCO_wdt.c: fix printk format warnings
        watchdog: sp805_wdt: Add clk_{un}prepare support
        watchdog: sp805_wdt: convert to watchdog core
        hwmon/sch56xx: Depend on watchdog for watchdog core functions
        watchdog: sch56xx-common: set correct bits in register()
        Watchdog: DA9052/53 PMIC watchdog support
        watchdog: sch56xx-common: Add proper ref-counting of watchdog data
        watchdog: sch56xx: Remove unnecessary checks for register changes
        watchdog: sch56xx: Use watchdog core
        watchdog: Add support for dynamically allocated watchdog_device structs
        watchdog: Add Locking support
        watchdog: watchdog_dev: Rewrite wrapper code
        watchdog: use dev_ functions
        watchdog: create all the proper device files
        watchdog: Add a flag to indicate the watchdog doesn't reboot things
        watchdog: Add multiple device support
        watchdog: watchdog_core.h: make functions extern
        watchdog: correct the name of the watchdog_core inlude file
        watchdog: Add watchdog_active() routine
        watchdog: watchdog_dev: include private header to pickup global symbol prototypes
      19ce0a99
    • Linus Torvalds's avatar
      Merge branch 'drm-fixes' of git://people.freedesktop.org/~airlied/linux · 6bb340c7
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "Just regular fixes, bunch from intel, quieting some of the over
        zealous power warnings, and the rest just misc.
      
        I've got another pull with the remaining dma-buf bits, since the vmap
        bits are in your tree now.  I'll send tomorrow just to space things
        out a bit."
      
      * 'drm-fixes' of git://people.freedesktop.org/~airlied/linux: (22 commits)
        drm/edid/quirks: ViewSonic VA2026w
        drm/udl: remove unused variables.
        drm/radeon: fix XFX quirk
        drm: Use stdint types for consistency
        drm: Constify params to format_check() and framebuffer_checks()
        drm/radeon: fix typo in trinity tiling setup
        drm/udl: unlock before returning in udl_gem_mmap()
        radeon: make radeon_cs_update_pages static.
        drm/i915: tune down the noise of the RP irq limit fail
        drm/i915: Remove the error message for unbinding pinned buffers
        drm/i915: Limit page allocations to lowmem (dma32) for i965
        drm/i915: always use RPNSWREQ for turbo change requests
        drm/i915: reject doubleclocked cea modes on dp
        drm/i915: Adding TV Out Missing modes.
        drm/i915: wait for a vblank to pass after tv detect
        drm/i915: no lvds quirk for HP t5740e Thin Client
        drm/i915: enable vdd when switching off the eDP panel
        drm/i915: Fix PCH PLL assertions to not assume CRTC:PLL relationship
        drm/i915: Always update RPS interrupts thresholds along with frequency
        drm/i915: properly handle interlaced bit for sdvo dtd conversion
        ...
      6bb340c7
    • Linus Torvalds's avatar
      Merge branch 'for-3.5/drivers' of git://git.kernel.dk/linux-block · a70f35af
      Linus Torvalds authored
      Pull block driver updates from Jens Axboe:
       "Here are the driver related changes for 3.5.  It contains:
      
         - The floppy changes from Jiri.  Jiri is now also marked as the
           maintainer of floppy.c, I shall be publically branding his forehead
           with red hot iron at the next opportune moment.
      
         - A batch of drbd updates and fixes from the linbit crew, as well as
           fixes from others.
      
         - Two small fixes for xen-blkfront courtesy of Jan."
      
      * 'for-3.5/drivers' of git://git.kernel.dk/linux-block: (70 commits)
        floppy: take over maintainership
        floppy: remove floppy-specific O_EXCL handling
        floppy: convert to delayed work and single-thread wq
        xen-blkfront: module exit handling adjustments
        xen-blkfront: properly name all devices
        drbd: grammar fix in log message
        drbd: check MODULE for THIS_MODULE
        drbd: Restore the request restart logic
        drbd: introduce a bio_set to allocate housekeeping bios from
        drbd: remove unused define
        drbd: bm_page_async_io: properly initialize page->private
        drbd: use the newly introduced page pool for bitmap IO
        drbd: add page pool to be used for meta data IO
        drbd: allow bitmap to change during writeout from resync_finished
        drbd: fix race between drbdadm invalidate/verify and finishing resync
        drbd: fix resend/resubmit of frozen IO
        drbd: Ensure that data_size is not 0 before using data_size-1 as index
        drbd: Delay/reject other state changes while establishing a connection
        drbd: move put_ldev from __req_mod() to the endio callback
        drbd: fix WRITE_ACKED_BY_PEER_AND_SIS to not set RQ_NET_DONE
        ...
      a70f35af
    • Linus Torvalds's avatar
      Merge branch 'for-3.5/core' of git://git.kernel.dk/linux-block · 0d167518
      Linus Torvalds authored
      Merge block/IO core bits from Jens Axboe:
       "This is a bit bigger on the core side than usual, but that is purely
        because we decided to hold off on parts of Tejun's submission on 3.4
        to give it a bit more time to simmer.  As a consequence, it's seen a
        long cycle in for-next.
      
        It contains:
      
         - Bug fix from Dan, wrong locking type.
         - Relax splice gifting restriction from Eric.
         - A ton of updates from Tejun, primarily for blkcg.  This improves
           the code a lot, making the API nicer and cleaner, and also includes
           fixes for how we handle and tie policies and re-activate on
           switches.  The changes also include generic bug fixes.
         - A simple fix from Vivek, along with a fix for doing proper delayed
           allocation of the blkcg stats."
      
      Fix up annoying conflict just due to different merge resolution in
      Documentation/feature-removal-schedule.txt
      
      * 'for-3.5/core' of git://git.kernel.dk/linux-block: (92 commits)
        blkcg: tg_stats_alloc_lock is an irq lock
        vmsplice: relax alignement requirements for SPLICE_F_GIFT
        blkcg: use radix tree to index blkgs from blkcg
        blkcg: fix blkcg->css ref leak in __blkg_lookup_create()
        block: fix elvpriv allocation failure handling
        block: collapse blk_alloc_request() into get_request()
        blkcg: collapse blkcg_policy_ops into blkcg_policy
        blkcg: embed struct blkg_policy_data in policy specific data
        blkcg: mass rename of blkcg API
        blkcg: style cleanups for blk-cgroup.h
        blkcg: remove blkio_group->path[]
        blkcg: blkg_rwstat_read() was missing inline
        blkcg: shoot down blkgs if all policies are deactivated
        blkcg: drop stuff unused after per-queue policy activation update
        blkcg: implement per-queue policy activation
        blkcg: add request_queue->root_blkg
        blkcg: make request_queue bypassing on allocation
        blkcg: make sure blkg_lookup() returns %NULL if @q is bypassing
        blkcg: make blkg_conf_prep() take @pol and return with queue lock held
        blkcg: remove static policy ID enums
        ...
      0d167518
    • Linus Torvalds's avatar
      Merge tag 'iommu-updates-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu · 2f83766d
      Linus Torvalds authored
      Pull IOMMU updates from Joerg Roedel:
       "Not much stuff this time.  The only change to the IOMMU core code is
        the addition of a handle to the fault handling code.  A few updates to
        the AMD IOMMU driver to work around new errata.  The other patches are
        mostly fixes and enhancements to the existing ARM IOMMU drivers and
        documentation updates.
      
        A new IOMMU driver for the Exynos platform was also underway but got
        merged via the Samsung tree and is not part of this tree."
      
      * tag 'iommu-updates-v3.5' of git://git.kernel.org/pub/scm/linux/kernel/git/joro/iommu:
        Documentation: kernel-parameters.txt Add amd_iommu_dump
        iommu/core: pass a user-provided token to fault handlers
        iommu/tegra: gart: Fix register offset correctly
        iommu: OMAP: device detach on domain destroy
        iommu: tegra/gart: Add device tree support
        iommu: tegra/gart: use correct gart_device
        iommu/tegra: smmu: Print device name correctly
        iommu/amd: Add workaround for event log erratum
        iommu/amd: Check for the right TLP prefix bit
        dma-debug: release free_entries_lock before saving stack trace
      2f83766d
    • Dave Hansen's avatar
      mm: fix vma_resv_map() NULL pointer · 4523e145
      Dave Hansen authored
      hugetlb_reserve_pages() can be used for either normal file-backed
      hugetlbfs mappings, or MAP_HUGETLB.  In the MAP_HUGETLB, semi-anonymous
      mode, there is not a VMA around.  The new call to resv_map_put() assumed
      that there was, and resulted in a NULL pointer dereference:
      
        BUG: unable to handle kernel NULL pointer dereference at 0000000000000030
        IP: vma_resv_map+0x9/0x30
        PGD 141453067 PUD 1421e1067 PMD 0
        Oops: 0000 [#1] PREEMPT SMP
        ...
        Pid: 14006, comm: trinity-child6 Not tainted 3.4.0+ #36
        RIP: vma_resv_map+0x9/0x30
        ...
        Process trinity-child6 (pid: 14006, threadinfo ffff8801414e0000, task ffff8801414f26b0)
        Call Trace:
          resv_map_put+0xe/0x40
          hugetlb_reserve_pages+0xa6/0x1d0
          hugetlb_file_setup+0x102/0x2c0
          newseg+0x115/0x360
          ipcget+0x1ce/0x310
          sys_shmget+0x5a/0x60
          system_call_fastpath+0x16/0x1b
      
      This was reported by Dave Jones, but was reproducible with the
      libhugetlbfs test cases, so shame on me for not running them in the
      first place.
      
      With this, the oops is gone, and the output of libhugetlbfs's
      run_tests.py is identical to plain 3.4 again.
      
      [ Marked for stable, since this was introduced by commit c50ac050
        ("hugetlb: fix resv_map leak in error path") which was also marked for
        stable ]
      Reported-by: default avatarDave Jones <davej@redhat.com>
      Cc: Mel Gorman <mel@csn.ul.ie>
      Cc: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
      Cc: Christoph Lameter <cl@linux.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: <stable@vger.kernel.org>        [2.6.32+]
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      4523e145
    • Joerg Roedel's avatar
    • Shuah Khan's avatar
      Documentation: kernel-parameters.txt Add amd_iommu_dump · c099cf17
      Shuah Khan authored
      Add amd_iommu_dump to kernel-parameters.txt
      Signed-off-by: default avatarShuah Khan <shuahkhan@gmail.com>
      Signed-off-by: default avatarJoerg Roedel <joerg.roedel@amd.com>
      c099cf17
    • Mark Brown's avatar
      i2c: Split I2C_M_NOSTART support out of I2C_FUNC_PROTOCOL_MANGLING · 14674e70
      Mark Brown authored
      Since there are uses for I2C_M_NOSTART which are much more sensible and
      standard than most of the protocol mangling functionality (the main one
      being gather writes to devices where something like a register address
      needs to be inserted before a block of data) create a new I2C_FUNC_NOSTART
      for this feature and update all the users to use it.
      
      Also strengthen the disrecommendation of the protocol mangling while we're
      at it.
      
      In the case of regmap-i2c we remove the requirement for mangling as
      I2C_M_NOSTART is the only mangling feature which is being used.
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Acked-by: default avatarWolfram Sang <w.sang@pengutronix.de>
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      14674e70
    • Jean Delvare's avatar
      i2c-dev: Add support for I2C_M_RECV_LEN · 838bfa60
      Jean Delvare authored
      As the bus driver side implementation of I2C_M_RECV_LEN is heavily
      tied to SMBus, we can't support received length over 32 bytes, but
      let's at least support that.
      
      In practice, the caller will have to setup a buffer large enough to
      cover the case where received length byte has value 32, so minimum
      32 + 1 = 33 bytes, possibly more if there is a fixed number of bytes
      added for the specific slave (for example a checksum.)
      Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
      Tested-by: default avatarDouglas Gilbert <dgilbert@interlog.com>
      838bfa60
    • Ingo Molnar's avatar
      Merge tag 'perf-core-for-mingo' of... · 59cd358a
      Ingo Molnar authored
      Merge tag 'perf-core-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Annotation fixes/improvements from Arnaldo Carvalho de Melo:
      
      . Make the annotatation toggles (hide_src_code, jump_arrows, use_offset, etc)
        global so that navigation doesn't resets them on new annotations.
      
      . Introduce an '[annotate]' config file section to allow permanent changes
        to the annotate browser defaults.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      59cd358a
    • Ingo Molnar's avatar
      Merge tag 'perf-urgent-for-mingo' of... · 55b78e34
      Ingo Molnar authored
      Merge tag 'perf-urgent-for-mingo' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux into perf/urgent
      
      Fixes for perf/urgent from Arnaldo Carvalho de Melo:
      
       * Fix fallback to --stdio when TUI not supported, from Namhyung Kim.
      
       * Use right cast for pointers/long in libtraceevent, from Namhyung Kim.
      
       * Be consistent on using the right error reporting interface for fatal errors,
         from Namhyung Kim.
      
       * Fix fallback to --stdio when TUI not supported, from Namhyung Kim.
      
       * Use the right index in asm only view in the annotate browser.
      Signed-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      Signed-off-by: default avatarIngo Molnar <mingo@kernel.org>
      55b78e34
    • Randy Dunlap's avatar
      watchdog: iTCO_wdt.c: fix printk format warnings · 4b98b32a
      Randy Dunlap authored
      Fix printk format warnings:
      
      drivers/watchdog/iTCO_wdt.c:577:3: warning: format '%04llx' expects type 'long long unsigned int', but argument 2 has type 'resource_size_t'
      drivers/watchdog/iTCO_wdt.c:594:3: warning: format '%04llx' expects type 'long long unsigned int', but argument 2 has type 'resource_size_t'
      drivers/watchdog/iTCO_wdt.c:600:2: warning: format '%04llx' expects type 'long long unsigned int', but argument 4 has type 'resource_size_t'
      Signed-off-by: default avatarRandy Dunlap <rdunlap@xenotime.net>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      4b98b32a
    • Viresh Kumar's avatar
      watchdog: sp805_wdt: Add clk_{un}prepare support · d9df0ef1
      Viresh Kumar authored
      clk_{un}prepare() routines are required for required on some platforms to run
      part of clk enable/disable() routines from contexts that can schedule.
      
      This patch adds support for these routines in sp805 driver.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      d9df0ef1
    • Viresh Kumar's avatar
      watchdog: sp805_wdt: convert to watchdog core · 4a516539
      Viresh Kumar authored
      This patch converts existing sp805 watchdog driver to use already in place
      common infrastructure present in watchdog core. With this lot of code goes away.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      4a516539
    • Hans de Goede's avatar
      hwmon/sch56xx: Depend on watchdog for watchdog core functions · 2d8c7ff5
      Hans de Goede authored
      Since the watchdog code in sch56xx-common now uses the watchdog core, the
      Kconfig entires for the sch5627 and sch5636 should depend on WATCHDOG
      being set. Also select the watchdog core when we select one of the drivers.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      2d8c7ff5
    • Dan Carpenter's avatar
      watchdog: sch56xx-common: set correct bits in register() · bb644913
      Dan Carpenter authored
      WDOG_NO_WAY_OUT (3) and WDOG_ACTIVE (0) are the bit numbers, not a mask.
      So "data->wddev.status |= WDOG_ACTIVE;" was intended to set bit zero but
      it is a no-op.
      Signed-off-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Acked-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      bb644913
    • Ashish Jangam's avatar
      Watchdog: DA9052/53 PMIC watchdog support · 664a0d78
      Ashish Jangam authored
      This driver adds support for the watchdog functionality provided by
      the Dialog Semiconductor DA9052 PMIC chip.
      
      Tested on samsung smdkv6410 and i.mx53 QS boards.
      Signed-off-by: default avatarAnthony Olech <Anthony.Olech@diasemi.com>
      Signed-off-by: default avatarAshish Jangam <ashish.jangam@kpitcummins.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      664a0d78
    • Hans de Goede's avatar
      watchdog: sch56xx-common: Add proper ref-counting of watchdog data · 54e2dc93
      Hans de Goede authored
      This fixes referencing free-ed memory in the corner case where /dev/watchdog
      is open when the platform driver gets unbound from the platform device.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      54e2dc93
    • Hans de Goede's avatar
      watchdog: sch56xx: Remove unnecessary checks for register changes · 85a2e40c
      Hans de Goede authored
      Since the watchdog core keeps track of the watchdog's active state, start/stop
      will never get called when no changes are necessary. So we can remove the
      check for the output_enable register changing before writing it (which is
      an expensive operation).
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      85a2e40c
    • Hans de Goede's avatar
      watchdog: sch56xx: Use watchdog core · fb551405
      Hans de Goede authored
      Convert sch56xx drivers to the generic watchdog core.
      
      Note this patch depends on the "watchdog: Add multiple device support" patch
      from Alan Cox.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      fb551405
    • Hans de Goede's avatar
      watchdog: Add support for dynamically allocated watchdog_device structs · e907df32
      Hans de Goede authored
      If a driver's watchdog_device struct is part of a dynamically allocated
      struct (which it often will be), merely locking the module is not enough,
      even with a drivers module locked, the driver can be unbound from the device,
      examples:
      1) The root user can unbind it through sysfd
      2) The i2c bus master driver being unloaded for an i2c watchdog
      
      I will gladly admit that these are corner cases, but we still need to handle
      them correctly.
      
      The fix for this consists of 2 parts:
      1) Add ref / unref operations, so that the driver can refcount the struct
         holding the watchdog_device struct and delay freeing it until any
         open filehandles referring to it are closed
      2) Most driver operations will do IO on the device and the driver should not
         do any IO on the device after it has been unbound. Rather then letting each
         driver deal with this internally, it is better to ensure at the watchdog
         core level that no operations (other then unref) will get called after
         the driver has called watchdog_unregister_device(). This actually is the
         bulk of this patch.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      e907df32
    • Hans de Goede's avatar
      watchdog: Add Locking support · f4e9c82f
      Hans de Goede authored
      This patch fixes some potential multithreading issues, despite only
      allowing one process to open the /dev/watchdog device, we can still get
      called multiple times at the same time, since a program could be using thread,
      or could share the fd after a fork.
      
      This causes 2 potential problems:
      1) watchdog_start / open do an unlocked test_n_set / test_n_clear,
         if these 2 race, the watchdog could be stopped while the active
         bit indicates it is running or visa versa.
      
      2) Most watchdog_dev drivers probably assume that only one
         watchdog-op will get called at a time, this is not necessary
         true atm.
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      f4e9c82f
    • Hans de Goede's avatar
      watchdog: watchdog_dev: Rewrite wrapper code · 7a879824
      Hans de Goede authored
      Rewrite and extend the wrapper code so that we can easily introduce
      locking (this to be able to prevent potential multithreading issues).
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      7a879824
    • Alan Cox's avatar
      watchdog: use dev_ functions · 3dfd6218
      Alan Cox authored
      While they are registered all our watchdogs now have a valid device object
      so we can in turn use that to report problems nicely.
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      3dfd6218
    • Alan Cox's avatar
      watchdog: create all the proper device files · d6b469d9
      Alan Cox authored
      Create the watchdog class and it's associated devices.
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      d6b469d9
    • Alan Cox's avatar
      watchdog: Add a flag to indicate the watchdog doesn't reboot things · 2bbeed01
      Alan Cox authored
      Some watchdogs merely trigger external alarms and controls. In a managed
      environment this is very useful but we want drivers to be able to figure
      out which is which now multiple dogs can be loaded. Thus add an ALARMONLY
      feature flag.
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      2bbeed01
    • Alan Cox's avatar
      watchdog: Add multiple device support · 45f5fed3
      Alan Cox authored
      We keep the old /dev/watchdog interface file for the first watchdog via
      miscdev. This is basically a cut and paste of the relevant interface code
      from the rtc driver layer tweaked for watchdog.
      
      Revised to fix problems noted by Hans de Goede
      Signed-off-by: default avatarAlan Cox <alan@linux.intel.com>
      Signed-off-by: default avatarHans de Goede <hdegoede@redhat.com>
      Signed-off-by: default avatarTomas Winkler <tomas.winkler@intel.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      45f5fed3
    • Wim Van Sebroeck's avatar
      watchdog: watchdog_core.h: make functions extern · fb5f6658
      Wim Van Sebroeck authored
      Make the functions in watchdog_core.h extern like it should.
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      fb5f6658
    • Wim Van Sebroeck's avatar
      watchdog: correct the name of the watchdog_core inlude file · 6cfb5aa8
      Wim Van Sebroeck authored
      The watchdog_core include file should have been named
      watchdog_core.h and not watchdog_dev.h . Correct this.
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      6cfb5aa8
    • Viresh Kumar's avatar
      watchdog: Add watchdog_active() routine · 257f8c4a
      Viresh Kumar authored
      Some watchdog may need to check if watchdog is ACTIVE or not, for example in
      their suspend/resume hooks.
      
      This patch adds this routine and changes the core drivers to use it.
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@st.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      257f8c4a
    • H Hartley Sweeten's avatar
      watchdog: watchdog_dev: include private header to pickup global symbol prototypes · 09a46e73
      H Hartley Sweeten authored
      Include the private watchdog_dev.h header to pickup the prototypes for the
      watchdog_dev_register/unregister functions.
      
      This quiets the following sparse warnings:
      
      warning: symbol 'watchdog_dev_register' was not declared. Should it be static?
      warning: symbol 'watchdog_dev_unregister' was not declared. Should it be static?
      Signed-off-by: default avatarH Hartley Sweeten <hsweeten@visionengravers.com>
      Signed-off-by: default avatarWim Van Sebroeck <wim@iguana.be>
      09a46e73
    • Linus Torvalds's avatar
      Merge branch 'x86-trampoline-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 731a7378
      Linus Torvalds authored
      Pull x86 trampoline rework from H. Peter Anvin:
       "This code reworks all the "trampoline"/"realmode" code (various bits
        that need to live in the first megabyte of memory, most but not all of
        which runs in real mode at some point) in the kernel into a single
        object.  The main reason for doing this is that it eliminates the last
        place in the kernel where we needed pages to be mapped RWX.  This code
        separates all that code into proper R/RW/RX pages."
      
      Fix up conflicts in arch/x86/kernel/Makefile (mca removed next to reboot
      code), and arch/x86/kernel/reboot.c (reboot code moved around in one
      branch, modified in this one), and arch/x86/tools/relocs.c (mostly same
      code came in earlier due to working around the ld bugs just before the
      3.4 release).
      
      Also remove stale x86-relocs entry from scripts/.gitignore as per Peter
      Anvin.
      
      * commit '61f54461': (36 commits)
        x86, realmode: Move end signature into header.S
        x86, relocs: When printing an error, say relative or absolute
        x86, relocs: More relocations which may end up as absolute
        x86, relocs: Workaround for binutils 2.22.52.0.1 section bug
        xen-acpi-processor: Add missing #include <xen/xen.h>
        acpi, bgrd: Add missing <linux/io.h> to drivers/acpi/bgrt.c
        x86, realmode: Change EFER to a single u64 field
        x86, realmode: Move kernel/realmode.c to realmode/init.c
        x86, realmode: Move not-common bits out of trampoline_common.S
        x86, realmode: Mask out EFER.LMA when saving trampoline EFER
        x86, realmode: Fix no cache bits test in reboot_32.S
        x86, realmode: Make sure all generated files are listed in targets
        x86, realmode: build fix: remove duplicate build
        x86, realmode: read cr4 and EFER from kernel for 64-bit trampoline
        x86, realmode: fixes compilation issue in tboot.c
        x86, realmode: move relocs from scripts/ to arch/x86/tools
        x86, realmode: header for trampoline code
        x86, realmode: flattened rm hierachy
        x86, realmode: don't copy real_mode_header
        x86, realmode: fix 64-bit wakeup sequence
        ...
      731a7378
    • Arnaldo Carvalho de Melo's avatar
      perf ui browser: Stop using 'self' · 05e8b080
      Arnaldo Carvalho de Melo authored
      Stop using this python/OOP convention, doesn't really helps. Will do
      more from time to time till we get it cleaned up in all of /perf.
      Suggested-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Cc: David Ahern <dsahern@gmail.com>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Namhyung Kim <namhyung@gmail.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Stephane Eranian <eranian@google.com>
      Link: http://lkml.kernel.org/n/tip-5dyxyb8o0gf4yndk27kafbd1@git.kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
      05e8b080
    • Linus Torvalds's avatar
      Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac · 87a5af24
      Linus Torvalds authored
      Pull EDAC internal API changes from Mauro Carvalho Chehab:
       "This changeset is the first part of a series of patches that fixes the
        EDAC sybsystem.  On this set, it changes the Kernel EDAC API in order
        to properly represent the Intel i3/i5/i7, Xeon 3xxx/5xxx/7xxx, and
        Intel E5-xxxx memory controllers.
      
        The EDAC core used to assume that:
      
             - the DRAM chip select pin is directly accessed by the memory
               controller
      
             - when multiple channels are used, they're all filled with the
               same type of memory.
      
        None of the above premises is true on Intel memory controllers since
        2002, when RAMBUS and FB-DIMMs were introduced, and Advanced Memory
        Buffer or by some similar technologies hides the direct access to the
        DRAM pins.
      
        So, the existing drivers for those chipsets had to lie to the EDAC
        core, in general telling that just one channel is filled.  That
        produces some hard to understand error messages like:
      
             EDAC MC0: CE row 3, channel 0, label "DIMM1": 1 Unknown error(s): memory read error on FATAL area : cpu=0 Err=0008:00c2 (ch=2), addr = 0xad1f73480 => socket=0, Channel=0(mask=2), rank=1
      
        The location information there (row3 channel 0) is completely bogus:
        it has no physical meaning, and are just some random values that the
        driver uses to talk with the EDAC core.  The error actually happened
        at CPU socket 0, channel 0, slot 1, but this is not reported anywhere,
        as the EDAC core doesn't know anything about the memory layout.  So,
        only advanced users that know how the EDAC driver works and that tests
        their systems to see how DIMMs are mapped can actually benefit for
        such error logs.
      
        This patch series fixes the error report logic, in order to allow the
        EDAC to expose the memory architecture used by them to the EDAC core.
        So, as the EDAC core now understands how the memory is organized, it
        can provide an useful report:
      
             EDAC MC0: CE memory read error on DIMM1 (channel:0 slot:1 page:0x364b1b offset:0x600 grain:32 syndrome:0x0 - count:1 area:DRAM err_code:0001:0090 socket:0 channel_mask:1 rank:4)
      
        The location of the DIMM where the error happened is reported by "MC0"
        (cpu socket #0), at "channel:0 slot:1" location, and matches the
        physical location of the DIMM.
      
        There are two remaining issues not covered by this patch series:
      
             - The EDAC sysfs API will still report bogus values.  So,
               userspace tools like edac-utils will still use the bogus data;
      
             - Add a new tracepoint-based way to get the binary information
               about the errors.
      
        Those are on a second series of patches (also at -next), but will
        probably miss the train for 3.5, due to the slow review process."
      
      Fix up trivial conflict (due to spelling correction of removed code) in
      drivers/edac/edac_device.c
      
      * git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-edac: (42 commits)
        i7core: fix ranks information at the per-channel struct
        i5000: Fix the fatal error handling
        i5100_edac: Fix a warning when compiled with 32 bits
        i82975x_edac: Test nr_pages earlier to save a few CPU cycles
        e752x_edac: provide more info about how DIMMS/ranks are mapped
        i5000_edac: Fix the logic that retrieves memory information
        i5400_edac: improve debug messages to better represent the filled memory
        edac: Cleanup the logs for i7core and sb edac drivers
        edac: Initialize the dimm label with the known information
        edac: Remove the legacy EDAC ABI
        x38_edac: convert driver to use the new edac ABI
        tile_edac: convert driver to use the new edac ABI
        sb_edac: convert driver to use the new edac ABI
        r82600_edac: convert driver to use the new edac ABI
        ppc4xx_edac: convert driver to use the new edac ABI
        pasemi_edac: convert driver to use the new edac ABI
        mv64x60_edac: convert driver to use the new edac ABI
        mpc85xx_edac: convert driver to use the new edac ABI
        i82975x_edac: convert driver to use the new edac ABI
        i82875p_edac: convert driver to use the new edac ABI
        ...
      87a5af24