remove the sysfs notify from interrupt context

Remove the sysfs notify for sysfs node from usb interrupt
context, as sysfs_notify may be scheduled or sleep.

Change-Id: I45baf51b96506e4df6290b74c3a033240f8a1a83
Signed-off-by: Yonghua Yan <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/2293617
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Yonghua Yan 2022-06-08 17:12:58 +08:00
commit 3006d8909c

View file

@ -846,9 +846,6 @@ static void do_set_config(struct usb_function *f, u16 new_config)
context->subnet_mask = 0;
context->router_ip = 0;
context->iff_flag = 0;
sysfs_notify(&context->dev->dev.kobj, NULL, "ip_addr");
sysfs_notify(&context->dev->dev.kobj, NULL, "subnet_mask");
sysfs_notify(&context->dev->dev.kobj, NULL, "iff_flag");
schedule_work(&context->usbnet_config_wq);
}
}
@ -881,12 +878,10 @@ static int usbnet_ctrlrequest(
case USBNET_SET_IP_ADDRESS:
context->ip_addr = (wValue << 16) | wIndex;
rc = 0;
sysfs_notify(&context->dev->dev.kobj, NULL, "ip_addr");
break;
case USBNET_SET_SUBNET_MASK:
context->subnet_mask = (wValue << 16) | wIndex;
rc = 0;
sysfs_notify(&context->dev->dev.kobj, NULL, "subnet_mask");
break;
case USBNET_SET_HOST_IP:
context->router_ip = (wValue << 16) | wIndex;
@ -899,7 +894,6 @@ static int usbnet_ctrlrequest(
if (context->ip_addr && context->subnet_mask
&& context->router_ip) {
context->iff_flag = IFF_UP;
sysfs_notify(&context->dev->dev.kobj, NULL, "iff_flag");
/* schedule a work queue to do this because we
need to be able to sleep */
schedule_work(&context->usbnet_config_wq);