1. 19 Mar, 2012 8 commits
    • Alan Stern's avatar
      PM / Driver core: leave runtime PM enabled during system shutdown · aca7c063
      Alan Stern authored
      commit fe6b91f4 upstream.
      
      Disabling all runtime PM during system shutdown turns out not to be a
      good idea, because some devices may need to be woken up from a
      low-power state at that time.
      
      The whole point of disabling runtime PM for system shutdown was to
      prevent untimely runtime-suspend method calls.  This patch (as1504)
      accomplishes the same result by incrementing the usage count for each
      device and waiting for ongoing runtime-PM callbacks to finish.  This
      is what we already do during system suspend and hibernation, which
      makes sense since the shutdown method is pretty much a legacy analog
      of the pm->poweroff method.
      
      This fixes a recent regression on some OMAP systems introduced by
      commit af8db150 (PM / driver core:
      disable device's runtime PM during shutdown).
      Reported-and-tested-by: default avatarNeilBrown <neilb@suse.de>
      Signed-off-by: default avatarAlan Stern <stern@rowland.harvard.edu>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
      Signed-off-by: default avatarRafael J. Wysocki <rjw@sisk.pl>
      Cc: Kostyantyn Shlyakhovoy <x0155534@ti.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      aca7c063
    • Stefan Richter's avatar
      firewire: core: handle ack_busy when fetching the Config ROM · 9bfaf9d1
      Stefan Richter authored
      commit aaff1203 upstream.
      
      Some older Panasonic made camcorders (Panasonic AG-EZ30 and NV-DX110,
      Grundig Scenos DLC 2000) reject requests with ack_busy_X if a request is
      sent immediately after they sent a response to a prior transaction.
      This causes firewire-core to fail probing of the camcorder with "giving
      up on config rom for node id ...".  Consequently, programs like kino or
      dvgrab are unaware of the presence of a camcorder.
      
      Such transaction failures happen also with the ieee1394 driver stack
      (of the 2.4...2.6 kernel series until 2.6.36 inclusive) but with a lower
      likelihood, such that kino or dvgrab are generally able to use these
      camcorders via the older driver stack.  The cause for firewire-ohci's or
      firewire-core's worse behavior is not yet known.  Gap count optimization
      in firewire-core is not the cause.  Perhaps the slightly higher latency
      of transaction completion in the older stack plays a role.  (ieee1394:
      AR-resp DMA context tasklet -> packet completion ktread -> user process;
      firewire-core: tasklet -> user process.)
      
      This change introduces retries and delays after ack_busy_X into
      firewire-core's Config ROM reader, such that at least firewire-core's
      probing and /dev/fw* creation are successful.  This still leaves the
      problem that userland processes are facing transaction failures.
      gscanbus's built-in retry routines deal with them successfully, but
      neither kino's nor dvgrab's do ever succeed.
      
      But at least DV capture with "dvgrab -noavc -card 0" works now.  Live
      video preview in kino works too, but not actual capture.
      
      One way to prevent Configuration ROM reading failures in application
      programs is to modify libraw1394 to synthesize read responses by means
      of firewire-core's Configuration ROM cache.  This would only leave
      CMP and FCP transaction failures as a potential problem source for
      applications.
      Reported-and-tested-by: default avatarThomas Seilund <tps@netmaster.dk>
      Reported-and-tested-by: default avatarRené Fritz <rene@colorcube.de>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9bfaf9d1
    • Stefan Richter's avatar
      firewire: cdev: fix 32 bit userland on 64 bit kernel compat corner cases · 4995a691
      Stefan Richter authored
      commit 9c1176b6 upstream.
      
      Clemens points out that we need to use compat_ptr() in order to safely
      cast from u64 to addresses of a 32-bit usermode client.
      
      Before, our conversion went wrong
        - in practice if the client cast from pointer to integer such that
          sign-extension happened, (libraw1394 and libdc1394 at least were not
          doing that, IOW were not affected)
      or
        - in theory on s390 (which doesn't have FireWire though) and on the
          tile architecture, regardless of what the client does.
      The bug would usually be observed as the initial get_info ioctl failing
      with "Bad address" (EFAULT).
      Reported-by: default avatarCarl Karsten <carl@personnelware.com>
      Reported-by: default avatarClemens Ladisch <clemens@ladisch.de>
      Signed-off-by: default avatarStefan Richter <stefanr@s5r6.in-berlin.de>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      4995a691
    • Matthew Garrett's avatar
      PCI: ignore pre-1.1 ASPM quirking when ASPM is disabled · 9217bfbb
      Matthew Garrett authored
      commit 4949be16 upstream.
      
      Right now we won't touch ASPM state if ASPM is disabled, except in the case
      where we find a device that appears to be too old to reliably support ASPM.
      Right now we'll clear it in that case, which is almost certainly the wrong
      thing to do. The easiest way around this is just to disable the blacklisting
      when ASPM is disabled.
      Signed-off-by: default avatarMatthew Garrett <mjg@redhat.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      9217bfbb
    • Thomas Gleixner's avatar
      x86: Derandom delay_tsc for 64 bit · 5bcb3f88
      Thomas Gleixner authored
      commit a7f4255f upstream.
      
      Commit f0fbf0ab ("x86: integrate delay functions") converted
      delay_tsc() into a random delay generator for 64 bit.  The reason is
      that it merged the mostly identical versions of delay_32.c and
      delay_64.c.  Though the subtle difference of the result was:
      
       static void delay_tsc(unsigned long loops)
       {
      -	unsigned bclock, now;
      +	unsigned long bclock, now;
      
      Now the function uses rdtscl() which returns the lower 32bit of the
      TSC. On 32bit that's not problematic as unsigned long is 32bit. On 64
      bit this fails when the lower 32bit are close to wrap around when
      bclock is read, because the following check
      
             if ((now - bclock) >= loops)
             	  	break;
      
      evaluated to true on 64bit for e.g. bclock = 0xffffffff and now = 0
      because the unsigned long (now - bclock) of these values results in
      0xffffffff00000001 which is definitely larger than the loops
      value. That explains Tvortkos observation:
      
      "Because I am seeing udelay(500) (_occasionally_) being short, and
       that by delaying for some duration between 0us (yep) and 491us."
      
      Make those variables explicitely u32 again, so this works for both 32
      and 64 bit.
      Reported-by: default avatarTvrtko Ursulin <tvrtko.ursulin@onelan.co.uk>
      Signed-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      5bcb3f88
    • Al Viro's avatar
      aio: fix the "too late munmap()" race · e808b6ad
      Al Viro authored
      commit c7b28555 upstream.
      
      Current code has put_ioctx() called asynchronously from aio_fput_routine();
      that's done *after* we have killed the request that used to pin ioctx,
      so there's nothing to stop io_destroy() waiting in wait_for_all_aios()
      from progressing.  As the result, we can end up with async call of
      put_ioctx() being the last one and possibly happening during exit_mmap()
      or elf_core_dump(), neither of which expects stray munmap() being done
      to them...
      
      We do need to prevent _freeing_ ioctx until aio_fput_routine() is done
      with that, but that's all we care about - neither io_destroy() nor
      exit_aio() will progress past wait_for_all_aios() until aio_fput_routine()
      does really_put_req(), so the ioctx teardown won't be done until then
      and we don't care about the contents of ioctx past that point.
      
      Since actual freeing of these suckers is RCU-delayed, we don't need to
      bump ioctx refcount when request goes into list for async removal.
      All we need is rcu_read_lock held just over the ->ctx_lock-protected
      area in aio_fput_routine().
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Acked-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      e808b6ad
    • Al Viro's avatar
      aio: fix io_setup/io_destroy race · 8ef749e3
      Al Viro authored
      commit 86b62a2c upstream.
      
      Have ioctx_alloc() return an extra reference, so that caller would drop it
      on success and not bother with re-grabbing it on failure exit.  The current
      code is obviously broken - io_destroy() from another thread that managed
      to guess the address io_setup() would've returned would free ioctx right
      under us; gets especially interesting if aio_context_t * we pass to
      io_setup() points to PROT_READ mapping, so put_user() fails and we end
      up doing io_destroy() on kioctx another thread has just got freed...
      Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
      Acked-by: default avatarBenjamin LaHaise <bcrl@kvack.org>
      Reviewed-by: default avatarJeff Moyer <jmoyer@redhat.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      8ef749e3
    • Denis 'GNUtoo' Carikli's avatar
      ASoC: neo1973: fix neo1973 wm8753 initialization · 0d9de887
      Denis 'GNUtoo' Carikli authored
      commit b2ccf065 upstream.
      
      The neo1973 driver had wrong codec name which prevented the "sound card"
      from appearing.
      Signed-off-by: default avatarDenis 'GNUtoo' Carikli <GNUtoo@no-log.org>
      Signed-off-by: default avatarMark Brown <broonie@opensource.wolfsonmicro.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      0d9de887
  2. 12 Mar, 2012 32 commits