From 39016d5e01e14227579d67b8921b5579dbfbe17c Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Thu, 4 Dec 2014 15:57:06 -0800 Subject: [PATCH] 3.17-stable patches added patches: bnx2fc-do-not-add-shared-skbs-to-the-fcoe_rx_list.patch clk-divider-fix-read_only-when-divider-1.patch irqchip-atmel-aic-fix-irqdomain-initialization.patch --- ...-add-shared-skbs-to-the-fcoe_rx_list.patch | 72 ++++++++++++ ...divider-fix-read_only-when-divider-1.patch | 109 ++++++++++++++++++ ...mel-aic-fix-irqdomain-initialization.patch | 53 +++++++++ queue-3.17/series | 3 + 4 files changed, 237 insertions(+) create mode 100644 queue-3.17/bnx2fc-do-not-add-shared-skbs-to-the-fcoe_rx_list.patch create mode 100644 queue-3.17/clk-divider-fix-read_only-when-divider-1.patch create mode 100644 queue-3.17/irqchip-atmel-aic-fix-irqdomain-initialization.patch diff --git a/queue-3.17/bnx2fc-do-not-add-shared-skbs-to-the-fcoe_rx_list.patch b/queue-3.17/bnx2fc-do-not-add-shared-skbs-to-the-fcoe_rx_list.patch new file mode 100644 index 00000000000..d8c51d05a17 --- /dev/null +++ b/queue-3.17/bnx2fc-do-not-add-shared-skbs-to-the-fcoe_rx_list.patch @@ -0,0 +1,72 @@ +From 01a4cc4d0cd6a836c7b923760e8eb1cbb6a47258 Mon Sep 17 00:00:00 2001 +From: Maurizio Lombardi +Date: Thu, 20 Nov 2014 11:17:33 +0100 +Subject: bnx2fc: do not add shared skbs to the fcoe_rx_list + +From: Maurizio Lombardi + +commit 01a4cc4d0cd6a836c7b923760e8eb1cbb6a47258 upstream. + +In some cases, the fcoe_rx_list may contains multiple instances +of the same skb (the so called "shared skbs"). + +the bnx2fc_l2_rcv thread is a loop that extracts a skb from the list, +modifies (and destroys) its content and then proceed to the next one. +The problem is that if the skb is shared, the remaining instances will +be corrupted. + +The solution is to use skb_share_check() before adding the skb to the +fcoe_rx_list. + +[ 6286.808725] ------------[ cut here ]------------ +[ 6286.808729] WARNING: at include/scsi/fc_frame.h:173 bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc]() +[ 6286.808748] Modules linked in: bnx2x(-) mdio dm_service_time bnx2fc cnic uio fcoe libfcoe 8021q garp stp mrp libfc llc scsi_transport_fc scsi_tgt sg iTCO_wdt iTCO_vendor_support coretemp kvm_intel kvm crct10dif_pclmul crc32_pclmul crc32c_intel e1000e ghash_clmulni_intel aesni_intel lrw gf128mul glue_helper ablk_helper ptp cryptd hpilo serio_raw hpwdt lpc_ich pps_core ipmi_si pcspkr mfd_core ipmi_msghandler shpchp pcc_cpufreq mperf nfsd auth_rpcgss nfs_acl lockd sunrpc dm_multipath xfs libcrc32c ata_generic pata_acpi sd_mod crc_t10dif crct10dif_common mgag200 syscopyarea sysfillrect sysimgblt i2c_algo_bit ata_piix drm_kms_helper ttm drm libata i2c_core hpsa dm_mirror dm_region_hash dm_log dm_mod [last unloaded: mdio] +[ 6286.808750] CPU: 3 PID: 1304 Comm: bnx2fc_l2_threa Not tainted 3.10.0-121.el7.x86_64 #1 +[ 6286.808750] Hardware name: HP ProLiant DL120 G7, BIOS J01 07/01/2013 +[ 6286.808752] 0000000000000000 000000000b36e715 ffff8800deba1e00 ffffffff815ec0ba +[ 6286.808753] ffff8800deba1e38 ffffffff8105dee1 ffffffffa05618c0 ffff8801e4c81888 +[ 6286.808754] ffffe8ffff663868 ffff8801f402b180 ffff8801f56bc000 ffff8800deba1e48 +[ 6286.808754] Call Trace: +[ 6286.808759] [] dump_stack+0x19/0x1b +[ 6286.808762] [] warn_slowpath_common+0x61/0x80 +[ 6286.808763] [] warn_slowpath_null+0x1a/0x20 +[ 6286.808765] [] bnx2fc_l2_rcv_thread+0x425/0x450 [bnx2fc] +[ 6286.808767] [] ? bnx2fc_disable+0x90/0x90 [bnx2fc] +[ 6286.808769] [] kthread+0xcf/0xe0 +[ 6286.808770] [] ? kthread_create_on_node+0x140/0x140 +[ 6286.808772] [] ret_from_fork+0x7c/0xb0 +[ 6286.808773] [] ? kthread_create_on_node+0x140/0x140 +[ 6286.808774] ---[ end trace c6cdb939184ccb4e ]--- + +Signed-off-by: Maurizio Lombardi +Acked-by: Chad Dupuis +Signed-off-by: Christoph Hellwig +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/scsi/bnx2fc/bnx2fc_fcoe.c | 7 +++++++ + 1 file changed, 7 insertions(+) + +--- a/drivers/scsi/bnx2fc/bnx2fc_fcoe.c ++++ b/drivers/scsi/bnx2fc/bnx2fc_fcoe.c +@@ -412,6 +412,7 @@ static int bnx2fc_rcv(struct sk_buff *sk + struct fc_frame_header *fh; + struct fcoe_rcv_info *fr; + struct fcoe_percpu_s *bg; ++ struct sk_buff *tmp_skb; + unsigned short oxid; + + interface = container_of(ptype, struct bnx2fc_interface, +@@ -424,6 +425,12 @@ static int bnx2fc_rcv(struct sk_buff *sk + goto err; + } + ++ tmp_skb = skb_share_check(skb, GFP_ATOMIC); ++ if (!tmp_skb) ++ goto err; ++ ++ skb = tmp_skb; ++ + if (unlikely(eth_hdr(skb)->h_proto != htons(ETH_P_FCOE))) { + printk(KERN_ERR PFX "bnx2fc_rcv: Wrong FC type frame\n"); + goto err; diff --git a/queue-3.17/clk-divider-fix-read_only-when-divider-1.patch b/queue-3.17/clk-divider-fix-read_only-when-divider-1.patch new file mode 100644 index 00000000000..724f36353aa --- /dev/null +++ b/queue-3.17/clk-divider-fix-read_only-when-divider-1.patch @@ -0,0 +1,109 @@ +From e6d5e7d90be92cee626d7ec16ca9b06f1eed710b Mon Sep 17 00:00:00 2001 +From: James Hogan +Date: Fri, 14 Nov 2014 15:32:09 +0000 +Subject: clk-divider: Fix READ_ONLY when divider > 1 + +From: James Hogan + +commit e6d5e7d90be92cee626d7ec16ca9b06f1eed710b upstream. + +Commit 79c6ab509558 (clk: divider: add CLK_DIVIDER_READ_ONLY flag) in +v3.16 introduced the CLK_DIVIDER_READ_ONLY flag which caused the +recalc_rate() and round_rate() clock callbacks to be omitted. + +However using this flag has the unfortunate side effect of causing the +clock recalculation code when a clock rate change is attempted to always +treat it as a pass-through clock, i.e. with a fixed divide of 1, which +may not be the case. Child clock rates are then recalculated using the +wrong parent rate. + +Therefore instead of dropping the recalc_rate() and round_rate() +callbacks, alter clk_divider_bestdiv() to always report the current +divider as the best divider so that it is never altered. + +For me the read only clock was the system clock, which divided the PLL +rate by 2, from which both the UART and the SPI clocks were divided. +Initial setting of the UART rate set it correctly, but when the SPI +clock was set, the other child clocks were miscalculated. The UART clock +was recalculated using the PLL rate as the parent rate, resulting in a +UART new_rate of double what it should be, and a UART which spewed forth +garbage when the rate changes were propagated. + +Signed-off-by: James Hogan +Cc: Thomas Abraham +Cc: Tomasz Figa +Cc: Max Schwarz +Acked-by: Haojian Zhuang +Signed-off-by: Michael Turquette +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/clk/clk-divider.c | 18 +++++++++--------- + drivers/clk/rockchip/clk.c | 4 +--- + include/linux/clk-provider.h | 1 - + 3 files changed, 10 insertions(+), 13 deletions(-) + +--- a/drivers/clk/clk-divider.c ++++ b/drivers/clk/clk-divider.c +@@ -263,6 +263,14 @@ static int clk_divider_bestdiv(struct cl + if (!rate) + rate = 1; + ++ /* if read only, just return current value */ ++ if (divider->flags & CLK_DIVIDER_READ_ONLY) { ++ bestdiv = readl(divider->reg) >> divider->shift; ++ bestdiv &= div_mask(divider); ++ bestdiv = _get_div(divider, bestdiv); ++ return bestdiv; ++ } ++ + maxdiv = _get_maxdiv(divider); + + if (!(__clk_get_flags(hw->clk) & CLK_SET_RATE_PARENT)) { +@@ -361,11 +369,6 @@ const struct clk_ops clk_divider_ops = { + }; + EXPORT_SYMBOL_GPL(clk_divider_ops); + +-const struct clk_ops clk_divider_ro_ops = { +- .recalc_rate = clk_divider_recalc_rate, +-}; +-EXPORT_SYMBOL_GPL(clk_divider_ro_ops); +- + static struct clk *_register_divider(struct device *dev, const char *name, + const char *parent_name, unsigned long flags, + void __iomem *reg, u8 shift, u8 width, +@@ -391,10 +394,7 @@ static struct clk *_register_divider(str + } + + init.name = name; +- if (clk_divider_flags & CLK_DIVIDER_READ_ONLY) +- init.ops = &clk_divider_ro_ops; +- else +- init.ops = &clk_divider_ops; ++ init.ops = &clk_divider_ops; + init.flags = flags | CLK_IS_BASIC; + init.parent_names = (parent_name ? &parent_name: NULL); + init.num_parents = (parent_name ? 1 : 0); +--- a/drivers/clk/rockchip/clk.c ++++ b/drivers/clk/rockchip/clk.c +@@ -89,9 +89,7 @@ struct clk *rockchip_clk_register_branch + div->width = div_width; + div->lock = lock; + div->table = div_table; +- div_ops = (div_flags & CLK_DIVIDER_READ_ONLY) +- ? &clk_divider_ro_ops +- : &clk_divider_ops; ++ div_ops = &clk_divider_ops; + } + + clk = clk_register_composite(NULL, name, parent_names, num_parents, +--- a/include/linux/clk-provider.h ++++ b/include/linux/clk-provider.h +@@ -341,7 +341,6 @@ struct clk_divider { + #define CLK_DIVIDER_READ_ONLY BIT(5) + + extern const struct clk_ops clk_divider_ops; +-extern const struct clk_ops clk_divider_ro_ops; + struct clk *clk_register_divider(struct device *dev, const char *name, + const char *parent_name, unsigned long flags, + void __iomem *reg, u8 shift, u8 width, diff --git a/queue-3.17/irqchip-atmel-aic-fix-irqdomain-initialization.patch b/queue-3.17/irqchip-atmel-aic-fix-irqdomain-initialization.patch new file mode 100644 index 00000000000..618159936f7 --- /dev/null +++ b/queue-3.17/irqchip-atmel-aic-fix-irqdomain-initialization.patch @@ -0,0 +1,53 @@ +From 45977fe35bf014f5cf9552717e1320783398ae0d Mon Sep 17 00:00:00 2001 +From: Boris Brezillon +Date: Tue, 11 Nov 2014 14:33:36 +0100 +Subject: irqchip: atmel-aic: Fix irqdomain initialization + +From: Boris Brezillon + +commit 45977fe35bf014f5cf9552717e1320783398ae0d upstream. + +First of all IRQCHIP_SKIP_SET_WAKE is not a valid irq_gc_flags and thus +should not be passed as the last argument of +irq_alloc_domain_generic_chips. + +Then pass the correct handler (handle_fasteoi_irq) to +irq_alloc_domain_generic_chips instead of manually re-setting it in the +initialization loop. + +And eventually initialize default irq flags to the pseudo standard: +IRQ_REQUEST | IRQ_PROBE | IRQ_AUTOEN. + +Signed-off-by: Boris Brezillon +Tested-by: Kevin Hilman +Fixes: b1479ebb77200 ("irqchip: atmel-aic: Add atmel AIC/AIC5 drivers") +Link: https://lkml.kernel.org/r/1415712816-9202-1-git-send-email-boris.brezillon@free-electrons.com +Signed-off-by: Jason Cooper +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/irqchip/irq-atmel-aic-common.c | 6 +++--- + 1 file changed, 3 insertions(+), 3 deletions(-) + +--- a/drivers/irqchip/irq-atmel-aic-common.c ++++ b/drivers/irqchip/irq-atmel-aic-common.c +@@ -217,8 +217,9 @@ struct irq_domain *__init aic_common_of_ + } + + ret = irq_alloc_domain_generic_chips(domain, 32, 1, name, +- handle_level_irq, 0, 0, +- IRQCHIP_SKIP_SET_WAKE); ++ handle_fasteoi_irq, ++ IRQ_NOREQUEST | IRQ_NOPROBE | ++ IRQ_NOAUTOEN, 0, 0); + if (ret) + goto err_domain_remove; + +@@ -230,7 +231,6 @@ struct irq_domain *__init aic_common_of_ + gc->unused = 0; + gc->wake_enabled = ~0; + gc->chip_types[0].type = IRQ_TYPE_SENSE_MASK; +- gc->chip_types[0].handler = handle_fasteoi_irq; + gc->chip_types[0].chip.irq_eoi = irq_gc_eoi; + gc->chip_types[0].chip.irq_set_wake = irq_gc_set_wake; + gc->chip_types[0].chip.irq_shutdown = aic_common_shutdown; diff --git a/queue-3.17/series b/queue-3.17/series index 80ffbdeae70..f317f4cbd2d 100644 --- a/queue-3.17/series +++ b/queue-3.17/series @@ -101,3 +101,6 @@ net-ping-handle-protocol-mismatching-scenario.patch revert-xhci-clear-root-port-wake-on-bits-if-controller-isn-t-wake-up-capable.patch ixgbe-correctly-disable-vlan-filter-in-promiscuous-mode.patch ixgbe-fix-use-after-free-adapter-state-test-in-ixgbe_remove-ixgbe_probe.patch +irqchip-atmel-aic-fix-irqdomain-initialization.patch +bnx2fc-do-not-add-shared-skbs-to-the-fcoe_rx_list.patch +clk-divider-fix-read_only-when-divider-1.patch -- 2.47.3