OSDN Git Service

Merge branch 'for-3.20/drivers' of git://git.kernel.dk/linux-block
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Feb 2015 22:30:53 +0000 (14:30 -0800)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 12 Feb 2015 22:30:53 +0000 (14:30 -0800)
Pull block driver changes from Jens Axboe:
 "This contains:

   - The 4k/partition fixes for brd from Boaz/Matthew.

   - A few xen front/back block fixes from David Vrabel and Roger Pau
     Monne.

   - Floppy changes from Takashi, cleaning the device file creation.

   - Switching libata to use the new blk-mq tagging policy, removing
     code (and a suboptimal implementation) from libata.  This will
     throw you a merge conflict, since a bug in the original libata
     tagging code was fixed since this code was branched.  Trivial.
     From Shaohua.

   - Conversion of loop to blk-mq, from Ming Lei.

   - Cleanup of the io_schedule() handling in bsg from Peter Zijlstra.
     He claims it improves on unreadable code, which will cost him a
     beer.

   - Maintainer update or NDB, now handled by Markus Pargmann.

   - NVMe:
        - Optimization from me that avoids a kmalloc/kfree per IO for
          smaller (<= 8KB) IO. This cuts about 1% of high IOPS CPU
          overhead.
        - Removal of (now) dead RCU code, a relic from before NVMe was
          converted to blk-mq"

* 'for-3.20/drivers' of git://git.kernel.dk/linux-block:
  xen-blkback: default to X86_32 ABI on x86
  xen-blkfront: fix accounting of reqs when migrating
  xen-blkback,xen-blkfront: add myself as maintainer
  block: Simplify bsg complete all
  floppy: Avoid manual call of device_create_file()
  NVMe: avoid kmalloc/kfree for smaller IO
  MAINTAINERS: Update NBD maintainer
  libata: make sata_sil24 use fifo tag allocator
  libata: move sas ata tag allocation to libata-scsi.c
  libata: use blk taging
  NVMe: within nvme_free_queues(), delete RCU sychro/deferred free
  null_blk: suppress invalid partition info
  brd: Request from fdisk 4k alignment
  brd: Fix all partitions BUGs
  axonram: Fix bug in direct_access
  loop: add blk-mq.h include
  block: loop: don't handle REQ_FUA explicitly
  block: loop: introduce lo_discard() and lo_req_flush()
  block: loop: say goodby to bio
  block: loop: improve performance via blk-mq

1  2 
MAINTAINERS
drivers/ata/libata-core.c
drivers/ata/libata-scsi.c
drivers/ata/libata.h
drivers/ata/sata_sil24.c
drivers/block/nvme-core.c
drivers/block/xen-blkback/common.h
include/linux/libata.h
include/linux/wait.h

diff --combined MAINTAINERS
@@@ -270,12 -270,12 +270,12 @@@ F:      drivers/acpi
  F:    drivers/pnp/pnpacpi/
  F:    include/linux/acpi.h
  F:    include/acpi/
 -F:    Documentation/acpi
 +F:    Documentation/acpi/
  F:    Documentation/ABI/testing/sysfs-bus-acpi
  F:    drivers/pci/*acpi*
  F:    drivers/pci/*/*acpi*
  F:    drivers/pci/*/*/*acpi*
 -F:    tools/power/acpi
 +F:    tools/power/acpi/
  
  ACPI COMPONENT ARCHITECTURE (ACPICA)
  M:    Robert Moore <robert.moore@intel.com>
@@@ -563,12 -563,6 +563,12 @@@ S:       Odd Fixe
  L:    linux-alpha@vger.kernel.org
  F:    arch/alpha/
  
 +ALTERA MAILBOX DRIVER
 +M:    Ley Foon Tan <lftan@altera.com>
 +L:    nios2-dev@lists.rocketboards.org (moderated for non-subscribers)
 +S:    Maintained
 +F:    drivers/mailbox/mailbox-altera.c
 +
  ALTERA TRIPLE SPEED ETHERNET DRIVER
  M:    Vince Bridgers <vbridger@opensource.altera.com>
  L:    netdev@vger.kernel.org
@@@ -665,13 -659,6 +665,13 @@@ L:       linux-media@vger.kernel.or
  S:    Maintained
  F:    drivers/media/i2c/ad9389b*
  
 +ANALOG DEVICES INC ADV7180 DRIVER
 +M:    Lars-Peter Clausen <lars@metafoo.de>
 +L:    linux-media@vger.kernel.org
 +W:    http://ez.analog.com/community/linux-device-drivers
 +S:    Supported
 +F:    drivers/media/i2c/adv7180.c
 +
  ANALOG DEVICES INC ADV7511 DRIVER
  M:    Hans Verkuil <hans.verkuil@cisco.com>
  L:    linux-media@vger.kernel.org
@@@ -709,7 -696,7 +709,7 @@@ L: alsa-devel@alsa-project.org (moderat
  W:    http://blackfin.uclinux.org/
  S:    Supported
  F:    sound/soc/blackfin/*
 - 
 +
  ANALOG DEVICES INC IIO DRIVERS
  M:    Lars-Peter Clausen <lars@metafoo.de>
  M:    Michael Hennerich <Michael.Hennerich@analog.com>
@@@ -721,16 -708,6 +721,16 @@@ X:       drivers/iio/*/adjd
  F:    drivers/staging/iio/*/ad*
  F:    staging/iio/trigger/iio-trig-bfin-timer.c
  
 +ANDROID DRIVERS
 +M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 +M:    Arve Hjønnevåg <arve@android.com>
 +M:    Riley Andrews <riandrews@android.com>
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/gregkh/staging.git
 +L:    devel@driverdev.osuosl.org
 +S:    Supported
 +F:    drivers/android/
 +F:    drivers/staging/android/
 +
  AOA (Apple Onboard Audio) ALSA DRIVER
  M:    Johannes Berg <johannes@sipsolutions.net>
  L:    linuxppc-dev@lists.ozlabs.org
@@@ -747,15 -724,15 +747,15 @@@ F:      include/uapi/linux/apm_bios.
  F:    drivers/char/apm-emulation.c
  
  APPLE BCM5974 MULTITOUCH DRIVER
 -M:    Henrik Rydberg <rydberg@euromail.se>
 +M:    Henrik Rydberg <rydberg@bitmath.org>
  L:    linux-input@vger.kernel.org
 -S:    Maintained
 +S:    Odd fixes
  F:    drivers/input/mouse/bcm5974.c
  
  APPLE SMC DRIVER
 -M:    Henrik Rydberg <rydberg@euromail.se>
 +M:    Henrik Rydberg <rydberg@bitmath.org>
  L:    lm-sensors@lm-sensors.org
 -S:    Maintained
 +S:    Odd fixes
  F:    drivers/hwmon/applesmc.c
  
  APPLETALK NETWORK LAYER
@@@ -777,6 -754,13 +777,6 @@@ L:        linux-media@vger.kernel.or
  S:    Maintained
  F:    drivers/media/i2c/aptina-pll.*
  
 -ARASAN COMPACT FLASH PATA CONTROLLER
 -M:    Viresh Kumar <viresh.linux@gmail.com>
 -L:    linux-ide@vger.kernel.org
 -S:    Maintained
 -F:    include/linux/pata_arasan_cf_data.h
 -F:    drivers/ata/pata_arasan_cf.c
 -
  ARC FRAMEBUFFER DRIVER
  M:    Jaya Kumar <jayalk@intworks.biz>
  S:    Maintained
@@@ -1599,14 -1583,12 +1599,14 @@@ N:   xilin
  F:    drivers/clocksource/cadence_ttc_timer.c
  F:    drivers/i2c/busses/i2c-cadence.c
  F:    drivers/mmc/host/sdhci-of-arasan.c
 +F:    drivers/edac/synopsys_edac.c
  
  ARM SMMU DRIVER
  M:    Will Deacon <will.deacon@arm.com>
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
  S:    Maintained
  F:    drivers/iommu/arm-smmu.c
 +F:    drivers/iommu/io-pgtable-arm.c
  
  ARM64 PORT (AARCH64 ARCHITECTURE)
  M:    Catalin Marinas <catalin.marinas@arm.com>
@@@ -1675,6 -1657,7 +1675,6 @@@ M:      Jiri Slaby <jirislaby@gmail.com
  M:    Nick Kossifidis <mickflemm@gmail.com>
  M:    "Luis R. Rodriguez" <mcgrof@do-not-panic.com>
  L:    linux-wireless@vger.kernel.org
 -L:    ath5k-devel@lists.ath5k.org
  W:    http://wireless.kernel.org/en/users/Drivers/ath5k
  S:    Maintained
  F:    drivers/net/wireless/ath/ath5k/
@@@ -2276,7 -2259,6 +2276,7 @@@ F:      drivers/gpio/gpio-bt8xx.
  BTRFS FILE SYSTEM
  M:    Chris Mason <clm@fb.com>
  M:    Josef Bacik <jbacik@fb.com>
 +M:    David Sterba <dsterba@suse.cz>
  L:    linux-btrfs@vger.kernel.org
  W:    http://btrfs.wiki.kernel.org/
  Q:    http://patchwork.kernel.org/project/linux-btrfs/list/
@@@ -2363,8 -2345,7 +2363,8 @@@ CAN NETWORK LAYE
  M:    Oliver Hartkopp <socketcan@hartkopp.net>
  L:    linux-can@vger.kernel.org
  W:    http://gitorious.org/linux-can
 -T:    git git://gitorious.org/linux-can/linux-can-next.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git
  S:    Maintained
  F:    Documentation/networking/can.txt
  F:    net/can/
@@@ -2379,8 -2360,7 +2379,8 @@@ M:      Wolfgang Grandegger <wg@grandegger.c
  M:    Marc Kleine-Budde <mkl@pengutronix.de>
  L:    linux-can@vger.kernel.org
  W:    http://gitorious.org/linux-can
 -T:    git git://gitorious.org/linux-can/linux-can-next.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can.git
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/mkl/linux-can-next.git
  S:    Maintained
  F:    drivers/net/can/
  F:    include/linux/can/dev.h
@@@ -3202,7 -3182,7 +3202,7 @@@ L:      dmaengine@vger.kernel.or
  Q:    https://patchwork.kernel.org/project/linux-dmaengine/list/
  S:    Maintained
  F:    drivers/dma/
 -F:    include/linux/dma*
 +F:    include/linux/dmaengine.h
  F:    Documentation/dmaengine/
  T:    git git://git.infradead.org/users/vkoul/slave-dma.git
  
@@@ -3227,7 -3207,6 +3227,7 @@@ F:      Documentation
  X:    Documentation/ABI/
  X:    Documentation/devicetree/
  X:    Documentation/[a-z][a-z]_[A-Z][A-Z]/
 +T:    git git://git.lwn.net/linux-2.6.git docs-next
  
  DOUBLETALK DRIVER
  M:    "James R. Van Zandt" <jrv@vanzandt.mv.com>
@@@ -3487,14 -3466,6 +3487,14 @@@ M:    "Maciej W. Rozycki" <macro@linux-mip
  S:    Maintained
  F:    drivers/tty/serial/dz.*
  
 +E3X0 POWER BUTTON DRIVER
 +M:    Moritz Fischer <moritz.fischer@ettus.com>
 +L:    usrp-users@lists.ettus.com
 +W:    http://www.ettus.com
 +S:    Supported
 +F:    drivers/input/misc/e3x0-button.c
 +F:    Documentation/devicetree/bindings/input/e3x0-button.txt
 +
  E4000 MEDIA DRIVER
  M:    Antti Palosaari <crope@iki.fi>
  L:    linux-media@vger.kernel.org
@@@ -3536,8 -3507,6 +3536,8 @@@ M:      Borislav Petkov <bp@alien8.de
  M:    Mauro Carvalho Chehab <mchehab@osg.samsung.com>
  L:    linux-edac@vger.kernel.org
  W:    bluesmoke.sourceforge.net
 +T:    git://git.kernel.org/pub/scm/linux/kernel/git/bp/bp.git#for-next
 +T:    git://git.kernel.org/pub/linux/kernel/git/mchehab/linux-edac.git#linux_next
  S:    Supported
  F:    Documentation/edac.txt
  F:    drivers/edac/
@@@ -4779,20 -4748,20 +4779,20 @@@ S:   Supporte
  F:    drivers/scsi/ipr.*
  
  IBM Power Virtual Ethernet Device Driver
 -M:    Santiago Leon <santil@linux.vnet.ibm.com>
 +M:    Thomas Falcon <tlfalcon@linux.vnet.ibm.com>
  L:    netdev@vger.kernel.org
  S:    Supported
  F:    drivers/net/ethernet/ibm/ibmveth.*
  
  IBM Power Virtual SCSI Device Drivers
 -M:    Nathan Fontenot <nfont@linux.vnet.ibm.com>
 +M:    Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
  L:    linux-scsi@vger.kernel.org
  S:    Supported
  F:    drivers/scsi/ibmvscsi/ibmvscsi*
  F:    drivers/scsi/ibmvscsi/viosrp.h
  
  IBM Power Virtual FC Device Drivers
 -M:    Brian King <brking@linux.vnet.ibm.com>
 +M:    Tyrel Datwyler <tyreld@linux.vnet.ibm.com>
  L:    linux-scsi@vger.kernel.org
  S:    Supported
  F:    drivers/scsi/ibmvscsi/ibmvfc*
@@@ -4918,7 -4887,7 +4918,7 @@@ F:      drivers/ipack
  
  INTEGRITY MEASUREMENT ARCHITECTURE (IMA)
  M:    Mimi Zohar <zohar@linux.vnet.ibm.com>
 -M:    Dmitry Kasatkin <d.kasatkin@samsung.com>
 +M:    Dmitry Kasatkin <dmitry.kasatkin@gmail.com>
  L:    linux-ima-devel@lists.sourceforge.net
  L:    linux-ima-user@lists.sourceforge.net
  L:    linux-security-module@vger.kernel.org
@@@ -4960,6 -4929,7 +4960,6 @@@ F:      include/uapi/linux/inotify.
  
  INPUT (KEYBOARD, MOUSE, JOYSTICK, TOUCHSCREEN) DRIVERS
  M:    Dmitry Torokhov <dmitry.torokhov@gmail.com>
 -M:    Dmitry Torokhov <dtor@mail.ru>
  L:    linux-input@vger.kernel.org
  Q:    http://patchwork.kernel.org/project/linux-input/list/
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git
@@@ -4970,27 -4940,18 +4970,27 @@@ F:   include/uapi/linux/input.
  F:    include/linux/input/
  
  INPUT MULTITOUCH (MT) PROTOCOL
 -M:    Henrik Rydberg <rydberg@euromail.se>
 +M:    Henrik Rydberg <rydberg@bitmath.org>
  L:    linux-input@vger.kernel.org
  T:    git git://git.kernel.org/pub/scm/linux/kernel/git/rydberg/input-mt.git
 -S:    Maintained
 +S:    Odd fixes
  F:    Documentation/input/multi-touch-protocol.txt
  F:    drivers/input/input-mt.c
  K:    \b(ABS|SYN)_MT_
  
 +INTEL ASoC BDW/HSW DRIVERS
 +M:    Jie Yang <yang.jie@linux.intel.com>
 +L:    alsa-devel@alsa-project.org
 +S:    Supported
 +F:    sound/soc/intel/sst-haswell*
 +F:    sound/soc/intel/sst-dsp*
 +F:    sound/soc/intel/sst-firmware.c
 +F:    sound/soc/intel/broadwell.c
 +F:    sound/soc/intel/haswell.c
 +
  INTEL C600 SERIES SAS CONTROLLER DRIVER
  M:    Intel SCU Linux support <intel-linux-scu@intel.com>
  M:    Artur Paszkiewicz <artur.paszkiewicz@intel.com>
 -M:    Dave Jiang <dave.jiang@intel.com>
  L:    linux-scsi@vger.kernel.org
  T:    git git://git.code.sf.net/p/intel-sas/isci
  S:    Supported
@@@ -5318,15 -5279,6 +5318,15 @@@ W:    www.open-iscsi.or
  Q:    http://patchwork.kernel.org/project/linux-rdma/list/
  F:    drivers/infiniband/ulp/iser/
  
 +ISCSI EXTENSIONS FOR RDMA (ISER) TARGET
 +M:    Sagi Grimberg <sagig@mellanox.com>
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/nab/target-pending.git master
 +L:    linux-rdma@vger.kernel.org
 +L:    target-devel@vger.kernel.org
 +S:    Supported
 +W:    http://www.linux-iscsi.org
 +F:    drivers/infiniband/ulp/isert
 +
  ISDN SUBSYSTEM
  M:    Karsten Keil <isdn@linux-pingi.de>
  L:    isdn4linux@listserv.isdn4linux.de (subscribers-only)
@@@ -5741,49 -5693,6 +5741,49 @@@ F:    drivers/lguest
  F:    include/linux/lguest*.h
  F:    tools/lguest/
  
 +LIBATA SUBSYSTEM (Serial and Parallel ATA drivers)
 +M:    Tejun Heo <tj@kernel.org>
 +L:    linux-ide@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
 +S:    Maintained
 +F:    drivers/ata/
 +F:    include/linux/ata.h
 +F:    include/linux/libata.h
 +
 +LIBATA PATA ARASAN COMPACT FLASH CONTROLLER
 +M:    Viresh Kumar <viresh.linux@gmail.com>
 +L:    linux-ide@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
 +S:    Maintained
 +F:    include/linux/pata_arasan_cf_data.h
 +F:    drivers/ata/pata_arasan_cf.c
 +
 +LIBATA PATA DRIVERS
 +M:    Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
 +M:    Tejun Heo <tj@kernel.org>
 +L:    linux-ide@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
 +S:    Maintained
 +F:    drivers/ata/pata_*.c
 +F:    drivers/ata/ata_generic.c
 +
 +LIBATA SATA AHCI PLATFORM devices support
 +M:    Hans de Goede <hdegoede@redhat.com>
 +M:    Tejun Heo <tj@kernel.org>
 +L:    linux-ide@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
 +S:    Maintained
 +F:    drivers/ata/ahci_platform.c
 +F:    drivers/ata/libahci_platform.c
 +F:    include/linux/ahci_platform.h
 +
 +LIBATA SATA PROMISE TX2/TX4 CONTROLLER DRIVER
 +M:    Mikael Pettersson <mikpelinux@gmail.com>
 +L:    linux-ide@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
 +S:    Maintained
 +F:    drivers/ata/sata_promise.*
 +
  LIBLOCKDEP
  M:    Sasha Levin <sasha.levin@oracle.com>
  S:    Maintained
@@@ -5875,21 -5784,6 +5875,21 @@@ F:    Documentation/misc-devices/lis3lv02
  F:    drivers/misc/lis3lv02d/
  F:    drivers/platform/x86/hp_accel.c
  
 +LIVE PATCHING
 +M:    Josh Poimboeuf <jpoimboe@redhat.com>
 +M:    Seth Jennings <sjenning@redhat.com>
 +M:    Jiri Kosina <jkosina@suse.cz>
 +M:    Vojtech Pavlik <vojtech@suse.cz>
 +S:    Maintained
 +F:    kernel/livepatch/
 +F:    include/linux/livepatch.h
 +F:    arch/x86/include/asm/livepatch.h
 +F:    arch/x86/kernel/livepatch.c
 +F:    Documentation/ABI/testing/sysfs-kernel-livepatch
 +F:    samples/livepatch/
 +L:    live-patching@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/jikos/livepatching.git
 +
  LLC (802.2)
  M:    Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
  S:    Maintained
@@@ -6188,13 -6082,6 +6188,13 @@@ F:    Documentation/devicetree/bindings/i2
  F:    drivers/hwmon/max6697.c
  F:    include/linux/platform_data/max6697.h
  
 +MAXIM MUIC CHARGER DRIVERS FOR EXYNOS BASED BOARDS
 +M:    Krzysztof Kozlowski <k.kozlowski@samsung.com>
 +L:    linux-pm@vger.kernel.org
 +S:    Supported
 +F:    drivers/power/max14577_charger.c
 +F:    drivers/power/max77693_charger.c
 +
  MAXIRADIO FM RADIO RECEIVER DRIVER
  M:    Hans Verkuil <hverkuil@xs4all.nl>
  L:    linux-media@vger.kernel.org
@@@ -6225,6 -6112,14 +6225,6 @@@ F:     include/uapi/linux/meye.
  F:    include/uapi/linux/ivtv*
  F:    include/uapi/linux/uvcvideo.h
  
 -MEDIAVISION PRO MOVIE STUDIO DRIVER
 -M:    Hans Verkuil <hverkuil@xs4all.nl>
 -L:    linux-media@vger.kernel.org
 -T:    git git://linuxtv.org/media_tree.git
 -W:    http://linuxtv.org
 -S:    Odd Fixes
 -F:    drivers/media/parport/pms*
 -
  MEGARAID SCSI/SAS DRIVERS
  M:    Kashyap Desai <kashyap.desai@avagotech.com>
  M:    Sumit Saxena <sumit.saxena@avagotech.com>
@@@ -6642,9 -6537,10 +6642,10 @@@ F:    include/uapi/linux/netrom.
  F:    net/netrom/
  
  NETWORK BLOCK DEVICE (NBD)
- M:    Paul Clements <Paul.Clements@steeleye.com>
+ M:    Markus Pargmann <mpa@pengutronix.de>
  S:    Maintained
  L:    nbd-general@lists.sourceforge.net
+ T:    git git://git.pengutronix.de/git/mpa/linux-nbd.git
  F:    Documentation/blockdev/nbd.txt
  F:    drivers/block/nbd.c
  F:    include/linux/nbd.h
@@@ -6673,7 -6569,6 +6674,7 @@@ F:      include/linux/netdevice.
  F:    include/uapi/linux/in.h
  F:    include/uapi/linux/net.h
  F:    include/uapi/linux/netdevice.h
 +F:    include/uapi/linux/net_namespace.h
  F:    tools/net/
  F:    tools/testing/selftests/net/
  F:    lib/random32.c
@@@ -6778,7 -6673,6 +6779,7 @@@ F:      Documentation/devicetree/bindings/ne
  
  NFS, SUNRPC, AND LOCKD CLIENTS
  M:    Trond Myklebust <trond.myklebust@primarydata.com>
 +M:    Anna Schumaker <anna.schumaker@netapp.com>
  L:    linux-nfs@vger.kernel.org
  W:    http://client.linux-nfs.org
  T:    git git://git.linux-nfs.org/projects/trondmy/linux-nfs.git
@@@ -7084,12 -6978,14 +7085,12 @@@ OPEN FIRMWARE AND FLATTENED DEVICE TRE
  M:    Grant Likely <grant.likely@linaro.org>
  M:    Rob Herring <robh+dt@kernel.org>
  L:    devicetree@vger.kernel.org
 -W:    http://fdt.secretlab.ca
 -T:    git git://git.secretlab.ca/git/linux-2.6.git
 +W:    http://www.devicetree.org/
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/glikely/linux.git
  S:    Maintained
  F:    drivers/of/
  F:    include/linux/of*.h
  F:    scripts/dtc/
 -K:    of_get_property
 -K:    of_match_table
  
  OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS
  M:    Rob Herring <robh+dt@kernel.org>
@@@ -7113,12 -7009,11 +7114,12 @@@ F:   arch/openrisc
  
  OPENVSWITCH
  M:    Pravin Shelar <pshelar@nicira.com>
 +L:    netdev@vger.kernel.org
  L:    dev@openvswitch.org
  W:    http://openvswitch.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/pshelar/openvswitch.git
  S:    Maintained
  F:    net/openvswitch/
 +F:    include/uapi/linux/openvswitch.h
  
  OPL4 DRIVER
  M:    Clemens Ladisch <clemens@ladisch.de>
@@@ -7316,14 -7211,6 +7317,14 @@@ F:    include/linux/pci
  F:    arch/x86/pci/
  F:    arch/x86/kernel/quirks.c
  
 +PCI DRIVER FOR ARM VERSATILE PLATFORM
 +M:    Rob Herring <robh@kernel.org>
 +L:    linux-pci@vger.kernel.org
 +L:    linux-arm-kernel@lists.infradead.org
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/pci/versatile.txt
 +F:    drivers/pci/host/pci-versatile.c
 +
  PCI DRIVER FOR APPLIEDMICRO XGENE
  M:    Tanmay Inamdar <tinamdar@apm.com>
  L:    linux-pci@vger.kernel.org
@@@ -7343,7 -7230,7 +7344,7 @@@ S:      Maintaine
  F:    drivers/pci/host/*layerscape*
  
  PCI DRIVER FOR IMX6
 -M:    Richard Zhu <r65037@freescale.com>
 +M:    Richard Zhu <Richard.Zhu@freescale.com>
  M:    Lucas Stach <l.stach@pengutronix.de>
  L:    linux-pci@vger.kernel.org
  L:    linux-arm-kernel@lists.infradead.org (moderated for non-subscribers)
@@@ -7513,7 -7400,6 +7514,7 @@@ F:      drivers/crypto/picoxcell
  PIN CONTROL SUBSYSTEM
  M:    Linus Walleij <linus.walleij@linaro.org>
  L:    linux-gpio@vger.kernel.org
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-pinctrl.git
  S:    Maintained
  F:    drivers/pinctrl/
  F:    include/linux/pinctrl/
@@@ -7681,6 -7567,12 +7682,6 @@@ W:     http://wireless.kernel.org/en/users/
  S:    Obsolete
  F:    drivers/net/wireless/prism54/
  
 -PROMISE SATA TX2/TX4 CONTROLLER LIBATA DRIVER
 -M:    Mikael Pettersson <mikpelinux@gmail.com>
 -L:    linux-ide@vger.kernel.org
 -S:    Maintained
 -F:    drivers/ata/sata_promise.*
 -
  PS3 NETWORK SUPPORT
  M:    Geoff Levand <geoff@infradead.org>
  L:    netdev@vger.kernel.org
@@@ -7846,7 -7738,8 +7847,7 @@@ F:      Documentation/scsi/LICENSE.qla2xx
  F:    drivers/scsi/qla2xxx/
  
  QLOGIC QLA4XXX iSCSI DRIVER
 -M:    Vikas Chaudhary <vikas.chaudhary@qlogic.com>
 -M:    iscsi-driver@qlogic.com
 +M:    QLogic-Storage-Upstream@qlogic.com
  L:    linux-scsi@vger.kernel.org
  S:    Supported
  F:    Documentation/scsi/LICENSE.qla4xxx
@@@ -7925,6 -7818,14 +7926,6 @@@ T:     git git://github.com/KrasnikovEugene
  S:    Supported
  F:    drivers/net/wireless/ath/wcn36xx/
  
 -QUICKCAM PARALLEL PORT WEBCAMS
 -M:    Hans Verkuil <hverkuil@xs4all.nl>
 -L:    linux-media@vger.kernel.org
 -T:    git git://linuxtv.org/media_tree.git
 -W:    http://linuxtv.org
 -S:    Odd Fixes
 -F:    drivers/media/parport/*-qcam*
 -
  RADOS BLOCK DEVICE (RBD)
  M:    Yehuda Sadeh <yehuda@inktank.com>
  M:    Sage Weil <sage@inktank.com>
@@@ -8113,13 -8014,6 +8114,13 @@@ S:    Maintaine
  F:    Documentation/rfkill.txt
  F:    net/rfkill/
  
 +RHASHTABLE
 +M:    Thomas Graf <tgraf@suug.ch>
 +L:    netdev@vger.kernel.org
 +S:    Maintained
 +F:    lib/rhashtable.c
 +F:    include/linux/rhashtable.h
 +
  RICOH SMARTMEDIA/XD DRIVER
  M:    Maxim Levitsky <maximlevitsky@gmail.com>
  S:    Maintained
@@@ -8462,6 -8356,12 +8463,6 @@@ F:     kernel/time/clocksource.
  F:    kernel/time/time*.c
  F:    kernel/time/ntp.c
  
 -TLG2300 VIDEO4LINUX-2 DRIVER
 -M:    Huang Shijie <shijie8@gmail.com>
 -M:    Hans Verkuil <hverkuil@xs4all.nl>
 -S:    Odd Fixes
 -F:    drivers/media/usb/tlg2300/
 -
  SC1200 WDT DRIVER
  M:    Zwane Mwaikambo <zwanem@gmail.com>
  S:    Maintained
@@@ -8647,6 -8547,25 +8648,6 @@@ S:     Maintaine
  F:    drivers/misc/phantom.c
  F:    include/uapi/linux/phantom.h
  
 -SERIAL ATA (SATA) SUBSYSTEM
 -M:    Tejun Heo <tj@kernel.org>
 -L:    linux-ide@vger.kernel.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
 -S:    Supported
 -F:    drivers/ata/
 -F:    include/linux/ata.h
 -F:    include/linux/libata.h
 -
 -SERIAL ATA AHCI PLATFORM devices support
 -M:    Hans de Goede <hdegoede@redhat.com>
 -M:    Tejun Heo <tj@kernel.org>
 -L:    linux-ide@vger.kernel.org
 -T:    git git://git.kernel.org/pub/scm/linux/kernel/git/tj/libata.git
 -S:    Supported
 -F:    drivers/ata/ahci_platform.c
 -F:    drivers/ata/libahci_platform.c
 -F:    include/linux/ahci_platform.h
 -
  SERVER ENGINES 10Gbps iSCSI - BladeEngine 2 DRIVER
  M:    Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
  L:    linux-scsi@vger.kernel.org
@@@ -8827,15 -8746,6 +8828,15 @@@ S:    Maintaine
  F:    drivers/media/platform/davinci/
  F:    include/media/davinci/
  
 +TI AM437X VPFE DRIVER
 +M:    Lad, Prabhakar <prabhakar.csengg@gmail.com>
 +L:    linux-media@vger.kernel.org
 +W:    http://linuxtv.org/
 +Q:    http://patchwork.linuxtv.org/project/linux-media/list/
 +T:    git git://linuxtv.org/mhadli/v4l-dvb-davinci_devices.git
 +S:    Maintained
 +F:    drivers/media/platform/am437x/
 +
  SIS 190 ETHERNET DRIVER
  M:    Francois Romieu <romieu@fr.zoreil.com>
  L:    netdev@vger.kernel.org
@@@ -8917,8 -8827,6 +8918,8 @@@ F:      drivers/media/i2c/smiapp
  F:    include/media/smiapp.h
  F:    drivers/media/i2c/smiapp-pll.c
  F:    drivers/media/i2c/smiapp-pll.h
 +F:    include/uapi/linux/smiapp.h
 +F:    Documentation/devicetree/bindings/media/i2c/nokia,smia.txt
  
  SMM665 HARDWARE MONITOR DRIVER
  M:    Guenter Roeck <linux@roeck-us.net>
@@@ -8985,7 -8893,6 +8986,7 @@@ SOFTLOGIC 6x10 MPEG CODE
  M:    Bluecherry Maintainers <maintainers@bluecherrydvr.com>
  M:    Andrey Utkin <andrey.utkin@corp.bluecherry.net>
  M:    Andrey Utkin <andrey.krieger.utkin@gmail.com>
 +M:    Ismael Luceno <ismael@iodev.co.uk>
  L:    linux-media@vger.kernel.org
  S:    Supported
  F:    drivers/media/pci/solo6x10/
@@@ -9298,13 -9205,6 +9299,13 @@@ F:    arch/m68k/sun3*
  F:    arch/m68k/include/asm/sun3*
  F:    drivers/net/ethernet/i825xx/sun3*
  
 +SUN4I LOW RES ADC ATTACHED TABLET KEYS DRIVER
 +M:    Hans de Goede <hdegoede@redhat.com>
 +L:    linux-input@vger.kernel.org
 +S:    Maintained
 +F:    Documentation/devicetree/bindings/input/sun4i-lradc-keys.txt
 +F:    drivers/input/keyboard/sun4i-lradc-keys.c
 +
  SUNDANCE NETWORK DRIVER
  M:    Denis Kirjanov <kda@linux-powerpc.org>
  L:    netdev@vger.kernel.org
@@@ -9313,6 -9213,7 +9314,6 @@@ F:      drivers/net/ethernet/dlink/sundance.
  
  SUPERH
  L:    linux-sh@vger.kernel.org
 -W:    http://www.linux-sh.org
  Q:    http://patchwork.kernel.org/project/linux-sh/list/
  S:    Orphan
  F:    Documentation/sh/
@@@ -9633,8 -9534,7 +9634,8 @@@ F:      drivers/platform/x86/thinkpad_acpi.
  TI BANDGAP AND THERMAL DRIVER
  M:    Eduardo Valentin <edubezval@gmail.com>
  L:    linux-pm@vger.kernel.org
 -S:    Supported
 +L:    linux-omap@vger.kernel.org
 +S:    Maintained
  F:    drivers/thermal/ti-soc-thermal/
  
  TI CLOCK DRIVER
@@@ -9691,13 -9591,6 +9692,13 @@@ F:    drivers/power/lp8788-charger.
  F:    drivers/regulator/lp8788-*.c
  F:    include/linux/mfd/lp8788*.h
  
 +TI NETCP ETHERNET DRIVER
 +M:    Wingman Kwok <w-kwok2@ti.com>
 +M:    Murali Karicheri <m-karicheri2@ti.com>
 +L:    netdev@vger.kernel.org
 +S:    Maintained
 +F:    drivers/net/ethernet/ti/netcp*
 +
  TI TWL4030 SERIES SOC CODEC DRIVER
  M:    Peter Ujfalusi <peter.ujfalusi@ti.com>
  L:    alsa-devel@alsa-project.org (moderated for non-subscribers)
@@@ -9818,21 -9711,13 +9819,21 @@@ F:   drivers/media/pci/tw68
  
  TPM DEVICE DRIVER
  M:    Peter Huewe <peterhuewe@gmx.de>
 -M:    Ashley Lai <ashley@ashleylai.com>
  M:    Marcel Selhorst <tpmdd@selhorst.net>
  W:    http://tpmdd.sourceforge.net
  L:    tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers)
 +Q:    git git://github.com/PeterHuewe/linux-tpmdd.git
 +T:    https://github.com/PeterHuewe/linux-tpmdd
  S:    Maintained
  F:    drivers/char/tpm/
  
 +TPM IBM_VTPM DEVICE DRIVER
 +M:    Ashley Lai <ashleydlai@gmail.com>
 +W:    http://tpmdd.sourceforge.net
 +L:    tpmdd-devel@lists.sourceforge.net (moderated for non-subscribers)
 +S:    Maintained
 +F:    drivers/char/tpm/tpm_ibmvtpm*
 +
  TRACING
  M:    Steven Rostedt <rostedt@goodmis.org>
  M:    Ingo Molnar <mingo@redhat.com>
@@@ -10262,7 -10147,6 +10263,7 @@@ USERSPACE I/O (UIO
  M:    "Hans J. Koch" <hjk@hansjkoch.de>
  M:    Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  S:    Maintained
 +T:    git git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc.git
  F:    Documentation/DocBook/uio-howto.tmpl
  F:    drivers/uio/
  F:    include/linux/uio*.h
@@@ -10690,6 -10574,7 +10691,7 @@@ F:   drivers/pci/*xen
  
  XEN BLOCK SUBSYSTEM
  M:    Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
+ M:    Roger Pau Monné <roger.pau@citrix.com>
  L:    xen-devel@lists.xenproject.org (moderated for non-subscribers)
  S:    Supported
  F:    drivers/block/xen-blkback/*
@@@ -10745,7 -10630,6 +10747,7 @@@ M:   Max Filippov <jcmvbkbc@gmail.com
  L:    linux-xtensa@linux-xtensa.org
  S:    Maintained
  F:    drivers/spi/spi-xtensa-xtfpga.c
 +F:    sound/soc/xtensa/xtfpga-i2s.c
  
  YAM DRIVER FOR AX.25
  M:    Jean-Paul Roubelat <jpr@f6fbb.org>
@@@ -1585,8 -1585,6 +1585,6 @@@ unsigned ata_exec_internal_sg(struct at
        else
                tag = 0;
  
-       if (test_and_set_bit(tag, &ap->qc_allocated))
-               BUG();
        qc = __ata_qc_from_tag(ap, tag);
  
        qc->tag = tag;
@@@ -1752,6 -1750,33 +1750,6 @@@ unsigned ata_exec_internal(struct ata_d
  }
  
  /**
 - *    ata_do_simple_cmd - execute simple internal command
 - *    @dev: Device to which the command is sent
 - *    @cmd: Opcode to execute
 - *
 - *    Execute a 'simple' command, that only consists of the opcode
 - *    'cmd' itself, without filling any other registers
 - *
 - *    LOCKING:
 - *    Kernel thread context (may sleep).
 - *
 - *    RETURNS:
 - *    Zero on success, AC_ERR_* mask on failure
 - */
 -unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd)
 -{
 -      struct ata_taskfile tf;
 -
 -      ata_tf_init(dev, &tf);
 -
 -      tf.command = cmd;
 -      tf.flags |= ATA_TFLAG_DEVICE;
 -      tf.protocol = ATA_PROT_NODATA;
 -
 -      return ata_exec_internal(dev, &tf, NULL, DMA_NONE, NULL, 0, 0);
 -}
 -
 -/**
   *    ata_pio_need_iordy      -       check if iordy needed
   *    @adev: ATA device
   *
@@@ -4206,33 -4231,10 +4204,33 @@@ static const struct ata_blacklist_entr
        { "PIONEER DVD-RW  DVR-216D",   NULL,   ATA_HORKAGE_NOSETXFER },
  
        /* devices that don't properly handle queued TRIM commands */
 -      { "Micron_M500*",               NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
 -      { "Crucial_CT???M500SSD*",      NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
 -      { "Micron_M550*",               NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
 -      { "Crucial_CT*M550SSD*",        NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
 +      { "Micron_M[56]*",              NULL,   ATA_HORKAGE_NO_NCQ_TRIM |
 +                                              ATA_HORKAGE_ZERO_AFTER_TRIM, },
 +      { "Crucial_CT*SSD*",            NULL,   ATA_HORKAGE_NO_NCQ_TRIM, },
 +
 +      /*
 +       * As defined, the DRAT (Deterministic Read After Trim) and RZAT
 +       * (Return Zero After Trim) flags in the ATA Command Set are
 +       * unreliable in the sense that they only define what happens if
 +       * the device successfully executed the DSM TRIM command. TRIM
 +       * is only advisory, however, and the device is free to silently
 +       * ignore all or parts of the request.
 +       *
 +       * Whitelist drives that are known to reliably return zeroes
 +       * after TRIM.
 +       */
 +
 +      /*
 +       * The intel 510 drive has buggy DRAT/RZAT. Explicitly exclude
 +       * that model before whitelisting all other intel SSDs.
 +       */
 +      { "INTEL*SSDSC2MH*",            NULL,   0, },
 +
 +      { "INTEL*SSD*",                 NULL,   ATA_HORKAGE_ZERO_AFTER_TRIM, },
 +      { "SSD*INTEL*",                 NULL,   ATA_HORKAGE_ZERO_AFTER_TRIM, },
 +      { "Samsung*SSD*",               NULL,   ATA_HORKAGE_ZERO_AFTER_TRIM, },
 +      { "SAMSUNG*SSD*",               NULL,   ATA_HORKAGE_ZERO_AFTER_TRIM, },
 +      { "ST[1248][0248]0[FH]*",       NULL,   ATA_HORKAGE_ZERO_AFTER_TRIM, },
  
        /*
         * Some WD SATA-I drives spin up and down erratically when the link
@@@ -4722,69 -4724,36 +4720,36 @@@ void swap_buf_le16(u16 *buf, unsigned i
  }
  
  /**
-  *    ata_qc_new - Request an available ATA command, for queueing
-  *    @ap: target port
-  *
-  *    Some ATA host controllers may implement a queue depth which is less
-  *    than ATA_MAX_QUEUE. So we shouldn't allocate a tag which is beyond
-  *    the hardware limitation.
+  *    ata_qc_new_init - Request an available ATA command, and initialize it
+  *    @dev: Device from whom we request an available command structure
   *
   *    LOCKING:
   *    None.
   */
  
- static struct ata_queued_cmd *ata_qc_new(struct ata_port *ap)
+ struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag)
  {
-       struct ata_queued_cmd *qc = NULL;
-       unsigned int max_queue = ap->host->n_tags;
-       unsigned int i, tag;
+       struct ata_port *ap = dev->link->ap;
+       struct ata_queued_cmd *qc;
  
        /* no command while frozen */
        if (unlikely(ap->pflags & ATA_PFLAG_FROZEN))
                return NULL;
  
-       for (i = 0, tag = ap->last_tag + 1; i < max_queue; i++, tag++) {
-               if (ap->flags & ATA_FLAG_LOWTAG)
-                       tag = i;
-               else
-                       tag = tag < max_queue ? tag : 0;
-               /* the last tag is reserved for internal command. */
-               if (tag == ATA_TAG_INTERNAL)
-                       continue;
-               if (!test_and_set_bit(tag, &ap->qc_allocated)) {
-                       qc = __ata_qc_from_tag(ap, tag);
-                       qc->tag = tag;
-                       ap->last_tag = tag;
-                       break;
-               }
+       /* libsas case */
+       if (!ap->scsi_host) {
+               tag = ata_sas_allocate_tag(ap);
+               if (tag < 0)
+                       return NULL;
        }
  
-       return qc;
- }
- /**
-  *    ata_qc_new_init - Request an available ATA command, and initialize it
-  *    @dev: Device from whom we request an available command structure
-  *
-  *    LOCKING:
-  *    None.
-  */
- struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev)
- {
-       struct ata_port *ap = dev->link->ap;
-       struct ata_queued_cmd *qc;
-       qc = ata_qc_new(ap);
-       if (qc) {
-               qc->scsicmd = NULL;
-               qc->ap = ap;
-               qc->dev = dev;
+       qc = __ata_qc_from_tag(ap, tag);
+       qc->tag = tag;
+       qc->scsicmd = NULL;
+       qc->ap = ap;
+       qc->dev = dev;
  
-               ata_qc_reinit(qc);
-       }
+       ata_qc_reinit(qc);
  
        return qc;
  }
@@@ -4811,7 -4780,8 +4776,8 @@@ void ata_qc_free(struct ata_queued_cmd 
        tag = qc->tag;
        if (likely(ata_tag_valid(tag))) {
                qc->tag = ATA_TAG_POISON;
-               clear_bit(tag, &ap->qc_allocated);
+               if (!ap->scsi_host)
+                       ata_sas_free_tag(tag, ap);
        }
  }
  
@@@ -756,7 -756,7 +756,7 @@@ static struct ata_queued_cmd *ata_scsi_
  {
        struct ata_queued_cmd *qc;
  
-       qc = ata_qc_new_init(dev);
+       qc = ata_qc_new_init(dev, cmd->request->tag);
        if (qc) {
                qc->scsicmd = cmd;
                qc->scsidone = cmd->scsi_done;
@@@ -1995,8 -1995,8 +1995,8 @@@ static unsigned int ata_scsiop_inq_std(
  
        VPRINTK("ENTER\n");
  
 -      /* set scsi removeable (RMB) bit per ata bit */
 -      if (ata_id_removeable(args->id))
 +      /* set scsi removable (RMB) bit per ata bit */
 +      if (ata_id_removable(args->id))
                hdr[1] |= (1 << 7);
  
        if (args->dev->class == ATA_DEV_ZAC) {
@@@ -2532,15 -2532,13 +2532,15 @@@ static unsigned int ata_scsiop_read_cap
                rbuf[15] = lowest_aligned;
  
                if (ata_id_has_trim(args->id)) {
 -                      rbuf[14] |= 0x80; /* TPE */
 +                      rbuf[14] |= 0x80; /* LBPME */
  
 -                      if (ata_id_has_zero_after_trim(args->id))
 -                              rbuf[14] |= 0x40; /* TPRZ */
 +                      if (ata_id_has_zero_after_trim(args->id) &&
 +                          dev->horkage & ATA_HORKAGE_ZERO_AFTER_TRIM) {
 +                              ata_dev_info(dev, "Enabling discard_zeroes_data\n");
 +                              rbuf[14] |= 0x40; /* LBPRZ */
 +                      }
                }
        }
 -
        return 0;
  }
  
@@@ -3668,6 -3666,9 +3668,9 @@@ int ata_scsi_add_hosts(struct ata_host 
                 */
                shost->max_host_blocked = 1;
  
+               if (scsi_init_shared_tag_map(shost, host->n_tags))
+                       goto err_add;
                rc = scsi_add_host_with_dma(ap->scsi_host,
                                                &ap->tdev, ap->host->dev);
                if (rc)
@@@ -4230,3 -4231,28 +4233,31 @@@ int ata_sas_queuecmd(struct scsi_cmnd *
        return rc;
  }
  EXPORT_SYMBOL_GPL(ata_sas_queuecmd);
 -              tag = tag < max_queue ? tag : 0;
+ int ata_sas_allocate_tag(struct ata_port *ap)
+ {
+       unsigned int max_queue = ap->host->n_tags;
+       unsigned int i, tag;
+       for (i = 0, tag = ap->sas_last_tag + 1; i < max_queue; i++, tag++) {
++              if (ap->flags & ATA_FLAG_LOWTAG)
++                      tag = 1;
++              else
++                      tag = tag < max_queue ? tag : 0;
+               /* the last tag is reserved for internal command. */
+               if (tag == ATA_TAG_INTERNAL)
+                       continue;
+               if (!test_and_set_bit(tag, &ap->sas_tag_allocated)) {
+                       ap->sas_last_tag = tag;
+                       return tag;
+               }
+       }
+       return -1;
+ }
+ void ata_sas_free_tag(unsigned int tag, struct ata_port *ap)
+ {
+       clear_bit(tag, &ap->sas_tag_allocated);
+ }
diff --combined drivers/ata/libata.h
@@@ -63,7 -63,7 +63,7 @@@ extern struct ata_link *ata_dev_phys_li
  extern void ata_force_cbl(struct ata_port *ap);
  extern u64 ata_tf_to_lba(const struct ata_taskfile *tf);
  extern u64 ata_tf_to_lba48(const struct ata_taskfile *tf);
- extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev);
+ extern struct ata_queued_cmd *ata_qc_new_init(struct ata_device *dev, int tag);
  extern int ata_build_rw_tf(struct ata_taskfile *tf, struct ata_device *dev,
                           u64 block, u32 n_block, unsigned int tf_flags,
                           unsigned int tag);
@@@ -76,6 -76,7 +76,6 @@@ extern unsigned ata_exec_internal_sg(st
                                     struct ata_taskfile *tf, const u8 *cdb,
                                     int dma_dir, struct scatterlist *sg,
                                     unsigned int n_elem, unsigned long timeout);
 -extern unsigned int ata_do_simple_cmd(struct ata_device *dev, u8 cmd);
  extern int ata_wait_ready(struct ata_link *link, unsigned long deadline,
                          int (*check_ready)(struct ata_link *link));
  extern int ata_dev_read_id(struct ata_device *dev, unsigned int *p_class,
@@@ -144,6 -145,8 +144,8 @@@ extern void ata_scsi_dev_rescan(struct 
  extern int ata_bus_probe(struct ata_port *ap);
  extern int ata_scsi_user_scan(struct Scsi_Host *shost, unsigned int channel,
                              unsigned int id, u64 lun);
+ int ata_sas_allocate_tag(struct ata_port *ap);
+ void ata_sas_free_tag(unsigned int tag, struct ata_port *ap);
  
  
  /* libata-eh.c */
diff --combined drivers/ata/sata_sil24.c
@@@ -246,7 -246,7 +246,7 @@@ enum 
        /* host flags */
        SIL24_COMMON_FLAGS      = ATA_FLAG_SATA | ATA_FLAG_PIO_DMA |
                                  ATA_FLAG_NCQ | ATA_FLAG_ACPI_SATA |
 -                                ATA_FLAG_AN | ATA_FLAG_PMP,
 +                                ATA_FLAG_AN | ATA_FLAG_PMP | ATA_FLAG_LOWTAG,
        SIL24_FLAG_PCIX_IRQ_WOC = (1 << 24), /* IRQ loss errata on PCI-X */
  
        IRQ_STAT_4PORTS         = 0xf,
@@@ -388,6 -388,7 +388,7 @@@ static struct scsi_host_template sil24_
        .can_queue              = SIL24_MAX_CMDS,
        .sg_tablesize           = SIL24_MAX_SGE,
        .dma_boundary           = ATA_DMA_BOUNDARY,
+       .tag_alloc_policy       = BLK_TAG_ALLOC_FIFO,
  };
  
  static struct ata_port_operations sil24_ops = {
@@@ -106,7 -106,7 +106,7 @@@ struct nvme_queue 
        dma_addr_t cq_dma_addr;
        u32 __iomem *q_db;
        u16 q_depth;
 -      u16 cq_vector;
 +      s16 cq_vector;
        u16 sq_head;
        u16 sq_tail;
        u16 cq_head;
@@@ -144,8 -144,37 +144,37 @@@ struct nvme_cmd_info 
        void *ctx;
        int aborted;
        struct nvme_queue *nvmeq;
+       struct nvme_iod iod[0];
  };
  
+ /*
+  * Max size of iod being embedded in the request payload
+  */
+ #define NVME_INT_PAGES                2
+ #define NVME_INT_BYTES(dev)   (NVME_INT_PAGES * (dev)->page_size)
+ /*
+  * Will slightly overestimate the number of pages needed.  This is OK
+  * as it only leads to a small amount of wasted memory for the lifetime of
+  * the I/O.
+  */
+ static int nvme_npages(unsigned size, struct nvme_dev *dev)
+ {
+       unsigned nprps = DIV_ROUND_UP(size + dev->page_size, dev->page_size);
+       return DIV_ROUND_UP(8 * nprps, PAGE_SIZE - 8);
+ }
+ static unsigned int nvme_cmd_size(struct nvme_dev *dev)
+ {
+       unsigned int ret = sizeof(struct nvme_cmd_info);
+       ret += sizeof(struct nvme_iod);
+       ret += sizeof(__le64 *) * nvme_npages(NVME_INT_BYTES(dev), dev);
+       ret += sizeof(struct scatterlist) * NVME_INT_PAGES;
+       return ret;
+ }
  static int nvme_admin_init_hctx(struct blk_mq_hw_ctx *hctx, void *data,
                                unsigned int hctx_idx)
  {
@@@ -215,9 -244,21 +244,22 @@@ static void nvme_set_info(struct nvme_c
        cmd->fn = handler;
        cmd->ctx = ctx;
        cmd->aborted = 0;
 +      blk_mq_start_request(blk_mq_rq_from_pdu(cmd));
  }
  
+ static void *iod_get_private(struct nvme_iod *iod)
+ {
+       return (void *) (iod->private & ~0x1UL);
+ }
+ /*
+  * If bit 0 is set, the iod is embedded in the request payload.
+  */
+ static bool iod_should_kfree(struct nvme_iod *iod)
+ {
+       return (iod->private & 0x01) == 0;
+ }
  /* Special values must be less than 0x1000 */
  #define CMD_CTX_BASE          ((void *)POISON_POINTER_DELTA)
  #define CMD_CTX_CANCELLED     (0x30C + CMD_CTX_BASE)
@@@ -361,35 -402,53 +403,53 @@@ static __le64 **iod_list(struct nvme_io
        return ((void *)iod) + iod->offset;
  }
  
- /*
-  * Will slightly overestimate the number of pages needed.  This is OK
-  * as it only leads to a small amount of wasted memory for the lifetime of
-  * the I/O.
-  */
- static int nvme_npages(unsigned size, struct nvme_dev *dev)
+ static inline void iod_init(struct nvme_iod *iod, unsigned nbytes,
+                           unsigned nseg, unsigned long private)
  {
-       unsigned nprps = DIV_ROUND_UP(size + dev->page_size, dev->page_size);
-       return DIV_ROUND_UP(8 * nprps, dev->page_size - 8);
+       iod->private = private;
+       iod->offset = offsetof(struct nvme_iod, sg[nseg]);
+       iod->npages = -1;
+       iod->length = nbytes;
+       iod->nents = 0;
  }
  
  static struct nvme_iod *
- nvme_alloc_iod(unsigned nseg, unsigned nbytes, struct nvme_dev *dev, gfp_t gfp)
+ __nvme_alloc_iod(unsigned nseg, unsigned bytes, struct nvme_dev *dev,
+                unsigned long priv, gfp_t gfp)
  {
        struct nvme_iod *iod = kmalloc(sizeof(struct nvme_iod) +
-                               sizeof(__le64 *) * nvme_npages(nbytes, dev) +
+                               sizeof(__le64 *) * nvme_npages(bytes, dev) +
                                sizeof(struct scatterlist) * nseg, gfp);
  
-       if (iod) {
-               iod->offset = offsetof(struct nvme_iod, sg[nseg]);
-               iod->npages = -1;
-               iod->length = nbytes;
-               iod->nents = 0;
-               iod->first_dma = 0ULL;
-       }
+       if (iod)
+               iod_init(iod, bytes, nseg, priv);
  
        return iod;
  }
  
+ static struct nvme_iod *nvme_alloc_iod(struct request *rq, struct nvme_dev *dev,
+                                      gfp_t gfp)
+ {
+       unsigned size = !(rq->cmd_flags & REQ_DISCARD) ? blk_rq_bytes(rq) :
+                                                 sizeof(struct nvme_dsm_range);
+       unsigned long mask = 0;
+       struct nvme_iod *iod;
+       if (rq->nr_phys_segments <= NVME_INT_PAGES &&
+           size <= NVME_INT_BYTES(dev)) {
+               struct nvme_cmd_info *cmd = blk_mq_rq_to_pdu(rq);
+               iod = cmd->iod;
+               mask = 0x01;
+               iod_init(iod, size, rq->nr_phys_segments,
+                               (unsigned long) rq | 0x01);
+               return iod;
+       }
+       return __nvme_alloc_iod(rq->nr_phys_segments, size, dev,
+                               (unsigned long) rq, gfp);
+ }
  void nvme_free_iod(struct nvme_dev *dev, struct nvme_iod *iod)
  {
        const int last_prp = dev->page_size / 8 - 1;
                dma_pool_free(dev->prp_page_pool, prp_list, prp_dma);
                prp_dma = next_prp_dma;
        }
-       kfree(iod);
+       if (iod_should_kfree(iod))
+               kfree(iod);
  }
  
  static int nvme_error_status(u16 status)
@@@ -424,7 -485,7 +486,7 @@@ static void req_completion(struct nvme_
                                                struct nvme_completion *cqe)
  {
        struct nvme_iod *iod = ctx;
-       struct request *req = iod->private;
+       struct request *req = iod_get_private(iod);
        struct nvme_cmd_info *cmd_rq = blk_mq_rq_to_pdu(req);
  
        u16 status = le16_to_cpup(&cqe->status) >> 1;
        if (unlikely(status)) {
                if (!(status & NVME_SC_DNR || blk_noretry_request(req))
                    && (jiffies - req->start_time) < req->timeout) {
 +                      unsigned long flags;
 +
                        blk_mq_requeue_request(req);
 -                      blk_mq_kick_requeue_list(req->q);
 +                      spin_lock_irqsave(req->q->queue_lock, flags);
 +                      if (!blk_queue_stopped(req->q))
 +                              blk_mq_kick_requeue_list(req->q);
 +                      spin_unlock_irqrestore(req->q->queue_lock, flags);
                        return;
                }
                req->errors = nvme_error_status(status);
@@@ -585,7 -641,7 +647,7 @@@ static void nvme_submit_flush(struct nv
  static int nvme_submit_iod(struct nvme_queue *nvmeq, struct nvme_iod *iod,
                                                        struct nvme_ns *ns)
  {
-       struct request *req = iod->private;
+       struct request *req = iod_get_private(iod);
        struct nvme_command *cmnd;
        u16 control = 0;
        u32 dsmgmt = 0;
@@@ -626,17 -682,12 +688,12 @@@ static int nvme_queue_rq(struct blk_mq_
        struct request *req = bd->rq;
        struct nvme_cmd_info *cmd = blk_mq_rq_to_pdu(req);
        struct nvme_iod *iod;
-       int psegs = req->nr_phys_segments;
        enum dma_data_direction dma_dir;
-       unsigned size = !(req->cmd_flags & REQ_DISCARD) ? blk_rq_bytes(req) :
-                                               sizeof(struct nvme_dsm_range);
  
-       iod = nvme_alloc_iod(psegs, size, ns->dev, GFP_ATOMIC);
+       iod = nvme_alloc_iod(req, ns->dev, GFP_ATOMIC);
        if (!iod)
                return BLK_MQ_RQ_QUEUE_BUSY;
  
-       iod->private = req;
        if (req->cmd_flags & REQ_DISCARD) {
                void *range;
                /*
                        goto retry_cmd;
                iod_list(iod)[0] = (__le64 *)range;
                iod->npages = 0;
-       } else if (psegs) {
+       } else if (req->nr_phys_segments) {
                dma_dir = rq_data_dir(req) ? DMA_TO_DEVICE : DMA_FROM_DEVICE;
  
-               sg_init_table(iod->sg, psegs);
+               sg_init_table(iod->sg, req->nr_phys_segments);
                iod->nents = blk_rq_map_sg(req->q, req, iod->sg);
                if (!iod->nents)
                        goto error_cmd;
                }
        }
  
 -      blk_mq_start_request(req);
 -
        nvme_set_info(cmd, iod, req_completion);
        spin_lock_irq(&nvmeq->q_lock);
        if (req->cmd_flags & REQ_DISCARD)
@@@ -839,7 -892,6 +896,7 @@@ static int nvme_submit_async_admin_req(
        if (IS_ERR(req))
                return PTR_ERR(req);
  
 +      req->cmd_flags |= REQ_NO_TIMEOUT;
        cmd_info = blk_mq_rq_to_pdu(req);
        nvme_set_info(cmd_info, req, async_req_completion);
  
@@@ -1021,19 -1073,14 +1078,19 @@@ static void nvme_abort_req(struct reque
        struct nvme_command cmd;
  
        if (!nvmeq->qid || cmd_rq->aborted) {
 +              unsigned long flags;
 +
 +              spin_lock_irqsave(&dev_list_lock, flags);
                if (work_busy(&dev->reset_work))
 -                      return;
 +                      goto out;
                list_del_init(&dev->node);
                dev_warn(&dev->pci_dev->dev,
                        "I/O %d QID %d timeout, reset controller\n",
                                                        req->tag, nvmeq->qid);
                dev->reset_workfn = nvme_reset_failed_dev;
                queue_work(nvme_workq, &dev->reset_work);
 + out:
 +              spin_unlock_irqrestore(&dev_list_lock, flags);
                return;
        }
  
@@@ -1074,22 -1121,15 +1131,22 @@@ static void nvme_cancel_queue_ios(struc
        void *ctx;
        nvme_completion_fn fn;
        struct nvme_cmd_info *cmd;
 -      static struct nvme_completion cqe = {
 -              .status = cpu_to_le16(NVME_SC_ABORT_REQ << 1),
 -      };
 +      struct nvme_completion cqe;
 +
 +      if (!blk_mq_request_started(req))
 +              return;
  
        cmd = blk_mq_rq_to_pdu(req);
  
        if (cmd->ctx == CMD_CTX_CANCELLED)
                return;
  
 +      if (blk_queue_dying(req->q))
 +              cqe.status = cpu_to_le16((NVME_SC_ABORT_REQ | NVME_SC_DNR) << 1);
 +      else
 +              cqe.status = cpu_to_le16(NVME_SC_ABORT_REQ << 1);
 +
 +
        dev_warn(nvmeq->q_dmadev, "Cancelling I/O %d QID %d\n",
                                                req->tag, nvmeq->qid);
        ctx = cancel_cmd_info(cmd, &fn);
@@@ -1101,29 -1141,17 +1158,29 @@@ static enum blk_eh_timer_return nvme_ti
        struct nvme_cmd_info *cmd = blk_mq_rq_to_pdu(req);
        struct nvme_queue *nvmeq = cmd->nvmeq;
  
 -      dev_warn(nvmeq->q_dmadev, "Timeout I/O %d QID %d\n", req->tag,
 -                                                      nvmeq->qid);
 -      if (nvmeq->dev->initialized)
 -              nvme_abort_req(req);
 -
        /*
         * The aborted req will be completed on receiving the abort req.
         * We enable the timer again. If hit twice, it'll cause a device reset,
         * as the device then is in a faulty state.
         */
 -      return BLK_EH_RESET_TIMER;
 +      int ret = BLK_EH_RESET_TIMER;
 +
 +      dev_warn(nvmeq->q_dmadev, "Timeout I/O %d QID %d\n", req->tag,
 +                                                      nvmeq->qid);
 +
 +      spin_lock_irq(&nvmeq->q_lock);
 +      if (!nvmeq->dev->initialized) {
 +              /*
 +               * Force cancelled command frees the request, which requires we
 +               * return BLK_EH_NOT_HANDLED.
 +               */
 +              nvme_cancel_queue_ios(nvmeq->hctx, req, nvmeq, reserved);
 +              ret = BLK_EH_NOT_HANDLED;
 +      } else
 +              nvme_abort_req(req);
 +      spin_unlock_irq(&nvmeq->q_lock);
 +
 +      return ret;
  }
  
  static void nvme_free_queue(struct nvme_queue *nvmeq)
  
  static void nvme_free_queues(struct nvme_dev *dev, int lowest)
  {
-       LLIST_HEAD(q_list);
-       struct nvme_queue *nvmeq, *next;
-       struct llist_node *entry;
        int i;
  
        for (i = dev->queue_count - 1; i >= lowest; i--) {
                struct nvme_queue *nvmeq = dev->queues[i];
-               llist_add(&nvmeq->node, &q_list);
                dev->queue_count--;
                dev->queues[i] = NULL;
-       }
-       synchronize_rcu();
-       entry = llist_del_all(&q_list);
-       llist_for_each_entry_safe(nvmeq, next, entry, node)
                nvme_free_queue(nvmeq);
+       }
  }
  
  /**
@@@ -1204,8 -1225,6 +1254,8 @@@ static void nvme_disable_queue(struct n
                adapter_delete_sq(dev, qid);
                adapter_delete_cq(dev, qid);
        }
 +      if (!qid && dev->admin_q)
 +              blk_mq_freeze_queue_start(dev->admin_q);
        nvme_clear_queue(nvmeq);
  }
  
@@@ -1392,14 -1411,6 +1442,14 @@@ static struct blk_mq_ops nvme_mq_ops = 
        .timeout        = nvme_timeout,
  };
  
 +static void nvme_dev_remove_admin(struct nvme_dev *dev)
 +{
 +      if (dev->admin_q && !blk_queue_dying(dev->admin_q)) {
 +              blk_cleanup_queue(dev->admin_q);
 +              blk_mq_free_tag_set(&dev->admin_tagset);
 +      }
 +}
 +
  static int nvme_alloc_admin_tags(struct nvme_dev *dev)
  {
        if (!dev->admin_q) {
                dev->admin_tagset.queue_depth = NVME_AQ_DEPTH - 1;
                dev->admin_tagset.timeout = ADMIN_TIMEOUT;
                dev->admin_tagset.numa_node = dev_to_node(&dev->pci_dev->dev);
-               dev->admin_tagset.cmd_size = sizeof(struct nvme_cmd_info);
+               dev->admin_tagset.cmd_size = nvme_cmd_size(dev);
                dev->admin_tagset.driver_data = dev;
  
                if (blk_mq_alloc_tag_set(&dev->admin_tagset))
                        blk_mq_free_tag_set(&dev->admin_tagset);
                        return -ENOMEM;
                }
 -      }
 +              if (!blk_get_queue(dev->admin_q)) {
 +                      nvme_dev_remove_admin(dev);
 +                      return -ENODEV;
 +              }
 +      } else
 +              blk_mq_unfreeze_queue(dev->admin_q);
  
        return 0;
  }
  
 -static void nvme_free_admin_tags(struct nvme_dev *dev)
 -{
 -      if (dev->admin_q)
 -              blk_mq_free_tag_set(&dev->admin_tagset);
 -}
 -
  static int nvme_configure_admin_queue(struct nvme_dev *dev)
  {
        int result;
        if (result)
                goto free_nvmeq;
  
 -      result = nvme_alloc_admin_tags(dev);
 -      if (result)
 -              goto free_nvmeq;
 -
        nvmeq->cq_vector = 0;
        result = queue_request_irq(dev, nvmeq, nvmeq->irqname);
        if (result)
 -              goto free_tags;
 +              goto free_nvmeq;
  
        return result;
  
 - free_tags:
 -      nvme_free_admin_tags(dev);
   free_nvmeq:
        nvme_free_queues(dev, 0);
        return result;
@@@ -1522,7 -1540,7 +1572,7 @@@ struct nvme_iod *nvme_map_user_pages(st
        }
  
        err = -ENOMEM;
-       iod = nvme_alloc_iod(count, length, dev, GFP_KERNEL);
+       iod = __nvme_alloc_iod(count, length, dev, 0, GFP_KERNEL);
        if (!iod)
                goto put_pages;
  
@@@ -2148,7 -2166,7 +2198,7 @@@ static int nvme_dev_add(struct nvme_de
        dev->tagset.numa_node = dev_to_node(&dev->pci_dev->dev);
        dev->tagset.queue_depth =
                                min_t(int, dev->q_depth, BLK_MQ_MAX_DEPTH) - 1;
-       dev->tagset.cmd_size = sizeof(struct nvme_cmd_info);
+       dev->tagset.cmd_size = nvme_cmd_size(dev);
        dev->tagset.flags = BLK_MQ_F_SHOULD_MERGE;
        dev->tagset.driver_data = dev;
  
@@@ -2274,18 -2292,13 +2324,18 @@@ static void nvme_wait_dq(struct nvme_de
                        break;
                if (!schedule_timeout(ADMIN_TIMEOUT) ||
                                        fatal_signal_pending(current)) {
 +                      /*
 +                       * Disable the controller first since we can't trust it
 +                       * at this point, but leave the admin queue enabled
 +                       * until all queue deletion requests are flushed.
 +                       * FIXME: This may take a while if there are more h/w
 +                       * queues than admin tags.
 +                       */
                        set_current_state(TASK_RUNNING);
 -
                        nvme_disable_ctrl(dev, readq(&dev->bar->cap));
 -                      nvme_disable_queue(dev, 0);
 -
 -                      send_sig(SIGKILL, dq->worker->task, 1);
 +                      nvme_clear_queue(dev->queues[0]);
                        flush_kthread_worker(dq->worker);
 +                      nvme_disable_queue(dev, 0);
                        return;
                }
        }
@@@ -2362,6 -2375,7 +2412,6 @@@ static void nvme_del_queue_start(struc
  {
        struct nvme_queue *nvmeq = container_of(work, struct nvme_queue,
                                                        cmdinfo.work);
 -      allow_signal(SIGKILL);
        if (nvme_delete_sq(nvmeq))
                nvme_del_queue_end(nvmeq);
  }
@@@ -2419,34 -2433,6 +2469,34 @@@ static void nvme_dev_list_remove(struc
                kthread_stop(tmp);
  }
  
 +static void nvme_freeze_queues(struct nvme_dev *dev)
 +{
 +      struct nvme_ns *ns;
 +
 +      list_for_each_entry(ns, &dev->namespaces, list) {
 +              blk_mq_freeze_queue_start(ns->queue);
 +
 +              spin_lock(ns->queue->queue_lock);
 +              queue_flag_set(QUEUE_FLAG_STOPPED, ns->queue);
 +              spin_unlock(ns->queue->queue_lock);
 +
 +              blk_mq_cancel_requeue_work(ns->queue);
 +              blk_mq_stop_hw_queues(ns->queue);
 +      }
 +}
 +
 +static void nvme_unfreeze_queues(struct nvme_dev *dev)
 +{
 +      struct nvme_ns *ns;
 +
 +      list_for_each_entry(ns, &dev->namespaces, list) {
 +              queue_flag_clear_unlocked(QUEUE_FLAG_STOPPED, ns->queue);
 +              blk_mq_unfreeze_queue(ns->queue);
 +              blk_mq_start_stopped_hw_queues(ns->queue, true);
 +              blk_mq_kick_requeue_list(ns->queue);
 +      }
 +}
 +
  static void nvme_dev_shutdown(struct nvme_dev *dev)
  {
        int i;
        dev->initialized = 0;
        nvme_dev_list_remove(dev);
  
 -      if (dev->bar)
 +      if (dev->bar) {
 +              nvme_freeze_queues(dev);
                csts = readl(&dev->bar->csts);
 +      }
        if (csts & NVME_CSTS_CFS || !(csts & NVME_CSTS_RDY)) {
                for (i = dev->queue_count - 1; i >= 0; i--) {
                        struct nvme_queue *nvmeq = dev->queues[i];
        nvme_dev_unmap(dev);
  }
  
 -static void nvme_dev_remove_admin(struct nvme_dev *dev)
 -{
 -      if (dev->admin_q && !blk_queue_dying(dev->admin_q))
 -              blk_cleanup_queue(dev->admin_q);
 -}
 -
  static void nvme_dev_remove(struct nvme_dev *dev)
  {
        struct nvme_ns *ns;
        list_for_each_entry(ns, &dev->namespaces, list) {
                if (ns->disk->flags & GENHD_FL_UP)
                        del_gendisk(ns->disk);
 -              if (!blk_queue_dying(ns->queue))
 +              if (!blk_queue_dying(ns->queue)) {
 +                      blk_mq_abort_requeue_list(ns->queue);
                        blk_cleanup_queue(ns->queue);
 +              }
        }
  }
  
@@@ -2564,7 -2552,6 +2614,7 @@@ static void nvme_free_dev(struct kref *
        nvme_free_namespaces(dev);
        nvme_release_instance(dev);
        blk_mq_free_tag_set(&dev->tagset);
 +      blk_put_queue(dev->admin_q);
        kfree(dev->queues);
        kfree(dev->entry);
        kfree(dev);
@@@ -2661,20 -2648,15 +2711,20 @@@ static int nvme_dev_start(struct nvme_d
        }
  
        nvme_init_queue(dev->queues[0], 0);
 +      result = nvme_alloc_admin_tags(dev);
 +      if (result)
 +              goto disable;
  
        result = nvme_setup_io_queues(dev);
        if (result)
 -              goto disable;
 +              goto free_tags;
  
        nvme_set_irq_hints(dev);
  
        return result;
  
 + free_tags:
 +      nvme_dev_remove_admin(dev);
   disable:
        nvme_disable_queue(dev, 0);
        nvme_dev_list_remove(dev);
@@@ -2714,9 -2696,6 +2764,9 @@@ static int nvme_dev_resume(struct nvme_
                dev->reset_workfn = nvme_remove_disks;
                queue_work(nvme_workq, &dev->reset_work);
                spin_unlock(&dev_list_lock);
 +      } else {
 +              nvme_unfreeze_queues(dev);
 +              nvme_set_irq_hints(dev);
        }
        dev->initialized = 1;
        return 0;
@@@ -2854,10 -2833,11 +2904,10 @@@ static void nvme_remove(struct pci_dev 
        pci_set_drvdata(pdev, NULL);
        flush_work(&dev->reset_work);
        misc_deregister(&dev->miscdev);
 -      nvme_dev_remove(dev);
        nvme_dev_shutdown(dev);
 +      nvme_dev_remove(dev);
        nvme_dev_remove_admin(dev);
        nvme_free_queues(dev, 0);
 -      nvme_free_admin_tags(dev);
        nvme_release_prp_pools(dev);
        kref_put(&dev->kref, nvme_free_dev);
  }
@@@ -214,6 -214,15 +214,15 @@@ enum blkif_protocol 
        BLKIF_PROTOCOL_X86_64 = 3,
  };
  
+ /*
+  * Default protocol if the frontend doesn't specify one.
+  */
+ #ifdef CONFIG_X86
+ #  define BLKIF_PROTOCOL_DEFAULT BLKIF_PROTOCOL_X86_32
+ #else
+ #  define BLKIF_PROTOCOL_DEFAULT BLKIF_PROTOCOL_NATIVE
+ #endif
  struct xen_vbd {
        /* What the domain refers to this vbd as. */
        blkif_vdev_t            handle;
@@@ -350,9 -359,6 +359,9 @@@ struct pending_req 
        struct grant_page       *indirect_pages[MAX_INDIRECT_PAGES];
        struct seg_buf          seg[MAX_INDIRECT_SEGMENTS];
        struct bio              *biolist[MAX_INDIRECT_SEGMENTS];
 +      struct gnttab_unmap_grant_ref unmap[MAX_INDIRECT_SEGMENTS];
 +      struct page                   *unmap_pages[MAX_INDIRECT_SEGMENTS];
 +      struct gntab_unmap_queue_data gnttab_unmap_data;
  };
  
  
diff --combined include/linux/libata.h
@@@ -231,7 -231,6 +231,7 @@@ enum 
        ATA_FLAG_SW_ACTIVITY    = (1 << 22), /* driver supports sw activity
                                              * led */
        ATA_FLAG_NO_DIPM        = (1 << 23), /* host not happy with DIPM */
 +      ATA_FLAG_LOWTAG         = (1 << 24), /* host wants lowest available tag */
  
        /* bits 24:31 of ap->flags are reserved for LLD specific flags */
  
        ATA_HORKAGE_NO_NCQ_TRIM = (1 << 19),    /* don't use queued TRIM */
        ATA_HORKAGE_NOLPM       = (1 << 20),    /* don't use LPM */
        ATA_HORKAGE_WD_BROKEN_LPM = (1 << 21),  /* some WDs have broken LPM */
 +      ATA_HORKAGE_ZERO_AFTER_TRIM = (1 << 22),/* guarantees zero after trim */
  
         /* DMA mask for user DMA control: User visible values; DO NOT
            renumber */
@@@ -823,10 -821,10 +823,10 @@@ struct ata_port 
        unsigned int            cbl;    /* cable type; ATA_CBL_xxx */
  
        struct ata_queued_cmd   qcmd[ATA_MAX_QUEUE];
-       unsigned long           qc_allocated;
+       unsigned long           sas_tag_allocated; /* for sas tag allocation only */
        unsigned int            qc_active;
        int                     nr_active_links; /* #links with active qcs */
-       unsigned int            last_tag;       /* track next tag hw expects */
+       unsigned int            sas_last_tag;   /* track next tag hw expects */
  
        struct ata_link         link;           /* host default link */
        struct ata_link         *slave_link;    /* see ata_slave_link_init() */
@@@ -1340,18 -1338,13 +1340,19 @@@ extern const struct ata_port_operation
  extern const struct ata_port_operations sata_port_ops;
  extern struct device_attribute *ata_common_sdev_attrs[];
  
 +/*
 + * All sht initializers (BASE, PIO, BMDMA, NCQ) must be instantiated
 + * by the edge drivers.  Because the 'module' field of sht must be the
 + * edge driver's module reference, otherwise the driver can be unloaded
 + * even if the scsi_device is being accessed.
 + */
  #define ATA_BASE_SHT(drv_name)                                        \
        .module                 = THIS_MODULE,                  \
        .name                   = drv_name,                     \
        .ioctl                  = ata_scsi_ioctl,               \
        .queuecommand           = ata_scsi_queuecmd,            \
        .can_queue              = ATA_DEF_QUEUE,                \
+       .tag_alloc_policy       = BLK_TAG_ALLOC_RR,             \
        .this_id                = ATA_SHT_THIS_ID,              \
        .cmd_per_lun            = ATA_SHT_CMD_PER_LUN,          \
        .emulated               = ATA_SHT_EMULATED,             \
diff --combined include/linux/wait.h
@@@ -267,6 -267,21 +267,21 @@@ do {                                                                     
        __wait_event(wq, condition);                                    \
  } while (0)
  
+ #define __io_wait_event(wq, condition)                                        \
+       (void)___wait_event(wq, condition, TASK_UNINTERRUPTIBLE, 0, 0,  \
+                           io_schedule())
+ /*
+  * io_wait_event() -- like wait_event() but with io_schedule()
+  */
+ #define io_wait_event(wq, condition)                                  \
+ do {                                                                  \
+       might_sleep();                                                  \
+       if (condition)                                                  \
+               break;                                                  \
+       __io_wait_event(wq, condition);                                 \
+ } while (0)
  #define __wait_event_freezable(wq, condition)                         \
        ___wait_event(wq, condition, TASK_INTERRUPTIBLE, 0, 0,          \
                            schedule(); try_to_freeze())
   */
  #define wait_event_cmd(wq, condition, cmd1, cmd2)                     \
  do {                                                                  \
 -      might_sleep();                                                  \
        if (condition)                                                  \
                break;                                                  \
        __wait_event_cmd(wq, condition, cmd1, cmd2);                    \
@@@ -990,32 -1006,6 +1005,32 @@@ wait_on_bit_io(void *word, int bit, uns
  }
  
  /**
 + * wait_on_bit_timeout - wait for a bit to be cleared or a timeout elapses
 + * @word: the word being waited on, a kernel virtual address
 + * @bit: the bit of the word being waited on
 + * @mode: the task state to sleep in
 + * @timeout: timeout, in jiffies
 + *
 + * Use the standard hashed waitqueue table to wait for a bit
 + * to be cleared. This is similar to wait_on_bit(), except also takes a
 + * timeout parameter.
 + *
 + * Returned value will be zero if the bit was cleared before the
 + * @timeout elapsed, or non-zero if the @timeout elapsed or process
 + * received a signal and the mode permitted wakeup on that signal.
 + */
 +static inline int
 +wait_on_bit_timeout(void *word, int bit, unsigned mode, unsigned long timeout)
 +{
 +      might_sleep();
 +      if (!test_bit(bit, word))
 +              return 0;
 +      return out_of_line_wait_on_bit_timeout(word, bit,
 +                                             bit_wait_timeout,
 +                                             mode, timeout);
 +}
 +
 +/**
   * wait_on_bit_action - wait for a bit to be cleared
   * @word: the word being waited on, a kernel virtual address
   * @bit: the bit of the word being waited on