ARM: dts: omap4-droid4: Fix typo in cpcap IRQ flags
Subsystems (13)
Sasha Levin
maintainerPATCH 1/36 ARM: dts: omap4-droid4: Fix typo in cpcap IRQ flags
From: Tony Lindgren <[email protected]>
[ Upstream commit ef4a55b9197a8f844ea0663138e902dcce3e2f36 ]
We're now getting the following error:
genirq: Setting trigger mode 1 for irq 230 failed (regmap_irq_set_type+0x0/0x15c)
cpcap-usb-phy cpcap-usb-phy.0: could not get irq dp: -524
--- arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/motorola-cpcap-mapphone.dtsi +1 -1
@@ -92,7 +92,7 @@ interrupts-extended = < &cpcap 15 0 &cpcap 14 0 &cpcap 28 0 &cpcap 19 0 &cpcap 18 0 &cpcap 17 0 &cpcap 16 0 &cpcap 49 0 - &cpcap 48 1 + &cpcap 48 0 >; interrupt-names = "id_ground", "id_float", "se0conn", "vbusvld",
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 2/36 arm64: dts: renesas: r8a7796: Enable DMA for SCIF2
From: Geert Uytterhoeven <[email protected]>
[ Upstream commit 97f26702bc95b5c3a72671d5c6675e4d6ee0a2f4 ]
SCIF2 on R-Car M3-W can be used with both DMAC1 and DMAC2.
--- arch/arm64/boot/dts/renesas/r8a7796.dtsi | 3 +++ 1 file changed, 3 insertions(+)
arch/arm64/boot/dts/renesas/r8a7796.dtsi +3 -0
@@ -937,6 +937,9 @@ <&cpg CPG_CORE R8A7796_CLK_S3D1>, <&scif_clk>; clock-names = "fck", "brg_int", "scif_clk"; + dmas = <&dmac1 0x13>, <&dmac1 0x12>, + <&dmac2 0x13>, <&dmac2 0x12>; + dma-names = "tx", "rx", "tx", "rx"; power-domains = <&sysc R8A7796_PD_ALWAYS_ON>; resets = <&cpg 310>; status = "disabled";
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 3/36 soc: fsl: qbman: avoid race in clearing QMan interrupt
In reply to Sasha LevinFrom: Madalin Bucur <[email protected]>
[ Upstream commit 89857a8a5c89a406b967ab2be7bd2ccdbe75e73d ]
By clearing all interrupt sources, not only those that already occurred, the existing code may acknowledge by mistake interrupts that occurred after the code checks for them.
--- drivers/soc/fsl/qbman/qman.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/soc/fsl/qbman/qman.c +5 -4
@@ -1048,18 +1048,19 @@ static void qm_mr_process_task(struct work_struct *work);static irqreturn_t portal_isr (int irq,void *ptr) {struct qman_portal *p = ptr; - -u32 clear =QM_DQAVAIL_MASK | p->irq_sources;u32 is =qm_in (&p->p,QM_REG_ISR ) & p->irq_sources; +u32 clear =0 ;if (unlikely (!is))return IRQ_NONE ;/* DQRR-handling if it's interrupt-driven */ -if (is &QM_PIRQ_DQRI ) +if (is &QM_PIRQ_DQRI ) {__poll_portal_fast (p,QMAN_POLL_LIMIT ); + clear =QM_DQAVAIL_MASK |QM_PIRQ_DQRI ; + }/* Handling of anything else that's interrupt-driven */ - clear |=__poll_portal_slow (p, is); + clear |=__poll_portal_slow (p, is) &QM_PIRQ_SLOW ;qm_out (&p->p,QM_REG_ISR , clear);return IRQ_HANDLED ; }
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 4/36 bpf: sock recvbuff must be limited by rmem_max in bpf_setsockopt()
In reply to Sasha LevinFrom: Yafang Shao <[email protected]>
[ Upstream commit c9e4576743eeda8d24dedc164d65b78877f9a98c ]
When sock recvbuff is set by bpf_setsockopt(), the value must by limited by rmem_max. It is the same with sendbuff.
--- net/core/filter.c | 2 ++ 1 file changed, 2 insertions(+)
net/core/filter.c +2 -0
@@ -3081,10 +3081,12 @@ BPF_CALL_5(bpf_setsockopt, struct bpf_sock_ops_kern *, bpf_sock,/* Only some socketops are supported */ switch (optname) {case SO_RCVBUF : + val =min_t (u32, val, sysctl_rmem_max); sk->sk_userlocks |=SOCK_RCVBUF_LOCK ; sk->sk_rcvbuf =max_t (int, val *2 ,SOCK_MIN_RCVBUF );break ;case SO_SNDBUF : + val =min_t (u32, val, sysctl_wmem_max); sk->sk_userlocks |=SOCK_SNDBUF_LOCK ; sk->sk_sndbuf =max_t (int, val *2 ,SOCK_MIN_SNDBUF );break ;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 5/36 ARM: pxa: ssp: unneeded to free devm_ allocated data
In reply to Sasha LevinFrom: Peng Hao <[email protected]>
[ Upstream commit ba16adeb346387eb2d1ada69003588be96f098fa ]
devm_ allocated data will be automatically freed. The free of devm_ allocated data is invalid.
--- arch/arm/plat-pxa/ssp.c | 3 --- 1 file changed, 3 deletions(-)
arch/arm/plat-pxa/ssp.c +0 -3
@@ -237,8 +237,6 @@ static int pxa_ssp_remove(struct platform_device *pdev)if (ssp ==NULL )return -ENODEV ; -iounmap (ssp->mmio_base); - res =platform_get_resource (pdev,IORESOURCE_MEM ,0 );release_mem_region (res->start,resource_size (res));
@@ -248,7 +246,6 @@ static int pxa_ssp_remove(struct platform_device *pdev)list_del (&ssp->node);mutex_unlock (&ssp_lock); -kfree (ssp);return 0 ; }
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 6/36 arm64: dts: add msm8996 compatible to gicv3
In reply to Sasha LevinFrom: Srinivas Kandagatla <[email protected]>
[ Upstream commit 2a81efb0de0e33f2d2c83154af0bd3ce389b3269 ]
Add compatible to gicv3 node to enable quirk required to restrict writing to GICR_WAKER register which is restricted on msm8996 SoC in Hypervisor.
With this quirk MSM8996 can at least boot out of mainline, which can help community to work with boards based on MSM8996.
Without this patch Qualcomm DB820c board reboots on mainline.
--- arch/arm64/boot/dts/qcom/msm8996.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/boot/dts/qcom/msm8996.dtsi +1 -1
@@ -359,7 +359,7 @@ }; intc: interrupt-controller@9bc0000 { - compatible = "arm,gic-v3"; + compatible = "qcom,msm8996-gic-v3", "arm,gic-v3"; #interrupt-cells = <3>; interrupt-controller; #redistributor-regions = <1>;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 7/36 DTS: CI20: Fix bugs in ci20's device tree.
In reply to Sasha LevinFrom: Zhou Yanjie <[email protected]>
[ Upstream commit 1ca1c87f91d9dc50d6a38e2177b2032996e7901c ]
According to the Schematic, the hardware of ci20 leads to uart3, but not to uart2. Uart2 is miswritten in the original code.
--- arch/mips/boot/dts/ingenic/ci20.dts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
arch/mips/boot/dts/ingenic/ci20.dts +4 -4
@@ -54,7 +54,7 @@ status = "okay"; pinctrl-names = "default"; - pinctrl-0 = <&pins_uart2>; + pinctrl-0 = <&pins_uart3>; }; &uart4 {
@@ -174,9 +174,9 @@ bias-disable; }; - pins_uart2: uart2 { - function = "uart2"; - groups = "uart2-data", "uart2-hwflow"; + pins_uart3: uart3 { + function = "uart3"; + groups = "uart3-data", "uart3-hwflow"; bias-disable; };
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 8/36 usb: phy: fix link errors
In reply to Sasha LevinFrom: Anders Roxell <[email protected]>
[ Upstream commit f2105d42597f4d10e431b195d69e96dccaf9b012 ]
Fix link errors when CONFIG_FSL_USB2_OTG is enabled and USB_OTG_FSM is set to module then the following link error occurs.
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.o: in function `fsl_otg_ioctl':drivers/usb/phy/phy-fsl-usb.c:1083: undefined reference to `otg_statemachine'
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.c:1083:(.text+0x574): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `otg_statemachine'
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.o: in function `fsl_otg_start_srp':drivers/usb/phy/phy-fsl-usb.c:674: undefined reference to `otg_statemachine'
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.c:674:(.text+0x61c): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `otg_statemachine'
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.o: in function `fsl_otg_set_host':drivers/usb/phy/phy-fsl-usb.c:593: undefined reference to `otg_statemachine'
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.c:593:(.text+0x7a4): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `otg_statemachine'
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.o: in function `fsl_otg_start_hnp':drivers/usb/phy/phy-fsl-usb.c:695: undefined reference to `otg_statemachine'
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.c:695:(.text+0x858): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `otg_statemachine'
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.o: in function `a_wait_enum':drivers/usb/phy/phy-fsl-usb.c:274: undefined reference to `otg_statemachine'
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.c:274:(.text+0x16f0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `otg_statemachine'
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.o:drivers/usb/phy/phy-fsl-usb.c:619: more undefined references to `otg_statemachine' follow
aarch64-linux-gnu-ld: drivers/usb/phy/phy-fsl-usb.o: in function `fsl_otg_set_peripheral':
drivers/usb/phy/phy-fsl-usb.c:619:(.text+0x1fa0): relocation truncated to fit: R_AARCH64_CALL26 against undefined symbol `otg_statemachine' make[1]: *** [Makefile:1020: vmlinux] Error 1
make[1]: Target 'Image' not remade because of errors.
make: *** [Makefile:152: sub-make] Error 2
make: Target 'Image' not remade because of errors.
Rework so that FSL_USB2_OTG depends on that the USB_OTG_FSM is builtin.
--- drivers/usb/phy/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/usb/phy/Kconfig +1 -1
@@ -21,7 +21,7 @@ config AB8500_USB config FSL_USB2_OTG bool "Freescale USB OTG Transceiver Driver" - depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_FSM && PM + depends on USB_EHCI_FSL && USB_FSL_USB2 && USB_OTG_FSM=y && PM depends on USB_GADGET || !USB_GADGET # if USB_GADGET=m, this can't be 'y' select USB_PHY help
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 9/36 irqchip/mmp: Only touch the PJ4 IRQ & FIQ bits on enable/disable
In reply to Sasha LevinFrom: Lubomir Rintel <[email protected]>
[ Upstream commit 2380a22b60ce6f995eac806e69c66e397b59d045 ]
Resetting bit 4 disables the interrupt delivery to the "secure processor" core. This breaks the keyboard on a OLPC XO 1.75 laptop, where the firmware running on the "secure processor" bit-bangs the PS/2 protocol over the GPIO lines.
It is not clear what the rest of the bits are and Marvell was unhelpful when asked for documentation. Aside from the SP bit, there are probably priority bits.
Leaving the unknown bits as the firmware set them up seems to be a wiser course of action compared to just turning them off.
--- drivers/irqchip/irq-mmp.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
drivers/irqchip/irq-mmp.c +5 -1
@@ -34,6 +34,9 @@#define SEL_INT_PENDING (1 << 6)#define SEL_INT_NUM_MASK 0x3f +#define MMP2_ICU_INT_ROUTE_PJ4_IRQ (1 << 5) +#define MMP2_ICU_INT_ROUTE_PJ4_FIQ (1 << 6) +struct icu_chip_data {int nr_irqs;unsigned int virq_base;
@@ -190,7 +193,8 @@ static const struct mmp_intc_conf mmp_conf = {static const struct mmp_intc_conf mmp2_conf = { .conf_enable =0x20 , .conf_disable =0x0 , - .conf_mask =0x7f , + .conf_mask =MMP2_ICU_INT_ROUTE_PJ4_IRQ | +MMP2_ICU_INT_ROUTE_PJ4_FIQ , }; static void __exception_irq_entry mmp_handle_irq(struct pt_regs *regs)
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 10/36 debugfs: return error values, not NULL
In reply to Sasha LevinFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit ff9fb72bc07705c00795ca48631f7fffe24d2c6b ]
When an error happens, debugfs should return an error pointer value, not NULL. This will prevent the totally theoretical error where a debugfs call fails due to lack of memory, returning NULL, and that dentry value is then passed to another debugfs call, which would end up succeeding, creating a file at the root of the debugfs tree, but would then be impossible to remove (because you can not remove the directory NULL).
So, to make everyone happy, always return errors, this makes the users of debugfs much simpler (they do not have to ever check the return value), and everyone can rest easy.
--- fs/debugfs/inode.c | 39 ++++++++++++++++++++++----------------- 1 file changed, 22 insertions(+), 17 deletions(-)
fs/debugfs/inode.c +22 -17
@@ -252,8 +252,8 @@ MODULE_ALIAS_FS("debugfs");* @parent: a pointer to the parent dentry of the file. * * This function will return a pointer to a dentry if it succeeds. If the file -* doesn't exist or an error occurs, %NULL will be returned. The returned -* dentry must be passed to dput() when it is no longer needed. +* doesn't exist or an error occurs, %ERR_PTR(-ERROR) will be returned. The +* returned dentry must be passed to dput() when it is no longer needed. * * If debugfs is not enabled in the kernel, the value -%ENODEV will be * returned.
@@ -263,7 +263,7 @@ struct dentry *debugfs_lookup(const char *name, struct dentry *parent)struct dentry *dentry;if (IS_ERR (parent)) -return NULL ; +return parent;if (!parent) parent = debugfs_mount->mnt_root;
@@ -273,10 +273,10 @@ struct dentry *debugfs_lookup(const char *name, struct dentry *parent)inode_unlock (d_inode (parent));if (IS_ERR (dentry)) -return NULL ; +return dentry;if (!d_really_is_positive (dentry)) {dput (dentry); -return NULL ; +return ERR_PTR (-EINVAL ); }return dentry; }
@@ -325,7 +325,7 @@ static struct dentry *failed_creating(struct dentry *dentry)inode_unlock (d_inode (dentry->d_parent));dput (dentry);simple_release_fs (&debugfs_mount, &debugfs_mount_count); -return NULL ; +return ERR_PTR (-ENOMEM ); }static struct dentry *end_creating (struct dentry *dentry)
@@ -348,7 +348,7 @@ static struct dentry *__debugfs_create_file(const char *name, umode_t mode, dentry =start_creating (name, parent);if (IS_ERR (dentry)) -return NULL ; +return dentry; inode =debugfs_get_inode (dentry->d_sb);if (unlikely (!inode))
@@ -386,7 +386,8 @@ static struct dentry *__debugfs_create_file(const char *name, umode_t mode,* This function will return a pointer to a dentry if it succeeds. This * pointer must be passed to the debugfs_remove() function when the file is * to be removed (no automatic cleanup happens if your module is unloaded, -* you are responsible here.) If an error occurs, %NULL will be returned. +* you are responsible here.) If an error occurs, %ERR_PTR(-ERROR) will be +* returned. * * If debugfs is not enabled in the kernel, the value -%ENODEV will be * returned.
@@ -464,7 +465,8 @@ EXPORT_SYMBOL_GPL(debugfs_create_file_unsafe);* This function will return a pointer to a dentry if it succeeds. This * pointer must be passed to the debugfs_remove() function when the file is * to be removed (no automatic cleanup happens if your module is unloaded, -* you are responsible here.) If an error occurs, %NULL will be returned. +* you are responsible here.) If an error occurs, %ERR_PTR(-ERROR) will be +* returned. * * If debugfs is not enabled in the kernel, the value -%ENODEV will be * returned.
@@ -495,7 +497,8 @@ EXPORT_SYMBOL_GPL(debugfs_create_file_size);* This function will return a pointer to a dentry if it succeeds. This * pointer must be passed to the debugfs_remove() function when the file is * to be removed (no automatic cleanup happens if your module is unloaded, -* you are responsible here.) If an error occurs, %NULL will be returned. +* you are responsible here.) If an error occurs, %ERR_PTR(-ERROR) will be +* returned. * * If debugfs is not enabled in the kernel, the value -%ENODEV will be * returned.
@@ -506,7 +509,7 @@ struct dentry *debugfs_create_dir(const char *name, struct dentry *parent)struct inode *inode;if (IS_ERR (dentry)) -return NULL ; +return dentry; inode =debugfs_get_inode (dentry->d_sb);if (unlikely (!inode))
@@ -545,7 +548,7 @@ struct dentry *debugfs_create_automount(const char *name,struct inode *inode;if (IS_ERR (dentry)) -return NULL ; +return dentry; inode =debugfs_get_inode (dentry->d_sb);if (unlikely (!inode))
@@ -581,8 +584,8 @@ EXPORT_SYMBOL(debugfs_create_automount);* This function will return a pointer to a dentry if it succeeds. This * pointer must be passed to the debugfs_remove() function when the symbolic * link is to be removed (no automatic cleanup happens if your module is -* unloaded, you are responsible here.) If an error occurs, %NULL will be -* returned. +* unloaded, you are responsible here.) If an error occurs, %ERR_PTR(-ERROR) +* will be returned. * * If debugfs is not enabled in the kernel, the value -%ENODEV will be * returned.
@@ -594,12 +597,12 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,struct inode *inode;char *link =kstrdup (target,GFP_KERNEL );if (!link) -return NULL ; +return ERR_PTR (-ENOMEM ); dentry =start_creating (name, parent);if (IS_ERR (dentry)) {kfree (link); -return NULL ; +return dentry; } inode =debugfs_get_inode (dentry->d_sb);
@@ -806,7 +809,9 @@ struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,if (dentry && !IS_ERR (dentry))dput (dentry);unlock_rename (new_dir, old_dir); -return NULL ; +if (IS_ERR (dentry)) +return dentry; +return ERR_PTR (-EINVAL ); }EXPORT_SYMBOL_GPL (debugfs_rename);
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 11/36 debugfs: debugfs_lookup() should return NULL if not found
In reply to Sasha LevinFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 37ea7b630ae5cdea4e8ff381d9d23abfef5939e6 ]
Lots of callers of debugfs_lookup() were just checking NULL to see if the file/directory was found or not. By changing this in ff9fb72bc077 ("debugfs: return error values, not NULL") we caused some subsystems to easily crash.
--- fs/debugfs/inode.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
fs/debugfs/inode.c +5 -5
@@ -252,8 +252,8 @@ MODULE_ALIAS_FS("debugfs");* @parent: a pointer to the parent dentry of the file. * * This function will return a pointer to a dentry if it succeeds. If the file -* doesn't exist or an error occurs, %ERR_PTR(-ERROR) will be returned. The -* returned dentry must be passed to dput() when it is no longer needed. +* doesn't exist or an error occurs, %NULL will be returned. The returned +* dentry must be passed to dput() when it is no longer needed. * * If debugfs is not enabled in the kernel, the value -%ENODEV will be * returned.
@@ -263,7 +263,7 @@ struct dentry *debugfs_lookup(const char *name, struct dentry *parent)struct dentry *dentry;if (IS_ERR (parent)) -return parent; +return NULL ;if (!parent) parent = debugfs_mount->mnt_root;
@@ -273,10 +273,10 @@ struct dentry *debugfs_lookup(const char *name, struct dentry *parent)inode_unlock (d_inode (parent));if (IS_ERR (dentry)) -return dentry; +return NULL ;if (!d_really_is_positive (dentry)) {dput (dentry); -return ERR_PTR (-EINVAL ); +return NULL ; }return dentry; }
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 12/36 net: stmmac: Fallback to Platform Data clock in Watchdog conversion
In reply to Sasha LevinFrom: Jose Abreu <[email protected]>
[ Upstream commit 4ec5302fa906ec9d86597b236f62315bacdb9622 ]
If we don't have DT then stmmac_clk will not be available. Let's add a new Platform Data field so that we can specify the refclk by this mean.
This way we can still use the coalesce command in PCI based setups.
--- .../net/ethernet/stmicro/stmmac/stmmac_ethtool.c | 14 ++++++++++---- include/linux/stmmac.h | 1 + 2 files changed, 11 insertions(+), 4 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_ethtool.c +10 -4
@@ -702,8 +702,11 @@ static u32 stmmac_usec2riwt(u32 usec, struct stmmac_priv *priv) {unsigned long clk =clk_get_rate (priv->plat->stmmac_clk); -if (!clk) -return 0 ; +if (!clk) { + clk = priv->plat->clk_ref_rate; +if (!clk) +return 0 ; + }return (usec * (clk /1000000 )) /256 ; }
@@ -712,8 +715,11 @@ static u32 stmmac_riwt2usec(u32 riwt, struct stmmac_priv *priv) {unsigned long clk =clk_get_rate (priv->plat->stmmac_clk); -if (!clk) -return 0 ; +if (!clk) { + clk = priv->plat->clk_ref_rate; +if (!clk) +return 0 ; + }return (riwt *256 ) / (clk /1000000 ); }
include/linux/stmmac.h +1 -0
@@ -183,6 +183,7 @@ struct plat_stmmacenet_data {struct clk *pclk;struct clk *clk_ptp_ref;unsigned int clk_ptp_rate; +unsigned int clk_ref_rate;struct reset_control *stmmac_rst;struct stmmac_axi *axi;int has_gmac4;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 13/36 net: stmmac: Send TSO packets always from Queue 0
In reply to Sasha LevinFrom: Jose Abreu <[email protected]>
[ Upstream commit c5acdbee22a1b200dde07effd26fd1f649e9ab8a ]
The number of TSO enabled channels in HW can be different than the number of total channels. There is no way to determined, at runtime, the number of TSO capable channels and its safe to assume that if TSO is enabled then at least channel 0 will be TSO capable.
Lets always send TSO packets from Queue 0.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +10 -1
@@ -3019,8 +3019,17 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)/* Manage oversized TCP frames for GMAC4 device */ if (skb_is_gso (skb) && priv->tso) { -if (skb_shinfo (skb)->gso_type & (SKB_GSO_TCPV4 |SKB_GSO_TCPV6 )) +if (skb_shinfo (skb)->gso_type & (SKB_GSO_TCPV4 |SKB_GSO_TCPV6 )) { +/* +* There is no way to determine the number of TSO +* capable Queues. Let's use always the Queue 0 +* because if TSO is supported then at least this +* one will be capable. +*/ +skb_set_queue_mapping (skb,0 ); +return stmmac_tso_xmit (skb, dev); + } }if (unlikely (stmmac_tx_avail (priv, queue) < nfrags +1 )) {
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 14/36 net: stmmac: Disable EEE mode earlier in XMIT callback
In reply to Sasha LevinFrom: Jose Abreu <[email protected]>
[ Upstream commit e2cd682deb231ba6f80524bb84e57e7138261149 ]
In stmmac xmit callback we use a different flow for TSO packets but TSO xmit callback is not disabling the EEE mode.
Fix this by disabling earlier the EEE mode, i.e. before calling the TSO xmit callback.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +3 -3
@@ -3017,6 +3017,9 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev) tx_q = &priv->tx_queue[queue]; +if (priv->tx_path_in_lpi_mode) +stmmac_disable_eee_mode (priv); +/* Manage oversized TCP frames for GMAC4 device */ if (skb_is_gso (skb) && priv->tso) {if (skb_shinfo (skb)->gso_type & (SKB_GSO_TCPV4 |SKB_GSO_TCPV6 )) {
@@ -3044,9 +3047,6 @@ static netdev_tx_t stmmac_xmit(struct sk_buff *skb, struct net_device *dev)return NETDEV_TX_BUSY ; } -if (priv->tx_path_in_lpi_mode) -stmmac_disable_eee_mode (priv); - entry = tx_q->cur_tx; first_entry = entry;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 15/36 irqchip/gic-v3-its: Fix ITT_entry_size accessor
In reply to Sasha LevinFrom: Zenghui Yu <[email protected]>
[ Upstream commit 56841070ccc87b463ac037d2d1f2beb8e5e35f0c ]
According to ARM IHI 0069C (ID070116), we should use GITS_TYPER's bits [7:4] as ITT_entry_size instead of [8:4]. Although this is pretty annoying, it only results in a potential over-allocation of memory, and nothing bad happens.
--- include/linux/irqchip/arm-gic-v3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/irqchip/arm-gic-v3.h +1 -1
@@ -306,7 +306,7 @@#define GITS_TYPER_PLPIS (1UL << 0)#define GITS_TYPER_VLPIS (1UL << 1)#define GITS_TYPER_ITT_ENTRY_SIZE_SHIFT 4 -#define GITS_TYPER_ITT_ENTRY_SIZE (r) ((((r) >> GITS_TYPER_ITT_ENTRY_SIZE_SHIFT) & 0x1f) + 1) +#define GITS_TYPER_ITT_ENTRY_SIZE (r) ((((r) >> GITS_TYPER_ITT_ENTRY_SIZE_SHIFT) & 0xf) + 1)#define GITS_TYPER_IDBITS_SHIFT 8#define GITS_TYPER_DEVBITS_SHIFT 13#define GITS_TYPER_DEVBITS (r) ((((r) >> GITS_TYPER_DEVBITS_SHIFT) & 0x1f) + 1)
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 16/36 relay: check return of create_buf_file() properly
In reply to Sasha LevinFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 2c1cf00eeacb784781cf1c9896b8af001246d339 ]
If create_buf_file() returns an error, don't try to reference it later as a valid dentry pointer.
This problem was exposed when debugfs started to return errors instead of just NULL for some calls when they do not succeed properly.
Also, the check for WARN_ON(dentry) was just wrong :)
--- kernel/relay.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
kernel/relay.c +3 -1
@@ -427,6 +427,8 @@ static struct dentry *relay_create_buf_file(struct rchan *chan, dentry = chan->cb->create_buf_file (tmpname, chan->parent,S_IRUSR , buf, &chan->is_global); +if (IS_ERR (dentry)) + dentry =NULL ;kfree (tmpname);
@@ -460,7 +462,7 @@ static struct rchan_buf *relay_open_buf(struct rchan *chan, unsigned int cpu) dentry = chan->cb->create_buf_file (NULL ,NULL ,S_IRUSR , buf, &chan->is_global); -if (WARN_ON (dentry)) +if (IS_ERR_OR_NULL (dentry)) goto free_buf; }
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 17/36 blk-mq: protect debugfs_create_files() from failures
In reply to Sasha LevinFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 36991ca68db9dd43bac7f3519f080ee3939263ef ]
If debugfs were to return a non-NULL error for a debugfs call, using that pointer later in debugfs_create_files() would crash.
Fix that by properly checking the pointer before referencing it.
--- block/blk-mq-debugfs.c | 3 +++ 1 file changed, 3 insertions(+)
block/blk-mq-debugfs.c +3 -0
@@ -791,6 +791,9 @@ static const struct blk_mq_debugfs_attr blk_mq_debugfs_ctx_attrs[] = {static bool debugfs_create_files (struct dentry *parent,void *data,const struct blk_mq_debugfs_attr *attr) { +if (IS_ERR_OR_NULL (parent)) +return false; +d_inode (parent)->i_private = data;for (; attr->name; attr++) {
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 18/36 bpf, selftests: fix handling of sparse CPU allocations
In reply to Sasha LevinFrom: Martynas Pumputis <m at lambda.lt>
[ Upstream commit 1bb54c4071f585ebef56ce8fdfe6026fa2cbcddd ]
Previously, bpf_num_possible_cpus() had a bug when calculating a number of possible CPUs in the case of sparse CPU allocations, as it was considering only the first range or element of /sys/devices/system/cpu/possible.
E.g. in the case of "0,2-3" (CPU 1 is not available), the function returned 1 instead of 3.
This patch fixes the function by making it parse all CPU ranges and elements.
--- tools/testing/selftests/bpf/bpf_util.h | 30 +++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-)
tools/testing/selftests/bpf/bpf_util.h +20 -10
@@ -13,7 +13,7 @@ static inline unsigned int bpf_num_possible_cpus(void)unsigned int start, end, possible_cpus =0 ;char buff[128 ];FILE *fp; -int n; +int len, n, i, j =0 ; fp =fopen (fcpu,"r" );if (!fp) {
@@ -21,17 +21,27 @@ static inline unsigned int bpf_num_possible_cpus(void)exit (1 ); } -while (fgets (buff,sizeof (buff), fp)) { - n =sscanf (buff,"%u-%u" , &start, &end); -if (n ==0 ) { -printf ("Failed to retrieve # possible CPUs!\n" ); -exit (1 ); - }else if (n ==1 ) { - end = start; +if (!fgets (buff,sizeof (buff), fp)) { +printf ("Failed to read %s!\n" , fcpu); +exit (1 ); + } + + len =strlen (buff); +for (i =0 ; i <= len; i++) { +if (buff[i] ==',' || buff[i] =='\0' ) { + buff[i] ='\0' ; + n =sscanf (&buff[j],"%u-%u" , &start, &end); +if (n <=0 ) { +printf ("Failed to retrieve # possible CPUs!\n" ); +exit (1 ); + }else if (n ==1 ) { + end = start; + } + possible_cpus += end - start +1 ; + j = i +1 ; } - possible_cpus = start ==0 ? end +1 :0 ; -break ; } +fclose (fp);return possible_cpus;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 19/36 bpf: fix lockdep false positive in percpu_freelist
In reply to Sasha LevinFrom: Alexei Starovoitov <[email protected]>
[ Upstream commit a89fac57b5d080771efd4d71feaae19877cf68f0 ]
Lockdep warns about false positive:
[ 12.492084] 00000000e6b28347 (&head->lock){+...}, at: pcpu_freelist_push+0x2a/0x40
[ 12.492696] but this lock was taken by another, HARDIRQ-safe lock in the past:
[ 12.493275] (&rq->lock){-.-.}
[ 12.493276]
[ 12.493276]
[ 12.493276] and interrupts could create inverse lock ordering between them.
[ 12.493276]
[ 12.494435]
[ 12.494435] other info that might help us debug this:
[ 12.494979] Possible interrupt unsafe locking scenario:
[ 12.494979]
[ 12.495518] CPU0 CPU1
[ 12.495879] ---- ----
[ 12.496243] lock(&head->lock);
[ 12.496502] local_irq_disable();
[ 12.496969] lock(&rq->lock);
[ 12.497431] lock(&head->lock);
[ 12.497890] <Interrupt>
[ 12.498104] lock(&rq->lock);
[ 12.498368]
[ 12.498368] *** DEADLOCK ***
[ 12.498368]
[ 12.498837] 1 lock held by dd/276:
[ 12.499110] #0: 00000000c58cb2ee (rcu_read_lock){....}, at: trace_call_bpf+0x5e/0x240
[ 12.499747]
[ 12.499747] the shortest dependencies between 2nd lock and 1st lock:
[ 12.500389] -> (&rq->lock){-.-.} {
[ 12.500669] IN-HARDIRQ-W at:
[ 12.500934] _raw_spin_lock+0x2f/0x40
[ 12.501373] scheduler_tick+0x4c/0xf0
[ 12.501812] update_process_times+0x40/0x50
[ 12.502294] tick_periodic+0x27/0xb0
[ 12.502723] tick_handle_periodic+0x1f/0x60
[ 12.503203] timer_interrupt+0x11/0x20
[ 12.503651] __handle_irq_event_percpu+0x43/0x2c0
[ 12.504167] handle_irq_event_percpu+0x20/0x50
[ 12.504674] handle_irq_event+0x37/0x60
[ 12.505139] handle_level_irq+0xa7/0x120
[ 12.505601] handle_irq+0xa1/0x150
[ 12.506018] do_IRQ+0x77/0x140
[ 12.506411] ret_from_intr+0x0/0x1d
[ 12.506834] _raw_spin_unlock_irqrestore+0x53/0x60
[ 12.507362] __setup_irq+0x481/0x730
[ 12.507789] setup_irq+0x49/0x80
[ 12.508195] hpet_time_init+0x21/0x32
[ 12.508644] x86_late_time_init+0xb/0x16
[ 12.509106] start_kernel+0x390/0x42a
[ 12.509554] secondary_startup_64+0xa4/0xb0
[ 12.510034] IN-SOFTIRQ-W at:
[ 12.510305] _raw_spin_lock+0x2f/0x40
[ 12.510772] try_to_wake_up+0x1c7/0x4e0
[ 12.511220] swake_up_locked+0x20/0x40
[ 12.511657] swake_up_one+0x1a/0x30
[ 12.512070] rcu_process_callbacks+0xc5/0x650
[ 12.512553] __do_softirq+0xe6/0x47b
[ 12.512978] irq_exit+0xc3/0xd0
[ 12.513372] smp_apic_timer_interrupt+0xa9/0x250
[ 12.513876] apic_timer_interrupt+0xf/0x20
[ 12.514343] default_idle+0x1c/0x170
[ 12.514765] do_idle+0x199/0x240
[ 12.515159] cpu_startup_entry+0x19/0x20
[ 12.515614] start_kernel+0x422/0x42a
[ 12.516045] secondary_startup_64+0xa4/0xb0
[ 12.516521] INITIAL USE at:
[ 12.516774] _raw_spin_lock_irqsave+0x38/0x50
[ 12.517258] rq_attach_root+0x16/0xd0
[ 12.517685] sched_init+0x2f2/0x3eb
[ 12.518096] start_kernel+0x1fb/0x42a
[ 12.518525] secondary_startup_64+0xa4/0xb0
[ 12.518986] }
[ 12.519132] ... key at: [<ffffffff82b7bc28>] __key.71384+0x0/0x8
[ 12.519649] ... acquired at:
[ 12.519892] pcpu_freelist_pop+0x7b/0xd0
[ 12.520221] bpf_get_stackid+0x1d2/0x4d0
[ 12.520563] ___bpf_prog_run+0x8b4/0x11a0
[ 12.520887]
[ 12.521008] -> (&head->lock){+...} {
[ 12.521292] HARDIRQ-ON-W at:
[ 12.521539] _raw_spin_lock+0x2f/0x40
[ 12.521950] pcpu_freelist_push+0x2a/0x40
[ 12.522396] bpf_get_stackid+0x494/0x4d0
[ 12.522828] ___bpf_prog_run+0x8b4/0x11a0
[ 12.523296] INITIAL USE at:
[ 12.523537] _raw_spin_lock+0x2f/0x40
[ 12.523944] pcpu_freelist_populate+0xc0/0x120
[ 12.524417] htab_map_alloc+0x405/0x500
[ 12.524835] __do_sys_bpf+0x1a3/0x1a90
[ 12.525253] do_syscall_64+0x4a/0x180
[ 12.525659] entry_SYSCALL_64_after_hwframe+0x49/0xbe
[ 12.526167] }
[ 12.526311] ... key at: [<ffffffff838f7668>] __key.13130+0x0/0x8
[ 12.526812] ... acquired at:
[ 12.527047] __lock_acquire+0x521/0x1350
[ 12.527371] lock_acquire+0x98/0x190
[ 12.527680] _raw_spin_lock+0x2f/0x40
[ 12.527994] pcpu_freelist_push+0x2a/0x40
[ 12.528325] bpf_get_stackid+0x494/0x4d0
[ 12.528645] ___bpf_prog_run+0x8b4/0x11a0
[ 12.528970]
[ 12.529092]
[ 12.529092] stack backtrace:
[ 12.529444] CPU: 0 PID: 276 Comm: dd Not tainted 5.0.0-rc3-00018-g2fa53f892422 #475
[ 12.530043] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.11.0-2.el7 04/01/2014
[ 12.530750] Call Trace:
[ 12.530948] dump_stack+0x5f/0x8b
[ 12.531248] check_usage_backwards+0x10c/0x120
[ 12.531598] ? ___bpf_prog_run+0x8b4/0x11a0
[ 12.531935] ? mark_lock+0x382/0x560
[ 12.532229] mark_lock+0x382/0x560
[ 12.532496] ? print_shortest_lock_dependencies+0x180/0x180
[ 12.532928] __lock_acquire+0x521/0x1350
[ 12.533271] ? find_get_entry+0x17f/0x2e0
[ 12.533586] ? find_get_entry+0x19c/0x2e0
[ 12.533902] ? lock_acquire+0x98/0x190
[ 12.534196] lock_acquire+0x98/0x190
[ 12.534482] ? pcpu_freelist_push+0x2a/0x40
[ 12.534810] _raw_spin_lock+0x2f/0x40
[ 12.535099] ? pcpu_freelist_push+0x2a/0x40
[ 12.535432] pcpu_freelist_push+0x2a/0x40
[ 12.535750] bpf_get_stackid+0x494/0x4d0
[ 12.536062] ___bpf_prog_run+0x8b4/0x11a0It has been explained that is a false positive here:
https://lkml.org/lkml/2018/7/25/756
Recap:
- stackmap uses pcpu_freelist
- The lock in pcpu_freelist is a percpu lock
- stackmap is only used by tracing bpf_prog
- A tracing bpf_prog cannot be run if another bpf_prog
has already been running (ensured by the percpu bpf_prog_active counter).
Eric pointed out that this lockdep splats stops other legit lockdep splats in selftests/bpf/test_progs.c.
Fix this by calling local_irq_save/restore for stackmap.
Another false positive had also been worked around by calling local_irq_save in commit 89ad2fa3f043 ("bpf: fix lockdep splat"). That commit added unnecessary irq_save/restore to fast path of bpf hash map. irqs are already disabled at that point, since htab is holding per bucket spin_lock with irqsave.
Let's reduce overhead for htab by introducing __pcpu_freelist_push/pop function w/o irqsave and convert pcpu_freelist_push/pop to irqsave to be used elsewhere (right now only in stackmap).
It stops lockdep false positive in stackmap with a bit of acceptable overhead.
--- kernel/bpf/hashtab.c | 4 ++-- kernel/bpf/percpu_freelist.c | 41 +++++++++++++++++++++++++----------- kernel/bpf/percpu_freelist.h | 4 ++++ 3 files changed, 35 insertions(+), 14 deletions(-)
kernel/bpf/hashtab.c +2 -2
@@ -655,7 +655,7 @@ static void free_htab_elem(struct bpf_htab *htab, struct htab_elem *l) }if (htab_is_prealloc (htab)) { -pcpu_freelist_push (&htab->freelist, &l->fnode); +__pcpu_freelist_push (&htab->freelist, &l->fnode); }else {atomic_dec (&htab->count); l->htab = htab;
@@ -717,7 +717,7 @@ static struct htab_elem *alloc_htab_elem(struct bpf_htab *htab, void *key, }else {struct pcpu_freelist_node *l; - l =pcpu_freelist_pop (&htab->freelist); + l =__pcpu_freelist_pop (&htab->freelist);if (!l)return ERR_PTR (-E2BIG ); l_new = container_of(l, struct htab_elem, fnode);
kernel/bpf/percpu_freelist.c +29 -12
86 lines not on this page · raw message
kernel/bpf/percpu_freelist.h +4 -0
@@ -22,8 +22,12 @@ struct pcpu_freelist_node {struct pcpu_freelist_node *next; }; +/* pcpu_freelist_* do spin_lock_irqsave. */ void pcpu_freelist_push (struct pcpu_freelist *,struct pcpu_freelist_node *);struct pcpu_freelist_node *pcpu_freelist_pop (struct pcpu_freelist *); +/* __pcpu_freelist_* do spin_lock only. caller must disable irqs. */ +void __pcpu_freelist_push (struct pcpu_freelist *,struct pcpu_freelist_node *); +struct pcpu_freelist_node *__pcpu_freelist_pop (struct pcpu_freelist *);void pcpu_freelist_populate (struct pcpu_freelist *s,void *buf,u32 elem_size,u32 nr_elems);int pcpu_freelist_init (struct pcpu_freelist *);
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 20/36 drm/sun4i: tcon: Prepare and enable TCON channel 0 clock at init
In reply to Sasha LevinFrom: Paul Kocialkowski <[email protected]>
[ Upstream commit b14e945bda8ae227d1bf2b1837c0c4a61721cd1a ]
When initializing clocks, a reference to the TCON channel 0 clock is obtained. However, the clock is never prepared and enabled later. Switching from simplefb to DRM actually disables the clock (that was usually configured by U-Boot) because of that.
On the V3s, this results in a hang when writing to some mixer registers when switching over to DRM from simplefb.
Fix this by preparing and enabling the clock when initializing other clocks. Waiting for sun4i_tcon_channel_enable to enable the clock is apparently too late and results in the same mixer register access hang.
--- drivers/gpu/drm/sun4i/sun4i_tcon.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/gpu/drm/sun4i/sun4i_tcon.c +2 -0
@@ -371,6 +371,7 @@ static int sun4i_tcon_init_clocks(struct device *dev,dev_err (dev,"Couldn't get the TCON channel 0 clock\n" );return PTR_ERR (tcon->sclk0); } +clk_prepare_enable (tcon->sclk0);if (tcon->quirks->has_channel_1) { tcon->sclk1 =devm_clk_get (dev,"tcon-ch1" );
@@ -385,6 +386,7 @@ static int sun4i_tcon_init_clocks(struct device *dev,static void sun4i_tcon_free_clocks (struct sun4i_tcon *tcon) { +clk_disable_unprepare (tcon->sclk0);clk_disable_unprepare (tcon->clk); }
Signature · 6 lines
2.19.1 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Sasha Levin
maintainerPATCH 21/36 dmaengine: at_xdmac: Fix wrongfull report of a channel as in use
In reply to Sasha LevinFrom: Codrin Ciubotariu <[email protected]>
[ Upstream commit dc3f595b6617ebc0307e0ce151e8f2f2b2489b95 ]
atchan->status variable is used to store two different information:
- pass channel interrupts status from interrupt handler to tasklet;
- channel information like whether it is cyclic or paused;
This causes a bug when device_terminate_all() is called, (AT_XDMAC_CHAN_IS_CYCLIC cleared on atchan->status) and then a late End of Block interrupt arrives (AT_XDMAC_CIS_BIS), which sets bit 0 of atchan->status. Bit 0 is also used for AT_XDMAC_CHAN_IS_CYCLIC, so when a new descriptor for a cyclic transfer is created, the driver reports the channel as in use:
if (test_and_set_bit(AT_XDMAC_CHAN_IS_CYCLIC, &atchan->status)) {
dev_err(chan2dev(chan), "channel currently used\n");
return NULL;
}This patch fixes the bug by adding a different struct member to keep the interrupts status separated from the channel status bits.
--- drivers/dma/at_xdmac.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
drivers/dma/at_xdmac.c +10 -9
@@ -203,6 +203,7 @@ struct at_xdmac_chan {u32 save_cim;u32 save_cnda;u32 save_cndc; +u32 irq_status;unsigned long status;struct tasklet_struct tasklet;struct dma_slave_config sconfig;
@@ -1580,8 +1581,8 @@ static void at_xdmac_tasklet(unsigned long data)struct at_xdmac_desc *desc;u32 error_mask; -dev_dbg (chan2dev (&atchan->chan),"%s: status=0x%08lx\n" , - __func__, atchan->status); +dev_dbg (chan2dev (&atchan->chan),"%s: status=0x%08x\n" , + __func__, atchan->irq_status); error_mask =AT_XDMAC_CIS_RBEIS |AT_XDMAC_CIS_WBEIS
@@ -1589,15 +1590,15 @@ static void at_xdmac_tasklet(unsigned long data)if (at_xdmac_chan_is_cyclic (atchan)) {at_xdmac_handle_cyclic (atchan); - }else if ((atchan->status &AT_XDMAC_CIS_LIS ) - || (atchan->status & error_mask)) { + }else if ((atchan->irq_status &AT_XDMAC_CIS_LIS ) + || (atchan->irq_status & error_mask)) {struct dma_async_tx_descriptor *txd; -if (atchan->status &AT_XDMAC_CIS_RBEIS ) +if (atchan->irq_status &AT_XDMAC_CIS_RBEIS )dev_err (chan2dev (&atchan->chan),"read bus error!!!" ); -if (atchan->status &AT_XDMAC_CIS_WBEIS ) +if (atchan->irq_status &AT_XDMAC_CIS_WBEIS )dev_err (chan2dev (&atchan->chan),"write bus error!!!" ); -if (atchan->status &AT_XDMAC_CIS_ROIS ) +if (atchan->irq_status &AT_XDMAC_CIS_ROIS )dev_err (chan2dev (&atchan->chan),"request overflow error!!!" );spin_lock_bh (&atchan->lock);
@@ -1652,7 +1653,7 @@ static irqreturn_t at_xdmac_interrupt(int irq, void *dev_id) atchan = &atxdmac->chan[i]; chan_imr =at_xdmac_chan_read (atchan,AT_XDMAC_CIM ); chan_status =at_xdmac_chan_read (atchan,AT_XDMAC_CIS ); - atchan->status = chan_status & chan_imr; + atchan->irq_status = chan_status & chan_imr;dev_vdbg (atxdmac->dma.dev,"%s: chan%d: imr=0x%x, status=0x%x\n" , __func__, i, chan_imr, chan_status);
@@ -1666,7 +1667,7 @@ static irqreturn_t at_xdmac_interrupt(int irq, void *dev_id)at_xdmac_chan_read (atchan,AT_XDMAC_CDA ), at_xdmac_chan_read(atchan, AT_XDMAC_CUBC)); -if (atchan->status & (AT_XDMAC_CIS_RBEIS |AT_XDMAC_CIS_WBEIS )) +if (atchan->irq_status & (AT_XDMAC_CIS_RBEIS |AT_XDMAC_CIS_WBEIS ))at_xdmac_write (atxdmac,AT_XDMAC_GD , atchan->mask);tasklet_schedule (&atchan->tasklet);
Signature · 7 lines
2.19.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 22/36 vsock/virtio: fix kernel panic after device hot-unplug
In reply to Sasha LevinFrom: Stefano Garzarella <[email protected]>
[ Upstream commit 22b5c0b63f32568e130fa2df4ba23efce3eb495b ]
virtio_vsock_remove() invokes the vsock_core_exit() also if there are opened sockets for the AF_VSOCK protocol family. In this way the vsock "transport" pointer is set to NULL, triggering the kernel panic at the first socket activity.
This patch move the vsock_core_init()/vsock_core_exit() in the virtio_vsock respectively in module_init and module_exit functions, that cannot be invoked until there are open sockets.
Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=1609699
--- net/vmw_vsock/virtio_transport.c | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-)
net/vmw_vsock/virtio_transport.c +18 -8
@@ -75,6 +75,9 @@ static u32 virtio_transport_get_local_cid(void) {struct virtio_vsock *vsock =virtio_vsock_get (); +if (!vsock) +return VMADDR_CID_ANY ; +return vsock->guest_cid; }
@@ -584,10 +587,6 @@ static int virtio_vsock_probe(struct virtio_device *vdev)virtio_vsock_update_guest_cid (vsock); - ret =vsock_core_init (&virtio_transport.transport); -if (ret <0 ) - goto out_vqs; - vsock->rx_buf_nr =0 ; vsock->rx_buf_max_nr =0 ;atomic_set (&vsock->queued_replies,0 );
@@ -618,8 +617,6 @@ static int virtio_vsock_probe(struct virtio_device *vdev)mutex_unlock (&the_virtio_vsock_mutex);return 0 ; -out_vqs: - vsock->vdev->config->del_vqs (vsock->vdev); out:kfree (vsock);mutex_unlock (&the_virtio_vsock_mutex);
@@ -669,7 +666,6 @@ static void virtio_vsock_remove(struct virtio_device *vdev)mutex_lock (&the_virtio_vsock_mutex); the_virtio_vsock =NULL ; -vsock_core_exit ();mutex_unlock (&the_virtio_vsock_mutex); vdev->config->del_vqs (vdev);
@@ -702,14 +698,28 @@ static int __init virtio_vsock_init(void) virtio_vsock_workqueue =alloc_workqueue ("virtio_vsock" ,0 ,0 );if (!virtio_vsock_workqueue)return -ENOMEM ; + ret =register_virtio_driver (&virtio_vsock_driver);if (ret) -destroy_workqueue (virtio_vsock_workqueue); + goto out_wq; + + ret =vsock_core_init (&virtio_transport.transport); +if (ret) + goto out_vdr; + +return 0 ; + +out_vdr: +unregister_virtio_driver (&virtio_vsock_driver); +out_wq: +destroy_workqueue (virtio_vsock_workqueue);return ret; + } static void __exit virtio_vsock_exit(void) { +vsock_core_exit ();unregister_virtio_driver (&virtio_vsock_driver);destroy_workqueue (virtio_vsock_workqueue); }
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 23/36 vsock/virtio: reset connected sockets on device removal
In reply to Sasha LevinFrom: Stefano Garzarella <[email protected]>
[ Upstream commit 85965487abc540368393a15491e6e7fcd230039d ]
When the virtio transport device disappear, we should reset all connected sockets in order to inform the users.
--- net/vmw_vsock/virtio_transport.c | 3 +++ 1 file changed, 3 insertions(+)
net/vmw_vsock/virtio_transport.c +3 -0
@@ -634,6 +634,9 @@ static void virtio_vsock_remove(struct virtio_device *vdev)flush_work (&vsock->event_work);flush_work (&vsock->send_pkt_work); +/* Reset all connected sockets when the device disappear */ +vsock_for_each_connected_socket (virtio_vsock_reset_sock); + vdev->config->reset (vdev);mutex_lock (&vsock->rx_lock);
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 24/36 dmaengine: dmatest: Abort test in case of mapping error
In reply to Sasha LevinFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 6454368a804c4955ccd116236037536f81e5b1f1 ]
In case of mapping error the DMA addresses are invalid and continuing will screw system memory or potentially something else.
[ 222.480310] dmatest: dma0chan7-copy0: summary 1 tests, 3 failures 6 iops 349 KB/s (0) ... [ 240.912725] check: Corrupted low memory at 00000000c7c75ac9 (2940 phys) = 5656000000000000 [ 240.921998] check: Corrupted low memory at 000000005715a1cd (2948 phys) = 279f2aca5595ab2b [ 240.931280] check: Corrupted low memory at 000000002f4024c0 (2950 phys) = 5e5624f349e793cf
...
Abort any test if mapping failed.
--- drivers/dma/dmatest.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-)
drivers/dma/dmatest.c +12 -16
@@ -626,11 +626,9 @@ static int dmatest_func(void *data) srcs[i] = um->addr[i] + src_off; ret =dma_mapping_error (dev->dev, um->addr[i]);if (ret) { -dmaengine_unmap_put (um);result ("src mapping error" , total_tests, src_off, dst_off, len, ret); - failed_tests++; -continue ; + goto error_unmap_continue; } um->to_cnt++; }
@@ -645,11 +643,9 @@ static int dmatest_func(void *data) DMA_BIDIRECTIONAL); ret =dma_mapping_error (dev->dev, dsts[i]);if (ret) { -dmaengine_unmap_put (um);result ("dst mapping error" , total_tests, src_off, dst_off, len, ret); - failed_tests++; -continue ; + goto error_unmap_continue; } um->bidi_cnt++; }
@@ -679,12 +675,10 @@ static int dmatest_func(void *data) }if (!tx) { -dmaengine_unmap_put (um);result ("prep error" , total_tests, src_off, dst_off, len, ret);msleep (100 ); - failed_tests++; -continue ; + goto error_unmap_continue; } done->done = false;
@@ -693,12 +687,10 @@ static int dmatest_func(void *data) cookie = tx->tx_submit (tx);if (dma_submit_error (cookie)) { -dmaengine_unmap_put (um);result ("submit error" , total_tests, src_off, dst_off, len, ret);msleep (100 ); - failed_tests++; -continue ; + goto error_unmap_continue; }dma_async_issue_pending (chan);
@@ -711,16 +703,14 @@ static int dmatest_func(void *data)dmaengine_unmap_put (um);result ("test timed out" , total_tests, src_off, dst_off, len,0 ); - failed_tests++; -continue ; + goto error_unmap_continue; }else if (status !=DMA_COMPLETE ) {dmaengine_unmap_put (um);result (status ==DMA_ERROR ?"completion error status" :"completion busy status" , total_tests, src_off, dst_off, len, ret); - failed_tests++; -continue ; + goto error_unmap_continue; }dmaengine_unmap_put (um);
@@ -765,6 +755,12 @@ static int dmatest_func(void *data)verbose_result ("test passed" , total_tests, src_off, dst_off, len,0 ); } + +continue ; + +error_unmap_continue: +dmaengine_unmap_put (um); + failed_tests++; } ktime =ktime_sub (ktime_get (), ktime); ktime =ktime_sub (ktime, comparetime);
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 25/36 selftests: netfilter: fix config fragment CONFIG_NF_TABLES_INET
In reply to Sasha LevinFrom: Naresh Kamboju <naresh.kamboju at linaro.org>
[ Upstream commit 952b72f89ae23b316da8c1021b18d0c388ad6cc4 ]
In selftests the config fragment for netfilter was added as NF_TABLES_INET=y and this patch correct it as CONFIG_NF_TABLES_INET=y
--- tools/testing/selftests/netfilter/config | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/testing/selftests/netfilter/config +1 -1
@@ -1,2 +1,2 @@ CONFIG_NET_NS=y -NF_TABLES_INET=y +CONFIG_NF_TABLES_INET=y
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 26/36 selftests: netfilter: add simple masq/redirect test cases
In reply to Sasha LevinFrom: Florian Westphal <[email protected]>
[ Upstream commit 98bfc3414bda335dbd7fec58bde6266f991801d7 ]
Check basic nat/redirect/masquerade for ipv4 and ipv6.
--- tools/testing/selftests/netfilter/Makefile | 2 +- tools/testing/selftests/netfilter/nft_nat.sh | 762 +++++++++++++++++++ 2 files changed, 763 insertions(+), 1 deletion(-) create mode 100755 tools/testing/selftests/netfilter/nft_nat.sh
tools/testing/selftests/netfilter/Makefile +1 -1
@@ -1,6 +1,6 @@ # SPDX-License-Identifier: GPL-2.0 # Makefile for netfilter selftests -TEST_PROGS := nft_trans_stress.sh +TEST_PROGS := nft_trans_stress.sh nft_nat.sh include ../lib.mk
tools/testing/selftests/netfilter/nft_nat.sh new file +762 -0
762 lines not on this page · raw message
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 27/36 netfilter: nf_nat: skip nat clash resolution for same-origin entries
In reply to Sasha LevinFrom: Martynas Pumputis <[email protected]>
[ Upstream commit 4e35c1cb9460240e983a01745b5f29fe3a4d8e39 ]
It is possible that two concurrent packets originating from the same socket of a connection-less protocol (e.g. UDP) can end up having different IP_CT_DIR_REPLY tuples which results in one of the packets being dropped.
To illustrate this, consider the following simplified scenario:
1. Packet A and B are sent at the same time from two different threads by same UDP socket. No matching conntrack entry exists yet. Both packets cause allocation of a new conntrack entry.
2. get_unique_tuple gets called for A. No clashing entry found. conntrack entry for A is added to main conntrack table.
3. get_unique_tuple is called for B and will find that the reply tuple of B is already taken by A.
It will allocate a new UDP source port for B to resolve the clash.
4. conntrack entry for B cannot be added to main conntrack table because its ORIGINAL direction is clashing with A and the REPLY directions of A and B are not the same anymore due to UDP source port reallocation done in step 3.
This patch modifies nf_conntrack_tuple_taken so it doesn't consider colliding reply tuples if the IP_CT_DIR_ORIGINAL tuples are equal.
[ Florian: simplify patch to not use .allow_clash setting
and always ignore identical flows ]
--- net/netfilter/nf_conntrack_core.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
net/netfilter/nf_conntrack_core.c +16 -0
@@ -869,6 +869,22 @@ nf_conntrack_tuple_taken(const struct nf_conntrack_tuple *tuple, }if (nf_ct_key_equal (h, tuple, zone, net)) { +/* Tuple is taken already, so caller will need to find +* a new source port to use. +* +* Only exception: +* If the *original tuples* are identical, then both +* conntracks refer to the same flow. +* This is a rare situation, it can occur e.g. when +* more than one UDP packet is sent from same socket +* in different threads. +* +* Let nf_ct_resolve_clash() deal with this later. +*/ +if (nf_ct_tuple_equal (&ignored_conntrack->tuplehash[IP_CT_DIR_ORIGINAL ].tuple, + &ct->tuplehash[IP_CT_DIR_ORIGINAL ].tuple)) +continue ; +NF_CT_STAT_INC_ATOMIC (net, found);rcu_read_unlock ();return 1 ;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 28/36 s390/qeth: fix use-after-free in error path
In reply to Sasha LevinFrom: Julian Wiedmann <[email protected]>
[ Upstream commit afa0c5904ba16d59b0454f7ee4c807dae350f432 ]
The error path in qeth_alloc_qdio_buffers() that takes care of cleaning up the Output Queues is buggy. It first frees the queue, but then calls qeth_clear_outq_buffers() with that very queue struct.
Make the call to qeth_clear_outq_buffers() part of the free action (in the correct order), and while at it fix the naming of the helper.
--- drivers/s390/net/qeth_core_main.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-)
drivers/s390/net/qeth_core_main.c +6 -9
@@ -2472,11 +2472,12 @@ static int qeth_init_qdio_out_buf(struct qeth_qdio_out_q *q, int bidx)return rc; } -static void qeth_free_qdio_out_buf (struct qeth_qdio_out_q *q) +static void qeth_free_output_queue (struct qeth_qdio_out_q *q) {if (!q)return ; +qeth_clear_outq_buffers (q,1 );qdio_free_buffers (q->qdio_bufs,QDIO_MAX_BUFFERS_PER_Q );kfree (q); }
@@ -2549,10 +2550,8 @@ static int qeth_alloc_qdio_buffers(struct qeth_card *card) card->qdio.out_qs[i]->bufs[j] =NULL ; } out_freeoutq: -while (i >0 ) { -qeth_free_qdio_out_buf (card->qdio.out_qs[--i]); -qeth_clear_outq_buffers (card->qdio.out_qs[i],1 ); - } +while (i >0 ) +qeth_free_output_queue (card->qdio.out_qs[--i]);kfree (card->qdio.out_qs); card->qdio.out_qs =NULL ; out_freepool:
@@ -2585,10 +2584,8 @@ static void qeth_free_qdio_buffers(struct qeth_card *card)qeth_free_buffer_pool (card);/* free outbound qdio_qs */ if (card->qdio.out_qs) { -for (i =0 ; i < card->qdio.no_out_queues; ++i) { -qeth_clear_outq_buffers (card->qdio.out_qs[i],1 ); -qeth_free_qdio_out_buf (card->qdio.out_qs[i]); - } +for (i =0 ; i < card->qdio.no_out_queues; i++) +qeth_free_output_queue (card->qdio.out_qs[i]);kfree (card->qdio.out_qs); card->qdio.out_qs =NULL ; }
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 29/36 perf symbols: Filter out hidden symbols from labels
In reply to Sasha LevinFrom: Jiri Olsa <[email protected]>
[ Upstream commit 59a17706915fe5ea6f711e1f92d4fb706bce07fe ]
When perf is built with the annobin plugin (RHEL8 build) extra symbols are added to its binary:
# nm perf | grep annobin | head -10 0000000000241100 t .annobin_annotate.c 0000000000326490 t .annobin_annotate.c 0000000000249255 t .annobin_annotate.c_end 00000000003283a8 t .annobin_annotate.c_end 00000000001bce18 t .annobin_annotate.c_end.hot 00000000001bce18 t .annobin_annotate.c_end.hot 00000000001bc3e2 t .annobin_annotate.c_end.unlikely 00000000001bc400 t .annobin_annotate.c_end.unlikely 00000000001bce18 t .annobin_annotate.c.hot 00000000001bce18 t .annobin_annotate.c.hot ...
Those symbols have no use for report or annotation and should be skipped. Moreover they interfere with the DWARF unwind test on the PPC arch, where they are mixed with checked symbols and then the test fails:
# perf test dwarf -v 59: Test dwarf unwind : --- start --- test child forked, pid 8515 unwind: .annobin_dwarf_unwind.c:ip = 0x10dba40dc (0x2740dc) ... got: .annobin_dwarf_unwind.c 0x10dba40dc, expecting test__arch_unwind_sample unwind: failed with 'no error'
The annobin symbols are defined as NOTYPE/LOCAL/HIDDEN:
# readelf -s ./perf | grep annobin | head -1
40: 00000000001bce4f 0 NOTYPE LOCAL HIDDEN 13 .annobin_init.cThey can still pass the check for the label symbol. Adding check for HIDDEN and INTERNAL (as suggested by Nick below) visibility and filter out such symbols.
Quoted 4 lines
Just to be awkward, if you are going to ignore
STV_HIDDENsymbols then you should probably also ignoreSTV_INTERNALones as well... Annobin does not generate them, but you never know, one day some other tool might create some.
--- tools/perf/util/symbol-elf.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-)
tools/perf/util/symbol-elf.c +8 -1
@@ -87,6 +87,11 @@ static inline uint8_t elf_sym__type(const GElf_Sym *sym)return GELF_ST_TYPE (sym->st_info); } +static inline uint8_t elf_sym__visibility (const GElf_Sym *sym) +{ +return GELF_ST_VISIBILITY (sym->st_other); +} +#ifndef STT_GNU_IFUNC #define STT_GNU_IFUNC 10#endif
@@ -111,7 +116,9 @@ static inline int elf_sym__is_label(const GElf_Sym *sym)return elf_sym__type (sym) ==STT_NOTYPE && sym->st_name !=0 && sym->st_shndx !=SHN_UNDEF && - sym->st_shndx !=SHN_ABS ; + sym->st_shndx !=SHN_ABS && +elf_sym__visibility (sym) !=STV_HIDDEN && +elf_sym__visibility (sym) !=STV_INTERNAL ; }static bool elf_sym__is_a (GElf_Sym *sym,enum map_type type)
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 30/36 perf trace: Support multiple "vfs_getname" probes
In reply to Sasha LevinFrom: Arnaldo Carvalho de Melo <[email protected]>
[ Upstream commit 6ab3bc240ade47a0f52bc16d97edd9accbe0024e ]
With a suitably defined "probe:vfs_getname" probe, 'perf trace' can "beautify" its output, so syscalls like open() or openat() can print the "filename" argument instead of just its hex address, like:
$ perf trace -e open -- touch /dev/null
[...]
0.590 ( 0.014 ms): touch/18063 open(filename: /dev/null, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3
[...]The output without such beautifier looks like:
0.529 ( 0.011 ms): touch/18075 open(filename: 0xc78cf288, flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3
However, when the vfs_getname probe expands to multiple probes and it is not the first one that is hit, the beautifier fails, as following:
0.326 ( 0.010 ms): touch/18072 open(filename: , flags: CREAT|NOCTTY|NONBLOCK|WRONLY, mode: IRUGO|IWUGO) = 3
Fix it by hooking into all the expanded probes (inlines), now, for instance:
[root@quaco ~]# perf probe -l
probe:vfs_getname (on getname_flags:73@fs/namei.c with pathname)
probe:vfs_getname_1 (on getname_flags:73@fs/namei.c with pathname)
[root@quaco ~]# perf trace -e open* sleep 1
0.010 ( 0.005 ms): sleep/5588 openat(dfd: CWD, filename: /etc/ld.so.cache, flags: RDONLY|CLOEXEC) = 3
0.029 ( 0.006 ms): sleep/5588 openat(dfd: CWD, filename: /lib64/libc.so.6, flags: RDONLY|CLOEXEC) = 3
0.194 ( 0.008 ms): sleep/5588 openat(dfd: CWD, filename: /usr/lib/locale/locale-archive, flags: RDONLY|CLOEXEC) = 3[root@quaco ~]#
Works, further verified with:
[root@quaco ~]# perf test vfs
65: Use vfs_getname probe to get syscall args filenames : Ok
66: Add vfs_getname probe to get syscall args filenames : Ok
67: Check open filename arg using perf trace + vfs_getname: Ok [root@quaco ~]#
--- tools/perf/builtin-trace.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-)
tools/perf/builtin-trace.c +18 -7
@@ -2109,19 +2109,30 @@ static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp);static bool perf_evlist__add_vfs_getname (struct perf_evlist *evlist) { -struct perf_evsel *evsel =perf_evsel__newtp ("probe" ,"vfs_getname" ); +bool found = false; +struct perf_evsel *evsel, *tmp; +struct parse_events_error err = { .idx =0 , }; +int ret =parse_events (evlist,"probe:vfs_getname*" , &err); -if (IS_ERR (evsel)) +if (ret)return false; -if (perf_evsel__field (evsel,"pathname" ) ==NULL ) { +evlist__for_each_entry_safe (evlist, evsel, tmp) { +if (!strstarts (perf_evsel__name (evsel),"probe:vfs_getname" )) +continue ; + +if (perf_evsel__field (evsel,"pathname" )) { + evsel->handler = trace__vfs_getname; + found = true; +continue ; + } + +list_del_init (&evsel->node); + evsel->evlist =NULL ;perf_evsel__delete (evsel); -return false; } - evsel->handler = trace__vfs_getname; -perf_evlist__add (evlist, evsel); -return true; +return found; }static struct perf_evsel *perf_evsel__new_pgfault (u64 config)
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 31/36 MIPS: Loongson: Introduce and use loongson_llsc_mb()
In reply to Sasha LevinFrom: Huacai Chen <[email protected]>
[ Upstream commit e02e07e3127d8aec1f4bcdfb2fc52a2d99b4859e ]
On the Loongson-2G/2H/3A/3B there is a hardware flaw that ll/sc and lld/scd is very weak ordering. We should add sync instructions "before each ll/lld" and "at the branch-target between ll/sc" to workaround. Otherwise, this flaw will cause deadlock occasionally (e.g. when doing heavy load test with LTP).
Below is the explaination of CPU designer:
"For Loongson 3 family, when a memory access instruction (load, store, or prefetch)'s executing occurs between the execution of LL and SC, the success or failure of SC is not predictable. Although programmer would not insert memory access instructions between LL and SC, the memory instructions before LL in program-order, may dynamically executed between the execution of LL/SC, so a memory fence (SYNC) is needed before LL/LLD to avoid this situation.
Since Loongson-3A R2 (3A2000), we have improved our hardware design to handle this case. But we later deduce a rarely circumstance that some speculatively executed memory instructions due to branch misprediction between LL/SC still fall into the above case, so a memory fence (SYNC) at branch-target (if its target is not between LL/SC) is needed for Loongson 3A1000, 3B1500, 3A2000 and 3A3000.
Our processor is continually evolving and we aim to to remove all these workaround-SYNCs around LL/SC for new-come processor."
Here is an example:
Both cpu1 and cpu2 simutaneously run atomic_add by 1 on same atomic var, this bug cause both 'sc' run by two cpus (in atomic_add) succeed at same time('sc' return 1), and the variable is only *added by 1*, sometimes, which is wrong and unacceptable(it should be added by 2).
Why disable fix-loongson3-llsc in compiler?
Because compiler fix will cause problems in kernel's __ex_table section.
This patch fix all the cases in kernel, but:
+. the fix at the end of futex_atomic_cmpxchg_inatomic is for branch-target of 'bne', there other cases which smp_mb__before_llsc() and smp_llsc_mb() fix the ll and branch-target coincidently such as atomic_sub_if_positive/ cmpxchg/xchg, just like this one.
+. Loongson 3 does support CONFIG_EDAC_ATOMIC_SCRUB, so no need to touch edac.h
+. local_ops and cmpxchg_local should not be affected by this bug since only the owner can write.
+. mips_atomic_set for syscall.c is deprecated and rarely used, just let it go
[[email protected]:
- Simplify the addition of -mno-fix-loongson3-llsc to cflags, and add a comment describing why it's there.
- Make loongson_llsc_mb() a no-op when CONFIG_CPU_LOONGSON3_WORKAROUNDS=n, rather than a compiler memory barrier.
- Add a comment describing the bug & how loongson_llsc_mb() helps in asm/barrier.h.]
--- arch/mips/Kconfig | 15 ++++++++++++++ arch/mips/include/asm/atomic.h | 6 ++++++ arch/mips/include/asm/barrier.h | 36 +++++++++++++++++++++++++++++++++ arch/mips/include/asm/bitops.h | 5 +++++ arch/mips/include/asm/futex.h | 3 +++ arch/mips/include/asm/pgtable.h | 2 ++ arch/mips/loongson64/Platform | 23 +++++++++++++++++++++ arch/mips/mm/tlbex.c | 10 +++++++++ 8 files changed, 100 insertions(+)
arch/mips/Kconfig +15 -0
@@ -1407,6 +1407,21 @@ config LOONGSON3_ENHANCEMENT please say 'N' here. If you want a high-performance kernel to run on new Loongson 3 machines only, please say 'Y' here. +config CPU_LOONGSON3_WORKAROUNDS + bool "Old Loongson 3 LLSC Workarounds" + default y if SMP + depends on CPU_LOONGSON3 + help + Loongson 3 processors have the llsc issues which require workarounds. + Without workarounds the system may hang unexpectedly. + + Newer Loongson 3 will fix these issues and no workarounds are needed. + The workarounds have no significant side effect on them but may + decrease the performance of the system so this option should be + disabled unless the kernel is intended to be run on old systems. + + If unsure, please say Y. + config CPU_LOONGSON2E bool "Loongson 2E" depends on SYS_HAS_CPU_LOONGSON2E
arch/mips/include/asm/atomic.h +6 -0
@@ -47,6 +47,7 @@ static __inline__ void atomic_##op(int i, atomic_t * v) \if (kernel_uses_llsc &&R10000_LLSC_WAR ) { \int temp; \ \ +loongson_llsc_mb (); \ __asm__ __volatile__( \ " .set arch=r4000 \n" \ "1: ll %0, %1 # atomic_" #op " \n" \
@@ -86,6 +87,7 @@ static __inline__ int atomic_##op##_return_relaxed(int i, atomic_t * v) \if (kernel_uses_llsc &&R10000_LLSC_WAR ) { \int temp; \ \ +loongson_llsc_mb (); \ __asm__ __volatile__( \ " .set arch=r4000 \n" \ "1: ll %1, %2 # atomic_" #op "_return \n" \
@@ -134,6 +136,7 @@ static __inline__ int atomic_fetch_##op##_relaxed(int i, atomic_t * v) \if (kernel_uses_llsc &&R10000_LLSC_WAR ) { \int temp; \ \ +loongson_llsc_mb (); \ __asm__ __volatile__( \ " .set arch=r4000 \n" \ "1: ll %1, %2 # atomic_fetch_" #op " \n" \
@@ -389,6 +392,7 @@ static __inline__ void atomic64_##op(long i, atomic64_t * v) \if (kernel_uses_llsc &&R10000_LLSC_WAR ) { \long temp; \ \ +loongson_llsc_mb (); \ __asm__ __volatile__( \ " .set arch=r4000 \n" \ "1: lld %0, %1 # atomic64_" #op " \n" \
@@ -428,6 +432,7 @@ static __inline__ long atomic64_##op##_return_relaxed(long i, atomic64_t * v) \if (kernel_uses_llsc &&R10000_LLSC_WAR ) { \long temp; \ \ +loongson_llsc_mb (); \ __asm__ __volatile__( \ " .set arch=r4000 \n" \ "1: lld %1, %2 # atomic64_" #op "_return\n" \
@@ -477,6 +482,7 @@ static __inline__ long atomic64_fetch_##op##_relaxed(long i, atomic64_t * v) \if (kernel_uses_llsc &&R10000_LLSC_WAR ) { \long temp; \ \ +loongson_llsc_mb (); \ __asm__ __volatile__( \ " .set arch=r4000 \n" \ "1: lld %1, %2 # atomic64_fetch_" #op "\n" \
arch/mips/include/asm/barrier.h +36 -0
@@ -222,6 +222,42 @@#define __smp_mb__before_atomic () __smp_mb__before_llsc()#define __smp_mb__after_atomic () smp_llsc_mb() +/* +* Some Loongson 3 CPUs have a bug wherein execution of a memory access (load, +* store or pref) in between an ll & sc can cause the sc instruction to +* erroneously succeed, breaking atomicity. Whilst it's unusual to write code +* containing such sequences, this bug bites harder than we might otherwise +* expect due to reordering & speculation: +* +* 1) A memory access appearing prior to the ll in program order may actually +* be executed after the ll - this is the reordering case. +* +* In order to avoid this we need to place a memory barrier (ie. a sync +* instruction) prior to every ll instruction, in between it & any earlier +* memory access instructions. Many of these cases are already covered by +* smp_mb__before_llsc() but for the remaining cases, typically ones in +* which multiple CPUs may operate on a memory location but ordering is not +* usually guaranteed, we use loongson_llsc_mb() below. +* +* This reordering case is fixed by 3A R2 CPUs, ie. 3A2000 models and later. +* +* 2) If a conditional branch exists between an ll & sc with a target outside +* of the ll-sc loop, for example an exit upon value mismatch in cmpxchg() +* or similar, then misprediction of the branch may allow speculative +* execution of memory accesses from outside of the ll-sc loop. +* +* In order to avoid this we need a memory barrier (ie. a sync instruction) +* at each affected branch target, for which we also use loongson_llsc_mb() +* defined below. +* +* This case affects all current Loongson 3 CPUs. +*/ +#ifdef CONFIG_CPU_LOONGSON3_WORKAROUNDS /* Loongson-3's LLSC workaround */ +#define loongson_llsc_mb () __asm__ __volatile__(__WEAK_LLSC_MB : : :"memory") +#else +#define loongson_llsc_mb () do { } while (0) +#endif +#include <asm-generic/barrier.h> #endif /* __ASM_BARRIER_H */
arch/mips/include/asm/bitops.h +5 -0
@@ -68,6 +68,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) : "ir" (1UL << bit), GCC_OFF_SMALL_ASM() (*m)); #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) }else if (kernel_uses_llsc &&__builtin_constant_p (bit)) { +loongson_llsc_mb (); do { __asm__ __volatile__( " " __LL "%0, %1 # set_bit \n"
@@ -78,6 +79,7 @@ static inline void set_bit(unsigned long nr, volatile unsigned long *addr) } while (unlikely(!temp));#endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */ }else if (kernel_uses_llsc) { +loongson_llsc_mb (); do { __asm__ __volatile__( " .set "MIPS_ISA_ARCH_LEVEL" \n"
@@ -120,6 +122,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) : "ir" (~(1UL << bit))); #if defined(CONFIG_CPU_MIPSR2) || defined(CONFIG_CPU_MIPSR6) }else if (kernel_uses_llsc &&__builtin_constant_p (bit)) { +loongson_llsc_mb (); do { __asm__ __volatile__( " " __LL "%0, %1 # clear_bit \n"
@@ -130,6 +133,7 @@ static inline void clear_bit(unsigned long nr, volatile unsigned long *addr) } while (unlikely(!temp));#endif /* CONFIG_CPU_MIPSR2 || CONFIG_CPU_MIPSR6 */ }else if (kernel_uses_llsc) { +loongson_llsc_mb (); do { __asm__ __volatile__( " .set "MIPS_ISA_ARCH_LEVEL" \n"
@@ -188,6 +192,7 @@ static inline void change_bit(unsigned long nr, volatile unsigned long *addr)unsigned long *m = ((unsigned long *) addr) + (nr >>SZLONG_LOG );unsigned long temp; +loongson_llsc_mb (); do { __asm__ __volatile__( " .set "MIPS_ISA_ARCH_LEVEL" \n"
arch/mips/include/asm/futex.h +3 -0
@@ -50,6 +50,7 @@ "i" (-EFAULT) \ : "memory"); \ } else if (cpu_has_llsc) { \ + loongson_llsc_mb(); \ __asm__ __volatile__( \ " .set push \n" \ " .set noat \n" \
@@ -162,6 +163,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, "i" (-EFAULT) : "memory"); }else if (cpu_has_llsc) { +loongson_llsc_mb (); __asm__ __volatile__("# futex_atomic_cmpxchg_inatomic \n" " .set push \n"
@@ -190,6 +192,7 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, : GCC_OFF_SMALL_ASM() (*uaddr), "Jr" (oldval), "Jr" (newval), "i" (-EFAULT) : "memory"); +loongson_llsc_mb (); }else return -ENOSYS ;
arch/mips/include/asm/pgtable.h +2 -0
@@ -229,6 +229,7 @@ static inline void set_pte(pte_t *ptep, pte_t pteval) : [buddy] "+m" (buddy->pte), [tmp] "=&r" (tmp) : [global] "r" (page_global)); } else if (kernel_uses_llsc) { +loongson_llsc_mb (); __asm__ __volatile__ (" .set " MIPS_ISA_ARCH_LEVEL " \n" " .set push \n"
@@ -244,6 +245,7 @@ static inline void set_pte(pte_t *ptep, pte_t pteval)" .set mips0 \n" : [buddy] "+m" (buddy->pte), [tmp] "=&r" (tmp) : [global] "r" (page_global)); + loongson_llsc_mb(); }#else /* !CONFIG_SMP */ if (pte_none (*buddy))
arch/mips/loongson64/Platform +23 -0
@@ -23,6 +23,29 @@ ifdef CONFIG_CPU_LOONGSON2F_WORKAROUNDS endif cflags-$(CONFIG_CPU_LOONGSON3) += -Wa,--trap + +# +# Some versions of binutils, not currently mainline as of 2019/02/04, support +# an -mfix-loongson3-llsc flag which emits a sync prior to each ll instruction +# to work around a CPU bug (see loongson_llsc_mb() in asm/barrier.h for a +# description). +# +# We disable this in order to prevent the assembler meddling with the +# instruction that labels refer to, ie. if we label an ll instruction: +# +# 1: ll v0, 0(a0) +# +# ...then with the assembler fix applied the label may actually point at a sync +# instruction inserted by the assembler, and if we were using the label in an +# exception table the table would no longer contain the address of the ll +# instruction. +# +# Avoid this by explicitly disabling that assembler behaviour. If upstream +# binutils does not merge support for the flag then we can revisit & remove +# this later - for now it ensures vendor toolchains don't cause problems. +# +cflags-$(CONFIG_CPU_LOONGSON3) += $(call as-option,-Wa$(comma)-mno-fix-loongson3-llsc,) + # # binutils from v2.25 on and gcc starting from v4.9.0 treat -march=loongson3a # as MIPS64 R2; older versions as just R1. This leaves the possibility open
arch/mips/mm/tlbex.c +10 -0
@@ -935,6 +935,8 @@ build_get_pgd_vmalloc64(u32 **p, struct uasm_label **l, struct uasm_reloc **r,* to mimic that here by taking a load/istream page * fault. */ +if (IS_ENABLED (CONFIG_CPU_LOONGSON3_WORKAROUNDS )) +uasm_i_sync (p,0 );UASM_i_LA (p, ptr, (unsigned long )tlb_do_page_fault_0);uasm_i_jr (p, ptr);
@@ -1660,6 +1662,8 @@ static void iPTE_LW(u32 **p, unsigned int pte, unsigned int ptr) {#ifdef CONFIG_SMP +if (IS_ENABLED (CONFIG_CPU_LOONGSON3_WORKAROUNDS )) +uasm_i_sync (p,0 );# ifdef CONFIG_PHYS_ADDR_T_64BIT if (cpu_has_64bits)uasm_i_lld (p, pte,0 , ptr);
@@ -2277,6 +2281,8 @@ static void build_r4000_tlb_load_handler(void)#endif uasm_l_nopage_tlbl (&l, p); +if (IS_ENABLED (CONFIG_CPU_LOONGSON3_WORKAROUNDS )) +uasm_i_sync (&p,0 );build_restore_work_registers (&p);#ifdef CONFIG_CPU_MICROMIPS if ((unsigned long )tlb_do_page_fault_0 &1 ) {
@@ -2332,6 +2338,8 @@ static void build_r4000_tlb_store_handler(void)#endif uasm_l_nopage_tlbs (&l, p); +if (IS_ENABLED (CONFIG_CPU_LOONGSON3_WORKAROUNDS )) +uasm_i_sync (&p,0 );build_restore_work_registers (&p);#ifdef CONFIG_CPU_MICROMIPS if ((unsigned long )tlb_do_page_fault_1 &1 ) {
@@ -2388,6 +2396,8 @@ static void build_r4000_tlb_modify_handler(void)#endif uasm_l_nopage_tlbm (&l, p); +if (IS_ENABLED (CONFIG_CPU_LOONGSON3_WORKAROUNDS )) +uasm_i_sync (&p,0 );build_restore_work_registers (&p);#ifdef CONFIG_CPU_MICROMIPS if ((unsigned long )tlb_do_page_fault_1 &1 ) {
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 32/36 MIPS: Remove function size check in get_frame_info()
In reply to Sasha LevinFrom: Jun-Ru Chang <[email protected]>
[ Upstream commit 2b424cfc69728224fcb5fad138ea7260728e0901 ]
Patch (b6c7a324df37b "MIPS: Fix get_frame_info() handling of microMIPS function size.") introduces additional function size check for microMIPS by only checking insn between ip and ip + func_size. However, func_size in get_frame_info() is always 0 if KALLSYMS is not enabled. This causes get_frame_info() to return immediately without calculating correct frame_size, which in turn causes "Can't analyze schedule() prologue" warning messages at boot time.
This patch removes func_size check, and let the frame_size check run up to 128 insns for both MIPS and microMIPS.
--- arch/mips/kernel/process.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
arch/mips/kernel/process.c +3 -4
@@ -370,7 +370,7 @@ static inline int is_sp_move_ins(union mips_instruction *ip, int *frame_size)static int get_frame_info (struct mips_frame_info *info) {bool is_mmips =IS_ENABLED (CONFIG_CPU_MICROMIPS ); -union mips_instruction insn, *ip, *ip_end; +union mips_instruction insn, *ip;const unsigned int max_insns =128 ;unsigned int last_insn_size =0 ;unsigned int i;
@@ -383,10 +383,9 @@ static int get_frame_info(struct mips_frame_info *info)if (!ip) goto err; - ip_end = (void *)ip + info->func_size; - -for (i =0 ; i < max_insns && ip < ip_end; i++) { +for (i =0 ; i < max_insns; i++) { ip = (void *)ip + last_insn_size; +if (is_mmips &&mm_insn_16bit (ip->halfword[0 ])) { insn.word = ip->halfword[0 ] <<16 ; last_insn_size =2 ;
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 33/36 i2c: omap: Use noirq system sleep pm ops to idle device for suspend
In reply to Sasha LevinFrom: Tony Lindgren <[email protected]>
[ Upstream commit c6e2bd956936d925748581e4d0294f10f1d92f2c ]
We currently get the following error with pixcir_ts driver during a suspend resume cycle:
omap_i2c 4802a000.i2c: controller timed outpixcir_ts 1-005c: pixcir_int_enable: can't read reg 0x34 : -110 pixcir_ts 1-005c: Failed to disable interrupt generation: -110 pixcir_ts 1-005c: Failed to stopdpm_run_callback(): pixcir_i2c_ts_resume+0x0/0x98 [pixcir_i2c_ts] returns -110
PM: Device 1-005c failed to resume: error -110
And at least am437x based devices with pixcir_ts will fail to resume to a touchscreen that is configured as the wakeup-source in device tree for these devices.
This is because pixcir_ts tries to reconfigure it's registers for noirq suspend which fails. This also leaves i2c-omap in enabled state for suspend.
Let's fix the pixcir_ts issue and make sure i2c-omap is suspended by adding SET_NOIRQ_SYSTEM_SLEEP_PM_OPS.
Let's also get rid of some ifdefs while at it and replace them with __maybe_unused as SET_RUNTIME_PM_OPS and SET_NOIRQ_SYSTEM_SLEEP_PM_OPS already deal with the various PM Kconfig options.
--- drivers/i2c/busses/i2c-omap.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/i2c/busses/i2c-omap.c +5 -8
@@ -1477,8 +1477,7 @@ static int omap_i2c_remove(struct platform_device *pdev)return 0 ; } -#ifdef CONFIG_PM -static int omap_i2c_runtime_suspend (struct device *dev) +static int __maybe_unused omap_i2c_runtime_suspend (struct device *dev) {struct omap_i2c_dev *omap =dev_get_drvdata (dev);
@@ -1504,7 +1503,7 @@ static int omap_i2c_runtime_suspend(struct device *dev)return 0 ; } -static int omap_i2c_runtime_resume (struct device *dev) +static int __maybe_unused omap_i2c_runtime_resume (struct device *dev) {struct omap_i2c_dev *omap =dev_get_drvdata (dev);
@@ -1519,20 +1518,18 @@ static int omap_i2c_runtime_resume(struct device *dev) }static const struct dev_pm_ops omap_i2c_pm_ops = { + SET_NOIRQ_SYSTEM_SLEEP_PM_OPS(pm_runtime_force_suspend, + pm_runtime_force_resume)SET_RUNTIME_PM_OPS (omap_i2c_runtime_suspend, omap_i2c_runtime_resume,NULL ) }; -#define OMAP_I2C_PM_OPS (&omap_i2c_pm_ops) -#else -#define OMAP_I2C_PM_OPS NULL -#endif /* CONFIG_PM */ static struct platform_driver omap_i2c_driver = { .probe = omap_i2c_probe, .remove = omap_i2c_remove, .driver = { .name ="omap_i2c" , - .pm =OMAP_I2C_PM_OPS , + .pm = &omap_i2c_pm_ops, .of_match_table =of_match_ptr (omap_i2c_of_match), }, };
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 34/36 fs: ratelimit __find_get_block_slow() failure message.
In reply to Sasha LevinFrom: Tetsuo Handa <[email protected]>
[ Upstream commit 43636c804df0126da669c261fc820fb22f62bfc2 ]
When something let __find_get_block_slow() hit all_mapped path, it calls printk() for 100+ times per a second. But there is no need to print same message with such high frequency; it is just asking for stall warning, or at least bloating log files.
[ 399.866302][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8 [ 399.873324][T15342] b_state=0x00000029, b_size=512 [ 399.878403][T15342] device loop0 blocksize: 4096 [ 399.883296][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8 [ 399.890400][T15342] b_state=0x00000029, b_size=512 [ 399.895595][T15342] device loop0 blocksize: 4096 [ 399.900556][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8 [ 399.907471][T15342] b_state=0x00000029, b_size=512 [ 399.912506][T15342] device loop0 blocksize: 4096
This patch reduces frequency to up to once per a second, in addition to concatenating three lines into one.
[ 399.866302][T15342] __find_get_block_slow() failed. block=1, b_blocknr=8, b_state=0x00000029, b_size=512, device loop0 blocksize: 4096
--- fs/buffer.c | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-)
fs/buffer.c +10 -9
@@ -208,6 +208,7 @@ __find_get_block_slow(struct block_device *bdev, sector_t block)struct buffer_head *head;struct page *page;int all_mapped =1 ; + static DEFINE_RATELIMIT_STATE(last_warned, HZ, 1); index = block >> (PAGE_SHIFT - bd_inode->i_blkbits); page =find_get_page_flags (bd_mapping, index,FGP_ACCESSED );
@@ -235,15 +236,15 @@ __find_get_block_slow(struct block_device *bdev, sector_t block)* file io on the block device and getblk. It gets dealt with * elsewhere, don't buffer_error if we had some unmapped buffers */ -if (all_mapped) { -printk ("__find_get_block_slow() failed. " -"block=%llu, b_blocknr=%llu\n" , - (unsigned long long )block, - (unsigned long long )bh->b_blocknr); -printk ("b_state=0x%08lx, b_size=%zu\n" , - bh->b_state, bh->b_size); -printk ("device %pg blocksize: %d\n" , bdev, -1 << bd_inode->i_blkbits); +ratelimit_set_flags (&last_warned,RATELIMIT_MSG_ON_RELEASE ); +if (all_mapped &&__ratelimit (&last_warned)) { +printk ("__find_get_block_slow() failed. block=%llu, " +"b_blocknr=%llu, b_state=0x%08lx, b_size=%zu, " +"device %pg blocksize: %d\n" , + (unsigned long long )block, + (unsigned long long )bh->b_blocknr, + bh->b_state, bh->b_size, bdev, +1 << bd_inode->i_blkbits); } out_unlock:spin_unlock (&bd_mapping->private_lock);
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 35/36 qed: Fix EQ full firmware assert.
In reply to Sasha LevinFrom: Manish Chopra <[email protected]>
[ Upstream commit 660492bcf4a7561b5fdc13be0ae0b0c0a8c120be ]
When slowpath messages are sent with high rate, the resulting events can lead to a FW assert in case they are not handled fast enough (Event Queue Full assert). Attempt to send queued slowpath messages only after the newly evacuated entries in the EQ ring are indicated to FW.
--- drivers/net/ethernet/qlogic/qed/qed_sp.h | 1 + drivers/net/ethernet/qlogic/qed/qed_spq.c | 15 +++++++-------- 2 files changed, 8 insertions(+), 8 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_sp.h +1 -0
@@ -380,6 +380,7 @@ void qed_consq_setup(struct qed_hwfn *p_hwfn);* @param p_hwfn */ void qed_consq_free (struct qed_hwfn *p_hwfn); +int qed_spq_pend_post (struct qed_hwfn *p_hwfn);/** * @file
drivers/net/ethernet/qlogic/qed/qed_spq.c +7 -8
@@ -404,6 +404,11 @@ int qed_eq_completion(struct qed_hwfn *p_hwfn, void *cookie)qed_eq_prod_update (p_hwfn,qed_chain_get_prod_idx (p_chain)); +/* Attempt to post pending requests */ +spin_lock_bh (&p_hwfn->p_spq->lock); + rc =qed_spq_pend_post (p_hwfn); +spin_unlock_bh (&p_hwfn->p_spq->lock); +return rc; }
@@ -747,7 +752,7 @@ static int qed_spq_post_list(struct qed_hwfn *p_hwfn,return 0 ; } -static int qed_spq_pend_post (struct qed_hwfn *p_hwfn) +int qed_spq_pend_post (struct qed_hwfn *p_hwfn) {struct qed_spq *p_spq = p_hwfn->p_spq;struct qed_spq_entry *p_ent =NULL ;
@@ -879,7 +884,6 @@ int qed_spq_completion(struct qed_hwfn *p_hwfn,struct qed_spq_entry *p_ent =NULL ;struct qed_spq_entry *tmp;struct qed_spq_entry *found =NULL ; -int rc;if (!p_hwfn)return -EINVAL ;
@@ -937,12 +941,7 @@ int qed_spq_completion(struct qed_hwfn *p_hwfn,*/ qed_spq_return_entry (p_hwfn, found); -/* Attempt to post pending requests */ -spin_lock_bh (&p_spq->lock); - rc =qed_spq_pend_post (p_hwfn); -spin_unlock_bh (&p_spq->lock); - -return rc; +return 0 ; }int qed_consq_alloc (struct qed_hwfn *p_hwfn)
Signature · 1 line
2.19.1
Sasha Levin
maintainerPATCH 36/36 qed: Consider TX tcs while deriving the max num_queues for PF.
In reply to Sasha LevinFrom: Sudarsana Reddy Kalluru <[email protected]>
[ Upstream commit fb1faab74ddef9ec2d841d54e5d0912a097b3abe ]
Max supported queues is derived incorrectly in the case of multi-CoS. Need to consider TCs while calculating num_queues for PF.
--- drivers/net/ethernet/qlogic/qed/qed_l2.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/qlogic/qed/qed_l2.c +3 -2
@@ -2161,7 +2161,7 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,u16 num_queues =0 ;/* Since the feature controls only queue-zones, -* make sure we have the contexts [rx, tx, xdp] to +* make sure we have the contexts [rx, xdp, tcs] to * match. */ for_each_hwfn (cdev, i) {
@@ -2171,7 +2171,8 @@ static int qed_fill_eth_dev_info(struct qed_dev *cdev,u16 cids; cids = hwfn->pf_params.eth_pf_params.num_cons; - num_queues +=min_t (u16, l2_queues, cids /3 ); + cids /= (2 + info->num_tc); + num_queues +=min_t (u16, l2_queues, cids); }/* queues might theoretically be >256, but interrupts'
Signature · 1 line
2.19.1