Unverified Commit 0e54270d authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!10324 BMA: Fix iBMA bug and change

Merge Pull Request from: @ci-robot 
 
PR sync from: Wang Hai <wanghai38@huawei.com>
https://mailweb.openeuler.org/hyperkitty/list/kernel@openeuler.org/message/JBIJJX225H34T47OGGCKIZQ5NUSJZVFD/ 
From: Wujiahai <wujiahai@huawei.com>

1. a low probability that iBMA cdev_veth driver causes softlockup problem
2. a low probability that iBMA veth driver causes soft interrupt loops
3. Change the iBMA driver version.
4. Resolved the problem that the DMA reset does not meet the
   expectation due to the mismatch between the register configuration
   and the communication transmission direction during DMA reset.

Wujiahai (5):
  BMA/edma_drv: Fix DMA reset problem and change the version number.
  BMA/cdev_drv: Change the version number.
  BMA/veth_drv: Fix soft interrupt loops and change the version number
  BMA/kbox_drv: Change the version number.
  BMA/cdev_veth_drv: Fix softlockup problem


-- 
2.27.0
 
https://gitee.com/openeuler/kernel/issues/IA97VA 
 
Link:https://gitee.com/openeuler/kernel/pulls/10324

 

Reviewed-by: default avatarChen Jiesong <chenjiesong@huawei.com>
Signed-off-by: default avatarZhang Changzhong <zhangchangzhong@huawei.com>
parents 365ea86d bc4008d2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -28,7 +28,7 @@
#ifdef DRV_VERSION
#define CDEV_VERSION		MICRO_TO_STR(DRV_VERSION)
#else
#define CDEV_VERSION		"0.3.5"
#define CDEV_VERSION		"0.3.7"
#endif

#define CDEV_DEFAULT_NUM	4
+8 −6
Original line number Diff line number Diff line
@@ -667,6 +667,7 @@ static int edma_veth_copy_full_packet(struct edma_eth_dev_s *eth_dev,
				      u8 *packet, u32 len)
{
	unsigned int count = 0;
	unsigned long flags = 0;
	u8 *ptr = NULL;

	LOG(DLOG_DEBUG, "Recv full packet, len %u.", len);
@@ -674,14 +675,14 @@ static int edma_veth_copy_full_packet(struct edma_eth_dev_s *eth_dev,
	ptr = kmalloc(len, GFP_ATOMIC);
	if (ptr) {
		/* lock the queue. */
		spin_lock(&eth_dev->rx_queue_lock);
		spin_lock_irqsave(&eth_dev->rx_queue_lock, flags);

		count = edma_veth_get_ring_buf_count(eth_dev->rx_packet_head,
						     eth_dev->rx_packet_tail,
						     MAX_RXTX_PACKET_LEN);
		if (count >= (MAX_RXTX_PACKET_LEN - 1)) {
			LOG(DLOG_DEBUG, "The rx queue is full.");
			spin_unlock(&eth_dev->rx_queue_lock);
			spin_unlock_irqrestore(&eth_dev->rx_queue_lock, flags);
			kfree(ptr);
			return -EBUSY;
		}
@@ -692,7 +693,7 @@ static int edma_veth_copy_full_packet(struct edma_eth_dev_s *eth_dev,
		eth_dev->rx_packet_tail = (eth_dev->rx_packet_tail + 1) %
					   MAX_RXTX_PACKET_LEN;

		spin_unlock(&eth_dev->rx_queue_lock);
		spin_unlock_irqrestore(&eth_dev->rx_queue_lock, flags);

		return 0;
	}
@@ -1672,16 +1673,17 @@ static ssize_t cdev_copy_packet_to_user(struct edma_eth_dev_s *dev,
	unsigned char *packet = NULL;
	unsigned char *start = NULL;
	unsigned int free_packet = 0;
	unsigned long flags = 0;
	ssize_t length = (ssize_t)count;
	ssize_t left;

	LOG(DLOG_DEBUG, "rx_packet_head:%u, rx_packet_tail: %u",
	    dev->rx_packet_head, dev->rx_packet_tail);

	spin_lock(&dev->rx_queue_lock);
	spin_lock_irqsave(&dev->rx_queue_lock, flags);

	if (!cdev_check_ring_recv()) {
		spin_unlock(&dev->rx_queue_lock);
		spin_unlock_irqrestore(&dev->rx_queue_lock, flags);
		return -EAGAIN;
	}

@@ -1712,7 +1714,7 @@ static ssize_t cdev_copy_packet_to_user(struct edma_eth_dev_s *dev,
				      MAX_RXTX_PACKET_LEN;
	}

	spin_unlock(&dev->rx_queue_lock);
	spin_unlock_irqrestore(&dev->rx_queue_lock, flags);

	if (length > 0 && copy_to_user(data, start, length)) {
		LOG(DLOG_DEBUG, "Failed to copy to user, skip this message.");
+1 −1
Original line number Diff line number Diff line
@@ -71,7 +71,7 @@ struct bma_pci_dev_s {
#ifdef DRV_VERSION
#define BMA_VERSION MICRO_TO_STR(DRV_VERSION)
#else
#define BMA_VERSION "0.3.5"
#define BMA_VERSION "0.3.7"
#endif

#ifdef CONFIG_ARM64
+2 −2
Original line number Diff line number Diff line
@@ -689,9 +689,9 @@ void edma_host_reset_dma(struct edma_host_s *edma_host, int dir)
		return;

	if (dir == BMC_TO_HOST)
		reg_addr = REG_PCIE1_DMA_READ_ENGINE_ENABLE;
	else if (dir == HOST_TO_BMC)
		reg_addr = REG_PCIE1_DMA_WRITE_ENGINE_ENABLE;
	else if (dir == HOST_TO_BMC)
		reg_addr = REG_PCIE1_DMA_READ_ENGINE_ENABLE;
	else
		return;

+1 −1
Original line number Diff line number Diff line
@@ -23,7 +23,7 @@
#ifdef DRV_VERSION
#define KBOX_VERSION MICRO_TO_STR(DRV_VERSION)
#else
#define KBOX_VERSION "0.3.5"
#define KBOX_VERSION "0.3.7"
#endif

#define UNUSED(x) (x = x)
Loading