Staging driver fixes for 5.14-rc5

Here are a few small staging driver fixes for 5.14-rc5 to resolve some
 reported problems.  They include:
 	- mt7621 driver fix
 	- rtl8723bs driver fixes
 	- rtl8712 driver fixes.
 Nothing major, just small problems resolved.
 
 All have been in linux-next for a while with no reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 
 iG0EABECAC0WIQT0tgzFv3jCIUoxPcsxR9QN2y37KQUCYQ+9kQ8cZ3JlZ0Brcm9h
 aC5jb20ACgkQMUfUDdst+ylsOwCcDMdcfuu1KI/gwuUwqvYqe+tJ8cUAn3oQSwV7
 aGb+wVJbgoXM0MFknrdA
 =B3Gi
 -----END PGP SIGNATURE-----

Merge tag 'staging-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging

Pull staging driver fixes from Greg KH:
 "Here are a few small staging driver fixes for 5.14-rc5 to resolve some
  reported problems. They include:

   - mt7621 driver fix

   - rtl8723bs driver fixes

   - rtl8712 driver fixes.

  Nothing major, just small problems resolved.

  All have been in linux-next for a while with no reported issues"

* tag 'staging-5.14-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
  staging: mt7621-pci: avoid to re-disable clock for those pcies not in use
  staging: rtl8712: error handling refactoring
  staging: rtl8712: get rid of flush_scheduled_work
  staging: rtl8723bs: select CONFIG_CRYPTO_LIB_ARC4
  staging: rtl8723bs: Fix a resource leak in sd_int_dpc
This commit is contained in:
Linus Torvalds 2021-08-08 10:29:39 -07:00
commit 911c3c5e01
9 changed files with 62 additions and 37 deletions

View File

@ -422,7 +422,6 @@ static void mt7621_pcie_init_ports(struct mt7621_pcie *pcie)
dev_err(dev, "pcie%d no card, disable it (RST & CLK)\n", dev_err(dev, "pcie%d no card, disable it (RST & CLK)\n",
slot); slot);
mt7621_control_assert(port); mt7621_control_assert(port);
clk_disable_unprepare(port->clk);
port->enabled = false; port->enabled = false;
if (slot == 0) { if (slot == 0) {

View File

@ -29,21 +29,31 @@
#define FWBUFF_ALIGN_SZ 512 #define FWBUFF_ALIGN_SZ 512
#define MAX_DUMP_FWSZ (48 * 1024) #define MAX_DUMP_FWSZ (48 * 1024)
static void rtl871x_load_fw_fail(struct _adapter *adapter)
{
struct usb_device *udev = adapter->dvobjpriv.pusbdev;
struct device *dev = &udev->dev;
struct device *parent = dev->parent;
complete(&adapter->rtl8712_fw_ready);
dev_err(&udev->dev, "r8712u: Firmware request failed\n");
if (parent)
device_lock(parent);
device_release_driver(dev);
if (parent)
device_unlock(parent);
}
static void rtl871x_load_fw_cb(const struct firmware *firmware, void *context) static void rtl871x_load_fw_cb(const struct firmware *firmware, void *context)
{ {
struct _adapter *adapter = context; struct _adapter *adapter = context;
if (!firmware) { if (!firmware) {
struct usb_device *udev = adapter->dvobjpriv.pusbdev; rtl871x_load_fw_fail(adapter);
struct usb_interface *usb_intf = adapter->pusb_intf;
dev_err(&udev->dev, "r8712u: Firmware request failed\n");
usb_put_dev(udev);
usb_set_intfdata(usb_intf, NULL);
r8712_free_drv_sw(adapter);
adapter->dvobj_deinit(adapter);
complete(&adapter->rtl8712_fw_ready);
free_netdev(adapter->pnetdev);
return; return;
} }
adapter->fw = firmware; adapter->fw = firmware;

View File

@ -1820,3 +1820,11 @@ void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction)
break; break;
} }
} }
void r8712_flush_led_works(struct _adapter *padapter)
{
struct led_priv *pledpriv = &padapter->ledpriv;
flush_work(&pledpriv->SwLed0.BlinkWorkItem);
flush_work(&pledpriv->SwLed1.BlinkWorkItem);
}

View File

@ -112,6 +112,7 @@ struct led_priv {
void r8712_InitSwLeds(struct _adapter *padapter); void r8712_InitSwLeds(struct _adapter *padapter);
void r8712_DeInitSwLeds(struct _adapter *padapter); void r8712_DeInitSwLeds(struct _adapter *padapter);
void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction); void LedControl871x(struct _adapter *padapter, enum LED_CTL_MODE LedAction);
void r8712_flush_led_works(struct _adapter *padapter);
#endif #endif

View File

@ -224,3 +224,11 @@ void r8712_unregister_cmd_alive(struct _adapter *padapter)
} }
mutex_unlock(&pwrctrl->mutex_lock); mutex_unlock(&pwrctrl->mutex_lock);
} }
void r8712_flush_rwctrl_works(struct _adapter *padapter)
{
struct pwrctrl_priv *pwrctrl = &padapter->pwrctrlpriv;
flush_work(&pwrctrl->SetPSModeWorkItem);
flush_work(&pwrctrl->rpwm_workitem);
}

View File

@ -108,5 +108,6 @@ void r8712_cpwm_int_hdl(struct _adapter *padapter,
void r8712_set_ps_mode(struct _adapter *padapter, uint ps_mode, void r8712_set_ps_mode(struct _adapter *padapter, uint ps_mode,
uint smart_ps); uint smart_ps);
void r8712_set_rpwm(struct _adapter *padapter, u8 val8); void r8712_set_rpwm(struct _adapter *padapter, u8 val8);
void r8712_flush_rwctrl_works(struct _adapter *padapter);
#endif /* __RTL871X_PWRCTRL_H_ */ #endif /* __RTL871X_PWRCTRL_H_ */

View File

@ -591,35 +591,30 @@ static void r871xu_dev_remove(struct usb_interface *pusb_intf)
{ {
struct net_device *pnetdev = usb_get_intfdata(pusb_intf); struct net_device *pnetdev = usb_get_intfdata(pusb_intf);
struct usb_device *udev = interface_to_usbdev(pusb_intf); struct usb_device *udev = interface_to_usbdev(pusb_intf);
struct _adapter *padapter = netdev_priv(pnetdev);
if (pnetdev) { /* never exit with a firmware callback pending */
struct _adapter *padapter = netdev_priv(pnetdev); wait_for_completion(&padapter->rtl8712_fw_ready);
usb_set_intfdata(pusb_intf, NULL);
release_firmware(padapter->fw);
if (drvpriv.drv_registered)
padapter->surprise_removed = true;
if (pnetdev->reg_state != NETREG_UNINITIALIZED)
unregister_netdev(pnetdev); /* will call netdev_close() */
r8712_flush_rwctrl_works(padapter);
r8712_flush_led_works(padapter);
udelay(1);
/* Stop driver mlme relation timer */
r8712_stop_drv_timers(padapter);
r871x_dev_unload(padapter);
r8712_free_drv_sw(padapter);
free_netdev(pnetdev);
/* never exit with a firmware callback pending */ /* decrease the reference count of the usb device structure
wait_for_completion(&padapter->rtl8712_fw_ready); * when disconnect
pnetdev = usb_get_intfdata(pusb_intf); */
usb_set_intfdata(pusb_intf, NULL); usb_put_dev(udev);
if (!pnetdev)
goto firmware_load_fail;
release_firmware(padapter->fw);
if (drvpriv.drv_registered)
padapter->surprise_removed = true;
if (pnetdev->reg_state != NETREG_UNINITIALIZED)
unregister_netdev(pnetdev); /* will call netdev_close() */
flush_scheduled_work();
udelay(1);
/* Stop driver mlme relation timer */
r8712_stop_drv_timers(padapter);
r871x_dev_unload(padapter);
r8712_free_drv_sw(padapter);
free_netdev(pnetdev);
/* decrease the reference count of the usb device structure
* when disconnect
*/
usb_put_dev(udev);
}
firmware_load_fail:
/* If we didn't unplug usb dongle and remove/insert module, driver /* If we didn't unplug usb dongle and remove/insert module, driver
* fails on sitesurvey for the first time when device is up. * fails on sitesurvey for the first time when device is up.
* Reset usb port for sitesurvey fail issue. * Reset usb port for sitesurvey fail issue.

View File

@ -5,6 +5,7 @@ config RTL8723BS
depends on m depends on m
select WIRELESS_EXT select WIRELESS_EXT
select WEXT_PRIV select WEXT_PRIV
select CRYPTO_LIB_ARC4
help help
This option enables support for RTL8723BS SDIO drivers, such as This option enables support for RTL8723BS SDIO drivers, such as
the wifi found on the 1st gen Intel Compute Stick, the CHIP the wifi found on the 1st gen Intel Compute Stick, the CHIP

View File

@ -909,6 +909,8 @@ void sd_int_dpc(struct adapter *adapter)
} else { } else {
rtw_c2h_wk_cmd(adapter, (u8 *)c2h_evt); rtw_c2h_wk_cmd(adapter, (u8 *)c2h_evt);
} }
} else {
kfree(c2h_evt);
} }
} else { } else {
/* Error handling for malloc fail */ /* Error handling for malloc fail */