Commit a1f8b587 authored by Wujiahai's avatar Wujiahai Committed by Wang Hai
Browse files

BMA/veth_drv: Fix soft interrupt loops and change the version number

driver inclusion
category: bugfix
bugzilla: https://gitee.com/openeuler/kernel/issues/IA97VA


CVE: NA

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

1. a low probability that iBMA veth driver causes soft interrupt loops
2. Change the iBMA driver version.

Fixes: 22c4847a ("Huawei BMA: Fix iBMA driver bug")
Signed-off-by: default avatarWujiahai <wujiahai@huawei.com>
parent 4321c8c8
Loading
Loading
Loading
Loading
+11 −1
Original line number Original line Diff line number Diff line
@@ -87,6 +87,13 @@ u32 g_testlbk;


struct bspveth_device g_bspveth_dev = {};
struct bspveth_device g_bspveth_dev = {};


/* g_shutdown_flag is used to prevent veth_shutdown_task
 * from being preempted by veth_dma_tx_timer_do_H.
 * The default value is 0.The value 1
 * indicates that veth_shutdown_flag cannot be preempted,
 * and the value 0 indicates that veth_shutdown_task can be preempted.
 */
static int g_shutdown_flag;
static int veth_int_handler(struct notifier_block *pthis, unsigned long ev,
static int veth_int_handler(struct notifier_block *pthis, unsigned long ev,
			    void *unuse);
			    void *unuse);


@@ -1607,6 +1614,7 @@ void veth_netdev_exit(void)
static void veth_shutdown_task(struct work_struct *work)
static void veth_shutdown_task(struct work_struct *work)
{
{
	struct net_device *netdev = g_bspveth_dev.pnetdev;
	struct net_device *netdev = g_bspveth_dev.pnetdev;
	g_shutdown_flag = 1;


	VETH_LOG(DLOG_ERROR, "veth is going down, please restart it manual\n");
	VETH_LOG(DLOG_ERROR, "veth is going down, please restart it manual\n");


@@ -1626,6 +1634,7 @@ static void veth_shutdown_task(struct work_struct *work)


		(void)veth_dmatimer_close_H();
		(void)veth_dmatimer_close_H();
	}
	}
	g_shutdown_flag = 0;
}
}


s32 veth_netdev_init(void)
s32 veth_netdev_init(void)
@@ -1728,7 +1737,8 @@ void veth_dma_tx_timer_do_H(unsigned long data)


	rxret = veth_dma_task_H(BSPVETH_RX);
	rxret = veth_dma_task_H(BSPVETH_RX);


	if (txret == BSP_ERR_AGAIN || rxret == BSP_ERR_AGAIN) {
	if ((txret == BSP_ERR_AGAIN || rxret == BSP_ERR_AGAIN) &&
	    g_shutdown_flag == 0) {
#ifndef USE_TASKLET
#ifndef USE_TASKLET
		(void)mod_timer(&g_bspveth_dev.dmatimer, jiffies_64);
		(void)mod_timer(&g_bspveth_dev.dmatimer, jiffies_64);
#else
#else
+1 −1
Original line number Original line Diff line number Diff line
@@ -31,7 +31,7 @@ extern "C" {
#ifdef DRV_VERSION
#ifdef DRV_VERSION
#define VETH_VERSION	MICRO_TO_STR(DRV_VERSION)
#define VETH_VERSION	MICRO_TO_STR(DRV_VERSION)
#else
#else
#define VETH_VERSION	"0.3.5"
#define VETH_VERSION	"0.3.7"
#endif
#endif


#define MODULE_NAME	"veth"
#define MODULE_NAME	"veth"