s390/qeth: invoke softirqs after napi_schedule()
Subsystems (20)
Sasha Levin
maintainerPATCH 1/66 s390/qeth: invoke softirqs after napi_schedule()
From: Julian Wiedmann <[email protected]>
[ Upstream commit 4d19db777a2f32c9b76f6fd517ed8960576cb43e ]
Calling napi_schedule() from process context does not ensure that the NET_RX softirq is run in a timely fashion. So trigger it manually.
This is no big issue with current code. A call to ndo_open() is usually followed by a ndo_set_rx_mode() call, and for qeth this contains a spin_unlock_bh(). Except for OSN, where qeth_l2_set_rx_mode() bails out early.
Nevertheless it's best to not depend on this behaviour, and just fix the issue at its source like all other drivers do. For instance see commit 83a0c6e58901 ("i40e: Invoke softirqs after napi_reschedule").
--- drivers/s390/net/qeth_l2_main.c | 3 +++ drivers/s390/net/qeth_l3_main.c | 3 +++ 2 files changed, 6 insertions(+)
drivers/s390/net/qeth_l2_main.c +3 -0
@@ -991,7 +991,10 @@ static int __qeth_l2_open(struct net_device *dev)if (qdio_stop_irq (card->data.ccwdev,0 ) >=0 ) {napi_enable (&card->napi); +local_bh_disable ();napi_schedule (&card->napi); +/* kick-start the NAPI softirq: */ +local_bh_enable (); }else rc = -EIO ;return rc;
drivers/s390/net/qeth_l3_main.c +3 -0
@@ -3005,7 +3005,10 @@ static int __qeth_l3_open(struct net_device *dev)if (qdio_stop_irq (card->data.ccwdev,0 ) >=0 ) {napi_enable (&card->napi); +local_bh_disable ();napi_schedule (&card->napi); +/* kick-start the NAPI softirq: */ +local_bh_enable (); }else rc = -EIO ;return rc;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 2/66 PCI/ACPI: Correct error message for ASPM disabling
From: Sinan Kaya <[email protected]>
[ Upstream commit 1ad61b612b95980a4d970c52022aa01dfc0f6068 ]
If _OSC execution fails today for platforms without an _OSC entry, code is printing a misleading message saying disabling ASPM as follows:
acpi PNP0A03:00: _OSC failed (AE_NOT_FOUND); disabling ASPM
We need to ensure that platform supports ASPM to begin with.
--- drivers/acpi/pci_root.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/acpi/pci_root.c +3 -2
@@ -454,8 +454,9 @@ static void negotiate_os_control(struct acpi_pci_root *root, int *no_aspm)decode_osc_support (root,"OS supports" , support); status =acpi_pci_osc_support (root, support);if (ACPI_FAILURE (status)) { -dev_info (&device->dev,"_OSC failed (%s); disabling ASPM\n" , -acpi_format_exception (status)); +dev_info (&device->dev,"_OSC failed (%s)%s\n" , +acpi_format_exception (status), +pcie_aspm_support_enabled () ?"; disabling ASPM" :"" ); *no_aspm =1 ;return ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 3/66 serial: mxs-auart: Fix potential infinite loop
In reply to Sasha LevinFrom: Anton Vasilyev <[email protected]>
[ Upstream commit 5963e8a3122471cadfe0eba41c4ceaeaa5c8bb4d ]
On the error path of mxs_auart_request_gpio_irq() is performed backward iterating with index i of enum type. Underline enum type may be unsigned char. In this case check (--i >= 0) will be always true and error handling goes into infinite loop.
The patch changes the check so that it is valid for signed and unsigned types.
Found by Linux Driver Verification project (linuxtesting.org).
--- drivers/tty/serial/mxs-auart.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/tty/serial/mxs-auart.c +2 -1
@@ -1635,8 +1635,9 @@ static int mxs_auart_request_gpio_irq(struct mxs_auart_port *s)/* * If something went wrong, rollback. +* Be careful: i may be unsigned. */ -while (err && (--i >=0 )) +while (err && (i-- >0 ))if (irq[i] >=0 )free_irq (irq[i], s);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 4/66 powerpc/iommu: Avoid derefence before pointer check
In reply to Sasha LevinFrom: Breno Leitao <[email protected]>
[ Upstream commit 984ecdd68de0fa1f63ce205d6c19ef5a7bc67b40 ]
The tbl pointer is being derefenced by IOMMU_PAGE_SIZE prior the check if it is not NULL.
Just moving the dereference code to after the check, where there will be guarantee that 'tbl' will not be NULL.
--- arch/powerpc/kernel/iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/kernel/iommu.c +1 -1
@@ -765,9 +765,9 @@ dma_addr_t iommu_map_page(struct device *dev, struct iommu_table *tbl, vaddr =page_address (page) + offset; uaddr = (unsigned long )vaddr; - npages =iommu_num_pages (uaddr, size,IOMMU_PAGE_SIZE (tbl));if (tbl) { + npages =iommu_num_pages (uaddr, size,IOMMU_PAGE_SIZE (tbl)); align =0 ;if (tbl->it_page_shift <PAGE_SHIFT && size >=PAGE_SIZE && ((unsigned long )vaddr & ~PAGE_MASK ) ==0 )
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 5/66 powerpc/64s/hash: Fix stab_rr off by one initialization
In reply to Sasha LevinFrom: Nicholas Piggin <[email protected]>
[ Upstream commit 09b4438db13fa83b6219aee5993711a2aa2a0c64 ]
This causes SLB alloation to start 1 beyond the start of the SLB. There is no real problem because after it wraps it stats behaving properly, it's just surprisig to see when looking at SLB traces.
--- arch/powerpc/mm/slb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/powerpc/mm/slb.c +1 -1
@@ -321,7 +321,7 @@ void slb_initialize(void)#endif } -get_paca ()->stab_rr =SLB_NUM_BOLTED ; +get_paca ()->stab_rr =SLB_NUM_BOLTED -1 ; lflags =SLB_VSID_KERNEL | linear_llp; vflags =SLB_VSID_KERNEL | vmalloc_llp;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 6/66 powerpc/pseries: Disable CPU hotplug across migrations
In reply to Sasha LevinFrom: Nathan Fontenot <[email protected]>
[ Upstream commit 85a88cabad57d26d826dd94ea34d3a785824d802 ]
When performing partition migrations all present CPUs must be online as all present CPUs must make the H_JOIN call as part of the migration process. Once all present CPUs make the H_JOIN call, one CPU is returned to make the rtas call to perform the migration to the destination system.
During testing of migration and changing the SMT state we have found instances where CPUs are offlined, as part of the SMT state change, before they make the H_JOIN call. This results in a hung system where every CPU is either in H_JOIN or offline.
To prevent this this patch disables CPU hotplug during the migration process.
--- arch/powerpc/kernel/rtas.c | 2 ++ 1 file changed, 2 insertions(+)
arch/powerpc/kernel/rtas.c +2 -0
@@ -984,6 +984,7 @@ int rtas_ibm_suspend_me(u64 handle) goto out; } +cpu_hotplug_disable ();stop_topology_update ();/* Call function on all CPUs. One of us will make the
@@ -998,6 +999,7 @@ int rtas_ibm_suspend_me(u64 handle)printk (KERN_ERR "Error doing global join\n" );start_topology_update (); +cpu_hotplug_enable ();/* Take down CPUs not online prior to suspend */ cpuret =rtas_offline_cpus_mask (offline_mask);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 7/66 RDMA/i40iw: Fix incorrect iterator type
In reply to Sasha LevinFrom: Håkon Bugge <[email protected]>
[ Upstream commit 802fa45cd320de319e86c93bca72abec028ba059 ]
Commit f27b4746f378 ("i40iw: add connection management code") uses an incorrect rcu iterator, whilst holding the rtnl_lock. Since the critical region invokes i40iw_manage_qhash(), which is a sleeping function, the rcu locking and traversal cannot be used.
--- drivers/infiniband/hw/i40iw/i40iw_cm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/i40iw/i40iw_cm.c +1 -1
@@ -1652,7 +1652,7 @@ static enum i40iw_status_code i40iw_add_mqh_6(struct i40iw_device *iwdev,unsigned long flags;rtnl_lock (); -for_each_netdev_rcu (&init_net, ip_dev) { +for_each_netdev (&init_net, ip_dev) {if ((((rdma_vlan_dev_vlan_id (ip_dev) <I40IW_NO_VLAN ) && (rdma_vlan_dev_real_dev (ip_dev) == iwdev->netdev)) || (ip_dev == iwdev->netdev)) && (ip_dev->flags &IFF_UP )) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 8/66 libfdt: Ensure INT_MAX is defined in libfdt_env.h
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit 53dd9dce6979bc54d64a3a09a2fb20187a025be7 ]
The next update of libfdt has a new dependency on INT_MAX. Update the instances of libfdt_env.h in the kernel to either include the necessary header with the definition or define it locally.
--- arch/arm/boot/compressed/libfdt_env.h | 2 ++ arch/powerpc/boot/libfdt_env.h | 2 ++ include/linux/libfdt_env.h | 1 + 3 files changed, 5 insertions(+)
arch/arm/boot/compressed/libfdt_env.h +2 -0
@@ -5,6 +5,8 @@#include <linux/string.h> #include <asm/byteorder.h> +#define INT_MAX ((int)(~0U>>1)) +typedef __be16 fdt16_t ;typedef __be32 fdt32_t ;typedef __be64 fdt64_t ;
arch/powerpc/boot/libfdt_env.h +2 -0
@@ -4,6 +4,8 @@#include <types.h> #include <string.h> +#define INT_MAX ((int)(~0U>>1)) +#include "of.h" typedef u32 uint32_t ;
include/linux/libfdt_env.h +1 -0
@@ -1,6 +1,7 @@#ifndef _LIBFDT_ENV_H#define _LIBFDT_ENV_H +#include <linux/kernel.h> /* For INT_MAX */ #include <linux/string.h> #include <asm/byteorder.h>
Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Sasha Levin
maintainerPATCH 9/66 power: supply: twl4030_charger: fix charging current out-of-bounds
In reply to Sasha LevinFrom: Andreas Kemnade <[email protected]>
[ Upstream commit 8314c212f995bc0d06b54ad02ef0ab4089781540 ]
the charging current uses unsigned int variables, if we step back if the current is still low, we would run into negative which means setting the target to a huge value.
Better add checks here.
--- drivers/power/supply/twl4030_charger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/power/supply/twl4030_charger.c +2 -1
@@ -449,7 +449,8 @@ static void twl4030_current_worker(struct work_struct *data)if (v <USB_MIN_VOLT ) {/* Back up and stop adjusting. */ - bci->usb_cur -=USB_CUR_STEP ; +if (bci->usb_cur >=USB_CUR_STEP ) + bci->usb_cur -=USB_CUR_STEP ; bci->usb_cur_target = bci->usb_cur; }else if (bci->usb_cur >= bci->usb_cur_target || bci->usb_cur +USB_CUR_STEP >USB_MAX_CURRENT ) {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 10/66 power: supply: twl4030_charger: disable eoc interrupt on linear charge
In reply to Sasha LevinFrom: Andreas Kemnade <[email protected]>
[ Upstream commit 079cdff3d0a09c5da10ae1be35def7a116776328 ]
This avoids getting woken up from suspend after power interruptions when the bci wrongly thinks the battery is full just because of input current going low because of low input power
--- drivers/power/supply/twl4030_charger.c | 27 +++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)
drivers/power/supply/twl4030_charger.c +26 -1
@@ -469,6 +469,7 @@ static void twl4030_current_worker(struct work_struct *data)static int twl4030_charger_enable_usb (struct twl4030_bci *bci,bool enable) {int ret; +u32 reg;if (bci->usb_mode ==CHARGE_OFF ) enable = false;
@@ -482,14 +483,38 @@ static int twl4030_charger_enable_usb(struct twl4030_bci *bci, bool enable) bci->usb_enabled =1 ; } -if (bci->usb_mode ==CHARGE_AUTO ) +if (bci->usb_mode ==CHARGE_AUTO ) { +/* Enable interrupts now. */ + reg = ~(u32)(TWL4030_ICHGLOW |TWL4030_ICHGEOC | +TWL4030_TBATOR2 |TWL4030_TBATOR1 | +TWL4030_BATSTS ); + ret =twl_i2c_write_u8 (TWL4030_MODULE_INTERRUPTS , reg, +TWL4030_INTERRUPTS_BCIIMR1A ); +if (ret <0 ) { +dev_err (bci->dev, +"failed to unmask interrupts: %d\n" , + ret); +return ret; + }/* forcing the field BCIAUTOUSB (BOOT_BCI[1]) to 1 */ ret =twl4030_clear_set_boot_bci (0 ,TWL4030_BCIAUTOUSB ); + }/* forcing USBFASTMCHG(BCIMFSTS4[2]) to 1 */ ret =twl4030_clear_set (TWL_MODULE_MAIN_CHARGE ,0 ,TWL4030_USBFASTMCHG ,TWL4030_BCIMFSTS4 );if (bci->usb_mode ==CHARGE_LINEAR ) { +/* Enable interrupts now. */ + reg = ~(u32)(TWL4030_ICHGLOW |TWL4030_TBATOR2 | +TWL4030_TBATOR1 |TWL4030_BATSTS ); + ret =twl_i2c_write_u8 (TWL4030_MODULE_INTERRUPTS , reg, +TWL4030_INTERRUPTS_BCIIMR1A ); +if (ret <0 ) { +dev_err (bci->dev, +"failed to unmask interrupts: %d\n" , + ret); +return ret; + }twl4030_clear_set_boot_bci (TWL4030_BCIAUTOAC |TWL4030_CVENAC ,0 );/* Watch dog key: WOVF acknowledge */ ret = twl_i2c_write_u8(TWL_MODULE_MAIN_CHARGE, 0x33,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 11/66 net: toshiba: fix return type of ndo_start_xmit function
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit bacade822524e02f662d88f784d2ae821a5546fb ]
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t.
Found by coccinelle.
--- drivers/net/ethernet/toshiba/ps3_gelic_net.c | 4 ++-- drivers/net/ethernet/toshiba/ps3_gelic_net.h | 2 +- drivers/net/ethernet/toshiba/spider_net.c | 4 ++-- drivers/net/ethernet/toshiba/tc35815.c | 6 ++++-- 4 files changed, 9 insertions(+), 7 deletions(-)
drivers/net/ethernet/toshiba/ps3_gelic_net.c +2 -2
@@ -845,9 +845,9 @@ static int gelic_card_kick_txdma(struct gelic_card *card,* @skb: packet to send out * @netdev: interface device structure * -* returns 0 on success, <0 on failure +* returns NETDEV_TX_OK on success, NETDEV_TX_BUSY on failure */ -int gelic_net_xmit (struct sk_buff *skb,struct net_device *netdev) +netdev_tx_t gelic_net_xmit (struct sk_buff *skb,struct net_device *netdev) {struct gelic_card *card =netdev_card (netdev);struct gelic_descr *descr;
drivers/net/ethernet/toshiba/ps3_gelic_net.h +1 -1
@@ -370,7 +370,7 @@ void gelic_card_up(struct gelic_card *card);void gelic_card_down (struct gelic_card *card);int gelic_net_open (struct net_device *netdev);int gelic_net_stop (struct net_device *netdev); -int gelic_net_xmit (struct sk_buff *skb,struct net_device *netdev); +netdev_tx_t gelic_net_xmit (struct sk_buff *skb,struct net_device *netdev);void gelic_net_set_multi (struct net_device *netdev);void gelic_net_tx_timeout (struct net_device *netdev);int gelic_net_change_mtu (struct net_device *netdev,int new_mtu);
drivers/net/ethernet/toshiba/spider_net.c +2 -2
@@ -880,9 +880,9 @@ spider_net_kick_tx_dma(struct spider_net_card *card)* @skb: packet to send out * @netdev: interface device structure * -* returns 0 on success, !0 on failure +* returns NETDEV_TX_OK on success, NETDEV_TX_BUSY on failure */ -static int +static netdev_tx_t spider_net_xmit (struct sk_buff *skb,struct net_device *netdev) {int cnt;
drivers/net/ethernet/toshiba/tc35815.c +4 -2
@@ -474,7 +474,8 @@ static void free_rxbuf_skb(struct pci_dev *hwdev, struct sk_buff *skb, dma_addr_/* Index to functions, as function prototypes. */ static int tc35815_open (struct net_device *dev); -static int tc35815_send_packet (struct sk_buff *skb,struct net_device *dev); +static netdev_tx_t tc35815_send_packet (struct sk_buff *skb, +struct net_device *dev);static irqreturn_t tc35815_interrupt (int irq,void *dev_id);static int tc35815_rx (struct net_device *dev,int limit);static int tc35815_poll (struct napi_struct *napi,int budget);
@@ -1249,7 +1250,8 @@ tc35815_open(struct net_device *dev)* invariant will hold if you make sure that the netif_*_queue() * calls are done at the proper times. */ -static int tc35815_send_packet (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t +tc35815_send_packet (struct sk_buff *skb,struct net_device *dev) {struct tc35815_local *lp =netdev_priv (dev);struct TxFD *txfd;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 12/66 net: xilinx: fix return type of ndo_start_xmit function
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 81255af8d9d5565004792c295dde49344df450ca ]
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t.
Found by coccinelle.
--- drivers/net/ethernet/xilinx/ll_temac_main.c | 3 ++- drivers/net/ethernet/xilinx/xilinx_axienet_main.c | 3 ++- drivers/net/ethernet/xilinx/xilinx_emaclite.c | 9 +++++---- 3 files changed, 9 insertions(+), 6 deletions(-)
drivers/net/ethernet/xilinx/ll_temac_main.c +2 -1
@@ -673,7 +673,8 @@ static inline int temac_check_tx_bd_space(struct temac_local *lp, int num_frag)return 0 ; } -static int temac_start_xmit (struct sk_buff *skb,struct net_device *ndev) +static netdev_tx_t +temac_start_xmit (struct sk_buff *skb,struct net_device *ndev) {struct temac_local *lp =netdev_priv (ndev);struct cdmac_bd *cur_p;
drivers/net/ethernet/xilinx/xilinx_axienet_main.c +2 -1
@@ -655,7 +655,8 @@ static inline int axienet_check_tx_bd_space(struct axienet_local *lp,* start the transmission. Additionally if checksum offloading is supported, * it populates AXI Stream Control fields with appropriate values. */ -static int axienet_start_xmit (struct sk_buff *skb,struct net_device *ndev) +static netdev_tx_t +axienet_start_xmit (struct sk_buff *skb,struct net_device *ndev) {u32 ii;u32 num_frag;
drivers/net/ethernet/xilinx/xilinx_emaclite.c +5 -4
@@ -1005,9 +1005,10 @@ static int xemaclite_close(struct net_device *dev)* deferred and the Tx queue is stopped so that the deferred socket buffer can * be transmitted when the Emaclite device is free to transmit data. * -* Return: 0, always. +* Return: NETDEV_TX_OK, always. */ -static int xemaclite_send (struct sk_buff *orig_skb,struct net_device *dev) +static netdev_tx_t +xemaclite_send (struct sk_buff *orig_skb,struct net_device *dev) {struct net_local *lp =netdev_priv (dev);struct sk_buff *new_skb;
@@ -1028,7 +1029,7 @@ static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev)/* Take the time stamp now, since we can't do this in an ISR. */ skb_tx_timestamp (new_skb);spin_unlock_irqrestore (&lp->reset_lock, flags); -return 0 ; +return NETDEV_TX_OK ; }spin_unlock_irqrestore (&lp->reset_lock, flags);
@@ -1037,7 +1038,7 @@ static int xemaclite_send(struct sk_buff *orig_skb, struct net_device *dev) dev->stats.tx_bytes += len;dev_consume_skb_any (new_skb); -return 0 ; +return NETDEV_TX_OK ; }/**
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 13/66 net: broadcom: fix return type of ndo_start_xmit function
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 0c13b8d1aee87c35a2fbc1d85a1f766227cf54b5 ]
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t.
Found by coccinelle.
--- drivers/net/ethernet/broadcom/bcm63xx_enet.c | 5 +++-- drivers/net/ethernet/broadcom/sb1250-mac.c | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/ethernet/broadcom/bcm63xx_enet.c +3 -2
@@ -571,12 +571,13 @@ static irqreturn_t bcm_enet_isr_dma(int irq, void *dev_id)/* * tx request callback */ -static int bcm_enet_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t +bcm_enet_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct bcm_enet_priv *priv;struct bcm_enet_desc *desc;u32 len_stat; -int ret; +netdev_tx_t ret; priv =netdev_priv (dev);
drivers/net/ethernet/broadcom/sb1250-mac.c +2 -2
@@ -299,7 +299,7 @@ static enum sbmac_state sbmac_set_channel_state(struct sbmac_softc *,static void sbmac_promiscuous_mode (struct sbmac_softc *sc,int onoff);static uint64_t sbmac_addr2reg (unsigned char *ptr);static irqreturn_t sbmac_intr (int irq,void *dev_instance); -static int sbmac_start_tx (struct sk_buff *skb,struct net_device *dev); +static netdev_tx_t sbmac_start_tx (struct sk_buff *skb,struct net_device *dev);static void sbmac_setmulti (struct sbmac_softc *sc);static int sbmac_init (struct platform_device *pldev,long long base);static int sbmac_set_speed (struct sbmac_softc *s,enum sbmac_speed speed);
@@ -2032,7 +2032,7 @@ static irqreturn_t sbmac_intr(int irq,void *dev_instance)* Return value: * nothing ********************************************************************* */ -static int sbmac_start_tx (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t sbmac_start_tx (struct sk_buff *skb,struct net_device *dev) {struct sbmac_softc *sc =netdev_priv (dev);unsigned long flags;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 14/66 net: amd: fix return type of ndo_start_xmit function
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit fe72352e37ae8478f4c97975a9831f0c50f22e73 ]
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t.
Found by coccinelle.
--- drivers/net/ethernet/amd/am79c961a.c | 2 +- drivers/net/ethernet/amd/atarilance.c | 6 ++++-- drivers/net/ethernet/amd/declance.c | 2 +- drivers/net/ethernet/amd/sun3lance.c | 6 ++++-- drivers/net/ethernet/amd/sunlance.c | 2 +- drivers/net/ethernet/amd/xgbe/xgbe-drv.c | 4 ++-- 6 files changed, 13 insertions(+), 9 deletions(-)
drivers/net/ethernet/amd/am79c961a.c +1 -1
@@ -440,7 +440,7 @@ static void am79c961_timeout(struct net_device *dev)/* * Transmit a packet */ -static int +static netdev_tx_t am79c961_sendpacket (struct sk_buff *skb,struct net_device *dev) {struct dev_priv *priv =netdev_priv (dev);
drivers/net/ethernet/amd/atarilance.c +4 -2
@@ -339,7 +339,8 @@ static unsigned long lance_probe1( struct net_device *dev, struct lance_addr *init_rec );static int lance_open (struct net_device *dev );static void lance_init_ring (struct net_device *dev ); -static int lance_start_xmit (struct sk_buff *skb,struct net_device *dev ); +static netdev_tx_t lance_start_xmit (struct sk_buff *skb, +struct net_device *dev);static irqreturn_t lance_interrupt (int irq,void *dev_id );static int lance_rx (struct net_device *dev );static int lance_close (struct net_device *dev );
@@ -770,7 +771,8 @@ static void lance_tx_timeout (struct net_device *dev)/* XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX */ -static int lance_start_xmit (struct sk_buff *skb,struct net_device *dev ) +static netdev_tx_t +lance_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct lance_private *lp =netdev_priv (dev);struct lance_ioreg *IO = lp->iobase;
drivers/net/ethernet/amd/declance.c +1 -1
@@ -893,7 +893,7 @@ static void lance_tx_timeout(struct net_device *dev)netif_wake_queue (dev); } -static int lance_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t lance_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct lance_private *lp =netdev_priv (dev);volatile struct lance_regs *ll = lp->ll;
drivers/net/ethernet/amd/sun3lance.c +4 -2
@@ -235,7 +235,8 @@ struct lance_private {static int lance_probe (struct net_device *dev);static int lance_open (struct net_device *dev );static void lance_init_ring (struct net_device *dev ); -static int lance_start_xmit (struct sk_buff *skb,struct net_device *dev ); +static netdev_tx_t lance_start_xmit (struct sk_buff *skb, +struct net_device *dev);static irqreturn_t lance_interrupt (int irq,void *dev_id);static int lance_rx (struct net_device *dev );static int lance_close (struct net_device *dev );
@@ -511,7 +512,8 @@ static void lance_init_ring( struct net_device *dev ) } -static int lance_start_xmit (struct sk_buff *skb,struct net_device *dev ) +static netdev_tx_t +lance_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct lance_private *lp =netdev_priv (dev);int entry, len;
drivers/net/ethernet/amd/sunlance.c +1 -1
@@ -1106,7 +1106,7 @@ static void lance_tx_timeout(struct net_device *dev)netif_wake_queue (dev); } -static int lance_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t lance_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct lance_private *lp =netdev_priv (dev);int entry, skblen, len;
drivers/net/ethernet/amd/xgbe/xgbe-drv.c +2 -2
@@ -1390,7 +1390,7 @@ static int xgbe_close(struct net_device *netdev)return 0 ; } -static int xgbe_xmit (struct sk_buff *skb,struct net_device *netdev) +static netdev_tx_t xgbe_xmit (struct sk_buff *skb,struct net_device *netdev) {struct xgbe_prv_data *pdata =netdev_priv (netdev);struct xgbe_hw_if *hw_if = &pdata->hw_if;
@@ -1399,7 +1399,7 @@ static int xgbe_xmit(struct sk_buff *skb, struct net_device *netdev)struct xgbe_ring *ring;struct xgbe_packet_data *packet;struct netdev_queue *txq; -int ret; +netdev_tx_t ret;DBGPR ("-->xgbe_xmit: skb->len = %d\n" , skb->len);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 15/66 usb: chipidea: imx: enable OTG overcurrent in case USB subsystem is already started
In reply to Sasha LevinFrom: Nicolas Adell <[email protected]>
[ Upstream commit 1dedbdf2bbb1ede8d96f35f9845ecae179dc1988 ]
When initializing the USB subsystem before starting the kernel, OTG overcurrent detection is disabled. In case the OTG polarity of overcurrent is low active, the overcurrent detection is never enabled again and events cannot be reported as expected. Because imx usb overcurrent polarity is low active by default, only detection needs to be enable in usbmisc init function.
--- drivers/usb/chipidea/usbmisc_imx.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/usb/chipidea/usbmisc_imx.c +2 -0
@@ -273,6 +273,8 @@ static int usbmisc_imx6q_init(struct imx_usbmisc_data *data) }else if (data->oc_polarity ==1 ) {/* High active */ reg &= ~(MX6_BM_OVER_CUR_DIS |MX6_BM_OVER_CUR_POLARITY ); + }else { + reg &= ~(MX6_BM_OVER_CUR_DIS ); }writel (reg, usbmisc->base + data->index *4 );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 16/66 usb: chipidea: Fix otg event handler
In reply to Sasha LevinFrom: Loic Poulain <[email protected]>
[ Upstream commit 59739131e0ca06db7560f9073fff2fb83f6bc2a5 ]
At OTG work running time, it's possible that several events need to be addressed (e.g. ID and VBUS events). The current implementation handles only one event at a time which leads to ignoring the other one. Fix it.
--- drivers/usb/chipidea/otg.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/usb/chipidea/otg.c +6 -3
@@ -206,14 +206,17 @@ static void ci_otg_work(struct work_struct *work) }pm_runtime_get_sync (ci->dev); +if (ci->id_event) { ci->id_event = false;ci_handle_id_switch (ci); - }else if (ci->b_sess_valid_event) { + } + +if (ci->b_sess_valid_event) { ci->b_sess_valid_event = false;ci_handle_vbus_change (ci); - }else -dev_err (ci->dev,"unexpected event occurs at %s\n" , __func__); + } +pm_runtime_put_sync (ci->dev);enable_irq (ci->irq);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 17/66 mlxsw: spectrum: Init shaper for TCs 8..15
In reply to Sasha LevinFrom: Petr Machata <[email protected]>
[ Upstream commit a9f36656b519a9a21309793c306941a3cd0eeb8f ]
With introduction of MC-aware mode to mlxsw, it became necessary to configure TCs above 7 as well. There is now code in mlxsw to disable ETS for these higher classes, but disablement of max shaper was neglected.
By default, max shaper is currently disabled to begin with, so the problem is just cosmetic. However, for symmetry, do like we do for ETS configuration, and call mlxsw_sp_port_ets_maxrate_set() for both TC i and i + 8.
--- drivers/net/ethernet/mellanox/mlxsw/spectrum.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/net/ethernet/mellanox/mlxsw/spectrum.c +7 -0
@@ -2191,6 +2191,13 @@ static int mlxsw_sp_port_ets_init(struct mlxsw_sp_port *mlxsw_sp_port) MLXSW_REG_QEEC_MAS_DIS);if (err)return err; + + err =mlxsw_sp_port_ets_maxrate_set (mlxsw_sp_port, +MLXSW_REG_QEEC_HIERARCY_TC , + i +8 , i, +MLXSW_REG_QEEC_MAS_DIS ); +if (err) +return err; }/* Map all priorities to traffic class 0. */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 18/66 ARM: dts: am335x-evm: fix number of cpsw
In reply to Sasha LevinFrom: Grygorii Strashko <[email protected]>
[ Upstream commit dcbf6b18d81bcdc51390ca1b258c17e2e13b7d0c ]
am335x-evm has only one CPSW external port physically wired, but DT defines 2 ext. ports. As result, PHY connection failure reported for the second ext. port.
Update DT to reflect am335x-evm board HW configuration, and, while here, switch to use phy-handle instead of phy_id.
--- arch/arm/boot/dts/am335x-evm.dts | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm/boot/dts/am335x-evm.dts +6 -6
@@ -701,6 +701,7 @@ pinctrl-0 = <&cpsw_default>; pinctrl-1 = <&cpsw_sleep>; status = "okay"; + slaves = <1>; }; &davinci_mdio {
@@ -708,15 +709,14 @@ pinctrl-0 = <&davinci_mdio_default>; pinctrl-1 = <&davinci_mdio_sleep>; status = "okay"; -}; -&cpsw_emac0 { - phy_id = <&davinci_mdio>, <0>; - phy-mode = "rgmii-txid"; + ethphy0: ethernet-phy@0 { + reg = <0>; + }; }; -&cpsw_emac1 { - phy_id = <&davinci_mdio>, <1>; +&cpsw_emac0 { + phy-handle = <ðphy0>; phy-mode = "rgmii-txid"; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 19/66 f2fs: fix to recover inode's uid/gid during POR
In reply to Sasha LevinFrom: Chao Yu <[email protected]>
[ Upstream commit dc4cd1257c86451cec3e8e352cc376348e4f4af4 ]
Step to reproduce this bug:
1. logon as root
2. mount -t f2fs /dev/sdd /mnt;
3. touch /mnt/file;
4. chown system /mnt/file; chgrp system /mnt/file;
5. xfs_io -f /mnt/file -c "fsync";
6. godown /mnt;
7. umount /mnt;
8. mount -t f2fs /dev/sdd /mnt;
After step 8) we will expect file's uid/gid are all system, but during recovery, these two fields were not been recovered, fix it.
--- fs/f2fs/recovery.c | 2 ++ 1 file changed, 2 insertions(+)
fs/f2fs/recovery.c +2 -0
@@ -179,6 +179,8 @@ static void recover_inode(struct inode *inode, struct page *page)char *name; inode->i_mode =le16_to_cpu (raw->i_mode); +i_uid_write (inode,le32_to_cpu (raw->i_uid)); +i_gid_write (inode,le32_to_cpu (raw->i_gid));f2fs_i_size_write (inode,le64_to_cpu (raw->i_size)); inode->i_atime.tv_sec =le64_to_cpu (raw->i_mtime); inode->i_ctime.tv_sec =le64_to_cpu (raw->i_ctime);
Signature · 8 lines
2.20.1 _______________________________________________ Linux-f2fs-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/linux-f2fs-devel
Sasha Levin
maintainerPATCH 20/66 ARM: dts: ux500: Correct SCU unit address
In reply to Sasha LevinFrom: Geert Uytterhoeven <[email protected]>
[ Upstream commit 2f217d24ecaec2012e628d21e244eef0608656a4 ]
The unit address of the Cortex-A9 SCU device node contains one zero too many. Remove it.
--- arch/arm/boot/dts/ste-dbx5x0.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/ste-dbx5x0.dtsi +1 -1
@@ -188,7 +188,7 @@ <0xa0410100 0x100>; }; - scu@a04100000 { + scu@a0410000 { compatible = "arm,cortex-a9-scu"; reg = <0xa0410000 0x100>; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 21/66 ARM: dts: ux500: Fix LCDA clock line muxing
In reply to Sasha LevinFrom: Linus Walleij <[email protected]>
[ Upstream commit ecde29569e3484e1d0a032bf4074449bce4d4a03 ]
The "lcdaclk_b_1" group is muxed with the function "lcd" but needs a separate entry to be muxed in with "lcda" rather than "lcd".
--- arch/arm/boot/dts/ste-href-family-pinctrl.dtsi | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
arch/arm/boot/dts/ste-href-family-pinctrl.dtsi +6 -2
@@ -607,16 +607,20 @@ mcde { lcd_default_mode: lcd_default { - default_mux { + default_mux1 { /* Mux in VSI0 and all the data lines */ function = "lcd"; groups = "lcdvsi0_a_1", /* VSI0 for LCD */ "lcd_d0_d7_a_1", /* Data lines */ "lcd_d8_d11_a_1", /* TV-out */ - "lcdaclk_b_1", /* Clock line for TV-out */ "lcdvsi1_a_1"; /* VSI1 for HDMI */ }; + default_mux2 { + function = "lcda"; + groups = + "lcdaclk_b_1"; /* Clock line for TV-out */ + }; default_cfg1 { pins = "GPIO68_E1", /* VSI0 */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 22/66 ARM: dts: ste: Fix SPI controller node names
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit 2f967f9e9fa076affb711da1a8389b5d33814fc6 ]
SPI controller nodes should be named 'spi' rather than 'ssp'. Fixing the name enables dtc SPI bus checks.
--- arch/arm/boot/dts/ste-dbx5x0.dtsi | 4 ++-- arch/arm/boot/dts/ste-hrefprev60.dtsi | 2 +- arch/arm/boot/dts/ste-snowball.dts | 2 +- arch/arm/boot/dts/ste-u300.dts | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/ste-dbx5x0.dtsi +2 -2
@@ -864,7 +864,7 @@ power-domains = <&pm_domains DOMAIN_VAPE>; }; - ssp@80002000 { + spi@80002000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x80002000 0x1000>; interrupts = <GIC_SPI 14 IRQ_TYPE_LEVEL_HIGH>;
@@ -878,7 +878,7 @@ power-domains = <&pm_domains DOMAIN_VAPE>; }; - ssp@80003000 { + spi@80003000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x80003000 0x1000>; interrupts = <GIC_SPI 52 IRQ_TYPE_LEVEL_HIGH>;
arch/arm/boot/dts/ste-hrefprev60.dtsi +1 -1
@@ -57,7 +57,7 @@ }; }; - ssp@80002000 { + spi@80002000 { /* * On the first generation boards, this SSP/SPI port was connected * to the AB8500.
arch/arm/boot/dts/ste-snowball.dts +1 -1
@@ -386,7 +386,7 @@ pinctrl-1 = <&i2c3_sleep_mode>; }; - ssp@80002000 { + spi@80002000 { pinctrl-names = "default"; pinctrl-0 = <&ssp0_snowball_mode>; };
arch/arm/boot/dts/ste-u300.dts +1 -1
@@ -441,7 +441,7 @@ dma-names = "rx"; }; - spi: ssp@c0006000 { + spi: spi@c0006000 { compatible = "arm,pl022", "arm,primecell"; reg = <0xc0006000 0x1000>; interrupt-parent = <&vica>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 23/66 spi: pic32: Use proper enum in dmaengine_prep_slave_rg
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 8cfde7847d5ed0bb77bace41519572963e43cd17 ]
Clang warns when one enumerated type is converted implicitly to another:
drivers/spi/spi-pic32.c:323:8: warning: implicit conversion from enumeration type 'enum dma_data_direction' to different enumeration type 'enum dma_transfer_direction' [-Wenum-conversion]
DMA_FROM_DEVICE,
^~~~~~~~~~~~~~~
drivers/spi/spi-pic32.c:333:8: warning: implicit conversion from
enumeration type 'enum dma_data_direction' to different enumeration type
'enum dma_transfer_direction' [-Wenum-conversion]
DMA_TO_DEVICE,
^~~~~~~~~~~~~2 warnings generated.
Use the proper enums from dma_transfer_direction (DMA_FROM_DEVICE = DMA_DEV_TO_MEM = 2, DMA_TO_DEVICE = DMA_MEM_TO_DEV = 1) to satify Clang.
--- drivers/spi/spi-pic32.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/spi/spi-pic32.c +2 -2
@@ -320,7 +320,7 @@ static int pic32_spi_dma_transfer(struct pic32_spi *pic32s, desc_rx =dmaengine_prep_slave_sg (master->dma_rx, xfer->rx_sg.sgl, xfer->rx_sg.nents, -DMA_FROM_DEVICE , +DMA_DEV_TO_MEM ,DMA_PREP_INTERRUPT |DMA_CTRL_ACK );if (!desc_rx) { ret = -EINVAL ;
@@ -330,7 +330,7 @@ static int pic32_spi_dma_transfer(struct pic32_spi *pic32s, desc_tx =dmaengine_prep_slave_sg (master->dma_tx, xfer->tx_sg.sgl, xfer->tx_sg.nents, -DMA_TO_DEVICE , +DMA_MEM_TO_DEV ,DMA_PREP_INTERRUPT |DMA_CTRL_ACK );if (!desc_tx) { ret = -EINVAL ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 24/66 cpufeature: avoid warning when compiling with clang
In reply to Sasha LevinFrom: Stefan Agner <[email protected]>
[ Upstream commit c785896b21dd8e156326ff660050b0074d3431df ]
The table id (second) argument to MODULE_DEVICE_TABLE is often referenced otherwise. This is not the case for CPU features. This leads to warnings when building the kernel with Clang:
arch/arm/crypto/aes-ce-glue.c:450:1: warning: variable
'cpu_feature_match_AES' is not needed and will not be emitted [-Wunneeded-internal-declaration]
module_cpu_feature_match(AES, aes_init);
^
Avoid warnings by using __maybe_unused, similar to commit 1f318a8bafcf ("modules: mark __inittest/__exittest as __maybe_unused").
--- include/linux/cpufeature.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
include/linux/cpufeature.h +1 -1
@@ -45,7 +45,7 @@* 'asm/cpufeature.h' of your favorite architecture. */ #define module_cpu_feature_match (x, __initfunc) \ -static struct cpu_feature const cpu_feature_match_ ## x[] = \ +static struct cpu_feature const __maybe_unused cpu_feature_match_ ## x[] = \ { { .feature = cpu_feature(x) }, { } }; \ MODULE_DEVICE_TABLE(cpu, cpu_feature_match_ ## x); \ \
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 25/66 ARM: dts: marvell: Fix SPI and I2C bus warnings
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit cf680cc5251487b9a39919c3cda31a108af19cf8 ]
dtc has new checks for I2C and SPI buses. Fix the warnings in node names and unit-addresses.
arch/arm/boot/dts/dove-cubox.dtb: Warning (i2c_bus_reg): /i2c-mux/i2c@0/clock-generator: I2C bus unit address format error, expected "60" arch/arm/boot/dts/dove-cubox-es.dtb: Warning (i2c_bus_reg): /i2c-mux/i2c@0/clock-generator: I2C bus unit address format error, expected "60" arch/arm/boot/dts/dove-cubox.dtb: Warning (spi_bus_bridge): /mbus/internal-regs/spi-ctrl@10600: node name for SPI buses should be 'spi' arch/arm/boot/dts/dove-cubox-es.dtb: Warning (spi_bus_bridge): /mbus/internal-regs/spi-ctrl@10600: node name for SPI buses should be 'spi' arch/arm/boot/dts/dove-dove-db.dtb: Warning (spi_bus_bridge): /mbus/internal-regs/spi-ctrl@10600: node name for SPI buses should be 'spi' arch/arm/boot/dts/dove-sbc-a510.dtb: Warning (spi_bus_bridge): /mbus/internal-regs/spi-ctrl@10600: node name for SPI buses should be 'spi' arch/arm/boot/dts/dove-sbc-a510.dtb: Warning (spi_bus_bridge): /mbus/internal-regs/spi-ctrl@14600: node name for SPI buses should be 'spi' arch/arm/boot/dts/orion5x-kuroboxpro.dtb: Warning (i2c_bus_reg): /soc/internal-regs/i2c@11000/rtc: I2C bus unit address format error, expected "32" arch/arm/boot/dts/orion5x-linkstation-lschl.dtb: Warning (i2c_bus_reg): /soc/internal-regs/i2c@11000/rtc: I2C bus unit address format error, expected "32" arch/arm/boot/dts/orion5x-linkstation-lsgl.dtb: Warning (i2c_bus_reg): /soc/internal-regs/i2c@11000/rtc: I2C bus unit address format error, expected "32" arch/arm/boot/dts/orion5x-linkstation-lswtgl.dtb: Warning (i2c_bus_reg): /soc/internal-regs/i2c@11000/rtc: I2C bus unit address format error, expected "32"
--- arch/arm/boot/dts/dove-cubox.dts | 2 +- arch/arm/boot/dts/dove.dtsi | 6 +++--- arch/arm/boot/dts/orion5x-linkstation.dtsi | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/dove-cubox.dts +1 -1
@@ -86,7 +86,7 @@ status = "okay"; clock-frequency = <100000>; - si5351: clock-generator { + si5351: clock-generator@60 { compatible = "silabs,si5351a-msop"; reg = <0x60>; #address-cells = <1>;
arch/arm/boot/dts/dove.dtsi +3 -3
@@ -152,7 +152,7 @@ 0xffffe000 MBUS_ID(0x03, 0x01) 0 0x0000800 /* CESA SRAM 2k */ 0xfffff000 MBUS_ID(0x0d, 0x00) 0 0x0000800>; /* PMU SRAM 2k */ - spi0: spi-ctrl@10600 { + spi0: spi@10600 { compatible = "marvell,orion-spi"; #address-cells = <1>; #size-cells = <0>;
@@ -165,7 +165,7 @@ status = "disabled"; }; - i2c: i2c-ctrl@11000 { + i2c: i2c@11000 { compatible = "marvell,mv64xxx-i2c"; reg = <0x11000 0x20>; #address-cells = <1>;
@@ -215,7 +215,7 @@ status = "disabled"; }; - spi1: spi-ctrl@14600 { + spi1: spi@14600 { compatible = "marvell,orion-spi"; #address-cells = <1>; #size-cells = <0>;
arch/arm/boot/dts/orion5x-linkstation.dtsi +1 -1
@@ -156,7 +156,7 @@ &i2c { status = "okay"; - rtc { + rtc@32 { compatible = "ricoh,rs5c372a"; reg = <0x32>; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 26/66 bnx2x: Ignore bandwidth attention in single function mode
In reply to Sasha LevinFrom: Shahed Shaikh <[email protected]>
[ Upstream commit 75a110a1783ef8324ffd763b24f4ac268253cbca ]
This is a workaround for FW bug -
MFW generates bandwidth attention in single function mode, which is only expected to be generated in multi function mode. This undesired attention in SF mode results in incorrect HW configuration and resulting into Tx timeout.
--- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c +10 -0
@@ -3540,6 +3540,16 @@ static void bnx2x_drv_info_iscsi_stat(struct bnx2x *bp)*/ static void bnx2x_config_mf_bw (struct bnx2x *bp) { +/* Workaround for MFW bug. +* MFW is not supposed to generate BW attention in +* single function mode. +*/ +if (!IS_MF (bp)) { +DP (BNX2X_MSG_MCP , +"Ignoring MF BW config in single function mode\n" ); +return ; + } +if (bp->link_vars.link_up) {bnx2x_cmng_fns_init (bp, true,CMNG_FNS_MINMAX );bnx2x_link_sync_notify (bp);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 27/66 net: micrel: fix return type of ndo_start_xmit function
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 2b49117a5abee8478b0470cba46ac74f93b4a479 ]
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t.
Found by coccinelle.
--- drivers/net/ethernet/micrel/ks8695net.c | 2 +- drivers/net/ethernet/micrel/ks8851_mll.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)
drivers/net/ethernet/micrel/ks8695net.c +1 -1
@@ -1156,7 +1156,7 @@ ks8695_timeout(struct net_device *ndev)* sk_buff and adds it to the TX ring. It then kicks the TX DMA * engine to ensure transmission begins. */ -static int +static netdev_tx_t ks8695_start_xmit (struct sk_buff *skb,struct net_device *ndev) {struct ks8695_priv *ksp =netdev_priv (ndev);
drivers/net/ethernet/micrel/ks8851_mll.c +2 -2
@@ -1020,9 +1020,9 @@ static void ks_write_qmu(struct ks_net *ks, u8 *pdata, u16 len)* spin_lock_irqsave is required because tx and rx should be mutual exclusive. * So while tx is in-progress, prevent IRQ interrupt from happenning. */ -static int ks_start_xmit (struct sk_buff *skb,struct net_device *netdev) +static netdev_tx_t ks_start_xmit (struct sk_buff *skb,struct net_device *netdev) { -int retv =NETDEV_TX_OK ; +netdev_tx_t retv =NETDEV_TX_OK ;struct ks_net *ks =netdev_priv (netdev);disable_irq (netdev->irq);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 28/66 x86/CPU: Use correct macros for Cyrix calls
In reply to Sasha LevinFrom: Matthew Whitehead <[email protected]>
[ Upstream commit 03b099bdcdf7125d4a63dc9ddeefdd454e05123d ]
There are comments in processor-cyrix.h advising you to _not_ make calls using the deprecated macros in this style:
setCx86_old(CX86_CCR4, getCx86_old(CX86_CCR4) | 0x80);
This is because it expands the macro into a non-functioning calling sequence. The calling order must be:
outb(CX86_CCR2, 0x22); inb(0x23);
From the comments:
* When using the old macros a line like
* setCx86(CX86_CCR2, getCx86(CX86_CCR2) | 0x88);
* gets expanded to:
* do {
* outb((CX86_CCR2), 0x22);
* outb((({
* outb((CX86_CCR2), 0x22);
* inb(0x23);
* }) | 0x88), 0x23);
* } while (0);
The new macros fix this problem, so use them instead.
--- arch/x86/kernel/cpu/cyrix.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/cpu/cyrix.c +1 -1
@@ -434,7 +434,7 @@ static void cyrix_identify(struct cpuinfo_x86 *c)/* enable MAPEN */ setCx86 (CX86_CCR3 , (ccr3 &0x0f ) |0x10 );/* enable cpuid */ -setCx86_old (CX86_CCR4 ,getCx86_old (CX86_CCR4 ) |0x80 ); +setCx86 (CX86_CCR4 ,getCx86 (CX86_CCR4 ) |0x80 );/* disable MAPEN */ setCx86 (CX86_CCR3 , ccr3);local_irq_restore (flags);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 29/66 MIPS: kexec: Relax memory restriction
In reply to Sasha LevinFrom: Dengcheng Zhu <[email protected]>
[ Upstream commit a6da4d6fdf8bd512c98d3ac7f1d16bc4bb282919 ]
We can rely on the system kernel and the dump capture kernel themselves in memory usage.
Being restrictive with 512MB limit may cause kexec tool failure on some platforms.
Patchwork: https://patchwork.linux-mips.org/patch/20568/
--- arch/mips/include/asm/kexec.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/mips/include/asm/kexec.h +3 -3
@@ -12,11 +12,11 @@#include <asm/stacktrace.h> /* Maximum physical address we can use pages from */ -#define KEXEC_SOURCE_MEMORY_LIMIT (0x20000000) +#define KEXEC_SOURCE_MEMORY_LIMIT (-1UL)/* Maximum address we can reach in physical address mode */ -#define KEXEC_DESTINATION_MEMORY_LIMIT (0x20000000) +#define KEXEC_DESTINATION_MEMORY_LIMIT (-1UL)/* Maximum address we can use for the control code buffer */ -#define KEXEC_CONTROL_MEMORY_LIMIT (0x20000000) +#define KEXEC_CONTROL_MEMORY_LIMIT (-1UL)/* Reserve 3*4096 bytes for board-specific info */ #define KEXEC_CONTROL_PAGE_SIZE (4096 + 3*4096)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 30/66 media: pci: ivtv: Fix a sleep-in-atomic-context bug in ivtv_yuv_init()
In reply to Sasha LevinFrom: Jia-Ju Bai <[email protected]>
[ Upstream commit 8d11eb847de7d89c2754988c944d51a4f63e219b ]
The driver may sleep in a interrupt handler.
The function call paths (from bottom to top) in Linux-4.16 are:
[FUNC] kzalloc(GFP_KERNEL) drivers/media/pci/ivtv/ivtv-yuv.c, 938:
kzalloc in ivtv_yuv_initdrivers/media/pci/ivtv/ivtv-yuv.c, 960:
ivtv_yuv_init in ivtv_yuv_next_freedrivers/media/pci/ivtv/ivtv-yuv.c, 1126:
ivtv_yuv_next_free in ivtv_yuv_setup_stream_framedrivers/media/pci/ivtv/ivtv-irq.c, 827:
ivtv_yuv_setup_stream_frame in ivtv_irq_dec_data_reqdrivers/media/pci/ivtv/ivtv-irq.c, 1013:
ivtv_irq_dec_data_req in ivtv_irq_handler
To fix this bug, GFP_KERNEL is replaced with GFP_ATOMIC.
This bug is found by my static analysis tool DSAC.
--- drivers/media/pci/ivtv/ivtv-yuv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/ivtv/ivtv-yuv.c +1 -1
@@ -935,7 +935,7 @@ static void ivtv_yuv_init(struct ivtv *itv) }/* We need a buffer for blanking when Y plane is offset - non-fatal if we can't get one */ - yi->blanking_ptr =kzalloc (720 *16 ,GFP_KERNEL |__GFP_NOWARN); + yi->blanking_ptr =kzalloc (720 *16 ,GFP_ATOMIC |__GFP_NOWARN);if (yi->blanking_ptr) { yi->blanking_dmaptr =pci_map_single (itv->pdev, yi->blanking_ptr,720 *16 ,PCI_DMA_TODEVICE ); }else {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 31/66 media: au0828: Fix incorrect error messages
In reply to Sasha LevinFrom: Brad Love <[email protected]>
[ Upstream commit f347596f2bf114a3af3d80201c6e6bef538d884f ]
Correcting red herring error messages.
Where appropriate, replaces au0282_dev_register with:
- au0828_analog_register
- au0828_dvb_register
--- drivers/media/usb/au0828/au0828-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/usb/au0828/au0828-core.c +2 -2
@@ -639,7 +639,7 @@ static int au0828_usb_probe(struct usb_interface *interface,/* Analog TV */ retval =au0828_analog_register (dev, interface);if (retval) { -pr_err ("%s() au0282_dev_register failed to register on V4L2\n" , +pr_err ("%s() au0828_analog_register failed to register on V4L2\n" , __func__); goto done; }
@@ -647,7 +647,7 @@ static int au0828_usb_probe(struct usb_interface *interface,/* Digital TV */ retval =au0828_dvb_register (dev);if (retval) -pr_err ("%s() au0282_dev_register failed\n" , +pr_err ("%s() au0828_dvb_register failed\n" , __func__);/* Remote controller */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 32/66 media: davinci: Fix implicit enum conversion warning
In reply to Sasha LevinFrom: Nathan Chancellor <[email protected]>
[ Upstream commit 4158757395b300b6eb308fc20b96d1d231484413 ]
Clang warns when one enumerated type is implicitly converted to another.
drivers/media/platform/davinci/vpbe_display.c:524:24: warning: implicit conversion from enumeration type 'enum osd_v_exp_ratio' to different enumeration type 'enum osd_h_exp_ratio' [-Wenum-conversion]
layer_info->h_exp = V_EXP_6_OVER_5;
~ ^~~~~~~~~~~~~~1 warning generated.
This appears to be a copy and paste error judging from the couple of lines directly above this statement and the way that height is handled in the if block above this one.
--- drivers/media/platform/davinci/vpbe_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/davinci/vpbe_display.c +1 -1
@@ -518,7 +518,7 @@ vpbe_disp_calculate_scale_factor(struct vpbe_display *disp_dev,else if (v_scale ==4 ) layer_info->v_zoom =ZOOM_X4 ;if (v_exp) - layer_info->h_exp =V_EXP_6_OVER_5 ; + layer_info->v_exp =V_EXP_6_OVER_5 ; }else {/* no scaling, only cropping. Set display area to crop area */ cfg->ysize = expected_ysize;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 33/66 usb: gadget: uvc: configfs: Drop leaked references to config items
In reply to Sasha LevinFrom: Laurent Pinchart <[email protected]>
[ Upstream commit 86f3daed59bceb4fa7981d85e89f63ebbae1d561 ]
Some of the .allow_link() and .drop_link() operations implementations call config_group_find_item() and then leak the reference to the returned item. Fix this by dropping those references where needed.
--- drivers/usb/gadget/function/uvc_configfs.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/usb/gadget/function/uvc_configfs.c +4 -0
@@ -543,6 +543,7 @@ static int uvcg_control_class_allow_link(struct config_item *src, unlock:mutex_unlock (&opts->lock); out: +config_item_put (header);mutex_unlock (su_mutex);return ret; }
@@ -584,6 +585,7 @@ static int uvcg_control_class_drop_link(struct config_item *src, unlock:mutex_unlock (&opts->lock); out: +config_item_put (header);mutex_unlock (su_mutex);return ret; }
@@ -2047,6 +2049,7 @@ static int uvcg_streaming_class_allow_link(struct config_item *src, unlock:mutex_unlock (&opts->lock); out: +config_item_put (header);mutex_unlock (su_mutex);return ret; }
@@ -2091,6 +2094,7 @@ static int uvcg_streaming_class_drop_link(struct config_item *src, unlock:mutex_unlock (&opts->lock); out: +config_item_put (header);mutex_unlock (su_mutex);return ret; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 34/66 usb: gadget: uvc: configfs: Prevent format changes after linking header
In reply to Sasha LevinFrom: Joel Pepper <[email protected]>
[ Upstream commit cb2200f7af8341aaf0c6abd7ba37e4c667c41639 ]
While checks are in place to avoid attributes and children of a format being manipulated after the format is linked into the streaming header, the linked flag was never actually set, invalidating the protections. Update the flag as appropriate in the header link calls.
--- drivers/usb/gadget/function/uvc_configfs.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/usb/gadget/function/uvc_configfs.c +3 -0
@@ -772,6 +772,7 @@ static int uvcg_streaming_header_allow_link(struct config_item *src, format_ptr->fmt = target_fmt;list_add_tail (&format_ptr->entry, &src_hdr->formats); ++src_hdr->num_fmt; + ++target_fmt->linked; out:mutex_unlock (&opts->lock);
@@ -810,6 +811,8 @@ static int uvcg_streaming_header_drop_link(struct config_item *src,break ; } + --target_fmt->linked; + out:mutex_unlock (&opts->lock);mutex_unlock (su_mutex);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 35/66 phy: phy-twl4030-usb: fix denied runtime access
In reply to Sasha LevinFrom: Andreas Kemnade <[email protected]>
[ Upstream commit 6c7103aa026094a4ee2c2708ec6977a6dfc5331d ]
When runtime is not enabled, pm_runtime_get_sync() returns -EACCESS, the counter will be incremented but the resume callback not called, so enumeration and charging will not start properly.
To avoid that happen, disable irq on suspend and recheck on resume.
Practically this happens when the device is woken up from suspend by plugging in usb.
--- drivers/phy/phy-twl4030-usb.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
drivers/phy/phy-twl4030-usb.c +29 -0
@@ -144,6 +144,7 @@#define PMBR1 0x0D#define GPIO_USB_4PIN_ULPI_2430C (3 << 0) +static irqreturn_t twl4030_usb_irq (int irq,void *_twl);/* * If VBUS is valid or ID is ground, then we know a * cable is present and we need to be runtime-enabled
@@ -392,6 +393,33 @@ static void __twl4030_phy_power(struct twl4030_usb *twl, int on)WARN_ON (twl4030_usb_write_verify (twl,PHY_PWR_CTRL , pwr) <0 ); } +static int __maybe_unused twl4030_usb_suspend (struct device *dev) +{ +struct twl4030_usb *twl =dev_get_drvdata (dev); + +/* +* we need enabled runtime on resume, +* so turn irq off here, so we do not get it early +* note: wakeup on usb plug works independently of this +*/ +dev_dbg (twl->dev,"%s\n" , __func__); +disable_irq (twl->irq); + +return 0 ; +} + +static int __maybe_unused twl4030_usb_resume (struct device *dev) +{ +struct twl4030_usb *twl =dev_get_drvdata (dev); + +dev_dbg (twl->dev,"%s\n" , __func__); +enable_irq (twl->irq); +/* check whether cable status changed */ +twl4030_usb_irq (0 , twl); + +return 0 ; +} +static int __maybe_unused twl4030_usb_runtime_suspend (struct device *dev) {struct twl4030_usb *twl =dev_get_drvdata (dev);
@@ -652,6 +680,7 @@ static const struct phy_ops ops = {static const struct dev_pm_ops twl4030_usb_pm_ops = { SET_RUNTIME_PM_OPS(twl4030_usb_runtime_suspend, twl4030_usb_runtime_resume, NULL) +SET_SYSTEM_SLEEP_PM_OPS (twl4030_usb_suspend, twl4030_usb_resume) };static int twl4030_usb_probe (struct platform_device *pdev)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 36/66 usb: gadget: uvc: Factor out video USB request queueing
In reply to Sasha LevinFrom: Laurent Pinchart <[email protected]>
[ Upstream commit 9d1ff5dcb3cd3390b1e56f1c24ae42c72257c4a3 ]
USB requests for video data are queued from two different locations in the driver, with the same code block occurring twice. Factor it out to a function.
--- drivers/usb/gadget/function/uvc_video.c | 30 ++++++++++++++++--------- 1 file changed, 20 insertions(+), 10 deletions(-)
drivers/usb/gadget/function/uvc_video.c +20 -10
@@ -129,6 +129,19 @@ uvc_video_encode_isoc(struct usb_request *req, struct uvc_video *video,* Request handling */ +static int uvcg_video_ep_queue (struct uvc_video *video,struct usb_request *req) +{ +int ret; + + ret =usb_ep_queue (video->ep, req,GFP_ATOMIC ); +if (ret <0 ) { +printk (KERN_INFO "Failed to queue request (%d).\n" , ret); +usb_ep_set_halt (video->ep); + } + +return ret; +} +/* * I somehow feel that synchronisation won't be easy to achieve here. We have * three events that control USB requests submission:
@@ -193,14 +206,13 @@ uvc_video_complete(struct usb_ep *ep, struct usb_request *req) video->encode (req, video, buf); -if ((ret =usb_ep_queue (ep, req,GFP_ATOMIC )) <0 ) { -printk (KERN_INFO "Failed to queue request (%d).\n" , ret); -usb_ep_set_halt (ep); -spin_unlock_irqrestore (&video->queue.irqlock, flags); + ret =uvcg_video_ep_queue (video, req); +spin_unlock_irqrestore (&video->queue.irqlock, flags); + +if (ret <0 ) {uvcg_queue_cancel (queue,0 ); goto requeue; } -spin_unlock_irqrestore (&video->queue.irqlock, flags);return ;
@@ -320,15 +332,13 @@ int uvcg_video_pump(struct uvc_video *video) video->encode (req, video, buf);/* Queue the USB request */ - ret =usb_ep_queue (video->ep, req,GFP_ATOMIC ); + ret =uvcg_video_ep_queue (video, req); +spin_unlock_irqrestore (&queue->irqlock, flags); +if (ret <0 ) { -printk (KERN_INFO "Failed to queue request (%d)\n" , ret); -usb_ep_set_halt (video->ep); -spin_unlock_irqrestore (&queue->irqlock, flags);uvcg_queue_cancel (queue,0 );break ; } -spin_unlock_irqrestore (&queue->irqlock, flags); }spin_lock_irqsave (&video->req_lock, flags);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 37/66 usb: gadget: uvc: Only halt video streaming endpoint in bulk mode
In reply to Sasha LevinFrom: Laurent Pinchart <[email protected]>
[ Upstream commit 8dbf9c7abefd5c1434a956d5c6b25e11183061a3 ]
When USB requests for video data fail to be submitted, the driver signals a problem to the host by halting the video streaming endpoint. This is only valid in bulk mode, as isochronous transfers have no handshake phase and can't thus report a stall. The usb_ep_set_halt() call returns an error when using isochronous endpoints, which we happily ignore, but some UDCs complain in the kernel log. Fix this by only trying to halt the endpoint in bulk mode.
--- drivers/usb/gadget/function/uvc_video.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/gadget/function/uvc_video.c +3 -1
@@ -136,7 +136,9 @@ static int uvcg_video_ep_queue(struct uvc_video *video, struct usb_request *req) ret =usb_ep_queue (video->ep, req,GFP_ATOMIC );if (ret <0 ) {printk (KERN_INFO "Failed to queue request (%d).\n" , ret); -usb_ep_set_halt (video->ep); +/* Isochronous endpoints can't be halted. */ +if (usb_endpoint_xfer_bulk (video->ep->desc)) +usb_ep_set_halt (video->ep); }return ret;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 38/66 coresight: Fix handling of sinks
In reply to Sasha LevinFrom: Suzuki K Poulose <[email protected]>
[ Upstream commit c71369de02b285d9da526a526d8f2affc7b17c59 ]
The coresight components could be operated either in sysfs mode or in perf mode. For some of the components, the mode of operation doesn't matter as they simply relay the data to the next component in the trace path. But for sinks, they need to be able to provide the trace data back to the user. Thus we need to make sure that "mode" is handled appropriately. e.g, the sysfs mode could have multiple sources driving the trace data, while perf mode doesn't allow sharing the sink.
The coresight_enable_sink() however doesn't really allow this check to trigger as it skips the "enable_sink" callback if the component is already enabled, irrespective of the mode. This could cause mixing of data from different modes or even same mode (in perf), if the sources are different. Also, if we fail to enable the sink while enabling a path (where sink is the first component enabled), we could end up in disabling the components in the "entire" path which were not enabled in this trial, causing disruptions in the existing trace paths.
--- drivers/hwtracing/coresight/coresight.c | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-)
drivers/hwtracing/coresight/coresight.c +15 -7
@@ -132,12 +132,14 @@ static int coresight_enable_sink(struct coresight_device *csdev, u32 mode) {int ret; -if (!csdev->enable) { -if (sink_ops (csdev)->enable) { - ret =sink_ops (csdev)->enable (csdev, mode); -if (ret) -return ret; - } +/* +* We need to make sure the "new" session is compatible with the +* existing "mode" of operation. +*/ +if (sink_ops (csdev)->enable) { + ret =sink_ops (csdev)->enable (csdev, mode); +if (ret) +return ret; csdev->enable = true; }
@@ -331,8 +333,14 @@ int coresight_enable_path(struct list_head *path, u32 mode)switch (type) {case CORESIGHT_DEV_TYPE_SINK : ret =coresight_enable_sink (csdev, mode); +/* +* Sink is the first component turned on. If we +* failed to enable the sink, there are no components +* that need disabling. Disabling the path here +* would mean we could disrupt an existing session. +*/ if (ret) - goto err; + goto out;break ;case CORESIGHT_DEV_TYPE_SOURCE :/* sources are enabled from either sysFS or Perf */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 39/66 coresight: etm4x: Configure EL2 exception level when kernel is running in HYP
In reply to Sasha LevinFrom: Tomasz Nowicki <[email protected]>
[ Upstream commit b860801e3237ec4c74cf8de0be4816996757ae5c ]
For non-VHE systems host kernel runs at EL1 and jumps to EL2 whenever hypervisor code should be executed. In this case ETM4x driver must restrict configuration to EL1 when it setups kernel tracing. However, there is no separate hypervisor privilege level when VHE is enabled, the host kernel runs at EL2.
This patch fixes configuration of TRCACATRn register for VHE systems so that ETM_EXLEVEL_NS_HYP bit is used instead of ETM_EXLEVEL_NS_OS to on/off kernel tracing. At the same time, it moves common code to new helper.
--- drivers/hwtracing/coresight/coresight-etm4x.c | 40 +++++++++---------- 1 file changed, 20 insertions(+), 20 deletions(-)
drivers/hwtracing/coresight/coresight-etm4x.c +20 -20
@@ -35,6 +35,7 @@#include <linux/pm_runtime.h> #include <asm/sections.h> #include <asm/local.h> +#include <asm/virt.h> #include "coresight-etm4x.h" #include "coresight-etm-perf.h"
@@ -615,7 +616,7 @@ static void etm4_set_default_config(struct etmv4_config *config) config->vinst_ctrl |=BIT (0 ); } -static u64 etm4_get_access_type (struct etmv4_config *config) +static u64 etm4_get_ns_access_type (struct etmv4_config *config) {u64 access_type =0 ;
@@ -626,17 +627,26 @@ static u64 etm4_get_access_type(struct etmv4_config *config)* Bit[13] Exception level 1 - OS * Bit[14] Exception level 2 - Hypervisor * Bit[15] Never implemented -* -* Always stay away from hypervisor mode. */ - access_type =ETM_EXLEVEL_NS_HYP ; - -if (config->mode &ETM_MODE_EXCL_KERN ) - access_type |=ETM_EXLEVEL_NS_OS ; +if (!is_kernel_in_hyp_mode ()) { +/* Stay away from hypervisor mode for non-VHE */ + access_type =ETM_EXLEVEL_NS_HYP ; +if (config->mode &ETM_MODE_EXCL_KERN ) + access_type |=ETM_EXLEVEL_NS_OS ; + }else if (config->mode &ETM_MODE_EXCL_KERN ) { + access_type =ETM_EXLEVEL_NS_HYP ; + }if (config->mode &ETM_MODE_EXCL_USER ) access_type |=ETM_EXLEVEL_NS_APP ; +return access_type; +} + +static u64 etm4_get_access_type (struct etmv4_config *config) +{ +u64 access_type =etm4_get_ns_access_type (config); +/* * EXLEVEL_S, bits[11:8], don't trace anything happening * in secure state.
@@ -890,20 +900,10 @@ void etm4_config_trace_mode(struct etmv4_config *config) addr_acc = config->addr_acc[ETM_DEFAULT_ADDR_COMP ];/* clear default config */ - addr_acc &= ~(ETM_EXLEVEL_NS_APP |ETM_EXLEVEL_NS_OS ); + addr_acc &= ~(ETM_EXLEVEL_NS_APP |ETM_EXLEVEL_NS_OS | +ETM_EXLEVEL_NS_HYP ); -/* -* EXLEVEL_NS, bits[15:12] -* The Exception levels are: -* Bit[12] Exception level 0 - Application -* Bit[13] Exception level 1 - OS -* Bit[14] Exception level 2 - Hypervisor -* Bit[15] Never implemented -*/ -if (mode &ETM_MODE_EXCL_KERN ) - addr_acc |=ETM_EXLEVEL_NS_OS ; -else - addr_acc |=ETM_EXLEVEL_NS_APP ; + addr_acc |=etm4_get_ns_access_type (config); config->addr_acc[ETM_DEFAULT_ADDR_COMP ] = addr_acc; config->addr_acc[ETM_DEFAULT_ADDR_COMP +1 ] = addr_acc;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 40/66 coresight: tmc: Fix byte-address alignment for RRP
In reply to Sasha LevinFrom: Leo Yan <[email protected]>
[ Upstream commit e7753f3937610633a540f2be81be87531f96ff04 ]
Quoted 1 line
From the comment in the code, it claims the requirement for byte-address
alignment for RRP register: 'for 32-bit, 64-bit and 128-bit wide trace memory, the four LSBs must be 0s. For 256-bit wide trace memory, the five LSBs must be 0s'. This isn't consistent with the program, the program sets five LSBs as zeros for 32/64/128-bit wide trace memory and set six LSBs zeros for 256-bit wide trace memory.
After checking with the CoreSight Trace Memory Controller technical reference manual (ARM DDI 0461B, section 3.3.4 RAM Read Pointer Register), it proves the comment is right and the program does wrong setting.
This patch fixes byte-address alignment for RRP by following correct definition in the technical reference manual.
--- drivers/hwtracing/coresight/coresight-tmc-etf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/hwtracing/coresight/coresight-tmc-etf.c +2 -2
@@ -425,10 +425,10 @@ static void tmc_update_etf_buffer(struct coresight_device *csdev,case TMC_MEM_INTF_WIDTH_32BITS :case TMC_MEM_INTF_WIDTH_64BITS :case TMC_MEM_INTF_WIDTH_128BITS : - mask =GENMASK (31 ,5 ); + mask =GENMASK (31 ,4 );break ;case TMC_MEM_INTF_WIDTH_256BITS : - mask =GENMASK (31 ,6 ); + mask =GENMASK (31 ,5 );break ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 41/66 misc: kgdbts: Fix restrict error
In reply to Sasha LevinFrom: Laura Abbott <[email protected]>
[ Upstream commit fa0218ef733e6f247a1a3986e3eb12460064ac77 ]
kgdbts current fails when compiled with restrict:
drivers/misc/kgdbts.c: In function ‘configure_kgdbts’:drivers/misc/kgdbts.c:1070:2: error: ‘strcpy’ source argument is the same as destination [-Werror=restrict]
strcpy(config, opt);
^~~~~~~~~~~~~~~~~~~
As the error says, config is being used in both the source and destination. Refactor the code to avoid the extra copy and put the parsing closer to the actual location.
--- drivers/misc/kgdbts.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
drivers/misc/kgdbts.c +6 -10
@@ -979,6 +979,12 @@ static void kgdbts_run_tests(void)int nmi_sleep =0 ;int i; + verbose =0 ; +if (strstr (config,"V1" )) + verbose =1 ; +if (strstr (config,"V2" )) + verbose =2 ; + ptr =strchr (config,'F' );if (ptr) fork_test =simple_strtol (ptr +1 ,NULL ,10 );
@@ -1062,13 +1068,6 @@ static int kgdbts_option_setup(char *opt)return -ENOSPC ; }strcpy (config, opt); - - verbose =0 ; -if (strstr (config,"V1" )) - verbose =1 ; -if (strstr (config,"V2" )) - verbose =2 ; -return 0 ; }
@@ -1080,9 +1079,6 @@ static int configure_kgdbts(void)if (!strlen (config) ||isspace (config[0 ])) goto noconfig; - err =kgdbts_option_setup (config); -if (err) - goto noconfig; final_ack =0 ;run_plant_and_detach_test (1 );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 42/66 misc: genwqe: should return proper error value.
In reply to Sasha LevinFrom: zhong jiang <[email protected]>
[ Upstream commit 02241995b004faa7d9ff628e97f24056190853f8 ]
The function should return -EFAULT when copy_from_user fails. Even though the caller does not distinguish them. but we should keep backward compatibility.
--- drivers/misc/genwqe/card_utils.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-)
drivers/misc/genwqe/card_utils.c +7 -6
@@ -298,7 +298,7 @@ static int genwqe_sgl_size(int num_pages)int genwqe_alloc_sync_sgl (struct genwqe_dev *cd,struct genwqe_sgl *sgl,void __user *user_addr,size_t user_size) { -int rc; +int ret = -ENOMEM ;struct pci_dev *pci_dev = cd->pci_dev; sgl->fpage_offs =offset_in_page ((unsigned long )user_addr);
@@ -317,7 +317,7 @@ int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,if (get_order (sgl->sgl_size) >MAX_ORDER ) {dev_err (&pci_dev->dev,"[%s] err: too much memory requested!\n" , __func__); -return -ENOMEM ; +return ret; } sgl->sgl = __genwqe_alloc_consistent(cd, sgl->sgl_size,
@@ -325,7 +325,7 @@ int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,if (sgl->sgl ==NULL ) {dev_err (&pci_dev->dev,"[%s] err: no memory available!\n" , __func__); -return -ENOMEM ; +return ret; }/* Only use buffering on incomplete pages */
@@ -338,7 +338,7 @@ int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,/* Sync with user memory */ if (copy_from_user (sgl->fpage + sgl->fpage_offs, user_addr, sgl->fpage_size)) { - rc = -EFAULT ; + ret = -EFAULT ; goto err_out; } }
@@ -351,7 +351,7 @@ int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,/* Sync with user memory */ if (copy_from_user (sgl->lpage, user_addr + user_size - sgl->lpage_size, sgl->lpage_size)) { - rc = -EFAULT ; + ret = -EFAULT ; goto err_out2; } }
@@ -373,7 +373,8 @@ int genwqe_alloc_sync_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl, sgl->sgl =NULL ; sgl->sgl_dma_addr =0 ; sgl->sgl_size =0 ; -return -ENOMEM ; + +return ret; } int genwqe_setup_sgl(struct genwqe_dev *cd, struct genwqe_sgl *sgl,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 43/66 vfio/pci: Fix potential memory leak in vfio_msi_cap_len
In reply to Sasha LevinFrom: Li Qiang <[email protected]>
[ Upstream commit 30ea32ab1951c80c6113f300fce2c70cd12659e4 ]
Free allocated vdev->msi_perm in error path.
--- drivers/vfio/pci/vfio_pci_config.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/vfio/pci/vfio_pci_config.c +3 -1
@@ -1182,8 +1182,10 @@ static int vfio_msi_cap_len(struct vfio_pci_device *vdev, u8 pos)return -ENOMEM ; ret =init_pci_cap_msi_perm (vdev->msi_perm, len, flags); -if (ret) +if (ret) { +kfree (vdev->msi_perm);return ret; + }return len; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 44/66 vfio/pci: Mask buggy SR-IOV VF INTx support
In reply to Sasha LevinFrom: Alex Williamson <[email protected]>
[ Upstream commit db04264fe9bc0f2b62e036629f9afb530324b693 ]
The SR-IOV spec requires that VFs must report zero for the INTx pin register as VFs are precluded from INTx support. It's much easier for the host kernel to understand whether a device is a VF and therefore whether a non-zero pin register value is bogus than it is to do the same in userspace. Override the INTx count for such devices and virtualize the pin register to provide a consistent view of the device to the user.
As this is clearly a spec violation, warn about it to support hardware validation, but also provide a known whitelist as it doesn't do much good to continue complaining if the hardware vendor doesn't plan to fix it.
Known devices with this issue: 8086:270c
--- drivers/vfio/pci/vfio_pci.c | 8 ++++++-- drivers/vfio/pci/vfio_pci_config.c | 27 +++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 2 deletions(-)
drivers/vfio/pci/vfio_pci.c +6 -2
@@ -426,10 +426,14 @@ static int vfio_pci_get_irq_count(struct vfio_pci_device *vdev, int irq_type) {if (irq_type ==VFIO_PCI_INTX_IRQ_INDEX ) {u8 pin; + +if (!IS_ENABLED (CONFIG_VFIO_PCI_INTX ) || + vdev->nointx || vdev->pdev->is_virtfn) +return 0 ; +pci_read_config_byte (vdev->pdev,PCI_INTERRUPT_PIN , &pin); -if (IS_ENABLED (CONFIG_VFIO_PCI_INTX ) && !vdev->nointx && pin) -return 1 ; +return pin ?1 :0 ; }else if (irq_type ==VFIO_PCI_MSI_IRQ_INDEX ) {u8 pos;u16 flags;
drivers/vfio/pci/vfio_pci_config.c +27 -0
@@ -1608,6 +1608,15 @@ static int vfio_ecap_init(struct vfio_pci_device *vdev)return 0 ; } +/* +* Nag about hardware bugs, hopefully to have vendors fix them, but at least +* to collect a list of dependencies for the VF INTx pin quirk below. +*/ +static const struct pci_device_id known_bogus_vf_intx_pin[] = { + {PCI_DEVICE (PCI_VENDOR_ID_INTEL ,0x270c ) }, + {} +}; +/* * For each device we allocate a pci_config_map that indicates the * capability occupying each dword and thus the struct perm_bits we
@@ -1673,6 +1682,24 @@ int vfio_config_init(struct vfio_pci_device *vdev)if (pdev->is_virtfn) { *(__le16 *)&vconfig[PCI_VENDOR_ID ] =cpu_to_le16 (pdev->vendor); *(__le16 *)&vconfig[PCI_DEVICE_ID ] =cpu_to_le16 (pdev->device); + +/* +* Per SR-IOV spec rev 1.1, 3.4.1.18 the interrupt pin register +* does not apply to VFs and VFs must implement this register +* as read-only with value zero. Userspace is not readily able +* to identify whether a device is a VF and thus that the pin +* definition on the device is bogus should it violate this +* requirement. We already virtualize the pin register for +* other purposes, so we simply need to replace the bogus value +* and consider VFs when we determine INTx IRQ count. +*/ +if (vconfig[PCI_INTERRUPT_PIN ] && + !pci_match_id (known_bogus_vf_intx_pin, pdev)) +pci_warn (pdev, +"Hardware bug: VF reports bogus INTx pin %d\n" , + vconfig[PCI_INTERRUPT_PIN ]); + + vconfig[PCI_INTERRUPT_PIN ] =0 ;/* Gratuitous for good VFs */ }if (!IS_ENABLED (CONFIG_VFIO_PCI_INTX ) || vdev->nointx)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 45/66 scsi: libsas: always unregister the old device if going to discover new
In reply to Sasha LevinFrom: Jason Yan <[email protected]>
[ Upstream commit 32c850bf587f993b2620b91e5af8a64a7813f504 ]
If we went into sas_rediscover_dev() the attached_sas_addr was already insured not to be zero. So it's unnecessary to check if the attached_sas_addr is zero.
And although if the sas address is not changed, we always have to unregister the old device when we are going to register a new one. We cannot just leave the device there and bring up the new.
--- drivers/scsi/libsas/sas_expander.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-)
drivers/scsi/libsas/sas_expander.c +5 -8
@@ -2049,14 +2049,11 @@ static int sas_rediscover_dev(struct domain_device *dev, int phy_id, bool last)return res; } -/* delete the old link */ -if (SAS_ADDR (phy->attached_sas_addr) && -SAS_ADDR (sas_addr) !=SAS_ADDR (phy->attached_sas_addr)) { -SAS_DPRINTK ("ex %016llx phy 0x%x replace %016llx\n" , -SAS_ADDR (dev->sas_addr), phy_id, -SAS_ADDR (phy->attached_sas_addr)); -sas_unregister_devs_sas_addr (dev, phy_id, last); - } +/* we always have to delete the old device when we went here */ +SAS_DPRINTK ("ex %016llx phy 0x%x replace %016llx\n" , +SAS_ADDR (dev->sas_addr), phy_id, +SAS_ADDR (phy->attached_sas_addr)); +sas_unregister_devs_sas_addr (dev, phy_id, last);return sas_discover_new (dev, phy_id); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 46/66 ARM: dts: tegra30: fix xcvr-setup-use-fuses
In reply to Sasha LevinFrom: Marcel Ziswiler <[email protected]>
[ Upstream commit 564706f65cda3de52b09e51feb423a43940fe661 ]
There was a dot instead of a comma. Fix this.
--- arch/arm/boot/dts/tegra30.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/tegra30.dtsi +3 -3
@@ -823,7 +823,7 @@ nvidia,elastic-limit = <16>; nvidia,term-range-adj = <6>; nvidia,xcvr-setup = <51>; - nvidia.xcvr-setup-use-fuses; + nvidia,xcvr-setup-use-fuses; nvidia,xcvr-lsfslew = <1>; nvidia,xcvr-lsrslew = <1>; nvidia,xcvr-hsslew = <32>;
@@ -860,7 +860,7 @@ nvidia,elastic-limit = <16>; nvidia,term-range-adj = <6>; nvidia,xcvr-setup = <51>; - nvidia.xcvr-setup-use-fuses; + nvidia,xcvr-setup-use-fuses; nvidia,xcvr-lsfslew = <2>; nvidia,xcvr-lsrslew = <2>; nvidia,xcvr-hsslew = <32>;
@@ -896,7 +896,7 @@ nvidia,elastic-limit = <16>; nvidia,term-range-adj = <6>; nvidia,xcvr-setup = <51>; - nvidia.xcvr-setup-use-fuses; + nvidia,xcvr-setup-use-fuses; nvidia,xcvr-lsfslew = <2>; nvidia,xcvr-lsrslew = <2>; nvidia,xcvr-hsslew = <32>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 47/66 ARM: tegra: apalis_t30: fix mmc1 cmd pull-up
In reply to Sasha LevinFrom: Marcel Ziswiler <[email protected]>
[ Upstream commit 1c997fe4becdc6fcbc06e23982ceb65621e6572a ]
Fix MMC1 cmd pin pull-up causing issues on carrier boards without external pull-up.
--- arch/arm/boot/dts/tegra30-apalis.dtsi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/tegra30-apalis.dtsi +3 -3
@@ -147,14 +147,14 @@ /* Apalis MMC1 */ sdmmc3_clk_pa6 { - nvidia,pins = "sdmmc3_clk_pa6", - "sdmmc3_cmd_pa7"; + nvidia,pins = "sdmmc3_clk_pa6"; nvidia,function = "sdmmc3"; nvidia,pull = <TEGRA_PIN_PULL_NONE>; nvidia,tristate = <TEGRA_PIN_DISABLE>; }; sdmmc3_dat0_pb7 { - nvidia,pins = "sdmmc3_dat0_pb7", + nvidia,pins = "sdmmc3_cmd_pa7", + "sdmmc3_dat0_pb7", "sdmmc3_dat1_pb6", "sdmmc3_dat2_pb5", "sdmmc3_dat3_pb4",
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 48/66 ARM: dts: paz00: fix wakeup gpio keycode
In reply to Sasha LevinFrom: Marc Dietrich <[email protected]>
[ Upstream commit ebea2a43fdafdbce918bd7e200b709d6c33b9f3b ]
The power key is controlled solely by the EC, which only tiggeres this gpio after wakeup.
Fixes immediately return to suspend after wake from LP1.
--- arch/arm/boot/dts/tegra20-paz00.dts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/arm/boot/dts/tegra20-paz00.dts +3 -3
@@ -521,10 +521,10 @@ gpio-keys { compatible = "gpio-keys"; - power { - label = "Power"; + wakeup { + label = "Wakeup"; gpios = <&gpio TEGRA_GPIO(J, 7) GPIO_ACTIVE_LOW>; - linux,code = <KEY_POWER>; + linux,code = <KEY_WAKEUP>; wakeup-source; }; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 49/66 net: smsc: fix return type of ndo_start_xmit function
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 6323d57f335ce1490d025cacc83fc10b07792130 ]
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, so make sure the implementation in this driver has returns 'netdev_tx_t' value, and change the function return type to netdev_tx_t.
Found by coccinelle.
--- drivers/net/ethernet/smsc/smc911x.c | 3 ++- drivers/net/ethernet/smsc/smc91x.c | 3 ++- drivers/net/ethernet/smsc/smsc911x.c | 3 ++- 3 files changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/smsc/smc911x.c +2 -1
@@ -514,7 +514,8 @@ static void smc911x_hardware_send_pkt(struct net_device *dev)* now, or set the card to generates an interrupt when ready * for the packet. */ -static int smc911x_hard_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t +smc911x_hard_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct smc911x_local *lp =netdev_priv (dev);unsigned int free;
drivers/net/ethernet/smsc/smc91x.c +2 -1
@@ -637,7 +637,8 @@ done: if (!THROTTLE_TX_PKTS)* now, or set the card to generates an interrupt when ready * for the packet. */ -static int smc_hard_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t +smc_hard_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct smc_local *lp =netdev_priv (dev);void __iomem *ioaddr = lp->base;
drivers/net/ethernet/smsc/smsc911x.c +2 -1
@@ -1776,7 +1776,8 @@ static int smsc911x_stop(struct net_device *dev) }/* Entry point for transmitting a packet */ -static int smsc911x_hard_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t +smsc911x_hard_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct smsc911x_data *pdata =netdev_priv (dev);unsigned int freespace;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 50/66 EDAC: Raise the maximum number of memory controllers
In reply to Sasha LevinFrom: Justin Ernst <[email protected]>
[ Upstream commit 6b58859419554fb824e09cfdd73151a195473cbc ]
We observe an oops in the skx_edac module during boot:
EDAC MC0: Giving out device to module skx_edac controller Skylake Socket#0 IMC#0 EDAC MC1: Giving out device to module skx_edac controller Skylake Socket#0 IMC#1 EDAC MC2: Giving out device to module skx_edac controller Skylake Socket#1 IMC#0
...
EDAC MC13: Giving out device to module skx_edac controller Skylake Socket#0 IMC#1 EDAC MC14: Giving out device to module skx_edac controller Skylake Socket#1 IMC#0 EDAC MC15: Giving out device to module skx_edac controller Skylake Socket#1 IMC#1 Too many memory controllers: 16
EDAC MC: Removed device 0 for skx_edac Skylake Socket#0 IMC#0
We observe there are two memory controllers per socket, with a limit of 16. Raise the maximum number of memory controllers from 16 to 2 * MAX_NUMNODES (1024).
[ bp: This is just a band-aid fix until we've sorted out the whole issue
with the bus_type association and handling in EDAC and can get rid of this arbitrary limit. ]
--- include/linux/edac.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
include/linux/edac.h +2 -1
@@ -17,6 +17,7 @@#include <linux/completion.h> #include <linux/workqueue.h> #include <linux/debugfs.h> +#include <linux/numa.h> struct device ;
@@ -778,6 +779,6 @@ struct mem_ctl_info {/* * Maximum number of memory controllers in the coherent fabric. */ -#define EDAC_MAX_MCS 16 +#define EDAC_MAX_MCS 2 * MAX_NUMNODES#endif
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 51/66 ARM: dts: realview: Fix SPI controller node names
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit 016add12977bcc30f77d7e48fc9a3a024cb46645 ]
SPI controller nodes should be named 'spi' rather than 'ssp'. Fixing the name enables dtc SPI bus checks.
--- arch/arm/boot/dts/arm-realview-eb.dtsi | 2 +- arch/arm/boot/dts/arm-realview-pb1176.dts | 2 +- arch/arm/boot/dts/arm-realview-pb11mp.dts | 2 +- arch/arm/boot/dts/arm-realview-pbx.dtsi | 2 +- arch/arm/boot/dts/versatile-ab.dts | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-)
arch/arm/boot/dts/arm-realview-eb.dtsi +1 -1
@@ -334,7 +334,7 @@ clock-names = "uartclk", "apb_pclk"; }; - ssp: ssp@1000d000 { + ssp: spi@1000d000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x1000d000 0x1000>; clocks = <&sspclk>, <&pclk>;
arch/arm/boot/dts/arm-realview-pb1176.dts +1 -1
@@ -343,7 +343,7 @@ clock-names = "apb_pclk"; }; - pb1176_ssp: ssp@1010b000 { + pb1176_ssp: spi@1010b000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x1010b000 0x1000>; interrupt-parent = <&intc_dc1176>;
arch/arm/boot/dts/arm-realview-pb11mp.dts +1 -1
@@ -480,7 +480,7 @@ clock-names = "uartclk", "apb_pclk"; }; - ssp@1000d000 { + spi@1000d000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x1000d000 0x1000>; interrupt-parent = <&intc_pb11mp>;
arch/arm/boot/dts/arm-realview-pbx.dtsi +1 -1
@@ -318,7 +318,7 @@ clock-names = "uartclk", "apb_pclk"; }; - ssp: ssp@1000d000 { + ssp: spi@1000d000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x1000d000 0x1000>; clocks = <&sspclk>, <&pclk>;
arch/arm/boot/dts/versatile-ab.dts +1 -1
@@ -303,7 +303,7 @@ clock-names = "apb_pclk"; }; - ssp@101f4000 { + spi@101f4000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x101f4000 0x1000>; interrupts = <11>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 52/66 Bluetooth: L2CAP: Detect if remote is not able to use the whole MPS
In reply to Sasha LevinFrom: Luiz Augusto von Dentz <[email protected]>
[ Upstream commit a5c3021bb62b970713550db3f7fd08aa70665d7e ]
If the remote is not able to fully utilize the MPS choosen recalculate the credits based on the actual amount it is sending that way it can still send packets of MTU size without credits dropping to 0.
--- net/bluetooth/l2cap_core.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
net/bluetooth/l2cap_core.c +10 -0
@@ -6811,6 +6811,16 @@ static int l2cap_le_data_rcv(struct l2cap_chan *chan, struct sk_buff *skb) chan->sdu_len = sdu_len; chan->sdu_last_frag = skb; +/* Detect if remote is not able to use the selected MPS */ +if (skb->len +L2CAP_SDULEN_SIZE < chan->mps) { +u16 mps_len = skb->len +L2CAP_SDULEN_SIZE ; + +/* Adjust the number of credits */ +BT_DBG ("chan->mps %u -> %u" , chan->mps, mps_len); + chan->mps = mps_len; +l2cap_chan_le_send_credits (chan); + } +return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 53/66 crypto: s5p-sss: Fix Fix argument list alignment
In reply to Sasha LevinFrom: Christoph Manszewski <[email protected]>
[ Upstream commit 6c12b6ba45490eeb820fdceccf5a53f42a26799c ]
Fix misalignment of continued argument list.
--- drivers/crypto/s5p-sss.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/crypto/s5p-sss.c +2 -2
@@ -298,7 +298,7 @@ static void s5p_unset_indata(struct s5p_aes_dev *dev) }static int s5p_make_sg_cpy (struct s5p_aes_dev *dev,struct scatterlist *src, -struct scatterlist **dst) +struct scatterlist **dst) {void *pages;int len;
@@ -510,7 +510,7 @@ static int s5p_set_indata_start(struct s5p_aes_dev *dev, }static int s5p_set_outdata_start (struct s5p_aes_dev *dev, -struct ablkcipher_request *req) +struct ablkcipher_request *req) {struct scatterlist *sg;int err;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 54/66 crypto: fix a memory leak in rsa-kcs1pad's encryption mode
In reply to Sasha LevinFrom: Dan Aloni <[email protected]>
[ Upstream commit 3944f139d5592790b70bc64f197162e643a8512b ]
The encryption mode of pkcs1pad never uses out_sg and out_buf, so there's no need to allocate the buffer, which presently is not even being freed.
--- crypto/rsa-pkcs1pad.c | 9 --------- 1 file changed, 9 deletions(-)
crypto/rsa-pkcs1pad.c +0 -9
@@ -267,15 +267,6 @@ static int pkcs1pad_encrypt(struct akcipher_request *req)pkcs1pad_sg_set_buf (req_ctx->in_sg, req_ctx->in_buf, ctx->key_size -1 - req->src_len, req->src); - req_ctx->out_buf =kmalloc (ctx->key_size,GFP_KERNEL ); -if (!req_ctx->out_buf) { -kfree (req_ctx->in_buf); -return -ENOMEM ; - } - -pkcs1pad_sg_set_buf (req_ctx->out_sg, req_ctx->out_buf, - ctx->key_size,NULL ); -akcipher_request_set_tfm (&req_ctx->child_req, ctx->child);akcipher_request_set_callback (&req_ctx->child_req, req->base.flags, pkcs1pad_encrypt_sign_complete_cb, req);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 55/66 scsi: NCR5380: Clear all unissued commands on host reset
In reply to Sasha LevinFrom: Hannes Reinecke <[email protected]>
[ Upstream commit 1aeeeed7f03c576f096eede7b0384f99a98f588c ]
When doing a host reset we should be clearing all outstanding commands, not just the command triggering the reset.
[mkp: adjusted Hannes' SoB address]
--- drivers/scsi/NCR5380.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/scsi/NCR5380.c +5 -2
@@ -2392,7 +2392,7 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)spin_lock_irqsave (&hostdata->lock, flags);#if (NDEBUG &NDEBUG_ANY ) -scmd_printk (KERN_INFO , cmd, __func__); +shost_printk (KERN_INFO , instance, __func__);#endif NCR5380_dprint (NDEBUG_ANY , instance);NCR5380_dprint_phase (NDEBUG_ANY , instance);
@@ -2410,10 +2410,13 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)* commands! */ -if (list_del_cmd (&hostdata->unissued, cmd)) { +list_for_each_entry (ncmd, &hostdata->unissued, list) { +struct scsi_cmnd *cmd =NCR5380_to_scmd (ncmd); + cmd->result =DID_RESET <<16 ; cmd->scsi_done (cmd); } +INIT_LIST_HEAD (&hostdata->unissued);if (hostdata->selecting) { hostdata->selecting->result =DID_RESET <<16 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 56/66 scsi: NCR5380: Use DRIVER_SENSE to indicate valid sense data
In reply to Sasha LevinFrom: Finn Thain <[email protected]>
[ Upstream commit 070356513963be6196142acff56acc8359069fa1 ]
When sense data is valid, call set_driver_byte(cmd, DRIVER_SENSE). Otherwise some callers of scsi_execute() will ignore sense data. Don't set DID_ERROR or DID_RESET just because sense data is missing.
--- drivers/scsi/NCR5380.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/scsi/NCR5380.c +4 -5
@@ -617,11 +617,12 @@ static void complete_cmd(struct Scsi_Host *instance,if (hostdata->sensing == cmd) {/* Autosense processing ends here */ -if ((cmd->result &0xff ) !=SAM_STAT_GOOD ) { +if (status_byte (cmd->result) !=GOOD ) {scsi_eh_restore_cmnd (cmd, &hostdata->ses); -set_host_byte (cmd,DID_ERROR ); - }else + }else {scsi_eh_restore_cmnd (cmd, &hostdata->ses); +set_driver_byte (cmd,DRIVER_SENSE ); + } hostdata->sensing =NULL ; }
@@ -2356,7 +2357,6 @@ static int NCR5380_abort(struct scsi_cmnd *cmd)if (list_del_cmd (&hostdata->autosense, cmd)) {dsprintk (NDEBUG_ABORT , instance,"abort: removed %p from sense queue\n" , cmd); -set_host_byte (cmd,DID_ERROR );complete_cmd (instance, cmd); }
@@ -2435,7 +2435,6 @@ static int NCR5380_bus_reset(struct scsi_cmnd *cmd)list_for_each_entry (ncmd, &hostdata->autosense, list) {struct scsi_cmnd *cmd =NCR5380_to_scmd (ncmd); -set_host_byte (cmd,DID_RESET ); cmd->scsi_done (cmd); }INIT_LIST_HEAD (&hostdata->autosense);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 57/66 scsi: NCR5380: Check for invalid reselection target
In reply to Sasha LevinFrom: Finn Thain <[email protected]>
[ Upstream commit 7ef55f6744c45e3d7c85a3f74ada39b67ac741dd ]
The X3T9.2 specification (draft) says, under "6.1.4.1 RESELECTION", that "the initiator shall not respond to a RESELECTION phase if other than two SCSI ID bits are on the DATA BUS." This issue (too many bits set) has been observed in the wild, so add a check.
--- drivers/scsi/NCR5380.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/scsi/NCR5380.c +5 -0
@@ -2102,6 +2102,11 @@ static void NCR5380_reselect(struct Scsi_Host *instance)NCR5380_write (MODE_REG ,MR_BASE ); target_mask =NCR5380_read (CURRENT_SCSI_DATA_REG ) & ~(hostdata->id_mask); +if (!target_mask || target_mask & (target_mask -1 )) { +shost_printk (KERN_WARNING , instance, +"reselect: bad target_mask 0x%02x\n" , target_mask); +return ; + }dsprintk (NDEBUG_RESELECTION , instance,"reselect\n" );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 58/66 scsi: NCR5380: Don't clear busy flag when abort fails
In reply to Sasha LevinFrom: Finn Thain <[email protected]>
[ Upstream commit 45ddc1b24806cc8f1a09f23dd4e7b6e4a8ae36e1 ]
When NCR5380_abort() returns FAILED, the driver forgets that the target is still busy. Hence, further commands may be sent to the target, which may fail during selection and produce the error message, "reselection after won arbitration?". Prevent this by leaving the busy flag set when NCR5380_abort() fails.
--- drivers/scsi/NCR5380.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-)
drivers/scsi/NCR5380.c +10 -4
@@ -626,8 +626,6 @@ static void complete_cmd(struct Scsi_Host *instance, hostdata->sensing =NULL ; } - hostdata->busy[scmd_id (cmd)] &= ~(1 << cmd->device->lun); - cmd->scsi_done (cmd); }
@@ -1799,6 +1797,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) cmd->result =DID_ERROR <<16 ;complete_cmd (instance, cmd); hostdata->connected =NULL ; + hostdata->busy[scmd_id (cmd)] &= ~(1 << cmd->device->lun);return ;#endif case PHASE_DATAIN :
@@ -1881,6 +1880,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance) cmd, scmd_id(cmd), cmd->device->lun); hostdata->connected =NULL ; + hostdata->busy[scmd_id (cmd)] &= ~(1 << cmd->device->lun); cmd->result &= ~0xffff ; cmd->result |= cmd->SCp.Status;
@@ -2040,6 +2040,7 @@ static void NCR5380_information_transfer(struct Scsi_Host *instance)NCR5380_transfer_pio (instance, &phase, &len, &data);if (msgout ==ABORT ) { hostdata->connected =NULL ; + hostdata->busy[scmd_id (cmd)] &= ~(1 << cmd->device->lun); cmd->result =DID_ERROR <<16 ;complete_cmd (instance, cmd);maybe_release_dma_irq (instance);
@@ -2194,13 +2195,16 @@ static void NCR5380_reselect(struct Scsi_Host *instance)dsprintk (NDEBUG_RESELECTION |NDEBUG_QUEUES , instance,"reselect: removed %p from disconnected queue\n" , tmp); }else { +int target =ffs (target_mask) -1 ; +shost_printk (KERN_ERR , instance,"target bitmask 0x%02x lun %d not in disconnected queue.\n" , target_mask, lun);/* * Since we have an established nexus that we can't do anything * with, we must abort it. */ -do_abort (instance); +if (do_abort (instance) ==0 ) + hostdata->busy[target] &= ~(1 << lun);return ; }
@@ -2368,8 +2372,10 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) out:if (result ==FAILED )dsprintk (NDEBUG_ABORT , instance,"abort: failed to abort %p\n" , cmd); -else +else { + hostdata->busy[scmd_id (cmd)] &= ~(1 << cmd->device->lun);dsprintk (NDEBUG_ABORT , instance,"abort: successfully aborted %p\n" , cmd); + }queue_work (hostdata->work_q, &hostdata->main_task);maybe_release_dma_irq (instance);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 59/66 scsi: NCR5380: Don't call dsprintk() following reselection interrupt
In reply to Sasha LevinFrom: Finn Thain <[email protected]>
[ Upstream commit 08267216b3f8aa5adc204bdccf8deb72c1cd7665 ]
The X3T9.2 specification (draft) says, under "6.1.4.1 RESELECTION",
... The reselected initiator shall then assert the BSY signal within a selection abort time of its most recent detection of being reselected; this is required for correct operation of the time-out procedure.
The selection abort time is only 200 us which may be insufficient time for a printk() call. Move the diagnostics to the error paths.
--- drivers/scsi/NCR5380.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/NCR5380.c +2 -2
@@ -2109,8 +2109,6 @@ static void NCR5380_reselect(struct Scsi_Host *instance)return ; } -dsprintk (NDEBUG_RESELECTION , instance,"reselect\n" ); -/* * At this point, we have detected that our SCSI ID is on the bus, * SEL is true and BSY was false for at least one bus settle delay
@@ -2123,6 +2121,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)NCR5380_write (INITIATOR_COMMAND_REG ,ICR_BASE |ICR_ASSERT_BSY );if (NCR5380_poll_politely (instance,STATUS_REG ,SR_SEL ,0 ,2 *HZ ) <0 ) { +shost_printk (KERN_ERR , instance,"reselect: !SEL timeout\n" );NCR5380_write (INITIATOR_COMMAND_REG ,ICR_BASE );return ; }
@@ -2134,6 +2133,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)if (NCR5380_poll_politely (instance,STATUS_REG ,SR_REQ ,SR_REQ ,2 *HZ ) <0 ) { +shost_printk (KERN_ERR , instance,"reselect: REQ timeout\n" );do_abort (instance);return ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 60/66 scsi: NCR5380: Handle BUS FREE during reselection
In reply to Sasha LevinFrom: Finn Thain <[email protected]>
[ Upstream commit ca694afad707cb3ae2fdef3b28454444d9ac726e ]
The X3T9.2 specification (draft) says, under "6.1.4.2 RESELECTION time-out procedure", that a target may assert RST or go to BUS FREE phase if the initiator does not respond within 200 us. Something like this has been observed with AztecMonster II target. When it happens, all we can do is wait for the target to try again.
--- drivers/scsi/NCR5380.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/scsi/NCR5380.c +3 -0
@@ -2133,6 +2133,9 @@ static void NCR5380_reselect(struct Scsi_Host *instance)if (NCR5380_poll_politely (instance,STATUS_REG ,SR_REQ ,SR_REQ ,2 *HZ ) <0 ) { +if ((NCR5380_read (STATUS_REG ) & (SR_BSY |SR_SEL )) ==0 ) +/* BUS FREE phase */ +return ;shost_printk (KERN_ERR , instance,"reselect: REQ timeout\n" );do_abort (instance);return ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 61/66 arm64: dts: amd: Fix SPI bus warnings
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit e9f0878c4b2004ac19581274c1ae4c61ae3ca70e ]
dtc has new checks for SPI buses. Fix the warnings in node names.
arch/arm64/boot/dts/amd/amd-overdrive.dtb: Warning (spi_bus_bridge): /smb/ssp@e1030000: node name for SPI buses should be 'spi' arch/arm64/boot/dts/amd/amd-overdrive-rev-b0.dtb: Warning (spi_bus_bridge): /smb/ssp@e1030000: node name for SPI buses should be 'spi' arch/arm64/boot/dts/amd/amd-overdrive-rev-b1.dtb: Warning (spi_bus_bridge): /smb/ssp@e1030000: node name for SPI buses should be 'spi'
--- arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm64/boot/dts/amd/amd-seattle-soc.dtsi +2 -2
@@ -106,7 +106,7 @@ clock-names = "uartclk", "apb_pclk"; }; - spi0: ssp@e1020000 { + spi0: spi@e1020000 { status = "disabled"; compatible = "arm,pl022", "arm,primecell"; reg = <0 0xe1020000 0 0x1000>;
@@ -116,7 +116,7 @@ clock-names = "apb_pclk"; }; - spi1: ssp@e1030000 { + spi1: spi@e1030000 { status = "disabled"; compatible = "arm,pl022", "arm,primecell"; reg = <0 0xe1030000 0 0x1000>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 62/66 arm64: dts: lg: Fix SPI controller node names
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit 09bae3b64cb580c95329bd8d16f08f0a5cb81ec9 ]
SPI controller nodes should be named 'spi' rather than 'ssp'. Fixing the name enables dtc SPI bus checks.
--- arch/arm64/boot/dts/lg/lg1312.dtsi | 4 ++-- arch/arm64/boot/dts/lg/lg1313.dtsi | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-)
arch/arm64/boot/dts/lg/lg1312.dtsi +2 -2
@@ -167,14 +167,14 @@ clock-names = "apb_pclk"; status="disabled"; }; - spi0: ssp@fe800000 { + spi0: spi@fe800000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x0 0xfe800000 0x1000>; interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk_bus>; clock-names = "apb_pclk"; }; - spi1: ssp@fe900000 { + spi1: spi@fe900000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x0 0xfe900000 0x1000>; interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
arch/arm64/boot/dts/lg/lg1313.dtsi +2 -2
@@ -167,14 +167,14 @@ clock-names = "apb_pclk"; status="disabled"; }; - spi0: ssp@fe800000 { + spi0: spi@fe800000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x0 0xfe800000 0x1000>; interrupts = <GIC_SPI 3 IRQ_TYPE_LEVEL_HIGH>; clocks = <&clk_bus>; clock-names = "apb_pclk"; }; - spi1: ssp@fe900000 { + spi1: spi@fe900000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x0 0xfe900000 0x1000>; interrupts = <GIC_SPI 4 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 63/66 ARM: dts: lpc32xx: Fix SPI controller node names
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit 11236ef582b8d66290bb3b3710e03ca1d85d8ad8 ]
SPI controller nodes should be named 'spi' rather than 'ssp'. Fixing the name enables dtc SPI bus checks.
--- arch/arm/boot/dts/lpc32xx.dtsi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/boot/dts/lpc32xx.dtsi +2 -2
@@ -179,7 +179,7 @@ * ssp0 and spi1 are shared pins; * enable one in your board dts, as needed. */ - ssp0: ssp@20084000 { + ssp0: spi@20084000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x20084000 0x1000>; interrupts = <20 IRQ_TYPE_LEVEL_HIGH>;
@@ -199,7 +199,7 @@ * ssp1 and spi2 are shared pins; * enable one in your board dts, as needed. */ - ssp1: ssp@2008c000 { + ssp1: spi@2008c000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x2008c000 0x1000>; interrupts = <21 IRQ_TYPE_LEVEL_HIGH>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 64/66 usb: xhci-mtk: fix ISOC error when interval is zero
In reply to Sasha LevinFrom: Chunfeng Yun <[email protected]>
[ Upstream commit 87173acc0d8f0987bda8827da35fff67f52ad15d ]
If the interval equal zero, needn't round up to power of two for the number of packets in each ESIT, so fix it.
--- drivers/usb/host/xhci-mtk-sch.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/usb/host/xhci-mtk-sch.c +3 -1
@@ -122,7 +122,9 @@ static void setup_sch_info(struct usb_device *udev, }if (ep_type ==ISOC_IN_EP || ep_type ==ISOC_OUT_EP ) { -if (esit_pkts <= sch_ep->esit) +if (sch_ep->esit ==1 ) + sch_ep->pkts = esit_pkts; +else if (esit_pkts <= sch_ep->esit) sch_ep->pkts =1 ;else sch_ep->pkts =roundup_pow_of_two (esit_pkts)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 65/66 fuse: use READ_ONCE on congestion_threshold and max_background
In reply to Sasha LevinFrom: Kirill Tkhai <[email protected]>
[ Upstream commit 2a23f2b8adbe4bd584f936f7ac17a99750eed9d7 ]
Since they are of unsigned int type, it's allowed to read them unlocked during reporting to userspace. Let's underline this fact with READ_ONCE() macroses.
--- fs/fuse/control.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
fs/fuse/control.c +2 -2
@@ -107,7 +107,7 @@ static ssize_t fuse_conn_max_background_read(struct file *file,if (!fc)return 0 ; - val = fc->max_background; + val =READ_ONCE (fc->max_background);fuse_conn_put (fc);return fuse_conn_limit_read (file, buf, len, ppos, val);
@@ -144,7 +144,7 @@ static ssize_t fuse_conn_congestion_threshold_read(struct file *file,if (!fc)return 0 ; - val = fc->congestion_threshold; + val =READ_ONCE (fc->congestion_threshold);fuse_conn_put (fc);return fuse_conn_limit_read (file, buf, len, ppos, val);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 66/66 IB/iser: Fix possible NULL deref at iser_inv_desc()
In reply to Sasha LevinFrom: Israel Rukshin <[email protected]>
[ Upstream commit 65f07f5a09dacf3b60619f196f096ea3671a5eda ]
In case target remote invalidates bogus rkey and signature is not used, pi_ctx is NULL deref.
The commit also fails the connection on bogus remote invalidation.
--- drivers/infiniband/ulp/iser/iser_initiator.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-)
drivers/infiniband/ulp/iser/iser_initiator.c +13 -5
@@ -590,13 +590,19 @@ void iser_login_rsp(struct ib_cq *cq, struct ib_wc *wc) ib_conn->post_recv_buf_count--; } -static inline void +static inline int iser_inv_desc (struct iser_fr_desc *desc,u32 rkey) { -if (likely (rkey == desc->rsc.mr->rkey)) +if (likely (rkey == desc->rsc.mr->rkey)) { desc->rsc.mr_valid =0 ; -else if (likely (rkey == desc->pi_ctx->sig_mr->rkey)) + }else if (likely (desc->pi_ctx && rkey == desc->pi_ctx->sig_mr->rkey)) { desc->pi_ctx->sig_mr_valid =0 ; + }else { +iser_err ("Bogus remote invalidation for rkey %#x\n" , rkey); +return -EINVAL ; + } + +return 0 ; } static int
@@ -624,12 +630,14 @@ iser_check_remote_inv(struct iser_conn *iser_conn,if (iser_task->dir[ISER_DIR_IN ]) { desc = iser_task->rdma_reg[ISER_DIR_IN ].mem_h; -iser_inv_desc (desc, rkey); +if (unlikely (iser_inv_desc (desc, rkey))) +return -EINVAL ; }if (iser_task->dir[ISER_DIR_OUT ]) { desc = iser_task->rdma_reg[ISER_DIR_OUT ].mem_h; -iser_inv_desc (desc, rkey); +if (unlikely (iser_inv_desc (desc, rkey))) +return -EINVAL ; } }else {iser_err ("failed to get task for itt=%d\n" , hdr->itt);
Signature · 1 line
2.20.1