s390/qeth: invoke softirqs after napi_schedule()
Subsystems (27)
Sasha Levin
maintainerPATCH 1/109 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
@@ -869,7 +869,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
@@ -2849,7 +2849,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 7/109 spi: mediatek: Don't modify spi_transfer when transfer.
From: Peter Shih <[email protected]>
[ Upstream commit 00bca73bfca4fb0ab089b94cad0fc83d8b49c25f ]
Mediatek SPI driver modifies some fields (tx_buf, rx_buf, len, tx_dma, rx_dma) of the spi_transfer* passed in when doing transfer_one and in interrupt handler. This is somewhat unexpected, and there are some caller (e.g. Cr50 spi driver) that reuse the spi_transfer for multiple messages. Add a field to record how many bytes have been transferred, and calculate the right len / buffer based on it instead.
--- drivers/spi/spi-mt65xx.c | 37 +++++++++++++++++++++---------------- 1 file changed, 21 insertions(+), 16 deletions(-)
drivers/spi/spi-mt65xx.c +21 -16
@@ -98,6 +98,7 @@ struct mtk_spi {struct clk *parent_clk, *sel_clk, *spi_clk;struct spi_transfer *cur_transfer;u32 xfer_len; +u32 num_xfered;struct scatterlist *tx_sgl, *rx_sgl;u32 tx_sgl_len, rx_sgl_len;const struct mtk_spi_compatible *dev_comp;
@@ -385,6 +386,7 @@ static int mtk_spi_fifo_transfer(struct spi_master *master, mdata->cur_transfer = xfer; mdata->xfer_len =min (MTK_SPI_MAX_FIFO_SIZE , xfer->len); + mdata->num_xfered =0 ;mtk_spi_prepare_transfer (master, xfer);mtk_spi_setup_packet (master);
@@ -415,6 +417,7 @@ static int mtk_spi_dma_transfer(struct spi_master *master, mdata->tx_sgl_len =0 ; mdata->rx_sgl_len =0 ; mdata->cur_transfer = xfer; + mdata->num_xfered =0 ;mtk_spi_prepare_transfer (master, xfer);
@@ -482,7 +485,7 @@ static int mtk_spi_setup(struct spi_device *spi)static irqreturn_t mtk_spi_interrupt (int irq,void *dev_id) { -u32 cmd, reg_val, cnt, remainder; +u32 cmd, reg_val, cnt, remainder, len;struct spi_master *master = dev_id;struct mtk_spi *mdata =spi_master_get_devdata (master);struct spi_transfer *trans = mdata->cur_transfer;
@@ -497,36 +500,38 @@ static irqreturn_t mtk_spi_interrupt(int irq, void *dev_id)if (trans->rx_buf) { cnt = mdata->xfer_len /4 ;ioread32_rep (mdata->base +SPI_RX_DATA_REG , - trans->rx_buf, cnt); + trans->rx_buf + mdata->num_xfered, cnt); remainder = mdata->xfer_len %4 ;if (remainder >0 ) { reg_val =readl (mdata->base +SPI_RX_DATA_REG ); -memcpy (trans->rx_buf + (cnt *4 ), - ®_val, remainder); +memcpy (trans->rx_buf + + mdata->num_xfered + + (cnt *4 ), + ®_val, + remainder); } } - trans->len -= mdata->xfer_len; -if (!trans->len) { + mdata->num_xfered += mdata->xfer_len; +if (mdata->num_xfered == trans->len) {spi_finalize_current_transfer (master);return IRQ_HANDLED ; } -if (trans->tx_buf) - trans->tx_buf += mdata->xfer_len; -if (trans->rx_buf) - trans->rx_buf += mdata->xfer_len; - - mdata->xfer_len =min (MTK_SPI_MAX_FIFO_SIZE , trans->len); + len = trans->len - mdata->num_xfered; + mdata->xfer_len =min (MTK_SPI_MAX_FIFO_SIZE , len);mtk_spi_setup_packet (master); - cnt = trans->len /4 ; -iowrite32_rep (mdata->base +SPI_TX_DATA_REG , trans->tx_buf, cnt); + cnt = len /4 ; +iowrite32_rep (mdata->base +SPI_TX_DATA_REG , + trans->tx_buf + mdata->num_xfered, cnt); - remainder = trans->len %4 ; + remainder = len %4 ;if (remainder >0 ) { reg_val =0 ; -memcpy (®_val, trans->tx_buf + (cnt *4 ), remainder); +memcpy (®_val, + trans->tx_buf + (cnt *4 ) + mdata->num_xfered, + remainder);writel (reg_val, mdata->base +SPI_TX_DATA_REG ); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 30/109 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
@@ -724,6 +724,7 @@ pinctrl-0 = <&cpsw_default>; pinctrl-1 = <&cpsw_sleep>; status = "okay"; + slaves = <1>; }; &davinci_mdio {
@@ -731,15 +732,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 35/109 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 49/109 arm64: dts: rockchip: Fix microSD in rk3399 sapphire board
In reply to Sasha LevinFrom: Vicente Bergas <[email protected]>
[ Upstream commit 88a20edf76091ee7f1bb459b89d714d53f0f8940 ]
The microSD card slot in the Sapphire board is not working because of several issues:
1.- The vmmc power supply is missing in the DTS. It is capable of 3.0V and has a GPIO-based enable control.
2.- The vqmmc power supply can provide up to 3.3V, but it is capped in the DTS to just 3.0V because of the vmmc capability. This results in a conflict from the mmc driver requesting an unsupportable voltage range from 3.3V to 3.0V (min > max) as reported in dmesg. So, extend the range up to 3.3V. The hw should be able to stand this 0.3V tolerance. See mmc_regulator_set_vqmmc in drivers/mmc/core/core.c.
3.- The card detect signal is non-working. There is a known conflict with jtag, but the workaround in drivers/soc/rockchip/grf.c does not work. Adding the broken-cd attribute to the DTS fixes the issue.
--- .../boot/dts/rockchip/rk3399-sapphire.dtsi | 24 ++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-)
arch/arm64/boot/dts/rockchip/rk3399-sapphire.dtsi +23 -1
@@ -113,6 +113,19 @@ vin-supply = <&vcc_1v8>; }; + vcc3v0_sd: vcc3v0-sd { + compatible = "regulator-fixed"; + enable-active-high; + gpio = <&gpio0 RK_PA1 GPIO_ACTIVE_HIGH>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc0_pwr_h>; + regulator-always-on; + regulator-max-microvolt = <3000000>; + regulator-min-microvolt = <3000000>; + regulator-name = "vcc3v0_sd"; + vin-supply = <&vcc3v3_sys>; + }; + vcc3v3_sys: vcc3v3-sys { compatible = "regulator-fixed"; regulator-name = "vcc3v3_sys";
@@ -315,7 +328,7 @@ regulator-always-on; regulator-boot-on; regulator-min-microvolt = <1800000>; - regulator-max-microvolt = <3000000>; + regulator-max-microvolt = <3300000>; regulator-state-mem { regulator-on-in-suspend; regulator-suspend-microvolt = <3000000>;
@@ -490,6 +503,13 @@ }; }; + sd { + sdmmc0_pwr_h: sdmmc0-pwr-h { + rockchip,pins = + <RK_GPIO0 RK_PA1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + usb2 { vcc5v0_host_en: vcc5v0-host-en { rockchip,pins =
@@ -537,6 +557,7 @@ }; &sdmmc { + broken-cd; bus-width = <4>; cap-mmc-highspeed; cap-sd-highspeed;
@@ -545,6 +566,7 @@ max-frequency = <150000000>; pinctrl-names = "default"; pinctrl-0 = <&sdmmc_clk &sdmmc_cmd &sdmmc_cd &sdmmc_bus4>; + vmmc-supply = <&vcc3v0_sd>; vqmmc-supply = <&vcc_sdio>; status = "okay"; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 53/109 ARM: dts: rockchip: explicitly set vcc_sd0 pin to gpio on rk3188-radxarock
In reply to Sasha LevinFrom: Heiko Stuebner <[email protected]>
[ Upstream commit a2df0984e73fd9e1dad5fc3f1c307ec3de395e30 ]
It is good practice to make the setting of gpio-pinctrls explicitly in the devicetree, and in this case even necessary.
Rockchip boards start with iomux settings set to gpio for most pins and while the linux pinctrl driver also implicitly sets the gpio function if a pin is requested as gpio that is not necessarily true for other drivers.
The issue in question stems from uboot, where the sdmmc_pwr pin is set to function 1 (sdmmc-power) by the bootrom when reading the 1st-stage loader. The regulator controlled by the pin is active-low though, so when the dwmmc hw-block sets its enabled bit, it actually disables the regulator. By changing the pin back to gpio we fix that behaviour.
--- arch/arm/boot/dts/rk3188-radxarock.dts | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/arm/boot/dts/rk3188-radxarock.dts +8 -0
@@ -130,6 +130,8 @@ regulator-min-microvolt = <3300000>; regulator-max-microvolt = <3300000>; gpio = <&gpio3 RK_PA1 GPIO_ACTIVE_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&sdmmc_pwr>; startup-delay-us = <100000>; vin-supply = <&vcc_io>; };
@@ -348,6 +350,12 @@ }; }; + sd0 { + sdmmc_pwr: sdmmc-pwr { + rockchip,pins = <RK_GPIO3 1 RK_FUNC_GPIO &pcfg_pull_none>; + }; + }; + usb { host_vbus_drv: host-vbus-drv { rockchip,pins = <0 3 RK_FUNC_GPIO &pcfg_pull_none>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 56/109 i2c: aspeed: fix invalid clock parameters for very large divisors
In reply to Sasha LevinFrom: Brendan Higgins <[email protected]>
[ Upstream commit 17ccba67109cd0631f206cf49e17986218b47854 ]
The function that computes clock parameters from divisors did not respect the maximum size of the bitfields that the parameters were written to. This fixes the bug.
This bug can be reproduced with (and this fix verified with) the test
at: https://kunit-review.googlesource.com/c/linux/+/1035/
Discovered-by-KUnit: https://kunit-review.googlesource.com/c/linux/+/1035/
--- drivers/i2c/busses/i2c-aspeed.c | 65 +++++++++++++++++++++++---------- 1 file changed, 45 insertions(+), 20 deletions(-)
drivers/i2c/busses/i2c-aspeed.c +45 -20
@@ -135,7 +135,8 @@ struct aspeed_i2c_bus {/* Synchronizes I/O mem access to base. */ spinlock_t lock;struct completion cmd_complete; -u32 (*get_clk_reg_val)(u32 divisor); +u32 (*get_clk_reg_val)(struct device *dev, +u32 divisor);unsigned long parent_clk_frequency;u32 bus_frequency;/* Transaction state. */
@@ -679,16 +680,27 @@ static const struct i2c_algorithm aspeed_i2c_algo = {#endif /* CONFIG_I2C_SLAVE */ }; -static u32 aspeed_i2c_get_clk_reg_val (u32 clk_high_low_max,u32 divisor) +static u32 aspeed_i2c_get_clk_reg_val (struct device *dev, +u32 clk_high_low_mask, +u32 divisor) { -u32 base_clk, clk_high, clk_low, tmp; +u32 base_clk_divisor, clk_high_low_max, clk_high, clk_low, tmp; + +/* +* SCL_high and SCL_low represent a value 1 greater than what is stored +* since a zero divider is meaningless. Thus, the max value each can +* store is every bit set + 1. Since SCL_high and SCL_low are added +* together (see below), the max value of both is the max value of one +* them times two. +*/ + clk_high_low_max = (clk_high_low_mask +1 ) *2 ;/* * The actual clock frequency of SCL is: * SCL_freq = APB_freq / (base_freq * (SCL_high + SCL_low)) * = APB_freq / divisor * where base_freq is a programmable clock divider; its value is -* base_freq = 1 << base_clk +* base_freq = 1 << base_clk_divisor * SCL_high is the number of base_freq clock cycles that SCL stays high * and SCL_low is the number of base_freq clock cycles that SCL stays * low for a period of SCL.
@@ -698,47 +710,59 @@ static u32 aspeed_i2c_get_clk_reg_val(u32 clk_high_low_max, u32 divisor)* SCL_low = clk_low + 1 * Thus, * SCL_freq = APB_freq / -* ((1 << base_clk) * (clk_high + 1 + clk_low + 1)) +* ((1 << base_clk_divisor) * (clk_high + 1 + clk_low + 1)) * The documentation recommends clk_high >= clk_high_max / 2 and * clk_low >= clk_low_max / 2 - 1 when possible; this last constraint * gives us the following solution: */ - base_clk = divisor > clk_high_low_max ? + base_clk_divisor = divisor > clk_high_low_max ?ilog2 ((divisor -1 ) / clk_high_low_max) +1 :0 ; - tmp = (divisor + (1 << base_clk) -1 ) >> base_clk; - clk_low = tmp /2 ; - clk_high = tmp - clk_low; -if (clk_high) - clk_high--; +if (base_clk_divisor >ASPEED_I2CD_TIME_BASE_DIVISOR_MASK ) { + base_clk_divisor =ASPEED_I2CD_TIME_BASE_DIVISOR_MASK ; + clk_low = clk_high_low_mask; + clk_high = clk_high_low_mask; +dev_err (dev, +"clamping clock divider: divider requested, %u, is greater than largest possible divider, %u.\n" , + divisor, (1 << base_clk_divisor) * clk_high_low_max); + }else { + tmp = (divisor + (1 << base_clk_divisor) -1 ) + >> base_clk_divisor; + clk_low = tmp /2 ; + clk_high = tmp - clk_low; + +if (clk_high) + clk_high--; -if (clk_low) - clk_low--; +if (clk_low) + clk_low--; + }return ((clk_high <<ASPEED_I2CD_TIME_SCL_HIGH_SHIFT ) &ASPEED_I2CD_TIME_SCL_HIGH_MASK ) | ((clk_low <<ASPEED_I2CD_TIME_SCL_LOW_SHIFT ) &ASPEED_I2CD_TIME_SCL_LOW_MASK ) - | (base_clk &ASPEED_I2CD_TIME_BASE_DIVISOR_MASK ); + | (base_clk_divisor + &ASPEED_I2CD_TIME_BASE_DIVISOR_MASK ); } -static u32 aspeed_i2c_24xx_get_clk_reg_val (u32 divisor) +static u32 aspeed_i2c_24xx_get_clk_reg_val (struct device *dev,u32 divisor) {/* * clk_high and clk_low are each 3 bits wide, so each can hold a max * value of 8 giving a clk_high_low_max of 16. */ -return aspeed_i2c_get_clk_reg_val (16 , divisor); +return aspeed_i2c_get_clk_reg_val (dev,GENMASK (2 ,0 ), divisor); } -static u32 aspeed_i2c_25xx_get_clk_reg_val (u32 divisor) +static u32 aspeed_i2c_25xx_get_clk_reg_val (struct device *dev,u32 divisor) {/* * clk_high and clk_low are each 4 bits wide, so each can hold a max * value of 16 giving a clk_high_low_max of 32. */ -return aspeed_i2c_get_clk_reg_val (32 , divisor); +return aspeed_i2c_get_clk_reg_val (dev,GENMASK (3 ,0 ), divisor); }/* precondition: bus.lock has been acquired. */
@@ -751,7 +775,7 @@ static int aspeed_i2c_init_clk(struct aspeed_i2c_bus *bus) clk_reg_val &= (ASPEED_I2CD_TIME_TBUF_MASK |ASPEED_I2CD_TIME_THDSTA_MASK |ASPEED_I2CD_TIME_TACST_MASK ); - clk_reg_val |= bus->get_clk_reg_val (divisor); + clk_reg_val |= bus->get_clk_reg_val (bus->dev, divisor);writel (clk_reg_val, bus->base +ASPEED_I2C_AC_TIMING_REG1 );writel (ASPEED_NO_TIMEOUT_CTRL , bus->base +ASPEED_I2C_AC_TIMING_REG2 );
@@ -859,7 +883,8 @@ static int aspeed_i2c_probe_bus(struct platform_device *pdev)if (!match) bus->get_clk_reg_val = aspeed_i2c_24xx_get_clk_reg_val;else - bus->get_clk_reg_val = (u32 (*)(u32 ))match->data; + bus->get_clk_reg_val = (u32 (*)(struct device *,u32 )) + match->data;/* Initialize the I2C adapter */ spin_lock_init (&bus->lock);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 73/109 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
@@ -840,7 +840,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>;
@@ -877,7 +877,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>;
@@ -913,7 +913,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 74/109 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
@@ -166,14 +166,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 75/109 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
@@ -524,10 +524,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 103/109 arm64: dts: rockchip: enable display nodes on rk3328-rock64
In reply to Sasha LevinFrom: Heiko Stuebner <[email protected]>
[ Upstream commit e78d53c7b2873e0724eb765a88ccde42560b0e05 ]
Enable necessary nodes to get output on the hdmi port of the board.
--- arch/arm64/boot/dts/rockchip/rk3328-rock64.dts | 16 ++++++++++++++++ 1 file changed, 16 insertions(+)
arch/arm64/boot/dts/rockchip/rk3328-rock64.dts +16 -0
@@ -146,6 +146,14 @@ status = "okay"; }; +&hdmi { + status = "okay"; +}; + +&hdmiphy { + status = "okay"; +}; + &i2c1 { status = "okay";
@@ -333,3 +341,11 @@ &usb_host0_ohci { status = "okay"; }; + +&vop { + status = "okay"; +}; + +&vop_mmu { + status = "okay"; +};
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 2/109 PCI/ACPI: Correct error message for ASPM disabling
In reply to Sasha LevinFrom: 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/109 serial: uartps: Fix suspend functionality
In reply to Sasha LevinFrom: Nava kishore Manne <[email protected]>
[ Upstream commit 4b9d33c6a30688344a3e95179654ea31b07f59b7 ]
The driver's suspend/resume functions were buggy. If UART node contains any child node in the DT and the child is established a communication path with the parent UART. The relevant /dev/ttyPS* node will be not available for other operations.
If the driver is trying to do any operations like suspend/resume without checking the tty->dev status it leads to the kernel crash/hang.
This patch fix this issue by call the device_may_wake() with the generic parameter of type struct device. in the uart suspend and resume paths.
It also fixes a race condition in the uart suspend path(i.e uart_suspend_port() should be called at the end of cdns_uart_suspend API this path updates the same)
--- drivers/tty/serial/xilinx_uartps.c | 41 +++++++++--------------------- 1 file changed, 12 insertions(+), 29 deletions(-)
drivers/tty/serial/xilinx_uartps.c +12 -29
@@ -1342,24 +1342,11 @@ static struct uart_driver cdns_uart_uart_driver = {static int cdns_uart_suspend (struct device *device) {struct uart_port *port =dev_get_drvdata (device); -struct tty_struct *tty; -struct device *tty_dev; -int may_wake =0 ; - -/* Get the tty which could be NULL so don't assume it's valid */ - tty =tty_port_tty_get (&port->state->port); -if (tty) { - tty_dev = tty->dev; - may_wake =device_may_wakeup (tty_dev); -tty_kref_put (tty); - } +int may_wake; -/* -* Call the API provided in serial_core.c file which handles -* the suspend. -*/ -uart_suspend_port (&cdns_uart_uart_driver, port); -if (!(console_suspend_enabled && !may_wake)) { + may_wake =device_may_wakeup (device); + +if (console_suspend_enabled && may_wake) {unsigned long flags =0 ;spin_lock_irqsave (&port->lock, flags);
@@ -1374,7 +1361,11 @@ static int cdns_uart_suspend(struct device *device)spin_unlock_irqrestore (&port->lock, flags); } -return 0 ; +/* +* Call the API provided in serial_core.c file which handles +* the suspend. +*/ +return uart_suspend_port (&cdns_uart_uart_driver, port); }/**
@@ -1388,17 +1379,9 @@ static int cdns_uart_resume(struct device *device)struct uart_port *port =dev_get_drvdata (device);unsigned long flags =0 ;u32 ctrl_reg; -struct tty_struct *tty; -struct device *tty_dev; -int may_wake =0 ; - -/* Get the tty which could be NULL so don't assume it's valid */ - tty =tty_port_tty_get (&port->state->port); -if (tty) { - tty_dev = tty->dev; - may_wake =device_may_wakeup (tty_dev); -tty_kref_put (tty); - } +int may_wake; + + may_wake =device_may_wakeup (device);if (console_suspend_enabled && !may_wake) {struct cdns_uart *cdns_uart = port->private_data;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 4/109 serial: samsung: Enable baud clock for UART reset procedure in resume
In reply to Sasha LevinFrom: Marek Szyprowski <[email protected]>
[ Upstream commit 1ff3652bc7111df26b5807037f624be294cf69d5 ]
Ensure that the baud clock is also enabled for UART register writes in driver resume. On Exynos5433 SoC this is needed to avoid external abort issue.
--- drivers/tty/serial/samsung.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/tty/serial/samsung.c +8 -0
@@ -1922,7 +1922,11 @@ static int s3c24xx_serial_resume(struct device *dev)if (port) {clk_prepare_enable (ourport->clk); +if (!IS_ERR (ourport->baudclk)) +clk_prepare_enable (ourport->baudclk);s3c24xx_serial_resetport (port,s3c24xx_port_to_cfg (port)); +if (!IS_ERR (ourport->baudclk)) +clk_disable_unprepare (ourport->baudclk);clk_disable_unprepare (ourport->clk);uart_resume_port (&s3c24xx_uart_drv, port);
@@ -1945,7 +1949,11 @@ static int s3c24xx_serial_resume_noirq(struct device *dev)if (rx_enabled (port)) uintm &= ~S3C64XX_UINTM_RXD_MSK ;clk_prepare_enable (ourport->clk); +if (!IS_ERR (ourport->baudclk)) +clk_prepare_enable (ourport->baudclk);wr_regl (port,S3C64XX_UINTM , uintm); +if (!IS_ERR (ourport->baudclk)) +clk_disable_unprepare (ourport->baudclk);clk_disable_unprepare (ourport->clk); } }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 6/109 samples/bpf: fix a compilation failure
In reply to Sasha LevinFrom: Yonghong Song <[email protected]>
[ Upstream commit 534e0e52bc23de588e81b5a6f75e10c8c4b189fc ]
samples/bpf build failed with the following errors:
$ make samples/bpf/
...
HOSTCC samples/bpf/sockex3_user.o
/data/users/yhs/work/net-next/samples/bpf/sockex3_user.c:16:8: error: redefinition of ‘struct bpf_flow_keys’
struct bpf_flow_keys {
^
In file included from /data/users/yhs/work/net-next/samples/bpf/sockex3_user.c:4:0:
./usr/include/linux/bpf.h:2338:9: note: originally defined here
struct bpf_flow_keys *flow_keys;
^
make[3]: *** [samples/bpf/sockex3_user.o] Error 1Commit d58e468b1112d ("flow_dissector: implements flow dissector BPF hook") introduced struct bpf_flow_keys in include/uapi/linux/bpf.h and hence caused the naming conflict with samples/bpf/sockex3_user.c.
The fix is to rename struct bpf_flow_keys in samples/bpf/sockex3_user.c to flow_keys to avoid the conflict.
--- samples/bpf/sockex3_user.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
samples/bpf/sockex3_user.c +2 -2
@@ -13,7 +13,7 @@#define PARSE_IP_PROG_FD (prog_fd[0])#define PROG_ARRAY_FD (map_fd[0]) -struct bpf_flow_keys { +struct flow_keys {__be32 src;__be32 dst;union {
@@ -64,7 +64,7 @@ int main(int argc, char **argv) (void ) f;for (i =0 ; i <5 ; i++) { -struct bpf_flow_keys key = {}, next_key; +struct flow_keys key = {}, next_key;struct pair value;sleep (1 );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 11/109 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
@@ -315,7 +315,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 14/109 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
@@ -1667,7 +1667,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 15/109 OPP: Protect dev_list with opp_table lock
In reply to Sasha LevinFrom: Viresh Kumar <[email protected]>
[ Upstream commit 3d2556992a878a2210d3be498416aee39e0c32aa ]
The dev_list needs to be protected with a lock, else we may have simultaneous access (addition/removal) to it and that would be racy. Extend scope of the opp_table lock to protect dev_list as well.
--- drivers/base/power/opp/core.c | 21 +++++++++++++++++++-- drivers/base/power/opp/cpu.c | 2 ++ drivers/base/power/opp/opp.h | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-)
drivers/base/power/opp/core.c +19 -2
@@ -49,9 +49,14 @@ static struct opp_device *_find_opp_dev(const struct device *dev,static struct opp_table *_find_opp_table_unlocked (struct device *dev) {struct opp_table *opp_table; +bool found;list_for_each_entry (opp_table, &opp_tables, node) { -if (_find_opp_dev (dev, opp_table)) { +mutex_lock (&opp_table->lock); + found = !!_find_opp_dev (dev, opp_table); +mutex_unlock (&opp_table->lock); + +if (found) {_get_opp_table_kref (opp_table);return opp_table;
@@ -711,6 +716,8 @@ struct opp_device *_add_opp_dev(const struct device *dev,/* Initialize opp-dev */ opp_dev->dev = dev; + +mutex_lock (&opp_table->lock);list_add (&opp_dev->node, &opp_table->dev_list);/* Create debugfs entries for the opp_table */
@@ -718,6 +725,7 @@ struct opp_device *_add_opp_dev(const struct device *dev,if (ret)dev_err (dev,"%s: Failed to register opp debugfs (%d)\n" , __func__, ret); +mutex_unlock (&opp_table->lock);return opp_dev; }
@@ -736,6 +744,7 @@ static struct opp_table *_allocate_opp_table(struct device *dev)if (!opp_table)return NULL ; +mutex_init (&opp_table->lock);INIT_LIST_HEAD (&opp_table->dev_list); opp_dev =_add_opp_dev (dev, opp_table);
@@ -757,7 +766,6 @@ static struct opp_table *_allocate_opp_table(struct device *dev)BLOCKING_INIT_NOTIFIER_HEAD (&opp_table->head);INIT_LIST_HEAD (&opp_table->opp_list); -mutex_init (&opp_table->lock);kref_init (&opp_table->kref);/* Secure the device table modification */
@@ -799,6 +807,10 @@ static void _opp_table_kref_release(struct kref *kref)if (!IS_ERR (opp_table->clk))clk_put (opp_table->clk); +/* +* No need to take opp_table->lock here as we are guaranteed that no +* references to the OPP table are taken at this point. +*/ opp_dev = list_first_entry(&opp_table->dev_list, struct opp_device, node);
@@ -1702,6 +1714,9 @@ void _dev_pm_opp_remove_table(struct opp_table *opp_table, struct device *dev, {struct dev_pm_opp *opp, *tmp; +/* Protect dev_list */ +mutex_lock (&opp_table->lock); +/* Find if opp_table manages a single device */ if (list_is_singular (&opp_table->dev_list)) {/* Free static OPPs */
@@ -1712,6 +1727,8 @@ void _dev_pm_opp_remove_table(struct opp_table *opp_table, struct device *dev, }else {_remove_opp_dev (_find_opp_dev (dev, opp_table), opp_table); } + +mutex_unlock (&opp_table->lock); }void _dev_pm_opp_find_and_remove_table (struct device *dev,bool remove_all)
drivers/base/power/opp/cpu.c +2 -0
@@ -222,8 +222,10 @@ int dev_pm_opp_get_sharing_cpus(struct device *cpu_dev, struct cpumask *cpumask)cpumask_clear (cpumask);if (opp_table->shared_opp ==OPP_TABLE_ACCESS_SHARED ) { +mutex_lock (&opp_table->lock);list_for_each_entry (opp_dev, &opp_table->dev_list, node)cpumask_set_cpu (opp_dev->dev->id, cpumask); +mutex_unlock (&opp_table->lock); }else {cpumask_set_cpu (cpu_dev->id, cpumask); }
drivers/base/power/opp/opp.h +1 -1
@@ -124,7 +124,7 @@ enum opp_table_access {* @dev_list: list of devices that share these OPPs * @opp_list: table of opps * @kref: for reference count of the table. -* @lock: mutex protecting the opp_list. +* @lock: mutex protecting the opp_list and dev_list. * @np: struct device_node pointer for opp's DT node. * @clock_latency_ns_max: Max clock latency in nanoseconds. * @shared_opp: OPP is shared between multiple devices.
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 17/109 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
@@ -420,7 +420,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 16/109 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
@@ -6,6 +6,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
@@ -5,6 +5,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
@@ -2,6 +2,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 20/109 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
@@ -674,7 +674,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
@@ -657,7 +657,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 21/109 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);
@@ -2028,7 +2028,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 12/109 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 22/109 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 );
@@ -769,7 +770,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
@@ -236,7 +236,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
@@ -1964,7 +1964,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;
@@ -1973,7 +1973,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 26/109 nfp: provide a better warning when ring allocation fails
In reply to Sasha LevinFrom: Jakub Kicinski <[email protected]>
[ Upstream commit 23d9f5531c7c28546954b0bf332134a9b8a38c0a ]
NFP supports fairly enormous ring sizes (up to 256k descriptors). In commit 466271703867 ("nfp: use kvcalloc() to allocate SW buffer descriptor arrays") we have started using kvcalloc() functions to make sure the allocation of software state arrays doesn't hit the MAX_ORDER limit. Unfortunately, we can't use virtual mappings for the DMA region holding HW descriptors. In case this allocation fails instead of the generic (and fairly scary) warning/splat in the logs print a helpful message explaining what happened and suggesting how to fix it.
--- .../net/ethernet/netronome/nfp/nfp_net_common.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-)
drivers/net/ethernet/netronome/nfp/nfp_net_common.c +12 -4
@@ -2169,9 +2169,13 @@ nfp_net_tx_ring_alloc(struct nfp_net_dp *dp, struct nfp_net_tx_ring *tx_ring) tx_ring->size =sizeof (*tx_ring->txds) * tx_ring->cnt; tx_ring->txds =dma_zalloc_coherent (dp->dev, tx_ring->size, - &tx_ring->dma,GFP_KERNEL ); -if (!tx_ring->txds) + &tx_ring->dma, +GFP_KERNEL | __GFP_NOWARN); +if (!tx_ring->txds) { +netdev_warn (dp->netdev,"failed to allocate TX descriptor ring memory, requested descriptor count: %d, consider lowering descriptor count\n" , + tx_ring->cnt); goto err_alloc; + } sz =sizeof (*tx_ring->txbufs) * tx_ring->cnt; tx_ring->txbufs =kzalloc (sz,GFP_KERNEL );
@@ -2314,9 +2318,13 @@ nfp_net_rx_ring_alloc(struct nfp_net_dp *dp, struct nfp_net_rx_ring *rx_ring) rx_ring->cnt = dp->rxd_cnt; rx_ring->size =sizeof (*rx_ring->rxds) * rx_ring->cnt; rx_ring->rxds =dma_zalloc_coherent (dp->dev, rx_ring->size, - &rx_ring->dma,GFP_KERNEL ); -if (!rx_ring->rxds) + &rx_ring->dma, +GFP_KERNEL | __GFP_NOWARN); +if (!rx_ring->rxds) { +netdev_warn (dp->netdev,"failed to allocate RX descriptor ring memory, requested descriptor count: %d, consider lowering descriptor count\n" , + rx_ring->cnt); goto err_alloc; + } sz =sizeof (*rx_ring->rxbufs) * rx_ring->cnt; rx_ring->rxbufs =kzalloc (sz,GFP_KERNEL );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 24/109 net: hns3: Fix for setting speed for phy failed problem
In reply to Sasha LevinFrom: Fuyun Liang <[email protected]>
[ Upstream commit fd8133148eb6a733f9cfdaecd4d99f378e21d582 ]
The function of genphy_read_status is that reading phy information from HW and using these information to update SW variable. If user is using ethtool to setting the speed of phy and service task is calling by hclge_get_mac_phy_link, the result of speed setting is uncertain. Because ethtool cmd will modified phydev and hclge_get_mac_phy_link also will modified phydev.
Because phy state machine will update phy link periodically, we can just use phydev->link to check the link status. This patch removes function call of genphy_read_status. To ensure accuracy, this patch adds a phy state check. If phy state is not PHY_RUNNING, we consider link is down. Because in some scenarios, phydev->link may be link up, but phy state is not PHY_RUNNING. This is just an intermediate state. In fact, the link is not ready yet.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_main.c +1 -1
@@ -2179,7 +2179,7 @@ static int hclge_get_mac_phy_link(struct hclge_dev *hdev) mac_state =hclge_get_mac_link_status (hdev);if (hdev->hw.mac.phydev) { -if (!genphy_read_status (hdev->hw.mac.phydev)) +if (hdev->hw.mac.phydev->state ==PHY_RUNNING ) link_stat = mac_state & hdev->hw.mac.phydev->link;else
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 29/109 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
@@ -2825,6 +2825,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 36/109 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 37/109 crypto: arm/crc32 - avoid warning when compiling with Clang
In reply to Sasha LevinFrom: Stefan Agner <[email protected]>
[ Upstream commit cd560235d8f9ddd94aa51e1c4dabdf3212b9b241 ]
The table id (second) argument to MODULE_DEVICE_TABLE is often referenced otherwise. This is not the case for CPU features. This leads to a warning when building the kernel with Clang:
arch/arm/crypto/crc32-ce-glue.c:239:33: warning: variable
'crc32_cpu_feature' is not needed and will not be emitted [-Wunneeded-internal-declaration]
static const struct cpu_feature crc32_cpu_feature[] = {
^Avoid warnings by using __maybe_unused, similar to commit 1f318a8bafcf ("modules: mark __inittest/__exittest as __maybe_unused").
--- arch/arm/crypto/crc32-ce-glue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/crypto/crc32-ce-glue.c +1 -1
@@ -236,7 +236,7 @@ static void __exit crc32_pmull_mod_exit(void) ARRAY_SIZE(crc32_pmull_algs)); } -static const struct cpu_feature crc32_cpu_feature[] = { +static const struct cpu_feature __maybe_unused crc32_cpu_feature[] = { {cpu_feature (CRC32 ) }, {cpu_feature (PMULL ) }, { } };MODULE_DEVICE_TABLE (cpu, crc32_cpu_feature);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 31/109 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
@@ -201,6 +201,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_atime); 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 38/109 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
@@ -87,7 +87,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
@@ -155,7 +155,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>;
@@ -168,7 +168,7 @@ status = "disabled"; }; - i2c: i2c-ctrl@11000 { + i2c: i2c@11000 { compatible = "marvell,mv64xxx-i2c"; reg = <0x11000 0x20>; #address-cells = <1>;
@@ -218,7 +218,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 40/109 ARM: dts: clearfog: fix sdhci supply property name
In reply to Sasha LevinFrom: Baruch Siach <[email protected]>
[ Upstream commit e807f0298144c06740022a2f900d86b7f115595e ]
The vmmc phandle, like all power supply property names, must have the '-supply' suffix.
--- arch/arm/boot/dts/armada-388-clearfog.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/armada-388-clearfog.dtsi +1 -1
@@ -89,7 +89,7 @@ &clearfog_sdhci_cd_pins>; pinctrl-names = "default"; status = "okay"; - vmmc = <®_3p3v>; + vmmc-supply = <®_3p3v>; wp-inverted; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 41/109 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 44/109 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
@@ -1164,7 +1164,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 45/109 net: freescale: fix return type of ndo_start_xmit function
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 06983aa526c759ebdf43f202d8d0491d9494e2f4 ]
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/freescale/dpaa/dpaa_eth.c | 3 ++- drivers/net/ethernet/freescale/fec_mpc52xx.c | 3 ++- drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c | 3 ++- drivers/net/ethernet/freescale/gianfar.c | 4 ++-- drivers/net/ethernet/freescale/ucc_geth.c | 3 ++- 5 files changed, 10 insertions(+), 6 deletions(-)
drivers/net/ethernet/freescale/dpaa/dpaa_eth.c +2 -1
@@ -2036,7 +2036,8 @@ static inline int dpaa_xmit(struct dpaa_priv *priv,return 0 ; } -static int dpaa_start_xmit (struct sk_buff *skb,struct net_device *net_dev) +static netdev_tx_t +dpaa_start_xmit (struct sk_buff *skb,struct net_device *net_dev) {const int queue_mapping =skb_get_queue_mapping (skb);bool nonlinear =skb_is_nonlinear (skb);
drivers/net/ethernet/freescale/fec_mpc52xx.c +2 -1
@@ -305,7 +305,8 @@ static int mpc52xx_fec_close(struct net_device *dev)* invariant will hold if you make sure that the netif_*_queue() * calls are done at the proper times. */ -static int mpc52xx_fec_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t +mpc52xx_fec_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct mpc52xx_fec_priv *priv =netdev_priv (dev);struct bcom_fec_bd *bd;
drivers/net/ethernet/freescale/fs_enet/fs_enet-main.c +2 -1
@@ -481,7 +481,8 @@ static struct sk_buff *tx_skb_align_workaround(struct net_device *dev, }#endif -static int fs_enet_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t +fs_enet_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct fs_enet_private *fep =netdev_priv (dev);cbd_t __iomem *bdp;
drivers/net/ethernet/freescale/gianfar.c +2 -2
@@ -112,7 +112,7 @@const char gfar_driver_version[] ="2.0" ;static int gfar_enet_open (struct net_device *dev); -static int gfar_start_xmit (struct sk_buff *skb,struct net_device *dev); +static netdev_tx_t gfar_start_xmit (struct sk_buff *skb,struct net_device *dev);static void gfar_reset_task (struct work_struct *work);static void gfar_timeout (struct net_device *dev);static int gfar_close (struct net_device *dev);
@@ -2334,7 +2334,7 @@ static inline bool gfar_csum_errata_76(struct gfar_private *priv,/* This is called by the kernel when a frame is ready for transmission. * It is pointed to by the dev->hard_start_xmit function pointer */ -static int gfar_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t gfar_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct gfar_private *priv =netdev_priv (dev);struct gfar_priv_tx_q *tx_queue =NULL ;
drivers/net/ethernet/freescale/ucc_geth.c +2 -1
@@ -3085,7 +3085,8 @@ static int ucc_geth_startup(struct ucc_geth_private *ugeth)/* This is called by the kernel when a frame is ready for transmission. */ /* It is pointed to by the dev->hard_start_xmit function pointer */ -static int ucc_geth_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t +ucc_geth_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct ucc_geth_private *ugeth =netdev_priv (dev);#ifdef CONFIG_UGETH_TX_ON_DEMAND
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 46/109 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
@@ -437,7 +437,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 47/109 x86/CPU: Change query logic so CPUID is enabled before testing
In reply to Sasha LevinFrom: Matthew Whitehead <[email protected]>
[ Upstream commit 2893cc8ff892fa74972d8dc0e1d0dc65116daaa3 ]
Presently we check first if CPUID is enabled. If it is not already enabled, then we next call identify_cpu_without_cpuid() and clear X86_FEATURE_CPUID.
Unfortunately, identify_cpu_without_cpuid() is the function where CPUID becomes _enabled_ on Cyrix 6x86/6x86L CPUs.
Reverse the calling sequence so that CPUID is first enabled, and then check a second time to see if the feature has now been activated.
[ bp: Massage commit message and remove trailing whitespace. ]
--- arch/x86/kernel/cpu/common.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
arch/x86/kernel/cpu/common.c +3 -1
@@ -1037,6 +1037,9 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)memset (&c->x86_capability,0 ,sizeof c->x86_capability); c->extended_cpuid_level =0 ; +if (!have_cpuid_p ()) +identify_cpu_without_cpuid (c); +/* cyrix could have cpuid enabled via c_identify()*/ if (have_cpuid_p ()) {cpu_detect (c);
@@ -1053,7 +1056,6 @@ static void __init early_identify_cpu(struct cpuinfo_x86 *c)if (this_cpu->c_bsp_init) this_cpu->c_bsp_init (c); }else { -identify_cpu_without_cpuid (c);setup_clear_cpu_cap (X86_FEATURE_CPUID ); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 78/109 f2fs: fix to recover inode's project id during POR
In reply to Sasha LevinFrom: Chao Yu <[email protected]>
[ Upstream commit f4474aa6e5e901ee4af21f39f1b9115aaaaec503 ]
Testcase to reproduce this bug:
1. mkfs.f2fs -O extra_attr -O project_quota /dev/sdd
2. mount -t f2fs /dev/sdd /mnt/f2fs
3. touch /mnt/f2fs/file
4. sync
5. chattr -p 1 /mnt/f2fs/file
6. xfs_io -f /mnt/f2fs/file -c "fsync"
7. godown /mnt/f2fs
8. umount /mnt/f2fs
9. mount -t f2fs /dev/sdd /mnt/f2fs
10. lsattr -p /mnt/f2fs/file
0 -----------------N- /mnt/f2fs/file
But actually, we expect the correct result is:
1 -----------------N- /mnt/f2fs/file
The reason is we didn't recover inode.i_projid field during mount, fix it.
--- fs/f2fs/recovery.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
fs/f2fs/recovery.c +13 -0
@@ -203,6 +203,19 @@ static void recover_inode(struct inode *inode, struct page *page) 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)); + +if (raw->i_inline &F2FS_EXTRA_ATTR ) { +if (f2fs_sb_has_project_quota (F2FS_I_SB (inode)->sb) && +F2FS_FITS_IN_INODE (raw,le16_to_cpu (raw->i_extra_isize), + i_projid)) { +projid_t i_projid; + + i_projid = (projid_t )le32_to_cpu (raw->i_projid); +F2FS_I (inode)->i_projid = +make_kprojid (&init_user_ns, i_projid); + } + } +f2fs_i_size_write (inode,le64_to_cpu (raw->i_size)); inode->i_atime.tv_sec =le64_to_cpu (raw->i_atime); 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 79/109 f2fs: mark inode dirty explicitly in recover_inode()
In reply to Sasha LevinFrom: Chao Yu <[email protected]>
[ Upstream commit 4a1728cad6340bfbe17bd17fd158b2165cd99508 ]
Mark inode dirty explicitly in the end of recover_inode() to make sure that all recoverable fields can be persisted later.
--- fs/f2fs/recovery.c | 2 ++ 1 file changed, 2 insertions(+)
fs/f2fs/recovery.c +2 -0
@@ -227,6 +227,8 @@ static void recover_inode(struct inode *inode, struct page *page)F2FS_I (inode)->i_advise = raw->i_advise;F2FS_I (inode)->i_flags =le32_to_cpu (raw->i_flags); +f2fs_mark_inode_dirty_sync (inode, true); +if (file_enc_name (inode)) name ="<encrypted>" ;else
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 52/109 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 101/109 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
@@ -168,14 +168,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
@@ -168,14 +168,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 104/109 rtc: armada38x: fix possible race condition
In reply to Sasha LevinFrom: Alexandre Belloni <[email protected]>
[ Upstream commit 7d61cbb945a753af08e247b5f10bdd5dbb8d6c80 ]
The IRQ is requested before the struct rtc is allocated and registered, but this struct is used in the IRQ handler. This may lead to a NULL pointer dereference.
Switch to devm_rtc_allocate_device/rtc_register_device to allocate the rtc before requesting the IRQ.
--- drivers/rtc/rtc-armada38x.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-)
drivers/rtc/rtc-armada38x.c +11 -11
@@ -390,7 +390,6 @@ MODULE_DEVICE_TABLE(of, armada38x_rtc_of_match_table);static __init int armada38x_rtc_probe (struct platform_device *pdev) { -const struct rtc_class_ops *ops;struct resource *res;struct armada38x_rtc *rtc;const struct of_device_id *match;
@@ -427,6 +426,11 @@ static __init int armada38x_rtc_probe(struct platform_device *pdev)dev_err (&pdev->dev,"no irq\n" );return rtc->irq; } + + rtc->rtc_dev =devm_rtc_allocate_device (&pdev->dev); +if (IS_ERR (rtc->rtc_dev)) +return PTR_ERR (rtc->rtc_dev); +if (devm_request_irq (&pdev->dev, rtc->irq, armada38x_rtc_alarm_irq,0 , pdev->name, rtc) <0 ) {dev_warn (&pdev->dev,"Interrupt not available.\n" );
@@ -436,28 +440,24 @@ static __init int armada38x_rtc_probe(struct platform_device *pdev)if (rtc->irq !=-1 ) {device_init_wakeup (&pdev->dev,1 ); - ops = &armada38x_rtc_ops; + rtc->rtc_dev->ops = &armada38x_rtc_ops; }else {/* * If there is no interrupt available then we can't * use the alarm */ - ops = &armada38x_rtc_ops_noirq; + rtc->rtc_dev->ops = &armada38x_rtc_ops_noirq; } rtc->data = (struct armada38x_rtc_data *)match->data; -/* Update RTC-MBUS bridge timing parameters */ rtc->data->update_mbus_timing (rtc); - rtc->rtc_dev =devm_rtc_device_register (&pdev->dev, pdev->name, - ops,THIS_MODULE ); -if (IS_ERR (rtc->rtc_dev)) { - ret =PTR_ERR (rtc->rtc_dev); + ret =rtc_register_device (rtc->rtc_dev); +if (ret)dev_err (&pdev->dev,"Failed to register RTC device: %d\n" , ret); -return ret; - } -return 0 ; + +return ret; }#ifdef CONFIG_PM_SLEEP
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 71/109 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
@@ -2060,14 +2060,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 87/109 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
@@ -261,15 +261,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 89/109 iwlwifi: api: annotate compressed BA notif array sizes
In reply to Sasha LevinFrom: Johannes Berg <[email protected]>
[ Upstream commit 6f68cc367ab6578a33cca21b6056804165621f00 ]
Annotate the compressed BA notification array sizes and make both of them 0-length since the length of 1 is just confusing - it may be different than that and the offset to the second one needs to be calculated in the C code anyhow.
--- drivers/net/wireless/intel/iwlwifi/fw/api/tx.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/net/wireless/intel/iwlwifi/fw/api/tx.h +3 -3
@@ -722,9 +722,9 @@ enum iwl_mvm_ba_resp_flags {* @tfd_cnt: number of TFD-Q elements * @ra_tid_cnt: number of RATID-Q elements * @tfd: array of TFD queue status updates. See &iwl_mvm_compressed_ba_tfd -* for details. +* for details. Length in @tfd_cnt. * @ra_tid: array of RA-TID queue status updates. For debug purposes only. See -* &iwl_mvm_compressed_ba_ratid for more details. +* &iwl_mvm_compressed_ba_ratid for more details. Length in @ra_tid_cnt. */ struct iwl_mvm_compressed_ba_notif {__le32 flags;
@@ -741,7 +741,7 @@ struct iwl_mvm_compressed_ba_notif {__le32 tx_rate;__le16 tfd_cnt;__le16 ra_tid_cnt; -struct iwl_mvm_compressed_ba_tfd tfd[1 ]; +struct iwl_mvm_compressed_ba_tfd tfd[0 ];struct iwl_mvm_compressed_ba_ratid ra_tid[0 ]; } __packed;/* COMPRESSED_BA_RES_API_S_VER_4 */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 96/109 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
@@ -522,8 +522,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); }
@@ -1711,6 +1709,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 :
@@ -1793,6 +1792,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;
@@ -1952,6 +1952,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);
@@ -2106,13 +2107,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 ; }
@@ -2283,8 +2287,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 81/109 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
@@ -304,7 +304,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 70/109 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
@@ -433,10 +433,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
@@ -1611,6 +1611,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
@@ -1676,6 +1685,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 57/109 phy: brcm-sata: allow PHY_BRCM_SATA driver to be built for DSL SoCs
In reply to Sasha LevinFrom: Florian Fainelli <[email protected]>
[ Upstream commit 26728df4b254ae06247726a9a6e64823e39ac504 ]
Broadcom ARM-based DSL SoCs (BCM63xx product line) have the same Broadcom SATA PHY that other SoCs are using, make it possible to select that driver on these platforms.
--- drivers/phy/broadcom/Kconfig | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/phy/broadcom/Kconfig +2 -1
@@ -60,7 +60,8 @@ config PHY_NS2_USB_DRD config PHY_BRCM_SATA tristate "Broadcom SATA PHY driver" - depends on ARCH_BRCMSTB || ARCH_BCM_IPROC || BMIPS_GENERIC || COMPILE_TEST + depends on ARCH_BRCMSTB || ARCH_BCM_IPROC || BMIPS_GENERIC || \ + ARCH_BCM_63XX || COMPILE_TEST depends on OF select GENERIC_PHY default ARCH_BCM_IPROC
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 58/109 phy: renesas: rcar-gen3-usb2: fix vbus_ctrl for role sysfs
In reply to Sasha LevinFrom: Yoshihiro Shimoda <[email protected]>
[ Upstream commit 09938ea9d136243e8d1fed6d4d7a257764f28f6d ]
This patch fixes and issue that the vbus_ctrl is disabled by rcar_gen3_init_from_a_peri_to_a_host(), so a usb host cannot supply the vbus.
Note that this condition will exit when the otg irq happens even if we don't apply this patch.
--- drivers/phy/renesas/phy-rcar-gen3-usb2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/phy/renesas/phy-rcar-gen3-usb2.c +1 -1
@@ -195,7 +195,7 @@ static void rcar_gen3_init_from_a_peri_to_a_host(struct rcar_gen3_chan *ch) val =readl (usb2_base +USB2_OBINTEN );writel (val & ~USB2_OBINT_BITS , usb2_base +USB2_OBINTEN ); -rcar_gen3_enable_vbus_ctrl (ch,0 ); +rcar_gen3_enable_vbus_ctrl (ch,1 );rcar_gen3_init_for_host (ch);writel (val |USB2_OBINT_BITS , usb2_base +USB2_OBINTEN );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 85/109 x86/hyperv: Suppress "PCI: Fatal: No config space access function found"
In reply to Sasha LevinFrom: Dexuan Cui <[email protected]>
[ Upstream commit 2f285f46240d67060061d153786740d4df53cd78 ]
A Generation-2 Linux VM on Hyper-V doesn't have the legacy PCI bus, and users always see the scary warning, which is actually harmless.
Suppress it.
--- arch/x86/hyperv/hv_init.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
arch/x86/hyperv/hv_init.c +19 -0
@@ -17,6 +17,7 @@* */ +#include <linux/efi.h> #include <linux/types.h> #include <asm/hypervisor.h> #include <asm/hyperv.h>
@@ -101,6 +102,22 @@ static int hv_cpu_init(unsigned int cpu)return 0 ; } +static int __init hv_pci_init (void ) +{ +int gen2vm =efi_enabled (EFI_BOOT ); + +/* +* For Generation-2 VM, we exit from pci_arch_init() by returning 0. +* The purpose is to suppress the harmless warning: +* "PCI: Fatal: No config space access function found" +*/ +if (gen2vm) +return 0 ; + +/* For Generation-1 VM, we'll proceed in pci_arch_init(). */ +return 1 ; +} +/* * This function is to be invoked early in the boot sequence after the * hypervisor has been detected.
@@ -154,6 +171,8 @@ void hyperv_init(void)hyper_alloc_mmu (); + x86_init.pci.arch_init = hv_pci_init; +/* * Register Hyper-V specific clocksource. */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 105/109 netfilter: masquerade: don't flush all conntracks if only one address deleted on device
In reply to Sasha LevinFrom: Tan Hu <[email protected]>
[ Upstream commit 097f95d319f817e651bd51f8846aced92a55a6a1 ]
We configured iptables as below, which only allowed incoming data on established connections:
iptables -t mangle -A PREROUTING -m state --state ESTABLISHED -j ACCEPT iptables -t mangle -P PREROUTING DROP
When deleting a secondary address, current masquerade implements would flush all conntracks on this device. All the established connections on primary address also be deleted, then subsequent incoming data on the connections would be dropped wrongly because it was identified as NEW connection.
So when an address was delete, it should only flush connections related with the address.
--- net/ipv4/netfilter/nf_nat_masquerade_ipv4.c | 22 ++++++++++++++++++--- net/ipv6/netfilter/nf_nat_masquerade_ipv6.c | 19 +++++++++++++++--- 2 files changed, 35 insertions(+), 6 deletions(-)
net/ipv4/netfilter/nf_nat_masquerade_ipv4.c +19 -3
@@ -105,12 +105,26 @@ static int masq_device_event(struct notifier_block *this,return NOTIFY_DONE ; } +static int inet_cmp (struct nf_conn *ct,void *ptr) +{ +struct in_ifaddr *ifa = (struct in_ifaddr *)ptr; +struct net_device *dev = ifa->ifa_dev->dev; +struct nf_conntrack_tuple *tuple; + +if (!device_cmp (ct, (void *)(long )dev->ifindex)) +return 0 ; + + tuple = &ct->tuplehash[IP_CT_DIR_REPLY ].tuple; + +return ifa->ifa_address == tuple->dst.u3.ip; +} +static int masq_inet_event (struct notifier_block *this,unsigned long event,void *ptr) {struct in_device *idev = ((struct in_ifaddr *)ptr)->ifa_dev; -struct netdev_notifier_info info; +struct net *net =dev_net (idev->dev);/* The masq_dev_notifier will catch the case of the device going * down. So if the inetdev is dead and being destroyed we have
@@ -120,8 +134,10 @@ static int masq_inet_event(struct notifier_block *this,if (idev->dead)return NOTIFY_DONE ; -netdev_notifier_info_init (&info, idev->dev); -return masq_device_event (this, event, &info); +if (event ==NETDEV_DOWN ) +nf_ct_iterate_cleanup_net (net, inet_cmp, ptr,0 ,0 ); + +return NOTIFY_DONE ; }static struct notifier_block masq_dev_notifier = {
net/ipv6/netfilter/nf_nat_masquerade_ipv6.c +16 -3
@@ -88,18 +88,30 @@ static struct notifier_block masq_dev_notifier = {struct masq_dev_work {struct work_struct work;struct net *net; +struct in6_addr addr;int ifindex; }; +static int inet_cmp (struct nf_conn *ct,void *work) +{ +struct masq_dev_work *w = (struct masq_dev_work *)work; +struct nf_conntrack_tuple *tuple; + +if (!device_cmp (ct, (void *)(long )w->ifindex)) +return 0 ; + + tuple = &ct->tuplehash[IP_CT_DIR_REPLY ].tuple; + +return ipv6_addr_equal (&w->addr, &tuple->dst.u3.in6); +} +static void iterate_cleanup_work (struct work_struct *work) {struct masq_dev_work *w; -long index; w = container_of(work, struct masq_dev_work, work); - index = w->ifindex; -nf_ct_iterate_cleanup_net (w->net, device_cmp, (void *)index,0 ,0 ); +nf_ct_iterate_cleanup_net (w->net, inet_cmp, (void *)w,0 ,0 );put_net (w->net);kfree (w);
@@ -148,6 +160,7 @@ static int masq_inet_event(struct notifier_block *this,INIT_WORK (&w->work, iterate_cleanup_work); w->ifindex = dev->ifindex; w->net = net; + w->addr = ifa->addr;schedule_work (&w->work);return NOTIFY_DONE ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 67/109 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
@@ -981,6 +981,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 );
@@ -1064,13 +1070,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 ; }
@@ -1082,9 +1081,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 54/109 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; }
@@ -578,6 +579,7 @@ static void uvcg_control_class_drop_link(struct config_item *src, unlock:mutex_unlock (&opts->lock); out: +config_item_put (header);mutex_unlock (su_mutex); }
@@ -2037,6 +2039,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; }
@@ -2077,6 +2080,7 @@ static void uvcg_streaming_class_drop_link(struct config_item *src, unlock:mutex_unlock (&opts->lock); out: +config_item_put (header);mutex_unlock (su_mutex); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 84/109 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
@@ -6819,6 +6819,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 93/109 scsi: NCR5380: Withhold disconnect privilege for REQUEST SENSE
In reply to Sasha LevinFrom: Finn Thain <[email protected]>
[ Upstream commit 7c8ed783c2faa1e3f741844ffac41340338ea0f4 ]
This is mostly needed because an AztecMonster II target has been observed disconnecting REQUEST SENSE commands and then failing to reselect properly.
--- drivers/scsi/NCR5380.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/NCR5380.c +3 -1
@@ -938,6 +938,8 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)int len;int err;bool ret = true; +bool can_disconnect = instance->irq !=NO_IRQ && + cmd->cmnd[0 ] !=REQUEST_SENSE ;NCR5380_dprint (NDEBUG_ARBITRATION , instance); dsprintk(NDEBUG_ARBITRATION, instance, "starting arbitration, id = %d\n",
@@ -1157,7 +1159,7 @@ static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)dsprintk (NDEBUG_SELECTION , instance,"target %d selected, going into MESSAGE OUT phase.\n" ,scmd_id (cmd)); - tmp[0 ] =IDENTIFY (((instance->irq ==NO_IRQ ) ?0 :1 ), cmd->device->lun); + tmp[0 ] =IDENTIFY (can_disconnect, cmd->device->lun); len =1 ; data = tmp;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 64/109 coresight: perf: Disable trace path upon source error
In reply to Sasha LevinFrom: Suzuki K Poulose <[email protected]>
[ Upstream commit 4f8ef21007531c3d7cb5b826e7b2c8999b65ecae ]
We enable the trace path, before activating the source. If we fail to enable the source, we must disable the path to make sure it is available for another session.
--- drivers/hwtracing/coresight/coresight-etm-perf.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/hwtracing/coresight/coresight-etm-perf.c +3 -1
@@ -317,11 +317,13 @@ static void etm_event_start(struct perf_event *event, int flags)/* Finally enable the tracer */ if (source_ops (csdev)->enable (csdev, event,CS_MODE_PERF )) - goto fail_end_stop; + goto fail_disable_path; out:return ; +fail_disable_path: +coresight_disable_path (path); fail_end_stop:perf_aux_output_flag (handle,PERF_AUX_FLAG_TRUNCATED );perf_aux_output_end (handle,0 );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 88/109 iwlwifi: dbg: don't crash if the firmware crashes in the middle of a debug dump
In reply to Sasha LevinFrom: Emmanuel Grumbach <[email protected]>
[ Upstream commit 79f25b10c9da3dbc953e47033d0494e51580ac3b ]
We can dump data from the firmware either when it crashes, or when the firmware is alive.
Not all the data is available if the firmware is running (like the Tx / Rx FIFOs which are available only when the firmware is halted), so we first check that the firmware is alive to compute the required size for the dump and then fill the buffer with the data.
When we allocate the buffer, we test the STATUS_FW_ERROR bit to check if the firmware is alive or not. This bit can be changed during the course of the dump since it is modified in the interrupt handler.
We hit a case where we allocate the buffer while the firmware is sill working, and while we start to fill the buffer, the firmware crashes. Then we test STATUS_FW_ERROR again and decide to fill the buffer with data like the FIFOs even if no room was allocated for this data in the buffer. This means that we overflow the buffer that was allocated leading to memory corruption.
To fix this, test the STATUS_FW_ERROR bit only once and rely on local variables to check if we should dump fifos or other firmware components.
--- drivers/net/wireless/intel/iwlwifi/fw/dbg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/intel/iwlwifi/fw/dbg.c +1 -1
@@ -775,7 +775,7 @@ void iwl_fw_error_dump(struct iwl_fw_runtime *fwrt) dump_data =iwl_fw_error_next_data (dump_data);/* We only dump the FIFOs if the FW is in error state */ -if (test_bit (STATUS_FW_ERROR , &fwrt->trans->status)) { +if (fifo_data_len) {iwl_fw_dump_fifos (fwrt, &dump_data);if (radio_len)iwl_read_radio_regs (fwrt, &dump_data);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 108/109 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
@@ -592,13 +592,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
@@ -626,12 +632,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
Sasha Levin
maintainerPATCH 95/109 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
@@ -2014,6 +2014,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 100/109 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
@@ -107,7 +107,7 @@ clock-names = "uartclk", "apb_pclk"; }; - spi0: ssp@e1020000 { + spi0: spi@e1020000 { status = "disabled"; compatible = "arm,pl022", "arm,primecell"; reg = <0 0xe1020000 0 0x1000>;
@@ -117,7 +117,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/109 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
@@ -140,12 +140,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; }
@@ -347,8 +349,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 102/109 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 98/109 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
@@ -2045,6 +2045,9 @@ static void NCR5380_reselect(struct Scsi_Host *instance)if (NCR5380_poll_politely (hostdata,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 107/109 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 82/109 firmware: dell_rbu: Make payload memory uncachable
In reply to Sasha LevinFrom: Stuart Hayes <[email protected]>
[ Upstream commit 6aecee6ad41cf97c0270f72da032c10eef025bf0 ]
The dell_rbu driver takes firmware update payloads and puts them in memory so the system BIOS can find them after a reboot. This sometimes fails (though rarely), because the memory containing the payload is in the CPU cache but never gets written back to main memory before the system is rebooted (CPU cache contents are lost on reboot).
With this patch, the payload memory will be changed to uncachable to ensure that the payload is actually in main memory before the system is rebooted.
--- drivers/firmware/dell_rbu.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/firmware/dell_rbu.c +8 -0
@@ -45,6 +45,7 @@#include <linux/moduleparam.h> #include <linux/firmware.h> #include <linux/dma-mapping.h> +#include <asm/set_memory.h> MODULE_AUTHOR ("Abhay Salunke <[email protected]>" );MODULE_DESCRIPTION ("Driver for updating BIOS image on DELL systems" );
@@ -181,6 +182,11 @@ static int create_packet(void *data, size_t length) packet_data_temp_buf =NULL ; } } +/* +* set to uncachable or it may never get written back before reboot +*/ +set_memory_uc ((unsigned long )packet_data_temp_buf,1 << ordernum); +spin_lock (&rbu_data.lock); newpacket->data = packet_data_temp_buf;
@@ -349,6 +355,8 @@ static void packet_empty_list(void)* to make sure there are no stale RBU packets left in memory */ memset (newpacket->data,0 , rbu_data.packetsize); +set_memory_wb ((unsigned long )newpacket->data, +1 << newpacket->ordernum);free_pages ((unsigned long ) newpacket->data, newpacket->ordernum);kfree (newpacket);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 80/109 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> #define EDAC_DEVICE_NAME_LEN 31
@@ -667,6 +668,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 61/109 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 65/109 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"
@@ -623,7 +624,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 ;
@@ -634,17 +635,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.
@@ -898,20 +908,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 63/109 coresight: perf: Fix per cpu path management
In reply to Sasha LevinFrom: Suzuki K Poulose <[email protected]>
[ Upstream commit 5ecabe4a76e8cdb61fa3e24862d9ca240a1c4ddf ]
We create a coresight trace path for each online CPU when we start the event. We rely on the number of online CPUs and then go on to allocate an array matching the "number of online CPUs" for holding the path and then uses normal CPU id as the index to the array. This is problematic as we could have some offline CPUs causing us to access beyond the actual array size (e.g, on a dual SMP system, if CPU0 is offline, CPU1 could be really accessing beyond the array). The solution is to switch to per-cpu array for holding the path.
--- .../hwtracing/coresight/coresight-etm-perf.c | 55 ++++++++++++++----- 1 file changed, 40 insertions(+), 15 deletions(-)
drivers/hwtracing/coresight/coresight-etm-perf.c +40 -15
@@ -23,6 +23,7 @@#include <linux/mm.h> #include <linux/init.h> #include <linux/perf_event.h> +#include <linux/percpu-defs.h> #include <linux/slab.h> #include <linux/types.h> #include <linux/workqueue.h>
@@ -44,7 +45,7 @@ struct etm_event_data {struct work_struct work;cpumask_t mask;void *snk_config; -struct list_head **path; +struct list_head *__percpu *path; }; static DEFINE_PER_CPU(struct perf_output_handle, ctx_handle);
@@ -72,6 +73,18 @@ static const struct attribute_group *etm_pmu_attr_groups[] = { NULL, }; +static inline struct list_head ** +etm_event_cpu_path_ptr (struct etm_event_data *data,int cpu) +{ +return per_cpu_ptr (data->path, cpu); +} + +static inline struct list_head * +etm_event_cpu_path (struct etm_event_data *data,int cpu) +{ +return *etm_event_cpu_path_ptr (data, cpu); +} +static void etm_event_read (struct perf_event *event) {}static int etm_addr_filters_alloc (struct perf_event *event)
@@ -131,23 +144,26 @@ static void free_event_data(struct work_struct *work)*/ if (event_data->snk_config) { cpu =cpumask_first (mask); - sink =coresight_get_sink (event_data->path[cpu]); + sink =coresight_get_sink (etm_event_cpu_path (event_data, cpu));if (sink_ops (sink)->free_buffer)sink_ops (sink)->free_buffer (event_data->snk_config); }for_each_cpu (cpu, mask) { -if (!(IS_ERR_OR_NULL (event_data->path[cpu]))) -coresight_release_path (event_data->path[cpu]); +struct list_head **ppath; + + ppath =etm_event_cpu_path_ptr (event_data, cpu); +if (!(IS_ERR_OR_NULL (*ppath))) +coresight_release_path (*ppath); + *ppath =NULL ; } -kfree (event_data->path); +free_percpu (event_data->path);kfree (event_data); }static void *alloc_event_data (int cpu) { -int size;cpumask_t *mask;struct etm_event_data *event_data;
@@ -158,7 +174,6 @@ static void *alloc_event_data(int cpu)/* Make sure nothing disappears under us */ get_online_cpus (); - size =num_online_cpus (); mask = &event_data->mask;if (cpu !=-1 )
@@ -175,8 +190,8 @@ static void *alloc_event_data(int cpu)* unused memory when dealing with single CPU trace scenarios is small * compared to the cost of searching through an optimized array. */ - event_data->path =kcalloc (size, -sizeof (struct list_head *),GFP_KERNEL ); + event_data->path = alloc_percpu(struct list_head *); +if (!event_data->path) {kfree (event_data);return NULL ;
@@ -224,6 +239,7 @@ static void *etm_setup_aux(int event_cpu, void **pages,/* Setup the path for each CPU in a trace session */ for_each_cpu (cpu, mask) { +struct list_head *path;struct coresight_device *csdev; csdev =per_cpu (csdev_src, cpu);
@@ -235,9 +251,11 @@ static void *etm_setup_aux(int event_cpu, void **pages,* list of devices from source to sink that can be * referenced later when the path is actually needed. */ - event_data->path[cpu] =coresight_build_path (csdev, sink); -if (IS_ERR (event_data->path[cpu])) + path =coresight_build_path (csdev, sink); +if (IS_ERR (path)) goto err; + + *etm_event_cpu_path_ptr (event_data, cpu) = path; }if (!sink_ops (sink)->alloc_buffer)
@@ -266,6 +284,7 @@ static void etm_event_start(struct perf_event *event, int flags)struct etm_event_data *event_data;struct perf_output_handle *handle =this_cpu_ptr (&ctx_handle);struct coresight_device *sink, *csdev =per_cpu (csdev_src, cpu); +struct list_head *path;if (!csdev) goto fail;
@@ -278,8 +297,9 @@ static void etm_event_start(struct perf_event *event, int flags)if (!event_data) goto fail; + path =etm_event_cpu_path (event_data, cpu);/* We need a sink, no need to continue without one */ - sink =coresight_get_sink (event_data->path[cpu]); + sink =coresight_get_sink (path);if (WARN_ON_ONCE (!sink || !sink_ops (sink)->set_buffer)) goto fail_end_stop;
@@ -289,7 +309,7 @@ static void etm_event_start(struct perf_event *event, int flags) goto fail_end_stop;/* Nothing will happen without a path */ -if (coresight_enable_path (event_data->path[cpu],CS_MODE_PERF )) +if (coresight_enable_path (path,CS_MODE_PERF )) goto fail_end_stop;/* Tell the perf core the event is alive */
@@ -317,6 +337,7 @@ static void etm_event_stop(struct perf_event *event, int mode)struct coresight_device *sink, *csdev =per_cpu (csdev_src, cpu);struct perf_output_handle *handle =this_cpu_ptr (&ctx_handle);struct etm_event_data *event_data =perf_get_aux (handle); +struct list_head *path;if (event->hw.state ==PERF_HES_STOPPED )return ;
@@ -324,7 +345,11 @@ static void etm_event_stop(struct perf_event *event, int mode)if (!csdev)return ; - sink =coresight_get_sink (event_data->path[cpu]); + path =etm_event_cpu_path (event_data, cpu); +if (!path) +return ; + + sink =coresight_get_sink (path);if (!sink)return ;
@@ -355,7 +380,7 @@ static void etm_event_stop(struct perf_event *event, int mode) }/* Disabling the path make its elements available to other sessions */ -coresight_disable_path (event_data->path[cpu]); +coresight_disable_path (path); }static int etm_event_add (struct perf_event *event,int mode)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 109/109 net: phy: mdio-bcm-unimac: mark PM functions as __maybe_unused
In reply to Sasha LevinFrom: Arnd Bergmann <[email protected]>
[ Upstream commit 9b97123a584f60a5bca5a2663485768a1f6cd0a4 ]
The newly added runtime-pm support causes a harmless warning when CONFIG_PM is disabled:
drivers/net/phy/mdio-bcm-unimac.c:330:12: error: 'unimac_mdio_resume' defined but not used [-Werror=unused-function]
static int unimac_mdio_resume(struct device *d)drivers/net/phy/mdio-bcm-unimac.c:321:12: error: 'unimac_mdio_suspend' defined but not used [-Werror=unused-function]
static int unimac_mdio_suspend(struct device *d)
Marking the functions as __maybe_unused is the easiest workaround and avoids adding #ifdef checks.
--- drivers/net/phy/mdio-bcm-unimac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/phy/mdio-bcm-unimac.c +2 -2
@@ -316,7 +316,7 @@ static int unimac_mdio_remove(struct platform_device *pdev)return 0 ; } -static int unimac_mdio_suspend (struct device *d) +static int __maybe_unused unimac_mdio_suspend (struct device *d) {struct unimac_mdio_priv *priv =dev_get_drvdata (d);
@@ -325,7 +325,7 @@ static int unimac_mdio_suspend(struct device *d)return 0 ; } -static int unimac_mdio_resume (struct device *d) +static int __maybe_unused unimac_mdio_resume (struct device *d) {struct unimac_mdio_priv *priv =dev_get_drvdata (d);int ret;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 77/109 net: faraday: fix return type of ndo_start_xmit function
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 0a715156656bddf4aa92d9868f850aeeb0465fd0 ]
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/faraday/ftgmac100.c | 4 ++-- drivers/net/ethernet/faraday/ftmac100.c | 7 ++++--- 2 files changed, 6 insertions(+), 5 deletions(-)
drivers/net/ethernet/faraday/ftgmac100.c +2 -2
@@ -707,8 +707,8 @@ static bool ftgmac100_prep_tx_csum(struct sk_buff *skb, u32 *csum_vlan)return skb_checksum_help (skb) ==0 ; } -static int ftgmac100_hard_start_xmit (struct sk_buff *skb, -struct net_device *netdev) +static netdev_tx_t ftgmac100_hard_start_xmit (struct sk_buff *skb, +struct net_device *netdev) {struct ftgmac100 *priv =netdev_priv (netdev);struct ftgmac100_txdes *txdes, *first;
drivers/net/ethernet/faraday/ftmac100.c +4 -3
@@ -632,8 +632,8 @@ static void ftmac100_tx_complete(struct ftmac100 *priv) ; } -static int ftmac100_xmit (struct ftmac100 *priv,struct sk_buff *skb, -dma_addr_t map) +static netdev_tx_t ftmac100_xmit (struct ftmac100 *priv,struct sk_buff *skb, +dma_addr_t map) {struct net_device *netdev = priv->netdev;struct ftmac100_txdes *txdes;
@@ -1013,7 +1013,8 @@ static int ftmac100_stop(struct net_device *netdev)return 0 ; } -static int ftmac100_hard_start_xmit (struct sk_buff *skb,struct net_device *netdev) +static netdev_tx_t +ftmac100_hard_start_xmit (struct sk_buff *skb,struct net_device *netdev) {struct ftmac100 *priv =netdev_priv (netdev);dma_addr_t map;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 91/109 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
@@ -2309,7 +2309,7 @@ static int NCR5380_host_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);
@@ -2327,10 +2327,13 @@ static int NCR5380_host_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 76/109 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
@@ -638,7 +638,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
@@ -1786,7 +1786,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 69/109 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
@@ -1180,8 +1180,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 106/109 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 97/109 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
@@ -2021,8 +2021,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
@@ -2035,6 +2033,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)NCR5380_write (INITIATOR_COMMAND_REG ,ICR_BASE |ICR_ASSERT_BSY );if (NCR5380_poll_politely (hostdata,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 ; }
@@ -2046,6 +2045,7 @@ static void NCR5380_reselect(struct Scsi_Host *instance)if (NCR5380_poll_politely (hostdata,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 92/109 scsi: NCR5380: Have NCR5380_select() return a bool
In reply to Sasha LevinFrom: Finn Thain <[email protected]>
[ Upstream commit dad8261e643849ea134c7cd5c8e794e31d93b9eb ]
The return value is taken to mean "retry" or "don't retry". Change it to bool to improve readability. Fix related comments. No functional change.
--- drivers/scsi/NCR5380.c | 46 +++++++++++++++++++----------------------- drivers/scsi/NCR5380.h | 2 +- 2 files changed, 22 insertions(+), 26 deletions(-)
drivers/scsi/NCR5380.c +21 -25
@@ -904,20 +904,16 @@ static irqreturn_t __maybe_unused NCR5380_intr(int irq, void *dev_id)return IRQ_RETVAL (handled); } -/* -* Function : int NCR5380_select(struct Scsi_Host *instance, -* struct scsi_cmnd *cmd) -* -* Purpose : establishes I_T_L or I_T_L_Q nexus for new or existing command, -* including ARBITRATION, SELECTION, and initial message out for -* IDENTIFY and queue messages. +/** +* NCR5380_select - attempt arbitration and selection for a given command +* @instance: the Scsi_Host instance +* @cmd: the scsi_cmnd to execute * -* Inputs : instance - instantiation of the 5380 driver on which this -* target lives, cmd - SCSI command to execute. +* This routine establishes an I_T_L nexus for a SCSI command. This involves +* ARBITRATION, SELECTION and MESSAGE OUT phases and an IDENTIFY message. * -* Returns cmd if selection failed but should be retried, -* NULL if selection failed and should not be retried, or -* NULL if selection succeeded (hostdata->connected == cmd). +* Returns true if the operation should be retried. +* Returns false if it should not be retried. * * Side effects : * If bus busy, arbitration failed, etc, NCR5380_select() will exit
@@ -925,16 +921,15 @@ static irqreturn_t __maybe_unused NCR5380_intr(int irq, void *dev_id)* SELECT_ENABLE will be set appropriately, the NCR5380 * will cease to drive any SCSI bus signals. * -* If successful : I_T_L or I_T_L_Q nexus will be established, -* instance->connected will be set to cmd. +* If successful : the I_T_L nexus will be established, and +* hostdata->connected will be set to cmd. * SELECT interrupt will be disabled. * * If failed (no target) : cmd->scsi_done() will be called, and the * cmd->result host byte set to DID_BAD_TARGET. */ -static struct scsi_cmnd *NCR5380_select (struct Scsi_Host *instance, -struct scsi_cmnd *cmd) +static bool NCR5380_select (struct Scsi_Host *instance,struct scsi_cmnd *cmd) __releases(&hostdata->lock) __acquires(&hostdata->lock) {struct NCR5380_hostdata *hostdata =shost_priv (instance);
@@ -942,6 +937,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,unsigned char *data;int len;int err; +bool ret = true;NCR5380_dprint (NDEBUG_ARBITRATION , instance); dsprintk(NDEBUG_ARBITRATION, instance, "starting arbitration, id = %d\n",
@@ -950,7 +946,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,/* * Arbitration and selection phases are slow and involve dropping the * lock, so we have to watch out for EH. An exception handler may -* change 'selecting' to NULL. This function will then return NULL +* change 'selecting' to NULL. This function will then return false * so that the caller will forget about 'cmd'. (During information * transfer phases, EH may change 'connected' to NULL.) */
@@ -986,7 +982,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,if (!hostdata->selecting) {/* Command was aborted */ NCR5380_write (MODE_REG ,MR_BASE ); -return NULL ; +return false; }if (err <0 ) {NCR5380_write (MODE_REG ,MR_BASE );
@@ -1035,7 +1031,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,if (!hostdata->selecting) {NCR5380_write (MODE_REG ,MR_BASE );NCR5380_write (INITIATOR_COMMAND_REG ,ICR_BASE ); -return NULL ; +return false; }dsprintk (NDEBUG_ARBITRATION , instance,"won arbitration\n" );
@@ -1118,13 +1114,13 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,/* Can't touch cmd if it has been reclaimed by the scsi ML */ if (!hostdata->selecting) -return NULL ; +return false; cmd->result =DID_BAD_TARGET <<16 ;complete_cmd (instance, cmd);dsprintk (NDEBUG_SELECTION , instance,"target did not respond within 250ms\n" ); - cmd =NULL ; + ret = false; goto out; }
@@ -1156,7 +1152,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance, }if (!hostdata->selecting) {do_abort (instance); -return NULL ; +return false; } dsprintk(NDEBUG_SELECTION, instance, "target %d selected, going into MESSAGE OUT phase.\n",
@@ -1172,7 +1168,7 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance, cmd->result =DID_ERROR <<16 ;complete_cmd (instance, cmd);dsprintk (NDEBUG_SELECTION , instance,"IDENTIFY message transfer failed\n" ); - cmd =NULL ; + ret = false; goto out; }
@@ -1187,13 +1183,13 @@ static struct scsi_cmnd *NCR5380_select(struct Scsi_Host *instance,initialize_SCp (cmd); - cmd =NULL ; + ret = false; out:if (!hostdata->selecting)return NULL ; hostdata->selecting =NULL ; -return cmd; +return ret; }/*
drivers/scsi/NCR5380.h +1 -1
@@ -275,7 +275,7 @@ static irqreturn_t NCR5380_intr(int irq, void *dev_id);static void NCR5380_main (struct work_struct *work);static const char *NCR5380_info (struct Scsi_Host *instance);static void NCR5380_reselect (struct Scsi_Host *instance); -static struct scsi_cmnd *NCR5380_select (struct Scsi_Host *,struct scsi_cmnd *); +static bool NCR5380_select (struct Scsi_Host *,struct scsi_cmnd *);static int NCR5380_transfer_dma (struct Scsi_Host *instance,unsigned char *phase,int *count,unsigned char **data);static int NCR5380_transfer_pio (struct Scsi_Host *instance,unsigned char *phase,int *count,unsigned char **data); static int NCR5380_poll_politely2(struct NCR5380_hostdata *,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 68/109 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 99/109 scsi: NCR5380: Check for bus reset
In reply to Sasha LevinFrom: Finn Thain <[email protected]>
[ Upstream commit 6b0e87a6aafe12d75c2bea6fc8e49e88b98b3083 ]
The SR_RST bit isn't latched. Hence, detecting a bus reset isn't reliable. When it is detected, the right thing to do is to drop all connected and disconnected commands. The code for that is already present so refactor it and call it when SR_RST is set.
--- drivers/scsi/NCR5380.c | 74 +++++++++++++++++++++++++----------------- 1 file changed, 45 insertions(+), 29 deletions(-)
drivers/scsi/NCR5380.c +45 -29
@@ -131,6 +131,7 @@static int do_abort (struct Scsi_Host *);static void do_reset (struct Scsi_Host *); +static void bus_reset_cleanup (struct Scsi_Host *);/** * initialize_SCp - init the scsi pointer field
@@ -885,7 +886,14 @@ static irqreturn_t __maybe_unused NCR5380_intr(int irq, void *dev_id)/* Probably Bus Reset */ NCR5380_read (RESET_PARITY_INTERRUPT_REG ); -dsprintk (NDEBUG_INTR , instance,"unknown interrupt\n" ); +if (sr &SR_RST ) { +/* Certainly Bus Reset */ +shost_printk (KERN_WARNING , instance, +"bus reset interrupt\n" ); +bus_reset_cleanup (instance); + }else { +dsprintk (NDEBUG_INTR , instance,"unknown interrupt\n" ); + }#ifdef SUN3_SCSI_VME dregs->csr |=CSR_DMA_ENABLE ;#endif
@@ -2303,31 +2311,12 @@ static int NCR5380_abort(struct scsi_cmnd *cmd) } -/** -* NCR5380_host_reset - reset the SCSI host -* @cmd: SCSI command undergoing EH -* -* Returns SUCCESS -*/ - -static int NCR5380_host_reset (struct scsi_cmnd *cmd) +static void bus_reset_cleanup (struct Scsi_Host *instance) { -struct Scsi_Host *instance = cmd->device->host;struct NCR5380_hostdata *hostdata =shost_priv (instance);int i; -unsigned long flags;struct NCR5380_cmd *ncmd; -spin_lock_irqsave (&hostdata->lock, flags); - -#if (NDEBUG &NDEBUG_ANY ) -shost_printk (KERN_INFO , instance, __func__); -#endif -NCR5380_dprint (NDEBUG_ANY , instance); -NCR5380_dprint_phase (NDEBUG_ANY , instance); - -do_reset (instance); -/* reset NCR registers */ NCR5380_write (MODE_REG ,MR_BASE );NCR5380_write (TARGET_COMMAND_REG ,0 );
@@ -2339,14 +2328,6 @@ static int NCR5380_host_reset(struct scsi_cmnd *cmd)* commands! */ -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 ;complete_cmd (instance, hostdata->selecting);
@@ -2380,6 +2361,41 @@ static int NCR5380_host_reset(struct scsi_cmnd *cmd)queue_work (hostdata->work_q, &hostdata->main_task);maybe_release_dma_irq (instance); +} + +/** +* NCR5380_host_reset - reset the SCSI host +* @cmd: SCSI command undergoing EH +* +* Returns SUCCESS +*/ + +static int NCR5380_host_reset (struct scsi_cmnd *cmd) +{ +struct Scsi_Host *instance = cmd->device->host; +struct NCR5380_hostdata *hostdata =shost_priv (instance); +unsigned long flags; +struct NCR5380_cmd *ncmd; + +spin_lock_irqsave (&hostdata->lock, flags); + +#if (NDEBUG &NDEBUG_ANY ) +shost_printk (KERN_INFO , instance, __func__); +#endif +NCR5380_dprint (NDEBUG_ANY , instance); +NCR5380_dprint_phase (NDEBUG_ANY , instance); + +list_for_each_entry (ncmd, &hostdata->unissued, list) { +struct scsi_cmnd *scmd =NCR5380_to_scmd (ncmd); + + scmd->result =DID_RESET <<16 ; + scmd->scsi_done (scmd); + } +INIT_LIST_HEAD (&hostdata->unissued); + +do_reset (instance); +bus_reset_cleanup (instance); +spin_unlock_irqrestore (&hostdata->lock, flags);return SUCCESS ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 59/109 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/ti/phy-twl4030-usb.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+)
drivers/phy/ti/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
@@ -395,6 +396,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);
@@ -655,6 +683,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 83/109 Bluetooth: hci_serdev: clear HCI_UART_PROTO_READY to avoid closing proto races
In reply to Sasha LevinFrom: Balakrishna Godavarthi <[email protected]>
[ Upstream commit 7cf7846d27bfc9731e449857db3eec5e0e9701ba ]
Clearing HCI_UART_PROTO_READY will avoid usage of proto function pointers before running the proto close function pointer. There is chance of kernel crash, due to usage of non proto close function pointers after proto close.
--- drivers/bluetooth/hci_serdev.c | 1 + 1 file changed, 1 insertion(+)
drivers/bluetooth/hci_serdev.c +1 -0
@@ -360,6 +360,7 @@ void hci_uart_unregister_device(struct hci_uart *hu) {struct hci_dev *hdev = hu->hdev; +clear_bit (HCI_UART_PROTO_READY , &hu->flags);hci_unregister_dev (hdev);hci_free_dev (hdev);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 90/109 iwlwifi: mvm: Allow TKIP for AP mode
In reply to Sasha LevinFrom: Ilan Peer <[email protected]>
[ Upstream commit 6f3df8c1192c873a6ad9a76328920f6f85af90a8 ]
Support for setting keys for TKIP cipher suite was mistakenly removed for AP mode. Fix this.
--- drivers/net/wireless/intel/iwlwifi/mvm/sta.c | 4 ---- 1 file changed, 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/sta.c +0 -4
@@ -3067,10 +3067,6 @@ static int __iwl_mvm_set_sta_key(struct iwl_mvm *mvm,switch (keyconf->cipher) {case WLAN_CIPHER_SUITE_TKIP : -if (vif->type ==NL80211_IFTYPE_AP ) { - ret = -EINVAL ; -break ; - } addr =iwl_mvm_get_mac_addr (mvm, vif, sta);/* get phase 1 key from mac80211 */ ieee80211_get_key_rx_seq (keyconf,0 , &seq);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 94/109 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
@@ -513,11 +513,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 ; }
@@ -2271,7 +2272,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); }
@@ -2350,7 +2350,6 @@ static int NCR5380_host_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 86/109 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
@@ -323,7 +323,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;
@@ -569,7 +569,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 72/109 phy: lantiq: Fix compile warning
In reply to Sasha LevinFrom: Hauke Mehrtens <[email protected]>
[ Upstream commit 3a00dae006623d799266d85f28b5f76ef07d6b6c ]
This local variable is unused, remove it.
--- drivers/phy/lantiq/phy-lantiq-rcu-usb2.c | 1 - 1 file changed, 1 deletion(-)
drivers/phy/lantiq/phy-lantiq-rcu-usb2.c +0 -1
@@ -156,7 +156,6 @@ static int ltq_rcu_usb2_of_parse(struct ltq_rcu_usb2_priv *priv, {struct device *dev = priv->dev;const __be32 *offset; -int ret; priv->reg_bits =of_device_get_match_data (dev);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 60/109 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 66/109 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
@@ -442,10 +442,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 55/109 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
@@ -765,6 +765,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);
@@ -802,6 +803,8 @@ static void 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 50/109 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 51/109 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
@@ -632,7 +632,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__);mutex_unlock (&dev->lock); goto done;
@@ -641,7 +641,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 48/109 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 43/109 net: phy: mdio-bcm-unimac: Allow configuring MDIO clock divider
In reply to Sasha LevinFrom: Florian Fainelli <[email protected]>
[ Upstream commit b78ac6ecd1b6b46f8767cbafa95a7b0b51b87ad8 ]
Allow the configuration of the MDIO clock divider when the Device Tree contains 'clock-frequency' property (similar to I2C and SPI buses). Because the hardware may have lost its state during suspend/resume, re-apply the MDIO clock divider upon resumption.
--- .../bindings/net/brcm,unimac-mdio.txt | 3 + drivers/net/phy/mdio-bcm-unimac.c | 83 ++++++++++++++++++- 2 files changed, 84 insertions(+), 2 deletions(-)
Documentation/devicetree/bindings/net/brcm,unimac-mdio.txt +3 -0
@@ -19,6 +19,9 @@ Optional properties: - interrupt-names: must be "mdio_done_error" when there is a share interrupt fed to this hardware block, or must be "mdio_done" for the first interrupt and "mdio_error" for the second when there are separate interrupts +- clocks: A reference to the clock supplying the MDIO bus controller +- clock-frequency: the MDIO bus clock that must be output by the MDIO bus + hardware, if absent, the default hardware values are used Child nodes of this MDIO bus controller node are standard Ethernet PHY device nodes as described in Documentation/devicetree/bindings/net/phy.txt
drivers/net/phy/mdio-bcm-unimac.c +81 -2
130 lines not on this page · raw message
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 42/109 samples/bpf: fix compilation failure
In reply to Sasha LevinFrom: Prashant Bhole <[email protected]>
[ Upstream commit 32c009798385ce21080beaa87a9b95faad3acd1e ]
following commit:
commit d58e468b1112 ("flow_dissector: implements flow dissector BPF hook") added struct bpf_flow_keys which conflicts with the struct with same name in sockex2_kern.c and sockex3_kern.c
similar to commit:
commit 534e0e52bc23 ("samples/bpf: fix a compilation failure") we tried the rename it "flow_keys" but it also conflicted with struct having same name in include/net/flow_dissector.h. Hence renaming the struct to "flow_key_record". Also, this commit doesn't fix the compilation error completely because the similar struct is present in sockex3_kern.c. Hence renaming it in both files sockex3_user.c and sockex3_kern.c
--- samples/bpf/sockex2_kern.c | 11 ++++++----- samples/bpf/sockex3_kern.c | 8 ++++---- samples/bpf/sockex3_user.c | 4 ++-- 3 files changed, 12 insertions(+), 11 deletions(-)
samples/bpf/sockex2_kern.c +6 -5
@@ -14,7 +14,7 @@ struct vlan_hdr {__be16 h_vlan_encapsulated_proto; }; -struct bpf_flow_keys { +struct flow_key_record {__be32 src;__be32 dst;union {
@@ -59,7 +59,7 @@ static inline __u32 ipv6_addr_hash(struct __sk_buff *ctx, __u64 off) }static inline __u64 parse_ip (struct __sk_buff *skb,__u64 nhoff,__u64 *ip_proto, -struct bpf_flow_keys *flow) +struct flow_key_record *flow) {__u64 verlen;
@@ -83,7 +83,7 @@ static inline __u64 parse_ip(struct __sk_buff *skb, __u64 nhoff, __u64 *ip_proto }static inline __u64 parse_ipv6 (struct __sk_buff *skb,__u64 nhoff,__u64 *ip_proto, -struct bpf_flow_keys *flow) +struct flow_key_record *flow) { *ip_proto =load_byte (skb, nhoff + offsetof(struct ipv6hdr , nexthdr));
@@ -96,7 +96,8 @@ static inline __u64 parse_ipv6(struct __sk_buff *skb, __u64 nhoff, __u64 *ip_proreturn nhoff; } -static inline bool flow_dissector (struct __sk_buff *skb,struct bpf_flow_keys *flow) +static inline bool flow_dissector (struct __sk_buff *skb, +struct flow_key_record *flow) {__u64 nhoff =ETH_HLEN ;__u64 ip_proto;
@@ -198,7 +199,7 @@ struct bpf_map_def SEC("maps") hash_map = { SEC("socket2")int bpf_prog2 (struct __sk_buff *skb) { -struct bpf_flow_keys flow = {}; +struct flow_key_record flow = {};struct pair *value;u32 key;
samples/bpf/sockex3_kern.c +4 -4
@@ -61,7 +61,7 @@ struct vlan_hdr {__be16 h_vlan_encapsulated_proto; }; -struct bpf_flow_keys { +struct flow_key_record {__be32 src;__be32 dst;union {
@@ -88,7 +88,7 @@ static inline __u32 ipv6_addr_hash(struct __sk_buff *ctx, __u64 off) }struct globals { -struct bpf_flow_keys flow; +struct flow_key_record flow; }; struct bpf_map_def SEC("maps") percpu_map = {
@@ -114,14 +114,14 @@ struct pair { struct bpf_map_def SEC("maps") hash_map = { .type = BPF_MAP_TYPE_HASH, - .key_size = sizeof(struct bpf_flow_keys), + .key_size = sizeof(struct flow_key_record), .value_size = sizeof(struct pair), .max_entries = 1024, };static void update_stats (struct __sk_buff *skb,struct globals *g) { -struct bpf_flow_keys key = g->flow; +struct flow_key_record key = g->flow;struct pair *value; value =bpf_map_lookup_elem (&hash_map, &key);
samples/bpf/sockex3_user.c +2 -2
@@ -13,7 +13,7 @@#define PARSE_IP_PROG_FD (prog_fd[0])#define PROG_ARRAY_FD (map_fd[0]) -struct flow_keys { +struct flow_key_record {__be32 src;__be32 dst;union {
@@ -64,7 +64,7 @@ int main(int argc, char **argv) (void ) f;for (i =0 ; i <5 ; i++) { -struct flow_keys key = {}, next_key; +struct flow_key_record key = {}, next_key;struct pair value;sleep (1 );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 39/109 x86/mce-inject: Reset injection struct after injection
In reply to Sasha LevinFrom: Borislav Petkov <[email protected]>
[ Upstream commit 7401a633c34adc7aefd3edfec60074cb0475a3e8 ]
Clear the MCE struct which is used for collecting the injection details after injection.
Also, populate it with more details from the machine.
--- arch/x86/kernel/cpu/mcheck/mce-inject.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/x86/kernel/cpu/mcheck/mce-inject.c +6 -0
@@ -108,6 +108,9 @@ static void setup_inj_struct(struct mce *m)memset (m,0 ,sizeof (struct mce )); m->cpuvendor = boot_cpu_data.x86_vendor; + m->time =ktime_get_real_seconds (); + m->cpuid =cpuid_eax (1 ); + m->microcode = boot_cpu_data.microcode; }/* Update fake mce registers on current CPU. */
@@ -576,6 +579,9 @@ static int inj_bank_set(void *data, u64 val) m->bank = val;do_inject (); +/* Reset injection struct */ +setup_inj_struct (&i_mce); +return 0 ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 34/109 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
@@ -878,7 +878,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>;
@@ -892,7 +892,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
@@ -376,7 +376,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
@@ -442,7 +442,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 32/109 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
@@ -197,7 +197,7 @@ <0xa0410100 0x100>; }; - scu@a04100000 { + scu@a0410000 { compatible = "arm,cortex-a9-scu"; reg = <0xa0410000 0x100>; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 33/109 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 28/109 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 27/109 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
@@ -343,6 +343,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 25/109 net: hns3: Fix parameter type for q_id in hclge_tm_q_to_qs_map_cfg()
In reply to Sasha LevinFrom: Jian Shen <[email protected]>
[ Upstream commit 32c7fbc8ffd752c6aa05d2dd7c13b0f0aa00ddaa ]
So far all the places calling hclge_tm_q_to_qs_map_cfg() are assigning an u16 type value to "q_id", and in the processing of hclge_tm_q_to_qs_map_cfg(), it also converts the "q_id" to le16.
The max tqp number for pf can be more than 256, we should use "u16" to store the queue id, instead of "u8", which may cause data lost.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_tm.c +1 -1
@@ -200,7 +200,7 @@ static int hclge_tm_qs_to_pri_map_cfg(struct hclge_dev *hdev, }static int hclge_tm_q_to_qs_map_cfg (struct hclge_dev *hdev, -u8 q_id,u16 qs_id) +u16 q_id,u16 qs_id) {struct hclge_nq_to_qs_link_cmd *map;struct hclge_desc desc;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 23/109 net: sun: fix return type of ndo_start_xmit function
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit 0e0cc31f6999df18bb5cfd0bd83c892ed5633975 ]
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, but the implementation in this driver returns an 'int'.
Found by coccinelle.
--- drivers/net/ethernet/sun/ldmvsw.c | 2 +- drivers/net/ethernet/sun/sunbmac.c | 3 ++- drivers/net/ethernet/sun/sunqe.c | 2 +- drivers/net/ethernet/sun/sunvnet.c | 2 +- drivers/net/ethernet/sun/sunvnet_common.c | 14 ++++++++------ drivers/net/ethernet/sun/sunvnet_common.h | 7 ++++--- 6 files changed, 17 insertions(+), 13 deletions(-)
drivers/net/ethernet/sun/ldmvsw.c +1 -1
@@ -111,7 +111,7 @@ static u16 vsw_select_queue(struct net_device *dev, struct sk_buff *skb, }/* Wrappers to common functions */ -static int vsw_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t vsw_start_xmit (struct sk_buff *skb,struct net_device *dev) {return sunvnet_start_xmit_common (skb, dev, vsw_tx_port_find); }
drivers/net/ethernet/sun/sunbmac.c +2 -1
@@ -951,7 +951,8 @@ static void bigmac_tx_timeout(struct net_device *dev) }/* Put a packet on the wire. */ -static int bigmac_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t +bigmac_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct bigmac *bp =netdev_priv (dev);int len, entry;
drivers/net/ethernet/sun/sunqe.c +1 -1
@@ -569,7 +569,7 @@ static void qe_tx_timeout(struct net_device *dev) }/* Get a packet queued to go onto the wire. */ -static int qe_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t qe_start_xmit (struct sk_buff *skb,struct net_device *dev) {struct sunqe *qep =netdev_priv (dev);struct sunqe_buffers *qbufs = qep->buffers;
drivers/net/ethernet/sun/sunvnet.c +1 -1
@@ -245,7 +245,7 @@ static u16 vnet_select_queue(struct net_device *dev, struct sk_buff *skb, }/* Wrappers to common functions */ -static int vnet_start_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t vnet_start_xmit (struct sk_buff *skb,struct net_device *dev) {return sunvnet_start_xmit_common (skb, dev, vnet_tx_port_find); }
drivers/net/ethernet/sun/sunvnet_common.c +8 -6
@@ -1215,9 +1215,10 @@ static inline struct sk_buff *vnet_skb_shape(struct sk_buff *skb, int ncookies)return skb; } -static int vnet_handle_offloads (struct vnet_port *port,struct sk_buff *skb, -struct vnet_port *(*vnet_tx_port) - (struct sk_buff *,struct net_device *)) +static netdev_tx_t +vnet_handle_offloads (struct vnet_port *port,struct sk_buff *skb, +struct vnet_port *(*vnet_tx_port) + (struct sk_buff *,struct net_device *)) {struct net_device *dev =VNET_PORT_TO_NET_DEVICE (port);struct vio_dring_state *dr = &port->vio.drings[VIO_DRIVER_TX_RING ];
@@ -1320,9 +1321,10 @@ static int vnet_handle_offloads(struct vnet_port *port, struct sk_buff *skb,return NETDEV_TX_OK ; } -int sunvnet_start_xmit_common (struct sk_buff *skb,struct net_device *dev, -struct vnet_port *(*vnet_tx_port) - (struct sk_buff *,struct net_device *)) +netdev_tx_t +sunvnet_start_xmit_common (struct sk_buff *skb,struct net_device *dev, +struct vnet_port *(*vnet_tx_port) + (struct sk_buff *,struct net_device *)) {struct vnet_port *port =NULL ;struct vio_dring_state *dr;
drivers/net/ethernet/sun/sunvnet_common.h +4 -3
@@ -136,9 +136,10 @@ int sunvnet_close_common(struct net_device *dev);void sunvnet_set_rx_mode_common (struct net_device *dev,struct vnet *vp);int sunvnet_set_mac_addr_common (struct net_device *dev,void *p);void sunvnet_tx_timeout_common (struct net_device *dev); -int sunvnet_start_xmit_common (struct sk_buff *skb,struct net_device *dev, -struct vnet_port *(*vnet_tx_port) - (struct sk_buff *,struct net_device *)); +netdev_tx_t +sunvnet_start_xmit_common (struct sk_buff *skb,struct net_device *dev, +struct vnet_port *(*vnet_tx_port) + (struct sk_buff *,struct net_device *));#ifdef CONFIG_NET_POLL_CONTROLLER void sunvnet_poll_controller_common (struct net_device *dev,struct vnet *vp);#endif
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 13/109 powerpc: Fix duplicate const clang warning in user access code
In reply to Sasha LevinFrom: Anton Blanchard <[email protected]>
[ Upstream commit e00d93ac9a189673028ac125a74b9bc8ae73eebc ]
This re-applies commit b91c1e3e7a6f ("powerpc: Fix duplicate const
clang warning in user access code") (Jun 2015) which was undone in
commits:
f2ca80905929 ("powerpc/sparse: Constify the address pointer in __get_user_nosleep()") (Feb 2017) d466f6c5cac1 ("powerpc/sparse: Constify the address pointer in __get_user_nocheck()") (Feb 2017) f84ed59a612d ("powerpc/sparse: Constify the address pointer in __get_user_check()") (Feb 2017)
We see a large number of duplicate const errors in the user access code when building with llvm/clang:
include/linux/pagemap.h:576:8: warning: duplicate 'const' declaration specifier [-Wduplicate-decl-specifier]
ret = __get_user(c, uaddr);
The problem is we are doing const __typeof__(*(ptr)), which will hit the warning if ptr is marked const.
Removing const does not seem to have any effect on GCC code generation.
--- arch/powerpc/include/asm/uaccess.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
arch/powerpc/include/asm/uaccess.h +3 -3
@@ -234,7 +234,7 @@ do { \ ({ \ long __gu_err; \ __long_type(*(ptr)) __gu_val; \ - const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ + __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ __chk_user_ptr(ptr); \ if (!is_kernel_addr((unsigned long)__gu_addr)) \ might_fault(); \
@@ -248,7 +248,7 @@ do { \ ({ \ long __gu_err = -EFAULT; \ __long_type(*(ptr)) __gu_val = 0; \ - const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ + __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ might_fault(); \ if (access_ok(VERIFY_READ, __gu_addr, (size))) { \ barrier_nospec(); \
@@ -262,7 +262,7 @@ do { \ ({ \ long __gu_err; \ __long_type(*(ptr)) __gu_val; \ - const __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ + __typeof__(*(ptr)) __user *__gu_addr = (ptr); \ __chk_user_ptr(ptr); \ barrier_nospec(); \ __get_user_size(__gu_val, __gu_addr, (size), __gu_err); \
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 10/109 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
@@ -785,9 +785,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 19/109 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_setup_netdev (struct net_device *netdev,struct gelic_card *card);
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);
@@ -1248,7 +1249,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 18/109 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
@@ -440,6 +440,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;
@@ -453,14 +454,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 9/109 net: hns3: fix return type of ndo_start_xmit function
In reply to Sasha LevinFrom: YueHaibing <[email protected]>
[ Upstream commit c9c3941186c5637caed131c4f4064411d6882299 ]
The method ndo_start_xmit() is defined as returning an 'netdev_tx_t', which is a typedef for an enum type, also the implementation in this driver has returns 'netdev_tx_t' value, so just change the function return type to netdev_tx_t.
Found by coccinelle.
--- drivers/net/ethernet/hisilicon/hip04_eth.c | 3 ++- drivers/net/ethernet/hisilicon/hix5hd2_gmac.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-)
drivers/net/ethernet/hisilicon/hip04_eth.c +2 -1
@@ -423,7 +423,8 @@ static void hip04_start_tx_timer(struct hip04_priv *priv) ns, HRTIMER_MODE_REL); } -static int hip04_mac_start_xmit (struct sk_buff *skb,struct net_device *ndev) +static netdev_tx_t +hip04_mac_start_xmit (struct sk_buff *skb,struct net_device *ndev) {struct hip04_priv *priv =netdev_priv (ndev);struct net_device_stats *stats = &ndev->stats;
drivers/net/ethernet/hisilicon/hix5hd2_gmac.c +1 -1
@@ -736,7 +736,7 @@ static int hix5hd2_fill_sg_desc(struct hix5hd2_priv *priv,return 0 ; } -static int hix5hd2_net_xmit (struct sk_buff *skb,struct net_device *dev) +static netdev_tx_t hix5hd2_net_xmit (struct sk_buff *skb,struct net_device *dev) {struct hix5hd2_priv *priv =netdev_priv (dev);struct hix5hd2_desc *desc;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 8/109 ipmi:dmi: Ignore IPMI SMBIOS entries with a zero base address
In reply to Sasha LevinFrom: Corey Minyard <[email protected]>
[ Upstream commit 1574608f5f4204440d6d9f52b971aba967664764 ]
Looking at logs from systems all over the place, it looks like tons of broken systems exist that set the base address to zero. I can only guess that is some sort of non-standard idea to mark the interface as not being present. It can't be zero, anyway, so just complain and ignore it.
--- drivers/char/ipmi/ipmi_dmi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/char/ipmi/ipmi_dmi.c +4 -0
@@ -197,6 +197,10 @@ static void __init dmi_decode_ipmi(const struct dmi_header *dm) slave_addr = data[DMI_IPMI_SLAVEADDR ];memcpy (&base_addr, data +DMI_IPMI_ADDR ,sizeof (unsigned long )); +if (!base_addr) { +pr_err ("Base address is zero, assuming no IPMI interface\n" ); +return ; + }if (len >=DMI_IPMI_VER2_LENGTH ) {if (type ==IPMI_DMI_TYPE_SSIF ) { offset =0 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 5/109 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
@@ -1638,8 +1638,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