diff --git a/Documentation/devicetree/bindings/pci/phytium,phytium-pcie-ep.txt b/Documentation/devicetree/bindings/pci/phytium,phytium-pcie-ep.txt index 16bcafb3166ef78fcbb82e732cd2fdc10efea45a..0067be87b18f7645d1a66c61ed194ae92a167ba1 100644 --- a/Documentation/devicetree/bindings/pci/phytium,phytium-pcie-ep.txt +++ b/Documentation/devicetree/bindings/pci/phytium,phytium-pcie-ep.txt @@ -1,7 +1,8 @@ * Phytium PCIe endpoint controller Required properties: -- compatible: Should contain "phytium,phytium-pcie-ep" to identify the IP used. +- compatible: Should contain "phytium,pcie-ep-1.0" or + "phytium,pcie-ep-2.0" - reg: Should contain the controller register base address, AXI interface region base address and hpb register base address respectively. - reg-names: Must be "reg", "mem" and "hpb" respectively. @@ -11,7 +12,7 @@ Required properties: Example: ep0: ep@0x29030000 { - compatible = "phytium,dp2008-pcie-ep"; + compatible = "phytium,pcie-ep-1.0"; reg = <0x0 0x29030000 0x0 0x10000>, <0x11 0x00000000 0x1 0x00000000>, <0x0 0x29101000 0x0 0x1000>; diff --git a/arch/arm64/configs/phytium_defconfig b/arch/arm64/configs/phytium_defconfig index 45aa71002d793574fafab9f1847a8d9949242a00..6d6bc2b66451895b9b738e62a26a281d9adaa170 100644 --- a/arch/arm64/configs/phytium_defconfig +++ b/arch/arm64/configs/phytium_defconfig @@ -16,6 +16,7 @@ CONFIG_TASK_XACCT=y CONFIG_TASK_IO_ACCOUNTING=y CONFIG_IKCONFIG=y CONFIG_IKCONFIG_PROC=y +CONFIG_NUMA_BALANCING=y CONFIG_MEMCG=y CONFIG_MEMCG_SWAP=y CONFIG_BLK_CGROUP=y @@ -45,6 +46,9 @@ CONFIG_PCIE_PHYTIUM_EP=y CONFIG_PCI_ENDPOINT=y CONFIG_ARM64_VA_BITS_48=y CONFIG_SCHED_MC=y +CONFIG_NR_CPUS=128 +CONFIG_NUMA=y +CONFIG_NODES_SHIFT=3 CONFIG_SECCOMP=y CONFIG_KEXEC=y CONFIG_CRASH_DUMP=y diff --git a/drivers/dma/phytium/phytium-gdmac.c b/drivers/dma/phytium/phytium-gdmac.c index 3fdf572196b0dd303b9c667d9a43320065c7f721..0154d6151e52a30cab0d2aef20fbb88e0eb9a422 100644 --- a/drivers/dma/phytium/phytium-gdmac.c +++ b/drivers/dma/phytium/phytium-gdmac.c @@ -29,7 +29,7 @@ #include #include "phytium-gdmac.h" -#define PHYTIUM_GDMA_DRIVER_VERSION "1.0.2" +#define PHYTIUM_GDMA_DRIVER_VERSION "1.0.3" static inline struct phytium_gdma_device *to_gdma_device(struct dma_chan *chan) { @@ -475,8 +475,6 @@ static int phytium_gdma_terminate_all(struct dma_chan *chan) { struct phytium_gdma_chan *gdma_chan = to_gdma_chan(chan); unsigned long flags = 0; - u32 val = 0; - int ret = 0; LIST_HEAD(head); spin_lock_irqsave(&gdma_chan->vchan.lock, flags); @@ -487,12 +485,9 @@ static int phytium_gdma_terminate_all(struct dma_chan *chan) vchan_terminate_vdesc(&gdma_chan->desc->vdesc); gdma_chan->desc = NULL; phytium_chan_disable(gdma_chan); - ret = readl_poll_timeout(gdma_chan->base + DMA_CX_STATE, val, - ~(val & BIT(4)), 10, 10000); - if (ret) - dev_err(chan_to_dev(gdma_chan), - "failed to complete writes\n"); phytium_chan_reset(gdma_chan); + phytium_chan_irq_disable(gdma_chan); + phytium_chan_clk_disable(gdma_chan); } vchan_get_all_descriptors(&gdma_chan->vchan, &head); @@ -524,10 +519,11 @@ static void phytium_gdma_free_chan_resources(struct dma_chan *chan) phytium_chan_disable(gdma_chan); phytium_chan_irq_disable(gdma_chan); + phytium_chan_clk_disable(gdma_chan); vchan_free_chan_resources(&gdma_chan->vchan); - dev_dbg(gdma->dev, "free channel %d\n", gdma_chan->id); + dev_info(gdma->dev, "free channel %d\n", gdma_chan->id); } static int phytium_gdma_slave_config(struct dma_chan *chan, @@ -753,8 +749,6 @@ static irqreturn_t phytium_dma_interrupt(int irq, void *dev_id) if (gdma->chan[i].desc) { phytium_chan_irq_handler(gdma_chan); - phytium_chan_disable(gdma_chan); - phytium_chan_clk_disable(gdma_chan); } } } diff --git a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c index f0aa7f0e5480310611091b9797ee1dae344b269c..d2b8d284b199526ef111849bcb103698ae2f3ddf 100644 --- a/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c +++ b/drivers/net/ethernet/mellanox/mlx5/core/fs_core.c @@ -1452,8 +1452,9 @@ static struct mlx5_flow_handle *add_rule_fg(struct mlx5_flow_group *fg, } trace_mlx5_fs_set_fte(fte, false); + /* Link newly added rules into the tree. */ for (i = 0; i < handle->num_rules; i++) { - if (refcount_read(&handle->rule[i]->node.refcount) == 1) { + if (!handle->rule[i]->node.parent) { tree_add_node(&handle->rule[i]->node, &fte->node); trace_mlx5_fs_add_rule(handle->rule[i]); } diff --git a/drivers/pci/controller/pcie-phytium-ep.c b/drivers/pci/controller/pcie-phytium-ep.c index 497c51efa24ad3f0dab082b7f1d746bf47c51bd9..fefeb8a4323d46136aca08971e0d3830b8bbb886 100644 --- a/drivers/pci/controller/pcie-phytium-ep.c +++ b/drivers/pci/controller/pcie-phytium-ep.c @@ -18,7 +18,7 @@ #include "pcie-phytium-ep.h" #include "pcie-phytium-register.h" -#define PHYTIUM_PCIE_RP_DRIVER_VERSION "1.1.1" +#define PHYTIUM_PCIE_EP_DRIVER_VERSION "1.1.2" #define PHYTIUM_PCIE_EP_IRQ_PCI_ADDR_NONE 0x0 #define PHYTIUM_PCIE_EP_IRQ_PCI_ADDR_LEGACY 0x1 @@ -340,12 +340,31 @@ static const struct pci_epc_ops phytium_pcie_epc_ops = { .start = phytium_pcie_ep_start, }; +static const struct phytium_pcie_ep_config pcie_ep_1p0_config = +{ + .hpb_perf_base_limit_offs = 0xA30, +}; +static const struct phytium_pcie_ep_config pcie_ep_2p0_config = +{ + .hpb_perf_base_limit_offs = 0xA40, +}; + +static const struct of_device_id phytium_pcie_ep_of_match[] = { + { .compatible = "phytium,pcie-ep-1.0", + .data = &pcie_ep_1p0_config }, + { .compatible = "phytium,pcie-ep-2.0", + .data = &pcie_ep_2p0_config }, + { }, +}; static int phytium_pcie_ep_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; + const struct of_device_id *match = NULL; struct phytium_pcie_ep *priv = NULL; + const struct phytium_pcie_ep_config *pcie_ep_config = + &pcie_ep_2p0_config; struct resource *res; struct device_node *np = dev->of_node; struct pci_epc *epc; @@ -356,6 +375,13 @@ static int phytium_pcie_ep_probe(struct platform_device *pdev) if (!priv) return -ENOMEM; + match = of_match_node(phytium_pcie_ep_of_match, pdev->dev.of_node); + if (match && match->data) { + pcie_ep_config = match->data; + } + priv->hpb_perf_base_limit_offs = + pcie_ep_config->hpb_perf_base_limit_offs; + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "reg"); priv->reg_base = devm_ioremap_resource(dev, res); if (IS_ERR(priv->reg_base)) { @@ -427,13 +453,13 @@ static int phytium_pcie_ep_probe(struct platform_device *pdev) & C0_PREF_BASE_MASK) << C0_PREF_BASE_SHIFT; value |= (((lower_32_bits(priv->mem_res->end) >> C0_PREF_VALUE_SHIFT) & C0_PREF_LIMIT_MASK) << C0_PREF_LIMIT_SHIFT); - phytium_hpb_writel(priv, PHYTIUM_HPB_C0_PREF_BASE_LIMIT, value); + phytium_hpb_writel(priv, priv->hpb_perf_base_limit_offs, value); value = ((upper_32_bits(priv->mem_res->start) >> C0_PREF_UP32_VALUE_SHIFT) & C0_PREF_BASE_UP32_MASK) << C0_PREF_BASE_UP32_SHIFT; value |= (((upper_32_bits(priv->mem_res->end) >> C0_PREF_UP32_VALUE_SHIFT) & C0_PREF_LIMIT_UP32_MASK) << C0_PREF_LIMIT_UP32_SHIFT); - phytium_hpb_writel(priv, PHYTIUM_HPB_C0_PREF_BASE_LIMIT_UP32, value); + phytium_hpb_writel(priv, priv->hpb_perf_base_limit_offs + 0x04, value); dev_dbg(dev, "exit %s successful\n", __func__); return 0; @@ -454,11 +480,6 @@ static int phytium_pcie_ep_remove(struct platform_device *pdev) return 0; } -static const struct of_device_id phytium_pcie_ep_of_match[] = { - { .compatible = "phytium,pd2008-pcie-ep" }, - { }, -}; - static struct platform_driver phytium_pcie_ep_driver = { .driver = { .name = "phytium-pcie-ep", @@ -471,6 +492,6 @@ MODULE_DEVICE_TABLE(of, phytium_pcie_ep_of_match); module_platform_driver(phytium_pcie_ep_driver); MODULE_LICENSE("GPL"); -MODULE_VERSION(PHYTIUM_PCIE_RP_DRIVER_VERSION); +MODULE_VERSION(PHYTIUM_PCIE_EP_DRIVER_VERSION); MODULE_AUTHOR("Yang Xun "); MODULE_DESCRIPTION("Phytium PCIe Controller Endpoint driver"); diff --git a/drivers/pci/controller/pcie-phytium-ep.h b/drivers/pci/controller/pcie-phytium-ep.h index a3768558d58ad086c87cc807a8fa03ef0a3f8273..cbf2653ed2a02ab0bc893c28672a0d68ecdf0763 100644 --- a/drivers/pci/controller/pcie-phytium-ep.h +++ b/drivers/pci/controller/pcie-phytium-ep.h @@ -8,13 +8,20 @@ #ifndef __PCIE_PHYTIUM_EP_H__ #define __PCIE_PHYTIUM_EP_H__ +#include #include "pcie-phytium-register.h" #define IRQ_MAPPING_SIZE 0x1000 + +struct phytium_pcie_ep_config { + u32 hpb_perf_base_limit_offs; +}; + struct phytium_pcie_ep { void __iomem *reg_base; struct resource *mem_res; void __iomem *hpb_base; + u32 hpb_perf_base_limit_offs; unsigned int max_regions; unsigned long ob_region_map; phys_addr_t *ob_addr; diff --git a/net/ipv6/netfilter/nf_reject_ipv6.c b/net/ipv6/netfilter/nf_reject_ipv6.c index 24858402e37481a7ac64a91cd1400bc21343d230..0edf9c1192de07a5406b88402420209d48b5d786 100644 --- a/net/ipv6/netfilter/nf_reject_ipv6.c +++ b/net/ipv6/netfilter/nf_reject_ipv6.c @@ -92,33 +92,23 @@ void nf_reject_ip6_tcphdr_put(struct sk_buff *nskb, const struct tcphdr *oth, unsigned int otcplen) { struct tcphdr *tcph; - int needs_ack; skb_reset_transport_header(nskb); - tcph = skb_put(nskb, sizeof(struct tcphdr)); + tcph = skb_put_zero(nskb, sizeof(struct tcphdr)); /* Truncate to length (no data) */ tcph->doff = sizeof(struct tcphdr)/4; tcph->source = oth->dest; tcph->dest = oth->source; if (oth->ack) { - needs_ack = 0; tcph->seq = oth->ack_seq; - tcph->ack_seq = 0; } else { - needs_ack = 1; tcph->ack_seq = htonl(ntohl(oth->seq) + oth->syn + oth->fin + otcplen - (oth->doff<<2)); - tcph->seq = 0; + tcph->ack = 1; } - /* Reset flags */ - ((u_int8_t *)tcph)[13] = 0; tcph->rst = 1; - tcph->ack = needs_ack; - tcph->window = 0; - tcph->urg_ptr = 0; - tcph->check = 0; /* Adjust TCP checksum */ tcph->check = csum_ipv6_magic(&ipv6_hdr(nskb)->saddr, diff --git a/net/ipv6/seg6.c b/net/ipv6/seg6.c index 9b2f272ca164919aa4c9a6559852f55a10ce24aa..13cdd7bcebc85fe71e789f2b61ea0f3323058ee3 100644 --- a/net/ipv6/seg6.c +++ b/net/ipv6/seg6.c @@ -440,22 +440,24 @@ int __init seg6_init(void) { int err = -ENOMEM; - err = genl_register_family(&seg6_genl_family); + err = register_pernet_subsys(&ip6_segments_ops); if (err) goto out; - err = register_pernet_subsys(&ip6_segments_ops); + err = genl_register_family(&seg6_genl_family); if (err) - goto out_unregister_genl; + goto out_unregister_pernet; #ifdef CONFIG_IPV6_SEG6_LWTUNNEL err = seg6_iptunnel_init(); if (err) - goto out_unregister_pernet; + goto out_unregister_genl; err = seg6_local_init(); - if (err) - goto out_unregister_pernet; + if (err) { + seg6_iptunnel_exit(); + goto out_unregister_genl; + } #endif #ifdef CONFIG_IPV6_SEG6_HMAC @@ -476,11 +478,13 @@ int __init seg6_init(void) #endif #endif #ifdef CONFIG_IPV6_SEG6_LWTUNNEL -out_unregister_pernet: - unregister_pernet_subsys(&ip6_segments_ops); -#endif out_unregister_genl: +#endif +#if IS_ENABLED(CONFIG_IPV6_SEG6_LWTUNNEL) || IS_ENABLED(CONFIG_IPV6_SEG6_HMAC) genl_unregister_family(&seg6_genl_family); +#endif +out_unregister_pernet: + unregister_pernet_subsys(&ip6_segments_ops); goto out; } diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c index 9348caf1c611d70d987c764b2c1e2e4b4b0545d1..2e9caa10d3bac5dee865ad53b1961a93bea13492 100644 --- a/net/mac80211/cfg.c +++ b/net/mac80211/cfg.c @@ -2452,6 +2452,10 @@ static int ieee80211_get_tx_power(struct wiphy *wiphy, else *dbm = sdata->vif.bss_conf.txpower; + /* INT_MIN indicates no power level was set yet */ + if (*dbm == INT_MIN) + return -EINVAL; + return 0; } diff --git a/sound/soc/phytium/pmdk_dp.c b/sound/soc/phytium/pmdk_dp.c index 28ad2efef73103676014162b8825e9249e3120d3..11df999fb5e6e6f92864fa6e3a8ea4ff4720df25 100644 --- a/sound/soc/phytium/pmdk_dp.c +++ b/sound/soc/phytium/pmdk_dp.c @@ -48,6 +48,11 @@ static int pmdk_dp0_init(struct snd_soc_pcm_runtime *runtime) dev_err(card->dev, "Jack creation failed %d\n", ret); return ret; } + ret = snd_jack_add_new_kctl(priv->jack0.jack, "HDMI/DP,pcm=0", + SND_JACK_LINEOUT); + if (ret) + dev_warn(card->dev, "failed creating Jack kctl %d\n", ret); + snd_soc_component_set_jack(component, &priv->jack0, NULL); return ret; } @@ -66,6 +71,10 @@ static int pmdk_dp1_init(struct snd_soc_pcm_runtime *runtime) dev_err(card->dev, "Jack creation failed %d\n", ret); return ret; } + ret = snd_jack_add_new_kctl(priv->jack1.jack, "HDMI/DP,pcm=1", + SND_JACK_LINEOUT); + if (ret) + dev_warn(card->dev, "failed creating Jack kctl %d\n", ret); snd_soc_component_set_jack(component, &priv->jack1, NULL); return ret; } @@ -84,6 +93,10 @@ static int pmdk_dp2_init(struct snd_soc_pcm_runtime *runtime) dev_err(card->dev, "Jack creation failed %d\n", ret); return ret; } + ret = snd_jack_add_new_kctl(priv->jack2.jack, "HDMI/DP,pcm=2", + SND_JACK_LINEOUT); + if (ret) + dev_warn(card->dev, "failed creating Jack kctl %d\n", ret); snd_soc_component_set_jack(component, &priv->jack2, NULL); return ret; }