pinctrl: qcom: lpass lpi: use default pullup/strength values
Subsystems (5)
PATCH 1/1 pinctrl: qcom: lpass lpi: use default pullup/strength values
If these fields are not set in dts, the driver will use these variables uninitialized to set the fields. Not only will it set garbage values for these fields, but it can overflow into other fields and break those.
In the current sm8250 dts, the dmic01 entries do not have a pullup setting, and might not work without this change.
--- drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +1 -1
@@ -392,7 +392,7 @@ static int lpi_config_set(struct pinctrl_dev *pctldev, unsigned int group, unsigned long *configs, unsigned int nconfs) {struct lpi_pinctrl *pctrl =dev_get_drvdata (pctldev->dev); -unsigned int param, arg, pullup, strength; +unsigned int param, arg, pullup =LPI_GPIO_BIAS_DISABLE , strength =2 ;bool value, output_enabled = false;const struct lpi_pingroup *g;unsigned long sval;
Signature · 1 line
2.26.1
Quoted 7 lines · Jonathan Marek
If these fields are not set in dts, the driver will use these variables uninitialized to set the fields. Not only will it set garbage values for these fields, but it can overflow into other fields and break those.
In the current sm8250 dts, the dmic01 entries do not have a pullup setting, and might not work without this change.
Perhaps you didn't see it, but Dan reported this a few days back. So unless you object I would suggest that we include:
Regards,
Bjorn
Quoted 22 lines
Fixes 6e261d1090d6 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver")Signed-off-by Jonathan Marek <[email protected]>--- drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +1
-1@@ -392,7 +392,7 @@ static int lpi_config_set(struct pinctrl_dev *pctldev, unsigned int group, unsigned long *configs, unsigned int nconfs) {struct lpi_pinctrl *pctrl =dev_get_drvdata (pctldev->dev); -unsigned int param, arg, pullup, strength; +unsigned int param, arg, pullup =LPI_GPIO_BIAS_DISABLE , strength =2 ;bool value, output_enabled = false;const struct lpi_pingroup *g;unsigned long sval;Signature · 1 line
2.26.1
Quoted 6 lines · Bjorn Andersson
Quoted 4 lines · Jonathan Marek
If these fields are not set in dts, the driver will use these variables uninitialized to set the fields. Not only will it set garbage values for these fields, but it can overflow into other fields and break those.
Quoted 7 lines
Quoted 3 lines
In the current sm8250 dts, the dmic01 entries do not have a pullup setting, and might not work without this change.
Perhaps you didn't see it, but Dan reported this a few days back. So unless you object I would suggest that we include:
I did not see it. But feel free to add tags.
Quoted 31 lines
Reported-by kernel test robot <[email protected]>Reported-by Dan Carpenter <[email protected]>Reviewed-by Bjorn Andersson <[email protected]>Regards,
BjornQuoted 22 lines
Fixes 6e261d1090d6 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver")Signed-off-by Jonathan Marek <[email protected]>--- drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +1
-1@@ -392,7 +392,7 @@ static int lpi_config_set(struct pinctrl_dev *pctldev, unsigned int group, unsigned long *configs, unsigned int nconfs) {struct lpi_pinctrl *pctrl =dev_get_drvdata (pctldev->dev); -unsigned int param, arg, pullup, strength; +unsigned int param, arg, pullup =LPI_GPIO_BIAS_DISABLE , strength =2 ;bool value, output_enabled = false;const struct lpi_pingroup *g;unsigned long sval;Signature · 1 line
2.26.1
Thanks Jonathan for fixing this!
Quoted 10 lines · Jonathan Marek
If these fields are not set in dts, the driver will use these variables uninitialized to set the fields. Not only will it set garbage values for these fields, but it can overflow into other fields and break those.
In the current sm8250 dts, the dmic01 entries do not have a pullup setting, and might not work without this change.
Fixes 6e261d1090d6 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver")Signed-off-by Jonathan Marek <[email protected]>---
LGTM,
--srini
Quoted 17 lines
drivers/pinctrl/qcom/pinctrl-lpass-lpi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/pinctrl/qcom/pinctrl-lpass-lpi.c +1
-1@@ -392,7 +392,7 @@ static int lpi_config_set(struct pinctrl_dev *pctldev, unsigned int group, unsigned long *configs, unsigned int nconfs) {struct lpi_pinctrl *pctrl =dev_get_drvdata (pctldev->dev); -unsigned int param, arg, pullup, strength; +unsigned int param, arg, pullup =LPI_GPIO_BIAS_DISABLE , strength =2 ;bool value, output_enabled = false;const struct lpi_pingroup *g;unsigned long sval;
Quoted 9 lines · Jonathan Marek
If these fields are not set in dts, the driver will use these variables uninitialized to set the fields. Not only will it set garbage values for these fields, but it can overflow into other fields and break those.
In the current sm8250 dts, the dmic01 entries do not have a pullup setting, and might not work without this change.
Fixes 6e261d1090d6 ("pinctrl: qcom: Add sm8250 lpass lpi pinctrl driver")Signed-off-by Jonathan Marek <[email protected]>
Patch applied for fixes!
Yours,
Linus Walleij
This patch was applied to qcom/linux.git (refs/heads/for-next):
Hello:
This patch was applied to qcom/linux.git (refs/heads/for-next):
Quoted 8 lines · On Thu, 4 Mar 2021 14:48:16 -0500 you wrote:
If these fields are not set in dts, the driver will use these variables uninitialized to set the fields. Not only will it set garbage values for these fields, but it can overflow into other fields and break those.
In the current sm8250 dts, the dmic01 entries do not have a pullup setting, and might not work without this change.
[...]
Here is the summary with links:
- pinctrl: qcom: lpass lpi: use default pullup/strength values
https://git.kernel.org/qcom/c/2a9be38099e3
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html