25 May, 2011

1 commit

  • * 'drm-core-next' of git://git.kernel.org/pub/scm/linux/kernel/git/airlied/drm-2.6: (169 commits)
    drivers/gpu/drm/radeon/atom.c: fix warning
    drm/radeon/kms: bump kms version number
    drm/radeon/kms: properly set num banks for fusion asics
    drm/radeon/kms/atom: move dig phy init out of modesetting
    drm/radeon/kms/cayman: fix typo in register mask
    drm/radeon/kms: fix typo in spread spectrum code
    drm/radeon/kms: fix tile_config value reported to userspace on cayman.
    drm/radeon/kms: fix incorrect comparison in cayman setup code.
    drm/radeon/kms: add wait idle ioctl for eg->cayman
    drm/radeon/cayman: setup hdp to invalidate and flush when asked
    drm/radeon/evergreen/btc/fusion: setup hdp to invalidate and flush when asked
    agp/uninorth: Fix lockups with radeon KMS and >1x.
    drm/radeon/kms: the SS_Id field in the LCD table if for LVDS only
    drm/radeon/kms: properly set the CLK_REF bit for DCE3 devices
    drm/radeon/kms: fixup eDP connector handling
    drm/radeon/kms: bail early for eDP in hotplug callback
    drm/radeon/kms: simplify hotplug handler logic
    drm/radeon/kms: rewrite DP handling
    drm/radeon/kms/atom: add support for setting DP panel mode
    drm/radeon/kms: atombios.h updates for DP panel mode
    ...

    Linus Torvalds
     

24 May, 2011

1 commit

  • * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6: (27 commits)
    PCI: Don't use dmi_name_in_vendors in quirk
    PCI: remove unused AER functions
    PCI/sysfs: move bus cpuaffinity to class dev_attrs
    PCI: add rescan to /sys/.../pci_bus/.../
    PCI: update bridge resources to get more big ranges when allocating space (again)
    KVM: Use pci_store/load_saved_state() around VM device usage
    PCI: Add interfaces to store and load the device saved state
    PCI: Track the size of each saved capability data area
    PCI/e1000e: Add and use pci_disable_link_state_locked()
    x86/PCI: derive pcibios_last_bus from ACPI MCFG
    PCI: add latency tolerance reporting enable/disable support
    PCI: add OBFF enable/disable support
    PCI: add ID-based ordering enable/disable support
    PCI hotplug: acpiphp: assume device is in state D0 after powering on a slot.
    PCI: Set PCIE maxpayload for card during hotplug insertion
    PCI/ACPI: Report _OSC control mask returned on failure to get control
    x86/PCI: irq and pci_ids patch for Intel Panther Point DeviceIDs
    PCI: handle positive error codes
    PCI: check pci_vpd_pci22_wait() return
    PCI: Use ICH6_GPIO_EN in ich6_lpc_acpi_gpio
    ...

    Fix up trivial conflicts in include/linux/pci_ids.h: commit a6e5e2be4461
    moved the intel SMBUS ID definitons to the i2c-i801.c driver.

    Linus Torvalds
     

22 May, 2011

8 commits

  • Don't use the costly dmi_name_in_vendors() when we know the string we
    are looking for can only be in the DMI board name field. This is more
    robust and, more importantly, much faster.

    Signed-off-by: Jean Delvare
    Signed-off-by: Jesse Barnes

    Jean Delvare
     
  • In the commit 28eb5f2, aer_osc_setup is removed but corresponding
    definiton information in the aerdrv.h is missed.

    Acked-by: Rafael J. Wysocki
    Signed-off-by: Chen Gong
    Signed-off-by: Jesse Barnes

    Chen Gong
     
  • Requested by Greg KH to fix a race condition in the creating of PCI bus
    cpuaffinity files.

    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Yinghai Lu
    Signed-off-by: Jesse Barnes

    Yinghai Lu
     
  • After remove the device from /sys, we have to rescan all or
    find out the bridge and access /sys../device/rescan there.

    this patch add /sys/.../pci_bus/.../rescan. So user can rescan more easy.
    that is more clean and easy to understand.

    like after remove 0000:c4:00.0, you can rescan 0000:c4 directly.

    -v2: According to Jesse, use function instead of exposing attr, so could hide
    #ifdef in header file.
    also add code to remove rescan file in remove path.
    -v3: GregKH pointed out that we should use dev_attrs to avoid racing.
    So add pcibus_attrs and make it to be member of pcibus_attrs.
    -v4: Change name to pcibus_dev_attrs according to GregKH

    Acked-by: Greg Kroah-Hartman
    Signed-off-by: Yinghai Lu
    Signed-off-by: Jesse Barnes

    Yinghai Lu
     
  • With Ram's fixes, this should be safe to do again. So let's give it
    another try.

    BIOS separates IO ranges between several IOHs, and on some slots, BIOS
    assigns resources to a bridge, but stops assigning resources to the
    device under that bridge, because the device needs a big resource.

    So:
    1. allocate resources and record the failed device resources
    2. clear the BIOS assigned resources of the parent bridge of failing device
    3. go back and call pci assign unassigned
    4. if it still fails, go up the tree, clear more bridges. and try again

    Now Ram's allocate requested resource already got into mainline. could
    put this one again.

    Reviewed-by: Ram Pai
    Signed-off-by: Yinghai Lu
    Signed-off-by: Jesse Barnes

    Yinghai Lu
     
  • For KVM device assignment, we'd like to save off the state of a device
    prior to passing it to the guest and restore it later. We also want
    to allow pci_reset_funciton() to be called while the device is owned
    by the guest. This however overwrites and invalidates the struct pci_dev
    buffers, so we can't just manually call save and restore. Add generic
    interfaces for the saved state to be stored and reloaded back into
    struct pci_dev at a later time.

    Signed-off-by: Alex Williamson
    Signed-off-by: Jesse Barnes

    Alex Williamson
     
  • This will allow us to store and load it later.

    Signed-off-by: Alex Williamson
    Signed-off-by: Jesse Barnes

    Alex Williamson
     
  • Need to use it in _e1000e_disable_aspm. This routine is used for error
    recovery, where the pci_bus_sem is already held, and we don't want
    pci_disable_link_state to try to take it again. So add a locked variant
    for use in cases like this.

    Found lock up:

    [ 2374.654557] kworker/32:1 D ffff881027f6b0f0 0 6075 2 0x00000000
    [ 2374.654816] ffff88503f099a68 0000000000000046 ffff88503f098000 0000000000004000
    [ 2374.654837] 00000000001d1ec0 ffff88503f099fd8 00000000001d1ec0 ffff88503f099fd8
    [ 2374.654860] 0000000000004000 00000000001d1ec0 ffff88503dcc8000 ffff88503f090000
    [ 2374.654880] Call Trace:
    [ 2374.654898] [] ? __lock_acquired+0x3a/0x224
    [ 2374.654914] [] ? _raw_spin_unlock_irq+0x30/0x36
    [ 2374.654925] [] ? trace_hardirqs_on_caller+0x1f/0x178
    [ 2374.654936] [] rwsem_down_failed_common+0xd3/0x103
    [ 2374.654945] [] ? __lock_contended+0x3a/0x2a2
    [ 2374.654955] [] rwsem_down_read_failed+0x12/0x14
    [ 2374.654967] [] call_rwsem_down_read_failed+0x14/0x30
    [ 2374.654981] [] ? pci_disable_link_state+0x5f/0xf5
    [ 2374.654990] [] ? down_read+0x7e/0x91
    [ 2374.654999] [] ? pci_disable_link_state+0x5f/0xf5
    [ 2374.655008] [] pci_disable_link_state+0x5f/0xf5
    [ 2374.655024] [] e1000e_disable_aspm+0x55/0x5a
    [ 2374.655037] [] e1000_io_slot_reset+0x59/0xea
    [ 2374.655048] [] ? report_mmio_enabled+0x5d/0x5d
    [ 2374.655057] [] report_slot_reset+0x2e/0x5d
    [ 2374.655072] [] pci_walk_bus+0x8a/0xb7
    [ 2374.655081] [] ? report_mmio_enabled+0x5d/0x5d
    [ 2374.655091] [] broadcast_error_message+0xa4/0xb2
    [ 2374.655101] [] ? pci_bus_read_config_dword+0x72/0x80
    [ 2374.655110] [] do_recovery+0x9e/0xf9
    [ 2374.655120] [] handle_error_source+0x4c/0x51
    [ 2374.655129] [] aer_isr_one_error+0x1e9/0x21a
    [ 2374.655138] [] aer_isr+0xc7/0xcc
    [ 2374.655147] [] ? aer_isr_one_error+0x21a/0x21a
    [ 2374.655159] [] process_one_work+0x237/0x3ec
    [ 2374.655168] [] ? process_one_work+0x1a8/0x3ec
    [ 2374.655178] [] worker_thread+0x17c/0x240
    [ 2374.655186] [] ? trace_hardirqs_on+0xd/0xf
    [ 2374.655196] [] ? manage_workers+0xab/0xab
    [ 2374.655209] [] kthread+0xa0/0xa8
    [ 2374.655223] [] kernel_thread_helper+0x4/0x10
    [ 2374.655232] [] ? retint_restore_args+0xe/0xe
    [ 2374.655243] [] ? __init_kthread_worker+0x5b/0x5b
    [ 2374.655252] [] ? gs_change+0xb/0xb

    when aer happens,
    pci_walk_bus already have down_read(&pci_bus_sem)...
    then report_slot_reset
    ==> e1000_io_slot_reset
    ==> e1000e_disable_aspm
    ==> pci_disable_link_state...

    We can not use pci_disable_link_state, and it will try to hold pci_bus_sem again.

    Try to have __pci_disable_link_state that will not need to hold pci_bus_sem.

    -v2: change name to pci_disable_link_state_locked() according to Jesse.

    [jbarnes: make sure new function is exported for modules]

    Signed-off-by: Yinghai Lu
    Signed-off-by: Jesse Barnes

    Yinghai Lu
     

20 May, 2011

1 commit

  • …/git/tip/linux-2.6-tip

    * 'core-iommu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, gart: Rename pci-gart_64.c to amd_gart_64.c
    x86/amd-iommu: Use threaded interupt handler
    arch/x86/kernel/pci-iommu_table.c: Convert sprintf_symbol to %pS
    x86/amd-iommu: Add support for invalidate_all command
    x86/amd-iommu: Add extended feature detection
    x86/amd-iommu: Add ATS enable/disable code
    x86/amd-iommu: Add flag to indicate IOTLB support
    x86/amd-iommu: Flush device IOTLB if ATS is enabled
    x86/amd-iommu: Select PCI_IOV with AMD IOMMU driver
    PCI: Move ATS declarations in seperate header file
    dma-debug: print information about leaked entry
    x86/amd-iommu: Flush all internal TLBs when IOMMUs are enabled
    x86/amd-iommu: Rename iommu_flush_device
    x86/amd-iommu: Improve handling of full command buffer
    x86/amd-iommu: Rename iommu_flush* to domain_flush*
    x86/amd-iommu: Remove command buffer resetting logic
    x86/amd-iommu: Cleanup completion-wait handling
    x86/amd-iommu: Cleanup inv_pages command handling
    x86/amd-iommu: Move inv-dte command building to own function
    x86/amd-iommu: Move compl-wait command building to own function

    Linus Torvalds
     

17 May, 2011

1 commit

  • During pci remove/rescan testing found:

    pci 0000:c0:03.0: PCI bridge to [bus c4-c9]
    pci 0000:c0:03.0: bridge window [io 0x1000-0x0fff]
    pci 0000:c0:03.0: bridge window [mem 0xf0000000-0xf00fffff]
    pci 0000:c0:03.0: bridge window [mem 0xfc180000000-0xfc197ffffff 64bit pref]
    pci 0000:c0:03.0: device not available (can't reserve [io 0x1000-0x0fff])
    pci 0000:c0:03.0: Error enabling bridge (-22), continuing
    pci 0000:c0:03.0: enabling bus mastering
    pci 0000:c0:03.0: setting latency timer to 64
    pcieport 0000:c0:03.0: device not available (can't reserve [io 0x1000-0x0fff])
    pcieport: probe of 0000:c0:03.0 failed with error -22

    This bug was caused by commit c8adf9a3e873 ("PCI: pre-allocate
    additional resources to devices only after successful allocation of
    essential resources.")

    After that commit, pci_hotplug_io_size is changed to additional_io_size
    from minium size. So it will not go through resource_size(res) != 0
    path, and will not be reset.

    The root cause is: pci_bridge_check_ranges will set RESOURCE_IO flag for
    pci bridge, and later if children do not need IO resource. those bridge
    resources will not need to be allocated. but flags is still there.
    that will confuse the the pci_enable_bridges later.

    related code:

    static void assign_requested_resources_sorted(struct resource_list *head,
    struct resource_list_x *fail_head)
    {
    struct resource *res;
    struct resource_list *list;
    int idx;

    for (list = head->next; list; list = list->next) {
    res = list->res;
    idx = res - &list->dev->resource[0];
    if (resource_size(res) && pci_assign_resource(list->dev, idx)) {
    ...
    reset_resource(res);
    }
    }
    }

    At last, We have to clear the flags in pbus_size_mem/io when requested
    size == 0 and !add_head. becasue this case it will not go through
    adjust_resources_sorted().

    Just make size1 = size0 when !add_head. it will make flags get cleared.

    At the same time when requested size == 0, add_size != 0, will still
    have in head and add_list. because we do not clear the flags for it.

    After this, we will get right result:

    pci 0000:c0:03.0: PCI bridge to [bus c4-c9]
    pci 0000:c0:03.0: bridge window [io disabled]
    pci 0000:c0:03.0: bridge window [mem 0xf0000000-0xf00fffff]
    pci 0000:c0:03.0: bridge window [mem 0xfc180000000-0xfc197ffffff 64bit pref]
    pci 0000:c0:03.0: enabling bus mastering
    pci 0000:c0:03.0: setting latency timer to 64
    pcieport 0000:c0:03.0: setting latency timer to 64
    pcieport 0000:c0:03.0: irq 160 for MSI/MSI-X
    pcieport 0000:c0:03.0: Signaling PME through PCIe PME interrupt
    pci 0000:c4:00.0: Signaling PME through PCIe PME interrupt
    pcie_pme 0000:c0:03.0:pcie01: service driver pcie_pme loaded
    aer 0000:c0:03.0:pcie02: service driver aer loaded
    pciehp 0000:c0:03.0:pcie04: Hotplug Controller:

    v3: more simple fix. also fix one typo in pbus_size_mem

    Signed-off-by: Yinghai Lu
    Reviewed-by: Ram Pai
    Cc: Jesse Barnes
    Cc: Bjorn Helgaas
    Signed-off-by: Linus Torvalds

    Yinghai Lu
     

12 May, 2011

4 commits


11 May, 2011

9 commits

  • The following patch sets the MaxPayload setting to match the parent
    reading when inserting a PCIE card into a hotplug slot. On our system,
    the upstream bridge is set to 256, but when inserting a card, the card
    setting defaults to 128. As soon as I/O is performed to the card it
    starts receiving errors since the payload size is too small.

    Reviewed-by: Kenji Kaneshige
    Signed-off-by: Jordan Hargrave
    Signed-off-by: Jesse Barnes

    Jordan_Hargrave@Dell.com
     
  • Callers expect pci_user_{read,write}_config_*() to indicate errors by
    returning negative values. Prior to this change, the indicated routines
    could return positive error codes (e.g. PCIBIOS_BAD_REGISTER_NUMBER)
    which callers would mistakenly interpret as success.

    This change converts any non-zero return from the mentioned routines
    into unambiguous negative value return codes.

    Signed-off-by: Greg Thelen
    Signed-off-by: Jesse Barnes

    Greg Thelen
     
  • pci_vpd_pci22_write() calls pci_vpd_pci22_wait() after writing
    PCI_VPD_DATA and PCI_VPD_ADDR to wait for the VPD operation to complete.
    The result pci_vpd_pci22_wait() was not checked for error.

    This change checks for error.

    Signed-off-by: Greg Thelen
    Signed-off-by: Jesse Barnes

    Greg Thelen
     
  • We were just lucky that ICH4_GPIO_EN and ICH6_GPIO_EN happen to have
    the same value.

    Signed-off-by: Jean Delvare
    Signed-off-by: Jesse Barnes

    Jean Delvare
     
  • Signed-off-by: Jean Delvare
    Signed-off-by: Jesse Barnes

    Jean Delvare
     
  • TI816X (common name for DM816x/C6A816x/AM389x family) devices configured
    to boot as PCIe Endpoint have class code = 0. This makes kernel PCI bus
    code to skip allocating BARs to these devices resulting into following
    type of error when trying to enable them:

    "Device 0000:01:00.0 not available because of resource collisions"

    The device cannot be operated because of the above issue.

    This patch adds a ID specific (TI VENDOR ID and 816X DEVICE ID based)
    'early' fixup quirk to replace class code with
    PCI_CLASS_MULTIMEDIA_VIDEO as class.

    Signed-off-by: Hemant Pedanekar
    Signed-off-by: Jesse Barnes

    Hemant Pedanekar
     
  • If it was preempted, and the variable aer_mask_override is changed
    after the spin_unlock_irqrestore it will write an uninitialized
    variable by the pci_write_config_dword() function.

    Signed-off-by: Wanlong Gao
    Signed-off-by: Jesse Barnes

    Wanlong Gao
     
  • The pci_pm_reset() function is not a very nice interface due to its
    limitations and conditional behavior (e.g. it doesn't affect devices
    in low-power states), but it cannot be simply dropped, because
    existing device drivers may depend on it. However, its behavior and
    limitations should be well documented, so add an appropriate
    kerneldoc comment to it.

    Signed-off-by: Rafael J. Wysocki
    Signed-off-by: Jesse Barnes

    Rafael J. Wysocki
     
  • Commit 2f671e2d allowed us to clear ASPM state when the FADT
    tells us it isn't supported, but we don't put this into effect
    if the aspm_policy is set to POLICY_POWERSAVE. Enable the
    state to be cleared regardless of policy.

    Signed-off-by: Alex Williamson
    Signed-off-by: Jesse Barnes

    Alex Williamson
     

10 May, 2011

1 commit


04 May, 2011

1 commit

  • So in a lot of modern systems, a GPU will always be below a parent bridge that won't share with any other GPUs. This means VGA arbitration on those GPUs can be controlled by using the bridge routing instead of io/mem decodes.

    The problem is locating which GPUs share which upstream bridges. This patch attempts to identify all the GPUs which can be controlled via bridges, and ones that can't. This patch endeavours to work out the bridge sharing semantics.

    When disabling GPUs via a bridge, it doesn't do irq callbacks or touch the io/mem decodes for the gpu.

    Signed-off-by: Dave Airlie

    Dave Airlie
     

22 Apr, 2011

1 commit


21 Apr, 2011

1 commit

  • Intel VT-d Protected Memory Regions (PMRs) are supposed to be disabled,
    on each VT-d engine, after DMA remapping is enabled on the engines.
    This is because the behavior of having both enabled is not deterministic
    and because, if TXT has been used to launch the kernel, the PMRs may be
    programmed to cover memory regions that will be used for DMA.

    Under some circumstances (certain quirks detected, lack of multiple
    devices, etc.), the current code does not set up DMA remapping on some
    VT-d engines. In such cases it also skips disabling the PMRs. This
    causes failures when the kernel is launched with TXT (most often this
    occurs on the graphics engine and results in colored vertical bars on
    the display).

    This patch detects when the kernel has been launched with TXT and then
    disables the PMRs on all VT-d engines. In some cases where the reason
    that remapping is not being enabled is due to possible ACPI DMAR table
    errors, the VT-d engine addresses may not be correct and thus not able
    to be safely programmed even to disable PMRs. Because part of the TXT
    launch process is the verification of these addresses, it will always be
    safe to disable PMRs if the TXT launch has succeeded and hence only
    doing this in such cases.

    Signed-off-by: Joseph Cihula
    Signed-off-by: David Woodhouse

    Joseph Cihula
     

20 Apr, 2011

1 commit


12 Apr, 2011

3 commits

  • Create a kconfig option symbol for PCI_LABEL and enable it
    when DMI || ACPI are enabled.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Jesse Barnes

    Randy Dunlap
     
  • Xen save/restore is going to use hibernate device callbacks for
    quiescing devices and putting them back to normal operations and it
    would need to select CONFIG_HIBERNATION for this purpose. However,
    that also would cause the hibernate interfaces for user space to be
    enabled, which might confuse user space, because the Xen kernels
    don't support hibernation. Moreover, it would be wasteful, as it
    would make the Xen kernels include a substantial amount of code that
    they would never use.

    To address this issue introduce new power management Kconfig option
    CONFIG_HIBERNATE_CALLBACKS, such that it will only select the code
    that is necessary for the hibernate device callbacks to work and make
    CONFIG_HIBERNATION select it. Then, Xen save/restore will be able to
    select CONFIG_HIBERNATE_CALLBACKS without dragging the entire
    hibernate code along with it.

    Signed-off-by: Rafael J. Wysocki
    Tested-by: Shriram Rajagopalan

    Rafael J. Wysocki
     
  • In commit 13583b16592a ("PCI: refactor io size calculation code") Ram
    had a thinko in the refactorization of the code: the end result used the
    variable 'align' for the bus alignment, but the original code used
    'min_align'.

    Since then, another use of that 'align' variable got introduced by
    commit c8adf9a3e873 ("PCI: pre-allocate additional resources to devices
    only after successful allocation of essential resources.")

    Fix both of those uses to use 'min_align' as they should.

    Daniel Hellstrom
    Acked-by: Ram Pai
    Acked-by: Jesse Barnes
    Signed-off-by: Linus Torvalds

    Linus Torvalds
     

11 Apr, 2011

1 commit

  • This patch moves the relevant declarations from the local
    header file in drivers/pci to a more accessible locations so
    that it can be used by the AMD IOMMU driver too.
    The file is named pci-ats.h because support for the PCI PRI
    capability will also be added there in a later patch-set.

    Signed-off-by: Joerg Roedel
    Acked-by: Jesse Barnes

    Joerg Roedel
     

31 Mar, 2011

1 commit


29 Mar, 2011

1 commit


26 Mar, 2011

2 commits


24 Mar, 2011

2 commits

  • * 'release' of git://git.kernel.org/pub/scm/linux/kernel/git/lenb/linux-acpi-2.6: (42 commits)
    ACPI: minor printk format change in acpi_pad
    ACPI: make acpi_pad /sys output more readable
    ACPICA: Update version to 20110316
    ACPICA: Header support for SLIC table
    ACPI: Make sure the FADT is at least rev 2 before using the reset register
    ACPI: Bug compatibility for Windows on the ACPI reboot vector
    ACPICA: Fix access width for reset vector
    ACPI battery: fribble sysfs files from a resume notifier
    ACPI button: remove unused procfs I/F
    ACPI, APEI, Add PCIe AER error information printing support
    PCIe, AER, use pre-generated prefix in error information printing
    ACPI, APEI, Add ERST record ID cache
    ACPI: Use syscore_ops instead of sysdev class and sysdev
    ACPI: Remove the unused EC sysdev class
    ACPI: use __cpuinit for the acpi_processor_set_pdc() call tree
    ACPI: use __init where possible in processor driver
    Thermal_Framework-Fix_crash_during_hwmon_unregister
    ACPICA: Update version to 20110211.
    ACPICA: Add mechanism to defer _REG methods for some installed handlers
    ACPICA: Add support for FunctionalFixedHW in acpi_ut_get_region_name
    ...

    Linus Torvalds
     
  • - Introduce ns_capable to test for a capability in a non-default
    user namespace.
    - Teach cap_capable to handle capabilities in a non-default
    user namespace.

    The motivation is to get to the unprivileged creation of new
    namespaces. It looks like this gets us 90% of the way there, with
    only potential uid confusion issues left.

    I still need to handle getting all caps after creation but otherwise I
    think I have a good starter patch that achieves all of your goals.

    Changelog:
    11/05/2010: [serge] add apparmor
    12/14/2010: [serge] fix capabilities to created user namespaces
    Without this, if user serge creates a user_ns, he won't have
    capabilities to the user_ns he created. THis is because we
    were first checking whether his effective caps had the caps
    he needed and returning -EPERM if not, and THEN checking whether
    he was the creator. Reverse those checks.
    12/16/2010: [serge] security_real_capable needs ns argument in !security case
    01/11/2011: [serge] add task_ns_capable helper
    01/11/2011: [serge] add nsown_capable() helper per Bastian Blank suggestion
    02/16/2011: [serge] fix a logic bug: the root user is always creator of
    init_user_ns, but should not always have capabilities to
    it! Fix the check in cap_capable().
    02/21/2011: Add the required user_ns parameter to security_capable,
    fixing a compile failure.
    02/23/2011: Convert some macros to functions as per akpm comments. Some
    couldn't be converted because we can't easily forward-declare
    them (they are inline if !SECURITY, extern if SECURITY). Add
    a current_user_ns function so we can use it in capability.h
    without #including cred.h. Move all forward declarations
    together to the top of the #ifdef __KERNEL__ section, and use
    kernel-doc format.
    02/23/2011: Per dhowells, clean up comment in cap_capable().
    02/23/2011: Per akpm, remove unreachable 'return -EPERM' in cap_capable.

    (Original written and signed off by Eric; latest, modified version
    acked by him)

    [akpm@linux-foundation.org: fix build]
    [akpm@linux-foundation.org: export current_user_ns() for ecryptfs]
    [serge.hallyn@canonical.com: remove unneeded extra argument in selinux's task_has_capability]
    Signed-off-by: Eric W. Biederman
    Signed-off-by: Serge E. Hallyn
    Acked-by: "Eric W. Biederman"
    Acked-by: Daniel Lezcano
    Acked-by: David Howells
    Cc: James Morris
    Signed-off-by: Serge E. Hallyn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Serge E. Hallyn