From 5d28382bc44aa46f6b5471b12e2f357122586a17 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 2 Dec 2019 19:48:35 +0100 Subject: [PATCH] 4.4-stable patches added patches: ath10k-restore-qca9880-ar1a-v1-detection.patch media-v4l2-ctrl-fix-flags-for-do_white_balance.patch net-macb-fix-error-format-in-dev_err.patch pwm-clear-chip_data-in-pwm_put.patch --- ...0k-restore-qca9880-ar1a-v1-detection.patch | 88 +++++++++++++++++++ ...-ctrl-fix-flags-for-do_white_balance.patch | 35 ++++++++ ...net-macb-fix-error-format-in-dev_err.patch | 80 +++++++++++++++++ .../pwm-clear-chip_data-in-pwm_put.patch | 47 ++++++++++ queue-4.4/series | 4 + 5 files changed, 254 insertions(+) create mode 100644 queue-4.4/ath10k-restore-qca9880-ar1a-v1-detection.patch create mode 100644 queue-4.4/media-v4l2-ctrl-fix-flags-for-do_white_balance.patch create mode 100644 queue-4.4/net-macb-fix-error-format-in-dev_err.patch create mode 100644 queue-4.4/pwm-clear-chip_data-in-pwm_put.patch diff --git a/queue-4.4/ath10k-restore-qca9880-ar1a-v1-detection.patch b/queue-4.4/ath10k-restore-qca9880-ar1a-v1-detection.patch new file mode 100644 index 00000000000..252a2f907b7 --- /dev/null +++ b/queue-4.4/ath10k-restore-qca9880-ar1a-v1-detection.patch @@ -0,0 +1,88 @@ +From f8914a14623a79b73f72b2b1ee4cd9b2cb91b735 Mon Sep 17 00:00:00 2001 +From: Christian Lamparter +Date: Fri, 6 Sep 2019 23:54:23 +0200 +Subject: ath10k: restore QCA9880-AR1A (v1) detection + +From: Christian Lamparter + +commit f8914a14623a79b73f72b2b1ee4cd9b2cb91b735 upstream. + +This patch restores the old behavior that read +the chip_id on the QCA988x before resetting the +chip. This needs to be done in this order since +the unsupported QCA988x AR1A chips fall off the +bus when resetted. Otherwise the next MMIO Op +after the reset causes a BUS ERROR and panic. + +Cc: stable@vger.kernel.org +Fixes: 1a7fecb766c8 ("ath10k: reset chip before reading chip_id in probe") +Signed-off-by: Christian Lamparter +Signed-off-by: Kalle Valo +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/wireless/ath/ath10k/pci.c | 27 +++++++++++++++++++++------ + 1 file changed, 21 insertions(+), 6 deletions(-) + +--- a/drivers/net/wireless/ath/ath10k/pci.c ++++ b/drivers/net/wireless/ath/ath10k/pci.c +@@ -2988,12 +2988,13 @@ static int ath10k_pci_probe(struct pci_d + struct ath10k_pci *ar_pci; + enum ath10k_hw_rev hw_rev; + u32 chip_id; +- bool pci_ps; ++ bool pci_ps, is_qca988x = false; + + switch (pci_dev->device) { + case QCA988X_2_0_DEVICE_ID: + hw_rev = ATH10K_HW_QCA988X; + pci_ps = false; ++ is_qca988x = true; + break; + case QCA6164_2_1_DEVICE_ID: + case QCA6174_2_1_DEVICE_ID: +@@ -3087,6 +3088,19 @@ static int ath10k_pci_probe(struct pci_d + goto err_deinit_irq; + } + ++ /* Read CHIP_ID before reset to catch QCA9880-AR1A v1 devices that ++ * fall off the bus during chip_reset. These chips have the same pci ++ * device id as the QCA9880 BR4A or 2R4E. So that's why the check. ++ */ ++ if (is_qca988x) { ++ chip_id = ath10k_pci_soc_read32(ar, SOC_CHIP_ID_ADDRESS); ++ if (chip_id != 0xffffffff) { ++ if (!ath10k_pci_chip_is_supported(pdev->device, ++ chip_id)) ++ goto err_unsupported; ++ } ++ } ++ + ret = ath10k_pci_chip_reset(ar); + if (ret) { + ath10k_err(ar, "failed to reset chip: %d\n", ret); +@@ -3099,11 +3113,8 @@ static int ath10k_pci_probe(struct pci_d + goto err_free_irq; + } + +- if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) { +- ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n", +- pdev->device, chip_id); +- goto err_free_irq; +- } ++ if (!ath10k_pci_chip_is_supported(pdev->device, chip_id)) ++ goto err_unsupported; + + ret = ath10k_core_register(ar, chip_id); + if (ret) { +@@ -3113,6 +3124,10 @@ static int ath10k_pci_probe(struct pci_d + + return 0; + ++err_unsupported: ++ ath10k_err(ar, "device %04x with chip_id %08x isn't supported\n", ++ pdev->device, bus_params.chip_id); ++ + err_free_irq: + ath10k_pci_free_irq(ar); + ath10k_pci_kill_tasklet(ar); diff --git a/queue-4.4/media-v4l2-ctrl-fix-flags-for-do_white_balance.patch b/queue-4.4/media-v4l2-ctrl-fix-flags-for-do_white_balance.patch new file mode 100644 index 00000000000..abc85571186 --- /dev/null +++ b/queue-4.4/media-v4l2-ctrl-fix-flags-for-do_white_balance.patch @@ -0,0 +1,35 @@ +From a0816e5088baab82aa738d61a55513114a673c8e Mon Sep 17 00:00:00 2001 +From: Eugen Hristev +Date: Mon, 15 Apr 2019 10:13:51 -0400 +Subject: media: v4l2-ctrl: fix flags for DO_WHITE_BALANCE + +From: Eugen Hristev + +commit a0816e5088baab82aa738d61a55513114a673c8e upstream. + +Control DO_WHITE_BALANCE is a button, with read only and execute-on-write flags. +Adding this control in the proper list in the fill function. + +After adding it here, we can see output of v4l2-ctl -L +do_white_balance 0x0098090d (button) : flags=write-only, execute-on-write + +Signed-off-by: Eugen Hristev +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/v4l2-core/v4l2-ctrls.c | 1 + + 1 file changed, 1 insertion(+) + +--- a/drivers/media/v4l2-core/v4l2-ctrls.c ++++ b/drivers/media/v4l2-core/v4l2-ctrls.c +@@ -991,6 +991,7 @@ void v4l2_ctrl_fill(u32 id, const char * + case V4L2_CID_FLASH_STROBE_STOP: + case V4L2_CID_AUTO_FOCUS_START: + case V4L2_CID_AUTO_FOCUS_STOP: ++ case V4L2_CID_DO_WHITE_BALANCE: + *type = V4L2_CTRL_TYPE_BUTTON; + *flags |= V4L2_CTRL_FLAG_WRITE_ONLY | + V4L2_CTRL_FLAG_EXECUTE_ON_WRITE; diff --git a/queue-4.4/net-macb-fix-error-format-in-dev_err.patch b/queue-4.4/net-macb-fix-error-format-in-dev_err.patch new file mode 100644 index 00000000000..6d87000a05c --- /dev/null +++ b/queue-4.4/net-macb-fix-error-format-in-dev_err.patch @@ -0,0 +1,80 @@ +From f413cbb332a0b5251a790f396d0eb4ebcade5dec Mon Sep 17 00:00:00 2001 +From: Luca Ceresoli +Date: Tue, 14 May 2019 15:23:07 +0200 +Subject: net: macb: fix error format in dev_err() + +From: Luca Ceresoli + +commit f413cbb332a0b5251a790f396d0eb4ebcade5dec upstream. + +Errors are negative numbers. Using %u shows them as very large positive +numbers such as 4294967277 that don't make sense. Use the %d format +instead, and get a much nicer -19. + +Signed-off-by: Luca Ceresoli +Fixes: b48e0bab142f ("net: macb: Migrate to devm clock interface") +Fixes: 93b31f48b3ba ("net/macb: unify clock management") +Fixes: 421d9df0628b ("net/macb: merge at91_ether driver into macb driver") +Fixes: aead88bd0e99 ("net: ethernet: macb: Add support for rx_clk") +Fixes: f5473d1d44e4 ("net: macb: Support clock management for tsu_clk") +Acked-by: Nicolas Ferre +Reviewed-by: Andrew Lunn +Signed-off-by: David S. Miller +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/net/ethernet/cadence/macb.c | 12 ++++++------ + 1 file changed, 6 insertions(+), 6 deletions(-) + +--- a/drivers/net/ethernet/cadence/macb.c ++++ b/drivers/net/ethernet/cadence/macb.c +@@ -2275,14 +2275,14 @@ static int macb_clk_init(struct platform + *pclk = devm_clk_get(&pdev->dev, "pclk"); + if (IS_ERR(*pclk)) { + err = PTR_ERR(*pclk); +- dev_err(&pdev->dev, "failed to get macb_clk (%u)\n", err); ++ dev_err(&pdev->dev, "failed to get macb_clk (%d)\n", err); + return err; + } + + *hclk = devm_clk_get(&pdev->dev, "hclk"); + if (IS_ERR(*hclk)) { + err = PTR_ERR(*hclk); +- dev_err(&pdev->dev, "failed to get hclk (%u)\n", err); ++ dev_err(&pdev->dev, "failed to get hclk (%d)\n", err); + return err; + } + +@@ -2292,19 +2292,19 @@ static int macb_clk_init(struct platform + + err = clk_prepare_enable(*pclk); + if (err) { +- dev_err(&pdev->dev, "failed to enable pclk (%u)\n", err); ++ dev_err(&pdev->dev, "failed to enable pclk (%d)\n", err); + return err; + } + + err = clk_prepare_enable(*hclk); + if (err) { +- dev_err(&pdev->dev, "failed to enable hclk (%u)\n", err); ++ dev_err(&pdev->dev, "failed to enable hclk (%d)\n", err); + goto err_disable_pclk; + } + + err = clk_prepare_enable(*tx_clk); + if (err) { +- dev_err(&pdev->dev, "failed to enable tx_clk (%u)\n", err); ++ dev_err(&pdev->dev, "failed to enable tx_clk (%d)\n", err); + goto err_disable_hclk; + } + +@@ -2704,7 +2704,7 @@ static int at91ether_clk_init(struct pla + + err = clk_prepare_enable(*pclk); + if (err) { +- dev_err(&pdev->dev, "failed to enable pclk (%u)\n", err); ++ dev_err(&pdev->dev, "failed to enable pclk (%d)\n", err); + return err; + } + diff --git a/queue-4.4/pwm-clear-chip_data-in-pwm_put.patch b/queue-4.4/pwm-clear-chip_data-in-pwm_put.patch new file mode 100644 index 00000000000..aec3bb9e960 --- /dev/null +++ b/queue-4.4/pwm-clear-chip_data-in-pwm_put.patch @@ -0,0 +1,47 @@ +From e926b12c611c2095c7976e2ed31753ad6eb5ff1a Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Uwe=20Kleine-K=C3=B6nig?= +Date: Mon, 25 Mar 2019 10:49:33 +0100 +Subject: pwm: Clear chip_data in pwm_put() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Uwe Kleine-König + +commit e926b12c611c2095c7976e2ed31753ad6eb5ff1a upstream. + +After a PWM is disposed by its user the per chip data becomes invalid. +Clear the data in common code instead of the device drivers to get +consistent behaviour. Before this patch only three of nine drivers +cleaned up here. + +Signed-off-by: Uwe Kleine-König +Signed-off-by: Thierry Reding +Signed-off-by: Lee Jones +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/pwm/core.c | 1 + + drivers/pwm/pwm-samsung.c | 1 - + 2 files changed, 1 insertion(+), 1 deletion(-) + +--- a/drivers/pwm/core.c ++++ b/drivers/pwm/core.c +@@ -781,6 +781,7 @@ void pwm_put(struct pwm_device *pwm) + if (pwm->chip->ops->free) + pwm->chip->ops->free(pwm->chip, pwm); + ++ pwm_set_chip_data(pwm, NULL); + pwm->label = NULL; + + module_put(pwm->chip->ops->owner); +--- a/drivers/pwm/pwm-samsung.c ++++ b/drivers/pwm/pwm-samsung.c +@@ -226,7 +226,6 @@ static int pwm_samsung_request(struct pw + static void pwm_samsung_free(struct pwm_chip *chip, struct pwm_device *pwm) + { + devm_kfree(chip->dev, pwm_get_chip_data(pwm)); +- pwm_set_chip_data(pwm, NULL); + } + + static int pwm_samsung_enable(struct pwm_chip *chip, struct pwm_device *pwm) diff --git a/queue-4.4/series b/queue-4.4/series index 3437b7116c0..ea29be8297b 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -77,3 +77,7 @@ mtd-remove-a-debug-trace-in-mtdpart.c.patch staging-rtl8192e-fix-potential-use-after-free.patch usb-serial-ftdi_sio-add-device-ids-for-u-blox-c099-f9p.patch mei-bus-prefix-device-names-on-bus-with-the-bus-name.patch +media-v4l2-ctrl-fix-flags-for-do_white_balance.patch +net-macb-fix-error-format-in-dev_err.patch +pwm-clear-chip_data-in-pwm_put.patch +ath10k-restore-qca9880-ar1a-v1-detection.patch -- 2.47.3