--- /dev/null
+From 2ed99e39cb9392312c100d9da591c20641c64d12 Mon Sep 17 00:00:00 2001
+From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
+Date: Wed, 12 Mar 2014 21:49:33 +0100
+Subject: cpufreq: Skip current frequency initialization for ->setpolicy drivers
+
+From: "Rafael J. Wysocki" <rafael.j.wysocki@intel.com>
+
+commit 2ed99e39cb9392312c100d9da591c20641c64d12 upstream.
+
+After commit da60ce9f2fac (cpufreq: call cpufreq_driver->get() after
+calling ->init()) __cpufreq_add_dev() sometimes fails for CPUs handled
+by intel_pstate, because that driver may return 0 from its ->get()
+callback if it has not run long enough to collect enough samples on the
+given CPU. That didn't happen before commit da60ce9f2fac which added
+policy->cur initialization to __cpufreq_add_dev() to help reduce code
+duplication in other cpufreq drivers.
+
+However, the code added by commit da60ce9f2fac need not be executed
+for cpufreq drivers having the ->setpolicy callback defined, because
+the subsequent invocation of cpufreq_set_policy() will use that
+callback to initialize the policy anyway and it doesn't need
+policy->cur to be initialized upfront. The analogous code in
+cpufreq_update_policy() is also unnecessary for cpufreq drivers
+having ->setpolicy set and may be skipped for them as well.
+
+Since intel_pstate provides ->setpolicy, skipping the upfront
+policy->cur initialization for cpufreq drivers with that callback
+set will cover intel_pstate and the problem it's been having after
+commit da60ce9f2fac will be addressed.
+
+Fixes: da60ce9f2fac (cpufreq: call cpufreq_driver->get() after calling ->init())
+References: https://bugzilla.kernel.org/show_bug.cgi?id=71931
+Reported-and-tested-by: Patrik Lundquist <patrik.lundquist@gmail.com>
+Acked-by: Dirk Brandewie <dirk.j.brandewie@intel.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/cpufreq.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/cpufreq/cpufreq.c
++++ b/drivers/cpufreq/cpufreq.c
+@@ -1051,7 +1051,7 @@ static int __cpufreq_add_dev(struct devi
+ goto err_set_policy_cpu;
+ }
+
+- if (cpufreq_driver->get) {
++ if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
+ policy->cur = cpufreq_driver->get(policy->cpu);
+ if (!policy->cur) {
+ pr_err("%s: ->get() failed\n", __func__);
+@@ -2051,7 +2051,7 @@ int cpufreq_update_policy(unsigned int c
+ * BIOS might change freq behind our back
+ * -> ask driver for current freq and notify governors about a change
+ */
+- if (cpufreq_driver->get) {
++ if (cpufreq_driver->get && !cpufreq_driver->setpolicy) {
+ new_policy.cur = cpufreq_driver->get(cpu);
+ if (!policy->cur) {
+ pr_debug("Driver did not initialize current freq");
--- /dev/null
+From 999976e0f6233322a878b0b7148c810544d6c8a8 Mon Sep 17 00:00:00 2001
+From: Aaron Plattner <aplattner@nvidia.com>
+Date: Tue, 4 Mar 2014 12:42:15 -0800
+Subject: cpufreq: use cpufreq_cpu_get() to avoid cpufreq_get() race conditions
+
+From: Aaron Plattner <aplattner@nvidia.com>
+
+commit 999976e0f6233322a878b0b7148c810544d6c8a8 upstream.
+
+If a module calls cpufreq_get while cpufreq is initializing, it's
+possible for it to be called after cpufreq_driver is set but before
+cpufreq_cpu_data is written during subsys_interface_register. This
+happens because cpufreq_get doesn't take the cpufreq_driver_lock
+around its use of cpufreq_cpu_data.
+
+Fix this by using cpufreq_cpu_get(cpu) to look up the policy rather
+than reading it out of cpufreq_cpu_data directly. cpufreq_cpu_get()
+takes the appropriate locks to prevent this race from happening.
+
+Since it's possible for policy to be NULL if the caller passes in an
+invalid CPU number or calls the function before cpufreq is initialized,
+delete the BUG_ON(!policy) and simply return 0. Don't try to return
+-ENOENT because that's negative and the function returns an unsigned
+integer.
+
+References: https://bbs.archlinux.org/viewtopic.php?id=177934
+Signed-off-by: Aaron Plattner <aplattner@nvidia.com>
+Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/cpufreq/cpufreq.c | 21 +++++++--------------
+ 1 file changed, 7 insertions(+), 14 deletions(-)
+
+--- a/drivers/cpufreq/cpufreq.c
++++ b/drivers/cpufreq/cpufreq.c
+@@ -1447,23 +1447,16 @@ static unsigned int __cpufreq_get(unsign
+ */
+ unsigned int cpufreq_get(unsigned int cpu)
+ {
+- struct cpufreq_policy *policy = per_cpu(cpufreq_cpu_data, cpu);
++ struct cpufreq_policy *policy = cpufreq_cpu_get(cpu);
+ unsigned int ret_freq = 0;
+
+- if (cpufreq_disabled() || !cpufreq_driver)
+- return -ENOENT;
++ if (policy) {
++ down_read(&policy->rwsem);
++ ret_freq = __cpufreq_get(cpu);
++ up_read(&policy->rwsem);
+
+- BUG_ON(!policy);
+-
+- if (!down_read_trylock(&cpufreq_rwsem))
+- return 0;
+-
+- down_read(&policy->rwsem);
+-
+- ret_freq = __cpufreq_get(cpu);
+-
+- up_read(&policy->rwsem);
+- up_read(&cpufreq_rwsem);
++ cpufreq_cpu_put(policy);
++ }
+
+ return ret_freq;
+ }
--- /dev/null
+From b28a613e9138e4b3a64649bd60b13436f4b4b49b Mon Sep 17 00:00:00 2001
+From: Michele Baldessari <michele@acksyn.org>
+Date: Fri, 7 Mar 2014 16:34:29 +0000
+Subject: libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk for Seagate Momentus SpinPoint M8 (2BA30001)
+
+From: Michele Baldessari <michele@acksyn.org>
+
+commit b28a613e9138e4b3a64649bd60b13436f4b4b49b upstream.
+
+Via commit 87809942d3fa "libata: add ATA_HORKAGE_BROKEN_FPDMA_AA quirk
+for Seagate Momentus SpinPoint M8" we added a quirk for disks named
+"ST1000LM024 HN-M101MBB" with firmware revision "2AR10001".
+
+As reported on https://bugzilla.redhat.com/show_bug.cgi?id=1073901,
+we need to also add firmware revision 2BA30001 as it is broken as well.
+
+Reported-by: Nicholas <arealityfarbetween@googlemail.com>
+Signed-off-by: Michele Baldessari <michele@acksyn.org>
+Tested-by: Guilherme Amadio <guilherme.amadio@gmail.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/ata/libata-core.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -4175,6 +4175,7 @@ static const struct ata_blacklist_entry
+
+ /* Seagate Momentus SpinPoint M8 seem to have FPMDA_AA issues */
+ { "ST1000LM024 HN-M101MBB", "2AR10001", ATA_HORKAGE_BROKEN_FPDMA_AA },
++ { "ST1000LM024 HN-M101MBB", "2BA30001", ATA_HORKAGE_BROKEN_FPDMA_AA },
+
+ /* Blacklist entries taken from Silicon Image 3124/3132
+ Windows driver .inf file - also several Linux problem reports */
--- /dev/null
+From 2564338b13e6e132ee224edb63e1e872adf431f4 Mon Sep 17 00:00:00 2001
+From: Marios Andreopoulos <opensource@andmarios.com>
+Date: Mon, 3 Mar 2014 18:19:59 +0200
+Subject: libata: disable queued TRIM for Crucial M500 mSATA SSDs
+
+From: Marios Andreopoulos <opensource@andmarios.com>
+
+commit 2564338b13e6e132ee224edb63e1e872adf431f4 upstream.
+
+Queued TRIM commands cause problems and silent file system corruption
+on Crucial M500 SSDs. This patch disables them for the mSATA model of
+the drive.
+
+Signed-off-by: Marios Andreopoulos <opensource@andmarios.com>
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=71371
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/ata/libata-core.c | 1 +
+ 1 file changed, 1 insertion(+)
+
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -4225,6 +4225,7 @@ static const struct ata_blacklist_entry
+ /* devices that don't properly handle queued TRIM commands */
+ { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
+ { "Crucial_CT???M500SSD1", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
++ { "Crucial_CT???M500SSD3", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
+
+ /*
+ * Some WD SATA-I drives spin up and down erratically when the link
--- /dev/null
+From 83493d7e782d2630f1a55def14a79f0e7c4faac3 Mon Sep 17 00:00:00 2001
+From: Tejun Heo <tj@kernel.org>
+Date: Mon, 10 Mar 2014 11:13:43 -0400
+Subject: libata: use wider match for blacklisting Crucial M500
+
+From: Tejun Heo <tj@kernel.org>
+
+commit 83493d7e782d2630f1a55def14a79f0e7c4faac3 upstream.
+
+We're now blacklisting "Crucial_CT???M500SSD1" and
+"Crucial_CT???M500SSD3". Also, "Micron_M500*" is blacklisted which is
+about the same devices as the crucial branded ones. Let's merge the
+two Crucial M500 entries and widen the match to
+"Crucial_CT???M500SSD*" so that we don't have to fiddle with new
+entries for similar devices.
+
+Signed-off-by: Tejun Heo <tj@kernel.org>
+Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/ata/libata-core.c | 3 +--
+ 1 file changed, 1 insertion(+), 2 deletions(-)
+
+--- a/drivers/ata/libata-core.c
++++ b/drivers/ata/libata-core.c
+@@ -4225,8 +4225,7 @@ static const struct ata_blacklist_entry
+
+ /* devices that don't properly handle queued TRIM commands */
+ { "Micron_M500*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
+- { "Crucial_CT???M500SSD1", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
+- { "Crucial_CT???M500SSD3", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
++ { "Crucial_CT???M500SSD*", NULL, ATA_HORKAGE_NO_NCQ_TRIM, },
+
+ /*
+ * Some WD SATA-I drives spin up and down erratically when the link
--- /dev/null
+From 755a48a7a4eb05b9c8424e3017d947b2961a60e0 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <trond.myklebust@primarydata.com>
+Date: Sun, 2 Mar 2014 22:03:12 -0500
+Subject: NFS: Fix a delegation callback race
+
+From: Trond Myklebust <trond.myklebust@primarydata.com>
+
+commit 755a48a7a4eb05b9c8424e3017d947b2961a60e0 upstream.
+
+The clean-up in commit 36281caa839f ended up removing a NULL pointer check
+that is needed in order to prevent an Oops in
+nfs_async_inode_return_delegation().
+
+Reported-by: "Yan, Zheng" <zheng.z.yan@intel.com>
+Link: http://lkml.kernel.org/r/5313E9F6.2020405@intel.com
+Fixes: 36281caa839f (NFSv4: Further clean-ups of delegation stateid validation)
+Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/delegation.c | 11 +++++++----
+ 1 file changed, 7 insertions(+), 4 deletions(-)
+
+--- a/fs/nfs/delegation.c
++++ b/fs/nfs/delegation.c
+@@ -659,16 +659,19 @@ int nfs_async_inode_return_delegation(st
+
+ rcu_read_lock();
+ delegation = rcu_dereference(NFS_I(inode)->delegation);
++ if (delegation == NULL)
++ goto out_enoent;
+
+- if (!clp->cl_mvops->match_stateid(&delegation->stateid, stateid)) {
+- rcu_read_unlock();
+- return -ENOENT;
+- }
++ if (!clp->cl_mvops->match_stateid(&delegation->stateid, stateid))
++ goto out_enoent;
+ nfs_mark_return_delegation(server, delegation);
+ rcu_read_unlock();
+
+ nfs_delegation_run_state_manager(clp);
+ return 0;
++out_enoent:
++ rcu_read_unlock();
++ return -ENOENT;
+ }
+
+ static struct inode *
--- /dev/null
+From b7e63a1079b266866a732cf699d8c4d61391bbda Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <trond.myklebust@primarydata.com>
+Date: Wed, 26 Feb 2014 11:19:14 -0800
+Subject: NFSv4: Fix another nfs4_sequence corruptor
+
+From: Trond Myklebust <trond.myklebust@primarydata.com>
+
+commit b7e63a1079b266866a732cf699d8c4d61391bbda upstream.
+
+nfs4_release_lockowner needs to set the rpc_message reply to point to
+the nfs4_sequence_res in order to avoid another Oopsable situation
+in nfs41_assign_slot.
+
+Fixes: fbd4bfd1d9d21 (NFS: Add nfs4_sequence calls for RELEASE_LOCKOWNER)
+Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/nfs4proc.c | 10 +++++-----
+ include/linux/nfs_xdr.h | 5 +++++
+ 2 files changed, 10 insertions(+), 5 deletions(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -5831,8 +5831,7 @@ struct nfs_release_lockowner_data {
+ struct nfs4_lock_state *lsp;
+ struct nfs_server *server;
+ struct nfs_release_lockowner_args args;
+- struct nfs4_sequence_args seq_args;
+- struct nfs4_sequence_res seq_res;
++ struct nfs_release_lockowner_res res;
+ unsigned long timestamp;
+ };
+
+@@ -5840,7 +5839,7 @@ static void nfs4_release_lockowner_prepa
+ {
+ struct nfs_release_lockowner_data *data = calldata;
+ nfs40_setup_sequence(data->server,
+- &data->seq_args, &data->seq_res, task);
++ &data->args.seq_args, &data->res.seq_res, task);
+ data->timestamp = jiffies;
+ }
+
+@@ -5849,7 +5848,7 @@ static void nfs4_release_lockowner_done(
+ struct nfs_release_lockowner_data *data = calldata;
+ struct nfs_server *server = data->server;
+
+- nfs40_sequence_done(task, &data->seq_res);
++ nfs40_sequence_done(task, &data->res.seq_res);
+
+ switch (task->tk_status) {
+ case 0:
+@@ -5890,7 +5889,6 @@ static int nfs4_release_lockowner(struct
+ data = kmalloc(sizeof(*data), GFP_NOFS);
+ if (!data)
+ return -ENOMEM;
+- nfs4_init_sequence(&data->seq_args, &data->seq_res, 0);
+ data->lsp = lsp;
+ data->server = server;
+ data->args.lock_owner.clientid = server->nfs_client->cl_clientid;
+@@ -5898,6 +5896,8 @@ static int nfs4_release_lockowner(struct
+ data->args.lock_owner.s_dev = server->s_dev;
+
+ msg.rpc_argp = &data->args;
++ msg.rpc_resp = &data->res;
++ nfs4_init_sequence(&data->args.seq_args, &data->res.seq_res, 0);
+ rpc_call_async(server->client, &msg, 0, &nfs4_release_lockowner_ops, data);
+ return 0;
+ }
+--- a/include/linux/nfs_xdr.h
++++ b/include/linux/nfs_xdr.h
+@@ -467,9 +467,14 @@ struct nfs_lockt_res {
+ };
+
+ struct nfs_release_lockowner_args {
++ struct nfs4_sequence_args seq_args;
+ struct nfs_lowner lock_owner;
+ };
+
++struct nfs_release_lockowner_res {
++ struct nfs4_sequence_res seq_res;
++};
++
+ struct nfs4_delegreturnargs {
+ struct nfs4_sequence_args seq_args;
+ const struct nfs_fh *fhandle;
--- /dev/null
+From e1253be0ece1a95a02c7f5843194877471af8179 Mon Sep 17 00:00:00 2001
+From: Trond Myklebust <trond.myklebust@primarydata.com>
+Date: Wed, 5 Mar 2014 08:44:23 -0500
+Subject: NFSv4: nfs4_stateid_is_current should return 'true' for an invalid stateid
+
+From: Trond Myklebust <trond.myklebust@primarydata.com>
+
+commit e1253be0ece1a95a02c7f5843194877471af8179 upstream.
+
+When nfs4_set_rw_stateid() can fails by returning EIO to indicate that
+the stateid is completely invalid, then it makes no sense to have it
+trigger a retry of the READ or WRITE operation. Instead, we should just
+have it fall through and attempt a recovery.
+
+This fixes an infinite loop in which the client keeps replaying the same
+bad stateid back to the server.
+
+Reported-by: Andy Adamson <andros@netapp.com>
+Link: http://lkml.kernel.org/r/1393954269-3974-1-git-send-email-andros@netapp.com
+Signed-off-by: Trond Myklebust <trond.myklebust@primarydata.com>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ fs/nfs/nfs4proc.c | 5 +++--
+ 1 file changed, 3 insertions(+), 2 deletions(-)
+
+--- a/fs/nfs/nfs4proc.c
++++ b/fs/nfs/nfs4proc.c
+@@ -4012,8 +4012,9 @@ static bool nfs4_stateid_is_current(nfs4
+ {
+ nfs4_stateid current_stateid;
+
+- if (nfs4_set_rw_stateid(¤t_stateid, ctx, l_ctx, fmode))
+- return false;
++ /* If the current stateid represents a lost lock, then exit */
++ if (nfs4_set_rw_stateid(¤t_stateid, ctx, l_ctx, fmode) == -EIO)
++ return true;
+ return nfs4_stateid_match(stateid, ¤t_stateid);
+ }
+
firewire-net-fix-use-after-free.patch
firewire-ohci-fix-probe-failure-with-agere-lsi-controllers.patch
firewire-don-t-use-prepare_delayed_work.patch
+libata-disable-queued-trim-for-crucial-m500-msata-ssds.patch
+libata-add-ata_horkage_broken_fpdma_aa-quirk-for-seagate-momentus-spinpoint-m8-2ba30001.patch
+libata-use-wider-match-for-blacklisting-crucial-m500.patch
+spi-coldfire-qspi-fix-getting-correct-address-for-mcfqspi.patch
+spi-fsl-dspi-fix-getting-correct-address-for-master.patch
+spi-spi-imx-spi_imx_remove-do-not-disable-disabled-clocks.patch
+spi-spi-ath79-fix-initial-gpio-cs-line-setup.patch
+nfsv4-fix-another-nfs4_sequence-corruptor.patch
+nfs-fix-a-delegation-callback-race.patch
+nfsv4-nfs4_stateid_is_current-should-return-true-for-an-invalid-stateid.patch
+cpufreq-use-cpufreq_cpu_get-to-avoid-cpufreq_get-race-conditions.patch
+cpufreq-skip-current-frequency-initialization-for-setpolicy-drivers.patch
--- /dev/null
+From ee73b4c6e3fc0755a91752ab8eebc8e070038b53 Mon Sep 17 00:00:00 2001
+From: Axel Lin <axel.lin@ingics.com>
+Date: Fri, 14 Feb 2014 09:53:00 +0800
+Subject: spi: coldfire-qspi: Fix getting correct address for *mcfqspi
+
+From: Axel Lin <axel.lin@ingics.com>
+
+commit ee73b4c6e3fc0755a91752ab8eebc8e070038b53 upstream.
+
+dev_get_drvdata() returns the address of master rather than mcfqspi.
+
+Fixes: af361079 (spi/coldfire-qspi: Drop extra calls to spi_master_get in suspend/resume functions)
+Signed-off-by: Axel Lin <axel.lin@ingics.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/spi/spi-coldfire-qspi.c | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+--- a/drivers/spi/spi-coldfire-qspi.c
++++ b/drivers/spi/spi-coldfire-qspi.c
+@@ -539,7 +539,8 @@ static int mcfqspi_resume(struct device
+ #ifdef CONFIG_PM_RUNTIME
+ static int mcfqspi_runtime_suspend(struct device *dev)
+ {
+- struct mcfqspi *mcfqspi = dev_get_drvdata(dev);
++ struct spi_master *master = dev_get_drvdata(dev);
++ struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
+
+ clk_disable(mcfqspi->clk);
+
+@@ -548,7 +549,8 @@ static int mcfqspi_runtime_suspend(struc
+
+ static int mcfqspi_runtime_resume(struct device *dev)
+ {
+- struct mcfqspi *mcfqspi = dev_get_drvdata(dev);
++ struct spi_master *master = dev_get_drvdata(dev);
++ struct mcfqspi *mcfqspi = spi_master_get_devdata(master);
+
+ clk_enable(mcfqspi->clk);
+
--- /dev/null
+From 017145fef567430789e40f6a22a90ce2a766370b Mon Sep 17 00:00:00 2001
+From: Axel Lin <axel.lin@ingics.com>
+Date: Fri, 14 Feb 2014 12:49:12 +0800
+Subject: spi: fsl-dspi: Fix getting correct address for master
+
+From: Axel Lin <axel.lin@ingics.com>
+
+commit 017145fef567430789e40f6a22a90ce2a766370b upstream.
+
+Current code set platform drvdata to dspi. However, the code in dspi_suspend()
+and dspi_resume() assumes the drvdata is the address of master.
+Fix it by setting platform drvdata to master.
+
+Signed-off-by: Axel Lin <axel.lin@ingics.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/spi/spi-fsl-dspi.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/drivers/spi/spi-fsl-dspi.c
++++ b/drivers/spi/spi-fsl-dspi.c
+@@ -421,7 +421,6 @@ static int dspi_suspend(struct device *d
+
+ static int dspi_resume(struct device *dev)
+ {
+-
+ struct spi_master *master = dev_get_drvdata(dev);
+ struct fsl_dspi *dspi = spi_master_get_devdata(master);
+
+@@ -505,7 +504,7 @@ static int dspi_probe(struct platform_de
+ clk_prepare_enable(dspi->clk);
+
+ init_waitqueue_head(&dspi->waitq);
+- platform_set_drvdata(pdev, dspi);
++ platform_set_drvdata(pdev, master);
+
+ ret = spi_bitbang_start(&dspi->bitbang);
+ if (ret != 0) {
+@@ -526,7 +525,8 @@ out_master_put:
+
+ static int dspi_remove(struct platform_device *pdev)
+ {
+- struct fsl_dspi *dspi = platform_get_drvdata(pdev);
++ struct spi_master *master = platform_get_drvdata(pdev);
++ struct fsl_dspi *dspi = spi_master_get_devdata(master);
+
+ /* Disconnect from the SPI framework */
+ spi_bitbang_stop(&dspi->bitbang);
--- /dev/null
+From 61d1cf163c8653934cc8cd5d0b2a562d0990c265 Mon Sep 17 00:00:00 2001
+From: Gabor Juhos <juhosg@openwrt.org>
+Date: Sun, 2 Mar 2014 20:54:42 +0100
+Subject: spi: spi-ath79: fix initial GPIO CS line setup
+
+From: Gabor Juhos <juhosg@openwrt.org>
+
+commit 61d1cf163c8653934cc8cd5d0b2a562d0990c265 upstream.
+
+The 'ath79_spi_setup_cs' function initializes the chip
+select line of a given SPI device in order to make sure
+that the device is inactive.
+
+If the SPI_CS_HIGH bit is set for a given device, it
+means that the CS line of that device is active HIGH
+so it must be set to LOW initially. In case of GPIO
+CS lines, the 'ath79_spi_setup_cs' function does the
+opposite of that due to the wrong GPIO flags.
+
+Fix the code to use the correct GPIO flags.
+
+Reported-by: Ronald Wahl <ronald.wahl@raritan.com>
+Signed-off-by: Gabor Juhos <juhosg@openwrt.org>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/spi/spi-ath79.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/spi/spi-ath79.c
++++ b/drivers/spi/spi-ath79.c
+@@ -132,9 +132,9 @@ static int ath79_spi_setup_cs(struct spi
+
+ flags = GPIOF_DIR_OUT;
+ if (spi->mode & SPI_CS_HIGH)
+- flags |= GPIOF_INIT_HIGH;
+- else
+ flags |= GPIOF_INIT_LOW;
++ else
++ flags |= GPIOF_INIT_HIGH;
+
+ status = gpio_request_one(cdata->gpio, flags,
+ dev_name(&spi->dev));
--- /dev/null
+From fd40dccb1a170ba689664481a3de83617b7194d2 Mon Sep 17 00:00:00 2001
+From: Philippe De Muyter <phdm@macqel.be>
+Date: Thu, 27 Feb 2014 10:16:15 +0100
+Subject: spi: spi-imx: spi_imx_remove: do not disable disabled clocks
+
+From: Philippe De Muyter <phdm@macqel.be>
+
+commit fd40dccb1a170ba689664481a3de83617b7194d2 upstream.
+
+Currently, at module removal, one gets the following warnings:
+------------[ cut here ]------------
+WARNING: at drivers/clk/clk.c:780 clk_disable+0x18/0x24()
+Modules linked in: spi_imx(-) [last unloaded: ev76c560]
+CPU: 1 PID: 16337 Comm: rmmod Tainted: G W 3.10.17-80548-g90191eb-dirty #33
+[<80013b4c>] (unwind_backtrace+0x0/0xf8) from [<800115dc>] (show_stack+0x10/0x14)
+[<800115dc>] (show_stack+0x10/0x14) from [<800257b8>] (warn_slowpath_common+0x4c/0x68)
+[<800257b8>] (warn_slowpath_common+0x4c/0x68) from [<800257f0>] (warn_slowpath_null+0x1c/0x24)
+[<800257f0>] (warn_slowpath_null+0x1c/0x24) from [<803f60ec>] (clk_disable+0x18/0x24)
+[<803f60ec>] (clk_disable+0x18/0x24) from [<7f02c9cc>] (spi_imx_remove+0x54/0x9c [spi_imx])
+[<7f02c9cc>] (spi_imx_remove+0x54/0x9c [spi_imx]) from [<8025868c>] (platform_drv_remove+0x18/0x1c)
+[<8025868c>] (platform_drv_remove+0x18/0x1c) from [<80256f60>] (__device_release_driver+0x70/0xcc)
+[<80256f60>] (__device_release_driver+0x70/0xcc) from [<80257770>] (driver_detach+0xcc/0xd0)
+[<80257770>] (driver_detach+0xcc/0xd0) from [<80256d90>] (bus_remove_driver+0x7c/0xc0)
+[<80256d90>] (bus_remove_driver+0x7c/0xc0) from [<80068668>] (SyS_delete_module+0x144/0x1f8)
+[<80068668>] (SyS_delete_module+0x144/0x1f8) from [<8000e080>] (ret_fast_syscall+0x0/0x30)
+---[ end trace 1f5df9ad54996300 ]---
+------------[ cut here ]------------
+WARNING: at drivers/clk/clk.c:780 clk_disable+0x18/0x24()
+Modules linked in: spi_imx(-) [last unloaded: ev76c560]
+CPU: 1 PID: 16337 Comm: rmmod Tainted: G W 3.10.17-80548-g90191eb-dirty #33
+[<80013b4c>] (unwind_backtrace+0x0/0xf8) from [<800115dc>] (show_stack+0x10/0x14)
+[<800115dc>] (show_stack+0x10/0x14) from [<800257b8>] (warn_slowpath_common+0x4c/0x68)
+[<800257b8>] (warn_slowpath_common+0x4c/0x68) from [<800257f0>] (warn_slowpath_null+0x1c/0x24)
+[<800257f0>] (warn_slowpath_null+0x1c/0x24) from [<803f60ec>] (clk_disable+0x18/0x24)
+[<803f60ec>] (clk_disable+0x18/0x24) from [<7f02c9e8>] (spi_imx_remove+0x70/0x9c [spi_imx])
+[<7f02c9e8>] (spi_imx_remove+0x70/0x9c [spi_imx]) from [<8025868c>] (platform_drv_remove+0x18/0x1c)
+[<8025868c>] (platform_drv_remove+0x18/0x1c) from [<80256f60>] (__device_release_driver+0x70/0xcc)
+[<80256f60>] (__device_release_driver+0x70/0xcc) from [<80257770>] (driver_detach+0xcc/0xd0)
+[<80257770>] (driver_detach+0xcc/0xd0) from [<80256d90>] (bus_remove_driver+0x7c/0xc0)
+[<80256d90>] (bus_remove_driver+0x7c/0xc0) from [<80068668>] (SyS_delete_module+0x144/0x1f8)
+[<80068668>] (SyS_delete_module+0x144/0x1f8) from [<8000e080>] (ret_fast_syscall+0x0/0x30)
+---[ end trace 1f5df9ad54996301 ]---
+
+Since commit 9e556dcc55774c9a1032f32baa0e5cfafede8b70, "spi: spi-imx: only
+enable the clocks when we start to transfer a message", clocks are always
+disabled except when transmitting messages. There is thus no need to
+disable them at module removal.
+
+Fixes: 9e556dcc55774 (spi: spi-imx: only enable the clocks when we start to transfer a message)
+Signed-off-by: Philippe De Muyter <phdm@macqel.be>
+Acked-by: Huang Shijie <b32955@freescale.com>
+Signed-off-by: Mark Brown <broonie@linaro.org>
+Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
+
+---
+ drivers/spi/spi-imx.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+--- a/drivers/spi/spi-imx.c
++++ b/drivers/spi/spi-imx.c
+@@ -925,8 +925,8 @@ static int spi_imx_remove(struct platfor
+ spi_bitbang_stop(&spi_imx->bitbang);
+
+ writel(0, spi_imx->base + MXC_CSPICTRL);
+- clk_disable_unprepare(spi_imx->clk_ipg);
+- clk_disable_unprepare(spi_imx->clk_per);
++ clk_unprepare(spi_imx->clk_ipg);
++ clk_unprepare(spi_imx->clk_per);
+ spi_master_put(master);
+
+ return 0;