Skip to contentSkip to conversation

gpio: mpc8xxx: Add platform device to gpiochip->parent

PATCH New Sasha Levin 1 participant 10 messages Jan 4, 2020

Subsystems (8)
Stable branch SCSI Kselftest GPIO +4 more subsystems
lore
Share & tools
lore
author maintainer
#4 lore raw

PATCH 5/10 scsi: target/iblock: Fix protection error with blocks greater than 512B

In reply to Sasha Levin

From: Israel Rukshin <[email protected]>

[ Upstream commit e4dc9a4c31fe10d1751c542702afc85be8a5c56a ]

The sector size of the block layer is 512 bytes, but integrity interval size might be different (in case of 4K block size of the media). At the initiator side the virtual start sector is the one that was originally submitted by the block layer (512 bytes) for the Reftag usage. The initiator converts the Reftag to integrity interval units and sends it to the target. So the target virtual start sector should be calculated at integrity interval units. prepare_fn() and complete_fn() don't remap correctly the Reftag when using incorrect units of the virtual start sector, which leads to the following protection error at the device:

"blk_update_request: protection error, dev sdb, sector 2048 op 0x0:(READ) flags 0x10000 phys_seg 1 prio class 0"

To fix that, set the seed in integrity interval units.

---
 drivers/target/target_core_iblock.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/target/target_core_iblock.c +3 -1
index 6949ea8bc387..51ffd5c002de 100644
@@ -646,7 +646,9 @@ iblock_alloc_bip(struct se_cmd *cmd, struct bio *bio,
 	}
 
 	bip->bip_iter.bi_size = bio_integrity_bytes(bi, bio_sectors(bio));
-	bip_set_seed(bip, bio->bi_iter.bi_sector);
+	/* virtual start sector must be in integrity interval units */
+	bip_set_seed(bip, bio->bi_iter.bi_sector >>
+				  (bi->interval_exp - SECTOR_SHIFT));
 
 	pr_debug("IBLOCK BIP Size: %u Sector: %llu\n", bip->bip_iter.bi_size,
 		 (unsigned long long)bip->bip_iter.bi_sector);
Signature · 1 line
2.20.1

Sasha Levin

author maintainer
#0 lore raw

PATCH 1/10 gpio: mpc8xxx: Add platform device to gpiochip->parent

From: Johnson CH Chen (陳昭勳) <[email protected]>

[ Upstream commit 322f6a3182d42df18059a89c53b09d33919f755e ]

Dear Linus Walleij,

In old kernels, some APIs still try to use parent->of_node from struct gpio_chip, and it could be resulted in kernel panic because parent is NULL. Adding platform device to gpiochip->parent can fix this problem.

---
 drivers/gpio/gpio-mpc8xxx.c | 1 +
 1 file changed, 1 insertion(+)
drivers/gpio/gpio-mpc8xxx.c +1 -0
index 16a47de29c94..161e3ff4106a 100644
@@ -346,6 +346,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)
 		return -ENOMEM;
 
 	gc = &mpc8xxx_gc->gc;
+	gc->parent = &pdev->dev;
 
 	if (of_property_read_bool(np, "little-endian")) {
 		ret = bgpio_init(gc, &pdev->dev, 4,
Signature · 1 line
2.20.1
author maintainer
#1 lore raw

PATCH 2/10 gpio: Fix error message on out-of-range GPIO in lookup table

From: Geert Uytterhoeven <[email protected]>

[ Upstream commit d935bd50dd14a7714cbdba9a76435dbb56edb1ae ]

When a GPIO offset in a lookup table is out-of-range, the printed error message (1) does not include the actual out-of-range value, and (2) contains an off-by-one error in the upper bound.

Avoid user confusion by also printing the actual GPIO offset, and correcting the upper bound of the range.
While at it, use "%u" for unsigned int.

Sample impact:

    -requested GPIO 0 is out of range [0..32] for chip e6052000.gpio
    +requested GPIO 0 (45) is out of range [0..31] for chip e6052000.gpio
Fixes 2a3cf6a3599e9015 ("gpiolib: return -ENOENT if no GPIO mapping exists")
---
 drivers/gpio/gpiolib.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpio/gpiolib.c +3 -2
index 104ed299d5ea..e4afe60f8594 100644
@@ -4320,8 +4320,9 @@ static struct gpio_desc *gpiod_find(struct device *dev, const char *con_id,
 
 		if (chip->ngpio <= p->chip_hwnum) {
 			dev_err(dev,
-				"requested GPIO %d is out of range [0..%d] for chip %s\n",
-				idx, chip->ngpio, chip->label);
+				"requested GPIO %u (%u) is out of range [0..%u] for chip %s\n",
+				idx, p->chip_hwnum, chip->ngpio - 1,
+				chip->label);
 			return ERR_PTR(-EINVAL);
 		}
 
Signature · 1 line
2.20.1
author maintainer
#2 lore raw

PATCH 3/10 scsi: mpt3sas: Fix double free in attach error handling

In reply to Sasha Levin

From: Dan Carpenter <[email protected]>

[ Upstream commit ee560e7bbab0c10cf3f0e71997fbc354ab2ee5cb ]

The caller also calls _base_release_memory_pools() on error so it leads to a number of double frees:

drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->chain_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->hpr_lookup' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->internal_lookup' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->pcie_sgl_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_free_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_post_free_array_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_post_free_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->sense_dma_pool' double freed

Fixes 74522a92bbf0 ("scsi: mpt3sas: Optimize I/O memory consumption in driver.")
---
 drivers/scsi/mpt3sas/mpt3sas_base.c | 1 -
 1 file changed, 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +0 -1
index fea3cb6a090b..752b71cfbe12 100644
@@ -5234,7 +5234,6 @@ _base_allocate_memory_pools(struct MPT3SAS_ADAPTER *ioc)
 					&ct->chain_buffer_dma);
 			if (!ct->chain_buffer) {
 				ioc_err(ioc, "chain_lookup: pci_pool_alloc failed\n");
-				_base_release_memory_pools(ioc);
 				goto out;
 			}
 		}
Signature · 1 line
2.20.1
author maintainer
#3 lore raw

PATCH 4/10 scsi: libcxgbi: fix NULL pointer dereference in cxgbi_device_destroy()

In reply to Sasha Levin

From: Varun Prakash <[email protected]>

[ Upstream commit 71482fde704efdd8c3abe0faf34d922c61e8d76b ]

If cxgb4i_ddp_init() fails then cdev->cdev2ppm will be NULL, so add a check for NULL pointer before dereferencing it.

---
 drivers/scsi/cxgbi/libcxgbi.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/cxgbi/libcxgbi.c +2 -1
index 3e17af8aedeb..2cd2761bd249 100644
@@ -121,7 +121,8 @@ static inline void cxgbi_device_destroy(struct cxgbi_device *cdev)
 		"cdev 0x%p, p# %u.\n", cdev, cdev->nports);
 	cxgbi_hbas_remove(cdev);
 	cxgbi_device_portmap_cleanup(cdev);
-	cxgbi_ppm_release(cdev->cdev2ppm(cdev));
+	if (cdev->cdev2ppm)
+		cxgbi_ppm_release(cdev->cdev2ppm(cdev));
 	if (cdev->pmap.max_connect)
 		cxgbi_free_big_mem(cdev->pmap.port_csk);
 	kfree(cdev);
Signature · 1 line
2.20.1
author maintainer
#6 lore raw

PATCH 7/10 cifs: Adjust indentation in smb2_open_file

In reply to Sasha Levin

From: Nathan Chancellor <[email protected]>

[ Upstream commit 7935799e041ae10d380d04ea23868240f082bd11 ]

Clang warns:

../fs/cifs/smb2file.c:70:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]

         if (oparms->tcon->use_resilient) {
         ^
../fs/cifs/smb2file.c:66:2: note: previous statement is here
        if (rc)
        ^

1 warning generated.

This warning occurs because there is a space after the tab on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns.

---
 fs/cifs/smb2file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/smb2file.c +1 -1
index 8b0b512c5792..afe1f03aabe3 100644
@@ -67,7 +67,7 @@ smb2_open_file(const unsigned int xid, struct cifs_open_parms *oparms,
 		goto out;
 
 
-	 if (oparms->tcon->use_resilient) {
+	if (oparms->tcon->use_resilient) {
 		/* default timeout is 0, servers pick default (120 seconds) */
 		nr_ioctl_req.Timeout =
 			cpu_to_le32(oparms->tcon->handle_timeout);
Signature · 1 line
2.20.1
author maintainer
#5 lore raw

PATCH 6/10 PM / devfreq: tegra: Add COMMON_CLK dependency

In reply to Sasha Levin

From: Arnd Bergmann <[email protected]>

[ Upstream commit 5fdb0684b5b0f41402161f068d3d84bf6ed1c3f4 ]

Compile-testing this driver fails if CONFIG_COMMON_CLK is not set:

drivers/devfreq/tegra30-devfreq.o: In function `tegra_devfreq_target':
tegra30-devfreq.c:(.text+0x164): undefined reference to `clk_set_min_rate'

Fixes 35f8dbc72721 ("PM / devfreq: tegra: Enable COMPILE_TEST for the driver")
---
 drivers/devfreq/Kconfig | 1 +
 1 file changed, 1 insertion(+)
drivers/devfreq/Kconfig +1 -0
index defe1d438710..af4a3ccb96b3 100644
@@ -99,6 +99,7 @@ config ARM_TEGRA_DEVFREQ
 		ARCH_TEGRA_210_SOC || \
 		COMPILE_TEST
 	select PM_OPP
+	depends on COMMON_CLK
 	help
 	  This adds the DEVFREQ driver for the Tegra family of SoCs.
 	  It reads ACTMON counters of memory controllers and adjusts the
Signature · 1 line
2.20.1
author maintainer
#7 lore raw

PATCH 8/10 selftests: firmware: Fix it to do root uid check and skip

In reply to Sasha Levin

From: Shuah Khan <[email protected]>

[ Upstream commit c65e41538b04e0d64a673828745a00cb68a24371 ]

firmware attempts to load test modules that require root access and fail. Fix it to check for root uid and exit with skip code instead.

Before this fix:

selftests: firmware: fw_run_tests.sh
modprobe: ERROR: could not insert 'test_firmware': Operation not permitted You must have the following enabled in your kernel:
CONFIG_TEST_FIRMWARE=y
CONFIG_FW_LOADER=y
CONFIG_FW_LOADER_USER_HELPER=y
CONFIG_IKCONFIG=y
CONFIG_IKCONFIG_PROC=y
not ok 1 selftests: firmware: fw_run_tests.sh # SKIP

With this fix:

selftests: firmware: fw_run_tests.sh
skip all tests: must be run as root
not ok 1 selftests: firmware: fw_run_tests.sh # SKIP

---
 tools/testing/selftests/firmware/fw_lib.sh | 6 ++++++
 1 file changed, 6 insertions(+)
tools/testing/selftests/firmware/fw_lib.sh +6 -0
index b879305a766d..5b8c0fedee76 100755
@@ -34,6 +34,12 @@ test_modprobe()
 
 check_mods()
 {
+	local uid=$(id -u)
+	if [ $uid -ne 0 ]; then
+		echo "skip all tests: must be run as root" >&2
+		exit $ksft_skip
+	fi
+
 	trap "test_modprobe" EXIT
 	if [ ! -d $DIR ]; then
 		modprobe test_firmware
Signature · 1 line
2.20.1
author maintainer
#9 lore raw

PATCH 10/10 riscv: export flush_icache_all to modules

In reply to Sasha Levin

From: Olof Johansson <[email protected]>

[ Upstream commit 1833e327a5ea1d1f356fbf6ded0760c9ff4b0594 ]

This is needed by LKDTM (crash dump test module), it calls flush_icache_range(), which on RISC-V turns into flush_icache_all(). On other architectures, the actual implementation is exported, so follow that precedence and export it here too.

Fixes build of CONFIG_LKDTM that fails with:
ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!

---
 arch/riscv/mm/cacheflush.c | 1 +
 1 file changed, 1 insertion(+)
arch/riscv/mm/cacheflush.c +1 -0
index 3f15938dec89..c54bd3c79955 100644
@@ -14,6 +14,7 @@ void flush_icache_all(void)
 {
 	sbi_remote_fence_i(NULL);
 }
+EXPORT_SYMBOL(flush_icache_all);
 
 /*
  * Performs an icache flush for the given MM context.  RISC-V has no direct
Signature · 1 line
2.20.1
author maintainer
#8 lore raw

PATCH 9/10 rseq/selftests: Turn off timeout setting

In reply to Sasha Levin

From: Mathieu Desnoyers <[email protected]>

[ Upstream commit af9cb29c5488381083b0b5ccdfb3cd931063384a ]

As the rseq selftests can run for a long period of time, disable the timeout that the general selftests have.

Cc Shuah Khan <[email protected]>
Cc Thomas Gleixner <[email protected]>
Cc Peter Zijlstra (Intel) <[email protected]>
Cc "Paul E. McKenney" <[email protected]>
Cc Boqun Feng <[email protected]>
Cc "H . Peter Anvin" <[email protected]>
Cc Paul Turner <[email protected]>
Cc Dmitry Vyukov <[email protected]>
---
 tools/testing/selftests/rseq/settings | 1 +
 1 file changed, 1 insertion(+)
 create mode 100644 tools/testing/selftests/rseq/settings
tools/testing/selftests/rseq/settings new file +1 -0
new file mode 100644
index 000000000000..e7b9417537fb
@@ -0,0 +1 @@
+timeout=0
Signature · 1 line
2.20.1