gpio: mpc8xxx: Add platform device to gpiochip->parent
Subsystems (8)
Sasha Levin
maintainerPATCH 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
@@ -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
Sasha Levin
maintainerPATCH 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--- drivers/gpio/gpiolib.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpio/gpiolib.c +3 -2
@@ -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
Sasha Levin
maintainerPATCH 3/10 scsi: mpt3sas: Fix double free in attach error handling
In reply to Sasha LevinFrom: 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
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +0 -1
@@ -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
Sasha Levin
maintainerPATCH 4/10 scsi: libcxgbi: fix NULL pointer dereference in cxgbi_device_destroy()
In reply to Sasha LevinFrom: 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
@@ -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
Sasha Levin
maintainerPATCH 5/10 scsi: target/iblock: Fix protection error with blocks greater than 512B
In reply to Sasha LevinFrom: 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
@@ -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
maintainerPATCH 6/10 PM / devfreq: tegra: Add COMMON_CLK dependency
In reply to Sasha LevinFrom: 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'
--- drivers/devfreq/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/devfreq/Kconfig +1 -0
@@ -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
Sasha Levin
maintainerPATCH 7/10 cifs: Adjust indentation in smb2_open_file
In reply to Sasha LevinFrom: 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
@@ -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
Sasha Levin
maintainerPATCH 8/10 selftests: firmware: Fix it to do root uid check and skip
In reply to Sasha LevinFrom: 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=yCONFIG_FW_LOADER=yCONFIG_FW_LOADER_USER_HELPER=yCONFIG_IKCONFIG=yCONFIG_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
@@ -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
Sasha Levin
maintainerPATCH 9/10 rseq/selftests: Turn off timeout setting
In reply to Sasha LevinFrom: 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.
--- 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
@@ -0,0 +1 @@ +timeout=0
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 10/10 riscv: export flush_icache_all to modules
In reply to Sasha LevinFrom: 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
@@ -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