UBUNTU: [Upstream] PPC: PCI: Fix pcibios_io_space_offset() so it works for 32-bit ptr/64-bit rsrcs

The commit introducing pcibios_io_space_offset() was ignoring 32-bit to
64-bit sign extention, which is the case on ppc32 with 64-bit resource
addresses. This only seems to have shown up while running under QEMU for
e500mc target. It may or may be suboptimal that QEMU has an IO base
address > 32-bits for the e500-pci implementation, but 1) it's still a
regression and 2) it's more correct to handle things this way.

(Patch sent upstream)

Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: [Upstream] SCSI: AACRAID: Use resource_size_t for IO mem pointers and offsets

This also stops using the "legacy crap" in Scsi_Host (shost->base is an
unsigned long).

This affected 32-bit systems that have 64-bit resource sizes, causing the
IO address to be truncated.

Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Cc: Adaptec OEM Raid Solutions <aacraid@adaptec.com
Cc: linux-scsi@vger.kernel.org
UBUNTU: [Upstream] SCSI: AACRAID: Better handling of in-flight events on thread stop

When an error occured that would shut down the driver, some in-flight
events were getting caught up, deadlocking a CPU or two.

Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Cc: Adaptec OEM Raid Solutions <aacraid@adaptec.com
Cc: linux-scsi@vger.kernel.org
UBUNTU: [Upstream] SCSI: AACRAID: Relax the tight timeout loop on fib commands

The loop that waited for syncronous fib commands was causing a CPU stall
when a timeout actually occured.

1) Switch to using a more accurate timeout mechanism.
2) Do not pace the loop with udelay(). Use cpu_relax() to allow for
   scheduling to occur.

Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Cc: Adaptec OEM Raid Solutions <aacraid@adaptec.com
Cc: linux-scsi@vger.kernel.org
UBUNTU: [Upstream] SCSI: AACRAID: Fix endian issues in core and SRC portions of driver

This may not fix all endian issues in this driver, but it does get the
driver working on PowerPC for a PMC SRC card. So it should at least fix
all the problems in the core and in the SRC support.

Signed-off-by: Ben Collins <bcollins@ubuntu.com>
Cc: Adaptec OEM Raid Solutions <aacraid@adaptec.com
Cc: linux-scsi@vger.kernel.org
UBUNTU: SAUCE: powerpc/pamu: Add driver to initialize PAMU tables

This patch is being maintained, and eventually merged upstream, by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Stuart Yoder <stuart.yoder@freescale.com>
Signed-off-by: Vakul Garg <Vakul@freescale.com>
Signed-off-by: Varun Sethi <Varun.Sethi@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: fsl_qbman: Add drivers for Freescale DPAA Qman & Bman

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Geoff Thorpe <Geoff.Thorpe@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com>
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: fsl_pme2: Add support for DPAA PME

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Geoff Thorpe <Geoff.Thorpe@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Jeffrey Ladouceur <Jeffrey.Ladouceur@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: fmd: FMD14 integration

FMD14 integration:
    - integration of NetCommSW GA 4.3 LLD
    - FMD wrapper cleanup
    - FMD dynamic resource allocation algorithm
    - Changes to support IXXAT IEEE 1588 stack v1.03
    - Support P3060 FMan

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Shlomi Gridish <gridish@freescale.com>
Signed-off-by: Timur Tabi <timur@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Signed-off-by: Ioana Radulescu <ruxandra.radulescu@freescale.com>
Signed-off-by: Sorin Pistirica <sorin.pistirica@freescale.com>
Signed-off-by: Bogdan Hamciuc <bogdan.hamciuc@freescale.com>
Signed-off-by: Stefan Szabo <stefan.szabo@freescale.com>
Signed-off-by: Haiying Wang <Haiying.Wang@freescale.com>
Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: net: Add support for handling queueing in hardware

The QDisc code does a bunch of locking which is unnecessary if
you have hardware which handles all of the queueing.  Add
support for this, and skip over all of the queueing code if
the feature is enabled on a given device. This code breaks
QDisc support on dpaa_eth, and also coopts the FCOE feature
bit.

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: net/flow: remove sleeping and deferral mechanism from flow_cache_flush

flow_cache_flush must not sleep as it can be called in atomic context;
removed the schedule_work as the deferred processing lead to the flow
cache gc never being actually run under heavy network load

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: Convert MDIO and PHY Lib drivers to support 10G

10G MDIO is a totally different protocol (clause 45 of 802.3).
Supporting this new protocol requires a couple of changes:

* Add a new parameter to the mdiobus_read functions to specify the
  "device address" inside the PHY.
* Add a phy45_read command which takes advantage of that new parameter
* Add a generic PHY driver for 10G PHYs
* Convert fsl_pq_mdio.c to the new API

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: of_mdio: Add of_phy_attach function

of_phy_connect is useful for most systems, but some drivers will want
finer-grained control over their PHYs, and won't want to use the
PHY Lib state machine or interrupt handlers.

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: phylib: Minimum hack to get the generic 10G PHY driver to work with 10G "fixed-link"s

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: Convert mii_bus users to new MDIO bus API

The MDIO bus API now takes an extra argument to support 10G.

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: fsl_pq_mdio: Add support for FMan

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: phy: Add support for VSC8234

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Andy Fleming <afleming@freescale.com>
Signed-off-by: Kumar Gala <kumar.gala@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: net/phy: avoid reaching an unsupported speed and duplex combination

- phy_force_reduction() may get the interface into a speed and duplex combination
 that is not supported by the device;
 - wait PHY_FORCE_TIMEOUT before each speed/duplex reduction in forced mode

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: net/phy: abort genphy_read_status when link changes during speed and duplex reading

If the link changes during speed and duplex reading the values may be out of sync;
abort the update if the link state changes during the read

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>
UBUNTU: SAUCE: net/phy: added autocross feature for forced links on VSC82x4

Added auto MDI/MDI-X capability for forced (autonegotiation disabled)
10/100 Mbps speeds on Vitesse VSC82x4 PHYs. Exported previously static
function genphy_setup_forced() required by the new config_aneg handler
in the Vitesse PHY module.

This patch is being maintained and will eventually be merged upstream by
Freescale directly. The powerpc-e500mc flavour uses this.

Signed-off-by: Madalin Bucur <madalin.bucur@freescale.com>
Signed-off-by: Ben Collins <bcollins@ubuntu.com>