1. 02 4月, 2015 3 次提交
    • G
      ARM: 8338/1: kexec: Relax SMP validation to improve DT compatibility · fee3fd4f
      Geert Uytterhoeven 提交于
      When trying to kexec into a new kernel on a platform where multiple CPU
      cores are present, but no SMP bringup code is available yet, the
      kexec_load system call fails with:
      
          kexec_load failed: Invalid argument
      
      The SMP test added to machine_kexec_prepare() in commit 2103f6cb
      ("ARM: 7807/1: kexec: validate CPU hotplug support") wants to prohibit
      kexec on SMP platforms where it cannot disable secondary CPUs.
      However, this test is too strict: if the secondary CPUs couldn't be
      enabled in the first place, there's no need to disable them later at
      kexec time.  Hence skip the test in the absence of SMP bringup code.
      
      This allows to add all CPU cores to the DTS from the beginning, without
      having to implement SMP bringup first, improving DT compatibility.
      Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be>
      Acked-by: NStephen Warren <swarren@nvidia.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      fee3fd4f
    • R
      ARM: move reboot code to arch/arm/kernel/reboot.c · 045ab94e
      Russell King 提交于
      Move shutdown and reboot related code to a separate file, out of
      process.c.  This helps to avoid polluting process.c with non-process
      related code.
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      045ab94e
    • R
      ARM: fix broken hibernation · 767bf7e7
      Russell King 提交于
      Normally, when a CPU wants to clear a cache line to zero in the external
      L2 cache, it would generate bus cycles to write each word as it would do
      with any other data access.
      
      However, a Cortex A9 connected to a L2C-310 has a specific feature where
      the CPU can detect this operation, and signal that it wants to zero an
      entire cache line.  This feature, known as Full Line of Zeros (FLZ),
      involves a non-standard AXI signalling mechanism which only the L2C-310
      can properly interpret.
      
      There are separate enable bits in both the L2C-310 and the Cortex A9 -
      the L2C-310 needs to be enabled and have the FLZ enable bit set in the
      auxiliary control register before the Cortex A9 has this feature
      enabled.
      
      Unfortunately, the suspend code was not respecting this - it's not
      obvious from the code:
      
      swsusp_arch_suspend()
       cpu_suspend() /* saves the Cortex A9 auxiliary control register */
        arch_save_image()
        soft_restart() /* turns off FLZ in Cortex A9, and disables L2C */
         cpu_resume() /* restores the Cortex A9 registers, inc auxcr */
      
      At this point, we end up with the L2C disabled, but the Cortex A9 with
      FLZ enabled - which means any memset() or zeroing of a full cache line
      will fail to take effect.
      
      A similar issue exists in the resume path, but it's slightly more
      complex:
      
      swsusp_arch_suspend()
       cpu_suspend() /* saves the Cortex A9 auxiliary control register */
        arch_save_image() /* image with A9 auxcr saved */
      ...
      swsusp_arch_resume()
       call_with_stack()
        arch_restore_image() /* restores image with A9 auxcr saved above */
        soft_restart() /* turns off FLZ in Cortex A9, and disables L2C */
         cpu_resume() /* restores the Cortex A9 registers, inc auxcr */
      
      Again, here we end up with the L2C disabled, but Cortex A9 FLZ enabled.
      
      There's no need to turn off the L2C in either of these two paths; there
      are benefits from not doing so - for example, the page copies will be
      faster with the L2C enabled.
      
      Hence, fix this by providing a variant of soft_restart() which can be
      used without turning the L2 cache controller off, and use it in both
      of these paths to keep the L2C enabled across the respective resume
      transitions.
      
      Fixes: 8ef418c7 ("ARM: l2c: trial at enabling some Cortex-A9 optimisations")
      Reported-by: NSean Cross <xobs@kosagi.com>
      Tested-by: NSean Cross <xobs@kosagi.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      767bf7e7
  2. 30 3月, 2015 6 次提交
  3. 29 3月, 2015 2 次提交
  4. 28 3月, 2015 5 次提交
  5. 18 3月, 2015 1 次提交
  6. 10 3月, 2015 1 次提交
  7. 25 2月, 2015 1 次提交
  8. 23 2月, 2015 4 次提交
    • C
      ARM: 8304/1: Respect NO_KERNEL_MAPPING when we don't have an IOMMU · 6e8266e3
      Carlo Caione 提交于
      Even without an iommu, NO_KERNEL_MAPPING is still convenient to save on
      kernel address space in places where we don't need a kernel mapping.
      Implement support for it in the two places where we're creating an
      expensive mapping.
      
      __alloc_from_pool uses an internal pool from which we already have
      virtual addresses, so it's not relevant, and __alloc_simple_buffer uses
      alloc_pages, which will always return a lowmem page, which is already
      mapped into kernel space, so we can't prevent a mapping for it in that
      case.
      Signed-off-by: NJasper St. Pierre <jstpierre@mecheye.net>
      Signed-off-by: NCarlo Caione <carlo@caione.org>
      Reviewed-by: NRob Clark <robdclark@gmail.com>
      Reviewed-by: NDaniel Drake <dsd@endlessm.com>
      Acked-by: NMarek Szyprowski <m.szyprowski@samsung.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      6e8266e3
    • L
      ARM: 8293/1: kernel: fix pci_mmap_page_range() offset calculation · 415ae101
      Lorenzo Pieralisi 提交于
      The pci_mmap_page_range() API should be written to expect offset
      values representing PCI memory resource addresses as seen by user
      space, through the pci_resource_to_user() API.
      
      ARM relies on the standard implementation of pci_resource_to_user()
      which actually is an identity map and exports to user space
      PCI memory resources as they are stored in PCI devices resources
      structures, which represent CPU physical addresses (fixed-up using
      BUS to CPU address conversions) not PCI bus addresses.
      
      Therefore, on ARM platforms where the mapping between CPU and BUS
      address is not a 1:1 the current pci_mmap_page_range() implementation is
      erroneous, in that an additional shift is applied to an already fixed-up
      offset passed from userspace.
      
      Hence, this patch removes the mem_offset from the pgoff calculation
      since the offset as passed from user space already represents the CPU
      physical address corresponding to the resource to be mapped, ie no
      additional offset should be applied.
      
      Cc: Arnd Bergmann <arnd@arndb.de>
      Signed-off-by: NLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
      Acked-by: NBjorn Helgaas <bhelgaas@google.com>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      415ae101
    • A
      ARM: 8219/1: handle interworking and out-of-range relocations separately · 2b8514d0
      Ard Biesheuvel 提交于
      Currently, interworking calls on module boundaries are not supported,
      and are handled by the same error handling code path as non-interworking
      calls whose targets are simply out of range.
      
      Before modifying the handling of those out-of-range jump and call
      relocations in a subsequent patch, move the handling of interworking
      restrictions out of it.
      Acked-by: NNicolas Pitre <nico@linaro.org>
      Signed-off-by: NArd Biesheuvel <ard.biesheuvel@linaro.org>
      Signed-off-by: NRussell King <rmk+kernel@arm.linux.org.uk>
      2b8514d0
    • D
      VFS: (Scripted) Convert S_ISLNK/DIR/REG(dentry->d_inode) to d_is_*(dentry) · e36cb0b8
      David Howells 提交于
      Convert the following where appropriate:
      
       (1) S_ISLNK(dentry->d_inode) to d_is_symlink(dentry).
      
       (2) S_ISREG(dentry->d_inode) to d_is_reg(dentry).
      
       (3) S_ISDIR(dentry->d_inode) to d_is_dir(dentry).  This is actually more
           complicated than it appears as some calls should be converted to
           d_can_lookup() instead.  The difference is whether the directory in
           question is a real dir with a ->lookup op or whether it's a fake dir with
           a ->d_automount op.
      
      In some circumstances, we can subsume checks for dentry->d_inode not being
      NULL into this, provided we the code isn't in a filesystem that expects
      d_inode to be NULL if the dirent really *is* negative (ie. if we're going to
      use d_inode() rather than d_backing_inode() to get the inode pointer).
      
      Note that the dentry type field may be set to something other than
      DCACHE_MISS_TYPE when d_inode is NULL in the case of unionmount, where the VFS
      manages the fall-through from a negative dentry to a lower layer.  In such a
      case, the dentry type of the negative union dentry is set to the same as the
      type of the lower dentry.
      
      However, if you know d_inode is not NULL at the call site, then you can use
      the d_is_xxx() functions even in a filesystem.
      
      There is one further complication: a 0,0 chardev dentry may be labelled
      DCACHE_WHITEOUT_TYPE rather than DCACHE_SPECIAL_TYPE.  Strictly, this was
      intended for special directory entry types that don't have attached inodes.
      
      The following perl+coccinelle script was used:
      
      use strict;
      
      my @callers;
      open($fd, 'git grep -l \'S_IS[A-Z].*->d_inode\' |') ||
          die "Can't grep for S_ISDIR and co. callers";
      @callers = <$fd>;
      close($fd);
      unless (@callers) {
          print "No matches\n";
          exit(0);
      }
      
      my @cocci = (
          '@@',
          'expression E;',
          '@@',
          '',
          '- S_ISLNK(E->d_inode->i_mode)',
          '+ d_is_symlink(E)',
          '',
          '@@',
          'expression E;',
          '@@',
          '',
          '- S_ISDIR(E->d_inode->i_mode)',
          '+ d_is_dir(E)',
          '',
          '@@',
          'expression E;',
          '@@',
          '',
          '- S_ISREG(E->d_inode->i_mode)',
          '+ d_is_reg(E)' );
      
      my $coccifile = "tmp.sp.cocci";
      open($fd, ">$coccifile") || die $coccifile;
      print($fd "$_\n") || die $coccifile foreach (@cocci);
      close($fd);
      
      foreach my $file (@callers) {
          chomp $file;
          print "Processing ", $file, "\n";
          system("spatch", "--sp-file", $coccifile, $file, "--in-place", "--no-show-diff") == 0 ||
      	die "spatch failed";
      }
      
      [AV: overlayfs parts skipped]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAl Viro <viro@zeniv.linux.org.uk>
      e36cb0b8
  9. 21 2月, 2015 2 次提交
  10. 20 2月, 2015 15 次提交