Unverified Commit 362ef656 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!11335 Revert SPI bugfixs

Merge Pull Request from: @lujunhuaHW 
 
1、The SPI driver debugfs provides the datain and dataout register dump functions.
According to the code review, it is suspected that the SPI FIFO is read during the execution. If the SPI transfer is in progress at the same time, the data transfer in the FIFO will be affected. You are advised not to provide the dump function for this register.

2、Code review shows that the SPI driver may divide by zero.
The ratio of the user input speed_hz to the maximum rate configured in the BIOS must be limited to avoid the problem of dividing by zero or inversion, and the rate must be within the recommended rate range of the FS. 
 
Link:https://gitee.com/openeuler/kernel/pulls/11335

 

Signed-off-by: default avatarZhang Peng <zhangpeng362@huawei.com>
parents 1f0e4758 56a766fd
Loading
Loading
Loading
Loading
+2 −5
Original line number Diff line number Diff line
@@ -481,11 +481,8 @@ static int hisi_spi_probe(struct platform_device *pdev)
		return -EINVAL;
	}

	if (host->max_speed_hz == 0) {
		dev_err(dev, "invalid max SPI clocking speed, max-freq=%u\n",
				host->max_speed_hz);
		return -EINVAL;
	}
	if (host->max_speed_hz == 0)
		return dev_err_probe(dev, -EINVAL, "spi-max-frequency can't be 0\n");

	ret = device_property_read_u16(dev, "num-cs",
					&host->num_chipselect);