3.18.83-stable review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 3.18.83-stable review
This is the start of the stable review cycle for the 3.18.83 release. There are 38 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Nov 21 14:29:00 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.83-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-3.18.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 3.18.83-rc1
Johan Hovold <[email protected]>
USB: serial: garmin_gps: fix memory leak on probe errors
Johan Hovold <[email protected]>
USB: serial: garmin_gps: fix I/O after failed probe and remove
Johan Hovold <[email protected]>
USB: serial: garmin_gps: fix memory leak on failed URB submit
Douglas Fischer <[email protected]>
USB: serial: qcserial: add pid/vid for Sierra Wireless EM7355 fw update
Bernhard Rosenkraenzer <[email protected]>
USB: Add delay-init quirk for Corsair K70 LUX keyboards
Alan Stern <[email protected]>
USB: usbfs: compute urb->actual_length for isochronous
Dmitry V. Levin <[email protected]>
uapi: fix linux/rds.h userspace compilation errors
Dmitry V. Levin <[email protected]>
uapi: fix linux/rds.h userspace compilation error
Sasha Levin <[email protected]>
Revert "uapi: fix linux/rds.h userspace compilation errors"
Sasha Levin <[email protected]>
Revert "crypto: xts - Add ECB dependency"
Paul Burton <[email protected]>
MIPS: Netlogic: Exclude netlogic,xlp-pic code from XLR builds
Marcin Nowakowski <[email protected]>
MIPS: init: Ensure reserved memory regions are not added to bootmem
Paul Burton <[email protected]>
MIPS: End asm function prologue macros with .insn
Emil Tantilov <[email protected]>
ixgbe: handle close/suspend race with netif_device_detach/present
Emil Tantilov <[email protected]>
ixgbe: fix AER error handling
Arvind Yadav <[email protected]>
gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap
Alexey Khoroshilov <[email protected]>
backlight: adp5520: Fix error handling in adp5520_bl_probe()
Uwe Kleine-König <[email protected]>
backlight: lcd: Fix race condition during register
Takashi Iwai <[email protected]>
ALSA: vx: Fix possible transfer overflow
Takashi Iwai <[email protected]>
ALSA: vx: Don't try to update capture stream before running
James Smart <[email protected]>
scsi: lpfc: Correct issue leading to oops during link reset
James Smart <[email protected]>
scsi: lpfc: Correct host name in symbolic_name field
James Smart <[email protected]>
scsi: lpfc: FCoE VPort enable-disable does not bring up the VPort
James Smart <[email protected]>
scsi: lpfc: Add missing memory barrier
Galo Navarro <[email protected]>
staging: rtl8188eu: fix incorrect ERROR tags from logs
Hannu Lounento <[email protected]>
igb: Fix hw_dbg logging in igb_update_flash_i210
Todd Fujinaka <[email protected]>
igb: close/suspend race in netif_device_detach
Aaron Sierra <[email protected]>
igb: reset the PHY before reading the PHY ID
Arvind Yadav <[email protected]>
drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache
Geert Uytterhoeven <[email protected]>
ata: SATA_MV should depend on HAS_DMA
Geert Uytterhoeven <[email protected]>
ata: SATA_HIGHBANK should depend on HAS_DMA
Geert Uytterhoeven <[email protected]>
ata: ATA_BMDMA should depend on HAS_DMA
Tony Lindgren <[email protected]>
ARM: dts: Fix omap3 off mode pull defines
Tony Lindgren <[email protected]>
ARM: OMAP2+: Fix init for multiple quirks for the same SoC
Roger Quadros <[email protected]>
extcon: palmas: Check the parent instance to prevent the NULL
Nicholas Bellinger <[email protected]>
iscsi-target: Fix iscsi_np reset hung task during parallel delete
Andrey Konovalov <[email protected]>
media: dib0700: fix invalid dvb_detach argument
Arvind Yadav <[email protected]>
media: imon: Fix null-ptr-deref in imon_probe
-------------
Diffstat:
Makefile | 4 +- arch/arm/mach-omap2/pdata-quirks.c | 1 - arch/mips/include/asm/asm.h | 10 ++- arch/mips/kernel/setup.c | 4 + arch/mips/netlogic/common/irq.c | 4 +- crypto/Kconfig | 1 - drivers/ata/Kconfig | 3 + drivers/extcon/extcon-palmas.c | 5 ++ drivers/gpu/drm/mgag200/mgag200_main.c | 2 + drivers/gpu/drm/sti/sti_vtg.c | 4 + drivers/media/rc/imon.c | 5 ++ drivers/media/usb/dvb-usb/dib0700_devices.c | 24 +++--- drivers/net/ethernet/intel/igb/e1000_82575.c | 11 +++ drivers/net/ethernet/intel/igb/e1000_i210.c | 4 +- drivers/net/ethernet/intel/igb/igb_main.c | 21 +++--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 23 +++--- drivers/scsi/lpfc/lpfc_attr.c | 17 +++++ drivers/scsi/lpfc/lpfc_sli.c | 3 + drivers/scsi/lpfc/lpfc_vport.c | 8 ++ drivers/staging/rtl8188eu/include/rtw_debug.h | 2 +- drivers/target/iscsi/iscsi_target.c | 1 + drivers/target/iscsi/iscsi_target_core.h | 1 + drivers/target/iscsi/iscsi_target_login.c | 7 +- drivers/usb/core/devio.c | 14 ++++ drivers/usb/core/quirks.c | 3 + drivers/usb/serial/garmin_gps.c | 23 +++++- drivers/usb/serial/qcserial.c | 1 + drivers/video/backlight/adp5520_bl.c | 12 ++- drivers/video/backlight/lcd.c | 4 +- include/dt-bindings/pinctrl/omap.h | 4 +- include/target/iscsi/iscsi_target_core.h | 1 + include/uapi/linux/rds.h | 102 +++++++++++++------------- sound/drivers/vx/vx_pcm.c | 8 +- sound/pci/vx222/vx222_ops.c | 12 +-- sound/pcmcia/vx/vxp_ops.c | 12 +-- 35 files changed, 239 insertions(+), 122 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/38 media: imon: Fix null-ptr-deref in imon_probe
3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arvind Yadav <[email protected]>
commit 58fd55e838276a0c13d1dc7c387f90f25063cbf3 upstream.
It seems that the return value of usb_ifnum_to_if() can be NULL and needs to be checked.
--- drivers/media/rc/imon.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/media/rc/imon.c +5 -0
@@ -2419,6 +2419,11 @@ static int imon_probe(struct usb_interfamutex_lock (&driver_lock); first_if =usb_ifnum_to_if (usbdev,0 ); +if (!first_if) { + ret = -ENODEV ; + goto fail; + } + first_if_ctx =usb_get_intfdata (first_if);if (ifnum ==0 ) {
Greg Kroah-Hartman
maintainerPATCH 2/38 media: dib0700: fix invalid dvb_detach argument
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Andrey Konovalov <[email protected]>
commit eb0c19942288569e0ae492476534d5a485fb8ab4 upstream.
dvb_detach(arg) calls symbol_put_addr(arg), where arg should be a pointer to a function. Right now a pointer to state->dib7000p_ops is passed to dvb_detach(), which causes a BUG() in symbol_put_addr() as discovered by syzkaller. Pass state->dib7000p_ops.set_wbd_ref instead.
------------[ cut here ]------------ kernel BUG at kernel/module.c:1081! invalid opcode: 0000 [#1] PREEMPT SMP KASAN Modules linked in: CPU: 1 PID: 1151 Comm: kworker/1:1 Tainted: G W 4.14.0-rc1-42251-gebb2c2437d80 #224 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Bochs 01/01/2011 Workqueue: usb_hub_wq hub_event task: ffff88006a336300 task.stack: ffff88006a7c8000 RIP: 0010:symbol_put_addr+0x54/0x60 kernel/module.c:1083 RSP: 0018:ffff88006a7ce210 EFLAGS: 00010246 RAX: 0000000000000000 RBX: ffff880062a8d190 RCX: 0000000000000000 RDX: dffffc0000000020 RSI: ffffffff85876d60 RDI: ffff880062a8d190 RBP: ffff88006a7ce218 R08: 1ffff1000d4f9c12 R09: 1ffff1000d4f9ae4 R10: 1ffff1000d4f9bed R11: 0000000000000000 R12: ffff880062a8d180 R13: 00000000ffffffed R14: ffff880062a8d190 R15: ffff88006947c000 FS: 0000000000000000(0000) GS:ffff88006c900000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f6416532000 CR3: 00000000632f5000 CR4: 00000000000006e0 Call Trace: stk7070p_frontend_attach+0x515/0x610 drivers/media/usb/dvb-usb/dib0700_devices.c:1013 dvb_usb_adapter_frontend_init+0x32b/0x660 drivers/media/usb/dvb-usb/dvb-usb-dvb.c:286 dvb_usb_adapter_init drivers/media/usb/dvb-usb/dvb-usb-init.c:86 dvb_usb_init drivers/media/usb/dvb-usb/dvb-usb-init.c:162 dvb_usb_device_init+0xf70/0x17f0 drivers/media/usb/dvb-usb/dvb-usb-init.c:277 dib0700_probe+0x171/0x5a0 drivers/media/usb/dvb-usb/dib0700_core.c:886 usb_probe_interface+0x35d/0x8e0 drivers/usb/core/driver.c:361 really_probe drivers/base/dd.c:413 driver_probe_device+0x610/0xa00 drivers/base/dd.c:557 __device_attach_driver+0x230/0x290 drivers/base/dd.c:653 bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463 __device_attach+0x26e/0x3d0 drivers/base/dd.c:710 device_initial_probe+0x1f/0x30 drivers/base/dd.c:757 bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523 device_add+0xd0b/0x1660 drivers/base/core.c:1835 usb_set_configuration+0x104e/0x1870 drivers/usb/core/message.c:1932 generic_probe+0x73/0xe0 drivers/usb/core/generic.c:174 usb_probe_device+0xaf/0xe0 drivers/usb/core/driver.c:266 really_probe drivers/base/dd.c:413 driver_probe_device+0x610/0xa00 drivers/base/dd.c:557 __device_attach_driver+0x230/0x290 drivers/base/dd.c:653 bus_for_each_drv+0x161/0x210 drivers/base/bus.c:463 __device_attach+0x26e/0x3d0 drivers/base/dd.c:710 device_initial_probe+0x1f/0x30 drivers/base/dd.c:757 bus_probe_device+0x1eb/0x290 drivers/base/bus.c:523 device_add+0xd0b/0x1660 drivers/base/core.c:1835 usb_new_device+0x7b8/0x1020 drivers/usb/core/hub.c:2457 hub_port_connect drivers/usb/core/hub.c:4903 hub_port_connect_change drivers/usb/core/hub.c:5009 port_event drivers/usb/core/hub.c:5115 hub_event+0x194d/0x3740 drivers/usb/core/hub.c:5195 process_one_work+0xc7f/0x1db0 kernel/workqueue.c:2119 worker_thread+0x221/0x1850 kernel/workqueue.c:2253 kthread+0x3a1/0x470 kernel/kthread.c:231 ret_from_fork+0x2a/0x40 arch/x86/entry/entry_64.S:431 Code: ff ff 48 85 c0 74 24 48 89 c7 e8 48 ea ff ff bf 01 00 00 00 e8 de 20 e3 ff 65 8b 05 b7 2f c2 7e 85 c0 75 c9 e8 f9 0b c1 ff eb c2 <0f> 0b 66 2e 0f 1f 84 00 00 00 00 00 0f 1f 44 00 00 48 b8 00 00 RIP: symbol_put_addr+0x54/0x60 RSP: ffff88006a7ce210 ---[ end trace b75b357739e7e116 ]---
--- drivers/media/usb/dvb-usb/dib0700_devices.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-)
drivers/media/usb/dvb-usb/dib0700_devices.c +12 -12
@@ -292,7 +292,7 @@ static int stk7700P2_frontend_attach(str stk7700d_dib7000p_mt2266_config) != 0) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; } }
@@ -326,7 +326,7 @@ static int stk7700d_frontend_attach(stru stk7700d_dib7000p_mt2266_config) != 0) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; } }
@@ -479,7 +479,7 @@ static int stk7700ph_frontend_attach(str &stk7700ph_dib7700_xc3028_config) != 0) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; }
@@ -1013,7 +1013,7 @@ static int stk7070p_frontend_attach(stru &dib7070p_dib7000p_config) != 0) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; }
@@ -1071,7 +1071,7 @@ static int stk7770p_frontend_attach(stru &dib7770p_dib7000p_config) != 0) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; }
@@ -3039,7 +3039,7 @@ static int nim7090_frontend_attach(strucif (state->dib7000p_ops.i2c_enumeration (&adap->dev->i2c_adap,1 ,0x10 , &nim7090_dib7000p_config) !=0 ) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; } adap->fe_adap[0 ].fe = state->dib7000p_ops.init (&adap->dev->i2c_adap,0x80 , &nim7090_dib7000p_config);
@@ -3092,7 +3092,7 @@ static int tfe7090pvr_frontend0_attach(s/* initialize IC 0 */ if (state->dib7000p_ops.i2c_enumeration (&adap->dev->i2c_adap,1 ,0x20 , &tfe7090pvr_dib7000p_config[0 ]) !=0 ) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; }
@@ -3122,7 +3122,7 @@ static int tfe7090pvr_frontend1_attach(s i2c = state->dib7000p_ops.get_i2c_master (adap->dev->adapter[0 ].fe_adap[0 ].fe,DIBX000_I2C_INTERFACE_GPIO_6_7 ,1 );if (state->dib7000p_ops.i2c_enumeration (i2c,1 ,0x10 , &tfe7090pvr_dib7000p_config[1 ]) !=0 ) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; }
@@ -3197,7 +3197,7 @@ static int tfe7790p_frontend_attach(stru 1, 0x10, &tfe7790p_dib7000p_config) != 0) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; } adap->fe_adap[0].fe = state->dib7000p_ops.init(&adap->dev->i2c_adap,
@@ -3292,7 +3292,7 @@ static int stk7070pd_frontend_attach0(st stk7070pd_dib7000p_config) != 0) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; }
@@ -3367,7 +3367,7 @@ static int novatd_frontend_attach(struct stk7070pd_dib7000p_config) != 0) {err ("%s: state->dib7000p_ops.i2c_enumeration failed. Cannot continue\n" , __func__); -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; } }
@@ -3603,7 +3603,7 @@ static int pctv340e_frontend_attach(struif (state->dib7000p_ops.dib7000pc_detection (&adap->dev->i2c_adap) ==0 ) {/* Demodulator not found for some reason? */ -dvb_detach (&state->dib7000p_ops); +dvb_detach (state->dib7000p_ops.set_wbd_ref);return -ENODEV ; }
Greg Kroah-Hartman
maintainerPATCH 3/38 iscsi-target: Fix iscsi_np reset hung task during parallel delete
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Nicholas Bellinger <[email protected]>
commit 978d13d60c34818a41fc35962602bdfa5c03f214 upstream.
This patch fixes a bug associated with iscsit_reset_np_thread() that can occur during parallel configfs rmdir of a single iscsi_np used across multiple iscsi-target instances, that would result in hung task(s) similar to below where configfs rmdir process context was blocked indefinately waiting for iscsi_np->np_restart_comp to finish:
[ 6726.112076] INFO: task dcp_proxy_node_:15550 blocked for more than 120 seconds. [ 6726.119440] Tainted: G W O 4.1.26-3321 #2 [ 6726.125045] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message. [ 6726.132927] dcp_proxy_node_ D ffff8803f202bc88 0 15550 1 0x00000000 [ 6726.140058] ffff8803f202bc88 ffff88085c64d960 ffff88083b3b1ad0 ffff88087fffeb08 [ 6726.147593] ffff8803f202c000 7fffffffffffffff ffff88083f459c28 ffff88083b3b1ad0 [ 6726.155132] ffff88035373c100 ffff8803f202bca8 ffffffff8168ced2 ffff8803f202bcb8 [ 6726.162667] Call Trace: [ 6726.165150] [<ffffffff8168ced2>] schedule+0x32/0x80 [ 6726.170156] [<ffffffff8168f5b4>] schedule_timeout+0x214/0x290 [ 6726.176030] [<ffffffff810caef2>] ? __send_signal+0x52/0x4a0 [ 6726.181728] [<ffffffff8168d7d6>] wait_for_completion+0x96/0x100 [ 6726.187774] [<ffffffff810e7c80>] ? wake_up_state+0x10/0x10 [ 6726.193395] [<ffffffffa035d6e2>] iscsit_reset_np_thread+0x62/0xe0 [iscsi_target_mod] [ 6726.201278] [<ffffffffa0355d86>] iscsit_tpg_disable_portal_group+0x96/0x190 [iscsi_target_mod] [ 6726.210033] [<ffffffffa0363f7f>] lio_target_tpg_store_enable+0x4f/0xc0 [iscsi_target_mod] [ 6726.218351] [<ffffffff81260c5a>] configfs_write_file+0xaa/0x110 [ 6726.224392] [<ffffffff811ea364>] vfs_write+0xa4/0x1b0 [ 6726.229576] [<ffffffff811eb111>] SyS_write+0x41/0xb0 [ 6726.234659] [<ffffffff8169042e>] system_call_fastpath+0x12/0x71
It would happen because each iscsit_reset_np_thread() sets state to ISCSI_NP_THREAD_RESET, sends SIGINT, and then blocks waiting for completion on iscsi_np->np_restart_comp.
However, if iscsi_np was active processing a login request and more than a single iscsit_reset_np_thread() caller to the same iscsi_np was blocked on iscsi_np->np_restart_comp, iscsi_np kthread process context in __iscsi_target_login_thread() would flush pending signals and only perform a single completion of np->np_restart_comp before going back to sleep within transport specific iscsit_transport->iscsi_accept_np code.
To address this bug, add a iscsi_np->np_reset_count and update __iscsi_target_login_thread() to keep completing np->np_restart_comp until ->np_reset_count has reached zero.
--- drivers/target/iscsi/iscsi_target.c | 1 + drivers/target/iscsi/iscsi_target_core.h | 1 + drivers/target/iscsi/iscsi_target_login.c | 7 +++++-- include/target/iscsi/iscsi_target_core.h | 1 + 4 files changed, 8 insertions(+), 2 deletions(-)
drivers/target/iscsi/iscsi_target.c +1 -0
@@ -428,6 +428,7 @@ int iscsit_reset_np_thread(return 0 ; } np->np_thread_state =ISCSI_NP_THREAD_RESET ; +atomic_inc (&np->np_reset_count);if (np->np_thread) {spin_unlock_bh (&np->np_thread_lock);
drivers/target/iscsi/iscsi_target_core.h +1 -0
@@ -783,6 +783,7 @@ struct iscsi_np {int np_sock_type;enum np_thread_state_table np_thread_state;bool enabled; +atomic_t np_reset_count;enum iscsi_timer_flags_table np_login_timer_flags;u32 np_exports;enum np_flags_table np_flags;
drivers/target/iscsi/iscsi_target_login.c +5 -2
@@ -1275,9 +1275,11 @@ static int __iscsi_target_login_thread(sflush_signals (current);spin_lock_bh (&np->np_thread_lock); -if (np->np_thread_state ==ISCSI_NP_THREAD_RESET ) { +if (atomic_dec_if_positive (&np->np_reset_count) >=0 ) { np->np_thread_state =ISCSI_NP_THREAD_ACTIVE ; +spin_unlock_bh (&np->np_thread_lock);complete (&np->np_restart_comp); +return 1 ; }else if (np->np_thread_state ==ISCSI_NP_THREAD_SHUTDOWN ) {spin_unlock_bh (&np->np_thread_lock); goto exit;
@@ -1310,7 +1312,8 @@ static int __iscsi_target_login_thread(s goto exit; }else if (rc <0 ) {spin_lock_bh (&np->np_thread_lock); -if (np->np_thread_state ==ISCSI_NP_THREAD_RESET ) { +if (atomic_dec_if_positive (&np->np_reset_count) >=0 ) { + np->np_thread_state =ISCSI_NP_THREAD_ACTIVE ;spin_unlock_bh (&np->np_thread_lock);complete (&np->np_restart_comp);iscsit_put_transport (conn->conn_transport);
include/target/iscsi/iscsi_target_core.h +1 -0
@@ -784,6 +784,7 @@ struct iscsi_np {int np_sock_type;enum np_thread_state_table np_thread_state;bool enabled; +atomic_t np_reset_count;enum iscsi_timer_flags_table np_login_timer_flags;u32 np_exports;enum np_flags_table np_flags;
Greg Kroah-Hartman
maintainerPATCH 4/38 extcon: palmas: Check the parent instance to prevent the NULL
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Roger Quadros <[email protected]>
[ Upstream commit 9fe172b9be532acc23e35ba693700383ab775e66 ]
extcon-palmas must be child of palmas and expects parent's drvdata to be valid. Check for non NULL parent drvdata and fail if it is NULL. Not doing so will result in a NULL pointer dereference later in the probe() parent drvdata is NULL (e.g. misplaced extcon-palmas node in device tree).
--- drivers/extcon/extcon-palmas.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/extcon/extcon-palmas.c +5 -0
@@ -150,6 +150,11 @@ static int palmas_usb_probe(struct platfstruct palmas_usb *palmas_usb;int status; +if (!palmas) { +dev_err (&pdev->dev,"failed to get valid parent\n" ); +return -EINVAL ; + } + palmas_usb =devm_kzalloc (&pdev->dev,sizeof (*palmas_usb),GFP_KERNEL );if (!palmas_usb)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 5/38 ARM: OMAP2+: Fix init for multiple quirks for the same SoC
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
[ Upstream commit 6e613ebf4405fc09e2a8c16ed193b47f80a3cbed ]
It's possible that there are multiple quirks that need to be initialized for the same SoC. Fix the issue by not returning on the first match.
--- arch/arm/mach-omap2/pdata-quirks.c | 1 - 1 file changed, 1 deletion(-)
arch/arm/mach-omap2/pdata-quirks.c +0 -1
@@ -417,7 +417,6 @@ static void pdata_quirks_check(struct pdif (of_machine_is_compatible (quirks->compatible)) {if (quirks->fn) quirks->fn (); -break ; } quirks++; }
Greg Kroah-Hartman
maintainerPATCH 6/38 ARM: dts: Fix omap3 off mode pull defines
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tony Lindgren <[email protected]>
[ Upstream commit d97556c8012015901a3ce77f46960078139cd79d ]
We need to also have OFFPULLUDENABLE bit set to use the off mode pull values. Otherwise the line is pulled down internally if no external pull exists.
This is has some documentation at:
http://processors.wiki.ti.com/index.php/Optimizing_OMAP35x_and_AM/DM37x_OFF_mode_PAD_configuration
Note that the value is still glitchy during off mode transitions as documented in spz319f.pdf "Advisory 1.45". It's best to use external pulls instead of relying on the internal ones for off mode and even then anything pulled up will get driven down momentarily on off mode restore for GPIO banks other than bank1.
--- include/dt-bindings/pinctrl/omap.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
include/dt-bindings/pinctrl/omap.h +2 -2
@@ -45,8 +45,8 @@#define PIN_OFF_NONE 0#define PIN_OFF_OUTPUT_HIGH (OFF_EN | OFFOUT_EN | OFFOUT_VAL)#define PIN_OFF_OUTPUT_LOW (OFF_EN | OFFOUT_EN) -#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFF_PULL_EN | OFF_PULL_UP) -#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFF_PULL_EN) +#define PIN_OFF_INPUT_PULLUP (OFF_EN | OFFOUT_EN | OFF_PULL_EN | OFF_PULL_UP) +#define PIN_OFF_INPUT_PULLDOWN (OFF_EN | OFFOUT_EN | OFF_PULL_EN)#define PIN_OFF_WAKEUPENABLE WAKEUP_EN/*
Greg Kroah-Hartman
maintainerPATCH 7/38 ata: ATA_BMDMA should depend on HAS_DMA
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 7bc7ab1e63dfe004931502f90ce7020e375623da ]
If NO_DMA=y:
ERROR: "dmam_alloc_coherent" [drivers/ata/libata.ko] undefined!
Add a dependency on HAS_DMA to fix this.
--- drivers/ata/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/ata/Kconfig +1 -0
@@ -245,6 +245,7 @@ config SATA_SX4 config ATA_BMDMA bool "ATA BMDMA support" + depends on HAS_DMA default y help This option adds support for SFF ATA controllers with BMDMA
Greg Kroah-Hartman
maintainerPATCH 8/38 ata: SATA_HIGHBANK should depend on HAS_DMA
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 2a736e0585e585c2566b5119af8381910a170e44 ]
If NO_DMA=y:
ERROR: "bad_dma_ops" [drivers/ata/sata_highbank.ko] undefined!
Add a dependency on HAS_DMA to fix this.
--- drivers/ata/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/ata/Kconfig +1 -0
@@ -291,6 +291,7 @@ config SATA_DWC_VDEBUG config SATA_HIGHBANK tristate "Calxeda Highbank SATA support" + depends on HAS_DMA depends on ARCH_HIGHBANK || COMPILE_TEST help This option enables support for the Calxeda Highbank SoC's
Greg Kroah-Hartman
maintainerPATCH 9/38 ata: SATA_MV should depend on HAS_DMA
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 62989cebd367a1aae1e009e1a5b1ec046a4c8fdc ]
If NO_DMA=y:
ERROR: "dma_pool_alloc" [drivers/ata/sata_mv.ko] undefined!
ERROR: "dmam_pool_create" [drivers/ata/sata_mv.ko] undefined!
ERROR: "dma_pool_free" [drivers/ata/sata_mv.ko] undefined!
Add a dependency on HAS_DMA to fix this.
--- drivers/ata/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/ata/Kconfig +1 -0
@@ -301,6 +301,7 @@ config SATA_HIGHBANK config SATA_MV tristate "Marvell SATA support" + depends on HAS_DMA depends on PCI || ARCH_DOVE || ARCH_MV78XX0 || \ ARCH_MVEBU || ARCH_ORION5X || COMPILE_TEST select GENERIC_PHY
Greg Kroah-Hartman
maintainerPATCH 10/38 drm/sti: sti_vtg: Handle return NULL error from devm_ioremap_nocache
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arvind Yadav <[email protected]>
[ Upstream commit 1ae0d5af347df224a6e76334683f13a96d915a44 ]
Here, If devm_ioremap_nocache will fail. It will return NULL. Kernel can run into a NULL-pointer dereference. This error check will avoid NULL pointer dereference.
--- drivers/gpu/drm/sti/sti_vtg.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/gpu/drm/sti/sti_vtg.c +4 -0
@@ -303,6 +303,10 @@ static int vtg_probe(struct platform_devreturn -ENOMEM ; } vtg->regs =devm_ioremap_nocache (dev, res->start,resource_size (res)); +if (!vtg->regs) { +DRM_ERROR ("failed to remap I/O memory\n" ); +return -ENOMEM ; + } np =of_parse_phandle (pdev->dev.of_node,"st,slave" ,0 );if (np) {
Greg Kroah-Hartman
maintainerPATCH 11/38 igb: reset the PHY before reading the PHY ID
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Aaron Sierra <[email protected]>
[ Upstream commit 182785335447957409282ca745aa5bc3968facee ]
Several people have reported firmware leaving the I210/I211 PHY's page select register set to something other than the default of zero. This causes the first accesses, PHY_IDx register reads, to access something else, resulting in device probe failure:
igb: Intel(R) Gigabit Ethernet Network Driver - version 5.4.0-k
igb: Copyright (c) 2007-2014 Intel Corporation.
igb: probe of 0000:01:00.0 failed with error -2This problem began for them after a previous patch I submitted was applied:
commit 2a3cdead8b408351fa1e3079b220fa331480ffbc
Author: Aaron Sierra <[email protected]>
Date: Tue Nov 3 12:37:09 2015 -0600
igb: Remove GS40G specific defines/functions
I personally experienced this problem after attempting to PXE boot from I210 devices using this firmware:
Intel(R) Boot Agent GE v1.5.78
Copyright (C) 1997-2014, Intel CorporationResetting the PHY before reading from it, ensures the page select register is in its default state and doesn't make assumptions about the PHY's register set before the PHY has been probed.
--- drivers/net/ethernet/intel/igb/e1000_82575.c | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/net/ethernet/intel/igb/e1000_82575.c +11 -0
@@ -215,6 +215,17 @@ static s32 igb_init_phy_params_82575(str hw->bus.func = (rd32 (E1000_STATUS ) &E1000_STATUS_FUNC_MASK ) >>E1000_STATUS_FUNC_SHIFT ; +/* Make sure the PHY is in a good state. Several people have reported +* firmware leaving the PHY's page select register set to something +* other than the default of zero, which causes the PHY ID read to +* access something other than the intended register. +*/ + ret_val = hw->phy.ops.reset (hw); +if (ret_val) { +hw_dbg ("Error resetting the PHY.\n" ); + goto out; + } +/* Set phy->phy_addr and phy->id. */ ret_val =igb_get_phy_id_82575 (hw);if (ret_val)
Greg Kroah-Hartman
maintainerPATCH 12/38 igb: close/suspend race in netif_device_detach
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Todd Fujinaka <[email protected]>
[ Upstream commit 9474933caf21a4cb5147223dca1551f527aaac36 ]
Similar to ixgbe, when an interface is part of a namespace it is possible that igb_close() may be called while __igb_shutdown() is running which ends up in a double free WARN and/or a BUG in free_msi_irqs().
Extend the rtnl_lock() to protect the call to netif_device_detach() and igb_clear_interrupt_scheme() in __igb_shutdown() and check for netif_device_present() to avoid calling igb_clear_interrupt_scheme() a second time in igb_close().
Also extend the rtnl lock in igb_resume() to netif_device_attach().
--- drivers/net/ethernet/intel/igb/igb_main.c | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/igb/igb_main.c +12 -9
@@ -3170,7 +3170,9 @@ static int __igb_close(struct net_devicestatic int igb_close (struct net_device *netdev) { -return __igb_close (netdev, false); +if (netif_device_present (netdev)) +return __igb_close (netdev, false); +return 0 ; }/**
@@ -7328,12 +7330,14 @@ static int __igb_shutdown(struct pci_devint retval =0 ;#endif +rtnl_lock ();netif_device_detach (netdev);if (netif_running (netdev))__igb_close (netdev, true);igb_clear_interrupt_scheme (adapter); +rtnl_unlock ();#ifdef CONFIG_PM retval =pci_save_state (pdev);
@@ -7452,16 +7456,15 @@ static int igb_resume(struct device *devwr32 (E1000_WUS , ~0 ); -if (netdev->flags &IFF_UP ) { -rtnl_lock (); +rtnl_lock (); +if (!err &&netif_running (netdev)) err =__igb_open (netdev, true); -rtnl_unlock (); -if (err) -return err; - } -netif_device_attach (netdev); -return 0 ; +if (!err) +netif_device_attach (netdev); +rtnl_unlock (); + +return err; }#ifdef CONFIG_PM_RUNTIME
Greg Kroah-Hartman
maintainerPATCH 13/38 igb: Fix hw_dbg logging in igb_update_flash_i210
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Hannu Lounento <[email protected]>
[ Upstream commit 76ed5a8f47476e4984cc8c0c1bc4cee62650f7fd ]
Fix an if statement with hw_dbg lines where the logic was inverted with regards to the corresponding return value used in the if statement.
--- drivers/net/ethernet/intel/igb/e1000_i210.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/igb/e1000_i210.c +2 -2
@@ -699,9 +699,9 @@ static s32 igb_update_flash_i210(struct ret_val =igb_pool_flash_update_done_i210 (hw);if (ret_val) -hw_dbg ("Flash update complete\n" ); -else hw_dbg ("Flash update time out\n" ); +else +hw_dbg ("Flash update complete\n" ); out:return ret_val;
Greg Kroah-Hartman
maintainerPATCH 14/38 staging: rtl8188eu: fix incorrect ERROR tags from logs
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Galo Navarro <[email protected]>
[ Upstream commit 401579c22ccbcb54244494069973e64b1fe980d2 ]
Several lifecycle events in the rtl8188eu driver are logged using the DBG_88E_LEVEL macro from rtw_debug.h, which is tagged as ERROR regardless of the actual level. Below are dmesg excerpts after loading and unloading the module, the messages are misleading as there was no error.
[517434.916239] usbcore: registered new interface driver r8188eu
[517435.680653] R8188EU: ERROR indicate disassoc
[517437.122606] R8188EU: ERROR assoc success
[517797.735611] usbcore: deregistering interface driver r8188eu
[517797.736069] R8188EU: ERROR indicate disassocRemove the ERROR prefix from the logs. After the patch, logs are:
[517949.873976] usbcore: registered new interface driver r8188eu
[517950.592845] R8188EU: indicate disassoc
[517951.993973] R8188EU: assoc success
[521778.784448] usbcore: deregistering interface driver r8188eu
[521778.784838] R8188EU: indicate disassoc--- drivers/staging/rtl8188eu/include/rtw_debug.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/rtl8188eu/include/rtw_debug.h +1 -1
@@ -75,7 +75,7 @@ extern u32 GlobalDebugLevel; #define DBG_88E_LEVEL(_level, fmt, arg...) \ do { \ if (_level <= GlobalDebugLevel) \ - pr_info(DRIVER_PREFIX"ERROR " fmt, ##arg); \ + pr_info(DRIVER_PREFIX fmt, ##arg); \ } while (0)#define DBG_88E (...) \
Greg Kroah-Hartman
maintainerPATCH 15/38 scsi: lpfc: Add missing memory barrier
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Smart <[email protected]>
[ Upstream commit 6b3b3bdb83b4ad51252d21bb13596db879e51850 ]
On loosely ordered memory systems (PPC for example), the WQE elements were being updated in memory, but not necessarily flushed before the separate doorbell was written to hw which would cause hw to dma the WQE element. Thus, the hardware occasionally received partially updated WQE data.
Add the memory barrier after updating the WQE memory.
--- drivers/scsi/lpfc/lpfc_sli.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/scsi/lpfc/lpfc_sli.c +2 -0
@@ -118,6 +118,8 @@ lpfc_sli4_wq_put(struct lpfc_queue *q, uif (q->phba->sli3_options &LPFC_SLI4_PHWQ_ENABLED )bf_set (wqe_wqid, &wqe->generic.wqe_com, q->queue_id);lpfc_sli_pcimem_bcopy (wqe, temp_wqe, q->entry_size); +/* ensure WQE bcopy flushed before doorbell write */ +wmb ();/* Update the host index before invoking device */ host_index = q->host_index;
Greg Kroah-Hartman
maintainerPATCH 16/38 scsi: lpfc: FCoE VPort enable-disable does not bring up the VPort
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Smart <[email protected]>
[ Upstream commit 104450eb08ca662e6b1d02da11aca9598e978f3e ]
FCoE VPort enable-disable does not bring up the VPort. VPI structure needed to be initialized before being re-registered.
--- drivers/scsi/lpfc/lpfc_vport.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/scsi/lpfc/lpfc_vport.c +8 -0
@@ -528,6 +528,12 @@ enable_vport(struct fc_vport *fc_vport)spin_lock_irq (shost->host_lock); vport->load_flag |=FC_LOADING ; +if (vport->fc_flag &FC_VPORT_NEEDS_INIT_VPI ) { +spin_unlock_irq (shost->host_lock); +lpfc_issue_init_vpi (vport); + goto out; + } + vport->fc_flag |=FC_VPORT_NEEDS_REG_VPI ;spin_unlock_irq (shost->host_lock);
@@ -548,6 +554,8 @@ enable_vport(struct fc_vport *fc_vport) }else {lpfc_vport_set_state (vport,FC_VPORT_FAILED ); } + +out:lpfc_printf_vlog (vport,KERN_ERR ,LOG_VPORT ,"1827 Vport Enabled.\n" );return VPORT_OK ;
Greg Kroah-Hartman
maintainerPATCH 17/38 scsi: lpfc: Correct host name in symbolic_name field
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Smart <[email protected]>
[ Upstream commit 6c9231f604c2575be24c96d38deb70f145172f92 ]
Correct host name in symbolic_name field of nameserver registrations
--- drivers/scsi/lpfc/lpfc_attr.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
drivers/scsi/lpfc/lpfc_attr.c +17 -0
@@ -5137,6 +5137,19 @@ lpfc_free_sysfs_attr(struct lpfc_vport **/ /** +* lpfc_get_host_symbolic_name - Copy symbolic name into the scsi host +* @shost: kernel scsi host pointer. +**/ +static void +lpfc_get_host_symbolic_name (struct Scsi_Host *shost) +{ +struct lpfc_vport *vport = (struct lpfc_vport *)shost->hostdata; + +lpfc_vport_symbolic_node_name (vport,fc_host_symbolic_name (shost), +sizeof fc_host_symbolic_name (shost)); +} + +/** * lpfc_get_host_port_id - Copy the vport DID into the scsi host port id * @shost: kernel scsi host pointer. **/
@@ -5670,6 +5683,8 @@ struct fc_function_template lpfc_transpo .show_host_supported_fc4s = 1, .show_host_supported_speeds = 1, .show_host_maxframe_size = 1, + + .get_host_symbolic_name = lpfc_get_host_symbolic_name, .show_host_symbolic_name = 1,/* dynamic attributes the driver supports */
@@ -5737,6 +5752,8 @@ struct fc_function_template lpfc_vport_t .show_host_supported_fc4s = 1, .show_host_supported_speeds = 1, .show_host_maxframe_size = 1, + + .get_host_symbolic_name = lpfc_get_host_symbolic_name, .show_host_symbolic_name = 1,/* dynamic attributes the driver supports */
Greg Kroah-Hartman
maintainerPATCH 18/38 scsi: lpfc: Correct issue leading to oops during link reset
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: James Smart <[email protected]>
[ Upstream commit e6c6acc0e0223ddaf867628d420ee196349c6fae ]
Correct issue leading to oops during link reset. Missing vport pointer.
[mkp: fixed typo]
--- drivers/scsi/lpfc/lpfc_sli.c | 1 + 1 file changed, 1 insertion(+)
drivers/scsi/lpfc/lpfc_sli.c +1 -0
@@ -9774,6 +9774,7 @@ lpfc_sli_abort_iotag_issue(struct lpfc_h iabt->ulpCommand =CMD_CLOSE_XRI_CN ; abtsiocbp->iocb_cmpl = lpfc_sli_abort_els_cmpl; + abtsiocbp->vport = vport;lpfc_printf_vlog (vport,KERN_INFO ,LOG_SLI , "0339 Abort xri x%x, original iotag x%x, "
Greg Kroah-Hartman
maintainerPATCH 19/38 ALSA: vx: Dont try to update capture stream before running
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit ed3c177d960bb5881b945ca6f784868126bb90db ]
The update of stream costs significantly, and we should avoid it unless the stream really has started. Check pipe->running flag instead of pipe->prepared.
--- sound/drivers/vx/vx_pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/drivers/vx/vx_pcm.c +1 -1
@@ -1015,7 +1015,7 @@ static void vx_pcm_capture_update(structint size, space, count;struct snd_pcm_runtime *runtime = subs->runtime; -if (! pipe->prepared || (chip->chip_status &VX_STAT_IS_STALE )) +if (!pipe->running || (chip->chip_status &VX_STAT_IS_STALE ))return ; size = runtime->buffer_size -snd_pcm_capture_avail (runtime);
Greg Kroah-Hartman
maintainerPATCH 20/38 ALSA: vx: Fix possible transfer overflow
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Takashi Iwai <[email protected]>
[ Upstream commit 874e1f6fad9a5184b67f4cee37c1335cd2cc5677 ]
The pseudo DMA transfer codes in VX222 and VX-pocket driver have a slight bug where they check the buffer boundary wrongly, and may overflow. Also, the zero sample count might be handled badly for the playback (although it shouldn't happen in theory). This patch addresses these issues.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=141541
--- sound/drivers/vx/vx_pcm.c | 6 ++++-- sound/pci/vx222/vx222_ops.c | 12 ++++++------ sound/pcmcia/vx/vxp_ops.c | 12 ++++++------ 3 files changed, 16 insertions(+), 14 deletions(-)
sound/drivers/vx/vx_pcm.c +4 -2
@@ -1048,8 +1048,10 @@ static void vx_pcm_capture_update(struct/* ok, let's accelerate! */ int align = pipe->align *3 ; space = (count / align) * align; -vx_pseudo_dma_read (chip, runtime, pipe, space); - count -= space; +if (space >0 ) { +vx_pseudo_dma_read (chip, runtime, pipe, space); + count -= space; + } }/* read the rest of bytes */ while (count >0 ) {
sound/pci/vx222/vx222_ops.c +6 -6
@@ -264,12 +264,12 @@ static void vx2_dma_write(struct vx_core/* Transfer using pseudo-dma. */ -if (offset + count > pipe->buffer_bytes) { +if (offset + count >= pipe->buffer_bytes) {int length = pipe->buffer_bytes - offset; count -= length; length >>=2 ;/* in 32bit words */ /* Transfer using pseudo-dma. */ -while (length-- >0 ) { +for (; length >0 ; length--) {outl (cpu_to_le32 (*addr), port); addr++; }
@@ -279,7 +279,7 @@ static void vx2_dma_write(struct vx_core pipe->hw_ptr += count; count >>=2 ;/* in 32bit words */ /* Transfer using pseudo-dma. */ -while (count-- >0 ) { +for (; count >0 ; count--) {outl (cpu_to_le32 (*addr), port); addr++; }
@@ -302,12 +302,12 @@ static void vx2_dma_read(struct vx_corevx2_setup_pseudo_dma (chip,0 );/* Transfer using pseudo-dma. */ -if (offset + count > pipe->buffer_bytes) { +if (offset + count >= pipe->buffer_bytes) {int length = pipe->buffer_bytes - offset; count -= length; length >>=2 ;/* in 32bit words */ /* Transfer using pseudo-dma. */ -while (length-- >0 ) +for (; length >0 ; length--) *addr++ =le32_to_cpu (inl (port)); addr = (u32 *)runtime->dma_area; pipe->hw_ptr =0 ;
@@ -315,7 +315,7 @@ static void vx2_dma_read(struct vx_core pipe->hw_ptr += count; count >>=2 ;/* in 32bit words */ /* Transfer using pseudo-dma. */ -while (count-- >0 ) +for (; count >0 ; count--) *addr++ =le32_to_cpu (inl (port));vx2_release_pseudo_dma (chip);
sound/pcmcia/vx/vxp_ops.c +6 -6
@@ -369,12 +369,12 @@ static void vxp_dma_write(struct vx_coreunsigned short *addr = (unsigned short *)(runtime->dma_area + offset);vx_setup_pseudo_dma (chip,1 ); -if (offset + count > pipe->buffer_bytes) { +if (offset + count >= pipe->buffer_bytes) {int length = pipe->buffer_bytes - offset; count -= length; length >>=1 ;/* in 16bit words */ /* Transfer using pseudo-dma. */ -while (length-- >0 ) { +for (; length >0 ; length--) {outw (cpu_to_le16 (*addr), port); addr++; }
@@ -384,7 +384,7 @@ static void vxp_dma_write(struct vx_core pipe->hw_ptr += count; count >>=1 ;/* in 16bit words */ /* Transfer using pseudo-dma. */ -while (count-- >0 ) { +for (; count >0 ; count--) {outw (cpu_to_le16 (*addr), port); addr++; }
@@ -411,12 +411,12 @@ static void vxp_dma_read(struct vx_coreif (snd_BUG_ON (count %2 ))return ;vx_setup_pseudo_dma (chip,0 ); -if (offset + count > pipe->buffer_bytes) { +if (offset + count >= pipe->buffer_bytes) {int length = pipe->buffer_bytes - offset; count -= length; length >>=1 ;/* in 16bit words */ /* Transfer using pseudo-dma. */ -while (length-- >0 ) +for (; length >0 ; length--) *addr++ =le16_to_cpu (inw (port)); addr = (unsigned short *)runtime->dma_area; pipe->hw_ptr =0 ;
@@ -424,7 +424,7 @@ static void vxp_dma_read(struct vx_core pipe->hw_ptr += count; count >>=1 ;/* in 16bit words */ /* Transfer using pseudo-dma. */ -while (count-- >1 ) +for (; count >1 ; count--) *addr++ =le16_to_cpu (inw (port));/* Disable DMA */ pchip->regDIALOG &= ~VXP_DLG_DMAREAD_SEL_MASK ;
Greg Kroah-Hartman
maintainerPATCH 22/38 backlight: adp5520: Fix error handling in adp5520_bl_probe()
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Khoroshilov <[email protected]>
[ Upstream commit 0eb3fba8c68275f0122f65f7316efaaf86448016 ]
If adp5520_bl_setup() fails, sysfs group left unremoved.
By the way, fix overcomplicated assignement of error code.
Found by Linux Driver Verification project (linuxtesting.org).
--- drivers/video/backlight/adp5520_bl.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-)
drivers/video/backlight/adp5520_bl.c +10 -2
@@ -332,10 +332,18 @@ static int adp5520_bl_probe(struct platf }platform_set_drvdata (pdev, bl); - ret |=adp5520_bl_setup (bl); + ret =adp5520_bl_setup (bl); +if (ret) { +dev_err (&pdev->dev,"failed to setup\n" ); +if (data->pdata->en_ambl_sens) +sysfs_remove_group (&bl->dev.kobj, + &adp5520_bl_attr_group); +return ret; + } +backlight_update_status (bl); -return ret; +return 0 ; }static int adp5520_bl_remove (struct platform_device *pdev)
Greg Kroah-Hartman
maintainerPATCH 23/38 gpu: drm: mgag200: mgag200_main:- Handle error from pci_iomap
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Arvind Yadav <[email protected]>
[ Upstream commit 4b0ea93f250afc6c1128e201b0a8a115ae613e47 ]
Here, pci_iomap can fail, handle this case and return -ENOMEM.
--- drivers/gpu/drm/mgag200/mgag200_main.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/mgag200/mgag200_main.c +2 -0
@@ -138,6 +138,8 @@ static int mga_vram_init(struct mga_devi } mem =pci_iomap (mdev->dev->pdev,0 ,0 ); +if (!mem) +return -ENOMEM ; mdev->mc.vram_size =mga_probe_vram (mdev, mem);
Greg Kroah-Hartman
maintainerPATCH 24/38 ixgbe: fix AER error handling
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emil Tantilov <[email protected]>
[ Upstream commit 126db13fa0e6d05c9f94e0125f61e773bd5ab079 ]
Make sure that we free the IRQs in ixgbe_io_error_detected() when responding to an PCIe AER error and also restore them when the interface recovers from it.
Previously it was possible to trigger BUG_ON() check in free_msix_irqs() in the case where we call ixgbe_remove() after a failed recovery from AER error because the interrupts were not freed.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +4 -2
@@ -8575,7 +8575,7 @@ skip_bad_vf_detection: }if (netif_running (netdev)) -ixgbe_down (adapter); +ixgbe_close_suspend (adapter);if (!test_and_set_bit (__IXGBE_DISABLED, &adapter->state))pci_disable_device (pdev);
@@ -8645,10 +8645,12 @@ static void ixgbe_io_resume(struct pci_d }#endif +rtnl_lock ();if (netif_running (netdev)) -ixgbe_up (adapter); +ixgbe_open (netdev);netif_device_attach (netdev); +rtnl_unlock (); } static const struct pci_error_handlers ixgbe_err_handler = {
Greg Kroah-Hartman
maintainerPATCH 25/38 ixgbe: handle close/suspend race with netif_device_detach/present
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Emil Tantilov <[email protected]>
[ Upstream commit f7f37e7ff2b9b7eff7fbd035569cab35896869a3 ]
When an interface is part of a namespace it is possible that ixgbe_close() may be called while __ixgbe_shutdown() is running which ends up in a double free WARN and/or a BUG in free_msi_irqs().
To handle this situation we extend the rtnl_lock() to protect the call to netif_device_detach() and ixgbe_clear_interrupt_scheme() in __ixgbe_shutdown() and check for netif_device_present() to avoid clearing the interrupts second time in ixgbe_close();
Also extend the rtnl lock in ixgbe_resume() to netif_device_attach().
--- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c +8 -9
@@ -5560,7 +5560,8 @@ static int ixgbe_close(struct net_deviceixgbe_ptp_stop (adapter); -ixgbe_close_suspend (adapter); +if (netif_device_present (netdev)) +ixgbe_close_suspend (adapter);ixgbe_fdir_filter_exit (adapter);
@@ -5605,14 +5606,12 @@ static int ixgbe_resume(struct pci_dev *if (!err &&netif_running (netdev)) err =ixgbe_open (netdev); -rtnl_unlock (); -if (err) -return err; - -netif_device_attach (netdev); +if (!err) +netif_device_attach (netdev); +rtnl_unlock (); - return 0; + return err; }#endif /* CONFIG_PM */
@@ -5627,14 +5626,14 @@ static int __ixgbe_shutdown(struct pci_dint retval =0 ;#endif +rtnl_lock ();netif_device_detach (netdev); -rtnl_lock ();if (netif_running (netdev))ixgbe_close_suspend (adapter); -rtnl_unlock ();ixgbe_clear_interrupt_scheme (adapter); +rtnl_unlock ();#ifdef CONFIG_PM retval =pci_save_state (pdev);
Greg Kroah-Hartman
maintainerPATCH 26/38 MIPS: End asm function prologue macros with .insn
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Burton <[email protected]>
[ Upstream commit 08889582b8aa0bbc01a1e5a0033b9f98d2e11caa ]
When building a kernel targeting a microMIPS ISA, recent GNU linkers will fail the link if they cannot determine that the target of a branch or jump is microMIPS code, with errors such as the following:
mips-img-linux-gnu-ld: arch/mips/built-in.o: .text+0x542c:
Unsupported jump between ISA modes; consider recompiling with interlinking enabled.
mips-img-linux-gnu-ld: final link failed: Bad value
or:
./arch/mips/include/asm/uaccess.h:1017: warning: JALX to a non-word-aligned address
Placing anything other than an instruction at the start of a function written in assembly appears to trigger such errors. In order to prepare for allowing us to follow function prologue macros with an EXPORT_SYMBOL invocation, end the prologue macros (LEAD, NESTED & FEXPORT) with a .insn directive. This ensures that the start of the function is marked as code, which always makes sense for functions & safely prevents us from hitting the link errors described above.
Patchwork: https://patchwork.linux-mips.org/patch/14508/
--- arch/mips/include/asm/asm.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-)
arch/mips/include/asm/asm.h +6 -4
@@ -54,7 +54,8 @@ .align 2; \ .type symbol, @function; \ .ent symbol, 0; \ -symbol: .frame sp, 0, ra +symbol: .frame sp, 0, ra; \ + .insn/* * NESTED - declare nested routine entry point
@@ -63,8 +64,9 @@ symbol: .frame sp, 0, ra .globl symbol; \ .align 2; \ .type symbol, @function; \ - .ent symbol, 0; \ -symbol: .frame sp, framesize, rpc + .ent symbol, 0; \ +symbol: .frame sp, framesize, rpc; \ + .insn/* * END - mark end of function
@@ -86,7 +88,7 @@ symbol:#define FEXPORT (symbol) \ .globl symbol; \ .type symbol, @function; \ -symbol: +symbol: .insn/* * ABS - export absolute symbol
Greg Kroah-Hartman
maintainerPATCH 27/38 MIPS: init: Ensure reserved memory regions are not added to bootmem
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Marcin Nowakowski <[email protected]>
[ Upstream commit e89ef66d7682f031f026eee6bba03c8c2248d2a9 ]
Memories managed through boot_mem_map are generally expected to define non-crossing areas. However, if part of a larger memory block is marked as reserved, it would still be added to bootmem allocator as an available block and could end up being overwritten by the allocator.
Prevent this by explicitly marking the memory as reserved it if exists in the range used by bootmem allocator.
Patchwork: https://patchwork.linux-mips.org/patch/14608/
--- arch/mips/kernel/setup.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/mips/kernel/setup.c +4 -0
@@ -427,6 +427,10 @@ static void __init bootmem_init(void)continue ;default :/* Not usable memory */ +if (start > min_low_pfn && end < max_low_pfn) +reserve_bootmem (boot_mem_map.map[i].addr, + boot_mem_map.map[i].size, +BOOTMEM_DEFAULT );continue ; }
Greg Kroah-Hartman
maintainerPATCH 28/38 MIPS: Netlogic: Exclude netlogic,xlp-pic code from XLR builds
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Paul Burton <[email protected]>
[ Upstream commit 9799270affc53414da96e77e454a5616b39cdab0 ]
Code in arch/mips/netlogic/common/irq.c which handles the XLP PIC fails to build in XLR configurations due to cpu_is_xlp9xx not being defined, leading to the following build failure:
arch/mips/netlogic/common/irq.c: In function ‘xlp_of_pic_init’:
arch/mips/netlogic/common/irq.c:298:2: error: implicit declaration of function ‘cpu_is_xlp9xx’ [-Werror=implicit-function-declaration]
if (cpu_is_xlp9xx()) {
^
Although the code was conditional upon CONFIG_OF which is indirectly selected by CONFIG_NLM_XLP_BOARD but not CONFIG_NLM_XLR_BOARD, the failing XLR with CONFIG_OF configuration can be configured manually or by randconfig.
Fix the build failure by making the affected XLP PIC code conditional upon CONFIG_CPU_XLP which is used to guard the inclusion of asm/netlogic/xlp-hal/xlp.h that provides the required cpu_is_xlp9xx function.
[[email protected]: Fixed up as per Jayachandran's suggestion.]
Patchwork: https://patchwork.linux-mips.org/patch/14524/
--- arch/mips/netlogic/common/irq.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/mips/netlogic/common/irq.c +2 -2
@@ -275,7 +275,7 @@ asmlinkage void plat_irq_dispatch(void)do_IRQ (nlm_irq_to_xirq (node, i)); } -#ifdef CONFIG_OF +#ifdef CONFIG_CPU_XLP static const struct irq_domain_ops xlp_pic_irq_domain_ops = { .xlate = irq_domain_xlate_onetwocell, };
@@ -348,7 +348,7 @@ void __init arch_init_irq(void)#if defined(CONFIG_CPU_XLR )nlm_setup_fmn_irq ();#endif -#if defined(CONFIG_OF ) +#ifdef CONFIG_CPU_XLP of_irq_init (xlp_pic_irq_ids);#endif }
Greg Kroah-Hartman
maintainerPATCH 29/38 Revert "crypto: xts - Add ECB dependency"
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <[email protected]>
This reverts commit 6145171a6bc0abdc3eca7a4b795ede467d2ba569.
The commit fixes a bug that was only introduced in 4.10, thus is irrelevant for <=4.9.
--- crypto/Kconfig | 1 - 1 file changed, 1 deletion(-)
crypto/Kconfig +0 -1
@@ -290,7 +290,6 @@ config CRYPTO_XTS select CRYPTO_BLKCIPHER select CRYPTO_MANAGER select CRYPTO_GF128MUL - select CRYPTO_ECB help XTS: IEEE1619/D16 narrow block cipher use with aes-xts-plain, key size 256, 384 or 512 bits. This implementation currently
Greg Kroah-Hartman
maintainerPATCH 30/38 Revert "uapi: fix linux/rds.h userspace compilation errors"
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Sasha Levin <[email protected]>
This reverts commit ad50561ba7a664bc581826c9d57d137fcf17bfa5.
There was a mixup with the commit message for two upstream commit that have the same subject line.
This revert will be followed by the two commits with proper commit messages.
--- include/uapi/linux/rds.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
include/uapi/linux/rds.h +1 -2
@@ -35,7 +35,6 @@#define _LINUX_RDS_H#include <linux/types.h> -#include <linux/socket.h> /* For __kernel_sockaddr_storage. */ #define RDS_IB_ABI_VERSION 0x301
@@ -214,7 +213,7 @@ struct rds_get_mr_args { };struct rds_get_mr_for_dest_args { -struct __kernel_sockaddr_storage dest_addr; +struct sockaddr_storage dest_addr;struct rds_iovec vec;uint64_t cookie_addr;uint64_t flags;
Greg Kroah-Hartman
maintainerPATCH 31/38 uapi: fix linux/rds.h userspace compilation error
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Dmitry V. Levin" <[email protected]>
[ Upstream commit 1786dbf3702e33ce3afd2d3dbe630bd04b1d2e58 ]
On the kernel side, sockaddr_storage is #define'd to __kernel_sockaddr_storage. Replacing struct sockaddr_storage with struct __kernel_sockaddr_storage defined by <linux/socket.h> fixes the following linux/rds.h userspace compilation error:
/usr/include/linux/rds.h:226:26: error: field 'dest_addr' has incomplete type
struct sockaddr_storage dest_addr;
--- include/uapi/linux/rds.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/uapi/linux/rds.h +2 -1
@@ -35,6 +35,7 @@#define _LINUX_RDS_H#include <linux/types.h> +#include <linux/socket.h> /* For __kernel_sockaddr_storage. */ #define RDS_IB_ABI_VERSION 0x301
@@ -213,7 +214,7 @@ struct rds_get_mr_args { };struct rds_get_mr_for_dest_args { -struct sockaddr_storage dest_addr; +struct __kernel_sockaddr_storage dest_addr;struct rds_iovec vec;uint64_t cookie_addr;uint64_t flags;
Greg Kroah-Hartman
maintainerPATCH 32/38 uapi: fix linux/rds.h userspace compilation errors
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: "Dmitry V. Levin" <[email protected]>
[ Upstream commit feb0869d90e51ce8b6fd8a46588465b1b5a26d09 ]
Consistently use types from linux/types.h to fix the following linux/rds.h userspace compilation errors:
/usr/include/linux/rds.h:106:2: error: unknown type name 'uint8_t'
uint8_t name[32];/usr/include/linux/rds.h:107:2: error: unknown type name 'uint64_t'
uint64_t value;/usr/include/linux/rds.h:117:2: error: unknown type name 'uint64_t'
uint64_t next_tx_seq;/usr/include/linux/rds.h:118:2: error: unknown type name 'uint64_t'
uint64_t next_rx_seq;/usr/include/linux/rds.h:121:2: error: unknown type name 'uint8_t'
uint8_t transport[TRANSNAMSIZ]; /* null term ascii *//usr/include/linux/rds.h:122:2: error: unknown type name 'uint8_t'
uint8_t flags;/usr/include/linux/rds.h:129:2: error: unknown type name 'uint64_t'
uint64_t seq;/usr/include/linux/rds.h:130:2: error: unknown type name 'uint32_t'
uint32_t len;/usr/include/linux/rds.h:135:2: error: unknown type name 'uint8_t'
uint8_t flags;/usr/include/linux/rds.h:139:2: error: unknown type name 'uint32_t'
uint32_t sndbuf;/usr/include/linux/rds.h:144:2: error: unknown type name 'uint32_t'
uint32_t rcvbuf;/usr/include/linux/rds.h:145:2: error: unknown type name 'uint64_t'
uint64_t inum;/usr/include/linux/rds.h:153:2: error: unknown type name 'uint64_t'
uint64_t hdr_rem;/usr/include/linux/rds.h:154:2: error: unknown type name 'uint64_t'
uint64_t data_rem;/usr/include/linux/rds.h:155:2: error: unknown type name 'uint32_t'
uint32_t last_sent_nxt;/usr/include/linux/rds.h:156:2: error: unknown type name 'uint32_t'
uint32_t last_expected_una;/usr/include/linux/rds.h:157:2: error: unknown type name 'uint32_t'
uint32_t last_seen_una;/usr/include/linux/rds.h:164:2: error: unknown type name 'uint8_t'
uint8_t src_gid[RDS_IB_GID_LEN];/usr/include/linux/rds.h:165:2: error: unknown type name 'uint8_t'
uint8_t dst_gid[RDS_IB_GID_LEN];/usr/include/linux/rds.h:167:2: error: unknown type name 'uint32_t'
uint32_t max_send_wr;/usr/include/linux/rds.h:168:2: error: unknown type name 'uint32_t'
uint32_t max_recv_wr;/usr/include/linux/rds.h:169:2: error: unknown type name 'uint32_t'
uint32_t max_send_sge;/usr/include/linux/rds.h:170:2: error: unknown type name 'uint32_t'
uint32_t rdma_mr_max;/usr/include/linux/rds.h:171:2: error: unknown type name 'uint32_t'
uint32_t rdma_mr_size;/usr/include/linux/rds.h:212:9: error: unknown type name 'uint64_t'
typedef uint64_t rds_rdma_cookie_t;/usr/include/linux/rds.h:215:2: error: unknown type name 'uint64_t'
uint64_t addr;/usr/include/linux/rds.h:216:2: error: unknown type name 'uint64_t'
uint64_t bytes;/usr/include/linux/rds.h:221:2: error: unknown type name 'uint64_t'
uint64_t cookie_addr;/usr/include/linux/rds.h:222:2: error: unknown type name 'uint64_t'
uint64_t flags;/usr/include/linux/rds.h:228:2: error: unknown type name 'uint64_t'
uint64_t cookie_addr;/usr/include/linux/rds.h:229:2: error: unknown type name 'uint64_t'
uint64_t flags;/usr/include/linux/rds.h:234:2: error: unknown type name 'uint64_t'
uint64_t flags;/usr/include/linux/rds.h:240:2: error: unknown type name 'uint64_t'
uint64_t local_vec_addr;/usr/include/linux/rds.h:241:2: error: unknown type name 'uint64_t'
uint64_t nr_local;/usr/include/linux/rds.h:242:2: error: unknown type name 'uint64_t'
uint64_t flags;/usr/include/linux/rds.h:243:2: error: unknown type name 'uint64_t'
uint64_t user_token;/usr/include/linux/rds.h:248:2: error: unknown type name 'uint64_t'
uint64_t local_addr;/usr/include/linux/rds.h:249:2: error: unknown type name 'uint64_t'
uint64_t remote_addr;/usr/include/linux/rds.h:252:4: error: unknown type name 'uint64_t'
uint64_t compare;
/usr/include/linux/rds.h:253:4: error: unknown type name 'uint64_t'
uint64_t swap;
/usr/include/linux/rds.h:256:4: error: unknown type name 'uint64_t'
uint64_t add;
/usr/include/linux/rds.h:259:4: error: unknown type name 'uint64_t'
uint64_t compare;
/usr/include/linux/rds.h:260:4: error: unknown type name 'uint64_t'
uint64_t swap;
/usr/include/linux/rds.h:261:4: error: unknown type name 'uint64_t'
uint64_t compare_mask;
/usr/include/linux/rds.h:262:4: error: unknown type name 'uint64_t'
uint64_t swap_mask;
/usr/include/linux/rds.h:265:4: error: unknown type name 'uint64_t'
uint64_t add;
/usr/include/linux/rds.h:266:4: error: unknown type name 'uint64_t'
uint64_t nocarry_mask;/usr/include/linux/rds.h:269:2: error: unknown type name 'uint64_t'
uint64_t flags;/usr/include/linux/rds.h:270:2: error: unknown type name 'uint64_t'
uint64_t user_token;/usr/include/linux/rds.h:274:2: error: unknown type name 'uint64_t'
uint64_t user_token;/usr/include/linux/rds.h:275:2: error: unknown type name 'int32_t'
int32_t status;
--- include/uapi/linux/rds.h | 102 +++++++++++++++++++++++------------------------ 1 file changed, 51 insertions(+), 51 deletions(-)
include/uapi/linux/rds.h +51 -51
@@ -94,8 +94,8 @@#define RDS_INFO_LAST 10010struct rds_info_counter { -uint8_t name[32 ]; -uint64_t value; +__u8 name[32 ]; +__u64 value; } __attribute__((packed));#define RDS_INFO_CONNECTION_FLAG_SENDING 0x01
@@ -105,35 +105,35 @@ struct rds_info_counter {#define TRANSNAMSIZ 16struct rds_info_connection { -uint64_t next_tx_seq; -uint64_t next_rx_seq; +__u64 next_tx_seq; +__u64 next_rx_seq;__be32 laddr;__be32 faddr; -uint8_t transport[TRANSNAMSIZ ];/* null term ascii */ -uint8_t flags; +__u8 transport[TRANSNAMSIZ ];/* null term ascii */ +__u8 flags; } __attribute__((packed));#define RDS_INFO_MESSAGE_FLAG_ACK 0x01#define RDS_INFO_MESSAGE_FLAG_FAST_ACK 0x02struct rds_info_message { -uint64_t seq; -uint32_t len; +__u64 seq; +__u32 len;__be32 laddr;__be32 faddr;__be16 lport;__be16 fport; -uint8_t flags; +__u8 flags; } __attribute__((packed));struct rds_info_socket { -uint32_t sndbuf; +__u32 sndbuf;__be32 bound_addr;__be32 connected_addr;__be16 bound_port;__be16 connected_port; -uint32_t rcvbuf; -uint64_t inum; +__u32 rcvbuf; +__u64 inum; } __attribute__((packed));struct rds_info_tcp_socket {
@@ -141,25 +141,25 @@ struct rds_info_tcp_socket {__be16 local_port;__be32 peer_addr;__be16 peer_port; -uint64_t hdr_rem; -uint64_t data_rem; -uint32_t last_sent_nxt; -uint32_t last_expected_una; -uint32_t last_seen_una; +__u64 hdr_rem; +__u64 data_rem; +__u32 last_sent_nxt; +__u32 last_expected_una; +__u32 last_seen_una; } __attribute__((packed));#define RDS_IB_GID_LEN 16struct rds_info_rdma_connection {__be32 src_addr;__be32 dst_addr; -uint8_t src_gid[RDS_IB_GID_LEN ]; -uint8_t dst_gid[RDS_IB_GID_LEN ]; +__u8 src_gid[RDS_IB_GID_LEN ]; +__u8 dst_gid[RDS_IB_GID_LEN ]; -uint32_t max_send_wr; -uint32_t max_recv_wr; -uint32_t max_send_sge; -uint32_t rdma_mr_max; -uint32_t rdma_mr_size; +__u32 max_send_wr; +__u32 max_recv_wr; +__u32 max_send_sge; +__u32 rdma_mr_max; +__u32 rdma_mr_size; };/*
@@ -200,70 +200,70 @@ struct rds_info_rdma_connection {* (so that the application does not have to worry about * alignment). */ -typedef uint64_t rds_rdma_cookie_t ; +typedef __u64 rds_rdma_cookie_t ;struct rds_iovec { -uint64_t addr; -uint64_t bytes; +__u64 addr; +__u64 bytes; };struct rds_get_mr_args {struct rds_iovec vec; -uint64_t cookie_addr; -uint64_t flags; +__u64 cookie_addr; +__u64 flags; };struct rds_get_mr_for_dest_args {struct __kernel_sockaddr_storage dest_addr;struct rds_iovec vec; -uint64_t cookie_addr; -uint64_t flags; +__u64 cookie_addr; +__u64 flags; };struct rds_free_mr_args {rds_rdma_cookie_t cookie; -uint64_t flags; +__u64 flags; };struct rds_rdma_args {rds_rdma_cookie_t cookie;struct rds_iovec remote_vec; -uint64_t local_vec_addr; -uint64_t nr_local; -uint64_t flags; -uint64_t user_token; +__u64 local_vec_addr; +__u64 nr_local; +__u64 flags; +__u64 user_token; };struct rds_atomic_args {rds_rdma_cookie_t cookie; -uint64_t local_addr; -uint64_t remote_addr; +__u64 local_addr; +__u64 remote_addr;union {struct { -uint64_t compare; -uint64_t swap; +__u64 compare; +__u64 swap; } cswp;struct { -uint64_t add; +__u64 add; } fadd;struct { -uint64_t compare; -uint64_t swap; -uint64_t compare_mask; -uint64_t swap_mask; +__u64 compare; +__u64 swap; +__u64 compare_mask; +__u64 swap_mask; } m_cswp;struct { -uint64_t add; -uint64_t nocarry_mask; +__u64 add; +__u64 nocarry_mask; } m_fadd; }; -uint64_t flags; -uint64_t user_token; +__u64 flags; +__u64 user_token; };struct rds_rdma_notify { -uint64_t user_token; -int32_t status; +__u64 user_token; +__s32 status; };#define RDS_RDMA_SUCCESS 0
Greg Kroah-Hartman
maintainerPATCH 33/38 USB: usbfs: compute urb->actual_length for isochronous
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alan Stern <[email protected]>
commit 2ef47001b3ee3ded579b7532ebdcf8680e4d8c54 upstream.
The USB kerneldoc says that the actual_length field "is read in non-iso completion functions", but the usbfs driver uses it for all URB types in processcompl(). Since not all of the host controller drivers set actual_length for isochronous URBs, programs using usbfs with some host controllers don't work properly. For example, Minas reports that a USB camera controlled by libusb doesn't work properly with a dwc2 controller.
It doesn't seem worthwhile to change the HCDs and the documentation, since the in-kernel USB class drivers evidently don't rely on actual_length for isochronous transfers. The easiest solution is for usbfs to calculate the actual_length value for itself, by adding up the lengths of the individual packets in an isochronous transfer.
--- drivers/usb/core/devio.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/usb/core/devio.c +14 -0
@@ -1649,6 +1649,18 @@ static int proc_unlinkurb(struct usb_devreturn 0 ; } +static void compute_isochronous_actual_length (struct urb *urb) +{ +unsigned int i; + +if (urb->number_of_packets >0 ) { + urb->actual_length =0 ; +for (i =0 ; i < urb->number_of_packets; i++) + urb->actual_length += + urb->iso_frame_desc[i].actual_length; + } +} +static int processcompl (struct async *as,void __user *__user *arg) {struct urb *urb = as->urb;
@@ -1656,6 +1668,7 @@ static int processcompl(struct async *asvoid __user *addr = as->userurb;unsigned int i; +compute_isochronous_actual_length (urb);if (as->userbuffer && urb->actual_length) {if (copy_urb_data_to_user (as->userbuffer, urb)) goto err_out;
@@ -1825,6 +1838,7 @@ static int processcompl_compat(struct asvoid __user *addr = as->userurb;unsigned int i; +compute_isochronous_actual_length (urb);if (as->userbuffer && urb->actual_length) {if (copy_urb_data_to_user (as->userbuffer, urb))return -EFAULT ;
Greg Kroah-Hartman
maintainerPATCH 34/38 USB: Add delay-init quirk for Corsair K70 LUX keyboards
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bernhard Rosenkraenzer <[email protected]>
commit a0fea6027f19c62727315aba1a7fae75a9caa842 upstream.
Without this patch, K70 LUX keyboards don't work, saying usb 3-3: unable to read config index 0 descriptor/all usb 3-3: can't read configurations, error -110 usb usb3-port3: unable to enumerate USB device
--- drivers/usb/core/quirks.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/core/quirks.c +3 -0
@@ -214,6 +214,9 @@ static const struct usb_device_id usb_qu/* Corsair Strafe RGB */ { USB_DEVICE(0x1b1c, 0x1b20), .driver_info = USB_QUIRK_DELAY_INIT }, + /* Corsair K70 LUX */ + { USB_DEVICE(0x1b1c, 0x1b36), .driver_info = USB_QUIRK_DELAY_INIT }, + /* MIDI keyboard WORLDE MINI */ { USB_DEVICE(0x1c75, 0x0204), .driver_info = USB_QUIRK_CONFIG_INTF_STRINGS },
Greg Kroah-Hartman
maintainerPATCH 35/38 USB: serial: qcserial: add pid/vid for Sierra Wireless EM7355 fw update
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Douglas Fischer <[email protected]>
commit 771394a54148f18926ca86414e51c69eda27d0cd upstream.
Add USB PID/VID for Sierra Wireless EM7355 LTE modem QDL firmware update mode.
--- drivers/usb/serial/qcserial.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/qcserial.c +1 -0
@@ -143,6 +143,7 @@ static const struct usb_device_id id_tab {DEVICE_SWI(0x114f, 0x68a2)}, /* Sierra Wireless MC7750 */ {DEVICE_SWI(0x1199, 0x68a2)}, /* Sierra Wireless MC7710 */ {DEVICE_SWI(0x1199, 0x901c)}, /* Sierra Wireless EM7700 */ + {DEVICE_SWI(0x1199, 0x901e)}, /* Sierra Wireless EM7355 QDL */ {DEVICE_SWI(0x1199, 0x901f)}, /* Sierra Wireless EM7355 */ {DEVICE_SWI(0x1199, 0x9040)}, /* Sierra Wireless Modem */ {DEVICE_SWI(0x1199, 0x9051)}, /* Netgear AirCard 340U */
Greg Kroah-Hartman
maintainerPATCH 36/38 USB: serial: garmin_gps: fix memory leak on failed URB submit
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit c4ac4496e835b78a45dfbf74f6173932217e4116 upstream.
Make sure to free the URB transfer buffer in case submission fails (e.g. due to a disconnect).
--- drivers/usb/serial/garmin_gps.c | 1 + 1 file changed, 1 insertion(+)
drivers/usb/serial/garmin_gps.c +1 -0
@@ -1044,6 +1044,7 @@ static int garmin_write_bulk(struct usb_"%s - usb_submit_urb(write bulk) failed with status = %d\n" , __func__, status); count = status; +kfree (buffer); }/* we are done with this urb, so let the host driver
Greg Kroah-Hartman
maintainerPATCH 37/38 USB: serial: garmin_gps: fix I/O after failed probe and remove
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 19a565d9af6e0d828bd0d521d3bafd5017f4ce52 upstream.
Make sure to stop any submitted interrupt and bulk-out URBs before returning after failed probe and when the port is being unbound to avoid later NULL-pointer dereferences in the completion callbacks.
Also fix up the related and broken I/O cancellation on failed open and on close. (Note that port->write_urb was never submitted.)
--- drivers/usb/serial/garmin_gps.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-)
drivers/usb/serial/garmin_gps.c +13 -3
@@ -138,6 +138,7 @@ struct garmin_data {__u8 privpkt[4 *6 ];spinlock_t lock;struct list_head pktlist; +struct usb_anchor write_urbs; };
@@ -906,7 +907,7 @@ static int garmin_init_session(struct us sizeof(GARMIN_START_SESSION_REQ), 0);if (status <0 ) -break ; + goto err_kill_urbs; }if (status >0 )
@@ -914,6 +915,12 @@ static int garmin_init_session(struct us }return status; + +err_kill_urbs: +usb_kill_anchored_urbs (&garmin_data_p->write_urbs); +usb_kill_urb (port->interrupt_in_urb); + +return status; }
@@ -931,7 +938,6 @@ static int garmin_open(struct tty_structspin_unlock_irqrestore (&garmin_data_p->lock, flags);/* shutdown any bulk reads that might be going on */ -usb_kill_urb (port->write_urb);usb_kill_urb (port->read_urb);if (garmin_data_p->state ==STATE_RESET )
@@ -954,7 +960,7 @@ static void garmin_close(struct usb_seri/* shutdown our urbs */ usb_kill_urb (port->read_urb); -usb_kill_urb (port->write_urb); +usb_kill_anchored_urbs (&garmin_data_p->write_urbs);/* keep reset state so we know that we must start a new session */ if (garmin_data_p->state !=STATE_RESET )
@@ -1038,12 +1044,14 @@ static int garmin_write_bulk(struct usb_ }/* send it down the pipe */ +usb_anchor_urb (urb, &garmin_data_p->write_urbs); status =usb_submit_urb (urb,GFP_ATOMIC );if (status) {dev_err (&port->dev,"%s - usb_submit_urb(write bulk) failed with status = %d\n" , __func__, status); count = status; +usb_unanchor_urb (urb);kfree (buffer); }
@@ -1402,6 +1410,7 @@ static int garmin_port_probe(struct usb_ garmin_data_p->state =0 ; garmin_data_p->flags =0 ; garmin_data_p->count =0 ; +init_usb_anchor (&garmin_data_p->write_urbs);usb_set_serial_port_data (port, garmin_data_p); status =garmin_init_session (port);
@@ -1414,6 +1423,7 @@ static int garmin_port_remove(struct usb {struct garmin_data *garmin_data_p =usb_get_serial_port_data (port); +usb_kill_anchored_urbs (&garmin_data_p->write_urbs);usb_kill_urb (port->interrupt_in_urb);del_timer_sync (&garmin_data_p->timer);kfree (garmin_data_p);
Greg Kroah-Hartman
maintainerPATCH 38/38 USB: serial: garmin_gps: fix memory leak on probe errors
In reply to Greg Kroah-Hartman3.18-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 74d471b598444b7f2d964930f7234779c80960a0 upstream.
Make sure to free the port private data before returning after a failed probe attempt.
--- drivers/usb/serial/garmin_gps.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/usb/serial/garmin_gps.c +6 -0
@@ -1414,6 +1414,12 @@ static int garmin_port_probe(struct usb_usb_set_serial_port_data (port, garmin_data_p); status =garmin_init_session (port); +if (status) + goto err_free; + +return 0 ; +err_free: +kfree (garmin_data_p);return status; }
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.83 release. There are 38 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Nov 21 14:29:00 UTC 2017. Anything received after that time might be too late.
Build results:
total: 136 pass: 136 fail: 0 Qemu test results: total: 112 pass: 110 fail: 2
Failed tests:
powerpc:bamboo:44x/bamboo_defconfig powerpc:bamboo:smpdev:44x/bamboo_defconfig
Building powerpc:bamboo:44x/bamboo_defconfig ... failed
------------
Error log:arch/powerpc/boot/treeboot-akebono.c:37:20: fatal error: libfdt.h: No such file or directory
#include "libfdt.h"
^compilation terminated.
make[1]: *** [arch/powerpc/boot/treeboot-akebono.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [zImage] Error 2
------------
Building powerpc:bamboo:smpdev:44x/bamboo_defconfig ... failed
------------
Error log:arch/powerpc/boot/treeboot-currituck.c:35:20: fatal error: libfdt.h: No such file or directory
#include "libfdt.h"
^compilation terminated.
make[1]: *** [arch/powerpc/boot/treeboot-currituck.o] Error 1
make[1]: *** Waiting for unfinished jobs.... arch/powerpc/boot/treeboot-iss4xx.c:33:20: fatal error: libfdt.h: No such file or directory
#include "libfdt.h"
Details are available at http://kerneltests.org/builders.
Guenter
Greg Kroah-Hartman
maintainerQuoted 35 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.83 release. There are 38 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Nov 21 14:29:00 UTC 2017. Anything received after that time might be too late.
Build results:
total: 136 pass: 136 fail: 0 Qemu test results: total: 112 pass: 110 fail: 2Failed tests:
powerpc:bamboo:44x/bamboo_defconfig powerpc:bamboo:smpdev:44x/bamboo_defconfigBuilding powerpc:bamboo:44x/bamboo_defconfig ... failed
------------
Error log:arch/powerpc/boot/treeboot-akebono.c:37:20: fatal error:libfdt.h: No such file or directory#include "libfdt.h" ^compilation terminated.
make[1]: *** [arch/powerpc/boot/treeboot-akebono.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [zImage] Error 2
------------
Building powerpc:bamboo:smpdev:44x/bamboo_defconfig ... failed
------------
Error log:arch/powerpc/boot/treeboot-currituck.c:35:20: fatal error:libfdt.h: No such file or directory#include "libfdt.h" ^
Quoted 7 lines
compilation terminated.
make[1]: *** [arch/powerpc/boot/treeboot-currituck.o] Error 1
make[1]: *** Waiting for unfinished jobs....arch/powerpc/boot/treeboot-iss4xx.c:33:20: fatal error:libfdt.h: No such file or directory
#include "libfdt.h"Details are available at http://kerneltests.org/builders.
This is really odd, nothing was changed around this code at all, is this a new arch/build that previously was not being built?
thanks,
greg k-h
Quoted 42 lines · Greg Kroah-Hartman
Quoted 41 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.83 release. There are 38 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Nov 21 14:29:00 UTC 2017. Anything received after that time might be too late.
Build results:
total: 136 pass: 136 fail: 0 Qemu test results: total: 112 pass: 110 fail: 2Failed tests:
powerpc:bamboo:44x/bamboo_defconfig powerpc:bamboo:smpdev:44x/bamboo_defconfigBuilding powerpc:bamboo:44x/bamboo_defconfig ... failed
------------
Error log:arch/powerpc/boot/treeboot-akebono.c:37:20: fatal error:libfdt.h: No such file or directory#include "libfdt.h" ^compilation terminated.
make[1]: *** [arch/powerpc/boot/treeboot-akebono.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [zImage] Error 2
------------
Building powerpc:bamboo:smpdev:44x/bamboo_defconfig ... failed
------------
Error log:arch/powerpc/boot/treeboot-currituck.c:35:20: fatal error:libfdt.h: No such file or directory#include "libfdt.h" ^compilation terminated.
make[1]: *** [arch/powerpc/boot/treeboot-currituck.o] Error 1
make[1]: *** Waiting for unfinished jobs....arch/powerpc/boot/treeboot-iss4xx.c:33:20: fatal error:libfdt.h: No such file or directory
#include "libfdt.h"
Quoted 5 lines
Quoted 1 line
Details are available at http://kerneltests.org/builders.
This is really odd, nothing was changed around this code at all, is this a new
arch/buildthat previously was not being built?
No, I have not changed anything recently. Let me have a look.
Guenter
Quoted 42 lines · Greg Kroah-Hartman
Quoted 41 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.83 release. There are 38 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Nov 21 14:29:00 UTC 2017. Anything received after that time might be too late.
Build results:
total: 136 pass: 136 fail: 0 Qemu test results: total: 112 pass: 110 fail: 2Failed tests:
powerpc:bamboo:44x/bamboo_defconfig powerpc:bamboo:smpdev:44x/bamboo_defconfigBuilding powerpc:bamboo:44x/bamboo_defconfig ... failed
------------
Error log:arch/powerpc/boot/treeboot-akebono.c:37:20: fatal error:libfdt.h: No such file or directory#include "libfdt.h" ^compilation terminated.
make[1]: *** [arch/powerpc/boot/treeboot-akebono.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [zImage] Error 2
------------
Building powerpc:bamboo:smpdev:44x/bamboo_defconfig ... failed
------------
Error log:arch/powerpc/boot/treeboot-currituck.c:35:20: fatal error:libfdt.h: No such file or directory#include "libfdt.h" ^compilation terminated.
make[1]: *** [arch/powerpc/boot/treeboot-currituck.o] Error 1
make[1]: *** Waiting for unfinished jobs....arch/powerpc/boot/treeboot-iss4xx.c:33:20: fatal error:libfdt.h: No such file or directory
#include "libfdt.h"
Quoted 5 lines
Quoted 1 line
Details are available at http://kerneltests.org/builders.
This is really odd, nothing was changed around this code at all, is this a new
arch/buildthat previously was not being built?
This was a flake. Rerun was fine. Updated results:
Build results:
total: 136 pass: 136 fail: 0 Qemu test results: total: 112 pass: 112 fail: 0
Having said that, building 44x/bamboo_defconfig on its own in 3.18.y (not part of the test script) does fail with that error, but that is nothing new. I'll look into that if I find the time.
Guenter
Greg Kroah-Hartman
maintainerQuoted 50 lines · Guenter Roeck
Quoted 42 lines · Greg Kroah-Hartman
Quoted 41 lines · Guenter Roeck
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.83 release. There are 38 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Nov 21 14:29:00 UTC 2017. Anything received after that time might be too late.
Build results:
total: 136 pass: 136 fail: 0 Qemu test results: total: 112 pass: 110 fail: 2Failed tests:
powerpc:bamboo:44x/bamboo_defconfig powerpc:bamboo:smpdev:44x/bamboo_defconfigBuilding powerpc:bamboo:44x/bamboo_defconfig ... failed
------------
Error log:arch/powerpc/boot/treeboot-akebono.c:37:20: fatal error:libfdt.h: No such file or directory#include "libfdt.h" ^compilation terminated.
make[1]: *** [arch/powerpc/boot/treeboot-akebono.o] Error 1
make[1]: *** Waiting for unfinished jobs....
make: *** [zImage] Error 2
------------
Building powerpc:bamboo:smpdev:44x/bamboo_defconfig ... failed
------------
Error log:arch/powerpc/boot/treeboot-currituck.c:35:20: fatal error:libfdt.h: No such file or directory#include "libfdt.h" ^compilation terminated.
make[1]: *** [arch/powerpc/boot/treeboot-currituck.o] Error 1
make[1]: *** Waiting for unfinished jobs....arch/powerpc/boot/treeboot-iss4xx.c:33:20: fatal error:libfdt.h: No such file or directory
#include "libfdt.h"Quoted 5 lines
Quoted 1 line
Details are available at http://kerneltests.org/builders.
This is really odd, nothing was changed around this code at all, is this a new
arch/buildthat previously was not being built?This was a flake. Rerun was fine. Updated results:
Quoted 8 lines
Build results:
total: 136 pass: 136 fail: 0 Qemu test results: total: 112 pass: 112 fail: 0Having said that, building 44x/bamboo_defconfig on its own in 3.18.y (not part of the test script) does fail with that error, but that is nothing new. I'll look into that if I find the time.
Don't worry too much about it, I doubt anyone cares about that arch/config for 3.18, so far it seems it is mostly just various ARM SoCs that are stuck at this old kernel version.
Thanks for running the tests again and letting me know.
greg k-h
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 3.18.83 release. There are 38 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Tue Nov 21 14:29:00 UTC 2017. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
kernel.org/pub/linux/kernel/v3.x/stable-review/patch-3.18.83-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-3.18.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah