From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
stable@vger.kernel.org,
Krzysztof Kozlowski <k.kozlowski@samsung.com>,
Javier Martinez Canillas <javier@osg.samsung.com>,
Mark Brown <broonie@kernel.org>
Subject: [PATCH 4.5 068/101] regulator: s2mps11: Fix invalid selector mask and voltages for buck9
Date: Mon, 16 May 2016 18:21:13 -0700 [thread overview]
Message-ID: <20160517011508.889621988@linuxfoundation.org> (raw)
In-Reply-To: <20160517011506.359924439@linuxfoundation.org>
4.5-stable review patch. If anyone has any objections, please let me know.
------------------
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
commit 3b672623079bb3e5685b8549e514f2dfaa564406 upstream.
The buck9 regulator of S2MPS11 PMIC had incorrect vsel_mask (0xff
instead of 0x1f) thus reading entire register as buck9's voltage. This
effectively caused regulator core to interpret values as higher voltages
than they were and then to set real voltage much lower than intended.
The buck9 provides power to other regulators, including LDO13
and LDO19 which supply the MMC2 (SD card). On Odroid XU3/XU4 the lower
voltage caused SD card detection errors on Odroid XU3/XU4:
mmc1: card never left busy state
mmc1: error -110 whilst initialising SD card
During driver probe the regulator core was checking whether initial
voltage matches the constraints. With incorrect vsel_mask of 0xff and
default value of 0x50, the core interpreted this as 5 V which is outside
of constraints (3-3.775 V). Then the regulator core was adjusting the
voltage to match the constraints. With incorrect vsel_mask this new
voltage mapped to a vere low voltage in the driver.
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com>
Tested-by: Javier Martinez Canillas <javier@osg.samsung.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
drivers/regulator/s2mps11.c | 28 ++++++++++++++++++++++------
include/linux/mfd/samsung/s2mps11.h | 2 ++
2 files changed, 24 insertions(+), 6 deletions(-)
--- a/drivers/regulator/s2mps11.c
+++ b/drivers/regulator/s2mps11.c
@@ -306,7 +306,7 @@ static struct regulator_ops s2mps11_buck
.enable_mask = S2MPS11_ENABLE_MASK \
}
-#define regulator_desc_s2mps11_buck6_10(num, min, step) { \
+#define regulator_desc_s2mps11_buck67810(num, min, step) { \
.name = "BUCK"#num, \
.id = S2MPS11_BUCK##num, \
.ops = &s2mps11_buck_ops, \
@@ -322,6 +322,22 @@ static struct regulator_ops s2mps11_buck
.enable_mask = S2MPS11_ENABLE_MASK \
}
+#define regulator_desc_s2mps11_buck9 { \
+ .name = "BUCK9", \
+ .id = S2MPS11_BUCK9, \
+ .ops = &s2mps11_buck_ops, \
+ .type = REGULATOR_VOLTAGE, \
+ .owner = THIS_MODULE, \
+ .min_uV = MIN_3000_MV, \
+ .uV_step = STEP_25_MV, \
+ .n_voltages = S2MPS11_BUCK9_N_VOLTAGES, \
+ .ramp_delay = S2MPS11_RAMP_DELAY, \
+ .vsel_reg = S2MPS11_REG_B9CTRL2, \
+ .vsel_mask = S2MPS11_BUCK9_VSEL_MASK, \
+ .enable_reg = S2MPS11_REG_B9CTRL1, \
+ .enable_mask = S2MPS11_ENABLE_MASK \
+}
+
static const struct regulator_desc s2mps11_regulators[] = {
regulator_desc_s2mps11_ldo(1, STEP_25_MV),
regulator_desc_s2mps11_ldo(2, STEP_50_MV),
@@ -366,11 +382,11 @@ static const struct regulator_desc s2mps
regulator_desc_s2mps11_buck1_4(3),
regulator_desc_s2mps11_buck1_4(4),
regulator_desc_s2mps11_buck5,
- regulator_desc_s2mps11_buck6_10(6, MIN_600_MV, STEP_6_25_MV),
- regulator_desc_s2mps11_buck6_10(7, MIN_600_MV, STEP_6_25_MV),
- regulator_desc_s2mps11_buck6_10(8, MIN_600_MV, STEP_6_25_MV),
- regulator_desc_s2mps11_buck6_10(9, MIN_3000_MV, STEP_25_MV),
- regulator_desc_s2mps11_buck6_10(10, MIN_750_MV, STEP_12_5_MV),
+ regulator_desc_s2mps11_buck67810(6, MIN_600_MV, STEP_6_25_MV),
+ regulator_desc_s2mps11_buck67810(7, MIN_600_MV, STEP_6_25_MV),
+ regulator_desc_s2mps11_buck67810(8, MIN_600_MV, STEP_6_25_MV),
+ regulator_desc_s2mps11_buck9,
+ regulator_desc_s2mps11_buck67810(10, MIN_750_MV, STEP_12_5_MV),
};
static struct regulator_ops s2mps14_reg_ops;
--- a/include/linux/mfd/samsung/s2mps11.h
+++ b/include/linux/mfd/samsung/s2mps11.h
@@ -173,10 +173,12 @@ enum s2mps11_regulators {
#define S2MPS11_LDO_VSEL_MASK 0x3F
#define S2MPS11_BUCK_VSEL_MASK 0xFF
+#define S2MPS11_BUCK9_VSEL_MASK 0x1F
#define S2MPS11_ENABLE_MASK (0x03 << S2MPS11_ENABLE_SHIFT)
#define S2MPS11_ENABLE_SHIFT 0x06
#define S2MPS11_LDO_N_VOLTAGES (S2MPS11_LDO_VSEL_MASK + 1)
#define S2MPS11_BUCK_N_VOLTAGES (S2MPS11_BUCK_VSEL_MASK + 1)
+#define S2MPS11_BUCK9_N_VOLTAGES (S2MPS11_BUCK9_VSEL_MASK + 1)
#define S2MPS11_RAMP_DELAY 25000 /* uV/us */
#define S2MPS11_CTRL1_PWRHOLD_MASK BIT(4)
next prev parent reply other threads:[~2016-05-17 1:38 UTC|newest]
Thread overview: 94+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-17 1:20 [PATCH 4.5 000/101] 4.5.5-stable review Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 001/101] staging: wilc1000: remove extraneous variable Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 002/101] decnet: Do not build routes to devices without decnet private data Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 003/101] route: do not cache fib route info on local routes with oif Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 004/101] packet: fix heap info leak in PACKET_DIAG_MCLIST sock_diag interface Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 005/101] net: sched: do not requeue a NULL skb Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 006/101] bpf/verifier: reject invalid LD_ABS | BPF_DW instruction Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 009/101] net: use skb_postpush_rcsum instead of own implementations Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 010/101] vlan: pull on __vlan_insert_tag error path and fix csum correction Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 011/101] openvswitch: Orphan skbs before IPv6 defrag Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 012/101] atl2: Disable unimplemented scatter/gather feature Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 013/101] openvswitch: use flow protocol when recalculating ipv6 checksums Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 014/101] net/mlx5_core: Fix soft lockup in steering error flow Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 015/101] net/mlx5e: Devices mtu field is u16 and not int Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 016/101] net/mlx5e: Fix minimum MTU Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 017/101] net/mlx5e: Use vport MTU rather than physical port MTU Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 018/101] ipv4/fib: dont warn when primary address is missing if in_dev is dead Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 019/101] net/mlx4_en: fix spurious timestamping callbacks Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 020/101] bpf: fix double-fdput in replace_map_fd_with_map_ptr() Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 021/101] bpf: fix refcnt overflow Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 022/101] bpf: fix check_map_func_compatibility logic Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 023/101] samples/bpf: fix trace_output example Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 024/101] net: Implement net_dbg_ratelimited() for CONFIG_DYNAMIC_DEBUG case Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 025/101] gre: do not pull header in ICMP error processing Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 026/101] net_sched: introduce qdisc_replace() helper Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 027/101] net_sched: update hierarchical backlog too Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 028/101] sch_htb: update backlog as well Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 029/101] sch_dsmark: " Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 030/101] netem: Segment GSO packets on enqueue Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 031/101] ipv6/ila: fix nlsize calculation for lwtunnel Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 035/101] net/mlx4_en: Fix endianness bug in IPV6 csum calculation Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 036/101] VSOCK: do not disconnect socket when peer has shutdown SEND only Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 037/101] net: bridge: fix old ioctl unlocked net device walk Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 040/101] net: fix a kernel infoleak in x25 module Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 041/101] net: thunderx: avoid exposing kernel stack Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 042/101] tcp: refresh skb timestamp at retransmit time Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 043/101] net/route: enforce hoplimit max value Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 044/101] ocfs2: revert using ocfs2_acl_chmod to avoid inode cluster lock hang Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 045/101] ocfs2: fix posix_acl_create deadlock Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 046/101] zsmalloc: fix zs_can_compact() integer overflow Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 047/101] mm: thp: calculate the mapcount correctly for THP pages during WP faults Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 048/101] crypto: qat - fix invalid pf2vf_resp_wq logic Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 049/101] crypto: qat - fix adf_ctl_drv.c:undefined reference to adf_init_pf_wq Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 050/101] crypto: hash - Fix page length clamping in hash walk Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 051/101] crypto: testmgr - Use kmalloc memory for RSA input Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 052/101] ALSA: usb-audio: Quirk for yet another Phoenix Audio devices (v2) Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 053/101] ALSA: usb-audio: Yet another Phoneix Audio device quirk Greg Kroah-Hartman
2016-05-17 1:20 ` [PATCH 4.5 054/101] ALSA: hda - Fix subwoofer pin on ASUS N751 and N551 Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 055/101] ALSA: hda - Fix white noise on Asus UX501VW headset Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 056/101] ALSA: hda - Fix broken reconfig Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 057/101] spi: pxa2xx: Do not detect number of enabled chip selects on Intel SPT Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 058/101] spi: spi-ti-qspi: Fix FLEN and WLEN settings if bits_per_word is overridden Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 059/101] spi: spi-ti-qspi: Handle truncated frames properly Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 060/101] pinctrl: at91-pio4: fix pull-up/down logic Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 061/101] regmap: spmi: Fix regmap_spmi_ext_read in multi-byte case Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 062/101] perf diff: Fix duplicated output column Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 063/101] perf/core: Disable the event on a truncated AUX record Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 064/101] vfs: add vfs_select_inode() helper Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 065/101] vfs: rename: check backing inode being equal Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 066/101] ARM: dts: at91: sam9x5: Fix the memory range assigned to the PMC Greg Kroah-Hartman
2016-05-17 1:21 ` Greg Kroah-Hartman [this message]
2016-05-17 1:21 ` [PATCH 4.5 069/101] regulator: axp20x: Fix axp22x ldo_io voltage ranges Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 070/101] atomic_open(): fix the handling of create_error Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 071/101] qla1280: Dont allocate 512kb of host tags Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 072/101] tools lib traceevent: Do not reassign parg after collapse_tree() Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 073/101] get_rock_ridge_filename(): handle malformed NM entries Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 074/101] Input: max8997-haptic - fix NULL pointer dereference Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 075/101] Revert "[media] videobuf2-v4l2: Verify planes array in buffer dequeueing" Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 077/101] drm/radeon: fix PLL sharing on DCE6.1 (v2) Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 078/101] drm/i915: Bail out of pipe config compute loop on LPT Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 079/101] Revert "drm/i915: start adding dp mst audio" Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 081/101] drm/radeon: fix DP link training issue with second 4K monitor Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 082/101] drm/radeon: fix DP mode validation Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 083/101] drm/amdgpu: " Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 084/101] btrfs: reada: Fix in-segment calculation for reada Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 085/101] Btrfs: fix truncate_space_check Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 086/101] btrfs: remove error message from search ioctl for nonexistent tree Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 087/101] btrfs: change max_inline default to 2048 Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 088/101] Btrfs: fix unreplayable log after snapshot delete + parent dir fsync Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 089/101] Btrfs: fix file loss on log replay after renaming a file and fsync Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 090/101] Btrfs: fix extent_same allowing destination offset beyond i_size Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 091/101] Btrfs: fix deadlock between direct IO reads and buffered writes Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 092/101] Btrfs: fix race when checking if we can skip fsyncing an inode Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 093/101] Btrfs: do not collect ordered extents when logging that inode exists Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 094/101] btrfs: csum_tree_block: return proper errno value Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 095/101] btrfs: do not write corrupted metadata blocks to disk Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 096/101] Btrfs: fix invalid reference in replace_path Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 097/101] btrfs: handle non-fatal errors in btrfs_qgroup_inherit() Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 098/101] btrfs: fallback to vmalloc in btrfs_compare_tree Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 099/101] Btrfs: dont use src fd for printk Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 100/101] btrfs: Reset IO error counters before start of device replacing Greg Kroah-Hartman
2016-05-17 1:21 ` [PATCH 4.5 101/101] nf_conntrack: avoid kernel pointer value leak in slab name Greg Kroah-Hartman
2016-05-17 17:28 ` [PATCH 4.5 000/101] 4.5.5-stable review Guenter Roeck
2016-05-17 17:28 ` Shuah Khan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160517011508.889621988@linuxfoundation.org \
--to=gregkh@linuxfoundation.org \
--cc=broonie@kernel.org \
--cc=javier@osg.samsung.com \
--cc=k.kozlowski@samsung.com \
--cc=linux-kernel@vger.kernel.org \
--cc=stable@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox