From 2e3a0bf1d8e4137126aa19e61a480ff4e95f6518 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Fri, 3 Oct 2014 10:06:43 -0700 Subject: [PATCH] 3.10-stable patches added patches: asoc-davinci-mcasp-correct-rx-format-unit-configuration.patch cifs-fix-directory-rename-error.patch cifs-fix-smb2-readdir-error-handling.patch iio-adc-ad_sigma_delta-fix-indio_dev-trig-assignment.patch iio-gyro-itg3200-fix-indio_dev-trig-assignment.patch iio-inkern-fix-overwritten-eprobe_defer-in-of_iio_channel_get_by_name.patch iio-inv_mpu6050-fix-indio_dev-trig-assignment.patch iio-magnetometer-bugfix-magnetometers-gain-values.patch iio-meter-ade7758-fix-indio_dev-trig-assignment.patch iio-st_sensors-fix-indio_dev-trig-assignment.patch iio-trigger-modify-return-value-for-iio_trigger_get.patch --- ...correct-rx-format-unit-configuration.patch | 49 ++++++ .../cifs-fix-directory-rename-error.patch | 45 +++++ ...cifs-fix-smb2-readdir-error-handling.patch | 157 ++++++++++++++++++ ..._delta-fix-indio_dev-trig-assignment.patch | 34 ++++ ...tg3200-fix-indio_dev-trig-assignment.patch | 33 ++++ ..._defer-in-of_iio_channel_get_by_name.patch | 34 ++++ ...pu6050-fix-indio_dev-trig-assignment.patch | 33 ++++ ...ter-bugfix-magnetometers-gain-values.patch | 102 ++++++++++++ ...de7758-fix-indio_dev-trig-assignment.patch | 34 ++++ ...ensors-fix-indio_dev-trig-assignment.patch | 33 ++++ ...ify-return-value-for-iio_trigger_get.patch | 38 +++++ queue-3.10/series | 11 ++ 12 files changed, 603 insertions(+) create mode 100644 queue-3.10/asoc-davinci-mcasp-correct-rx-format-unit-configuration.patch create mode 100644 queue-3.10/cifs-fix-directory-rename-error.patch create mode 100644 queue-3.10/cifs-fix-smb2-readdir-error-handling.patch create mode 100644 queue-3.10/iio-adc-ad_sigma_delta-fix-indio_dev-trig-assignment.patch create mode 100644 queue-3.10/iio-gyro-itg3200-fix-indio_dev-trig-assignment.patch create mode 100644 queue-3.10/iio-inkern-fix-overwritten-eprobe_defer-in-of_iio_channel_get_by_name.patch create mode 100644 queue-3.10/iio-inv_mpu6050-fix-indio_dev-trig-assignment.patch create mode 100644 queue-3.10/iio-magnetometer-bugfix-magnetometers-gain-values.patch create mode 100644 queue-3.10/iio-meter-ade7758-fix-indio_dev-trig-assignment.patch create mode 100644 queue-3.10/iio-st_sensors-fix-indio_dev-trig-assignment.patch create mode 100644 queue-3.10/iio-trigger-modify-return-value-for-iio_trigger_get.patch diff --git a/queue-3.10/asoc-davinci-mcasp-correct-rx-format-unit-configuration.patch b/queue-3.10/asoc-davinci-mcasp-correct-rx-format-unit-configuration.patch new file mode 100644 index 00000000000..a1cc82bbedd --- /dev/null +++ b/queue-3.10/asoc-davinci-mcasp-correct-rx-format-unit-configuration.patch @@ -0,0 +1,49 @@ +From fe0a29e163a5d045c73faab682a8dac71c2f8012 Mon Sep 17 00:00:00 2001 +From: Peter Ujfalusi +Date: Thu, 4 Sep 2014 10:52:53 +0300 +Subject: ASoC: davinci-mcasp: Correct rx format unit configuration + +From: Peter Ujfalusi + +commit fe0a29e163a5d045c73faab682a8dac71c2f8012 upstream. + +In case of capture we should not use rotation. The reverse and mask is +enough to get the data align correctly from the bus to MCU: +Format data from bus after reverse (XRBUF) +S16_LE: |LSB|MSB|xxx|xxx| |xxx|xxx|MSB|LSB| +S24_3LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| +S24_LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| +S32_LE: |LSB|DAT|DAT|MSB| |MSB|DAT|DAT|LSB| + +With this patch all supported formats will work for playback and capture. + +Reported-by: Jyri Sarha (broken S24_3LE capture) +Signed-off-by: Peter Ujfalusi +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + sound/soc/davinci/davinci-mcasp.c | 11 ++++++++++- + 1 file changed, 10 insertions(+), 1 deletion(-) + +--- a/sound/soc/davinci/davinci-mcasp.c ++++ b/sound/soc/davinci/davinci-mcasp.c +@@ -632,8 +632,17 @@ static int davinci_config_channel_size(s + { + u32 fmt; + u32 tx_rotate = (word_length / 4) & 0x7; +- u32 rx_rotate = (32 - word_length) / 4; + u32 mask = (1ULL << word_length) - 1; ++ /* ++ * For captured data we should not rotate, inversion and masking is ++ * enoguh to get the data to the right position: ++ * Format data from bus after reverse (XRBUF) ++ * S16_LE: |LSB|MSB|xxx|xxx| |xxx|xxx|MSB|LSB| ++ * S24_3LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| ++ * S24_LE: |LSB|DAT|MSB|xxx| |xxx|MSB|DAT|LSB| ++ * S32_LE: |LSB|DAT|DAT|MSB| |MSB|DAT|DAT|LSB| ++ */ ++ u32 rx_rotate = 0; + + /* + * if s BCLK-to-LRCLK ratio has been configured via the set_clkdiv() diff --git a/queue-3.10/cifs-fix-directory-rename-error.patch b/queue-3.10/cifs-fix-directory-rename-error.patch new file mode 100644 index 00000000000..e25efdca775 --- /dev/null +++ b/queue-3.10/cifs-fix-directory-rename-error.patch @@ -0,0 +1,45 @@ +From a07d322059db66b84c9eb4f98959df468e88b34b Mon Sep 17 00:00:00 2001 +From: Pavel Shilovsky +Date: Fri, 22 Aug 2014 13:32:09 +0400 +Subject: CIFS: Fix directory rename error + +From: Pavel Shilovsky + +commit a07d322059db66b84c9eb4f98959df468e88b34b upstream. + +CIFS servers process nlink counts differently for files and directories. +In cifs_rename() if we the request fails on the existing target, we +try to remove it through cifs_unlink() but this is not what we want +to do for directories. As the result the following sequence of commands + +mkdir {1,2}; mv -T 1 2; rmdir {1,2}; mkdir {1,2}; echo foo > 2/bar + +and XFS test generic/023 fail with -ENOENT error. That's why the second +mkdir reuses the existing inode (target inode of the mv -T command) with +S_DEAD flag. + +Fix this by checking whether the target is directory or not and +calling cifs_rmdir() rather than cifs_unlink() for directories. + +Signed-off-by: Pavel Shilovsky +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/inode.c | 5 ++++- + 1 file changed, 4 insertions(+), 1 deletion(-) + +--- a/fs/cifs/inode.c ++++ b/fs/cifs/inode.c +@@ -1640,7 +1640,10 @@ cifs_rename(struct inode *source_dir, st + unlink_target: + /* Try unlinking the target dentry if it's not negative */ + if (target_dentry->d_inode && (rc == -EACCES || rc == -EEXIST)) { +- tmprc = cifs_unlink(target_dir, target_dentry); ++ if (S_ISDIR(target_dentry->d_inode->i_mode)) ++ tmprc = cifs_rmdir(target_dir, target_dentry); ++ else ++ tmprc = cifs_unlink(target_dir, target_dentry); + if (tmprc) + goto cifs_rename_exit; + rc = cifs_do_rename(xid, source_dentry, from_name, diff --git a/queue-3.10/cifs-fix-smb2-readdir-error-handling.patch b/queue-3.10/cifs-fix-smb2-readdir-error-handling.patch new file mode 100644 index 00000000000..5f4d5e0a29d --- /dev/null +++ b/queue-3.10/cifs-fix-smb2-readdir-error-handling.patch @@ -0,0 +1,157 @@ +From 52755808d4525f4d5b86d112d36ffc7a46f3fb48 Mon Sep 17 00:00:00 2001 +From: Pavel Shilovsky +Date: Mon, 18 Aug 2014 20:49:57 +0400 +Subject: CIFS: Fix SMB2 readdir error handling + +From: Pavel Shilovsky + +commit 52755808d4525f4d5b86d112d36ffc7a46f3fb48 upstream. + +SMB2 servers indicates the end of a directory search with +STATUS_NO_MORE_FILE error code that is not processed now. +This causes generic/257 xfstest to fail. Fix this by triggering +the end of search by this error code in SMB2_query_directory. + +Also when negotiating CIFS protocol we tell the server to close +the search automatically at the end and there is no need to do +it itself. In the case of SMB2 protocol, we need to close it +explicitly - separate close directory checks for different +protocols. + +Signed-off-by: Pavel Shilovsky +Signed-off-by: Steve French +Signed-off-by: Greg Kroah-Hartman + +--- + fs/cifs/cifsglob.h | 2 ++ + fs/cifs/file.c | 2 +- + fs/cifs/readdir.c | 2 +- + fs/cifs/smb1ops.c | 7 +++++++ + fs/cifs/smb2maperror.c | 2 +- + fs/cifs/smb2ops.c | 8 ++++++++ + fs/cifs/smb2pdu.c | 9 ++++----- + 7 files changed, 24 insertions(+), 8 deletions(-) + +--- a/fs/cifs/cifsglob.h ++++ b/fs/cifs/cifsglob.h +@@ -375,6 +375,8 @@ struct smb_version_operations { + const char *, u32 *); + int (*set_acl)(struct cifs_ntsd *, __u32, struct inode *, const char *, + int); ++ /* check if we need to issue closedir */ ++ bool (*dir_needs_close)(struct cifsFileInfo *); + }; + + struct smb_version_values { +--- a/fs/cifs/file.c ++++ b/fs/cifs/file.c +@@ -735,7 +735,7 @@ int cifs_closedir(struct inode *inode, s + + cifs_dbg(FYI, "Freeing private data in close dir\n"); + spin_lock(&cifs_file_list_lock); +- if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) { ++ if (server->ops->dir_needs_close(cfile)) { + cfile->invalidHandle = true; + spin_unlock(&cifs_file_list_lock); + if (server->ops->close_dir) +--- a/fs/cifs/readdir.c ++++ b/fs/cifs/readdir.c +@@ -582,7 +582,7 @@ find_cifs_entry(const unsigned int xid, + /* close and restart search */ + cifs_dbg(FYI, "search backing up - close and restart search\n"); + spin_lock(&cifs_file_list_lock); +- if (!cfile->srch_inf.endOfSearch && !cfile->invalidHandle) { ++ if (server->ops->dir_needs_close(cfile)) { + cfile->invalidHandle = true; + spin_unlock(&cifs_file_list_lock); + if (server->ops->close_dir) +--- a/fs/cifs/smb1ops.c ++++ b/fs/cifs/smb1ops.c +@@ -885,6 +885,12 @@ cifs_mand_lock(const unsigned int xid, s + (__u8)type, wait, 0); + } + ++static bool ++cifs_dir_needs_close(struct cifsFileInfo *cfile) ++{ ++ return !cfile->srch_inf.endOfSearch && !cfile->invalidHandle; ++} ++ + struct smb_version_operations smb1_operations = { + .send_cancel = send_nt_cancel, + .compare_fids = cifs_compare_fids, +@@ -948,6 +954,7 @@ struct smb_version_operations smb1_opera + .mand_lock = cifs_mand_lock, + .mand_unlock_range = cifs_unlock_range, + .push_mand_locks = cifs_push_mandatory_locks, ++ .dir_needs_close = cifs_dir_needs_close, + #ifdef CONFIG_CIFS_XATTR + .query_all_EAs = CIFSSMBQAllEAs, + .set_EA = CIFSSMBSetEA, +--- a/fs/cifs/smb2maperror.c ++++ b/fs/cifs/smb2maperror.c +@@ -214,7 +214,7 @@ static const struct status_to_posix_erro + {STATUS_BREAKPOINT, -EIO, "STATUS_BREAKPOINT"}, + {STATUS_SINGLE_STEP, -EIO, "STATUS_SINGLE_STEP"}, + {STATUS_BUFFER_OVERFLOW, -EIO, "STATUS_BUFFER_OVERFLOW"}, +- {STATUS_NO_MORE_FILES, -EIO, "STATUS_NO_MORE_FILES"}, ++ {STATUS_NO_MORE_FILES, -ENODATA, "STATUS_NO_MORE_FILES"}, + {STATUS_WAKE_SYSTEM_DEBUGGER, -EIO, "STATUS_WAKE_SYSTEM_DEBUGGER"}, + {STATUS_HANDLES_CLOSED, -EIO, "STATUS_HANDLES_CLOSED"}, + {STATUS_NO_INHERITANCE, -EIO, "STATUS_NO_INHERITANCE"}, +--- a/fs/cifs/smb2ops.c ++++ b/fs/cifs/smb2ops.c +@@ -554,6 +554,12 @@ smb2_new_lease_key(struct cifs_fid *fid) + get_random_bytes(fid->lease_key, SMB2_LEASE_KEY_SIZE); + } + ++static bool ++smb2_dir_needs_close(struct cifsFileInfo *cfile) ++{ ++ return !cfile->invalidHandle; ++} ++ + struct smb_version_operations smb21_operations = { + .compare_fids = smb2_compare_fids, + .setup_request = smb2_setup_request, +@@ -618,6 +624,7 @@ struct smb_version_operations smb21_oper + .set_lease_key = smb2_set_lease_key, + .new_lease_key = smb2_new_lease_key, + .calc_signature = smb2_calc_signature, ++ .dir_needs_close = smb2_dir_needs_close, + }; + + +@@ -685,6 +692,7 @@ struct smb_version_operations smb30_oper + .set_lease_key = smb2_set_lease_key, + .new_lease_key = smb2_new_lease_key, + .calc_signature = smb3_calc_signature, ++ .dir_needs_close = smb2_dir_needs_close, + }; + + struct smb_version_values smb20_values = { +--- a/fs/cifs/smb2pdu.c ++++ b/fs/cifs/smb2pdu.c +@@ -1800,6 +1800,10 @@ SMB2_query_directory(const unsigned int + rsp = (struct smb2_query_directory_rsp *)iov[0].iov_base; + + if (rc) { ++ if (rc == -ENODATA && rsp->hdr.Status == STATUS_NO_MORE_FILES) { ++ srch_inf->endOfSearch = true; ++ rc = 0; ++ } + cifs_stats_fail_inc(tcon, SMB2_QUERY_DIRECTORY_HE); + goto qdir_exit; + } +@@ -1837,11 +1841,6 @@ SMB2_query_directory(const unsigned int + else + cifs_dbg(VFS, "illegal search buffer type\n"); + +- if (rsp->hdr.Status == STATUS_NO_MORE_FILES) +- srch_inf->endOfSearch = 1; +- else +- srch_inf->endOfSearch = 0; +- + return rc; + + qdir_exit: diff --git a/queue-3.10/iio-adc-ad_sigma_delta-fix-indio_dev-trig-assignment.patch b/queue-3.10/iio-adc-ad_sigma_delta-fix-indio_dev-trig-assignment.patch new file mode 100644 index 00000000000..778816d542f --- /dev/null +++ b/queue-3.10/iio-adc-ad_sigma_delta-fix-indio_dev-trig-assignment.patch @@ -0,0 +1,34 @@ +From 9e5846be33277802c0c76e5c12825d0e4d27f639 Mon Sep 17 00:00:00 2001 +From: Srinivas Pandruvada +Date: Fri, 22 Aug 2014 21:48:00 +0100 +Subject: iio: adc: ad_sigma_delta: Fix indio_dev->trig assignment + +From: Srinivas Pandruvada + +commit 9e5846be33277802c0c76e5c12825d0e4d27f639 upstream. + +This can result in wrong reference count for trigger device, call +iio_trigger_get to increment reference. +Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion +with Jonathan. + +Signed-off-by: Srinivas Pandruvada +Acked-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/adc/ad_sigma_delta.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/adc/ad_sigma_delta.c ++++ b/drivers/iio/adc/ad_sigma_delta.c +@@ -477,7 +477,7 @@ static int ad_sd_probe_trigger(struct ii + goto error_free_irq; + + /* select default trigger */ +- indio_dev->trig = sigma_delta->trig; ++ indio_dev->trig = iio_trigger_get(sigma_delta->trig); + + return 0; + diff --git a/queue-3.10/iio-gyro-itg3200-fix-indio_dev-trig-assignment.patch b/queue-3.10/iio-gyro-itg3200-fix-indio_dev-trig-assignment.patch new file mode 100644 index 00000000000..4b8869d1d12 --- /dev/null +++ b/queue-3.10/iio-gyro-itg3200-fix-indio_dev-trig-assignment.patch @@ -0,0 +1,33 @@ +From 0b4dce2ee694a991ef38203ec5ff91a738518cb3 Mon Sep 17 00:00:00 2001 +From: Srinivas Pandruvada +Date: Fri, 22 Aug 2014 21:48:00 +0100 +Subject: iio: gyro: itg3200: Fix indio_dev->trig assignment + +From: Srinivas Pandruvada + +commit 0b4dce2ee694a991ef38203ec5ff91a738518cb3 upstream. + +This can result in wrong reference count for trigger device, call +iio_trigger_get to increment reference. +Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion +with Jonathan. + +Signed-off-by: Srinivas Pandruvada +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/gyro/itg3200_buffer.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/gyro/itg3200_buffer.c ++++ b/drivers/iio/gyro/itg3200_buffer.c +@@ -135,7 +135,7 @@ int itg3200_probe_trigger(struct iio_dev + goto error_free_irq; + + /* select default trigger */ +- indio_dev->trig = st->trig; ++ indio_dev->trig = iio_trigger_get(st->trig); + + return 0; + diff --git a/queue-3.10/iio-inkern-fix-overwritten-eprobe_defer-in-of_iio_channel_get_by_name.patch b/queue-3.10/iio-inkern-fix-overwritten-eprobe_defer-in-of_iio_channel_get_by_name.patch new file mode 100644 index 00000000000..12f5efb0495 --- /dev/null +++ b/queue-3.10/iio-inkern-fix-overwritten-eprobe_defer-in-of_iio_channel_get_by_name.patch @@ -0,0 +1,34 @@ +From 872687f626e033b4ddfaec1e410057cfc6636d77 Mon Sep 17 00:00:00 2001 +From: Johannes Pointner +Date: Mon, 25 Aug 2014 09:04:00 +0100 +Subject: iio:inkern: fix overwritten -EPROBE_DEFER in of_iio_channel_get_by_name + +From: Johannes Pointner + +commit 872687f626e033b4ddfaec1e410057cfc6636d77 upstream. + +Fixes: a2c12493ed7e ('iio: of_iio_channel_get_by_name() returns non-null pointers for error legs') + +which improperly assumes that of_iio_channel_get_by_name must always +return NULL and thus now hides -EPROBE_DEFER. + +Signed-off-by: Johannes Pointner +Reviewed-by: Guenter Roeck +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/inkern.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/inkern.c ++++ b/drivers/iio/inkern.c +@@ -178,7 +178,7 @@ static struct iio_channel *of_iio_channe + index = of_property_match_string(np, "io-channel-names", + name); + chan = of_iio_channel_get(np, index); +- if (!IS_ERR(chan)) ++ if (!IS_ERR(chan) || PTR_ERR(chan) == -EPROBE_DEFER) + break; + else if (name && index >= 0) { + pr_err("ERROR: could not get IIO channel %s:%s(%i)\n", diff --git a/queue-3.10/iio-inv_mpu6050-fix-indio_dev-trig-assignment.patch b/queue-3.10/iio-inv_mpu6050-fix-indio_dev-trig-assignment.patch new file mode 100644 index 00000000000..62dd9990a0f --- /dev/null +++ b/queue-3.10/iio-inv_mpu6050-fix-indio_dev-trig-assignment.patch @@ -0,0 +1,33 @@ +From b07e3b3850b2e1f09c19f54d3ed7210d9f529e2c Mon Sep 17 00:00:00 2001 +From: Srinivas Pandruvada +Date: Fri, 22 Aug 2014 21:48:00 +0100 +Subject: iio: inv_mpu6050: Fix indio_dev->trig assignment + +From: Srinivas Pandruvada + +commit b07e3b3850b2e1f09c19f54d3ed7210d9f529e2c upstream. + +This can result in wrong reference count for trigger device, call +iio_trigger_get to increment reference. +Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion +with Jonathan. + +Signed-off-by: Srinivas Pandruvada +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c ++++ b/drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c +@@ -135,7 +135,7 @@ int inv_mpu6050_probe_trigger(struct iio + ret = iio_trigger_register(st->trig); + if (ret) + goto error_free_irq; +- indio_dev->trig = st->trig; ++ indio_dev->trig = iio_trigger_get(st->trig); + + return 0; + diff --git a/queue-3.10/iio-magnetometer-bugfix-magnetometers-gain-values.patch b/queue-3.10/iio-magnetometer-bugfix-magnetometers-gain-values.patch new file mode 100644 index 00000000000..1fc7173b606 --- /dev/null +++ b/queue-3.10/iio-magnetometer-bugfix-magnetometers-gain-values.patch @@ -0,0 +1,102 @@ +From a31d0928999fbf33b3a6042e8bcb7b7f7e07d094 Mon Sep 17 00:00:00 2001 +From: Denis CIOCCA +Date: Thu, 9 Oct 2014 13:55:00 +0100 +Subject: iio:magnetometer: bugfix magnetometers gain values + +From: Denis CIOCCA + +commit a31d0928999fbf33b3a6042e8bcb7b7f7e07d094 upstream. + +This patch fix gains values. The first driver was designed using +engineering samples, in mass production the values are changed. + +Signed-off-by: Denis Ciocca +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/magnetometer/st_magn_core.c | 52 ++++++++++++++++++-------------- + 1 file changed, 30 insertions(+), 22 deletions(-) + +--- a/drivers/iio/magnetometer/st_magn_core.c ++++ b/drivers/iio/magnetometer/st_magn_core.c +@@ -40,7 +40,8 @@ + #define ST_MAGN_FS_AVL_5600MG 5600 + #define ST_MAGN_FS_AVL_8000MG 8000 + #define ST_MAGN_FS_AVL_8100MG 8100 +-#define ST_MAGN_FS_AVL_10000MG 10000 ++#define ST_MAGN_FS_AVL_12000MG 12000 ++#define ST_MAGN_FS_AVL_16000MG 16000 + + /* CUSTOM VALUES FOR SENSOR 1 */ + #define ST_MAGN_1_WAI_EXP 0x3c +@@ -67,20 +68,20 @@ + #define ST_MAGN_1_FS_AVL_4700_VAL 0x05 + #define ST_MAGN_1_FS_AVL_5600_VAL 0x06 + #define ST_MAGN_1_FS_AVL_8100_VAL 0x07 +-#define ST_MAGN_1_FS_AVL_1300_GAIN_XY 1100 +-#define ST_MAGN_1_FS_AVL_1900_GAIN_XY 855 +-#define ST_MAGN_1_FS_AVL_2500_GAIN_XY 670 +-#define ST_MAGN_1_FS_AVL_4000_GAIN_XY 450 +-#define ST_MAGN_1_FS_AVL_4700_GAIN_XY 400 +-#define ST_MAGN_1_FS_AVL_5600_GAIN_XY 330 +-#define ST_MAGN_1_FS_AVL_8100_GAIN_XY 230 +-#define ST_MAGN_1_FS_AVL_1300_GAIN_Z 980 +-#define ST_MAGN_1_FS_AVL_1900_GAIN_Z 760 +-#define ST_MAGN_1_FS_AVL_2500_GAIN_Z 600 +-#define ST_MAGN_1_FS_AVL_4000_GAIN_Z 400 +-#define ST_MAGN_1_FS_AVL_4700_GAIN_Z 355 +-#define ST_MAGN_1_FS_AVL_5600_GAIN_Z 295 +-#define ST_MAGN_1_FS_AVL_8100_GAIN_Z 205 ++#define ST_MAGN_1_FS_AVL_1300_GAIN_XY 909 ++#define ST_MAGN_1_FS_AVL_1900_GAIN_XY 1169 ++#define ST_MAGN_1_FS_AVL_2500_GAIN_XY 1492 ++#define ST_MAGN_1_FS_AVL_4000_GAIN_XY 2222 ++#define ST_MAGN_1_FS_AVL_4700_GAIN_XY 2500 ++#define ST_MAGN_1_FS_AVL_5600_GAIN_XY 3030 ++#define ST_MAGN_1_FS_AVL_8100_GAIN_XY 4347 ++#define ST_MAGN_1_FS_AVL_1300_GAIN_Z 1020 ++#define ST_MAGN_1_FS_AVL_1900_GAIN_Z 1315 ++#define ST_MAGN_1_FS_AVL_2500_GAIN_Z 1666 ++#define ST_MAGN_1_FS_AVL_4000_GAIN_Z 2500 ++#define ST_MAGN_1_FS_AVL_4700_GAIN_Z 2816 ++#define ST_MAGN_1_FS_AVL_5600_GAIN_Z 3389 ++#define ST_MAGN_1_FS_AVL_8100_GAIN_Z 4878 + #define ST_MAGN_1_MULTIREAD_BIT false + + /* CUSTOM VALUES FOR SENSOR 2 */ +@@ -103,10 +104,12 @@ + #define ST_MAGN_2_FS_MASK 0x60 + #define ST_MAGN_2_FS_AVL_4000_VAL 0x00 + #define ST_MAGN_2_FS_AVL_8000_VAL 0x01 +-#define ST_MAGN_2_FS_AVL_10000_VAL 0x02 +-#define ST_MAGN_2_FS_AVL_4000_GAIN 430 +-#define ST_MAGN_2_FS_AVL_8000_GAIN 230 +-#define ST_MAGN_2_FS_AVL_10000_GAIN 230 ++#define ST_MAGN_2_FS_AVL_12000_VAL 0x02 ++#define ST_MAGN_2_FS_AVL_16000_VAL 0x03 ++#define ST_MAGN_2_FS_AVL_4000_GAIN 146 ++#define ST_MAGN_2_FS_AVL_8000_GAIN 292 ++#define ST_MAGN_2_FS_AVL_12000_GAIN 438 ++#define ST_MAGN_2_FS_AVL_16000_GAIN 584 + #define ST_MAGN_2_MULTIREAD_BIT false + #define ST_MAGN_2_OUT_X_L_ADDR 0x28 + #define ST_MAGN_2_OUT_Y_L_ADDR 0x2a +@@ -252,9 +255,14 @@ static const struct st_sensors st_magn_s + .gain = ST_MAGN_2_FS_AVL_8000_GAIN, + }, + [2] = { +- .num = ST_MAGN_FS_AVL_10000MG, +- .value = ST_MAGN_2_FS_AVL_10000_VAL, +- .gain = ST_MAGN_2_FS_AVL_10000_GAIN, ++ .num = ST_MAGN_FS_AVL_12000MG, ++ .value = ST_MAGN_2_FS_AVL_12000_VAL, ++ .gain = ST_MAGN_2_FS_AVL_12000_GAIN, ++ }, ++ [3] = { ++ .num = ST_MAGN_FS_AVL_16000MG, ++ .value = ST_MAGN_2_FS_AVL_16000_VAL, ++ .gain = ST_MAGN_2_FS_AVL_16000_GAIN, + }, + }, + }, diff --git a/queue-3.10/iio-meter-ade7758-fix-indio_dev-trig-assignment.patch b/queue-3.10/iio-meter-ade7758-fix-indio_dev-trig-assignment.patch new file mode 100644 index 00000000000..65d1a7730e9 --- /dev/null +++ b/queue-3.10/iio-meter-ade7758-fix-indio_dev-trig-assignment.patch @@ -0,0 +1,34 @@ +From 0495081179212b758775df752e657ea71dcae020 Mon Sep 17 00:00:00 2001 +From: Srinivas Pandruvada +Date: Fri, 22 Aug 2014 21:48:00 +0100 +Subject: iio: meter: ade7758: Fix indio_dev->trig assignment + +From: Srinivas Pandruvada + +commit 0495081179212b758775df752e657ea71dcae020 upstream. + +This can result in wrong reference count for trigger device, call +iio_trigger_get to increment reference. +Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion +with Jonathan. + +Signed-off-by: Srinivas Pandruvada +Acked-by: Lars-Peter Clausen +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/staging/iio/meter/ade7758_trigger.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/staging/iio/meter/ade7758_trigger.c ++++ b/drivers/staging/iio/meter/ade7758_trigger.c +@@ -85,7 +85,7 @@ int ade7758_probe_trigger(struct iio_dev + ret = iio_trigger_register(st->trig); + + /* select default trigger */ +- indio_dev->trig = st->trig; ++ indio_dev->trig = iio_trigger_get(st->trig); + if (ret) + goto error_free_irq; + diff --git a/queue-3.10/iio-st_sensors-fix-indio_dev-trig-assignment.patch b/queue-3.10/iio-st_sensors-fix-indio_dev-trig-assignment.patch new file mode 100644 index 00000000000..4429a4863f4 --- /dev/null +++ b/queue-3.10/iio-st_sensors-fix-indio_dev-trig-assignment.patch @@ -0,0 +1,33 @@ +From f0e84acd7056e6d7ade551c6439531606ae30a46 Mon Sep 17 00:00:00 2001 +From: Srinivas Pandruvada +Date: Fri, 22 Aug 2014 21:48:00 +0100 +Subject: iio: st_sensors: Fix indio_dev->trig assignment + +From: Srinivas Pandruvada + +commit f0e84acd7056e6d7ade551c6439531606ae30a46 upstream. + +This can result in wrong reference count for trigger device, call +iio_trigger_get to increment reference. +Refer to http://www.spinics.net/lists/linux-iio/msg13669.html for discussion +with Jonathan. + +Signed-off-by: Srinivas Pandruvada +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iio/common/st_sensors/st_sensors_trigger.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/iio/common/st_sensors/st_sensors_trigger.c ++++ b/drivers/iio/common/st_sensors/st_sensors_trigger.c +@@ -49,7 +49,7 @@ int st_sensors_allocate_trigger(struct i + dev_err(&indio_dev->dev, "failed to register iio trigger.\n"); + goto iio_trigger_register_error; + } +- indio_dev->trig = sdata->trig; ++ indio_dev->trig = iio_trigger_get(sdata->trig); + + return 0; + diff --git a/queue-3.10/iio-trigger-modify-return-value-for-iio_trigger_get.patch b/queue-3.10/iio-trigger-modify-return-value-for-iio_trigger_get.patch new file mode 100644 index 00000000000..0f3140aae9b --- /dev/null +++ b/queue-3.10/iio-trigger-modify-return-value-for-iio_trigger_get.patch @@ -0,0 +1,38 @@ +From f153566570fb9e32c2f59182883f4f66048788fb Mon Sep 17 00:00:00 2001 +From: Srinivas Pandruvada +Date: Fri, 22 Aug 2014 21:48:00 +0100 +Subject: iio:trigger: modify return value for iio_trigger_get + +From: Srinivas Pandruvada + +commit f153566570fb9e32c2f59182883f4f66048788fb upstream. + +Instead of a void function, return the trigger pointer. + +Whilst not in of itself a fix, this makes the following set of +7 fixes cleaner than they would otherwise be. + +Signed-off-by: Srinivas Pandruvada +Signed-off-by: Jonathan Cameron +Signed-off-by: Greg Kroah-Hartman + +--- + include/linux/iio/trigger.h | 4 +++- + 1 file changed, 3 insertions(+), 1 deletion(-) + +--- a/include/linux/iio/trigger.h ++++ b/include/linux/iio/trigger.h +@@ -83,10 +83,12 @@ static inline void iio_trigger_put(struc + put_device(&trig->dev); + } + +-static inline void iio_trigger_get(struct iio_trigger *trig) ++static inline struct iio_trigger *iio_trigger_get(struct iio_trigger *trig) + { + get_device(&trig->dev); + __module_get(trig->ops->owner); ++ ++ return trig; + } + + /** diff --git a/queue-3.10/series b/queue-3.10/series index 35c22f46f7e..475a715973a 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -72,3 +72,14 @@ regmap-fix-handling-of-volatile-registers-for-format_write-chips.patch kvm-x86-handle-idiv-overflow-at-kvm_write_tsc.patch x86-early_ioremap-increase-fix_btmaps_slots-to-8.patch shmem-fix-nlink-for-rename-overwrite-directory.patch +asoc-davinci-mcasp-correct-rx-format-unit-configuration.patch +cifs-fix-directory-rename-error.patch +cifs-fix-smb2-readdir-error-handling.patch +iio-trigger-modify-return-value-for-iio_trigger_get.patch +iio-gyro-itg3200-fix-indio_dev-trig-assignment.patch +iio-inv_mpu6050-fix-indio_dev-trig-assignment.patch +iio-meter-ade7758-fix-indio_dev-trig-assignment.patch +iio-st_sensors-fix-indio_dev-trig-assignment.patch +iio-adc-ad_sigma_delta-fix-indio_dev-trig-assignment.patch +iio-magnetometer-bugfix-magnetometers-gain-values.patch +iio-inkern-fix-overwritten-eprobe_defer-in-of_iio_channel_get_by_name.patch -- 2.47.3