5.4.114-rc1 review
Subsystems (2)
Greg Kroah-Hartman
maintainercover 5.4.114-rc1 review
This is the start of the stable review cycle for the 5.4.114 release. There are 73 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 Wed, 21 Apr 2021 13:05:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.114-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-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.4.114-rc1
Pali Rohár <[email protected]>
net: phy: marvell: fix detection of PHY on Topaz switches
Fredrik Strupe <[email protected]>
ARM: 9071/1: uprobes: Don't hook on thumb instructions
Heiner Kallweit <[email protected]>
r8169: don't advertise pause in jumbo mode
Heiner Kallweit <[email protected]>
r8169: tweak max read request size for newer chips also in jumbo mtu mode
Heiner Kallweit <[email protected]>
r8169: improve rtl_jumbo_config
Heiner Kallweit <[email protected]>
r8169: fix performance regression related to PCIe max read request size
Heiner Kallweit <[email protected]>
r8169: simplify setting PCI_EXP_DEVCTL_NOSNOOP_EN
Heiner Kallweit <[email protected]>
r8169: remove fiddling with the PCIe max read request size
Andre Przywara <[email protected]>
arm64: dts: allwinner: Fix SD card CD GPIO for SOPine systems
Russell King <[email protected]>
ARM: footbridge: fix PCI interrupt mapping
Eric Dumazet <[email protected]>
gro: ensure frag0 meets IP header alignment
Lijun Pan <[email protected]>
ibmvnic: remove duplicate napi_schedule call in open function
Lijun Pan <[email protected]>
ibmvnic: remove duplicate napi_schedule call in do_reset function
Lijun Pan <[email protected]>
ibmvnic: avoid calling napi_disable() twice
Jason Xing <[email protected]>
i40e: fix the panic when running bpf in xdpdrv mode
Hristo Venev <[email protected]>
net: ip6_tunnel: Unregister catch-all devices
Hristo Venev <[email protected]>
net: sit: Unregister catch-all devices
Christophe JAILLET <[email protected]>
net: davicom: Fix regulator not turned off on failed probe
Eric Dumazet <[email protected]>
netfilter: nft_limit: avoid possible divide error in nft_limit_init
Claudiu Beznea <[email protected]>
net: macb: fix the restore of cmp registers
Florian Westphal <[email protected]>
netfilter: arp_tables: add pre_exit hook for table unregister
Florian Westphal <[email protected]>
netfilter: bridge: add pre_exit hooks for ebtable unregistration
Vaibhav Jain <[email protected]>
libnvdimm/region: Fix nvdimm_has_flush() to handle ND_REGION_ASYNC
Pablo Neira Ayuso <[email protected]>
netfilter: conntrack: do not print icmpv6 as unknown via /proc
Jolly Shah <[email protected]>
scsi: libsas: Reset num_scatter if libata marks qc as NODATA
Kefeng Wang <[email protected]>
riscv: Fix spelling mistake "SPARSEMEM" to "SPARSMEM"
Christian A. Ehrhardt <[email protected]>
vfio/pci: Add missing range check in vfio_pci_mmap
Nathan Chancellor <[email protected]>
arm64: alternatives: Move length validation in alternative_{insn, endif}Peter Collingbourne <[email protected]>
arm64: fix inline asm in load_unaligned_zeropad()
Linus Torvalds <[email protected]>
readdir: make sure to verify directory entry for legacy interfaces too
Jaegeuk Kim <[email protected]>
dm verity fec: fix misaligned RS roots IO
Ping Cheng <[email protected]>
HID: wacom: set EV_KEY and EV_ABS only for non-HID_GENERIC type of devices
Arnd Bergmann <[email protected]>
Input: i8042 - fix Pegatron C15B ID entry
Caleb Connolly <[email protected]>
Input: s6sy761 - fix coordinate read bit shift
A. Cody Schuffelen <[email protected]>
virt_wifi: Return micros for BSS TSF values
Seevalamuthu Mariappan <[email protected]>
mac80211: clear sta->fast_rx when STA removed from 4-addr VLAN
Zheng Yongjun <[email protected]>
net: tipc: Fix spelling errors in net/tipc module
Aditya Pakki <[email protected]>
net/rds: Avoid potential use after free in rds_send_remove_from_sock
Guenter Roeck <[email protected]>
pcnet32: Use pci_resource_len to validate PCI resource
Alexander Aring <[email protected]>
net: ieee802154: forbid monitor for add llsec seclevel
Alexander Aring <[email protected]>
net: ieee802154: stop dump llsec seclevels for monitors
Alexander Aring <[email protected]>
net: ieee802154: forbid monitor for del llsec devkey
Alexander Aring <[email protected]>
net: ieee802154: forbid monitor for add llsec devkey
Alexander Aring <[email protected]>
net: ieee802154: stop dump llsec devkeys for monitors
Alexander Aring <[email protected]>
net: ieee802154: forbid monitor for del llsec dev
Alexander Aring <[email protected]>
net: ieee802154: forbid monitor for add llsec dev
Alexander Aring <[email protected]>
net: ieee802154: stop dump llsec devs for monitors
Alexander Aring <[email protected]>
net: ieee802154: forbid monitor for del llsec key
Alexander Aring <[email protected]>
net: ieee802154: forbid monitor for add llsec key
Alexander Aring <[email protected]>
net: ieee802154: stop dump llsec keys for monitors
Martin Wilck <[email protected]>
scsi: scsi_transport_srp: Don't block target in SRP_PORT_LOST state
Alexander Shiyan <[email protected]>
ASoC: fsl_esai: Fix TDM slot setup for I2S mode
Rob Clark <[email protected]>
drm/msm: Fix a5xx/a6xx timestamps
Arnd Bergmann <[email protected]>
ARM: omap1: fix building with clang IAS
Arnd Bergmann <[email protected]>
ARM: keystone: fix integer overflow warning
Tong Zhu <[email protected]>
neighbour: Disregard DEAD dst in neigh_update
Ryan Lee <[email protected]>
ASoC: max98373: Added 30ms turn on/off time delay
Wang Qing <[email protected]>
arc: kernel: Return -EFAULT if copy_to_user() fails
Tetsuo Handa <[email protected]>
lockdep: Add a missing initialization hint to the "INFO: Trying to register non-static key" message
Tony Lindgren <[email protected]>
ARM: dts: Fix moving mmc devices with aliases for omap4 & 5
Tony Lindgren <[email protected]>
ARM: dts: Drop duplicate sha2md5_fck to fix clk_disable race
Andy Shevchenko <[email protected]>
dmaengine: dw: Make it dependent to HAS_IOMEM
Matti Vaittinen <[email protected]>
gpio: sysfs: Obey valid_mask
Fabian Vogt <[email protected]>
Input: nspire-keypad - enable interrupts only when opened
Or Cohen <[email protected]>
net/sctp: fix race condition in sctp_destroy_sock
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix fabric scan hang
Quinn Tran <[email protected]>
scsi: qla2xxx: Fix stuck login session using prli_pend_timer
Shyam Sundar <[email protected]>
scsi: qla2xxx: Add a shadow variable to hold disc_state history of fcport
Quinn Tran <[email protected]>
scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure
Arun Easi <[email protected]>
scsi: qla2xxx: Fix device connect issues in P2P configuration
Michael Hernandez <[email protected]>
scsi: qla2xxx: Dual FCP-NVMe target port support
Sasha Levin <[email protected]>
Revert "scsi: qla2xxx: Fix stuck login session using prli_pend_timer"
Sasha Levin <[email protected]>
Revert "scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure"
-------------
Diffstat:
Makefile | 4 +- arch/arc/kernel/signal.c | 4 +- arch/arm/boot/dts/omap4.dtsi | 5 + arch/arm/boot/dts/omap44xx-clocks.dtsi | 8 -- arch/arm/boot/dts/omap5.dtsi | 5 + arch/arm/mach-footbridge/cats-pci.c | 4 +- arch/arm/mach-footbridge/ebsa285-pci.c | 4 +- arch/arm/mach-footbridge/netwinder-pci.c | 2 +- arch/arm/mach-footbridge/personal-pci.c | 5 +- arch/arm/mach-keystone/keystone.c | 4 +- arch/arm/mach-omap1/ams-delta-fiq-handler.S | 1 + arch/arm/probes/uprobes/core.c | 4 +- .../boot/dts/allwinner/sun50i-a64-pine64-lts.dts | 4 + .../boot/dts/allwinner/sun50i-a64-sopine.dtsi | 2 +- arch/arm64/include/asm/alternative.h | 8 +- arch/arm64/include/asm/word-at-a-time.h | 10 +- arch/riscv/Kconfig | 2 +- drivers/dma/dw/Kconfig | 2 + drivers/gpio/gpiolib-sysfs.c | 8 ++ drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 4 +- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 +- drivers/hid/wacom_wac.c | 6 +- drivers/input/keyboard/nspire-keypad.c | 56 ++++---- drivers/input/serio/i8042-x86ia64io.h | 1 + drivers/input/touchscreen/s6sy761.c | 4 +- drivers/md/dm-verity-fec.c | 11 +- drivers/md/dm-verity-fec.h | 1 + drivers/net/dsa/mv88e6xxx/chip.c | 30 ++--- drivers/net/ethernet/amd/pcnet32.c | 5 +- drivers/net/ethernet/cadence/macb_main.c | 2 +- drivers/net/ethernet/davicom/dm9000.c | 6 +- drivers/net/ethernet/ibm/ibmvnic.c | 14 +- drivers/net/ethernet/intel/i40e/i40e_main.c | 6 + drivers/net/ethernet/realtek/r8169_main.c | 141 +++++++-------------- drivers/net/phy/marvell.c | 29 ++++- drivers/net/wireless/virt_wifi.c | 5 +- drivers/nvdimm/region_devs.c | 9 +- drivers/scsi/libsas/sas_ata.c | 9 +- drivers/scsi/qla2xxx/qla_dbg.c | 2 +- drivers/scsi/qla2xxx/qla_def.h | 40 +++++- drivers/scsi/qla2xxx/qla_fw.h | 2 + drivers/scsi/qla2xxx/qla_gbl.h | 3 + drivers/scsi/qla2xxx/qla_gs.c | 44 ++++--- drivers/scsi/qla2xxx/qla_init.c | 133 +++++++++++-------- drivers/scsi/qla2xxx/qla_inline.h | 36 ++++++ drivers/scsi/qla2xxx/qla_iocb.c | 53 ++++++-- drivers/scsi/qla2xxx/qla_mbx.c | 11 +- drivers/scsi/qla2xxx/qla_os.c | 19 ++- drivers/scsi/qla2xxx/qla_target.c | 11 +- drivers/scsi/scsi_transport_srp.c | 2 +- drivers/vfio/pci/vfio_pci.c | 4 +- fs/readdir.c | 6 + include/linux/marvell_phy.h | 5 +- include/linux/netfilter_arp/arp_tables.h | 5 +- include/linux/netfilter_bridge/ebtables.h | 5 +- kernel/locking/lockdep.c | 3 +- net/bridge/netfilter/ebtable_broute.c | 8 +- net/bridge/netfilter/ebtable_filter.c | 8 +- net/bridge/netfilter/ebtable_nat.c | 8 +- net/bridge/netfilter/ebtables.c | 30 ++++- net/core/dev.c | 3 +- net/core/neighbour.c | 2 +- net/ieee802154/nl802154.c | 41 ++++++ net/ipv4/netfilter/arp_tables.c | 9 +- net/ipv4/netfilter/arptable_filter.c | 10 +- net/ipv6/ip6_tunnel.c | 10 ++ net/ipv6/sit.c | 4 +- net/mac80211/cfg.c | 4 +- net/netfilter/nf_conntrack_standalone.c | 1 + net/netfilter/nft_limit.c | 4 +- net/rds/message.c | 1 + net/rds/send.c | 2 +- net/sctp/socket.c | 13 +- net/tipc/bearer.h | 6 +- net/tipc/net.c | 2 +- net/tipc/node.c | 2 +- sound/soc/codecs/max98373.c | 2 + sound/soc/fsl/fsl_esai.c | 8 +- 78 files changed, 625 insertions(+), 366 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 1/73 Revert "scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure"
This reverts commit 74924e407bf74667b07430f785a104371be097af.
--- drivers/scsi/qla2xxx/qla_init.c | 28 ++++++++++++++++++++++++---- drivers/scsi/qla2xxx/qla_iocb.c | 6 +----- 2 files changed, 25 insertions(+), 9 deletions(-)
drivers/scsi/qla2xxx/qla_init.c +24 -4
@@ -1921,13 +1921,33 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea)"%s %d %8phC post fc4 prli\n" , __func__, __LINE__, ea->fcport->port_name); ea->fcport->fc4f_nvme =0 ; +qla24xx_post_prli_work (vha, ea->fcport);return ; } - ea->fcport->flags &= ~FCF_ASYNC_SENT ; - ea->fcport->keep_nport_handle =0 ; - ea->fcport->logout_on_delete =1 ; -qlt_schedule_sess_for_deletion (ea->fcport); +/* at this point both PRLI NVME & PRLI FCP failed */ +if (N2N_TOPO (vha->hw)) { +if (ea->fcport->n2n_link_reset_cnt <3 ) { + ea->fcport->n2n_link_reset_cnt++; +/* +* remote port is not sending Plogi. Reset +* link to kick start his state machine +*/ +set_bit (N2N_LINK_RESET , &vha->dpc_flags); + }else { +ql_log (ql_log_warn, vha,0x2119 , +"%s %d %8phC Unable to reconnect\n" , + __func__, __LINE__, ea->fcport->port_name); + } + }else { +/* +* switch connect. login failed. Take connection +* down and allow relogin to retrigger +*/ + ea->fcport->flags &= ~FCF_ASYNC_SENT ; + ea->fcport->keep_nport_handle =0 ; +qlt_schedule_sess_for_deletion (ea->fcport); + }break ; } }
drivers/scsi/qla2xxx/qla_iocb.c +1 -5
@@ -2773,7 +2773,6 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) ea.sp = sp;qla24xx_handle_plogi_done_event (vha, &ea);break ; -case CS_IOCB_ERROR :switch (fw_status[1 ]) {case LSC_SCODE_PORTID_USED :
@@ -2844,7 +2843,6 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) fw_status[0], fw_status[1], fw_status[2]); fcport->flags &= ~FCF_ASYNC_SENT ; - fcport->disc_state =DSC_LOGIN_FAILED ;set_bit (RELOGIN_NEEDED , &vha->dpc_flags);break ; }
@@ -2857,7 +2855,6 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) fw_status[0], fw_status[1], fw_status[2]); sp->fcport->flags &= ~FCF_ASYNC_SENT ; - sp->fcport->disc_state =DSC_LOGIN_FAILED ;set_bit (RELOGIN_NEEDED , &vha->dpc_flags);break ; }
@@ -2893,12 +2890,11 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,return -ENOMEM ; } - fcport->flags |=FCF_ASYNC_SENT ; - fcport->disc_state =DSC_LOGIN_PEND ; elsio = &sp->u.iocb_cmd;ql_dbg (ql_dbg_io, vha,0x3073 ,"Enter: PLOGI portid=%06x\n" , fcport->d_id.b24); + fcport->flags |=FCF_ASYNC_SENT ; sp->type =SRB_ELS_DCMD ; sp->name ="ELS_DCMD" ; sp->fcport = fcport;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 2/73 Revert "scsi: qla2xxx: Fix stuck login session using prli_pend_timer"
In reply to Greg Kroah-HartmanThis reverts commit 0b84591fdd5ea3ca0d93aaea489353f0381832c0.
--- drivers/scsi/qla2xxx/qla_def.h | 5 ----- drivers/scsi/qla2xxx/qla_init.c | 34 ++++++++----------------------- drivers/scsi/qla2xxx/qla_target.c | 1 - 3 files changed, 8 insertions(+), 32 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +0 -5
@@ -2402,7 +2402,6 @@ typedef struct fc_port { unsigned int scan_needed:1; unsigned int n2n_flag:1; unsigned int explicit_logout:1; - unsigned int prli_pend_timer:1;struct completion nvme_del_done;uint32_t nvme_prli_service_param;
@@ -2429,7 +2428,6 @@ typedef struct fc_port {struct work_struct free_work;struct work_struct reg_work;uint64_t jiffies_at_registration; -unsigned long prli_expired;struct qlt_plogi_ack_t *plogi_link[QLT_PLOGI_LINK_MAX ];uint16_t tgt_id;
@@ -4823,9 +4821,6 @@ struct sff_8247_a0 { ha->current_topology == ISP_CFG_N || \ !ha->current_topology) -#define PRLI_PHASE (_cls) \ - ((_cls == DSC_LS_PRLI_PEND) || (_cls == DSC_LS_PRLI_COMP)) -#include "qla_target.h" #include "qla_gbl.h" #include "qla_dbg.h"
drivers/scsi/qla2xxx/qla_init.c +8 -26
@@ -696,7 +696,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha,port_id_t id;u64 wwn;u16 data[2 ]; -u8 current_login_state, nvme_cls; +u8 current_login_state; fcport = ea->fcport; ql_dbg(ql_dbg_disc, vha, 0xffff,
@@ -755,17 +755,10 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, loop_id =le16_to_cpu (e->nport_handle); loop_id = (loop_id &0x7fff ); - nvme_cls = e->current_login_state >>4 ; - current_login_state = e->current_login_state &0xf ; - -if (PRLI_PHASE (nvme_cls)) { - current_login_state = nvme_cls; - fcport->fc4_type &= ~FS_FC4TYPE_FCP ; - fcport->fc4_type |=FS_FC4TYPE_NVME ; - }else if (PRLI_PHASE (current_login_state)) { - fcport->fc4_type |=FS_FC4TYPE_FCP ; - fcport->fc4_type &= ~FS_FC4TYPE_NVME ; - } +if (fcport->fc4f_nvme) + current_login_state = e->current_login_state >>4 ; +else + current_login_state = e->current_login_state &0xf ; ql_dbg(ql_dbg_disc, vha, 0x20e2,
@@ -1246,19 +1239,12 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport)struct srb_iocb *lio;int rval =QLA_FUNCTION_FAILED ; -if (!vha->flags.online) { -ql_dbg (ql_dbg_disc, vha,0xffff ,"%s %d %8phC exit\n" , - __func__, __LINE__, fcport->port_name); +if (!vha->flags.online)return rval; - } -if ((fcport->fw_login_state ==DSC_LS_PLOGI_PEND || - fcport->fw_login_state ==DSC_LS_PRLI_PEND ) && -qla_dual_mode_enabled (vha)) { -ql_dbg (ql_dbg_disc, vha,0xffff ,"%s %d %8phC exit\n" , - __func__, __LINE__, fcport->port_name); +if (fcport->fw_login_state ==DSC_LS_PLOGI_PEND || + fcport->fw_login_state ==DSC_LS_PRLI_PEND )return rval; - } sp =qla2x00_get_sp (vha, fcport,GFP_KERNEL );if (!sp)
@@ -1636,10 +1622,6 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)break ;default :if (fcport->login_pause) { -ql_dbg (ql_dbg_disc, vha,0x20d8 , -"%s %d %8phC exit\n" , - __func__, __LINE__, - fcport->port_name); fcport->last_rscn_gen = fcport->rscn_gen; fcport->last_login_gen = fcport->login_gen;set_bit (RELOGIN_NEEDED , &vha->dpc_flags);
drivers/scsi/qla2xxx/qla_target.c +0 -1
@@ -1267,7 +1267,6 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) sess->deleted =QLA_SESS_DELETION_IN_PROGRESS ;spin_unlock_irqrestore (&sess->vha->work_lock, flags); - sess->prli_pend_timer =0 ; sess->disc_state =DSC_DELETE_PEND ;qla24xx_chk_fcp_state (sess);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 3/73 scsi: qla2xxx: Dual FCP-NVMe target port support
In reply to Greg Kroah-HartmanFrom: Michael Hernandez <[email protected]>
[ Upstream commit 84ed362ac40ca44dbbbebf767301463aa72bc797 ]
Some storage arrays advertise FCP LUNs and NVMe namespaces behind the same WWN. The driver now offers a user option by way of NVRAM parameter to allow users to choose, on a per port basis, the kind of FC-4 type they would like to prioritize for login.
--- drivers/scsi/qla2xxx/qla_def.h | 26 ++++++++++++- drivers/scsi/qla2xxx/qla_fw.h | 2 + drivers/scsi/qla2xxx/qla_gs.c | 42 ++++++++++++-------- drivers/scsi/qla2xxx/qla_init.c | 64 ++++++++++++++++++------------- drivers/scsi/qla2xxx/qla_inline.h | 12 ++++++ drivers/scsi/qla2xxx/qla_mbx.c | 11 +++--- drivers/scsi/qla2xxx/qla_os.c | 17 ++++---- 7 files changed, 114 insertions(+), 60 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +24 -2
@@ -2281,7 +2281,7 @@ typedef struct {uint8_t fabric_port_name[WWN_SIZE ];uint16_t fp_speed;uint8_t fc4_type; -uint8_t fc4f_nvme;/* nvme fc4 feature bits */ +uint8_t fc4_features; } sw_info_t;/* FCP-4 types */
@@ -2450,7 +2450,7 @@ typedef struct fc_port {u32 supported_classes;uint8_t fc4_type; -uint8_t fc4f_nvme; +uint8_t fc4_features;uint8_t scan_state;unsigned long last_queue_full;
@@ -2481,6 +2481,9 @@ typedef struct fc_port {u16 n2n_chip_reset; } fc_port_t; +#define FC4_PRIORITY_NVME 0 +#define FC4_PRIORITY_FCP 1 +#define QLA_FCPORT_SCAN 1#define QLA_FCPORT_FOUND 2
@@ -4296,6 +4299,8 @@ struct qla_hw_data {atomic_t nvme_active_aen_cnt;uint16_t nvme_last_rptd_aen;/* Last recorded aen count */ +uint8_t fc4_type_priority; +atomic_t zio_threshold;uint16_t last_zio_threshold;
@@ -4821,6 +4826,23 @@ struct sff_8247_a0 { ha->current_topology == ISP_CFG_N || \ !ha->current_topology) +#define NVME_TYPE (fcport) \ + (fcport->fc4_type & FS_FC4TYPE_NVME) \ + +#define FCP_TYPE (fcport) \ + (fcport->fc4_type & FS_FC4TYPE_FCP) \ + +#define NVME_ONLY_TARGET (fcport) \ + (NVME_TYPE(fcport) && !FCP_TYPE(fcport)) \ + +#define NVME_FCP_TARGET (fcport) \ + (FCP_TYPE(fcport) && NVME_TYPE(fcport)) \ + +#define NVME_TARGET (ha, fcport) \ + ((NVME_FCP_TARGET(fcport) && \ + (ha->fc4_type_priority == FC4_PRIORITY_NVME)) || \ + NVME_ONLY_TARGET(fcport)) \ +#include "qla_target.h" #include "qla_gbl.h" #include "qla_dbg.h"
drivers/scsi/qla2xxx/qla_fw.h +2 -0
@@ -2105,4 +2105,6 @@ struct qla_fcp_prio_cfg {#define FA_FLASH_LAYOUT_ADDR_83 (0x3F1000/4)#define FA_FLASH_LAYOUT_ADDR_28 (0x11000/4) +#define NVRAM_DUAL_FCP_NVME_FLAG_OFFSET 0x196 +#endif
drivers/scsi/qla2xxx/qla_gs.c +25 -17
83 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_init.c +37 -27
155 lines not on this page · raw message
drivers/scsi/qla2xxx/qla_inline.h +12 -0
@@ -312,3 +312,15 @@ qla_83xx_start_iocbs(struct qla_qpair *qpair)WRT_REG_DWORD (req->req_q_in, req->ring_index); } + +static inline int +qla2xxx_get_fc4_priority (struct scsi_qla_host *vha) +{ +uint32_t data; + + data = + ((uint8_t *)vha->hw->nvram)[NVRAM_DUAL_FCP_NVME_FLAG_OFFSET ]; + + +return ((data >>6 ) &BIT_0 ); +}
drivers/scsi/qla2xxx/qla_mbx.c +6 -5
@@ -1924,7 +1924,7 @@ qla2x00_get_port_database(scsi_qla_host_t *vha, fc_port_t *fcport, uint8_t opt) pd24 = (struct port_database_24xx *) pd;/* Check for logged in state. */ -if (fcport->fc4f_nvme) { +if (NVME_TARGET (ha, fcport)) { current_login_state = pd24->current_login_state >>4 ; last_login_state = pd24->last_login_state >>4 ; }else {
@@ -3891,8 +3891,9 @@ qla24xx_report_id_acquisition(scsi_qla_host_t *vha, fcport->scan_state =QLA_FCPORT_FOUND ; fcport->n2n_flag =1 ; fcport->keep_nport_handle =1 ; + fcport->fc4_type =FS_FC4TYPE_FCP ;if (vha->flags.nvme_enabled) - fcport->fc4f_nvme =1 ; + fcport->fc4_type |=FS_FC4TYPE_NVME ;switch (fcport->disc_state) {case DSC_DELETED :
@@ -6350,7 +6351,7 @@ int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport,uint64_t zero =0 ;u8 current_login_state, last_login_state; -if (fcport->fc4f_nvme) { +if (NVME_TARGET (vha->hw, fcport)) { current_login_state = pd->current_login_state >>4 ; last_login_state = pd->last_login_state >>4 ; }else {
@@ -6385,8 +6386,8 @@ int __qla24xx_parse_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, fcport->d_id.b.al_pa = pd->port_id[2 ]; fcport->d_id.b.rsvd_1 =0 ; -if (fcport->fc4f_nvme) { - fcport->port_type =0 ; +if (NVME_TARGET (vha->hw, fcport)) { + fcport->port_type =FCT_NVME ;if ((pd->prli_svc_param_word_3[0 ] &BIT_5 ) ==0 ) fcport->port_type |=FCT_NVME_INITIATOR ;if ((pd->prli_svc_param_word_3[0 ] &BIT_4 ) ==0 )
drivers/scsi/qla2xxx/qla_os.c +8 -9
@@ -5055,19 +5055,17 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) fcport->d_id = e->u.new_sess.id; fcport->flags |=FCF_FABRIC_DEVICE ; fcport->fw_login_state =DSC_LS_PLOGI_PEND ; -if (e->u.new_sess.fc4_type ==FS_FC4TYPE_FCP ) - fcport->fc4_type =FC4_TYPE_FCP_SCSI ; - -if (e->u.new_sess.fc4_type ==FS_FC4TYPE_NVME ) { - fcport->fc4_type =FC4_TYPE_OTHER ; - fcport->fc4f_nvme =FC4_TYPE_NVME ; - }memcpy (fcport->port_name, e->u.new_sess.port_name,WWN_SIZE ); -if (e->u.new_sess.fc4_type &FS_FCP_IS_N2N ) + fcport->fc4_type = e->u.new_sess.fc4_type; +if (e->u.new_sess.fc4_type &FS_FCP_IS_N2N ) { + fcport->fc4_type =FS_FC4TYPE_FCP ; fcport->n2n_flag =1 ; +if (vha->flags.nvme_enabled) + fcport->fc4_type |=FS_FC4TYPE_NVME ; + } }else { ql_dbg(ql_dbg_disc, vha, 0xffff,
@@ -5171,7 +5169,8 @@ void qla24xx_create_new_sess(struct scsi_qla_host *vha, struct qla_work_evt *e) fcport->flags &= ~FCF_FABRIC_DEVICE ; fcport->keep_nport_handle =1 ;if (vha->flags.nvme_enabled) { - fcport->fc4f_nvme =1 ; + fcport->fc4_type = + (FS_FC4TYPE_NVME |FS_FC4TYPE_FCP ); fcport->n2n_flag =1 ; } fcport->fw_login_state =0 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 4/73 scsi: qla2xxx: Fix device connect issues in P2P configuration
In reply to Greg Kroah-HartmanFrom: Arun Easi <[email protected]>
[ Upstream commit 65e9200938052ce90f24421bb057e1be1d6147c7 ]
P2P needs to take the alternate plogi route.
--- drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 9 +++++++++ drivers/scsi/qla2xxx/qla_iocb.c | 5 ++--- 3 files changed, 12 insertions(+), 3 deletions(-)
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
@@ -917,4 +917,5 @@ int qla2x00_set_data_rate(scsi_qla_host_t *vha, uint16_t mode);/* nvme.c */ void qla_nvme_unregister_remote_port (struct fc_port *fcport); +void qla_handle_els_plogi_done (scsi_qla_host_t *vha,struct event_arg *ea);#endif /* _QLA_GBL_H */
drivers/scsi/qla2xxx/qla_init.c +9 -0
@@ -1738,6 +1738,15 @@ void qla24xx_handle_relogin_event(scsi_qla_host_t *vha,qla24xx_fcport_handle_login (vha, fcport); } +void qla_handle_els_plogi_done (scsi_qla_host_t *vha, +struct event_arg *ea) +{ +ql_dbg (ql_dbg_disc, vha,0x2118 , +"%s %d %8phC post PRLI\n" , + __func__, __LINE__, ea->fcport->port_name); +qla24xx_post_prli_work (vha, ea->fcport); +} +/* * RSCN(s) came in for this fcport, but the RSCN(s) was not able * to be consumed by the fcport
drivers/scsi/qla2xxx/qla_iocb.c +2 -3
@@ -2769,9 +2769,8 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res)case CS_COMPLETE :memset (&ea,0 ,sizeof (ea)); ea.fcport = fcport; - ea.data[0 ] =MBS_COMMAND_COMPLETE ; - ea.sp = sp; -qla24xx_handle_plogi_done_event (vha, &ea); + ea.rc = res; +qla_handle_els_plogi_done (vha, &ea);break ;case CS_IOCB_ERROR :switch (fw_status[1 ]) {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 5/73 scsi: qla2xxx: Retry PLOGI on FC-NVMe PRLI failure
In reply to Greg Kroah-HartmanFrom: Quinn Tran <[email protected]>
[ Upstream commit 983f127603fac650fa34ee69db363e4615eaf9e7 ]
Current code will send PRLI with FC-NVMe bit set for the targets which support only FCP. This may result into issue with targets which do not understand NVMe and will go into a strange state. This patch would restart the login process by going back to PLOGI state. The PLOGI state will force the target to respond to correct PRLI request.
--- drivers/scsi/qla2xxx/qla_init.c | 37 +++++++-------------------------- drivers/scsi/qla2xxx/qla_iocb.c | 6 +++++- 2 files changed, 13 insertions(+), 30 deletions(-)
drivers/scsi/qla2xxx/qla_init.c +8 -29
@@ -1911,42 +1911,21 @@ qla24xx_handle_prli_done_event(struct scsi_qla_host *vha, struct event_arg *ea)* FCP/NVMe port */ if (NVME_FCP_TARGET (ea->fcport)) { -if (vha->hw->fc4_type_priority ==FC4_PRIORITY_NVME ) - ea->fcport->fc4_type &= ~FS_FC4TYPE_NVME ; -else - ea->fcport->fc4_type &= ~FS_FC4TYPE_FCP ;ql_dbg (ql_dbg_disc, vha,0x2118 ,"%s %d %8phC post %s prli\n" , __func__, __LINE__, ea->fcport->port_name, (ea->fcport->fc4_type &FS_FC4TYPE_NVME ) ?"NVMe" :"FCP" ); -qla24xx_post_prli_work (vha, ea->fcport); -break ; +if (vha->hw->fc4_type_priority ==FC4_PRIORITY_NVME ) + ea->fcport->fc4_type &= ~FS_FC4TYPE_NVME ; +else + ea->fcport->fc4_type &= ~FS_FC4TYPE_FCP ; } -/* at this point both PRLI NVME & PRLI FCP failed */ -if (N2N_TOPO (vha->hw)) { -if (ea->fcport->n2n_link_reset_cnt <3 ) { - ea->fcport->n2n_link_reset_cnt++; -/* -* remote port is not sending Plogi. Reset -* link to kick start his state machine -*/ -set_bit (N2N_LINK_RESET , &vha->dpc_flags); - }else { -ql_log (ql_log_warn, vha,0x2119 , -"%s %d %8phC Unable to reconnect\n" , - __func__, __LINE__, ea->fcport->port_name); - } - }else { -/* -* switch connect. login failed. Take connection -* down and allow relogin to retrigger -*/ - ea->fcport->flags &= ~FCF_ASYNC_SENT ; - ea->fcport->keep_nport_handle =0 ; -qlt_schedule_sess_for_deletion (ea->fcport); - } + ea->fcport->flags &= ~FCF_ASYNC_SENT ; + ea->fcport->keep_nport_handle =0 ; + ea->fcport->logout_on_delete =1 ; +qlt_schedule_sess_for_deletion (ea->fcport);break ; } }
drivers/scsi/qla2xxx/qla_iocb.c +5 -1
@@ -2772,6 +2772,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) ea.rc = res;qla_handle_els_plogi_done (vha, &ea);break ; +case CS_IOCB_ERROR :switch (fw_status[1 ]) {case LSC_SCODE_PORTID_USED :
@@ -2842,6 +2843,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) fw_status[0], fw_status[1], fw_status[2]); fcport->flags &= ~FCF_ASYNC_SENT ; + fcport->disc_state =DSC_LOGIN_FAILED ;set_bit (RELOGIN_NEEDED , &vha->dpc_flags);break ; }
@@ -2854,6 +2856,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) fw_status[0], fw_status[1], fw_status[2]); sp->fcport->flags &= ~FCF_ASYNC_SENT ; + sp->fcport->disc_state =DSC_LOGIN_FAILED ;set_bit (RELOGIN_NEEDED , &vha->dpc_flags);break ; }
@@ -2889,11 +2892,12 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode,return -ENOMEM ; } + fcport->flags |=FCF_ASYNC_SENT ; + fcport->disc_state =DSC_LOGIN_PEND ; elsio = &sp->u.iocb_cmd;ql_dbg (ql_dbg_io, vha,0x3073 ,"Enter: PLOGI portid=%06x\n" , fcport->d_id.b24); - fcport->flags |=FCF_ASYNC_SENT ; sp->type =SRB_ELS_DCMD ; sp->name ="ELS_DCMD" ; sp->fcport = fcport;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 6/73 scsi: qla2xxx: Add a shadow variable to hold disc_state history of fcport
In reply to Greg Kroah-HartmanFrom: Shyam Sundar <[email protected]>
[ Upstream commit 27258a5771446f9c7edc929ecb76fe2c12c29d97 ]
This patch adds a shadow variable to hold disc_state history for the fcport and prints state transition when the logging is enabled.
--- drivers/scsi/qla2xxx/qla_dbg.c | 2 +- drivers/scsi/qla2xxx/qla_def.h | 14 ++++++++++++++ drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_gs.c | 2 +- drivers/scsi/qla2xxx/qla_init.c | 29 +++++++++++++++-------------- drivers/scsi/qla2xxx/qla_inline.h | 24 ++++++++++++++++++++++++ drivers/scsi/qla2xxx/qla_iocb.c | 7 ++++--- drivers/scsi/qla2xxx/qla_os.c | 2 +- drivers/scsi/qla2xxx/qla_target.c | 11 ++++++----- 9 files changed, 67 insertions(+), 25 deletions(-)
drivers/scsi/qla2xxx/qla_dbg.c +1 -1
@@ -18,7 +18,7 @@* | Device Discovery | 0x2134 | 0x210e-0x2116 | * | | | 0x211a | * | | | 0x211c-0x2128 | -* | | | 0x212a-0x2130 | +* | | | 0x212a-0x2134 | * | Queue Command and IO tracing | 0x3074 | 0x300b | * | | | 0x3027-0x3028 | * | | | 0x303d-0x3041 |
drivers/scsi/qla2xxx/qla_def.h +14 -0
@@ -2464,6 +2464,7 @@ typedef struct fc_port {struct qla_tgt_sess *tgt_session;struct ct_sns_desc ct_desc;enum discovery_state disc_state; +atomic_t shadow_disc_state;enum discovery_state next_disc_state;enum login_state fw_login_state;unsigned long dm_login_expire;
@@ -2508,6 +2509,19 @@ struct event_arg {extern const char *const port_state_str[5 ]; +static const char *const port_dstate_str[] = { +"DELETED" , +"GNN_ID" , +"GNL" , +"LOGIN_PEND" , +"LOGIN_FAILED" , +"GPDB" , +"UPD_FCPORT" , +"LOGIN_COMPLETE" , +"ADISC" , +"DELETE_PEND" +}; +/* * FC port flags. */
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
@@ -80,6 +80,7 @@ extern int qla24xx_async_gnl(struct scsi_qla_host *, fc_port_t *);int qla2x00_post_work (struct scsi_qla_host *vha,struct qla_work_evt *e);extern void *qla2x00_alloc_iocbs_ready (struct qla_qpair *,srb_t *);extern int qla24xx_update_fcport_fcp_prio (scsi_qla_host_t *,fc_port_t *); +extern int qla24xx_async_abort_cmd (srb_t *,bool );extern void qla2x00_set_fcport_state (fc_port_t *fcport,int state); extern fc_port_t *
drivers/scsi/qla2xxx/qla_gs.c +1 -1
@@ -4290,7 +4290,7 @@ int qla24xx_async_gnnid(scsi_qla_host_t *vha, fc_port_t *fcport)if (!vha->flags.online || (fcport->flags &FCF_ASYNC_SENT ))return rval; - fcport->disc_state =DSC_GNN_ID ; +qla2x00_set_fcport_disc_state (fcport,DSC_GNN_ID ); sp =qla2x00_get_sp (vha, fcport,GFP_ATOMIC );if (!sp) goto done;
drivers/scsi/qla2xxx/qla_init.c +15 -14
@@ -337,10 +337,10 @@ qla2x00_async_login(struct scsi_qla_host *vha, fc_port_t *fcport,if (!sp) goto done; +qla2x00_set_fcport_disc_state (fcport,DSC_LOGIN_PEND ); fcport->flags |=FCF_ASYNC_SENT ; fcport->logout_completed =0 ; - fcport->disc_state =DSC_LOGIN_PEND ; sp->type =SRB_LOGIN_CMD ; sp->name ="login" ; sp->gen1 = fcport->rscn_gen;
@@ -544,7 +544,7 @@ static int qla_post_els_plogi_work(struct scsi_qla_host *vha, fc_port_t *fcport) e->u.fcport.fcport = fcport; fcport->flags |=FCF_ASYNC_ACTIVE ; - fcport->disc_state =DSC_LOGIN_PEND ; +qla2x00_set_fcport_disc_state (fcport,DSC_LOGIN_PEND );return qla2x00_post_work (vha, e); }
@@ -847,7 +847,8 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha,* with GNL. Push disc_state back to DELETED * so GNL can go out again */ - fcport->disc_state =DSC_DELETED ; +qla2x00_set_fcport_disc_state (fcport, +DSC_DELETED );break ;case DSC_LS_PRLI_COMP :if ((e->prli_svc_param_word_3[0 ] &BIT_4 ) ==0 )
@@ -923,7 +924,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha,qla24xx_fcport_handle_login (vha, fcport);break ;case ISP_CFG_N : - fcport->disc_state =DSC_DELETED ; +qla2x00_set_fcport_disc_state (fcport,DSC_DELETED );if (time_after_eq (jiffies, fcport->dm_login_expire)) {if (fcport->n2n_link_reset_cnt <2 ) { fcport->n2n_link_reset_cnt++;
@@ -1093,7 +1094,7 @@ int qla24xx_async_gnl(struct scsi_qla_host *vha, fc_port_t *fcport)spin_lock_irqsave (&vha->hw->tgt.sess_lock, flags); fcport->flags |=FCF_ASYNC_SENT ; - fcport->disc_state =DSC_GNL ; +qla2x00_set_fcport_disc_state (fcport,DSC_GNL ); fcport->last_rscn_gen = fcport->rscn_gen; fcport->last_login_gen = fcport->login_gen;
@@ -1316,12 +1317,12 @@ int qla24xx_async_gpdb(struct scsi_qla_host *vha, fc_port_t *fcport, u8 opt)return rval; } - fcport->disc_state =DSC_GPDB ; - sp =qla2x00_get_sp (vha, fcport,GFP_KERNEL );if (!sp) goto done; +qla2x00_set_fcport_disc_state (fcport,DSC_GPDB ); + fcport->flags |=FCF_ASYNC_SENT ; sp->type =SRB_MB_IOCB ; sp->name ="gpdb" ;
@@ -1400,7 +1401,7 @@ void __qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea)ql_dbg (ql_dbg_disc, vha,0x20d6 ,"%s %d %8phC session revalidate success\n" , __func__, __LINE__, ea->fcport->port_name); - ea->fcport->disc_state =DSC_LOGIN_COMPLETE ; +qla2x00_set_fcport_disc_state (ea->fcport,DSC_LOGIN_COMPLETE ); }spin_unlock_irqrestore (&vha->hw->tgt.sess_lock, flags); }
@@ -1454,7 +1455,7 @@ void qla24xx_handle_gpdb_event(scsi_qla_host_t *vha, struct event_arg *ea)/* Set discovery state back to GNL to Relogin attempt */ if (qla_dual_mode_enabled (vha) ||qla_ini_mode_enabled (vha)) { - fcport->disc_state =DSC_GNL ; +qla2x00_set_fcport_disc_state (fcport,DSC_GNL );set_bit (RELOGIN_NEEDED , &vha->dpc_flags); }return ;
@@ -2013,7 +2014,7 @@ qla24xx_handle_plogi_done_event(struct scsi_qla_host *vha, struct event_arg *ea) __func__, __LINE__, ea->fcport->port_name, ea->data[1]); ea->fcport->flags &= ~FCF_ASYNC_SENT ; - ea->fcport->disc_state =DSC_LOGIN_FAILED ; +qla2x00_set_fcport_disc_state (ea->fcport,DSC_LOGIN_FAILED );if (ea->data[1 ] &QLA_LOGIO_LOGIN_RETRIED )set_bit (RELOGIN_NEEDED , &vha->dpc_flags);else
@@ -5393,7 +5394,7 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)ql_dbg (ql_dbg_disc, vha,0x20ef ,"%s %8phC\n" , __func__, fcport->port_name); - fcport->disc_state =DSC_UPD_FCPORT ; +qla2x00_set_fcport_disc_state (fcport,DSC_UPD_FCPORT ); fcport->login_retry = vha->hw->login_retry_count; fcport->flags &= ~(FCF_LOGIN_NEEDED |FCF_ASYNC_SENT ); fcport->deleted =0 ;
@@ -5413,7 +5414,7 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport)if (NVME_TARGET (vha->hw, fcport)) {qla_nvme_register_remote (vha, fcport); - fcport->disc_state =DSC_LOGIN_COMPLETE ; +qla2x00_set_fcport_disc_state (fcport,DSC_LOGIN_COMPLETE );qla2x00_set_fcport_state (fcport,FCS_ONLINE );return ; }
@@ -5458,7 +5459,7 @@ qla2x00_update_fcport(scsi_qla_host_t *vha, fc_port_t *fcport) } } - fcport->disc_state =DSC_LOGIN_COMPLETE ; +qla2x00_set_fcport_disc_state (fcport,DSC_LOGIN_COMPLETE ); }void qla_register_fcport_fn (struct work_struct *work)
@@ -5867,7 +5868,7 @@ qla2x00_find_all_fabric_devs(scsi_qla_host_t *vha)if (NVME_TARGET (vha->hw, fcport)) {if (fcport->disc_state ==DSC_DELETE_PEND ) { - fcport->disc_state =DSC_GNL ; +qla2x00_set_fcport_disc_state (fcport,DSC_GNL ); vha->fcport_count--; fcport->login_succ =0 ; }
drivers/scsi/qla2xxx/qla_inline.h +24 -0
@@ -105,6 +105,30 @@ qla2x00_clean_dsd_pool(struct qla_hw_data *ha, struct crc_context *ctx)INIT_LIST_HEAD (&ctx->dsd_list); } +static inline void +qla2x00_set_fcport_disc_state (fc_port_t *fcport,int state) +{ +int old_val; +uint8_t shiftbits, mask; + +/* This will have to change when the max no. of states > 16 */ + shiftbits =4 ; + mask = (1 << shiftbits) -1 ; + + fcport->disc_state = state; +while (1 ) { + old_val =atomic_read (&fcport->shadow_disc_state); +if (old_val ==atomic_cmpxchg (&fcport->shadow_disc_state, + old_val, (old_val << shiftbits) | state)) { +ql_dbg (ql_dbg_disc, fcport->vha,0x2134 , +"FCPort %8phC disc_state transition: %s to %s - portid=%06x.\n" , + fcport->port_name, port_dstate_str[old_val & mask], + port_dstate_str[state], fcport->d_id.b24); +return ; + } + } +} +static inline int qla2x00_hba_err_chk_enabled (srb_t *sp) {
drivers/scsi/qla2xxx/qla_iocb.c +4 -3
@@ -2843,7 +2843,8 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) fw_status[0], fw_status[1], fw_status[2]); fcport->flags &= ~FCF_ASYNC_SENT ; - fcport->disc_state =DSC_LOGIN_FAILED ; +qla2x00_set_fcport_disc_state (fcport, +DSC_LOGIN_FAILED );set_bit (RELOGIN_NEEDED , &vha->dpc_flags);break ; }
@@ -2856,7 +2857,7 @@ static void qla2x00_els_dcmd2_sp_done(srb_t *sp, int res) fw_status[0], fw_status[1], fw_status[2]); sp->fcport->flags &= ~FCF_ASYNC_SENT ; - sp->fcport->disc_state =DSC_LOGIN_FAILED ; +qla2x00_set_fcport_disc_state (fcport,DSC_LOGIN_FAILED );set_bit (RELOGIN_NEEDED , &vha->dpc_flags);break ; }
@@ -2893,7 +2894,7 @@ qla24xx_els_dcmd2_iocb(scsi_qla_host_t *vha, int els_opcode, } fcport->flags |=FCF_ASYNC_SENT ; - fcport->disc_state =DSC_LOGIN_PEND ; +qla2x00_set_fcport_disc_state (fcport,DSC_LOGIN_PEND ); elsio = &sp->u.iocb_cmd;ql_dbg (ql_dbg_io, vha,0x3073 ,"Enter: PLOGI portid=%06x\n" , fcport->d_id.b24);
drivers/scsi/qla2xxx/qla_os.c +1 -1
@@ -5014,7 +5014,7 @@ void qla24xx_sched_upd_fcport(fc_port_t *fcport) fcport->jiffies_at_registration = jiffies; fcport->sec_since_registration =0 ; fcport->next_disc_state =DSC_DELETED ; - fcport->disc_state =DSC_UPD_FCPORT ; +qla2x00_set_fcport_disc_state (fcport,DSC_UPD_FCPORT );spin_unlock_irqrestore (&fcport->vha->work_lock, flags);queue_work (system_unbound_wq, &fcport->reg_work);
drivers/scsi/qla2xxx/qla_target.c +6 -5
@@ -596,7 +596,8 @@ static void qla2x00_async_nack_sp_done(srb_t *sp, int res)spin_lock_irqsave (&vha->hw->tgt.sess_lock, flags); }else { sp->fcport->login_retry =0 ; - sp->fcport->disc_state =DSC_LOGIN_COMPLETE ; +qla2x00_set_fcport_disc_state (sp->fcport, +DSC_LOGIN_COMPLETE ); sp->fcport->deleted =0 ; sp->fcport->logout_on_delete =1 ; }
@@ -1056,7 +1057,7 @@ void qlt_free_session_done(struct work_struct *work) tgt->sess_count--; } - sess->disc_state =DSC_DELETED ; +qla2x00_set_fcport_disc_state (sess,DSC_DELETED ); sess->fw_login_state =DSC_LS_PORT_UNAVAIL ; sess->deleted =QLA_SESS_DELETED ;
@@ -1166,7 +1167,7 @@ void qlt_unreg_sess(struct fc_port *sess) vha->hw->tgt.tgt_ops->clear_nacl_from_fcport_map (sess); sess->deleted =QLA_SESS_DELETION_IN_PROGRESS ; - sess->disc_state =DSC_DELETE_PEND ; +qla2x00_set_fcport_disc_state (sess,DSC_DELETE_PEND ); sess->last_rscn_gen = sess->rscn_gen; sess->last_login_gen = sess->login_gen;
@@ -1267,7 +1268,7 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) sess->deleted =QLA_SESS_DELETION_IN_PROGRESS ;spin_unlock_irqrestore (&sess->vha->work_lock, flags); - sess->disc_state =DSC_DELETE_PEND ; +qla2x00_set_fcport_disc_state (sess,DSC_DELETE_PEND );qla24xx_chk_fcp_state (sess);
@@ -6060,7 +6061,7 @@ static fc_port_t *qlt_get_port_database(struct scsi_qla_host *vha,if (!IS_SW_RESV_ADDR (fcport->d_id)) vha->fcport_count++; fcport->login_gen++; - fcport->disc_state =DSC_LOGIN_COMPLETE ; +qla2x00_set_fcport_disc_state (fcport,DSC_LOGIN_COMPLETE ); fcport->login_succ =1 ; newfcport =1 ; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 7/73 scsi: qla2xxx: Fix stuck login session using prli_pend_timer
In reply to Greg Kroah-HartmanFrom: Quinn Tran <[email protected]>
[ Upstream commit 8aaac2d7da873aebeba92c666f82c00bbd74aaf9 ]
Session is stuck if driver sees FW has received a PRLI. Driver allows FW to finish with processing of PRLI by checking back with FW at a later time to see if the PRLI has finished. Instead, driver failed to push forward after re-checking PRLI completion.
--- drivers/scsi/qla2xxx/qla_def.h | 5 +++++ drivers/scsi/qla2xxx/qla_init.c | 34 +++++++++++++++++++++++-------- drivers/scsi/qla2xxx/qla_target.c | 1 + 3 files changed, 32 insertions(+), 8 deletions(-)
drivers/scsi/qla2xxx/qla_def.h +5 -0
@@ -2402,6 +2402,7 @@ typedef struct fc_port { unsigned int scan_needed:1; unsigned int n2n_flag:1; unsigned int explicit_logout:1; + unsigned int prli_pend_timer:1;struct completion nvme_del_done;uint32_t nvme_prli_service_param;
@@ -2428,6 +2429,7 @@ typedef struct fc_port {struct work_struct free_work;struct work_struct reg_work;uint64_t jiffies_at_registration; +unsigned long prli_expired;struct qlt_plogi_ack_t *plogi_link[QLT_PLOGI_LINK_MAX ];uint16_t tgt_id;
@@ -4857,6 +4859,9 @@ struct sff_8247_a0 { (ha->fc4_type_priority == FC4_PRIORITY_NVME)) || \ NVME_ONLY_TARGET(fcport)) \ +#define PRLI_PHASE (_cls) \ + ((_cls == DSC_LS_PRLI_PEND) || (_cls == DSC_LS_PRLI_COMP)) +#include "qla_target.h" #include "qla_gbl.h" #include "qla_dbg.h"
drivers/scsi/qla2xxx/qla_init.c +26 -8
@@ -696,7 +696,7 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha,port_id_t id;u64 wwn;u16 data[2 ]; -u8 current_login_state; +u8 current_login_state, nvme_cls; fcport = ea->fcport; ql_dbg(ql_dbg_disc, vha, 0xffff,
@@ -755,10 +755,17 @@ static void qla24xx_handle_gnl_done_event(scsi_qla_host_t *vha, loop_id =le16_to_cpu (e->nport_handle); loop_id = (loop_id &0x7fff ); -if (NVME_TARGET (vha->hw, fcport)) - current_login_state = e->current_login_state >>4 ; -else - current_login_state = e->current_login_state &0xf ; + nvme_cls = e->current_login_state >>4 ; + current_login_state = e->current_login_state &0xf ; + +if (PRLI_PHASE (nvme_cls)) { + current_login_state = nvme_cls; + fcport->fc4_type &= ~FS_FC4TYPE_FCP ; + fcport->fc4_type |=FS_FC4TYPE_NVME ; + }else if (PRLI_PHASE (current_login_state)) { + fcport->fc4_type |=FS_FC4TYPE_FCP ; + fcport->fc4_type &= ~FS_FC4TYPE_NVME ; + } ql_dbg(ql_dbg_disc, vha, 0x20e2, "%s found %8phC CLS [%x|%x] fc4_type %d ID[%06x|%06x] lid[%d|%d]\n",
@@ -1238,12 +1245,19 @@ qla24xx_async_prli(struct scsi_qla_host *vha, fc_port_t *fcport)struct srb_iocb *lio;int rval =QLA_FUNCTION_FAILED ; -if (!vha->flags.online) +if (!vha->flags.online) { +ql_dbg (ql_dbg_disc, vha,0xffff ,"%s %d %8phC exit\n" , + __func__, __LINE__, fcport->port_name);return rval; + } -if (fcport->fw_login_state ==DSC_LS_PLOGI_PEND || - fcport->fw_login_state ==DSC_LS_PRLI_PEND ) +if ((fcport->fw_login_state ==DSC_LS_PLOGI_PEND || + fcport->fw_login_state ==DSC_LS_PRLI_PEND ) && +qla_dual_mode_enabled (vha)) { +ql_dbg (ql_dbg_disc, vha,0xffff ,"%s %d %8phC exit\n" , + __func__, __LINE__, fcport->port_name);return rval; + } sp =qla2x00_get_sp (vha, fcport,GFP_KERNEL );if (!sp)
@@ -1622,6 +1636,10 @@ int qla24xx_fcport_handle_login(struct scsi_qla_host *vha, fc_port_t *fcport)break ;default :if (fcport->login_pause) { +ql_dbg (ql_dbg_disc, vha,0x20d8 , +"%s %d %8phC exit\n" , + __func__, __LINE__, + fcport->port_name); fcport->last_rscn_gen = fcport->rscn_gen; fcport->last_login_gen = fcport->login_gen;set_bit (RELOGIN_NEEDED , &vha->dpc_flags);
drivers/scsi/qla2xxx/qla_target.c +1 -0
@@ -1268,6 +1268,7 @@ void qlt_schedule_sess_for_deletion(struct fc_port *sess) sess->deleted =QLA_SESS_DELETION_IN_PROGRESS ;spin_unlock_irqrestore (&sess->vha->work_lock, flags); + sess->prli_pend_timer =0 ;qla2x00_set_fcport_disc_state (sess,DSC_DELETE_PEND );qla24xx_chk_fcp_state (sess);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 8/73 scsi: qla2xxx: Fix fabric scan hang
In reply to Greg Kroah-HartmanFrom: Quinn Tran <[email protected]>
[ Upstream commit f57a0107359605b29f4ea9afb8ee2e03473b1448 ]
On timeout, SRB pointer was cleared from outstanding command array and dropped. It was not allowed to go through the done process and cleanup. This patch will abort the SRB where FW will return it with an error status and resume the normal cleanup.
--- drivers/scsi/qla2xxx/qla_gbl.h | 1 + drivers/scsi/qla2xxx/qla_init.c | 34 +++++++++++++++------------ drivers/scsi/qla2xxx/qla_iocb.c | 41 ++++++++++++++++++++++++++------- 3 files changed, 53 insertions(+), 23 deletions(-)
drivers/scsi/qla2xxx/qla_gbl.h +1 -0
@@ -256,6 +256,7 @@ extern char *qla2x00_get_fw_version_str(struct scsi_qla_host *, char *);extern void qla2x00_mark_device_lost (scsi_qla_host_t *,fc_port_t *,int ,int );extern void qla2x00_mark_all_devices_lost (scsi_qla_host_t *,int ); +extern int qla24xx_async_abort_cmd (srb_t *,bool );extern struct fw_blob *qla2x00_request_firmware (scsi_qla_host_t *);
drivers/scsi/qla2xxx/qla_init.c +19 -15
@@ -50,16 +50,9 @@ qla2x00_sp_timeout(struct timer_list *t) {srb_t *sp =from_timer (sp, t, u.iocb_cmd.timer);struct srb_iocb *iocb; -struct req_que *req; -unsigned long flags; -struct qla_hw_data *ha = sp->vha->hw; -WARN_ON_ONCE (irqs_disabled ()); -spin_lock_irqsave (&ha->hardware_lock, flags); - req = sp->qpair->req; - req->outstanding_cmds[sp->handle] =NULL ; +WARN_ON (irqs_disabled ()); iocb = &sp->u.iocb_cmd; -spin_unlock_irqrestore (&ha->hardware_lock, flags); iocb->timeout (sp); }
@@ -153,7 +146,7 @@ static void qla24xx_abort_sp_done(srb_t *sp, int res) sp->free (sp); } -static int qla24xx_async_abort_cmd (srb_t *cmd_sp,bool wait) +int qla24xx_async_abort_cmd (srb_t *cmd_sp,bool wait) {scsi_qla_host_t *vha = cmd_sp->vha;struct srb_iocb *abt_iocb;
@@ -253,6 +246,7 @@ qla2x00_async_iocb_timeout(void *data)case SRB_NACK_PRLI :case SRB_NACK_LOGO :case SRB_CTRL_VP : +default : rc =qla24xx_async_abort_cmd (sp, false);if (rc) {spin_lock_irqsave (sp->qpair->qp_lock_ptr, flags);
@@ -269,10 +263,6 @@ qla2x00_async_iocb_timeout(void *data) sp->done (sp,QLA_FUNCTION_TIMEOUT ); }break ; -default : -WARN_ON_ONCE (true); - sp->done (sp,QLA_FUNCTION_TIMEOUT ); -break ; } }
@@ -1794,9 +1784,23 @@ qla2x00_tmf_iocb_timeout(void *data) {srb_t *sp = data;struct srb_iocb *tmf = &sp->u.iocb_cmd; +int rc, h; +unsigned long flags; - tmf->u.tmf.comp_status =CS_TIMEOUT ; -complete (&tmf->u.tmf.comp); + rc =qla24xx_async_abort_cmd (sp, false); +if (rc) { +spin_lock_irqsave (sp->qpair->qp_lock_ptr, flags); +for (h =1 ; h < sp->qpair->req->num_outstanding_cmds; h++) { +if (sp->qpair->req->outstanding_cmds[h] == sp) { + sp->qpair->req->outstanding_cmds[h] =NULL ; +break ; + } + } +spin_unlock_irqrestore (sp->qpair->qp_lock_ptr, flags); + tmf->u.tmf.comp_status =CS_TIMEOUT ; + tmf->u.tmf.data =QLA_FUNCTION_FAILED ; +complete (&tmf->u.tmf.comp); + } }static void qla2x00_tmf_sp_done (srb_t *sp,int res)
drivers/scsi/qla2xxx/qla_iocb.c +33 -8
69 lines not on this page · raw message
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 9/73 net/sctp: fix race condition in sctp_destroy_sock
In reply to Greg Kroah-HartmanFrom: Or Cohen <[email protected]>
commit b166a20b07382b8bc1dcee2a448715c9c2c81b5b upstream.
If sctp_destroy_sock is called without sock_net(sk)->sctp.addr_wq_lock held and sp->do_auto_asconf is true, then an element is removed from the auto_asconf_splist without any proper locking.
This can happen in the following functions:
1. In sctp_accept, if sctp_sock_migrate fails.
2. In inet_create or inet6_create, if there is a bpf program attached to BPF_CGROUP_INET_SOCK_CREATE which denies creation of the sctp socket.
The bug is fixed by acquiring addr_wq_lock in sctp_destroy_sock instead of sctp_close.
This addresses CVE-2021-23133.
--- net/sctp/socket.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
net/sctp/socket.c +5 -8
@@ -1539,11 +1539,9 @@ static void sctp_close(struct sock *sk,/* Supposedly, no process has access to the socket, but * the net layers still may. -* Also, sctp_destroy_sock() needs to be called with addr_wq_lock -* held and that should be grabbed before socket lock. */ -spin_lock_bh (&net->sctp.addr_wq_lock); -bh_lock_sock_nested (sk); +local_bh_disable (); +bh_lock_sock (sk);/* Hold the sock, since sk_common_release() will put sock_put() * and we have just a little more cleanup.
@@ -1552,7 +1550,7 @@ static void sctp_close(struct sock *sk,sk_common_release (sk);bh_unlock_sock (sk); -spin_unlock_bh (&net->sctp.addr_wq_lock); +local_bh_enable ();sock_put (sk);
@@ -5115,9 +5113,6 @@ static int sctp_init_sock(struct sock *ssk_sockets_allocated_inc (sk);sock_prot_inuse_add (net, sk->sk_prot,1 ); -/* Nothing can fail after this block, otherwise -* sctp_destroy_sock() will be called without addr_wq_lock held -*/ if (net->sctp.default_auto_asconf) {spin_lock (&sock_net (sk)->sctp.addr_wq_lock); list_add_tail(&sp->auto_asconf_list,
@@ -5152,7 +5147,9 @@ static void sctp_destroy_sock(struct socif (sp->do_auto_asconf) { sp->do_auto_asconf =0 ; +spin_lock_bh (&sock_net (sk)->sctp.addr_wq_lock);list_del (&sp->auto_asconf_list); +spin_unlock_bh (&sock_net (sk)->sctp.addr_wq_lock); }sctp_endpoint_free (sp->ep);local_bh_disable ();
Greg Kroah-Hartman
maintainerPATCH 10/73 Input: nspire-keypad - enable interrupts only when opened
In reply to Greg Kroah-HartmanFrom: Fabian Vogt <[email protected]>
[ Upstream commit 69d5ff3e9e51e23d5d81bf48480aa5671be67a71 ]
The driver registers an interrupt handler in _probe, but didn't configure them until later when the _open function is called. In between, the keypad can fire an IRQ due to touchpad activity, which the handler ignores. This causes the kernel to disable the interrupt, blocking the keypad from working.
Fix this by disabling interrupts before registering the handler. Additionally, disable them in _close, so that they're only enabled while open.
--- drivers/input/keyboard/nspire-keypad.c | 56 ++++++++++++++------------ 1 file changed, 31 insertions(+), 25 deletions(-)
drivers/input/keyboard/nspire-keypad.c +31 -25
@@ -93,9 +93,15 @@ static irqreturn_t nspire_keypad_irq(int irq, void *dev_id)return IRQ_HANDLED ; } -static int nspire_keypad_chip_init (struct nspire_keypad *keypad) +static int nspire_keypad_open (struct input_dev *input) { +struct nspire_keypad *keypad =input_get_drvdata (input);unsigned long val =0 , cycles_per_us, delay_cycles, row_delay_cycles; +int error; + + error =clk_prepare_enable (keypad->clk); +if (error) +return error; cycles_per_us = (clk_get_rate (keypad->clk) /1000000 );if (cycles_per_us ==0 )
@@ -121,30 +127,6 @@ static int nspire_keypad_chip_init(struct nspire_keypad *keypad) keypad->int_mask =1 <<1 ;writel (keypad->int_mask, keypad->reg_base +KEYPAD_INTMSK ); -/* Disable GPIO interrupts to prevent hanging on touchpad */ -/* Possibly used to detect touchpad events */ -writel (0 , keypad->reg_base +KEYPAD_UNKNOWN_INT ); -/* Acknowledge existing interrupts */ -writel (~0 , keypad->reg_base +KEYPAD_UNKNOWN_INT_STS ); - -return 0 ; -} - -static int nspire_keypad_open (struct input_dev *input) -{ -struct nspire_keypad *keypad =input_get_drvdata (input); -int error; - - error =clk_prepare_enable (keypad->clk); -if (error) -return error; - - error =nspire_keypad_chip_init (keypad); -if (error) { -clk_disable_unprepare (keypad->clk); -return error; - } -return 0 ; }
@@ -152,6 +134,11 @@ static void nspire_keypad_close(struct input_dev *input) {struct nspire_keypad *keypad =input_get_drvdata (input); +/* Disable interrupts */ +writel (0 , keypad->reg_base +KEYPAD_INTMSK ); +/* Acknowledge existing interrupts */ +writel (~0 , keypad->reg_base +KEYPAD_INT ); +clk_disable_unprepare (keypad->clk); }
@@ -210,6 +197,25 @@ static int nspire_keypad_probe(struct platform_device *pdev)return -ENOMEM ; } + error =clk_prepare_enable (keypad->clk); +if (error) { +dev_err (&pdev->dev,"failed to enable clock\n" ); +return error; + } + +/* Disable interrupts */ +writel (0 , keypad->reg_base +KEYPAD_INTMSK ); +/* Acknowledge existing interrupts */ +writel (~0 , keypad->reg_base +KEYPAD_INT ); + +/* Disable GPIO interrupts to prevent hanging on touchpad */ +/* Possibly used to detect touchpad events */ +writel (0 , keypad->reg_base +KEYPAD_UNKNOWN_INT ); +/* Acknowledge existing GPIO interrupts */ +writel (~0 , keypad->reg_base +KEYPAD_UNKNOWN_INT_STS ); + +clk_disable_unprepare (keypad->clk); +input_set_drvdata (input, keypad); input->id.bustype =BUS_HOST ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 11/73 gpio: sysfs: Obey valid_mask
In reply to Greg Kroah-HartmanFrom: Matti Vaittinen <[email protected]>
[ Upstream commit 23cf00ddd2e1aacf1873e43f5e0c519c120daf7a ]
Do not allow exporting GPIOs which are set invalid by the driver's valid mask.
--- drivers/gpio/gpiolib-sysfs.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpio/gpiolib-sysfs.c +8 -0
@@ -457,6 +457,8 @@ static ssize_t export_store(struct class *class,long gpio;struct gpio_desc *desc;int status; +struct gpio_chip *gc; +int offset; status =kstrtol (buf,0 , &gpio);if (status <0 )
@@ -468,6 +470,12 @@ static ssize_t export_store(struct class *class,pr_warn ("%s: invalid GPIO %ld\n" , __func__, gpio);return -EINVAL ; } + gc = desc->gdev->chip; + offset =gpio_chip_hwgpio (desc); +if (!gpiochip_line_is_valid (gc, offset)) { +pr_warn ("%s: GPIO %ld masked\n" , __func__, gpio); +return -EINVAL ; + }/* No extra locking here; FLAG_SYSFS just signifies that the * request and export were done by on behalf of userspace, so
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 12/73 dmaengine: dw: Make it dependent to HAS_IOMEM
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 88cd1d6191b13689094310c2405394e4ce36d061 ]
Some architectures do not provide devm_*() APIs. Hence make the driver dependent on HAVE_IOMEM.
--- drivers/dma/dw/Kconfig | 2 ++ 1 file changed, 2 insertions(+)
drivers/dma/dw/Kconfig +2 -0
@@ -10,6 +10,7 @@ config DW_DMAC_CORE config DW_DMAC tristate "Synopsys DesignWare AHB DMA platform driver" + depends on HAS_IOMEM select DW_DMAC_CORE help Support the Synopsys DesignWare AHB DMA controller. This
@@ -18,6 +19,7 @@ config DW_DMAC config DW_DMAC_PCI tristate "Synopsys DesignWare AHB DMA PCI driver" depends on PCI + depends on HAS_IOMEM select DW_DMAC_CORE help Support the Synopsys DesignWare AHB DMA controller on the
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 13/73 ARM: dts: Drop duplicate sha2md5_fck to fix clk_disable race
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 140a776833957539c84301dbdb4c3013876de118 ]
We have a duplicate legacy clock defined for sha2md5_fck that can sometimes race with clk_disable() with the dts configured clock for OMAP4_SHA2MD5_CLKCTRL when unused clocks are disabled during boot causing an "Unhandled fault: imprecise external abort".
--- arch/arm/boot/dts/omap44xx-clocks.dtsi | 8 -------- 1 file changed, 8 deletions(-)
arch/arm/boot/dts/omap44xx-clocks.dtsi +0 -8
@@ -770,14 +770,6 @@ ti,max-div = <2>; }; - sha2md5_fck: sha2md5_fck@15c8 { - #clock-cells = <0>; - compatible = "ti,gate-clock"; - clocks = <&l3_div_ck>; - ti,bit-shift = <1>; - reg = <0x15c8>; - }; - usb_phy_cm_clk32k: usb_phy_cm_clk32k@640 { #clock-cells = <0>; compatible = "ti,gate-clock";
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 14/73 ARM: dts: Fix moving mmc devices with aliases for omap4 & 5
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
[ Upstream commit 77335a040178a0456d4eabc8bf17a7ca3ee4a327 ]
Fix moving mmc devices with dts aliases as discussed on the lists. Without this we now have internal eMMC mmc1 show up as mmc2 compared to the earlier order of devices.
--- arch/arm/boot/dts/omap4.dtsi | 5 +++++ arch/arm/boot/dts/omap5.dtsi | 5 +++++ 2 files changed, 10 insertions(+)
arch/arm/boot/dts/omap4.dtsi +5 -0
@@ -22,6 +22,11 @@ i2c1 = &i2c2; i2c2 = &i2c3; i2c3 = &i2c4; + mmc0 = &mmc1; + mmc1 = &mmc2; + mmc2 = &mmc3; + mmc3 = &mmc4; + mmc4 = &mmc5; serial0 = &uart1; serial1 = &uart2; serial2 = &uart3;
arch/arm/boot/dts/omap5.dtsi +5 -0
@@ -25,6 +25,11 @@ i2c2 = &i2c3; i2c3 = &i2c4; i2c4 = &i2c5; + mmc0 = &mmc1; + mmc1 = &mmc2; + mmc2 = &mmc3; + mmc3 = &mmc4; + mmc4 = &mmc5; serial0 = &uart1; serial1 = &uart2; serial2 = &uart3;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 15/73 lockdep: Add a missing initialization hint to the "INFO: Trying to register non-static key" message
In reply to Greg Kroah-HartmanFrom: Tetsuo Handa <[email protected]>
[ Upstream commit 3a85969e9d912d5dd85362ee37b5f81266e00e77 ]
Since this message is printed when dynamically allocated spinlocks (e.g. kzalloc()) are used without initialization (e.g. spin_lock_init()), suggest to developers to check whether initialization functions for objects were called, before making developers wonder what annotation is missing.
[ mingo: Minor tweaks to the message. ]
--- kernel/locking/lockdep.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
kernel/locking/lockdep.c +2 -1
@@ -875,7 +875,8 @@ static bool assign_lock_key(struct lockdep_map *lock)/* Debug-check: all keys must be persistent! */ debug_locks_off ();pr_err ("INFO: trying to register non-static key.\n" ); -pr_err ("the code is fine but needs lockdep annotation.\n" ); +pr_err ("The code is fine but needs lockdep annotation, or maybe\n" ); +pr_err ("you didn't initialize this object before use?\n" );pr_err ("turning off the locking correctness validator.\n" );dump_stack ();return false;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 16/73 arc: kernel: Return -EFAULT if copy_to_user() fails
In reply to Greg Kroah-HartmanFrom: Wang Qing <[email protected]>
[ Upstream commit 46e152186cd89d940b26726fff11eb3f4935b45a ]
The copy_to_user() function returns the number of bytes remaining to be copied, but we want to return -EFAULT if the copy doesn't complete.
--- arch/arc/kernel/signal.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arc/kernel/signal.c +2 -2
@@ -96,7 +96,7 @@ stash_usr_regs(struct rt_sigframe __user *sf, struct pt_regs *regs, sizeof(sf->uc.uc_mcontext.regs.scratch)); err |=__copy_to_user (&sf->uc.uc_sigmask, set,sizeof (sigset_t)); -return err; +return err ? -EFAULT :0 ; }static int restore_usr_regs (struct pt_regs *regs,struct rt_sigframe __user *sf)
@@ -110,7 +110,7 @@ static int restore_usr_regs(struct pt_regs *regs, struct rt_sigframe __user *sf) &(sf->uc.uc_mcontext.regs.scratch), sizeof(sf->uc.uc_mcontext.regs.scratch));if (err) -return err; +return -EFAULT ;set_current_blocked (&set); regs->bta = uregs.scratch.bta;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 17/73 ASoC: max98373: Added 30ms turn on/off time delay
In reply to Greg Kroah-HartmanFrom: Ryan Lee <[email protected]>
[ Upstream commit 3a27875e91fb9c29de436199d20b33f9413aea77 ]
Amp requires 10 ~ 30ms for the power ON and OFF.
Added 30ms delay for stability.
--- sound/soc/codecs/max98373.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/codecs/max98373.c +2 -0
@@ -410,11 +410,13 @@ static int max98373_dac_event(struct snd_soc_dapm_widget *w,regmap_update_bits (max98373->regmap,MAX98373_R20FF_GLOBAL_SHDN ,MAX98373_GLOBAL_EN_MASK ,1 ); +usleep_range (30000 ,31000 );break ;case SND_SOC_DAPM_POST_PMD :regmap_update_bits (max98373->regmap,MAX98373_R20FF_GLOBAL_SHDN ,MAX98373_GLOBAL_EN_MASK ,0 ); +usleep_range (30000 ,31000 ); max98373->tdm_mode = false;break ;default :
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 18/73 neighbour: Disregard DEAD dst in neigh_update
In reply to Greg Kroah-HartmanFrom: Tong Zhu <[email protected]>
[ Upstream commit d47ec7a0a7271dda08932d6208e4ab65ab0c987c ]
After a short network outage, the dst_entry is timed out and put in DST_OBSOLETE_DEAD. We are in this code because arp reply comes from this neighbour after network recovers. There is a potential race condition that dst_entry is still in DST_OBSOLETE_DEAD. With that, another neighbour lookup causes more harm than good.
In best case all packets in arp_queue are lost. This is counterproductive to the original goal of finding a better path for those packets.
I observed a worst case with 4.x kernel where a dst_entry in DST_OBSOLETE_DEAD state is associated with loopback net_device. It leads to an ethernet header with all zero addresses. A packet with all zero source MAC address is quite deadly with mac80211, ath9k and 802.11 block ack. It fails ieee80211_find_sta_by_ifaddr in ath9k (xmit.c). Ath9k flushes tx queue (ath_tx_complete_aggr). BAW (block ack window) is not updated. BAW logic is damaged and ath9k transmission is disabled.
--- net/core/neighbour.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
net/core/neighbour.c +1 -1
@@ -1379,7 +1379,7 @@ static int __neigh_update(struct neighbour *neigh, const u8 *lladdr,* we can reinject the packet there. */ n2 =NULL ; -if (dst) { +if (dst && dst->obsolete !=DST_OBSOLETE_DEAD ) { n2 =dst_neigh_lookup_skb (dst, skb);if (n2) n1 = n2;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 19/73 ARM: keystone: fix integer overflow warning
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 844b85dda2f569943e1e018fdd63b6f7d1d6f08e ]
clang warns about an impossible condition when building with 32-bit phys_addr_t:
arch/arm/mach-keystone/keystone.c:79:16: error: result of comparison of constant 51539607551 with expression of type 'phys_addr_t' (aka 'unsigned int') is always false [-Werror,-Wtautological-constant-out-of-range-compare]
mem_end > KEYSTONE_HIGH_PHYS_END) {
~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~
arch/arm/mach-keystone/keystone.c:78:16: error: result of comparison of constant 34359738368 with expression of type 'phys_addr_t' (aka 'unsigned int') is always true [-Werror,-Wtautological-constant-out-of-range-compare]
if (mem_start < KEYSTONE_HIGH_PHYS_START ||
~~~~~~~~~ ^ ~~~~~~~~~~~~~~~~~~~~~~~~Change the temporary variable to a fixed-size u64 to avoid the warning.
--- arch/arm/mach-keystone/keystone.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-keystone/keystone.c +2 -2
@@ -62,7 +62,7 @@ static void __init keystone_init(void)static long long __init keystone_pv_fixup (void ) {long long offset; -phys_addr_t mem_start, mem_end; +u64 mem_start, mem_end; mem_start =memblock_start_of_DRAM (); mem_end =memblock_end_of_DRAM ();
@@ -75,7 +75,7 @@ static long long __init keystone_pv_fixup(void)if (mem_start <KEYSTONE_HIGH_PHYS_START || mem_end >KEYSTONE_HIGH_PHYS_END ) {pr_crit ("Invalid address space for memory (%08llx-%08llx)\n" , - (u64 )mem_start, (u64 )mem_end); + mem_start, mem_end);return 0 ; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 20/73 ARM: omap1: fix building with clang IAS
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 28399a5a6d569c9bdb612345e4933046ca37cde5 ]
The clang integrated assembler fails to build one file with a complex asm instruction:
arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: error: invalid instruction, any one of the following would fix this:
mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
^arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: note: instruction requires: armv6t2
mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
^arch/arm/mach-omap1/ams-delta-fiq-handler.S:249:2: note: instruction requires: thumb2
mov r10, #(1 << (((NR_IRQS_LEGACY + 12) - NR_IRQS_LEGACY) % 32)) @ set deferred_fiq bit
^
The problem is that 'NR_IRQS_LEGACY' is not defined here. Apparently gas does not care because we first add and then subtract this number, leading to the immediate value to be the same regardless of the specific definition of NR_IRQS_LEGACY.
Neither the way that 'gas' just silently builds this file, nor the way that clang IAS makes nonsensical suggestions for how to fix it is great. Fortunately there is an easy fix, which is to #include the header that contains the definition.
--- arch/arm/mach-omap1/ams-delta-fiq-handler.S | 1 + 1 file changed, 1 insertion(+)
arch/arm/mach-omap1/ams-delta-fiq-handler.S +1 -0
@@ -15,6 +15,7 @@ #include <linux/platform_data/gpio-omap.h> #include <asm/assembler.h> +#include <asm/irq.h> #include "ams-delta-fiq.h" #include "board-ams-delta.h"
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 21/73 drm/msm: Fix a5xx/a6xx timestamps
In reply to Greg Kroah-HartmanFrom: Rob Clark <[email protected]>
[ Upstream commit 9fbd3088351b92e8c2cef6e37a39decb12a8d5bb ]
They were reading a counter that was configured to ALWAYS_COUNT (ie. cycles that the GPU is doing something) rather than ALWAYS_ON. This isn't the thing that userspace is looking for.
Message-Id: <[email protected]>
--- drivers/gpu/drm/msm/adreno/a5xx_gpu.c | 4 ++-- drivers/gpu/drm/msm/adreno/a6xx_gpu.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/gpu/drm/msm/adreno/a5xx_gpu.c +2 -2
@@ -1131,8 +1131,8 @@ static int a5xx_pm_suspend(struct msm_gpu *gpu)static int a5xx_get_timestamp (struct msm_gpu *gpu,uint64_t *value) { - *value =gpu_read64 (gpu,REG_A5XX_RBBM_PERFCTR_CP_0_LO , -REG_A5XX_RBBM_PERFCTR_CP_0_HI ); + *value =gpu_read64 (gpu,REG_A5XX_RBBM_ALWAYSON_COUNTER_LO , +REG_A5XX_RBBM_ALWAYSON_COUNTER_HI );return 0 ; }
drivers/gpu/drm/msm/adreno/a6xx_gpu.c +2 -2
@@ -773,8 +773,8 @@ static int a6xx_get_timestamp(struct msm_gpu *gpu, uint64_t *value)/* Force the GPU power on so we can read this register */ a6xx_gmu_set_oob (&a6xx_gpu->gmu,GMU_OOB_GPU_SET ); - *value =gpu_read64 (gpu,REG_A6XX_RBBM_PERFCTR_CP_0_LO , -REG_A6XX_RBBM_PERFCTR_CP_0_HI ); + *value =gpu_read64 (gpu,REG_A6XX_CP_ALWAYS_ON_COUNTER_LO , +REG_A6XX_CP_ALWAYS_ON_COUNTER_HI );a6xx_gmu_clear_oob (&a6xx_gpu->gmu,GMU_OOB_GPU_SET );return 0 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 22/73 ASoC: fsl_esai: Fix TDM slot setup for I2S mode
In reply to Greg Kroah-HartmanFrom: Alexander Shiyan <[email protected]>
[ Upstream commit e7a48c710defa0e0fef54d42b7d9e4ab596e2761 ]
When using the driver in I2S TDM mode, the fsl_esai_startup() function rewrites the number of slots previously set by the fsl_esai_set_dai_tdm_slot() function to 2.
To fix this, let's use the saved slot count value or, if TDM is not used and the number of slots is not set, the driver will use the default value (2), which is set by fsl_esai_probe().
--- sound/soc/fsl/fsl_esai.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
sound/soc/fsl/fsl_esai.c +5 -3
@@ -494,11 +494,13 @@ static int fsl_esai_startup(struct snd_pcm_substream *substream,ESAI_SAICR_SYNC , esai_priv->synchronous ? ESAI_SAICR_SYNC : 0); -/* Set a default slot number -- 2 */ +/* Set slots count */ regmap_update_bits (esai_priv->regmap,REG_ESAI_TCCR , - ESAI_xCCR_xDC_MASK,ESAI_xCCR_xDC (2 )); + ESAI_xCCR_xDC_MASK, +ESAI_xCCR_xDC (esai_priv->slots));regmap_update_bits (esai_priv->regmap,REG_ESAI_RCCR , - ESAI_xCCR_xDC_MASK,ESAI_xCCR_xDC (2 )); + ESAI_xCCR_xDC_MASK, +ESAI_xCCR_xDC (esai_priv->slots)); }return 0 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 23/73 scsi: scsi_transport_srp: Dont block target in SRP_PORT_LOST state
In reply to Greg Kroah-HartmanFrom: Martin Wilck <[email protected]>
[ Upstream commit 5cd0f6f57639c5afbb36100c69281fee82c95ee7 ]
rport_dev_loss_timedout() sets the rport state to SRP_PORT_LOST and the SCSI target state to SDEV_TRANSPORT_OFFLINE. If this races with srp_reconnect_work(), a warning is printed:
Mar 27 18:48:07 ictm1604s01h4 kernel: dev_loss_tmo expired for SRP port-18:1 / host18. Mar 27 18:48:07 ictm1604s01h4 kernel: ------------[ cut here ]------------ Mar 27 18:48:07 ictm1604s01h4 kernel: scsi_internal_device_block(18:0:0:100) failed: ret = -22 Mar 27 18:48:07 ictm1604s01h4 kernel: Call Trace: Mar 27 18:48:07 ictm1604s01h4 kernel: ? scsi_target_unblock+0x50/0x50 [scsi_mod] Mar 27 18:48:07 ictm1604s01h4 kernel: starget_for_each_device+0x80/0xb0 [scsi_mod] Mar 27 18:48:07 ictm1604s01h4 kernel: target_block+0x24/0x30 [scsi_mod] Mar 27 18:48:07 ictm1604s01h4 kernel: device_for_each_child+0x57/0x90 Mar 27 18:48:07 ictm1604s01h4 kernel: srp_reconnect_rport+0xe4/0x230 [scsi_transport_srp] Mar 27 18:48:07 ictm1604s01h4 kernel: srp_reconnect_work+0x40/0xc0 [scsi_transport_srp]
Avoid this by not trying to block targets for rports in SRP_PORT_LOST state.
--- drivers/scsi/scsi_transport_srp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/scsi_transport_srp.c +1 -1
@@ -541,7 +541,7 @@ int srp_reconnect_rport(struct srp_rport *rport) res =mutex_lock_interruptible (&rport->mutex);if (res) goto out; -if (rport->state !=SRP_RPORT_FAIL_FAST ) +if (rport->state !=SRP_RPORT_FAIL_FAST && rport->state !=SRP_RPORT_LOST )/* * sdev state must be SDEV_TRANSPORT_OFFLINE, transition * to SDEV_BLOCK is illegal. Calling scsi_target_unblock()
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 24/73 net: ieee802154: stop dump llsec keys for monitors
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit fb3c5cdf88cd504ef11d59e8d656f4bc896c6922 ]
This patch stops dumping llsec keys for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ieee802154/nl802154.c +5 -0
@@ -1514,6 +1514,11 @@ nl802154_dump_llsec_key(struct sk_buff *skb, struct netlink_callback *cb)if (err)return err; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) { + err = skb->len; + goto out_err; + } +if (!wpan_dev->netdev) { err = -EINVAL ; goto out_err;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 25/73 net: ieee802154: forbid monitor for add llsec key
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit 08470c5453339369bd3d590c4cbb0b5961cdcbb6 ]
This patch forbids to add llsec key for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1573,6 +1573,9 @@ static int nl802154_add_llsec_key(struct sk_buff *skb, struct genl_info *info)struct ieee802154_llsec_key_id id = { };u32 commands[NL802154_CMD_FRAME_NR_IDS /32 ] = { }; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (!info->attrs[NL802154_ATTR_SEC_KEY ] ||nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack))return -EINVAL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 26/73 net: ieee802154: forbid monitor for del llsec key
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit b6e2949544a183f590ae6f3ef2d1aaaa2c44e38a ]
This patch forbids to del llsec key for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1625,6 +1625,9 @@ static int nl802154_del_llsec_key(struct sk_buff *skb, struct genl_info *info)struct nlattr *attrs[NL802154_KEY_ATTR_MAX +1 ];struct ieee802154_llsec_key_id id; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (!info->attrs[NL802154_ATTR_SEC_KEY ] ||nla_parse_nested_deprecated (attrs,NL802154_KEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_KEY ], nl802154_key_policy, info->extack))return -EINVAL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 27/73 net: ieee802154: stop dump llsec devs for monitors
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit 5582d641e6740839c9b83efd1fbf9bcd00b6f5fc ]
This patch stops dumping llsec devs for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ieee802154/nl802154.c +5 -0
@@ -1693,6 +1693,11 @@ nl802154_dump_llsec_dev(struct sk_buff *skb, struct netlink_callback *cb)if (err)return err; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) { + err = skb->len; + goto out_err; + } +if (!wpan_dev->netdev) { err = -EINVAL ; goto out_err;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 28/73 net: ieee802154: forbid monitor for add llsec dev
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit 5303f956b05a2886ff42890908156afaec0f95ac ]
This patch forbids to add llsec dev for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1784,6 +1784,9 @@ static int nl802154_add_llsec_dev(struct sk_buff *skb, struct genl_info *info)struct wpan_dev *wpan_dev = dev->ieee802154_ptr;struct ieee802154_llsec_device dev_desc; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (ieee802154_llsec_parse_device (info->attrs[NL802154_ATTR_SEC_DEVICE ], &dev_desc) <0 )return -EINVAL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 29/73 net: ieee802154: forbid monitor for del llsec dev
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit ad8f9de1f3566686af35b1c6b43240726541da61 ]
This patch forbids to del llsec dev for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1802,6 +1802,9 @@ static int nl802154_del_llsec_dev(struct sk_buff *skb, struct genl_info *info)struct nlattr *attrs[NL802154_DEV_ATTR_MAX +1 ];__le64 extended_addr; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (!info->attrs[NL802154_ATTR_SEC_DEVICE ] ||nla_parse_nested_deprecated (attrs,NL802154_DEV_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVICE ], nl802154_dev_policy, info->extack))return -EINVAL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 30/73 net: ieee802154: stop dump llsec devkeys for monitors
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit 080d1a57a94d93e70f84b7a360baa351388c574f ]
This patch stops dumping llsec devkeys for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ieee802154/nl802154.c +5 -0
@@ -1874,6 +1874,11 @@ nl802154_dump_llsec_devkey(struct sk_buff *skb, struct netlink_callback *cb)if (err)return err; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) { + err = skb->len; + goto out_err; + } +if (!wpan_dev->netdev) { err = -EINVAL ; goto out_err;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 31/73 net: ieee802154: forbid monitor for add llsec devkey
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit a347b3b394868fef15b16f143719df56184be81d ]
This patch forbids to add llsec devkey for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1936,6 +1936,9 @@ static int nl802154_add_llsec_devkey(struct sk_buff *skb, struct genl_info *infostruct ieee802154_llsec_device_key key;__le64 extended_addr; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (!info->attrs[NL802154_ATTR_SEC_DEVKEY ] ||nla_parse_nested_deprecated (attrs,NL802154_DEVKEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVKEY ], nl802154_devkey_policy, info->extack) <0 )return -EINVAL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 32/73 net: ieee802154: forbid monitor for del llsec devkey
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit 6fb8045319ef172dc88a8142e7f8b58c7608137e ]
This patch forbids to del llsec devkey for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -1970,6 +1970,9 @@ static int nl802154_del_llsec_devkey(struct sk_buff *skb, struct genl_info *infostruct ieee802154_llsec_device_key key;__le64 extended_addr; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (!info->attrs[NL802154_ATTR_SEC_DEVKEY ] ||nla_parse_nested_deprecated (attrs,NL802154_DEVKEY_ATTR_MAX , info->attrs[NL802154_ATTR_SEC_DEVKEY ], nl802154_devkey_policy, info->extack))return -EINVAL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 33/73 net: ieee802154: stop dump llsec seclevels for monitors
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit 4c9b4f55ad1f5a4b6206ac4ea58f273126d21925 ]
This patch stops dumping llsec seclevels for monitors which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 5 +++++ 1 file changed, 5 insertions(+)
net/ieee802154/nl802154.c +5 -0
@@ -2047,6 +2047,11 @@ nl802154_dump_llsec_seclevel(struct sk_buff *skb, struct netlink_callback *cb)if (err)return err; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) { + err = skb->len; + goto out_err; + } +if (!wpan_dev->netdev) { err = -EINVAL ; goto out_err;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 34/73 net: ieee802154: forbid monitor for add llsec seclevel
In reply to Greg Kroah-HartmanFrom: Alexander Aring <[email protected]>
[ Upstream commit 9ec87e322428d4734ac647d1a8e507434086993d ]
This patch forbids to add llsec seclevel for monitor interfaces which we don't support yet. Otherwise we will access llsec mib which isn't initialized for monitors.
--- net/ieee802154/nl802154.c | 3 +++ 1 file changed, 3 insertions(+)
net/ieee802154/nl802154.c +3 -0
@@ -2136,6 +2136,9 @@ static int nl802154_add_llsec_seclevel(struct sk_buff *skb,struct wpan_dev *wpan_dev = dev->ieee802154_ptr;struct ieee802154_llsec_seclevel sl; +if (wpan_dev->iftype ==NL802154_IFTYPE_MONITOR ) +return -EOPNOTSUPP ; +if (llsec_parse_seclevel (info->attrs[NL802154_ATTR_SEC_LEVEL ], &sl) <0 )return -EINVAL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 35/73 pcnet32: Use pci_resource_len to validate PCI resource
In reply to Greg Kroah-HartmanFrom: Guenter Roeck <[email protected]>
[ Upstream commit 66c3f05ddc538ee796321210c906b6ae6fc0792a ]
pci_resource_start() is not a good indicator to determine if a PCI resource exists or not, since the resource may start at address 0. This is seen when trying to instantiate the driver in qemu for riscv32 or riscv64.
pci 0000:00:01.0: reg 0x10: [io 0x0000-0x001f] pci 0000:00:01.0: reg 0x14: [mem 0x00000000-0x0000001f]
...
pcnet32: card has no PCI IO resources, aborting
Use pci_resouce_len() instead.
--- drivers/net/ethernet/amd/pcnet32.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/amd/pcnet32.c +3 -2
@@ -1548,8 +1548,7 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent) }pci_set_master (pdev); - ioaddr =pci_resource_start (pdev,0 ); -if (!ioaddr) { +if (!pci_resource_len (pdev,0 )) {if (pcnet32_debug &NETIF_MSG_PROBE )pr_err ("card has no PCI IO resources, aborting\n" ); err = -ENODEV ;
@@ -1562,6 +1561,8 @@ pcnet32_probe_pci(struct pci_dev *pdev, const struct pci_device_id *ent)pr_err ("architecture does not support 32bit PCI busmaster DMA\n" ); goto err_disable_dev; } + + ioaddr =pci_resource_start (pdev,0 );if (!request_region (ioaddr,PCNET32_TOTAL_SIZE ,"pcnet32_probe_pci" )) {if (pcnet32_debug &NETIF_MSG_PROBE )pr_err ("io address range already allocated\n" );
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 36/73 net/rds: Avoid potential use after free in rds_send_remove_from_sock
In reply to Greg Kroah-HartmanFrom: Aditya Pakki <[email protected]>
[ Upstream commit 0c85a7e87465f2d4cbc768e245f4f45b2f299b05 ]
In case of rs failure in rds_send_remove_from_sock(), the 'rm' resource is freed and later under spinlock, causing potential use-after-free. Set the free pointer to NULL to avoid undefined behavior.
--- net/rds/message.c | 1 + net/rds/send.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-)
net/rds/message.c +1 -0
@@ -180,6 +180,7 @@ void rds_message_put(struct rds_message *rm)rds_message_purge (rm);kfree (rm); + rm =NULL ; } }EXPORT_SYMBOL_GPL (rds_message_put);
net/rds/send.c +1 -1
@@ -665,7 +665,7 @@ static void rds_send_remove_from_sock(struct list_head *messages, int status) unlock_and_drop:spin_unlock_irqrestore (&rm->m_rs_lock, flags);rds_message_put (rm); -if (was_on_sock) +if (was_on_sock && rm)rds_message_put (rm); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 37/73 net: tipc: Fix spelling errors in net/tipc module
In reply to Greg Kroah-HartmanFrom: Zheng Yongjun <[email protected]>
[ Upstream commit a79ace4b312953c5835fafb12adc3cb6878b26bd ]
These patches fix a series of spelling errors in net/tipc module.
--- net/tipc/bearer.h | 6 +++--- net/tipc/net.c | 2 +- net/tipc/node.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
net/tipc/bearer.h +3 -3
@@ -149,9 +149,9 @@ struct tipc_media {* care of initializing all other fields. */ struct tipc_bearer { -void __rcu *media_ptr;/* initalized by media */ -u32 mtu;/* initalized by media */ -struct tipc_media_addr addr;/* initalized by media */ +void __rcu *media_ptr;/* initialized by media */ +u32 mtu;/* initialized by media */ +struct tipc_media_addr addr;/* initialized by media */ char name[TIPC_MAX_BEARER_NAME ];struct tipc_media *media;struct tipc_media_addr bcast_addr;
net/tipc/net.c +1 -1
@@ -89,7 +89,7 @@* - A spin lock to protect the registry of kernel/driver users (reg.c) * - A global spin_lock (tipc_port_lock), which only task is to ensure * consistency where more than one port is involved in an operation, -* i.e., whe a port is part of a linked list of ports. +* i.e., when a port is part of a linked list of ports. * There are two such lists; 'port_list', which is used for management, * and 'wait_list', which is used to queue ports during congestion. *
net/tipc/node.c +1 -1
@@ -1482,7 +1482,7 @@ int tipc_node_xmit(struct net *net, struct sk_buff_head *list, }/* tipc_node_xmit_skb(): send single buffer to destination -* Buffers sent via this functon are generally TIPC_SYSTEM_IMPORTANCE +* Buffers sent via this function are generally TIPC_SYSTEM_IMPORTANCE * messages, which will not be rejected * The only exception is datagram messages rerouted after secondary * lookup, which are rare and safe to dispose of anyway.
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 38/73 mac80211: clear sta->fast_rx when STA removed from 4-addr VLAN
In reply to Greg Kroah-HartmanFrom: Seevalamuthu Mariappan <[email protected]>
[ Upstream commit dd0b45538146cb6a54d6da7663b8c3afd16ebcfd ]
In some race conditions, with more clients and traffic configuration, below crash is seen when making the interface down. sta->fast_rx wasn't cleared when STA gets removed from 4-addr AP_VLAN interface. The crash is due to try accessing 4-addr AP_VLAN interface's net_device (fast_rx->dev) which has been deleted already.
Resolve this by clearing sta->fast_rx pointer when STA removes from a 4-addr VLAN.
[ 239.449529] Unable to handle kernel NULL pointer dereference at virtual address 00000004
[ 239.449531] pgd = 80204000
...
[ 239.481496] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 4.4.60 #227
[ 239.481591] Hardware name: Generic DT based system
[ 239.487665] task: be05b700 ti: be08e000 task.ti: be08e000
[ 239.492360] PC is at get_rps_cpu+0x2d4/0x31c
[ 239.497823] LR is at 0xbe08fc54
...
[ 239.778574] [<80739740>] (get_rps_cpu) from [<8073cb10>] (netif_receive_skb_internal+0x8c/0xac)
[ 239.786722] [<8073cb10>] (netif_receive_skb_internal) from [<8073d578>] (napi_gro_receive+0x48/0xc4)
[ 239.795267] [<8073d578>] (napi_gro_receive) from [<c7b83e8c>] (ieee80211_mark_rx_ba_filtered_frames+0xbcc/0x12d4 [mac80211])
[ 239.804776] [<c7b83e8c>] (ieee80211_mark_rx_ba_filtered_frames [mac80211]) from [<c7b84d4c>] (ieee80211_rx_napi+0x7b8/0x8c8 [mac8
0211])
[ 239.815857] [<c7b84d4c>] (ieee80211_rx_napi [mac80211]) from [<c7f63d7c>] (ath11k_dp_process_rx+0x7bc/0x8c8 [ath11k])
[ 239.827757] [<c7f63d7c>] (ath11k_dp_process_rx [ath11k]) from [<c7f5b6c4>] (ath11k_dp_service_srng+0x2c0/0x2e0 [ath11k])
[ 239.838484] [<c7f5b6c4>] (ath11k_dp_service_srng [ath11k]) from [<7f55b7dc>] (ath11k_ahb_ext_grp_napi_poll+0x20/0x84 [ath11k_ahb]
)
[ 239.849419] [<7f55b7dc>] (ath11k_ahb_ext_grp_napi_poll [ath11k_ahb]) from [<8073ce1c>] (net_rx_action+0xe0/0x28c)
[ 239.860945] [<8073ce1c>] (net_rx_action) from [<80324868>] (__do_softirq+0xe4/0x228)
[ 239.871269] [<80324868>] (__do_softirq) from [<80324c48>] (irq_exit+0x98/0x108)
[ 239.879080] [<80324c48>] (irq_exit) from [<8035c59c>] (__handle_domain_irq+0x90/0xb4)
[ 239.886114] [<8035c59c>] (__handle_domain_irq) from [<8030137c>] (gic_handle_irq+0x50/0x94)
[ 239.894100] [<8030137c>] (gic_handle_irq) from [<803024c0>] (__irq_svc+0x40/0x74)--- net/mac80211/cfg.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/mac80211/cfg.c +3 -1
@@ -1670,8 +1670,10 @@ static int ieee80211_change_station(struct wiphy *wiphy, }if (sta->sdata->vif.type ==NL80211_IFTYPE_AP_VLAN && - sta->sdata->u.vlan.sta) + sta->sdata->u.vlan.sta) { +ieee80211_clear_fast_rx (sta);RCU_INIT_POINTER (sta->sdata->u.vlan.sta,NULL ); + }if (test_sta_flag (sta,WLAN_STA_AUTHORIZED ))ieee80211_vif_dec_num_mcast (sta->sdata);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 39/73 virt_wifi: Return micros for BSS TSF values
In reply to Greg Kroah-HartmanFrom: A. Cody Schuffelen <[email protected]>
[ Upstream commit b57aa17f07c9270e576ef7df09f142978b5a75f0 ]
cfg80211_inform_bss expects to receive a TSF value, but is given the time since boot in nanoseconds. TSF values are expected to be at microsecond scale rather than nanosecond scale.
--- drivers/net/wireless/virt_wifi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/wireless/virt_wifi.c +3 -2
@@ -12,6 +12,7 @@#include <net/cfg80211.h> #include <net/rtnetlink.h> #include <linux/etherdevice.h> +#include <linux/math64.h> #include <linux/module.h> static struct wiphy *common_wiphy;
@@ -168,11 +169,11 @@ static void virt_wifi_scan_result(struct work_struct *work) scan_result.work);struct wiphy *wiphy =priv_to_wiphy (priv);struct cfg80211_scan_info scan_info = { .aborted = false }; +u64 tsf =div_u64 (ktime_get_boottime_ns (),1000 ); informed_bss =cfg80211_inform_bss (wiphy, &channel_5ghz,CFG80211_BSS_FTYPE_PRESP , - fake_router_bssid, -ktime_get_boottime_ns (), + fake_router_bssid, tsf,WLAN_CAPABILITY_ESS ,0 , (void *)&ssid,sizeof (ssid),DBM_TO_MBM (-50 ),GFP_KERNEL );
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 40/73 Input: s6sy761 - fix coordinate read bit shift
In reply to Greg Kroah-HartmanFrom: Caleb Connolly <[email protected]>
commit 30b3f68715595dee7fe4d9bd91a2252c3becdf0a upstream.
The touch coordinate register contains the following:
byte 3 byte 2 byte 1
+--------+--------+ +-----------------+ +-----------------+ | | | | | | | | X[3:0] | Y[3:0] | | Y[11:4] | | X[11:4] | | | | | | | | +--------+--------+ +-----------------+ +-----------------+
Bytes 2 and 1 need to be shifted left by 4 bits, the least significant nibble of each is stored in byte 3. Currently they are only being shifted by 3 causing the reported coordinates to be incorrect.
This matches downstream examples, and has been confirmed on my device (OnePlus 7 Pro).
--- drivers/input/touchscreen/s6sy761.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/input/touchscreen/s6sy761.c +2 -2
@@ -145,8 +145,8 @@ static void s6sy761_report_coordinates(su8 major = event[4 ];u8 minor = event[5 ];u8 z = event[6 ] &S6SY761_MASK_Z ; -u16 x = (event[1 ] <<3 ) | ((event[3 ] &S6SY761_MASK_X ) >>4 ); -u16 y = (event[2 ] <<3 ) | (event[3 ] &S6SY761_MASK_Y ); +u16 x = (event[1 ] <<4 ) | ((event[3 ] &S6SY761_MASK_X ) >>4 ); +u16 y = (event[2 ] <<4 ) | (event[3 ] &S6SY761_MASK_Y );input_mt_slot (sdata->input, tid);
Greg Kroah-Hartman
maintainerPATCH 41/73 Input: i8042 - fix Pegatron C15B ID entry
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit daa58c8eec0a65ac8e2e77ff3ea8a233d8eec954 upstream.
The Zenbook Flip entry that was added overwrites a previous one because of a typo:
In file included from drivers/input/serio/i8042.h:23,
from drivers/input/serio/i8042.c:131:
drivers/input/serio/i8042-x86ia64io.h:591:28: error: initialized field overwritten [-Werror=override-init]
591 | .matches = {
| ^drivers/input/serio/i8042-x86ia64io.h:591:28: note: (near initialization for 'i8042_dmi_noselftest_table[0].matches')
Add the missing separator between the two.
--- drivers/input/serio/i8042-x86ia64io.h | 1 + 1 file changed, 1 insertion(+)
drivers/input/serio/i8042-x86ia64io.h +1 -0
@@ -588,6 +588,7 @@ static const struct dmi_system_id i8042_DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ),DMI_MATCH (DMI_CHASSIS_TYPE ,"10" ),/* Notebook */ }, + }, { .matches = {DMI_MATCH (DMI_SYS_VENDOR ,"ASUSTeK COMPUTER INC." ), DMI_MATCH(DMI_CHASSIS_TYPE, "31"), /* Convertible Notebook */
Greg Kroah-Hartman
maintainerPATCH 42/73 HID: wacom: set EV_KEY and EV_ABS only for non-HID_GENERIC type of devices
In reply to Greg Kroah-HartmanFrom: Ping Cheng <[email protected]>
commit 276559d8d02c2709281578976ca2f53bc62063d4 upstream.
Valid HID_GENERIC type of devices set EV_KEY and EV_ABS by wacom_map_usage. When *_input_capabilities are reached, those devices should already have their proper EV_* set. EV_KEY and EV_ABS only need to be set for non-HID_GENERIC type of devices in *_input_capabilities.
Devices that don't support HID descitoprs will pass back to hid-input for registration without being accidentally rejected by the introduction of
patch: "Input: refuse to register absolute devices without absinfo"
--- drivers/hid/wacom_wac.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/hid/wacom_wac.c +2 -4
@@ -3574,8 +3574,6 @@ int wacom_setup_pen_input_capabilities(s {struct wacom_features *features = &wacom_wac->features; - input_dev->evbit[0 ] |=BIT_MASK (EV_KEY ) |BIT_MASK (EV_ABS ); -if (!(features->device_type &WACOM_DEVICETYPE_PEN ))return -ENODEV ;
@@ -3590,6 +3588,7 @@ int wacom_setup_pen_input_capabilities(sreturn 0 ; } + input_dev->evbit[0 ] |=BIT_MASK (EV_KEY ) |BIT_MASK (EV_ABS );__set_bit (BTN_TOUCH , input_dev->keybit);__set_bit (ABS_MISC , input_dev->absbit);
@@ -3742,8 +3741,6 @@ int wacom_setup_touch_input_capabilities {struct wacom_features *features = &wacom_wac->features; - input_dev->evbit[0 ] |=BIT_MASK (EV_KEY ) |BIT_MASK (EV_ABS ); -if (!(features->device_type &WACOM_DEVICETYPE_TOUCH ))return -ENODEV ;
@@ -3756,6 +3753,7 @@ int wacom_setup_touch_input_capabilities/* setup has already been done */ return 0 ; + input_dev->evbit[0 ] |=BIT_MASK (EV_KEY ) |BIT_MASK (EV_ABS );__set_bit (BTN_TOUCH , input_dev->keybit);if (features->touch_max ==1 ) {
Greg Kroah-Hartman
maintainerPATCH 43/73 dm verity fec: fix misaligned RS roots IO
In reply to Greg Kroah-HartmanFrom: Jaegeuk Kim <[email protected]>
commit 8ca7cab82bda4eb0b8064befeeeaa38106cac637 upstream.
commit df7b59ba9245 ("dm verity: fix FEC for RS roots unaligned to block size") introduced the possibility for misaligned roots IO relative to the underlying device's logical block size. E.g. Android's default RS roots=2 results in dm_bufio->block_size=1024, which causes the following EIO if the logical block size of the device is 4096, given v->data_dev_block_bits=12:
E sd 0 : 0:0:0: [sda] tag#30 request not aligned to the logical block size
E blk_update_request: I/O error, dev sda, sector 10368424 op 0x0:(READ) flags 0x0 phys_seg 1 prio class 0 E device-mapper: verity-fec: 254:8: FEC 9244672: parity read failed (block 18056): -5
Fix this by onlu using f->roots for dm_bufio blocksize IFF it is aligned to v->data_dev_block_bits.
--- drivers/md/dm-verity-fec.c | 11 ++++++++--- drivers/md/dm-verity-fec.h | 1 + 2 files changed, 9 insertions(+), 3 deletions(-)
drivers/md/dm-verity-fec.c +8 -3
@@ -65,7 +65,7 @@ static u8 *fec_read_parity(struct dm_veru8 *res; position = (index + rsb) * v->fec->roots; - block =div64_u64_rem (position, v->fec->roots <<SECTOR_SHIFT , &rem); + block =div64_u64_rem (position, v->fec->io_size, &rem); *offset = (unsigned )rem; res =dm_bufio_read (v->fec->bufio, block, buf);
@@ -154,7 +154,7 @@ static int fec_decode_bufs(struct dm_ver/* read the next block when we run out of parity bytes */ offset += v->fec->roots; -if (offset >= v->fec->roots <<SECTOR_SHIFT ) { +if (offset >= v->fec->io_size) {dm_bufio_release (buf); par =fec_read_parity (v, rsb, block_offset, &offset, &buf);
@@ -742,8 +742,13 @@ int verity_fec_ctr(struct dm_verity *v)return -E2BIG ; } +if ((f->roots <<SECTOR_SHIFT ) & ((1 << v->data_dev_block_bits) -1 )) + f->io_size =1 << v->data_dev_block_bits; +else + f->io_size = v->fec->roots <<SECTOR_SHIFT ; + f->bufio =dm_bufio_client_create (f->dev->bdev, - f->roots <<SECTOR_SHIFT , + f->io_size,1 ,0 ,NULL ,NULL );if (IS_ERR (f->bufio)) { ti->error ="Cannot initialize FEC bufio client" ;
drivers/md/dm-verity-fec.h +1 -0
@@ -36,6 +36,7 @@ struct dm_verity_fec {struct dm_dev *dev;/* parity data device */ struct dm_bufio_client *data_bufio;/* for data dev access */ struct dm_bufio_client *bufio;/* for parity data access */ +size_t io_size;/* IO size for roots */ sector_t start;/* parity data start in blocks */ sector_t blocks;/* number of blocks covered */ sector_t rounds;/* number of interleaving rounds */
Greg Kroah-Hartman
maintainerPATCH 44/73 readdir: make sure to verify directory entry for legacy interfaces too
In reply to Greg Kroah-HartmanFrom: Linus Torvalds <[email protected]>
commit 0c93ac69407d63a85be0129aa55ffaec27ffebd3 upstream.
This does the directory entry name verification for the legacy "fillonedir" (and compat) interface that goes all the way back to the dark ages before we had a proper dirent, and the readdir() system call returned just a single entry at a time.
Nobody should use this interface unless you still have binaries from 1991, but let's do it right.
This came up during discussions about unsafe_copy_to_user() and proper checking of all the inputs to it, as the networking layer is looking to use it in a few new places. So let's make sure the _old_ users do it all right and proper, before we add new ones.
See also commit 8a23eb804ca4 ("Make filldir[64]() verify the directory entry filename is valid") which did the proper modern interfaces that people actually use. It had a note:
Note that I didn't bother adding the checks to any legacy interfaces that nobody uses.
which this now corrects. Note that we really don't care about POSIX and the presense of '/' in a directory entry, but verify_dirent_name() also ends up doing the proper name length verification which is what the input checking discussion was about.
[ Another option would be to remove the support for this particular very
old interface: any binaries that use it are likely a.out binaries, and they will no longer run anyway since we removed a.out binftm support in commit eac616557050 ("x86: Deprecate a.out support").
But I'm not sure which came first: getdents() or ELF support, so let's pretend somebody might still have a working binary that uses the legacy readdir() case.. ]
--- fs/readdir.c | 6 ++++++ 1 file changed, 6 insertions(+)
fs/readdir.c +6 -0
@@ -150,6 +150,9 @@ static int fillonedir(struct dir_contextif (buf->result)return -EINVAL ; + buf->result =verify_dirent_name (name, namlen); +if (buf->result <0 ) +return buf->result; d_ino = ino;if (sizeof (d_ino) <sizeof (ino) && d_ino != ino) { buf->result = -EOVERFLOW ;
@@ -417,6 +420,9 @@ static int compat_fillonedir(struct dir_if (buf->result)return -EINVAL ; + buf->result =verify_dirent_name (name, namlen); +if (buf->result <0 ) +return buf->result; d_ino = ino;if (sizeof (d_ino) <sizeof (ino) && d_ino != ino) { buf->result = -EOVERFLOW ;
Greg Kroah-Hartman
maintainerPATCH 45/73 arm64: fix inline asm in load_unaligned_zeropad()
In reply to Greg Kroah-HartmanFrom: Peter Collingbourne <[email protected]>
commit 185f2e5f51c2029efd9dd26cceb968a44fe053c6 upstream.
The inline asm's addr operand is marked as input-only, however in the case where an exception is taken it may be modified by the BIC instruction on the exception path. Fix the problem by using a temporary register as the destination register for the BIC instruction.
--- arch/arm64/include/asm/word-at-a-time.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
arch/arm64/include/asm/word-at-a-time.h +5 -5
@@ -53,7 +53,7 @@ static inline unsigned long find_zero(un*/ static inline unsigned long load_unaligned_zeropad (const void *addr) { -unsigned long ret, offset; +unsigned long ret, tmp;/* Load word from unaligned pointer addr */ asm(
@@ -61,9 +61,9 @@ static inline unsigned long load_unalign"2:\n" " .pushsection .fixup,\"ax\"\n" " .align 2\n" -"3: and %1, %2, #0x7\n" -" bic %2, %2, #0x7\n" -" ldr %0, [%2]\n" +"3: bic %1, %2, #0x7\n" +" ldr %0, [%1]\n" +" and %1, %2, #0x7\n" " lsl %1, %1, #0x3\n" #ifndef __AARCH64EB__" lsr %0, %0, %1\n"
@@ -73,7 +73,7 @@ static inline unsigned long load_unalign" b 2b\n" " .popsection\n" _ASM_EXTABLE(1b ,3b ) - : "=&r" (ret), "=&r" (offset) + : "=&r" (ret), "=&r" (tmp) : "r" (addr), "Q" (*(unsigned long *)addr)); return ret;
Greg Kroah-Hartman
maintainerPATCH 46/73 arm64: alternatives: Move length validation in alternative_{insn, endif}
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
commit 22315a2296f4c251fa92aec45fbbae37e9301b6c upstream.
After commit 2decad92f473 ("arm64: mte: Ensure TIF_MTE_ASYNC_FAULT is set atomically"), LLVM's integrated assembler fails to build entry.S:
<instantiation>:5:7: error: expected assembly-time absolute expression
.org . - (664b-663b) + (662b-661b)
^
<instantiation>:6:7: error: expected assembly-time absolute expression
.org . - (662b-661b) + (664b-663b)
^The root cause is LLVM's assembler has a one-pass design, meaning it cannot figure out these instruction lengths when the .org directive is outside of the subsection that they are in, which was changed by the .arch_extension directive added in the above commit.
Apply the same fix from commit 966a0acce2fc ("arm64/alternatives: move length validation inside the subsection") to the alternative_endif macro, shuffling the .org directives so that the length validation happen will always happen in the same subsections. alternative_insn has not shown any issue yet but it appears that it could have the same issue in the future so just preemptively change it.
--- arch/arm64/include/asm/alternative.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/arm64/include/asm/alternative.h +4 -4
@@ -119,9 +119,9 @@ static inline void apply_alternatives_mo .popsection .subsection 1 663: \insn2 -664: .previous - .org . - (664b-663b) + (662b-661b) +664: .org . - (664b-663b) + (662b-661b) .org . - (662b-661b) + (664b-663b) + .previous .endif .endm
@@ -191,11 +191,11 @@ static inline void apply_alternatives_mo*/ .macro alternative_endif 664: + .org . - (664b-663b) + (662b-661b) + .org . - (662b-661b) + (664b-663b) .if .Lasm_alt_mode==0 .previous .endif - .org . - (664b-663b) + (662b-661b) - .org . - (662b-661b) + (664b-663b) .endm/*
Greg Kroah-Hartman
maintainerPATCH 47/73 vfio/pci: Add missing range check in vfio_pci_mmap
In reply to Greg Kroah-HartmanFrom: Christian A. Ehrhardt <[email protected]>
commit 909290786ea335366e21d7f1ed5812b90f2f0a92 upstream.
When mmaping an extra device region verify that the region index derived from the mmap offset is valid.
Message-Id: <[email protected]>
--- drivers/vfio/pci/vfio_pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/vfio/pci/vfio_pci.c +3 -1
@@ -1474,6 +1474,8 @@ static int vfio_pci_mmap(void *device_da index = vma->vm_pgoff >> (VFIO_PCI_OFFSET_SHIFT -PAGE_SHIFT ); +if (index >=VFIO_PCI_NUM_REGIONS + vdev->num_regions) +return -EINVAL ;if (vma->vm_end < vma->vm_start)return -EINVAL ;if ((vma->vm_flags &VM_SHARED ) ==0 )
@@ -1482,7 +1484,7 @@ static int vfio_pci_mmap(void *device_daint regnum = index -VFIO_PCI_NUM_REGIONS ;struct vfio_pci_region *region = vdev->region + regnum; -if (region && region->ops && region->ops->mmap && +if (region->ops && region->ops->mmap && (region->flags &VFIO_REGION_INFO_FLAG_MMAP ))return region->ops->mmap (vdev, region, vma);return -EINVAL ;
Greg Kroah-Hartman
maintainerPATCH 48/73 riscv: Fix spelling mistake "SPARSEMEM" to "SPARSMEM"
In reply to Greg Kroah-HartmanFrom: Kefeng Wang <[email protected]>
commit 199fc6b8dee7d6d50467a57e0dc7e3e1b7d59966 upstream.
There is a spelling mistake when SPARSEMEM Kconfig copy.
--- arch/riscv/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/riscv/Kconfig +1 -1
@@ -101,7 +101,7 @@ config ARCH_FLATMEM_ENABLE config ARCH_SPARSEMEM_ENABLE def_bool y depends on MMU - select SPARSEMEM_STATIC if 32BIT && SPARSMEM + select SPARSEMEM_STATIC if 32BIT && SPARSEMEM select SPARSEMEM_VMEMMAP_ENABLE if 64BIT config ARCH_SELECT_MEMORY_MODEL
Greg Kroah-Hartman
maintainerPATCH 49/73 scsi: libsas: Reset num_scatter if libata marks qc as NODATA
In reply to Greg Kroah-HartmanFrom: Jolly Shah <[email protected]>
commit 176ddd89171ddcf661862d90c5d257877f7326d6 upstream.
When the cache_type for the SCSI device is changed, the SCSI layer issues a MODE_SELECT command. The caching mode details are communicated via a request buffer associated with the SCSI command with data direction set as DMA_TO_DEVICE (scsi_mode_select()). When this command reaches the libata layer, as a part of generic initial setup, libata layer sets up the scatterlist for the command using the SCSI command (ata_scsi_qc_new()). This command is then translated by the libata layer into ATA_CMD_SET_FEATURES (ata_scsi_mode_select_xlat()). The libata layer treats this as a non-data command (ata_mselect_caching()), since it only needs an ATA taskfile to pass the caching on/off information to the device. It does not need the scatterlist that has been setup, so it does not perform dma_map_sg() on the scatterlist (ata_qc_issue()). Unfortunately, when this command reaches the libsas layer (sas_ata_qc_issue()), libsas layer sees it as a non-data command with a scatterlist. It cannot extract the correct DMA length since the scatterlist has not been mapped with dma_map_sg() for a DMA operation. When this partially constructed SAS task reaches pm80xx LLDD, it results in the following warning:
"pm80xx_chip_sata_req 6058: The sg list address start_addr=0x0000000000000000 data_len=0x0end_addr_high=0xffffffff end_addr_low=0xffffffff has crossed 4G boundary"
Update libsas to handle ATA non-data commands separately so num_scatter and total_xfer_len remain 0.
--- drivers/scsi/libsas/sas_ata.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/scsi/libsas/sas_ata.c +4 -5
@@ -200,18 +200,17 @@ static unsigned int sas_ata_qc_issue(strmemcpy (task->ata_task.atapi_packet, qc->cdb, qc->dev->cdb_len); task->total_xfer_len = qc->nbytes; task->num_scatter = qc->n_elem; + task->data_dir = qc->dma_dir; + }else if (qc->tf.protocol ==ATA_PROT_NODATA ) { + task->data_dir =DMA_NONE ; }else {for_each_sg (qc->sg, sg, qc->n_elem, si) xfer +=sg_dma_len (sg); task->total_xfer_len = xfer; task->num_scatter = si; - } - -if (qc->tf.protocol ==ATA_PROT_NODATA ) - task->data_dir =DMA_NONE ; -else task->data_dir = qc->dma_dir; + } task->scatter = qc->sg; task->ata_task.retry_count =1 ; task->task_state_flags =SAS_TASK_STATE_PENDING ;
Greg Kroah-Hartman
maintainerPATCH 50/73 netfilter: conntrack: do not print icmpv6 as unknown via /proc
In reply to Greg Kroah-HartmanFrom: Pablo Neira Ayuso <[email protected]>
commit fbea31808ca124dd73ff6bb1e67c9af4607c3e32 upstream.
/proc/net/nf_conntrack shows icmpv6 as unknown.
--- net/netfilter/nf_conntrack_standalone.c | 1 + 1 file changed, 1 insertion(+)
net/netfilter/nf_conntrack_standalone.c +1 -0
@@ -266,6 +266,7 @@ static const char* l4proto_name(u16 protcase IPPROTO_GRE :return "gre" ;case IPPROTO_SCTP :return "sctp" ;case IPPROTO_UDPLITE :return "udplite" ; +case IPPROTO_ICMPV6 :return "icmpv6" ; }return "unknown" ;
Greg Kroah-Hartman
maintainerPATCH 51/73 libnvdimm/region: Fix nvdimm_has_flush() to handle ND_REGION_ASYNC
In reply to Greg Kroah-HartmanFrom: Vaibhav Jain <[email protected]>
commit a2948b17f6b936fc52f86c0f92c46d2f91928b79 upstream.
In case a platform doesn't provide explicit flush-hints but provides an explicit flush callback via ND_REGION_ASYNC region flag, then nvdimm_has_flush() still returns '0' indicating that writes do not require flushing. This happens on PPC64 with patch at [1] applied, where 'deep_flush' of a region was denied even though an explicit flush function was provided.
Fix this by adding a condition to nvdimm_has_flush() to test for the ND_REGION_ASYNC flag on the region and see if a 'region->flush' callback is assigned.
--- drivers/nvdimm/region_devs.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/nvdimm/region_devs.c +7 -2
@@ -1142,6 +1142,11 @@ int nvdimm_has_flush(struct nd_region *n || !IS_ENABLED(CONFIG_ARCH_HAS_PMEM_API))return -ENXIO ; +/* Test if an explicit flush function is defined */ +if (test_bit (ND_REGION_ASYNC , &nd_region->flags) && nd_region->flush) +return 1 ; + +/* Test if any flush hints for the region are available */ for (i =0 ; i < nd_region->ndr_mappings; i++) {struct nd_mapping *nd_mapping = &nd_region->mapping[i];struct nvdimm *nvdimm = nd_mapping->nvdimm;
@@ -1152,8 +1157,8 @@ int nvdimm_has_flush(struct nd_region *n }/* -* The platform defines dimm devices without hints, assume -* platform persistence mechanism like ADR +* The platform defines dimm devices without hints nor explicit flush, +* assume platform persistence mechanism like ADR */ return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 52/73 netfilter: bridge: add pre_exit hooks for ebtable unregistration
In reply to Greg Kroah-HartmanFrom: Florian Westphal <[email protected]>
commit 7ee3c61dcd28bf6e290e06ad382f13511dc790e9 upstream.
Just like ip/ip6/arptables, the hooks have to be removed, then synchronize_rcu() has to be called to make sure no more packets are being processed before the ruleset data is released.
Place the hook unregistration in the pre_exit hook, then call the new ebtables pre_exit function from there.
Years ago, when first netns support got added for netfilter+ebtables, this used an older (now removed) netfilter hook unregister API, that did a unconditional synchronize_rcu().
Now that all is done with call_rcu, ebtable_{filter,nat,broute} pernet exit handlers may free the ebtable ruleset while packets are still in flight.
This can only happens on module removal, not during netns exit.
The new function expects the table name, not the table struct.
This is because upcoming patch set (targeting -next) will remove all net->xt.{nat,filter,broute}_table instances, this makes it necessary to avoid external references to those member variables.
The existing APIs will be converted, so follow the upcoming scheme of passing name + hook type instead.
--- include/linux/netfilter_bridge/ebtables.h | 5 +++-- net/bridge/netfilter/ebtable_broute.c | 8 +++++++- net/bridge/netfilter/ebtable_filter.c | 8 +++++++- net/bridge/netfilter/ebtable_nat.c | 8 +++++++- net/bridge/netfilter/ebtables.c | 30 +++++++++++++++++++++++++++--- 5 files changed, 51 insertions(+), 8 deletions(-)
include/linux/netfilter_bridge/ebtables.h +3 -2
@@ -110,8 +110,9 @@ extern int ebt_register_table(struct netconst struct ebt_table *table, const struct nf_hook_ops *ops, struct ebt_table **res); -extern void ebt_unregister_table (struct net *net,struct ebt_table *table, -const struct nf_hook_ops *); +extern void ebt_unregister_table (struct net *net,struct ebt_table *table); +void ebt_unregister_table_pre_exit (struct net *net,const char *tablename, +const struct nf_hook_ops *ops);extern unsigned int ebt_do_table (struct sk_buff *skb,const struct nf_hook_state *state,struct ebt_table *table);
net/bridge/netfilter/ebtable_broute.c +7 -1
@@ -105,14 +105,20 @@ static int __net_init broute_net_init(st &net->xt.broute_table); } +static void __net_exit broute_net_pre_exit(struct net *net) +{ +ebt_unregister_table_pre_exit (net,"broute" , &ebt_ops_broute); +} + static void __net_exit broute_net_exit(struct net *net) { -ebt_unregister_table (net, net->xt.broute_table, &ebt_ops_broute); +ebt_unregister_table (net, net->xt.broute_table); }static struct pernet_operations broute_net_ops = { .init = broute_net_init, .exit = broute_net_exit, + .pre_exit = broute_net_pre_exit, };static int __init ebtable_broute_init (void )
net/bridge/netfilter/ebtable_filter.c +7 -1
@@ -99,14 +99,20 @@ static int __net_init frame_filter_net_i &net->xt.frame_filter); } +static void __net_exit frame_filter_net_pre_exit(struct net *net) +{ +ebt_unregister_table_pre_exit (net,"filter" , ebt_ops_filter); +} + static void __net_exit frame_filter_net_exit(struct net *net) { -ebt_unregister_table (net, net->xt.frame_filter, ebt_ops_filter); +ebt_unregister_table (net, net->xt.frame_filter); }static struct pernet_operations frame_filter_net_ops = { .init = frame_filter_net_init, .exit = frame_filter_net_exit, + .pre_exit = frame_filter_net_pre_exit, };static int __init ebtable_filter_init (void )
net/bridge/netfilter/ebtable_nat.c +7 -1
@@ -99,14 +99,20 @@ static int __net_init frame_nat_net_init &net->xt.frame_nat); } +static void __net_exit frame_nat_net_pre_exit(struct net *net) +{ +ebt_unregister_table_pre_exit (net,"nat" , ebt_ops_nat); +} + static void __net_exit frame_nat_net_exit(struct net *net) { -ebt_unregister_table (net, net->xt.frame_nat, ebt_ops_nat); +ebt_unregister_table (net, net->xt.frame_nat); }static struct pernet_operations frame_nat_net_ops = { .init = frame_nat_net_init, .exit = frame_nat_net_exit, + .pre_exit = frame_nat_net_pre_exit, };static int __init ebtable_nat_init (void )
net/bridge/netfilter/ebtables.c +27 -3
@@ -1237,10 +1237,34 @@ out:return ret; } -void ebt_unregister_table (struct net *net,struct ebt_table *table, -const struct nf_hook_ops *ops) +static struct ebt_table *__ebt_find_table (struct net *net,const char *name) +{ +struct ebt_table *t; + +mutex_lock (&ebt_mutex); + +list_for_each_entry (t, &net->xt.tables[NFPROTO_BRIDGE ], list) { +if (strcmp (t->name, name) ==0 ) { +mutex_unlock (&ebt_mutex); +return t; + } + } + +mutex_unlock (&ebt_mutex); +return NULL ; +} + +void ebt_unregister_table_pre_exit (struct net *net,const char *name,const struct nf_hook_ops *ops) +{ +struct ebt_table *table =__ebt_find_table (net, name); + +if (table) +nf_unregister_net_hooks (net, ops,hweight32 (table->valid_hooks)); +} +EXPORT_SYMBOL (ebt_unregister_table_pre_exit); + +void ebt_unregister_table (struct net *net,struct ebt_table *table) { -nf_unregister_net_hooks (net, ops,hweight32 (table->valid_hooks));__ebt_unregister_table (net, table); }
Greg Kroah-Hartman
maintainerPATCH 53/73 netfilter: arp_tables: add pre_exit hook for table unregister
In reply to Greg Kroah-HartmanFrom: Florian Westphal <[email protected]>
commit d163a925ebbc6eb5b562b0f1d72c7e817aa75c40 upstream.
Same problem that also existed in iptables/ip(6)tables, when arptable_filter is removed there is no longer a wait period before the table/ruleset is free'd.
Unregister the hook in pre_exit, then remove the table in the exit function.
This used to work correctly because the old nf_hook_unregister API did unconditional synchronize_net.
The per-net hook unregister function uses call_rcu instead.
--- include/linux/netfilter_arp/arp_tables.h | 5 +++-- net/ipv4/netfilter/arp_tables.c | 9 +++++++-- net/ipv4/netfilter/arptable_filter.c | 10 +++++++++- 3 files changed, 19 insertions(+), 5 deletions(-)
include/linux/netfilter_arp/arp_tables.h +3 -2
@@ -52,8 +52,9 @@ extern void *arpt_alloc_initial_table(coint arpt_register_table (struct net *net,const struct xt_table *table,const struct arpt_replace *repl,const struct nf_hook_ops *ops,struct xt_table **res); -void arpt_unregister_table (struct net *net,struct xt_table *table, -const struct nf_hook_ops *ops); +void arpt_unregister_table (struct net *net,struct xt_table *table); +void arpt_unregister_table_pre_exit (struct net *net,struct xt_table *table, +const struct nf_hook_ops *ops);extern unsigned int arpt_do_table (struct sk_buff *skb,const struct nf_hook_state *state,struct xt_table *table);
net/ipv4/netfilter/arp_tables.c +7 -2
@@ -1580,10 +1580,15 @@ out_free:return ret; } -void arpt_unregister_table (struct net *net,struct xt_table *table, -const struct nf_hook_ops *ops) +void arpt_unregister_table_pre_exit (struct net *net,struct xt_table *table, +const struct nf_hook_ops *ops) {nf_unregister_net_hooks (net, ops,hweight32 (table->valid_hooks)); +} +EXPORT_SYMBOL (arpt_unregister_table_pre_exit); + +void arpt_unregister_table (struct net *net,struct xt_table *table) +{__arpt_unregister_table (net, table); }
net/ipv4/netfilter/arptable_filter.c +9 -1
@@ -56,16 +56,24 @@ static int __net_init arptable_filter_tareturn err; } +static void __net_exit arptable_filter_net_pre_exit(struct net *net) +{ +if (net->ipv4.arptable_filter) +arpt_unregister_table_pre_exit (net, net->ipv4.arptable_filter, + arpfilter_ops); +} + static void __net_exit arptable_filter_net_exit(struct net *net) {if (!net->ipv4.arptable_filter)return ; -arpt_unregister_table (net, net->ipv4.arptable_filter, arpfilter_ops); +arpt_unregister_table (net, net->ipv4.arptable_filter); net->ipv4.arptable_filter =NULL ; }static struct pernet_operations arptable_filter_net_ops = { .exit = arptable_filter_net_exit, + .pre_exit = arptable_filter_net_pre_exit, };static int __init arptable_filter_init (void )
Greg Kroah-Hartman
maintainerPATCH 54/73 net: macb: fix the restore of cmp registers
In reply to Greg Kroah-HartmanFrom: Claudiu Beznea <[email protected]>
commit a714e27ea8bdee2b238748029d31472d0a65b611 upstream.
Commit a14d273ba159 ("net: macb: restore cmp registers on resume path") introduces the restore of CMP registers on resume path. In case the IP doesn't support type 2 screeners (zero on DCFG8 register) the struct macb::rx_fs_list::list is not initialized and thus the list_for_each_entry(item, &bp->rx_fs_list.list, list) loop introduced in commit a14d273ba159 ("net: macb: restore cmp registers on resume path") will access an uninitialized list leading to crash. Thus, initialize the struct macb::rx_fs_list::list without taking into account if the IP supports type 2 screeners or not.
--- drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/cadence/macb_main.c +1 -1
@@ -3590,6 +3590,7 @@ static int macb_init(struct platform_dev reg =gem_readl (bp,DCFG8 ); bp->max_tuples =min ((GEM_BFEXT (SCR2CMP , reg) /3 ),GEM_BFEXT (T2SCR , reg)); +INIT_LIST_HEAD (&bp->rx_fs_list.list);if (bp->max_tuples >0 ) {/* also needs one ethtype match to check IPv4 */ if (GEM_BFEXT (SCR2ETH , reg) >0 ) {
@@ -3600,7 +3601,6 @@ static int macb_init(struct platform_dev/* Filtering is supported in hw but don't enable it in kernel now */ dev->hw_features |=NETIF_F_NTUPLE ;/* init Rx flow definitions */ -INIT_LIST_HEAD (&bp->rx_fs_list.list); bp->rx_fs_list.count =0 ;spin_lock_init (&bp->rx_fs_lock); }else
Greg Kroah-Hartman
maintainerPATCH 55/73 netfilter: nft_limit: avoid possible divide error in nft_limit_init
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit b895bdf5d643b6feb7c60856326dd4feb6981560 upstream.
div_u64() divides u64 by u32.
nft_limit_init() wants to divide u64 by u64, use the appropriate math function (div64_u64)
divide error: 0000 [#1] PREEMPT SMP KASAN
CPU: 1 PID: 8390 Comm: syz-executor188 Not tainted 5.12.0-rc4-syzkaller #0 Hardware name: Google Google Compute Engine/Google Compute Engine, BIOS Google 01/01/2011 RIP: 0010:div_u64_rem include/linux/math64.h:28 [inline] RIP: 0010:div_u64 include/linux/math64.h:127 [inline] RIP: 0010:nft_limit_init+0x2a2/0x5e0 net/netfilter/nft_limit.c:85 Code: ef 4c 01 eb 41 0f 92 c7 48 89 de e8 38 a5 22 fa 4d 85 ff 0f 85 97 02 00 00 e8 ea 9e 22 fa 4c 0f af f3 45 89 ed 31 d2 4c 89 f0 <49> f7 f5 49 89 c6 e8 d3 9e 22 fa 48 8d 7d 48 48 b8 00 00 00 00 00 RSP: 0018:ffffc90009447198 EFLAGS: 00010246 RAX: 0000000000000000 RBX: 0000200000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: ffffffff875152e6 RDI: 0000000000000003 RBP: ffff888020f80908 R08: 0000200000000000 R09: 0000000000000000 R10: ffffffff875152d8 R11: 0000000000000000 R12: ffffc90009447270 R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000 FS: 000000000097a300(0000) GS:ffff8880b9d00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00000000200001c4 CR3: 0000000026a52000 CR4: 00000000001506e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: nf_tables_newexpr net/netfilter/nf_tables_api.c:2675 [inline] nft_expr_init+0x145/0x2d0 net/netfilter/nf_tables_api.c:2713 nft_set_elem_expr_alloc+0x27/0x280 net/netfilter/nf_tables_api.c:5160 nf_tables_newset+0x1997/0x3150 net/netfilter/nf_tables_api.c:4321 nfnetlink_rcv_batch+0x85a/0x21b0 net/netfilter/nfnetlink.c:456 nfnetlink_rcv_skb_batch net/netfilter/nfnetlink.c:580 [inline] nfnetlink_rcv+0x3af/0x420 net/netfilter/nfnetlink.c:598 netlink_unicast_kernel net/netlink/af_netlink.c:1312 [inline] netlink_unicast+0x533/0x7d0 net/netlink/af_netlink.c:1338 netlink_sendmsg+0x856/0xd90 net/netlink/af_netlink.c:1927 sock_sendmsg_nosec net/socket.c:654 [inline] sock_sendmsg+0xcf/0x120 net/socket.c:674 ____sys_sendmsg+0x6e8/0x810 net/socket.c:2350 ___sys_sendmsg+0xf3/0x170 net/socket.c:2404 __sys_sendmsg+0xe5/0x1b0 net/socket.c:2433 do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46 entry_SYSCALL_64_after_hwframe+0x44/0xae
--- net/netfilter/nft_limit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/netfilter/nft_limit.c +2 -2
@@ -76,13 +76,13 @@ static int nft_limit_init(struct nft_limreturn -EOVERFLOW ;if (pkts) { - tokens =div_u64 (limit->nsecs, limit->rate) * limit->burst; + tokens =div64_u64 (limit->nsecs, limit->rate) * limit->burst; }else {/* The token bucket size limits the number of tokens can be * accumulated. tokens_max specifies the bucket size. * tokens_max = unit * (rate + burst) / rate. */ - tokens =div_u64 (limit->nsecs * (limit->rate + limit->burst), + tokens =div64_u64 (limit->nsecs * (limit->rate + limit->burst), limit->rate); }
Greg Kroah-Hartman
maintainerPATCH 56/73 net: davicom: Fix regulator not turned off on failed probe
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
commit 31457db3750c0b0ed229d836f2609fdb8a5b790e upstream.
When the probe fails, we must disable the regulator that was previously enabled.
This patch is a follow-up to commit ac88c531a5b3
("net: davicom: Fix regulator not turned off on failed probe") which missed one case.
--- drivers/net/ethernet/davicom/dm9000.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/davicom/dm9000.c +4 -2
@@ -1476,8 +1476,10 @@ dm9000_probe(struct platform_device *pde/* Init network device */ ndev =alloc_etherdev (sizeof (struct board_info )); -if (!ndev) -return -ENOMEM ; +if (!ndev) { + ret = -ENOMEM ; + goto out_regulator_disable; + }SET_NETDEV_DEV (ndev, &pdev->dev);
Greg Kroah-Hartman
maintainerPATCH 57/73 net: sit: Unregister catch-all devices
In reply to Greg Kroah-HartmanFrom: Hristo Venev <[email protected]>
commit 610f8c0fc8d46e0933955ce13af3d64484a4630a upstream.
A sit interface created without a local or a remote address is linked into the sit_net::tunnels_wc list of its original namespace. When deleting a network namespace, delete the devices that have been moved.
The following script triggers a null pointer dereference if devices linked in a deleted sit_net remain:
for i in seq 1 30; do
ip netns add ns-test
ip netns exec ns-test ip link add dev veth0 type veth peer veth1 ip netns exec ns-test ip link add dev sit$i type sit dev veth0 ip netns exec ns-test ip link set dev sit$i netns $$ ip netns del ns-test
done
for i in seq 1 30; do
ip link del dev sit$i
done
--- net/ipv6/sit.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv6/sit.c +2 -2
@@ -1819,9 +1819,9 @@ static void __net_exit sit_destroy_tunneif (dev->rtnl_link_ops == &sit_link_ops)unregister_netdevice_queue (dev, head); -for (prio =1 ; prio <4 ; prio++) { +for (prio =0 ; prio <4 ; prio++) {int h; -for (h =0 ; h <IP6_SIT_HASH_SIZE ; h++) { +for (h =0 ; h < (prio ?IP6_SIT_HASH_SIZE :1 ); h++) {struct ip_tunnel *t; t =rtnl_dereference (sitn->tunnels[prio][h]);
Greg Kroah-Hartman
maintainerPATCH 58/73 net: ip6_tunnel: Unregister catch-all devices
In reply to Greg Kroah-HartmanFrom: Hristo Venev <[email protected]>
commit 941ea91e87a6e879ed82dad4949f6234f2702bec upstream.
Similarly to the sit case, we need to remove the tunnels with no addresses that have been moved to another network namespace.
--- net/ipv6/ip6_tunnel.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
net/ipv6/ip6_tunnel.c +10 -0
@@ -2217,6 +2217,16 @@ static void __net_exit ip6_tnl_destroy_t t =rtnl_dereference (t->next); } } + + t =rtnl_dereference (ip6n->tnls_wc[0 ]); +while (t) { +/* If dev is in the same netns, it has already +* been added to the list by the previous loop. +*/ +if (!net_eq (dev_net (t->dev), net)) +unregister_netdevice_queue (t->dev, list); + t =rtnl_dereference (t->next); + } }static int __net_init ip6_tnl_init_net (struct net *net)
Greg Kroah-Hartman
maintainerPATCH 59/73 i40e: fix the panic when running bpf in xdpdrv mode
In reply to Greg Kroah-HartmanFrom: Jason Xing <[email protected]>
commit 4e39a072a6a0fc422ba7da5e4336bdc295d70211 upstream.
Fix this panic by adding more rules to calculate the value of @rss_size_max which could be used in allocating the queues when bpf is loaded, which, however, could cause the failure and then trigger the NULL pointer of vsi->rx_rings. Prio to this fix, the machine doesn't care about how many cpus are online and then allocates 256 queues on the machine with 32 cpus online actually.
Once the load of bpf begins, the log will go like this "failed to get tracking for 256 queues for VSI 0 err -12" and this "setup of MAIN VSI failed".
Thus, I attach the key information of the crash-log here.
BUG: unable to handle kernel NULL pointer dereference at 0000000000000000 RIP: 0010:i40e_xdp+0xdd/0x1b0 [i40e] Call Trace: [2160294.717292] ? i40e_reconfig_rss_queues+0x170/0x170 [i40e] [2160294.717666] dev_xdp_install+0x4f/0x70 [2160294.718036] dev_change_xdp_fd+0x11f/0x230 [2160294.718380] ? dev_disable_lro+0xe0/0xe0 [2160294.718705] do_setlink+0xac7/0xe70 [2160294.719035] ? __nla_parse+0xed/0x120 [2160294.719365] rtnl_newlink+0x73b/0x860
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +6 -0
@@ -11872,6 +11872,7 @@ static int i40e_sw_init(struct i40e_pf * {int err =0 ;int size; +u16 pow;/* Set default capability flags */ pf->flags = I40E_FLAG_RX_CSUM_ENABLED |
@@ -11890,6 +11891,11 @@ static int i40e_sw_init(struct i40e_pf * pf->rss_table_size = pf->hw.func_caps.rss_table_size; pf->rss_size_max =min_t (int, pf->rss_size_max, pf->hw.func_caps.num_tx_qp); + +/* find the next higher power-of-2 of num cpus */ + pow =roundup_pow_of_two (num_online_cpus ()); + pf->rss_size_max =min_t (int, pf->rss_size_max, pow); +if (pf->hw.func_caps.rss) { pf->flags |=I40E_FLAG_RSS_ENABLED ; pf->alloc_rss_size = min_t(int, pf->rss_size_max,
Greg Kroah-Hartman
maintainerPATCH 60/73 ibmvnic: avoid calling napi_disable() twice
In reply to Greg Kroah-HartmanFrom: Lijun Pan <[email protected]>
commit 0775ebc4cf8554bdcd2c212669a0868ab68df5c0 upstream.
__ibmvnic_open calls napi_disable without checking whether NAPI polling has already been disabled or not. This could cause napi_disable being called twice, which could generate deadlock. For example, the first napi_disable will spin until NAPI_STATE_SCHED is cleared by napi_complete_done, then set it again.
When napi_disable is called the second time, it will loop infinitely because no dev->poll will be running to clear NAPI_STATE_SCHED.
To prevent above scenario from happening, call ibmvnic_napi_disable() which checks if napi is disabled or not before calling napi_disable.
--- drivers/net/ethernet/ibm/ibmvnic.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/net/ethernet/ibm/ibmvnic.c +1 -2
@@ -1081,8 +1081,7 @@ static int __ibmvnic_open(struct net_dev rc =set_link_state (adapter,IBMVNIC_LOGICAL_LNK_UP );if (rc) { -for (i =0 ; i < adapter->req_rx_queues; i++) -napi_disable (&adapter->napi[i]); +ibmvnic_napi_disable (adapter);release_resources (adapter);return rc; }
Greg Kroah-Hartman
maintainerPATCH 61/73 ibmvnic: remove duplicate napi_schedule call in do_reset function
In reply to Greg Kroah-HartmanFrom: Lijun Pan <[email protected]>
commit d3a6abccbd272aea7dc2c6f984bb5a2c11278e44 upstream.
During adapter reset, do_reset/do_hard_reset calls ibmvnic_open(), which will calls napi_schedule if previous state is VNIC_CLOSED (i.e, the reset case, and "ifconfig down" case). So there is no need for do_reset to call napi_schedule again at the end of the function though napi_schedule will neglect the request if napi is already scheduled.
--- drivers/net/ethernet/ibm/ibmvnic.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/ethernet/ibm/ibmvnic.c +1 -5
@@ -1849,7 +1849,7 @@ static int do_reset(struct ibmvnic_adaptu64 old_num_rx_queues, old_num_tx_queues;u64 old_num_rx_slots, old_num_tx_slots;struct net_device *netdev = adapter->netdev; -int i, rc; +int rc;netdev_dbg (adapter->netdev,"Re-setting driver (%d)\n" , rwi->reset_reason);
@@ -1994,10 +1994,6 @@ static int do_reset(struct ibmvnic_adapt/* refresh device's multicast list */ ibmvnic_set_multi (netdev); -/* kick napi */ -for (i =0 ; i < adapter->req_rx_queues; i++) -napi_schedule (&adapter->napi[i]); -if (adapter->reset_reason ==VNIC_RESET_FAILOVER || adapter->reset_reason ==VNIC_RESET_MOBILITY ) {call_netdevice_notifiers (NETDEV_NOTIFY_PEERS , netdev);
Greg Kroah-Hartman
maintainerPATCH 62/73 ibmvnic: remove duplicate napi_schedule call in open function
In reply to Greg Kroah-HartmanFrom: Lijun Pan <[email protected]>
commit 7c451f3ef676c805a4b77a743a01a5c21a250a73 upstream.
Remove the unnecessary napi_schedule() call in __ibmvnic_open() since interrupt_rx() calls napi_schedule_prep/__napi_schedule during every receive interrupt.
--- drivers/net/ethernet/ibm/ibmvnic.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/net/ethernet/ibm/ibmvnic.c +0 -5
@@ -1088,11 +1088,6 @@ static int __ibmvnic_open(struct net_devnetif_tx_start_all_queues (netdev); -if (prev_state ==VNIC_CLOSED ) { -for (i =0 ; i < adapter->req_rx_queues; i++) -napi_schedule (&adapter->napi[i]); - } - adapter->state =VNIC_OPEN ;return rc; }
Greg Kroah-Hartman
maintainerPATCH 63/73 gro: ensure frag0 meets IP header alignment
In reply to Greg Kroah-HartmanFrom: Eric Dumazet <[email protected]>
commit 38ec4944b593fd90c5ef42aaaa53e66ae5769d04 upstream.
After commit 0f6925b3e8da ("virtio_net: Do not pull payload in skb->head") Guenter Roeck reported one failure in his tests using sh architecture.
After much debugging, we have been able to spot silent unaligned accesses in inet_gro_receive()
The issue at hand is that upper networking stacks assume their header is word-aligned. Low level drivers are supposed to reserve NET_IP_ALIGN bytes before the Ethernet header to make that happen.
This patch hardens skb_gro_reset_offset() to not allow frag0 fast-path if the fragment is not properly aligned.
Some arches like x86, arm64 and powerpc do not care and define NET_IP_ALIGN as 0, this extra check will be a NOP for them.
Note that if frag0 is not used, GRO will call pskb_may_pull() as many times as needed to pull network and transport headers.
--- net/core/dev.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/core/dev.c +2 -1
@@ -5406,7 +5406,8 @@ static void skb_gro_reset_offset(structif (skb_mac_header (skb) ==skb_tail_pointer (skb) && pinfo->nr_frags && - !PageHighMem (skb_frag_page (frag0))) { + !PageHighMem (skb_frag_page (frag0)) && + (!NET_IP_ALIGN || !(skb_frag_off (frag0) &3 ))) {NAPI_GRO_CB (skb)->frag0 =skb_frag_address (frag0); NAPI_GRO_CB(skb)->frag0_len = min_t(unsigned int, skb_frag_size(frag0),
Greg Kroah-Hartman
maintainerPATCH 64/73 ARM: footbridge: fix PCI interrupt mapping
In reply to Greg Kroah-HartmanFrom: Russell King <[email protected]>
[ Upstream commit 30e3b4f256b4e366a61658c294f6a21b8626dda7 ]
Since commit 30fdfb929e82 ("PCI: Add a call to pci_assign_irq() in pci_device_probe()"), the PCI code will call the IRQ mapping function whenever a PCI driver is probed. If these are marked as __init, this causes an oops if a PCI driver is loaded or bound after the kernel has initialised.
--- arch/arm/mach-footbridge/cats-pci.c | 4 ++-- arch/arm/mach-footbridge/ebsa285-pci.c | 4 ++-- arch/arm/mach-footbridge/netwinder-pci.c | 2 +- arch/arm/mach-footbridge/personal-pci.c | 5 ++--- 4 files changed, 7 insertions(+), 8 deletions(-)
arch/arm/mach-footbridge/cats-pci.c +2 -2
@@ -15,14 +15,14 @@#include <asm/mach-types.h> /* cats host-specific stuff */ -static int irqmap_cats[]__initdata = {IRQ_PCI ,IRQ_IN0 ,IRQ_IN1 ,IRQ_IN3 }; +static int irqmap_cats[] = {IRQ_PCI ,IRQ_IN0 ,IRQ_IN1 ,IRQ_IN3 };static u8 cats_no_swizzle (struct pci_dev *dev,u8 *pin) {return 0 ; } -static int __init cats_map_irq (const struct pci_dev *dev,u8 slot,u8 pin) +static int cats_map_irq (const struct pci_dev *dev,u8 slot,u8 pin) {if (dev->irq >=255 )return -1 ;/* not a valid interrupt. */
arch/arm/mach-footbridge/ebsa285-pci.c +2 -2
@@ -14,9 +14,9 @@#include <asm/mach/pci.h> #include <asm/mach-types.h> -static int irqmap_ebsa285[]__initdata = {IRQ_IN3 ,IRQ_IN1 ,IRQ_IN0 ,IRQ_PCI }; +static int irqmap_ebsa285[] = {IRQ_IN3 ,IRQ_IN1 ,IRQ_IN0 ,IRQ_PCI }; -static int __init ebsa285_map_irq (const struct pci_dev *dev,u8 slot,u8 pin) +static int ebsa285_map_irq (const struct pci_dev *dev,u8 slot,u8 pin) {if (dev->vendor ==PCI_VENDOR_ID_CONTAQ && dev->device ==PCI_DEVICE_ID_CONTAQ_82C693 )
arch/arm/mach-footbridge/netwinder-pci.c +1 -1
@@ -18,7 +18,7 @@* We now use the slot ID instead of the device identifiers to select * which interrupt is routed where. */ -static int __init netwinder_map_irq (const struct pci_dev *dev,u8 slot,u8 pin) +static int netwinder_map_irq (const struct pci_dev *dev,u8 slot,u8 pin) {switch (slot) {case 0 :/* host bridge */
arch/arm/mach-footbridge/personal-pci.c +2 -3
@@ -14,13 +14,12 @@#include <asm/mach/pci.h> #include <asm/mach-types.h> -static int irqmap_personal_server[]__initdata = { +static int irqmap_personal_server[] = {IRQ_IN0 ,IRQ_IN1 ,IRQ_IN2 ,IRQ_IN3 ,0 ,0 ,0 ,IRQ_DOORBELLHOST ,IRQ_DMA1 ,IRQ_DMA2 ,IRQ_PCI }; -static int __init personal_server_map_irq (const struct pci_dev *dev,u8 slot, -u8 pin) +static int personal_server_map_irq (const struct pci_dev *dev,u8 slot,u8 pin) {unsigned char line;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 65/73 arm64: dts: allwinner: Fix SD card CD GPIO for SOPine systems
In reply to Greg Kroah-HartmanFrom: Andre Przywara <[email protected]>
[ Upstream commit 3dd4ce4185df6798dcdcc3669bddb35899d7d5e1 ]
Commit 941432d00768 ("arm64: dts: allwinner: Drop non-removable from SoPine/LTS SD card") enabled the card detect GPIO for the SOPine module, along the way with the Pine64-LTS, which share the same base .dtsi.
However while both boards indeed have a working CD GPIO on PF6, the polarity is different: the SOPine modules uses a "push-pull" socket, which has an active-high switch, while the Pine64-LTS use the more traditional push-push socket and the common active-low switch.
Fix the polarity in the sopine.dtsi, and overwrite it in the LTS board .dts, to make the SD card work again on systems using SOPine modules.
--- arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts | 4 ++++ arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/allwinner/sun50i-a64-pine64-lts.dts +4 -0
@@ -11,3 +11,7 @@ compatible = "pine64,pine64-lts", "allwinner,sun50i-r18", "allwinner,sun50i-a64"; }; + +&mmc0 { + cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 push-push switch */ +};
arch/arm64/boot/dts/allwinner/sun50i-a64-sopine.dtsi +1 -1
@@ -57,7 +57,7 @@ vmmc-supply = <®_dcdc1>; disable-wp; bus-width = <4>; - cd-gpios = <&pio 5 6 GPIO_ACTIVE_LOW>; /* PF6 */ + cd-gpios = <&pio 5 6 GPIO_ACTIVE_HIGH>; /* PF6 push-pull switch */ status = "okay"; };
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 66/73 r8169: remove fiddling with the PCIe max read request size
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
[ Upstream commit 2df49d36549808a7357ad9f78b7a8e39516e7809 ]
The attempt to improve performance by changing the PCIe max read request size was added in the vendor driver more than 10 years back and copied to r8169 driver. In the vendor driver this has been removed long ago. Obviously it had no effect, also in my tests I didn't see any difference. Typically the max payload size is less than 512 bytes anyway, and the PCI core takes care that the maximum supported value is set. So let's remove fiddling with PCIe max read request size from r8169 too.
--- drivers/net/ethernet/realtek/r8169_main.c | 40 +++-------------------- 1 file changed, 4 insertions(+), 36 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +4 -36
@@ -742,12 +742,6 @@ static void rtl_unlock_config_regs(struct rtl8169_private *tp)RTL_W8 (tp, Cfg9346, Cfg9346_Unlock); } -static void rtl_tx_performance_tweak (struct rtl8169_private *tp,u16 force) -{ -pcie_capability_clear_and_set_word (tp->pci_dev,PCI_EXP_DEVCTL , -PCI_EXP_DEVCTL_READRQ , force); -} -static bool rtl_is_8125 (struct rtl8169_private *tp) {return tp->mac_version >=RTL_GIGA_MAC_VER_60 ;
@@ -4057,14 +4051,12 @@ static void r8168c_hw_jumbo_enable(struct rtl8169_private *tp) {RTL_W8 (tp, Config3,RTL_R8 (tp, Config3) | Jumbo_En0);RTL_W8 (tp, Config4,RTL_R8 (tp, Config4) | Jumbo_En1); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_512B ); }static void r8168c_hw_jumbo_disable (struct rtl8169_private *tp) {RTL_W8 (tp, Config3,RTL_R8 (tp, Config3) & ~Jumbo_En0);RTL_W8 (tp, Config4,RTL_R8 (tp, Config4) & ~Jumbo_En1); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); }static void r8168dp_hw_jumbo_enable (struct rtl8169_private *tp)
@@ -4082,7 +4074,6 @@ static void r8168e_hw_jumbo_enable(struct rtl8169_private *tp)RTL_W8 (tp, MaxTxPacketSize,0x24 );RTL_W8 (tp, Config3,RTL_R8 (tp, Config3) | Jumbo_En0);RTL_W8 (tp, Config4,RTL_R8 (tp, Config4) |0x01 ); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_512B ); }static void r8168e_hw_jumbo_disable (struct rtl8169_private *tp)
@@ -4090,19 +4081,18 @@ static void r8168e_hw_jumbo_disable(struct rtl8169_private *tp)RTL_W8 (tp, MaxTxPacketSize,0x3f );RTL_W8 (tp, Config3,RTL_R8 (tp, Config3) & ~Jumbo_En0);RTL_W8 (tp, Config4,RTL_R8 (tp, Config4) & ~0x01 ); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); }static void r8168b_0_hw_jumbo_enable (struct rtl8169_private *tp) { -rtl_tx_performance_tweak (tp, -PCI_EXP_DEVCTL_READRQ_512B |PCI_EXP_DEVCTL_NOSNOOP_EN ); +pcie_capability_set_word (tp->pci_dev,PCI_EXP_DEVCTL , +PCI_EXP_DEVCTL_NOSNOOP_EN ); }static void r8168b_0_hw_jumbo_disable (struct rtl8169_private *tp) { -rtl_tx_performance_tweak (tp, -PCI_EXP_DEVCTL_READRQ_4096B |PCI_EXP_DEVCTL_NOSNOOP_EN ); +pcie_capability_set_word (tp->pci_dev,PCI_EXP_DEVCTL , +PCI_EXP_DEVCTL_NOSNOOP_EN ); }static void r8168b_1_hw_jumbo_enable (struct rtl8169_private *tp)
@@ -4575,18 +4565,12 @@ static void rtl_hw_start_8168d(struct rtl8169_private *tp)rtl_set_def_aspm_entry_latency (tp);rtl_disable_clock_request (tp); - -if (tp->dev->mtu <=ETH_DATA_LEN ) -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); }static void rtl_hw_start_8168dp (struct rtl8169_private *tp) {rtl_set_def_aspm_entry_latency (tp); -if (tp->dev->mtu <=ETH_DATA_LEN ) -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); -rtl_disable_clock_request (tp); }
@@ -4601,8 +4585,6 @@ static void rtl_hw_start_8168d_4(struct rtl8169_private *tp)rtl_set_def_aspm_entry_latency (tp); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); -rtl_ephy_init (tp, e_info_8168d_4);rtl_enable_clock_request (tp);
@@ -4677,8 +4659,6 @@ static void rtl_hw_start_8168f(struct rtl8169_private *tp) {rtl_set_def_aspm_entry_latency (tp); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); -rtl_eri_write (tp,0xc0 ,ERIAR_MASK_0011 ,0x0000 );rtl_eri_write (tp,0xb8 ,ERIAR_MASK_0011 ,0x0000 );rtl_set_fifo_size (tp,0x10 ,0x10 ,0x02 ,0x06 );
@@ -4741,8 +4721,6 @@ static void rtl_hw_start_8168g(struct rtl8169_private *tp)rtl_set_def_aspm_entry_latency (tp); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); -rtl_reset_packet_filter (tp);rtl_eri_write (tp,0x2f8 ,ERIAR_MASK_0011 ,0x1d8f );
@@ -4979,8 +4957,6 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)rtl_set_def_aspm_entry_latency (tp); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); -rtl_reset_packet_filter (tp);rtl_eri_set_bits (tp,0xdc ,ERIAR_MASK_1111 ,BIT (4 ));
@@ -5038,8 +5014,6 @@ static void rtl_hw_start_8168ep(struct rtl8169_private *tp)rtl_set_def_aspm_entry_latency (tp); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); -rtl_reset_packet_filter (tp);rtl_eri_set_bits (tp,0xd4 ,ERIAR_MASK_1111 ,0x1f80 );
@@ -5142,8 +5116,6 @@ static void rtl_hw_start_8102e_1(struct rtl8169_private *tp)RTL_W8 (tp,DBG_REG ,FIX_NAK_1 ); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); -RTL_W8 (tp, Config1,LEDS1 |LEDS0 | Speed_down |MEMMAP |IOMAP |VPD | PMEnable);RTL_W8 (tp, Config3,RTL_R8 (tp, Config3) & ~Beacon_en);
@@ -5159,8 +5131,6 @@ static void rtl_hw_start_8102e_2(struct rtl8169_private *tp) {rtl_set_def_aspm_entry_latency (tp); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); -RTL_W8 (tp, Config1,MEMMAP |IOMAP |VPD | PMEnable);RTL_W8 (tp, Config3,RTL_R8 (tp, Config3) & ~Beacon_en); }
@@ -5221,8 +5191,6 @@ static void rtl_hw_start_8402(struct rtl8169_private *tp)rtl_ephy_init (tp, e_info_8402); -rtl_tx_performance_tweak (tp,PCI_EXP_DEVCTL_READRQ_4096B ); -rtl_set_fifo_size (tp,0x00 ,0x00 ,0x02 ,0x06 );rtl_reset_packet_filter (tp);rtl_eri_write (tp,0xc0 ,ERIAR_MASK_0011 ,0x0000 );
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 67/73 r8169: simplify setting PCI_EXP_DEVCTL_NOSNOOP_EN
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
[ Upstream commit e0bbe7cbb3c5ff72d680993edf89db2391e80d5d ]
r8168b_0_hw_jumbo_enable() and r8168b_0_hw_jumbo_disable() both do the same and just set PCI_EXP_DEVCTL_NOSNOOP_EN. We can simplify the code by moving this setting for RTL8168B to rtl_hw_start_8168().
--- drivers/net/ethernet/realtek/r8169_main.c | 34 +++++++---------------- 1 file changed, 10 insertions(+), 24 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +10 -24
@@ -4083,29 +4083,13 @@ static void r8168e_hw_jumbo_disable(struct rtl8169_private *tp)RTL_W8 (tp, Config4,RTL_R8 (tp, Config4) & ~0x01 ); } -static void r8168b_0_hw_jumbo_enable (struct rtl8169_private *tp) -{ -pcie_capability_set_word (tp->pci_dev,PCI_EXP_DEVCTL , -PCI_EXP_DEVCTL_NOSNOOP_EN ); -} - -static void r8168b_0_hw_jumbo_disable (struct rtl8169_private *tp) -{ -pcie_capability_set_word (tp->pci_dev,PCI_EXP_DEVCTL , -PCI_EXP_DEVCTL_NOSNOOP_EN ); -} -static void r8168b_1_hw_jumbo_enable (struct rtl8169_private *tp) { -r8168b_0_hw_jumbo_enable (tp); -RTL_W8 (tp, Config4,RTL_R8 (tp, Config4) | (1 <<0 )); }static void r8168b_1_hw_jumbo_disable (struct rtl8169_private *tp) { -r8168b_0_hw_jumbo_disable (tp); -RTL_W8 (tp, Config4,RTL_R8 (tp, Config4) & ~(1 <<0 )); }
@@ -4113,9 +4097,6 @@ static void rtl_hw_jumbo_enable(struct rtl8169_private *tp) {rtl_unlock_config_regs (tp);switch (tp->mac_version) { -case RTL_GIGA_MAC_VER_11 : -r8168b_0_hw_jumbo_enable (tp); -break ;case RTL_GIGA_MAC_VER_12 :case RTL_GIGA_MAC_VER_17 :r8168b_1_hw_jumbo_enable (tp);
@@ -4139,9 +4120,6 @@ static void rtl_hw_jumbo_disable(struct rtl8169_private *tp) {rtl_unlock_config_regs (tp);switch (tp->mac_version) { -case RTL_GIGA_MAC_VER_11 : -r8168b_0_hw_jumbo_disable (tp); -break ;case RTL_GIGA_MAC_VER_12 :case RTL_GIGA_MAC_VER_17 :r8168b_1_hw_jumbo_disable (tp);
@@ -5406,10 +5384,18 @@ static void rtl_hw_start_8125(struct rtl8169_private *tp)static void rtl_hw_start_8168 (struct rtl8169_private *tp) { -if (tp->mac_version ==RTL_GIGA_MAC_VER_13 || - tp->mac_version ==RTL_GIGA_MAC_VER_16 ) +switch (tp->mac_version) { +case RTL_GIGA_MAC_VER_11 : +case RTL_GIGA_MAC_VER_12 : +case RTL_GIGA_MAC_VER_13 : +case RTL_GIGA_MAC_VER_16 : +case RTL_GIGA_MAC_VER_17 :pcie_capability_set_word (tp->pci_dev,PCI_EXP_DEVCTL ,PCI_EXP_DEVCTL_NOSNOOP_EN ); +break ; +default : +break ; + }if (rtl_is_8168evl_up (tp))RTL_W8 (tp, MaxTxPacketSize, EarlySize);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 68/73 r8169: fix performance regression related to PCIe max read request size
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
[ Upstream commit 21b5f672fb2eb1366dedc4ac9d32431146b378d3 ]
It turned out that on low performance systems the original change can cause lower tx performance. On a N3450-based mini-PC tx performance in iperf3 was reduced from 950Mbps to ~900Mbps. Therefore effectively revert the original change, just use pcie_set_readrq() now instead of changing the PCIe capability register directly.
--- drivers/net/ethernet/realtek/r8169_main.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/realtek/r8169_main.c +6 -0
@@ -4099,15 +4099,18 @@ static void rtl_hw_jumbo_enable(struct rtl8169_private *tp)switch (tp->mac_version) {case RTL_GIGA_MAC_VER_12 :case RTL_GIGA_MAC_VER_17 : +pcie_set_readrq (tp->pci_dev,512 );r8168b_1_hw_jumbo_enable (tp);break ; case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_26: +pcie_set_readrq (tp->pci_dev,512 );r8168c_hw_jumbo_enable (tp);break ; case RTL_GIGA_MAC_VER_27 ... RTL_GIGA_MAC_VER_28:r8168dp_hw_jumbo_enable (tp);break ; case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_33: +pcie_set_readrq (tp->pci_dev,512 );r8168e_hw_jumbo_enable (tp);break ;default :
@@ -4137,6 +4140,9 @@ static void rtl_hw_jumbo_disable(struct rtl8169_private *tp)break ; }rtl_lock_config_regs (tp); + +if (pci_is_pcie (tp->pci_dev) && tp->supports_gmii) +pcie_set_readrq (tp->pci_dev,4096 ); }static void rtl_jumbo_config (struct rtl8169_private *tp,int mtu)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 69/73 r8169: improve rtl_jumbo_config
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
[ Upstream commit 9db0ac57bd3286fedcf43a86b29b847cea281cc7 ]
Merge enabling and disabling jumbo packets to one function to make the code a little simpler.
--- drivers/net/ethernet/realtek/r8169_main.c | 69 +++++++++-------------- 1 file changed, 27 insertions(+), 42 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +27 -42
@@ -4093,66 +4093,52 @@ static void r8168b_1_hw_jumbo_disable(struct rtl8169_private *tp)RTL_W8 (tp, Config4,RTL_R8 (tp, Config4) & ~(1 <<0 )); } -static void rtl_hw_jumbo_enable (struct rtl8169_private *tp) +static void rtl_jumbo_config (struct rtl8169_private *tp) { -rtl_unlock_config_regs (tp); -switch (tp->mac_version) { -case RTL_GIGA_MAC_VER_12 : -case RTL_GIGA_MAC_VER_17 : -pcie_set_readrq (tp->pci_dev,512 ); -r8168b_1_hw_jumbo_enable (tp); -break ; - case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_26: -pcie_set_readrq (tp->pci_dev,512 ); -r8168c_hw_jumbo_enable (tp); -break ; - case RTL_GIGA_MAC_VER_27 ... RTL_GIGA_MAC_VER_28: -r8168dp_hw_jumbo_enable (tp); -break ; - case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_33: -pcie_set_readrq (tp->pci_dev,512 ); -r8168e_hw_jumbo_enable (tp); -break ; -default : -break ; - } -rtl_lock_config_regs (tp); -} +bool jumbo = tp->dev->mtu >ETH_DATA_LEN ; -static void rtl_hw_jumbo_disable (struct rtl8169_private *tp) -{rtl_unlock_config_regs (tp);switch (tp->mac_version) {case RTL_GIGA_MAC_VER_12 :case RTL_GIGA_MAC_VER_17 : -r8168b_1_hw_jumbo_disable (tp); +if (jumbo) { +pcie_set_readrq (tp->pci_dev,512 ); +r8168b_1_hw_jumbo_enable (tp); + }else { +r8168b_1_hw_jumbo_disable (tp); + }break ; case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_26: -r8168c_hw_jumbo_disable (tp); +if (jumbo) { +pcie_set_readrq (tp->pci_dev,512 ); +r8168c_hw_jumbo_enable (tp); + }else { +r8168c_hw_jumbo_disable (tp); + }break ; case RTL_GIGA_MAC_VER_27 ... RTL_GIGA_MAC_VER_28: -r8168dp_hw_jumbo_disable (tp); +if (jumbo) +r8168dp_hw_jumbo_enable (tp); +else +r8168dp_hw_jumbo_disable (tp);break ; case RTL_GIGA_MAC_VER_31 ... RTL_GIGA_MAC_VER_33: -r8168e_hw_jumbo_disable (tp); +if (jumbo) { +pcie_set_readrq (tp->pci_dev,512 ); +r8168e_hw_jumbo_enable (tp); + }else { +r8168e_hw_jumbo_disable (tp); + }break ;default :break ; }rtl_lock_config_regs (tp); -if (pci_is_pcie (tp->pci_dev) && tp->supports_gmii) +if (!jumbo &&pci_is_pcie (tp->pci_dev) && tp->supports_gmii)pcie_set_readrq (tp->pci_dev,4096 ); } -static void rtl_jumbo_config (struct rtl8169_private *tp,int mtu) -{ -if (mtu >ETH_DATA_LEN ) -rtl_hw_jumbo_enable (tp); -else -rtl_hw_jumbo_disable (tp); -} -DECLARE_RTL_COND (rtl_chipcmd_cond) {return RTL_R8 (tp, ChipCmd) & CmdReset;
@@ -5458,7 +5444,7 @@ static void rtl_hw_start(struct rtl8169_private *tp)rtl_set_rx_tx_desc_registers (tp);rtl_lock_config_regs (tp); -rtl_jumbo_config (tp, tp->dev->mtu); +rtl_jumbo_config (tp);/* Initially a 10 us delay. Turned it into a PCI commit. - FR */ RTL_R16 (tp, CPlusCmd);
@@ -5473,10 +5459,9 @@ static int rtl8169_change_mtu(struct net_device *dev, int new_mtu) {struct rtl8169_private *tp =netdev_priv (dev); -rtl_jumbo_config (tp, new_mtu); - dev->mtu = new_mtu;netdev_update_features (dev); +rtl_jumbo_config (tp);/* Reportedly at least Asus X453MA truncates packets otherwise */ if (tp->mac_version ==RTL_GIGA_MAC_VER_37 )
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 70/73 r8169: tweak max read request size for newer chips also in jumbo mtu mode
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
[ Upstream commit 5e00e16cb98935bcf06f51931876d898c226f65c ]
So far we don't increase the max read request size if we switch to jumbo mode before bringing up the interface for the first time. Let's change this.
--- drivers/net/ethernet/realtek/r8169_main.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +5 -4
@@ -4096,13 +4096,14 @@ static void r8168b_1_hw_jumbo_disable(struct rtl8169_private *tp)static void rtl_jumbo_config (struct rtl8169_private *tp) {bool jumbo = tp->dev->mtu >ETH_DATA_LEN ; +int readrq =4096 ;rtl_unlock_config_regs (tp);switch (tp->mac_version) {case RTL_GIGA_MAC_VER_12 :case RTL_GIGA_MAC_VER_17 :if (jumbo) { -pcie_set_readrq (tp->pci_dev,512 ); + readrq =512 ;r8168b_1_hw_jumbo_enable (tp); }else {r8168b_1_hw_jumbo_disable (tp);
@@ -4110,7 +4111,7 @@ static void rtl_jumbo_config(struct rtl8169_private *tp)break ; case RTL_GIGA_MAC_VER_18 ... RTL_GIGA_MAC_VER_26:if (jumbo) { -pcie_set_readrq (tp->pci_dev,512 ); + readrq =512 ;r8168c_hw_jumbo_enable (tp); }else {r8168c_hw_jumbo_disable (tp);
@@ -4135,8 +4136,8 @@ static void rtl_jumbo_config(struct rtl8169_private *tp) }rtl_lock_config_regs (tp); -if (!jumbo &&pci_is_pcie (tp->pci_dev) && tp->supports_gmii) -pcie_set_readrq (tp->pci_dev,4096 ); +if (pci_is_pcie (tp->pci_dev) && tp->supports_gmii) +pcie_set_readrq (tp->pci_dev, readrq); }DECLARE_RTL_COND (rtl_chipcmd_cond)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 71/73 r8169: dont advertise pause in jumbo mode
In reply to Greg Kroah-HartmanFrom: Heiner Kallweit <[email protected]>
[ Upstream commit 453a77894efa4d9b6ef9644d74b9419c47ac427c ]
It has been reported [0] that using pause frames in jumbo mode impacts performance. There's no available chip documentation, but vendor drivers r8168 and r8125 don't advertise pause in jumbo mode. So let's do the same, according to Roman it fixes the issue.
[0] https://bugzilla.kernel.org/show_bug.cgi?id=212617
--- drivers/net/ethernet/realtek/r8169_main.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/net/ethernet/realtek/r8169_main.c +7 -2
@@ -4138,6 +4138,13 @@ static void rtl_jumbo_config(struct rtl8169_private *tp)if (pci_is_pcie (tp->pci_dev) && tp->supports_gmii)pcie_set_readrq (tp->pci_dev, readrq); + +/* Chip doesn't support pause in jumbo mode */ +linkmode_mod_bit (ETHTOOL_LINK_MODE_Pause_BIT, + tp->phydev->advertising, !jumbo); +linkmode_mod_bit (ETHTOOL_LINK_MODE_Asym_Pause_BIT, + tp->phydev->advertising, !jumbo); +phy_start_aneg (tp->phydev); }DECLARE_RTL_COND (rtl_chipcmd_cond)
@@ -6314,8 +6321,6 @@ static int r8169_phy_connect(struct rtl8169_private *tp)if (!tp->supports_gmii)phy_set_max_speed (phydev,SPEED_100 ); -phy_support_asym_pause (phydev); -phy_attached_info (phydev);return 0 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 72/73 ARM: 9071/1: uprobes: Dont hook on thumb instructions
In reply to Greg Kroah-HartmanFrom: Fredrik Strupe <[email protected]>
commit d2f7eca60b29006285d57c7035539e33300e89e5 upstream.
Since uprobes is not supported for thumb, check that the thumb bit is not set when matching the uprobes instruction hooks.
The Arm UDF instructions used for uprobes triggering (UPROBE_SWBP_ARM_INSN and UPROBE_SS_ARM_INSN) coincidentally share the same encoding as a pair of unallocated 32-bit thumb instructions (not UDF) when the condition code is 0b1111 (0xf). This in effect makes it possible to trigger the uprobes functionality from thumb, and at that using two unallocated instructions which are not permanently undefined.
--- arch/arm/probes/uprobes/core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/probes/uprobes/core.c +2 -2
@@ -204,7 +204,7 @@ unsigned long uprobe_get_swbp_addr(strucstatic struct undef_hook uprobes_arm_break_hook = { .instr_mask =0x0fffffff , .instr_val = (UPROBE_SWBP_ARM_INSN &0x0fffffff ), - .cpsr_mask =MODE_MASK , + .cpsr_mask = (PSR_T_BIT |MODE_MASK ), .cpsr_val =USR_MODE , .fn = uprobe_trap_handler, };
@@ -212,7 +212,7 @@ static struct undef_hook uprobes_arm_brestatic struct undef_hook uprobes_arm_ss_hook = { .instr_mask =0x0fffffff , .instr_val = (UPROBE_SS_ARM_INSN &0x0fffffff ), - .cpsr_mask =MODE_MASK , + .cpsr_mask = (PSR_T_BIT |MODE_MASK ), .cpsr_val =USR_MODE , .fn = uprobe_trap_handler, };
Greg Kroah-Hartman
maintainerPATCH 73/73 net: phy: marvell: fix detection of PHY on Topaz switches
In reply to Greg Kroah-HartmanFrom: Pali Rohár <[email protected]>
commit 1fe976d308acb6374c899a4ee8025a0a016e453e upstream.
Since commit fee2d546414d ("net: phy: marvell: mv88e6390 temperature sensor reading"), Linux reports the temperature of Topaz hwmon as constant -75°C.
This is because switches from the Topaz family (88E6141 / 88E6341) have the address of the temperature sensor register different from Peridot.
This address is instead compatible with 88E1510 PHYs, as was used for Topaz before the above mentioned commit.
Create a new mapping table between switch family and PHY ID for families which don't have a model number. And define PHY IDs for Topaz and Peridot families.
Create a new PHY ID and a new PHY driver for Topaz's internal PHY. The only difference from Peridot's PHY driver is the HWMON probing method.
Prior this change Topaz's internal PHY is detected by kernel as:
PHY [...] driver [Marvell 88E6390] (irq=63)
And afterwards as:
PHY [...] driver [Marvell 88E6341 Family] (irq=63)
--- drivers/net/dsa/mv88e6xxx/chip.c | 30 +++++++++++++----------------- drivers/net/phy/marvell.c | 29 ++++++++++++++++++++++++++--- include/linux/marvell_phy.h | 5 +++-- 3 files changed, 42 insertions(+), 22 deletions(-)
drivers/net/dsa/mv88e6xxx/chip.c +13 -17
@@ -2766,10 +2766,17 @@ unlock:return err; } +/* prod_id for switch families which do not have a PHY model number */ +static const u16 family_prod_id_table[] = { + [MV88E6XXX_FAMILY_6341 ] =MV88E6XXX_PORT_SWITCH_ID_PROD_6341 , + [MV88E6XXX_FAMILY_6390 ] =MV88E6XXX_PORT_SWITCH_ID_PROD_6390 , +}; +static int mv88e6xxx_mdio_read (struct mii_bus *bus,int phy,int reg) {struct mv88e6xxx_mdio_bus *mdio_bus = bus->priv;struct mv88e6xxx_chip *chip = mdio_bus->chip; +u16 prod_id;u16 val;int err;
@@ -2780,23 +2787,12 @@ static int mv88e6xxx_mdio_read(struct mi err = chip->info->ops->phy_read (chip, bus, phy, reg, &val);mv88e6xxx_reg_unlock (chip); -if (reg ==MII_PHYSID2 ) { -/* Some internal PHYs don't have a model number. */ -if (chip->info->family !=MV88E6XXX_FAMILY_6165 ) -/* Then there is the 6165 family. It gets is -* PHYs correct. But it can also have two -* SERDES interfaces in the PHY address -* space. And these don't have a model -* number. But they are not PHYs, so we don't -* want to give them something a PHY driver -* will recognise. -* -* Use the mv88e6390 family model number -* instead, for anything which really could be -* a PHY, -*/ -if (!(val &0x3f0 )) - val |=MV88E6XXX_PORT_SWITCH_ID_PROD_6390 >>4 ; +/* Some internal PHYs don't have a model number. */ +if (reg ==MII_PHYSID2 && !(val &0x3f0 ) && + chip->info->family <ARRAY_SIZE (family_prod_id_table)) { + prod_id = family_prod_id_table[chip->info->family]; +if (prod_id) + val |= prod_id >>4 ; }return err ? err : val;
drivers/net/phy/marvell.c +26 -3
@@ -2401,9 +2401,31 @@ static struct phy_driver marvell_drivers .get_stats = marvell_get_stats, }, { - .phy_id = MARVELL_PHY_ID_88E6390, + .phy_id = MARVELL_PHY_ID_88E6341_FAMILY, .phy_id_mask = MARVELL_PHY_ID_MASK, - .name = "Marvell 88E6390", + .name = "Marvell 88E6341 Family", +/* PHY_GBIT_FEATURES */ + .probe = m88e1510_probe, + .config_init = &marvell_config_init, + .config_aneg = &m88e6390_config_aneg, + .read_status = &marvell_read_status, + .ack_interrupt = &marvell_ack_interrupt, + .config_intr = &marvell_config_intr, + .did_interrupt = &m88e1121_did_interrupt, + .resume = &genphy_resume, + .suspend = &genphy_suspend, + .read_page = marvell_read_page, + .write_page = marvell_write_page, + .get_sset_count = marvell_get_sset_count, + .get_strings = marvell_get_strings, + .get_stats = marvell_get_stats, + .get_tunable = m88e1540_get_tunable, + .set_tunable = m88e1540_set_tunable, + }, + { + .phy_id = MARVELL_PHY_ID_88E6390_FAMILY, + .phy_id_mask = MARVELL_PHY_ID_MASK, + .name = "Marvell 88E6390 Family",/* PHY_GBIT_FEATURES */ .probe = m88e6390_probe, .config_init = &marvell_config_init,
@@ -2441,7 +2463,8 @@ static struct mdio_device_id __maybe_unu { MARVELL_PHY_ID_88E1540, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E1545, MARVELL_PHY_ID_MASK }, { MARVELL_PHY_ID_88E3016, MARVELL_PHY_ID_MASK }, - { MARVELL_PHY_ID_88E6390, MARVELL_PHY_ID_MASK }, + { MARVELL_PHY_ID_88E6341_FAMILY, MARVELL_PHY_ID_MASK }, + { MARVELL_PHY_ID_88E6390_FAMILY, MARVELL_PHY_ID_MASK }, { } };
include/linux/marvell_phy.h +3 -2
@@ -23,11 +23,12 @@#define MARVELL_PHY_ID_88X3310 0x002b09a0#define MARVELL_PHY_ID_88E2110 0x002b09b0 -/* The MV88e6390 Ethernet switch contains embedded PHYs. These PHYs do +/* These Ethernet switch families contain embedded PHYs, but they do * not have a model ID. So the switch driver traps reads to the ID2 * register and returns the switch family ID */ -#define MARVELL_PHY_ID_88E6390 0x01410f90 +#define MARVELL_PHY_ID_88E6341_FAMILY 0x01410f41 +#define MARVELL_PHY_ID_88E6390_FAMILY 0x01410f90#define MARVELL_PHY_FAMILY_ID (id) ((id) >> 4)
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.114 release. There are 73 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 Wed, 21 Apr 2021 13:05:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.114-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB, using 32-bit and 64-bit ARM kernels:
Signature · 1 line
Florian
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.114 release. There are 73 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 Wed, 21 Apr 2021 13:05:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.114-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Compiled and booted on my test system. No dmesg regressions.
thanks,
-- Shuah
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.114 release. There are 73 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 Wed, 21 Apr 2021 13:05:09 +0000. Anything received after that time might be too late.
Build results:
total: 157 pass: 157 fail: 0 Qemu test results: total: 433 pass: 433 fail: 0
Guenter
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.114 release. There are 73 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 Wed, 21 Apr 2021 13:05:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.114-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
All tests passing for Tegra ...
Test results for stable-v5.4:
12 builds: 12 pass, 0 fail
26 boots: 26 pass, 0 fail
59 tests: 59 pass, 0 failLinux version: 5.4.114-rc1-gc509b45704fd
Boards tested: tegra124-jetson-tk1, tegra186-p2771-0000,
tegra194-p2972-0000, tegra20-ventana,
tegra210-p2371-2180, tegra210-p3450-0000,
tegra30-cardhu-a04Jon
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.114 release. There are 73 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 Wed, 21 Apr 2021 13:05:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.114-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
NOTE:
The following kernel crash reported on arm64 hikey device running stable-rc 5.4.114-rc1 kernel and testing LTP thp04 test case.
but not reproducible. please find more details in the below link, So this is not considered as real regression.
thp04: page allocation failure: order:0, mode:0x400dc0(GFP_KERNEL_ACCOUNT|__GFP_ZERO), nodemask=(null)
Unable to handle kernel paging request at virtual address 0000000000001540 ,cpuset=/,mems_allowed=0 Unable to handle kernel paging request at virtual address 0000000000001540
## Build
* kernel: 5.4.114-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git branch: linux-5.4.y
* git commit: c509b45704fd663fc59405e98d29d7f06eaae4b5
* git describe: v5.4.113-74-gc509b45704fd
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.4.y/build/v5.4.113-74-gc509b45704fd
## No regressions (compared to v5.4.113-49-g56028094045b)
## No fixes (compared to v5.4.113-49-g56028094045b)
## Test result summary
total: 64147, pass: 53600, fail: 638, skip: 9689, xfail: 220,
## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 191 total, 191 passed, 0 failed
* arm64: 25 total, 25 passed, 0 failed
* dragonboard-410c: 1 total, 1 passed, 0 failed
* hi6220-hikey: 1 total, 1 passed, 0 failed
* i386: 14 total, 14 passed, 0 failed
* juno-r2: 1 total, 1 passed, 0 failed
* mips: 45 total, 45 passed, 0 failed
* parisc: 9 total, 9 passed, 0 failed
* powerpc: 27 total, 27 passed, 0 failed
* riscv: 21 total, 21 passed, 0 failed
* s390: 9 total, 9 passed, 0 failed
* sh: 18 total, 18 passed, 0 failed
* sparc: 9 total, 9 passed, 0 failed
* x15: 1 total, 1 passed, 0 failed
* x86: 1 total, 1 passed, 0 failed
* x86_64: 25 total, 25 passed, 0 failed
## Test suites summary
* fwts
* igt-gpu-tools
* install-android-platform-tools-r2600
* kselftest-android
* kselftest-bpf
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kexec
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-lkdtm
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-tc-testing
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-x86
* kselftest-zram
* kvm-unit-tests
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-open-posix-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* network-basic-tests
* perf
* rcutorture
* ssuite
* v4l2-compliance
--
Linaro LKFT
https://lkft.linaro.org
Hi Greg,
Quoted 7 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.114 release. There are 73 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 Wed, 21 Apr 2021 13:05:09 +0000. Anything received after that time might be too late.
Build test:
mips (gcc version 10.3.1 20210416): 65 configs -> no new failure arm (gcc version 10.3.1 20210416): 107 configs -> no new failure x86_64 (gcc version 10.2.1 20210110): 2 configs -> no failure
Boot test:x86_64: Booted on my test laptop. No regression.x86_64: Booted on qemu. No regression.
arm: Booted on rpi3b. No regression.
--
Regards
Sudip
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.4.114 release. There are 73 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 Wed, 21 Apr 2021 13:05:09 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.114-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.4.y
and the diffstat can be found below.thanks,
greg k-h
Tested on arm64 and x86 for 5.4.114-rc1,
Kernel repo:
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
Branch: linux-5.4.y
Version: 5.4.114-rc1
Commit: c509b45704fd663fc59405e98d29d7f06eaae4b5
Compiler: gcc version 7.3.0 (GCC)
arm64:
--------------------------------------------------------------------
Testcase Result Summary:
total: 5764
passed: 5764
failed: 0
timeout: 0
--------------------------------------------------------------------
x86:
--------------------------------------------------------------------
Testcase Result Summary:
total: 5764
passed: 5764
failed: 0
timeout: 0
--------------------------------------------------------------------