bnxt_en: reinitialize IRQs when MTU is modified
Subsystems (5)
Sasha Levin
maintainerPATCH 1/12 bnxt_en: reinitialize IRQs when MTU is modified
From: Vasundhara Volam <[email protected]>
[ Upstream commit a9b952d267e59a3b405e644930f46d252cea7122 ]
MTU changes may affect the number of IRQs so we must call bnxt_close_nic()/bnxt_open_nic() with the irq_re_init parameter set to true. The reason is that a larger MTU may require aggregation rings not needed with smaller MTU. We may not be able to allocate the required number of aggregation rings and so we reduce the number of channels which will change the number of IRQs. Without this patch, it may crash eventually in pci_disable_msix() when the IRQs are not properly unwound.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -2
@@ -5310,13 +5310,13 @@ static int bnxt_change_mtu(struct net_device *dev, int new_mtu)return -EINVAL ;if (netif_running (dev)) -bnxt_close_nic (bp, false, false); +bnxt_close_nic (bp, true, false); dev->mtu = new_mtu;bnxt_set_ring_params (bp);if (netif_running (dev)) -return bnxt_open_nic (bp, false, false); +return bnxt_open_nic (bp, true, false);return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 2/12 cpupower: avoid multiple definition with gcc -fno-common
From: Mike Gilbert <[email protected]>
[ Upstream commit 2de7fb60a4740135e03cf55c1982e393ccb87b6b ]
Building cpupower with -fno-common in CFLAGS results in errors due to multiple definitions of the 'cpu_count' and 'start_time' variables.
./utils/idle_monitor/snb_idle.o:./utils/idle_monitor/cpupower-monitor.h:28:
multiple definition of `cpu_count'; ./utils/idle_monitor/nhm_idle.o:./utils/idle_monitor/cpupower-monitor.h:28:
first defined here
...
./utils/idle_monitor/cpuidle_sysfs.o:./utils/idle_monitor/cpuidle_sysfs.c:22:
multiple definition of `start_time'; ./utils/idle_monitor/amd_fam14h_idle.o:./utils/idle_monitor/amd_fam14h_idle.c:85:
first defined here
The -fno-common option will be enabled by default in GCC 10.
--- tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c | 2 +- tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c | 2 +- tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c | 2 ++ tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h | 2 +- 4 files changed, 5 insertions(+), 3 deletions(-)
tools/power/cpupower/utils/idle_monitor/amd_fam14h_idle.c +1 -1
@@ -83,7 +83,7 @@ static struct pci_access *pci_acc;static struct pci_dev *amd_fam14h_pci_dev;static int nbp1_entered; -struct timespec start_time; +static struct timespec start_time;static unsigned long long timediff;#ifdef DEBUG
tools/power/cpupower/utils/idle_monitor/cpuidle_sysfs.c +1 -1
@@ -21,7 +21,7 @@ struct cpuidle_monitor cpuidle_sysfs_monitor;static unsigned long long **previous_count;static unsigned long long **current_count; -struct timespec start_time; +static struct timespec start_time;static unsigned long long timediff; static int cpuidle_get_count_percent(unsigned int id, double *percent,
tools/power/cpupower/utils/idle_monitor/cpupower-monitor.c +2 -0
@@ -29,6 +29,8 @@ struct cpuidle_monitor *all_monitors[] = { 0 }; +int cpu_count; +static struct cpuidle_monitor *monitors[MONITORS_MAX ];static unsigned int avail_monitors;
tools/power/cpupower/utils/idle_monitor/cpupower-monitor.h +1 -1
@@ -18,7 +18,7 @@#define CSTATE_NAME_LEN 5#define CSTATE_DESC_LEN 60 -int cpu_count; +extern int cpu_count;/* Hard to define the right names ...: */ enum power_range_e {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 3/12 fib: add missing attribute validation for tun_id
In reply to Sasha LevinFrom: Jakub Kicinski <[email protected]>
[ Upstream commit 4c16d64ea04056f1b1b324ab6916019f6a064114 ]
Add missing netlink policy entry for FRA_TUN_ID.
--- include/net/fib_rules.h | 1 + 1 file changed, 1 insertion(+)
include/net/fib_rules.h +1 -0
@@ -85,6 +85,7 @@ struct fib_rules_ops { [FRA_OIFNAME] = { .type = NLA_STRING, .len = IFNAMSIZ - 1 }, \ [FRA_PRIORITY] = { .type = NLA_U32 }, \ [FRA_FWMARK] = { .type = NLA_U32 }, \ + [FRA_TUN_ID] = { .type = NLA_U64 }, \ [FRA_FWMASK] = { .type = NLA_U32 }, \ [FRA_TABLE] = { .type = NLA_U32 }, \ [FRA_SUPPRESS_PREFIXLEN] = { .type = NLA_U32 }, \
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 4/12 team: add missing attribute validation for port ifindex
In reply to Sasha LevinFrom: Jakub Kicinski <[email protected]>
[ Upstream commit dd25cb272ccce4db67dc8509278229099e4f5e99 ]
Add missing attribute validation for TEAM_ATTR_OPTION_PORT_IFINDEX to the netlink policy.
--- drivers/net/team/team.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/team/team.c +1 -0
@@ -2169,6 +2169,7 @@ team_nl_option_policy[TEAM_ATTR_OPTION_MAX + 1] = { [TEAM_ATTR_OPTION_CHANGED] = { .type = NLA_FLAG }, [TEAM_ATTR_OPTION_TYPE] = { .type = NLA_U8 }, [TEAM_ATTR_OPTION_DATA] = { .type = NLA_BINARY }, + [TEAM_ATTR_OPTION_PORT_IFINDEX] = { .type = NLA_U32 }, };static int team_nl_cmd_noop (struct sk_buff *skb,struct genl_info *info)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 5/12 team: add missing attribute validation for array index
In reply to Sasha LevinFrom: Jakub Kicinski <[email protected]>
[ Upstream commit 669fcd7795900cd1880237cbbb57a7db66cb9ac8 ]
Add missing attribute validation for TEAM_ATTR_OPTION_ARRAY_INDEX to the netlink policy.
--- drivers/net/team/team.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/team/team.c +1 -0
@@ -2170,6 +2170,7 @@ team_nl_option_policy[TEAM_ATTR_OPTION_MAX + 1] = { [TEAM_ATTR_OPTION_TYPE] = { .type = NLA_U8 }, [TEAM_ATTR_OPTION_DATA] = { .type = NLA_BINARY }, [TEAM_ATTR_OPTION_PORT_IFINDEX] = { .type = NLA_U32 }, + [TEAM_ATTR_OPTION_ARRAY_INDEX] = { .type = NLA_U32 }, };static int team_nl_cmd_noop (struct sk_buff *skb,struct genl_info *info)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 6/12 netfilter: cthelper: add missing attribute validation for cthelper
In reply to Sasha LevinFrom: Jakub Kicinski <[email protected]>
[ Upstream commit c049b3450072b8e3998053490e025839fecfef31 ]
Add missing attribute validation for cthelper
to the netlink policy.
--- net/netfilter/nfnetlink_cthelper.c | 2 ++ 1 file changed, 2 insertions(+)
net/netfilter/nfnetlink_cthelper.c +2 -0
@@ -711,6 +711,8 @@ static const struct nla_policy nfnl_cthelper_policy[NFCTH_MAX+1] = { [NFCTH_NAME ] = { .type =NLA_NUL_STRING , .len = NF_CT_HELPER_NAME_LEN-1 }, [NFCTH_QUEUE_NUM] = { .type = NLA_U32, }, + [NFCTH_PRIV_DATA_LEN] = { .type = NLA_U32, }, + [NFCTH_STATUS] = { .type = NLA_U32, }, };static const struct nfnl_callback nfnl_cthelper_cb[NFNL_MSG_CTHELPER_MAX ] = {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 7/12 dt-bindings: net: FMan erratum A050385
In reply to Sasha LevinFrom: Madalin Bucur <[email protected]>
[ Upstream commit 26d5bb9e4c4b541c475751e015072eb2cbf70d15 ]
FMAN DMA read or writes under heavy traffic load may cause FMAN internal resource leak; thus stopping further packet processing.
The FMAN internal queue can overflow when FMAN splits single read or write transactions into multiple smaller transactions such that more than 17 AXI transactions are in flight from FMAN to interconnect. When the FMAN internal queue overflows, it can stall further packet processing. The issue can occur with any one of the following three conditions:
1. FMAN AXI transaction crosses 4K address boundary (Errata
A010022)
2. FMAN DMA address for an AXI transaction is not 16 byte aligned, i.e. the last 4 bits of an address are non-zero
3. Scatter Gather (SG) frames have more than one SG buffer in the SG list and any one of the buffers, except the last buffer in the SG list has data size that is not a multiple of 16 bytes, i.e., other than 16, 32, 48, 64, etc.
With any one of the above three conditions present, there is likelihood of stalled FMAN packet processing, especially under stress with multiple ports injecting line-rate traffic.
To avoid situations that stall FMAN packet processing, all of the above three conditions must be avoided; therefore, configure the system with the following rules:
1. Frame buffers must not span a 4KB address boundary, unless the frame start address is 256 byte aligned
2. All FMAN DMA start addresses (for example, BMAN buffer address, FD[address] + FD[offset]) are 16B aligned
3. SG table and buffer addresses are 16B aligned and the size of SG buffers are multiple of 16 bytes, except for the last SG buffer that can be of any size.
Additional workaround notes:
- Address alignment of 64 bytes is recommended for maximally efficient system bus transactions (although 16 byte alignment is sufficient to avoid the stall condition)
- To support frame sizes that are larger than 4K bytes, there are two options:
1. Large single buffer frames that span a 4KB page boundary can be converted into SG frames to avoid transaction splits at the 4KB boundary,
2. Align the large single buffer to 256B address boundaries, ensure that the frame address plus offset is 256B aligned.
- If software generated SG frames have buffers that are unaligned and with random non-multiple of 16 byte lengths, before transmitting such frames via FMAN, frames will need to be copied into a new single buffer or multiple buffer SG frame that is compliant with the three rules listed above.
--- Documentation/devicetree/bindings/powerpc/fsl/fman.txt | 7 +++++++ 1 file changed, 7 insertions(+)
Documentation/devicetree/bindings/powerpc/fsl/fman.txt +7 -0
@@ -110,6 +110,13 @@ PROPERTIES Usage: required Definition: See soc/fsl/qman.txt and soc/fsl/bman.txt +- fsl,erratum-a050385 + Usage: optional + Value type: boolean + Definition: A boolean property. Indicates the presence of the + erratum A050385 which indicates that DMA transactions that are + split can result in a FMan lock. + ============================================================================= FMan MURAM Node
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 8/12 scsi: ipr: Fix softlockup when rescanning devices in petitboot
In reply to Sasha LevinFrom: Wen Xiong <[email protected]>
[ Upstream commit 394b61711f3ce33f75bf70a3e22938464a13b3ee ]
When trying to rescan disks in petitboot shell, we hit the following softlockup stacktrace:
Kernel panic - not syncing: System is deadlocked on memory [ 241.223394] CPU: 32 PID: 693 Comm: sh Not tainted 5.4.16-openpower1 #1 [ 241.223406] Call Trace: [ 241.223415] [c0000003f07c3180] [c000000000493fc4] dump_stack+0xa4/0xd8 (unreliable) [ 241.223432] [c0000003f07c31c0] [c00000000007d4ac] panic+0x148/0x3cc [ 241.223446] [c0000003f07c3260] [c000000000114b10] out_of_memory+0x468/0x4c4 [ 241.223461] [c0000003f07c3300] [c0000000001472b0] __alloc_pages_slowpath+0x594/0x6d8 [ 241.223476] [c0000003f07c3420] [c00000000014757c] __alloc_pages_nodemask+0x188/0x1a4 [ 241.223492] [c0000003f07c34a0] [c000000000153e10] alloc_pages_current+0xcc/0xd8 [ 241.223508] [c0000003f07c34e0] [c0000000001577ac] alloc_slab_page+0x30/0x98 [ 241.223524] [c0000003f07c3520] [c0000000001597fc] new_slab+0x138/0x40c [ 241.223538] [c0000003f07c35f0] [c00000000015b204] ___slab_alloc+0x1e4/0x404 [ 241.223552] [c0000003f07c36c0] [c00000000015b450] __slab_alloc+0x2c/0x48 [ 241.223566] [c0000003f07c36f0] [c00000000015b754] kmem_cache_alloc_node+0x9c/0x1b4 [ 241.223582] [c0000003f07c3760] [c000000000218c48] blk_alloc_queue_node+0x34/0x270 [ 241.223599] [c0000003f07c37b0] [c000000000226574] blk_mq_init_queue+0x2c/0x78 [ 241.223615] [c0000003f07c37e0] [c0000000002ff710] scsi_mq_alloc_queue+0x28/0x70 [ 241.223631] [c0000003f07c3810] [c0000000003005b8] scsi_alloc_sdev+0x184/0x264 [ 241.223647] [c0000003f07c38a0] [c000000000300ba0] scsi_probe_and_add_lun+0x288/0xa3c [ 241.223663] [c0000003f07c3a00] [c000000000301768] __scsi_scan_target+0xcc/0x478 [ 241.223679] [c0000003f07c3b20] [c000000000301c64] scsi_scan_channel.part.9+0x74/0x7c [ 241.223696] [c0000003f07c3b70] [c000000000301df4] scsi_scan_host_selected+0xe0/0x158 [ 241.223712] [c0000003f07c3bd0] [c000000000303f04] store_scan+0x104/0x114 [ 241.223727] [c0000003f07c3cb0] [c0000000002d5ac4] dev_attr_store+0x30/0x4c [ 241.223741] [c0000003f07c3cd0] [c0000000001dbc34] sysfs_kf_write+0x64/0x78 [ 241.223756] [c0000003f07c3cf0] [c0000000001da858] kernfs_fop_write+0x170/0x1b8 [ 241.223773] [c0000003f07c3d40] [c0000000001621fc] __vfs_write+0x34/0x60 [ 241.223787] [c0000003f07c3d60] [c000000000163c2c] vfs_write+0xa8/0xcc [ 241.223802] [c0000003f07c3db0] [c000000000163df4] ksys_write+0x70/0xbc [ 241.223816] [c0000003f07c3e20] [c00000000000b40c] system_call+0x5c/0x68
As a part of the scan process Linux will allocate and configure a scsi_device for each target to be scanned. If the device is not present, then the scsi_device is torn down. As a part of scsi_device teardown a workqueue item will be scheduled and the lockups we see are because there are 250k workqueue items to be processed. Accoding to the specification of SIS-64 sas controller, max_channel should be decreased on SIS-64 adapters to 4.
The patch fixes softlockup issue.
Thanks for Oliver Halloran's help with debugging and explanation!
--- drivers/scsi/ipr.c | 3 ++- drivers/scsi/ipr.h | 1 + 2 files changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/ipr.c +2 -1
@@ -9730,6 +9730,7 @@ static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg, ioa_cfg->max_devs_supported = ipr_max_devs;if (ioa_cfg->sis64) { + host->max_channel =IPR_MAX_SIS64_BUSES ; host->max_id =IPR_MAX_SIS64_TARGETS_PER_BUS ; host->max_lun =IPR_MAX_SIS64_LUNS_PER_TARGET ;if (ipr_max_devs >IPR_MAX_SIS64_DEVS )
@@ -9738,6 +9739,7 @@ static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg, + ((sizeof (struct ipr_config_table_entry64 ) * ioa_cfg->max_devs_supported))); }else { + host->max_channel =IPR_VSET_BUS ; host->max_id =IPR_MAX_NUM_TARGETS_PER_BUS ; host->max_lun =IPR_MAX_NUM_LUNS_PER_TARGET ;if (ipr_max_devs >IPR_MAX_PHYSICAL_DEVS )
@@ -9747,7 +9749,6 @@ static void ipr_init_ioa_cfg(struct ipr_ioa_cfg *ioa_cfg, * ioa_cfg->max_devs_supported))); } - host->max_channel =IPR_VSET_BUS ; host->unique_id = host->host_no; host->max_cmd_len =IPR_MAX_CDB_LEN ; host->can_queue = ioa_cfg->max_cmds;
drivers/scsi/ipr.h +1 -0
@@ -1301,6 +1301,7 @@ struct ipr_resource_entry {#define IPR_ARRAY_VIRTUAL_BUS 0x1#define IPR_VSET_VIRTUAL_BUS 0x2#define IPR_IOAFP_VIRTUAL_BUS 0x3 +#define IPR_MAX_SIS64_BUSES 0x4#define IPR_GET_RES_PHYS_LOC (res) \ (((res)->bus << 24) | ((res)->target << 8) | (res)->lun)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 9/12 mac80211: Do not send mesh HWMP PREQ if HWMP is disabled
In reply to Sasha LevinFrom: Nicolas Cavallari <[email protected]>
[ Upstream commit ba32679cac50c38fdf488296f96b1f3175532b8e ]
When trying to transmit to an unknown destination, the mesh code would unconditionally transmit a HWMP PREQ even if HWMP is not the current path selection algorithm.
--- net/mac80211/mesh_hwmp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/mac80211/mesh_hwmp.c +2 -1
@@ -1112,7 +1112,8 @@ int mesh_nexthop_resolve(struct ieee80211_sub_if_data *sdata, } } -if (!(mpath->flags &MESH_PATH_RESOLVING )) +if (!(mpath->flags &MESH_PATH_RESOLVING ) && +mesh_path_sel_is_hwmp (sdata))mesh_queue_preq (mpath,PREQ_Q_F_START );if (skb_queue_len (&mpath->frame_queue) >=MESH_FRAME_QUEUE_LEN )
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 10/12 sxgbe: Fix off by one in samsung driver strncpy size arg
In reply to Sasha LevinFrom: Dominik Czarnota <[email protected]>
[ Upstream commit f3cc008bf6d59b8d93b4190e01d3e557b0040e15 ]
This patch fixes an off-by-one error in strncpy size argument in drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c. The issue is that in:
strncmp(opt, "eee_timer:", 6)
the passed string literal: "eee_timer:" has 10 bytes (without the NULL byte) and the passed size argument is 6. As a result, the logic will also accept other, malformed strings, e.g. "eee_tiXXX:".
This bug doesn't seem to have any security impact since its present in module's cmdline parsing code.
--- drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/samsung/sxgbe/sxgbe_main.c +1 -1
@@ -2315,7 +2315,7 @@ static int __init sxgbe_cmdline_opt(char *str)if (!str || !*str)return -EINVAL ;while ((opt =strsep (&str,"," )) !=NULL ) { -if (!strncmp (opt,"eee_timer:" ,6 )) { +if (!strncmp (opt,"eee_timer:" ,10 )) {if (kstrtoint (opt +10 ,0 , &eee_timer)) goto err; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 11/12 iommu/vt-d: quirk_ioat_snb_local_iommu: replace WARN_TAINT with pr_warn + add_taint
In reply to Sasha LevinFrom: Hans de Goede <[email protected]>
[ Upstream commit 81ee85d0462410de8eeeec1b9761941fd6ed8c7b ]
Quoting from the comment describing the WARN functions in include/asm-generic/bug.h:
* WARN(), WARN_ON(), WARN_ON_ONCE, and so on can be used to report
* significant kernel issues that need prompt attention if they should ever
* appear at runtime.
*
* Do not use these macros when checking for invalid external inputs
The (buggy) firmware tables which the dmar code was calling WARN_TAINT for really are invalid external inputs. They are not under the kernel's control and the issues in them cannot be fixed by a kernel update. So logging a backtrace, which invites bug reports to be filed about this, is not helpful.
--- drivers/iommu/intel-iommu.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/iommu/intel-iommu.c +4 -3
@@ -3949,10 +3949,11 @@ static void quirk_ioat_snb_local_iommu(struct pci_dev *pdev)/* we know that the this iommu should be at offset 0xa000 from vtbar */ drhd =dmar_find_matched_drhd_unit (pdev); -if (WARN_TAINT_ONCE (!drhd || drhd->reg_base_addr - vtbar !=0xa000 , -TAINT_FIRMWARE_WORKAROUND , -"BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n" )) +if (!drhd || drhd->reg_base_addr - vtbar !=0xa000 ) { +pr_warn_once (FW_BUG "BIOS assigned incorrect VT-d unit for Intel(R) QuickData Technology device\n" ); +add_taint (TAINT_FIRMWARE_WORKAROUND ,LOCKDEP_STILL_OK ); pdev->dev.archdata.iommu =DUMMY_DEVICE_DOMAIN_INFO ; + } }DECLARE_PCI_FIXUP_ENABLE (PCI_VENDOR_ID_INTEL ,PCI_DEVICE_ID_INTEL_IOAT_SNB , quirk_ioat_snb_local_iommu);
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu
Sasha Levin
maintainerPATCH 12/12 iommu/vt-d: Fix the wrong printing in RHSA parsing
In reply to Sasha LevinFrom: Zhenzhong Duan <[email protected]>
[ Upstream commit b0bb0c22c4db623f2e7b1a471596fbf1c22c6dc5 ]
When base address in RHSA structure doesn't match base address in each DRHD structure, the base address in last DRHD is printed out.
This doesn't make sense when there are multiple DRHD units, fix it by printing the buggy RHSA's base address.
--- drivers/iommu/dmar.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/dmar.c +1 -1
@@ -473,7 +473,7 @@ static int dmar_parse_one_rhsa(struct acpi_dmar_header *header, void *arg)1 ,TAINT_FIRMWARE_WORKAROUND ,"Your BIOS is broken; RHSA refers to non-existent DMAR unit at %llx\n" "BIOS vendor: %s; Ver: %s; Product Version: %s\n" , - drhd->reg_base_addr, + rhsa->base_address,dmi_get_system_info (DMI_BIOS_VENDOR ),dmi_get_system_info (DMI_BIOS_VERSION ), dmi_get_system_info(DMI_PRODUCT_VERSION));
Signature · 6 lines
2.20.1 _______________________________________________ iommu mailing list [email protected] https://lists.linuxfoundation.org/mailman/listinfo/iommu