1. 27 Jul, 2013 6 commits
    • Shane Huang's avatar
      ahci: Add AMD CZ SATA device ID · 4db44d2f
      Shane Huang authored
      commit fafe5c3d upstream.
      
      To add AMD CZ SATA controller device ID of IDE mode.
      
      [bhelgaas: drop pci_ids.h update]
      Signed-off-by: default avatarShane Huang <shane.huang@amd.com>
      Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
      Reviewed-by: default avatarTejun Heo <tj@kernel.org>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      4db44d2f
    • Steffen Maier's avatar
      zfcp: status read buffers on first adapter open with link down · c49e1c85
      Steffen Maier authored
      commit 9edf7d75 upstream.
      
      Commit 64deb6ef
      "[SCSI] zfcp: Use status_read_buf_num provided by FCP channel"
      started using a value returned by the channel but only evaluated the value
      if the fabric link is up.
      Commit 8d88cf3f
      "[SCSI] zfcp: Update status read mempool"
      introduced mempool resizings based on the above value.
      On setting an FCP device online for the very first time since boot, a new
      zeroed adapter object is allocated. If the link is down, the number of
      status read requests remains zero. Since just the config data exchange is
      incomplete, we proceed with adapter open recovery. However, we
      unconditionally call mempool_resize with adapter->stat_read_buf_num == 0 in
      this case.
      
      This causes a kernel message "kernel BUG at mm/mempool.c:131!" in process
      "zfcperp<FCP-device-bus-ID>" with last function mempool_resize in Krnl PSW
      and zfcp_erp_thread in the Call Trace.
      
      Don't evaluate channel values which are invalid on link down. The number of
      status read requests is always valid, evaluated, and set to a positive
      minimum greater than zero. The adapter open recovery can proceed and the
      channel has status read buffers to inform us on a future link up event.
      While we are not aware of any other code path that could result in mempool
      resize attempts of size zero, we still also initialize the number of status
      read buffers to be posted to a static minimum number on adapter object
      allocation.
      Signed-off-by: default avatarSteffen Maier <maier@linux.vnet.ibm.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      [bwh: Backported to 3.2:
       - Copyright notice changed slightly
       - Don't use zfcp_fsf_convert_portspeed()]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      c49e1c85
    • Steffen Maier's avatar
      zfcp: block queue limits with data router · d5dc413b
      Steffen Maier authored
      commit 5fea4291 upstream.
      
      Commit 86a9668a
      "[SCSI] zfcp: support for hardware data router"
      reduced the initial block queue limits in the scsi_host_template to the
      absolute minimum and adjusted them later on. However, the adjustment was
      too late for the BSG devices of Scsi_Host and fc_host.
      
      Therefore, ioctl(..., SG_IO, ...) with request or response size > 4kB to a
      BSG device of an fc_host or a Scsi_Host fails with EINVAL. As a result,
      users of such ioctl such as HBA_SendCTPassThru() in libzfcphbaapi return
      with error HBA_STATUS_ERROR.
      
      Initialize the block queue limits in zfcp_scsi_host_template to the
      greatest common denominator (GCD).
      
      While we cannot exploit the slightly enlarged maximum request size with
      data router, this should be neglectible. Doing so also avoids running into
      trouble after live guest relocation (LGR) / migration from a data router
      FCP device to an FCP device that does not support data router. In that
      case, zfcp would figure out the new limits on adapter recovery, but the
      fc_host and Scsi_Host (plus in fact all sdevs) still exist with the old and
      now too large queue limits.
      
      It should also OK, not to use half the size as in the DIX case, because
      fc_host and Scsi_Host do not transport FCP requests including SCSI commands
      using protection data.
      Signed-off-by: default avatarSteffen Maier <maier@linux.vnet.ibm.com>
      Reviewed-by: default avatarMartin Peschke <mpeschke@linux.vnet.ibm.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      [bwh: Backported to 3.2: copyright notice changed slightly]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      d5dc413b
    • Daniel Hansel's avatar
      zfcp: fix adapter (re)open recovery while link to SAN is down · 657b0bf0
      Daniel Hansel authored
      commit f76ccaac upstream.
      
      FCP device remains in status ERP_FAILED when device is switched online
      or adapter recovery is triggered  while link to SAN is down.
      
      When Exchange Configuration Data command returns the FSF status
      FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE it aborts the exchange process.
      The only retries are done during the common error recovery procedure
      (i.e. max. 3 retries with 8sec sleep between) and remains in status
      ERP_FAILED with QDIO down.
      
      This commit reverts the commit 0df13847
      (zfcp: Fix adapter activation on link down).
      When FSF status FSF_EXCHANGE_CONFIG_DATA_INCOMPLETE is received the
      adapter recovery will be finished without any retries. QDIO will be
      up now and status changes such as LINK UP will be received now.
      Signed-off-by: default avatarDaniel Hansel <daniel.hansel@linux.vnet.ibm.com>
      Signed-off-by: default avatarSteffen Maier <maier@linux.vnet.ibm.com>
      Signed-off-by: default avatarJames Bottomley <JBottomley@Parallels.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      657b0bf0
    • Bu, Yitian's avatar
      printk: Fix rq->lock vs logbuf_lock unlock lock inversion · ff766b8d
      Bu, Yitian authored
      commit dbda92d1 upstream.
      
      commit 07354eb1 ("locking printk: Annotate logbuf_lock as raw")
      reintroduced a lock inversion problem which was fixed in commit
      0b5e1c52 ("printk: Release console_sem after logbuf_lock"). This
      happened probably when fixing up patch rejects.
      
      Restore the ordering and unlock logbuf_lock before releasing
      console_sem.
      Signed-off-by: default avatarybu <ybu@qti.qualcomm.com>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Link: http://lkml.kernel.org/r/E807E903FE6CBE4D95E420FBFCC273B827413C@nasanexd01h.na.qualcomm.comSigned-off-by: default avatarThomas Gleixner <tglx@linutronix.de>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      ff766b8d
    • Ben Hutchings's avatar
      r8169: fix offloaded tx checksum for small packets. · 5f97f7c7
      Ben Hutchings authored
      The workaround introduced by commit e5195c1f 'r8169: fix 8168evl
      frame padding.' upstream was incorrect and was entirely replaced in
      commit b423e9ae 'r8169: fix offloaded tx checksum for small
      packets.'
      
      On the 3.2.y branch, the first commit has effectively been applied
      twice: the first time by itself, and the second time in commit
      3cf40360 which squashed the two upstream commits together.  That
      left us with both the incorrect and the correct workaround in place.
      Remove the incorrect one.
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      Cc: Francois Romieu <romieu@fr.zoreil.com>
      5f97f7c7
  2. 29 Jun, 2013 28 commits
  3. 19 Jun, 2013 6 commits
    • Ben Hutchings's avatar
      Linux 3.2.47 · 398cabc8
      Ben Hutchings authored
      398cabc8
    • Paul Mackerras's avatar
      powerpc: Fix emulation of illegal instructions on PowerNV platform · e4f37de0
      Paul Mackerras authored
      commit bf593907 upstream.
      
      Normally, the kernel emulates a few instructions that are unimplemented
      on some processors (e.g. the old dcba instruction), or privileged (e.g.
      mfpvr).  The emulation of unimplemented instructions is currently not
      working on the PowerNV platform.  The reason is that on these machines,
      unimplemented and illegal instructions cause a hypervisor emulation
      assist interrupt, rather than a program interrupt as on older CPUs.
      Our vector for the emulation assist interrupt just calls
      program_check_exception() directly, without setting the bit in SRR1
      that indicates an illegal instruction interrupt.  This fixes it by
      making the emulation assist interrupt set that bit before calling
      program_check_interrupt().  With this, old programs that use no-longer
      implemented instructions such as dcba now work again.
      Signed-off-by: default avatarPaul Mackerras <paulus@samba.org>
      Signed-off-by: default avatarBenjamin Herrenschmidt <benh@kernel.crashing.org>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      e4f37de0
    • Nithin Sujir's avatar
      tg3: Wait for boot code to finish after power on · 08647d0f
      Nithin Sujir authored
      commit df465abf upstream.
      
      Some systems that don't need wake-on-lan may choose to power down the
      chip on system standby. Upon resume, the power on causes the boot code
      to startup and initialize the hardware. On one new platform, this is
      causing the device to go into a bad state due to a race between the
      driver and boot code, once every several hundred resumes. The same race
      exists on open since we come up from a power on.
      
      This patch adds a wait for boot code signature at the beginning of
      tg3_init_hw() which is common to both cases. If there has not been a
      power-off or the boot code has already completed, the signature will be
      present and poll_fw() returns immediately. Also return immediately if
      the device does not have firmware.
      Signed-off-by: default avatarNithin Nayak Sujir <nsujir@broadcom.com>
      Signed-off-by: default avatarMichael Chan <mchan@broadcom.com>
      Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
      [bwh: Backported to 3.2: adjust context]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      08647d0f
    • Alex Lyakas's avatar
      md/raid1: consider WRITE as successful only if at least one non-Faulty and... · 58e06b1d
      Alex Lyakas authored
      md/raid1: consider WRITE as successful only if at least one non-Faulty and non-rebuilding drive completed it.
      
      commit 3056e3ae upstream.
      
      Without that fix, the following scenario could happen:
      
      - RAID1 with drives A and B; drive B was freshly-added and is rebuilding
      - Drive A fails
      - WRITE request arrives to the array. It is failed by drive A, so
      r1_bio is marked as R1BIO_WriteError, but the rebuilding drive B
      succeeds in writing it, so the same r1_bio is marked as
      R1BIO_Uptodate.
      - r1_bio arrives to handle_write_finished, badblocks are disabled,
      md_error()->error() does nothing because we don't fail the last drive
      of raid1
      - raid_end_bio_io()  calls call_bio_endio()
      - As a result, in call_bio_endio():
              if (!test_bit(R1BIO_Uptodate, &r1_bio->state))
                      clear_bit(BIO_UPTODATE, &bio->bi_flags);
      this code doesn't clear the BIO_UPTODATE flag, and the whole master
      WRITE succeeds, back to the upper layer.
      
      So we returned success to the upper layer, even though we had written
      the data onto the rebuilding drive only. But when we want to read the
      data back, we would not read from the rebuilding drive, so this data
      is lost.
      
      [neilb - applied identical change to raid10 as well]
      
      This bug can result in lost data, so it is suitable for any
      -stable kernel.
      Signed-off-by: default avatarAlex Lyakas <alex@zadarastorage.com>
      Signed-off-by: default avatarNeilBrown <neilb@suse.de>
      [bwh: Backported to 3.2: for raid10, s/rdev/conf->mirrors[dev].rdev/]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      58e06b1d
    • Kees Cook's avatar
      x86: Fix typo in kexec register clearing · c161265b
      Kees Cook authored
      commit c8a22d19 upstream.
      
      Fixes a typo in register clearing code. Thanks to PaX Team for fixing
      this originally, and James Troup for pointing it out.
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Link: http://lkml.kernel.org/r/20130605184718.GA8396@www.outflux.net
      Cc: PaX Team <pageexec@freemail.hu>
      Signed-off-by: default avatarH. Peter Anvin <hpa@linux.intel.com>
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      c161265b
    • Johan Hovold's avatar
      USB: pl2303: fix device initialisation at open · 0f9613bf
      Johan Hovold authored
      commit 2d8f4447 upstream.
      
      Do not use uninitialised termios data to determine when to configure the
      device at open.
      
      This also prevents stack data from leaking to userspace in the OOM error
      path.
      Signed-off-by: default avatarJohan Hovold <jhovold@gmail.com>
      Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [bwh: Backported to 3.2: tty_struct::termios is a pointer, not a struct]
      Signed-off-by: default avatarBen Hutchings <ben@decadent.org.uk>
      0f9613bf