Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1696302

[PATCH 4.12 014/196] NFC: nfcmrvl: fix firmware-management initialisation

From Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Newsgroups linux.kernel
Subject [PATCH 4.12 014/196] NFC: nfcmrvl: fix firmware-management initialisation
Date 2017-07-25 22:20 +0200
Message-ID <u7ete-7sJ-81@gated-at.bofh.it> (permalink)
References <u7dGN-6Sz-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


4.12-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Johan Hovold <johan@kernel.org>

commit 45dd39b974f6632222dd5cdcbea7358a077ab0b0 upstream.

The nci-device was never deregistered in the event that
fw-initialisation failed.

Fix this by moving the firmware initialisation before device
registration since the firmware work queue should be available before
registering.

Note that this depends on a recent fix that moved device-name
initialisation back to to nci_allocate_device() as the
firmware-workqueue name is now derived from the nfc-device name.

Fixes: 3194c6870158 ("NFC: nfcmrvl: add firmware download support")
Cc: Vincent Cuissard <cuissard@marvell.com>
Signed-off-by: Johan Hovold <johan@kernel.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 drivers/nfc/nfcmrvl/main.c |   16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

--- a/drivers/nfc/nfcmrvl/main.c
+++ b/drivers/nfc/nfcmrvl/main.c
@@ -158,26 +158,28 @@ struct nfcmrvl_private *nfcmrvl_nci_regi
 		goto error_free_gpio;
 	}
 
+	rc = nfcmrvl_fw_dnld_init(priv);
+	if (rc) {
+		nfc_err(dev, "failed to initialize FW download %d\n", rc);
+		goto error_free_dev;
+	}
+
 	nci_set_drvdata(priv->ndev, priv);
 
 	rc = nci_register_device(priv->ndev);
 	if (rc) {
 		nfc_err(dev, "nci_register_device failed %d\n", rc);
-		goto error_free_dev;
+		goto error_fw_dnld_deinit;
 	}
 
 	/* Ensure that controller is powered off */
 	nfcmrvl_chip_halt(priv);
 
-	rc = nfcmrvl_fw_dnld_init(priv);
-	if (rc) {
-		nfc_err(dev, "failed to initialize FW download %d\n", rc);
-		goto error_free_dev;
-	}
-
 	nfc_info(dev, "registered with nci successfully\n");
 	return priv;
 
+error_fw_dnld_deinit:
+	nfcmrvl_fw_dnld_deinit(priv);
 error_free_dev:
 	nci_free_device(priv->ndev);
 error_free_gpio:

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 4.12 000/196] 4.12.4-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 013/196] NFC: nfcmrvl: use nfc-device for firmware download Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 021/196] perf intel-pt: Ensure IP is zero when state is INTEL_PT_STATE_NO_IP Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 016/196] nfc: Fix the sockaddr length sanitization in llcp_sock_connect Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 012/196] NFC: nfcmrvl: do not use device-managed resources Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 002/196] [media] ir-core: fix gcc-7 warning on bool arithmetic Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 020/196] perf intel-pt: Fix missing stack clear Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 018/196] perf intel-pt: Move decoder error setting into one condition Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 025/196] perf intel-pt: Clear FUP flag on error Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 014/196] NFC: nfcmrvl: fix firmware-management initialisation Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 024/196] perf intel-pt: Use FUP always when scanning for an IP Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 022/196] perf intel-pt: Fix last_ip usage Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  [PATCH 4.12 023/196] perf intel-pt: Ensure never to set last_ip when packet count is zero Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-25 22:20 +0200
  Re: [PATCH 4.12 000/196] 4.12.4-stable review Guenter Roeck <linux@roeck-us.net> - 2017-07-26 05:00 +0200
    Re: [PATCH 4.12 000/196] 4.12.4-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-26 22:00 +0200
  Re: [PATCH 4.12 000/196] 4.12.4-stable review Shuah Khan <shuahkh@osg.samsung.com> - 2017-07-26 16:30 +0200
    Re: [PATCH 4.12 000/196] 4.12.4-stable review Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-07-26 18:30 +0200

csiph-web