s390/qeth: invoke softirqs after napi_schedule()
Subsystems (16)
Sasha Levin
maintainerPATCH 1/40 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
@@ -996,7 +996,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
@@ -3031,7 +3031,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/40 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/40 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
@@ -1248,8 +1248,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/40 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
@@ -764,9 +764,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/40 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
@@ -322,7 +322,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/40 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
@@ -967,6 +967,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
@@ -981,6 +982,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/40 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 8/40 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/twl4030_charger.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/power/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 9/40 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/twl4030_charger.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)
drivers/power/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 10/40 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
@@ -881,9 +881,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
@@ -475,7 +475,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);
@@ -1279,7 +1280,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 11/40 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
@@ -656,7 +656,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
@@ -1008,9 +1008,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;
@@ -1031,7 +1032,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);
@@ -1040,7 +1041,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 12/40 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
@@ -300,7 +300,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);
@@ -2033,7 +2033,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 13/40 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 14/40 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 15/40 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
@@ -697,6 +697,7 @@ pinctrl-0 = <&cpsw_default>; pinctrl-1 = <&cpsw_sleep>; status = "okay"; + slaves = <1>; }; &davinci_mdio {
@@ -704,15 +705,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 16/40 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
@@ -186,7 +186,7 @@ <0xa0410100 0x100>; }; - scu@a04100000 { + scu@a0410000 { compatible = "arm,cortex-a9-scu"; reg = <0xa0410000 0x100>; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 17/40 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 18/40 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
@@ -894,7 +894,7 @@ power-domains = <&pm_domains DOMAIN_VAPE>; }; - ssp@80002000 { + spi@80002000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x80002000 0x1000>; interrupts = <0 14 IRQ_TYPE_LEVEL_HIGH>;
@@ -908,7 +908,7 @@ power-domains = <&pm_domains DOMAIN_VAPE>; }; - ssp@80003000 { + spi@80003000 { compatible = "arm,pl022", "arm,primecell"; reg = <0x80003000 0x1000>; interrupts = <0 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
@@ -311,7 +311,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
@@ -451,7 +451,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 19/40 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 20/40 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
@@ -3532,6 +3532,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 21/40 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 22/40 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
@@ -433,7 +433,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 23/40 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 24/40 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
@@ -936,7 +936,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 25/40 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
@@ -520,7 +520,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 26/40 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
@@ -564,6 +564,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; }
@@ -605,6 +606,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; }
@@ -2087,6 +2089,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; }
@@ -2131,6 +2134,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 27/40 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
@@ -807,6 +807,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);
@@ -845,6 +846,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 28/40 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 29/40 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 30/40 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 31/40 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 32/40 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
@@ -1130,8 +1130,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 33/40 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 34/40 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 35/40 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 36/40 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
@@ -511,7 +511,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
@@ -1677,7 +1677,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 37/40 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 38/40 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
@@ -6795,6 +6795,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 39/40 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
@@ -84,7 +84,7 @@ clock-names = "uartclk", "apb_pclk"; }; - spi0: ssp@e1020000 { + spi0: spi@e1020000 { status = "disabled"; compatible = "arm,pl022", "arm,primecell"; #gpio-cells = <2>;
@@ -95,7 +95,7 @@ clock-names = "apb_pclk"; }; - spi1: ssp@e1030000 { + spi1: spi@e1030000 { status = "disabled"; compatible = "arm,pl022", "arm,primecell"; #gpio-cells = <2>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 40/40 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