1. 25 Jan, 2012 14 commits
    • Eric W. Biederman's avatar
      sysctl: A more obvious version of grab_header. · 3cc3e046
      Eric W. Biederman authored
      Instead of relying on sysct_head_next(NULL) to magically
      return the right header for the root directory instead
      explicitly transform NULL into the root directories header.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      3cc3e046
    • Eric W. Biederman's avatar
      sysctl: Remove the now unused ctl_table parent field. · 8d6ecfcc
      Eric W. Biederman authored
      While useful at one time for selinux and the sysctl sanity
      checks those users no longer use the parent field and we can
      safely remove it.
      Inspired-by: default avatarLucian Adrian Grijincu <lucian.grijincu@gmil.com>
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      8d6ecfcc
    • Eric W. Biederman's avatar
      sysctl: Improve the sysctl sanity checks · 7c60c48f
      Eric W. Biederman authored
      - Stop validating subdirectories now that we only register leaf tables
      
      - Cleanup and improve the duplicate filename check.
        * Run the duplicate filename check under the sysctl_lock to guarantee
          we never add duplicate names.
        * Reduce the duplicate filename check to nearly O(M*N) where M is the
          number of entries in tthe table we are registering and N is the
          number of entries in the directory before we got there.
      
      - Move the duplicate filename check into it's own function and call
        it directtly from __register_sysctl_table
      
      - Kill the config option as the sanity checks are now cheap enough
        the config option is unnecessary. The original reason for the config
        option was because we had a huge table used to verify the proc filename
        to binary sysctl mapping.  That table has now evolved into the binary_sysctl
        translation layer and is no longer part of the sysctl_check code.
      
      - Tighten up the permission checks.  Guarnateeing that files only have read
        or write permissions.
      
      - Removed redudant check for parents having a procname as now everything has
        a procname.
      
      - Generalize the backtrace logic so that we print a backtrace from
        any failure of __register_sysctl_table that was not caused by
        a memmory allocation failure.  The backtrace allows us to track
        down who erroneously registered a sysctl table.
      
      Bechmark before (CONFIG_SYSCTL_CHECK=y):
          make-dummies 0 999 -> 12s
          rmmod dummy        -> 0.08s
      
      Bechmark before (CONFIG_SYSCTL_CHECK=n):
          make-dummies 0 999 -> 0.7s
          rmmod dummy        -> 0.06s
          make-dummies 0 99999 -> 1m13s
          rmmod dummy          -> 0.38s
      
      Benchmark after:
          make-dummies 0 999 -> 0.65s
          rmmod dummy        -> 0.055s
          make-dummies 0 9999 -> 1m10s
          rmmod dummy         -> 0.39s
      
      The sysctl sanity checks now impose no measurable cost.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      7c60c48f
    • Eric W. Biederman's avatar
      sysctl: register only tables of sysctl files · f728019b
      Eric W. Biederman authored
      Split the registration of a complex ctl_table array which may have
      arbitrary numbers of directories (->child != NULL) and tables of files
      into a series of simpler registrations that only register tables of files.
      
      Graphically:
      
         register('dir', { + file-a
                           + file-b
                           + subdir1
                             + file-c
                           + subdir2
                             + file-d
                             + file-e })
      
      is transformed into:
         wrapper->subheaders[0] = register('dir', {file1-a, file1-b})
         wrapper->subheaders[1] = register('dir/subdir1', {file-c})
         wrapper->subheaders[2] = register('dir/subdir2', {file-d, file-e})
         return wrapper
      
      This guarantees that __register_sysctl_table will only see a simple
      ctl_table array with all entries having (->child == NULL).
      
      Care was taken to pass the original simple ctl_table arrays to
      __register_sysctl_table whenever possible.
      
      This change is derived from a similar patch written
      by Lucrian Grijincu.
      Inspired-by: default avatarLucian Adrian Grijincu <lucian.grijincu@gmail.com>
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      f728019b
    • Eric W. Biederman's avatar
      sysctl: Add ctl_table chains into cstring paths · ec6a5266
      Eric W. Biederman authored
      For any component of table passed to __register_sysctl_paths
      that actually serves as a path, add that to the cstring path
      that is passed to __register_sysctl_table.
      
      The result is that for most calls to __register_sysctl_paths
      we only pass a table to __register_sysctl_table that contains
      no child directories.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      ec6a5266
    • Eric W. Biederman's avatar
      sysctl: Add support for register sysctl tables with a normal cstring path. · 6e9d5164
      Eric W. Biederman authored
      Make __register_sysctl_table the core sysctl registration operation and
      make it take a char * string as path.
      
      Now that binary paths have been banished into the real of backwards
      compatibility in kernel/binary_sysctl.c where they can be safely
      ignored there is no longer a need to use struct ctl_path to represent
      path names when registering ctl_tables.
      
      Start the transition to using normal char * strings to represent
      pathnames when registering sysctl tables.  Normal strings are easier
      to deal with both in the internal sysctl implementation and for
      programmers registering sysctl tables.
      
      __register_sysctl_paths is turned into a backwards compatibility wrapper
      that converts a ctl_path array into a normal char * string.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      6e9d5164
    • Eric W. Biederman's avatar
      sysctl: Create local copies of directory names used in paths · f05e53a7
      Eric W. Biederman authored
      Creating local copies of directory names is a good idea for
      two reasons.
      - The dynamic names used by callers must be copied into new
        strings by the callers today to ensure the strings do not
        change between register and unregister of the sysctl table.
      
      - Sysctl directories have a potentially different lifetime
        than the time between register and unregister of any
        particular sysctl table.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      f05e53a7
    • Eric W. Biederman's avatar
      sysctl: Remove the unnecessary sysctl_set parent concept. · bd295b56
      Eric W. Biederman authored
      In sysctl_net register the two networking roots in the proper order.
      
      In register_sysctl walk the sysctl sets in the reverse order of the
      sysctl roots.
      
      Remove parent from ctl_table_set and setup_sysctl_set as it is no
      longer needed.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      bd295b56
    • Eric W. Biederman's avatar
      sysctl: Implement retire_sysctl_set · 97324cd8
      Eric W. Biederman authored
      This adds a small helper retire_sysctl_set to remove the intimate knowledge about
      the how a sysctl_set is implemented from net/sysct_net.c
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      97324cd8
    • Eric W. Biederman's avatar
      sysctl: Make the directories have nlink == 1 · a15e2098
      Eric W. Biederman authored
      I goofed when I made sysctl directories have nlink == 0.
      nlink == 0 means the directory has been deleted.
      nlink == 1 meands a directory does not count subdirectories.
      
      Use the default nlink == 1 for sysctl directories.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      a15e2098
    • Eric W. Biederman's avatar
      sysctl: Move the implementation into fs/proc/proc_sysctl.c · 1f87f0b5
      Eric W. Biederman authored
      Move the core sysctl code from kernel/sysctl.c and kernel/sysctl_check.c
      into fs/proc/proc_sysctl.c.
      
      Currently sysctl maintenance is hampered by the sysctl implementation
      being split across 3 files with artificial layering between them.
      Consolidate the entire sysctl implementation into 1 file so that
      it is easier to see what is going on and hopefully allowing for
      simpler maintenance.
      
      For functions that are now only used in fs/proc/proc_sysctl.c remove
      their declarations from sysctl.h and make them static in fs/proc/proc_sysctl.c
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      1f87f0b5
    • Eric W. Biederman's avatar
      sysctl: Register the base sysctl table like any other sysctl table. · de4e83bd
      Eric W. Biederman authored
      Simplify the code by treating the base sysctl table like any other
      sysctl table and register it with register_sysctl_table.
      
      To ensure this table is registered early enough to avoid problems
      call sysctl_init from proc_sys_init.
      
      Rename sysctl_net.c:sysctl_init() to net_sysctl_init() to avoid
      name conflicts now that kernel/sysctl.c:sysctl_init() is no longer
      static.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      de4e83bd
    • Eric W. Biederman's avatar
      sysctl: Consolidate !CONFIG_SYSCTL handling · 0ce8974d
      Eric W. Biederman authored
      - In sysctl.h move functions only available if CONFIG_SYSCL
        is defined inside of #ifdef CONFIG_SYSCTL
      
      - Move the stub function definitions for !CONFIG_SYSCTL
        into sysctl.h and make them static inlines.
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      0ce8974d
    • Lucas De Marchi's avatar
      sysctl: remove impossible condition check · 36885d7b
      Lucas De Marchi authored
      Remove checks for conditions that will never happen. If procname is NULL
      the loop would already had bailed out, so there's no need to check it
      again.
      
      At the same time this also compacts the function find_in_table() by
      refactoring it to be easier to read.
      Signed-off-by: default avatarLucas De Marchi <lucas.demarchi@profusion.mobi>
      Reviewed-by: default avatarJesper Juhl <jj@chaosbits.net>
      Signed-off-by: default avatarEric W. Biederman <ebiederm@xmission.com>
      36885d7b
  2. 19 Jan, 2012 16 commits
  3. 18 Jan, 2012 10 commits
    • Linus Torvalds's avatar
      Merge branch 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending · 4ba3069f
      Linus Torvalds authored
      * 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending: (26 commits)
        target: Set additional sense length field in sense data
        target: Remove legacy device status check from transport_execute_tasks
        target: Remove __transport_execute_tasks() for each processing context
        target: Remove extra se_device->execute_task_lock access in fast path
        target: Drop se_device TCQ queue_depth usage from I/O path
        target: Fix possible NULL pointer with __transport_execute_tasks
        target: Remove TFO->check_release_cmd() fabric API caller
        tcm_fc: Convert ft_send_work to use target_submit_cmd
        target: Add target_submit_cmd() for process context fabric submission
        target: Make target_put_sess_cmd use target_release_cmd_kref
        target: Set response format in INQUIRY response
        target: tcm_mod_builder: small fixups
        Documentation/target: Fix tcm_mod_builder.py build breakage
        target: remove overagressive ____cacheline_aligned annoations
        tcm_loop: bump max_sectors
        target/configs: remove trailing newline from udev_path and alias
        iscsi-target: fix chap identifier simple_strtoul usage
        target: remove useless casts
        target: simplify target_check_cdb_and_preempt
        target: Move core_scsi3_check_cdb_abort_and_preempt
        ...
      4ba3069f
    • Linus Torvalds's avatar
      Merge branch 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux · 507a03c1
      Linus Torvalds authored
      This includes initial support for the recently published ACPI 5.0 spec.
      In particular, support for the "hardware-reduced" bit that eliminates
      the dependency on legacy hardware.
      
      APEI has patches resulting from testing on real hardware.
      
      Plus other random fixes.
      
      * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux: (52 commits)
        acpi/apei/einj: Add extensions to EINJ from rev 5.0 of acpi spec
        intel_idle: Split up and provide per CPU initialization func
        ACPI processor: Remove unneeded variable passed by acpi_processor_hotadd_init V2
        ACPI processor: Remove unneeded cpuidle_unregister_driver call
        intel idle: Make idle driver more robust
        intel_idle: Fix a cast to pointer from integer of different size warning in intel_idle
        ACPI: kernel-parameters.txt : Add intel_idle.max_cstate
        intel_idle: remove redundant local_irq_disable() call
        ACPI processor: Fix error path, also remove sysdev link
        ACPI: processor: fix acpi_get_cpuid for UP processor
        intel_idle: fix API misuse
        ACPI APEI: Convert atomicio routines
        ACPI: Export interfaces for ioremapping/iounmapping ACPI registers
        ACPI: Fix possible alignment issues with GAS 'address' references
        ACPI, ia64: Use SRAT table rev to use 8bit or 16/32bit PXM fields (ia64)
        ACPI, x86: Use SRAT table rev to use 8bit or 32bit PXM fields (x86/x86-64)
        ACPI: Store SRAT table revision
        ACPI, APEI, Resolve false conflict between ACPI NVS and APEI
        ACPI, Record ACPI NVS regions
        ACPI, APEI, EINJ, Refine the fix of resource conflict
        ...
      507a03c1
    • Stefan Berger's avatar
      tpm: fix (ACPI S3) suspend regression · be405411
      Stefan Berger authored
      This patch fixes an (ACPI S3) suspend regression introduced in commit
      68d6e671 ("tpm: Introduce function to poll for result of self test")
      and occurring with an Infineon TPM and tpm_tis and tpm_infineon drivers
      active.
      
      The suspend problem occurred if the TPM was disabled and/or deactivated
      and therefore the TPM_PCRRead checking the result of the (asynchronous)
      self test returned an error code which then caused the tpm_tis driver to
      become inactive and this then seemed to have negatively influenced the
      suspend support by the tpm_infineon driver...  Besides that the tpm_tis
      drive may stay active even if the TPM is disabled and/or deactivated.
      Signed-off-by: default avatarStefan Berger <stefanb@linux.vnet.ibm.com>
      Tested-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Acked-by: default avatarRajiv Andrade <srajiv@linux.vnet.ibm.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      be405411
    • Linus Torvalds's avatar
      nvme: fix merge error due to change of 'make_request_fn' fn type · 93c3d65b
      Linus Torvalds authored
      The type of 'make_request_fn' changed in 5a7bbad2 ("block: remove
      support for bio remapping from ->make_request"), but the merge of the
      nvme driver didn't take that into account, and as a result the driver
      would compile with a warning:
      
        drivers/block/nvme.c: In function 'nvme_alloc_ns':
        drivers/block/nvme.c:1336:2: warning: passing argument 2 of 'blk_queue_make_request' from incompatible pointer type [enabled by default]
        include/linux/blkdev.h:830:13: note: expected 'void (*)(struct request_queue *, struct bio *)' but argument is of type 'int (*)(struct request_queue *, struct bio *)'
      
      It's benign, but the warning is annoying.
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org>
      Cc: Matthew Wilcox <matthew.r.wilcox@intel.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      93c3d65b
    • Stephen Rothwell's avatar
      xen: using EXPORT_SYMBOL requires including export.h · 9ef9b20b
      Stephen Rothwell authored
      Fix these warnings:
      
        drivers/xen/biomerge.c:14:1: warning: data definition has no type or storage class [enabled by default]
        drivers/xen/biomerge.c:14:1: warning: type defaults to 'int' in declaration of 'EXPORT_SYMBOL' [-Wimplicit-int]
        drivers/xen/biomerge.c:14:1: warning: parameter names (without types) in function declaration [enabled by default]
      
      And this build error:
      
        ERROR: "xen_biovec_phys_mergeable" [drivers/block/nvme.ko] undefined!
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9ef9b20b
    • Linus Torvalds's avatar
      Merge branch 'for-linus/i2c-33' of git://git.fluff.org/bjdooks/linux · aa303f2c
      Linus Torvalds authored
      * 'for-linus/i2c-33' of git://git.fluff.org/bjdooks/linux:
        i2c-eg20t: Change-company-name-OKI-SEMICONDUCTOR to LAPIS Semiconductor
        i2c-eg20t: Support new device LAPIS Semiconductor ML7831 IOH
        i2c-eg20t: modified the setting of transfer rate.
        i2c-eg20t: use i2c_add_numbered_adapter to get a fixed bus number
        i2c: OMAP: Add DT support for i2c controller
        I2C: OMAP: NACK without STP
        I2C: OMAP: correct SYSC register offset for OMAP4
      aa303f2c
    • Linus Torvalds's avatar
      Merge branch 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media · 4a7c1ff2
      Linus Torvalds authored
      * 'v4l_for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media: (57 commits)
        [media] as3645a: Fix compilation by including slab.h
        [media] s5p-fimc: Remove linux/version.h include from fimc-mdevice.c
        [media] s5p-mfc: Remove linux/version.h include from s5p_mfc.c
        [media] ds3000: using logical && instead of bitwise &
        [media] v4l2-ctrls: make control names consistent
        [media] DVB: dib0700, add support for Nova-TD LEDs
        [media] DVB: dib0700, add corrected Nova-TD frontend_attach
        [media] DVB: dib0700, separate stk7070pd initialization
        [media] DVB: dib0700, move Nova-TD Stick to a separate set
        [media] : add MODULE_FIRMWARE to dib0700
        [media] DVB-CORE: remove superfluous DTV_CMDs
        [media] s5p-jpeg: adapt to recent videobuf2 changes
        [media] s5p-g2d: fixed a bug in controls setting function
        [media] s5p-mfc: Fix volatile controls setup
        [media] drivers/media/video/s5p-mfc/s5p_mfc.c: adjust double test
        [media] drivers/media/video/s5p-fimc/fimc-capture.c: adjust double test
        [media] s5p-fimc: Fix incorrect control ID assignment
        [media] dvb_frontend: Don't call get_frontend() if idle
        [media] DocBook/dvbproperty.xml: Remove DTV_MODULATION from ISDB-T
        [media] DocBook/dvbproperty.xml: Fix ISDB-T delivery system parameters
        ...
      4a7c1ff2
    • Linus Torvalds's avatar
      Merge branch 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound · 9278e634
      Linus Torvalds authored
      * 'fix/asoc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound:
        ASoC: Wait for WM8993 FLL to stabilise
        ASoC: core - Free platform DAPM context at platform removal.
        ASoC: dapm - Fix check for codec context in dapm_power_widgets().
        ASoC: sgtl5000: update author email address
        ASoC: Fix DMA channel leak in imx-pcm-dma-mx2 driver.
      9278e634
    • Laxman Dewangan's avatar
      gpio: tps65910: Use correct offset for gpio initialization · 94bd2442
      Laxman Dewangan authored
      Using the correct gpio offset for setting the initial value
      of gpio when setting output direction.
      Signed-off-by: default avatarLaxman Dewangan <ldewangan@nvidia.com>
      Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
      94bd2442
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6 · d71f5be2
      Linus Torvalds authored
      SCSI updates on 20120118
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi-misc-2.6: (49 commits)
        [SCSI] libfc: remove redundant timer init for fcp
        [SCSI] fcoe: Move fcoe_debug_logging from fcoe.h to fcoe.c
        [SCSI] libfc: Declare local functions static
        [SCSI] fcoe: fix regression on offload em matching function for initiator/target
        [SCSI] qla4xxx: Update driver version to 5.02.00-k12
        [SCSI] qla4xxx: Cleanup modinfo display
        [SCSI] qla4xxx: Update license
        [SCSI] qla4xxx: Clear the RISC interrupt bit during FW init
        [SCSI] qla4xxx: Added error logging for firmware abort
        [SCSI] qla4xxx: Disable generating pause frames in case of FW hung
        [SCSI] qla4xxx: Temperature monitoring for ISP82XX core.
        [SCSI] megaraid: fix sparse warnings
        [SCSI] sg: convert to kstrtoul_from_user()
        [SCSI] don't change sdev starvation list order without request dispatched
        [SCSI] isci: fix, prevent port from getting stuck in the 'configuring' state
        [SCSI] isci: fix start OOB
        [SCSI] isci: fix io failures while wide port links are coming up
        [SCSI] isci: allow more time for wide port targets
        [SCSI] isci: enable wide port targets
        [SCSI] isci: Fix IO fails when pull cable from phy in x4 wideport in MPC mode.
        ...
      d71f5be2