iio: dac: mcp4922: fix error handling in mcp4922_write_raw
Subsystems (11)
Sasha Levin
maintainerPATCH 1/44 iio: dac: mcp4922: fix error handling in mcp4922_write_raw
From: Marcus Folkesson <[email protected]>
[ Upstream commit 0833627fc3f757a0dca11e2a9c46c96335a900ee ]
Do not try to write negative values and make sure that the write goes well.
--- drivers/iio/dac/mcp4922.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/iio/dac/mcp4922.c +8 -3
@@ -94,17 +94,22 @@ static int mcp4922_write_raw(struct iio_dev *indio_dev, long mask) {struct mcp4922_state *state =iio_priv (indio_dev); +int ret;if (val2 !=0 )return -EINVAL ;switch (mask) {case IIO_CHAN_INFO_RAW : -if (val >GENMASK (chan->scan_type.realbits-1 ,0 )) +if (val <0 || val >GENMASK (chan->scan_type.realbits -1 ,0 ))return -EINVAL ; val <<= chan->scan_type.shift; - state->value[chan->channel] = val; -return mcp4922_spi_write (state, chan->channel, val); + + ret =mcp4922_spi_write (state, chan->channel, val); +if (!ret) + state->value[chan->channel] = val; +return ret; +default :return -EINVAL ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 2/44 ALSA: pcm: signedness bug in snd_pcm_plug_alloc()
From: Dan Carpenter <[email protected]>
[ Upstream commit 6f128fa41f310e1f39ebcea9621d2905549ecf52 ]
The "frames" variable is unsigned so the error handling doesn't work properly.
--- sound/core/oss/pcm_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/core/oss/pcm_plugin.c +2 -2
@@ -111,7 +111,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)while (plugin->next) {if (plugin->dst_frames) frames = plugin->dst_frames (plugin, frames); -if (snd_BUG_ON (frames <=0 )) +if (snd_BUG_ON ((snd_pcm_sframes_t )frames <=0 ))return -ENXIO ; plugin = plugin->next; err =snd_pcm_plugin_alloc (plugin, frames);
@@ -123,7 +123,7 @@ int snd_pcm_plug_alloc(struct snd_pcm_substream *plug, snd_pcm_uframes_t frames)while (plugin->prev) {if (plugin->src_frames) frames = plugin->src_frames (plugin, frames); -if (snd_BUG_ON (frames <=0 )) +if (snd_BUG_ON ((snd_pcm_sframes_t )frames <=0 ))return -ENXIO ; plugin = plugin->prev; err =snd_pcm_plugin_alloc (plugin, frames);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 3/44 ARM: dts: at91/trivial: Fix USART1 definition for at91sam9g45
In reply to Sasha LevinFrom: Jay Foster <[email protected]>
[ Upstream commit 10af10db8c76fa5b9bf1f52a895c1cb2c0ac24da ]
Fix a typo. No functional change made by this patch.
--- arch/arm/boot/dts/at91sam9g45.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/at91sam9g45.dtsi +1 -1
@@ -546,7 +546,7 @@ }; }; - uart1 { + usart1 { pinctrl_usart1: usart1-0 { atmel,pins = <AT91_PIOB 4 AT91_PERIPH_A AT91_PINCTRL_PULL_UP /* PB4 periph A with pullup */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 4/44 ALSA: seq: Do error checks at creating system ports
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit b8e131542b47b81236ecf6768c923128e1f5db6e ]
snd_seq_system_client_init() doesn't check the errors returned from its port creations. Let's do it properly and handle the error paths.
--- sound/core/seq/seq_system.c | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-)
sound/core/seq/seq_system.c +15 -3
@@ -123,6 +123,7 @@ int __init snd_seq_system_client_init(void) {struct snd_seq_port_callback pcallbacks;struct snd_seq_port_info *port; +int err; port =kzalloc (sizeof (*port),GFP_KERNEL );if (!port)
@@ -144,7 +145,10 @@ int __init snd_seq_system_client_init(void) port->flags =SNDRV_SEQ_PORT_FLG_GIVEN_PORT ; port->addr.client = sysclient; port->addr.port =SNDRV_SEQ_PORT_SYSTEM_TIMER ; -snd_seq_kernel_client_ctl (sysclient,SNDRV_SEQ_IOCTL_CREATE_PORT , port); + err =snd_seq_kernel_client_ctl (sysclient,SNDRV_SEQ_IOCTL_CREATE_PORT , + port); +if (err <0 ) + goto error_port;/* register announcement port */ strcpy (port->name,"Announce" );
@@ -154,16 +158,24 @@ int __init snd_seq_system_client_init(void) port->flags =SNDRV_SEQ_PORT_FLG_GIVEN_PORT ; port->addr.client = sysclient; port->addr.port =SNDRV_SEQ_PORT_SYSTEM_ANNOUNCE ; -snd_seq_kernel_client_ctl (sysclient,SNDRV_SEQ_IOCTL_CREATE_PORT , port); + err =snd_seq_kernel_client_ctl (sysclient,SNDRV_SEQ_IOCTL_CREATE_PORT , + port); +if (err <0 ) + goto error_port; announce_port = port->addr.port;kfree (port);return 0 ; + + error_port: +snd_seq_system_client_done (); +kfree (port); +return err; }/* unregister our internal client */ -void __exit snd_seq_system_client_done(void) +void snd_seq_system_client_done (void ) {int oldsysclient = sysclient;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 5/44 gfs2: Don't set GFS2_RDF_UPTODATE when the lvb is updated
In reply to Sasha LevinFrom: Bob Peterson <[email protected]>
[ Upstream commit 4f36cb36c9d14340bb200d2ad9117b03ce992cfe ]
The GFS2_RDF_UPTODATE flag in the rgrp is used to determine when a rgrp buffer is valid. It's cleared when the glock is invalidated, signifying that the buffer data is now invalid. But before this patch, function update_rgrp_lvb was setting the flag when it determined it had a valid lvb. But that's an invalid assumption:
just because you have a valid lvb doesn't mean you have valid buffers. After all, another node may have made the lvb valid, and this node just fetched it from the glock via dlm.
Consider this scenario:
1. The file system is mounted with RGRPLVB option.
2. In gfs2_inplace_reserve it locks the rgrp glock EX, but thanks to GL_SKIP, it skips the gfs2_rgrp_bh_get.
3. Since loops == 0 and the allocation target (ap->target) is bigger than the largest known chunk of blocks in the rgrp (rs->rs_rbm.rgd->rd_extfail_pt) it skips that rgrp and bypasses the call to gfs2_rgrp_bh_get there as well.
4. update_rgrp_lvb sees the lvb MAGIC number is valid, so bypasses gfs2_rgrp_bh_get, but it still sets sets GFS2_RDF_UPTODATE due to this invalid assumption.
5. The next time update_rgrp_lvb is called, it sees the bit is set and just returns 0, assuming both the lvb and rgrp are both uptodate. But since this is a smaller allocation, or space has been freed by another node, thus adjusting the lvb values, it decides to use the rgrp for allocations, with invalid rd_free due to the fact it was never updated.
This patch changes update_rgrp_lvb so it doesn't set the UPTODATE flag anymore. That way, it has no choice but to fetch the latest values.
--- fs/gfs2/rgrp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/gfs2/rgrp.c +1 -1
@@ -1228,7 +1228,7 @@ static int update_rgrp_lvb(struct gfs2_rgrpd *rgd) rl_flags =be32_to_cpu (rgd->rd_rgl->rl_flags); rl_flags &= ~GFS2_RDF_MASK ; rgd->rd_flags &=GFS2_RDF_MASK ; - rgd->rd_flags |= (rl_flags |GFS2_RDF_UPTODATE |GFS2_RDF_CHECK ); + rgd->rd_flags |= (rl_flags |GFS2_RDF_CHECK );if (rgd->rd_rgl->rl_unlinked ==0 ) rgd->rd_flags &= ~GFS2_RDF_CHECK ; rgd->rd_free =be32_to_cpu (rgd->rd_rgl->rl_free);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 6/44 ASoC: dpcm: Properly initialise hw->rate_max
In reply to Sasha LevinFrom: Charles Keepax <[email protected]>
[ Upstream commit e33ffbd9cd39da09831ce62c11025d830bf78d9e ]
If the CPU DAI does not initialise rate_max, say if using using KNOT or CONTINUOUS, then the rate_max field will be initialised to 0. A value of zero in the rate_max field of the hardware runtime will cause the sound card to support no sample rates at all. Obviously this is not desired, just a different mechanism is being used to apply the constraints. As such update the setting of rate_max in dpcm_init_runtime_hw to be consistent with the non-DPCM cases and set rate_max to UINT_MAX if nothing is defined on the CPU DAI.
--- sound/soc/soc-pcm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/soc-pcm.c +1 -1
@@ -1541,7 +1541,7 @@ static void dpcm_init_runtime_hw(struct snd_pcm_runtime *runtime, u64 formats) { runtime->hw.rate_min = stream->rate_min; - runtime->hw.rate_max = stream->rate_max; + runtime->hw.rate_max =min_not_zero (stream->rate_max,UINT_MAX ); runtime->hw.channels_min = stream->channels_min; runtime->hw.channels_max = stream->channels_max;if (runtime->hw.formats)
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 7/44 MIPS: BCM47XX: Enable USB power on Netgear WNDR3400v3
In reply to Sasha LevinFrom: Tuomas Tynkkynen <[email protected]>
[ Upstream commit feef7918667b84f9d5653c501542dd8d84ae32af ]
Setting GPIO 21 high seems to be required to enable power to USB ports on the WNDR3400v3. As there is already similar code for WNR3500L, make the existing USB power GPIO code generic and use that.
Patchwork: https://patchwork.linux-mips.org/patch/20259/
--- arch/mips/bcm47xx/workarounds.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
arch/mips/bcm47xx/workarounds.c +5 -3
@@ -4,9 +4,8 @@#include <bcm47xx_board.h> #include <bcm47xx.h> -static void __init bcm47xx_workarounds_netgear_wnr3500l (void ) +static void __init bcm47xx_workarounds_enable_usb_power (int usb_power) { -const int usb_power =12 ;int err; err =gpio_request_one (usb_power,GPIOF_OUT_INIT_HIGH ,"usb_power" );
@@ -22,7 +21,10 @@ void __init bcm47xx_workarounds(void)switch (board) {case BCM47XX_BOARD_NETGEAR_WNR3500L : -bcm47xx_workarounds_netgear_wnr3500l (); +bcm47xx_workarounds_enable_usb_power (12 ); +break ; +case BCM47XX_BOARD_NETGEAR_WNDR3400_V3 : +bcm47xx_workarounds_enable_usb_power (21 );break ;default :/* No workaround(s) needed */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 8/44 ARM: dts: exynos: Fix sound in Snow-rev5 Chromebook
In reply to Sasha LevinFrom: Marek Szyprowski <[email protected]>
[ Upstream commit 64858773d78e820003a94e5a7179d368213655d6 ]
This patch adds missing properties to the CODEC and sound nodes, so the audio will work also on Snow rev5 Chromebook. This patch is an extension to the commit e9eefc3f8ce0 ("ARM: dts: exynos: Add missing clock and DAI properties to the max98095 node in Snow Chromebook")
and commit 6ab569936d60 ("ARM: dts: exynos: Enable HDMI audio on Snow Chromebook"). It has been reported that such changes work fine on the rev5 board too.
--- arch/arm/boot/dts/exynos5250-snow-rev5.dts | 11 +++++++++++ 1 file changed, 11 insertions(+)
arch/arm/boot/dts/exynos5250-snow-rev5.dts +11 -0
@@ -23,6 +23,14 @@ samsung,model = "Snow-I2S-MAX98090"; samsung,audio-codec = <&max98090>; + + cpu { + sound-dai = <&i2s0 0>; + }; + + codec { + sound-dai = <&max98090 0>, <&hdmi>; + }; }; };
@@ -34,6 +42,9 @@ interrupt-parent = <&gpx0>; pinctrl-names = "default"; pinctrl-0 = <&max98090_irq>; + clocks = <&pmu_system_controller 0>; + clock-names = "mclk"; + #sound-dai-cells = <1>; }; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 9/44 i40e: use correct length for strncpy
In reply to Sasha LevinFrom: Mitch Williams <[email protected]>
[ Upstream commit 7eb74ff891b4e94b8bac48f648a21e4b94ddee64 ]
Caught by GCC 8. When we provide a length for strncpy, we should not include the terminating null. So we must tell it one less than the size of the destination buffer.
--- drivers/net/ethernet/intel/i40e/i40e_ptp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/intel/i40e/i40e_ptp.c +2 -1
@@ -605,7 +605,8 @@ static long i40e_ptp_create_clock(struct i40e_pf *pf)if (!IS_ERR_OR_NULL (pf->ptp_clock))return 0 ; -strncpy (pf->ptp_caps.name, i40e_driver_name,sizeof (pf->ptp_caps.name)); +strncpy (pf->ptp_caps.name, i40e_driver_name, +sizeof (pf->ptp_caps.name) -1 ); pf->ptp_caps.owner =THIS_MODULE ; pf->ptp_caps.max_adj =999999999 ; pf->ptp_caps.n_ext_ts =0 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 10/44 i40e: hold the rtnl lock on clearing interrupt scheme
In reply to Sasha LevinFrom: Patryk Małek <[email protected]>
[ Upstream commit 5cba17b14182696d6bb0ec83a1d087933f252241 ]
Hold the rtnl lock when we're clearing interrupt scheme in i40e_shutdown and in i40e_remove.
--- drivers/net/ethernet/intel/i40e/i40e_main.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_main.c +8 -0
@@ -10828,6 +10828,7 @@ static void i40e_remove(struct pci_dev *pdev)mutex_destroy (&hw->aq.asq_mutex);/* Clear all dynamic memory lists of rings, q_vectors, and VSIs */ +rtnl_lock ();i40e_clear_interrupt_scheme (pf);for (i =0 ; i < pf->num_alloc_vsi; i++) {if (pf->vsi[i]) {
@@ -10836,6 +10837,7 @@ static void i40e_remove(struct pci_dev *pdev) pf->vsi[i] =NULL ; } } +rtnl_unlock ();for (i =0 ; i <I40E_MAX_VEB ; i++) {kfree (pf->veb[i]);
@@ -10982,7 +10984,13 @@ static void i40e_shutdown(struct pci_dev *pdev)wr32 (hw,I40E_PFPM_WUFC , (pf->wol_en ?I40E_PFPM_WUFC_MAG_MASK :0 )); +/* Since we're going to destroy queues during the +* i40e_clear_interrupt_scheme() we should hold the RTNL lock for this +* whole section +*/ +rtnl_lock ();i40e_clear_interrupt_scheme (pf); +rtnl_unlock ();if (system_state ==SYSTEM_POWER_OFF ) {pci_wake_from_d3 (pdev, pf->wol_en);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 11/44 i40e: Prevent deleting MAC address from VF when set by PF
In reply to Sasha LevinFrom: Patryk Małek <[email protected]>
[ Upstream commit 5907cf6c5bbe78be2ed18b875b316c6028b20634 ]
To prevent VF from deleting MAC address that was assigned by the PF we need to check for that scenario when we try to delete a MAC address from a VF.
--- drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
drivers/net/ethernet/intel/i40e/i40e_virtchnl_pf.c +10 -0
@@ -1677,6 +1677,16 @@ static int i40e_vc_del_mac_addr_msg(struct i40e_vf *vf, u8 *msg, u16 msglen) ret =I40E_ERR_INVALID_MAC_ADDR ; goto error_param; } + +if (vf->pf_set_mac && +ether_addr_equal (al->list[i].addr, + vf->default_lan_addr.addr)) { +dev_err (&pf->pdev->dev, +"MAC addr %pM has been set by PF, cannot delete it for VF %d, reset VF to change MAC addr\n" , + vf->default_lan_addr.addr, vf->vf_id); + ret =I40E_ERR_PARAM ; + goto error_param; + } } vsi = pf->vsi[vf->lan_vsi_idx];
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 12/44 ARM: dts: pxa: fix power i2c base address
In reply to Sasha LevinFrom: Marcel Ziswiler <[email protected]>
[ Upstream commit 8a1ecc01a473b75ab97be9b36f623e4551a6e9ae ]
There is one too many zeroes in the Power I2C base address. Fix this.
--- arch/arm/boot/dts/pxa27x.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/pxa27x.dtsi +1 -1
@@ -63,7 +63,7 @@ clocks = <&clks CLK_PWM1>; }; - pwri2c: i2c@40f000180 { + pwri2c: i2c@40f00180 { compatible = "mrvl,pxa-i2c"; reg = <0x40f00180 0x24>; interrupts = <6>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 13/44 rtl8187: Fix warning generated when strncpy() destination length matches the sixe argument
In reply to Sasha LevinFrom: Larry Finger <[email protected]>
[ Upstream commit 199ba9faca909e77ac533449ecd1248123ce89e7 ]
In gcc8, when the 3rd argument (size) of a call to strncpy() matches the length of the first argument, the compiler warns of the possibility of an unterminated string. Using strlcpy() forces a null at the end.
--- drivers/net/wireless/realtek/rtl818x/rtl8187/leds.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtl818x/rtl8187/leds.c +1 -1
@@ -146,7 +146,7 @@ static int rtl8187_register_led(struct ieee80211_hw *dev, led->dev = dev; led->ledpin = ledpin; led->is_radio = is_radio; -strncpy (led->name, name,sizeof (led->name)); +strlcpy (led->name, name,sizeof (led->name)); led->led_dev.name = led->name; led->led_dev.default_trigger = default_trigger;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 14/44 net: lan78xx: Bail out if lan78xx_get_endpoints fails
In reply to Sasha LevinFrom: Stefan Wahren <[email protected]>
[ Upstream commit fa8cd98c06407b5798b927cd7fd14d30f360ed02 ]
We need to bail out if lan78xx_get_endpoints() fails, otherwise the result is overwritten.
--- drivers/net/usb/lan78xx.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/usb/lan78xx.c +5 -0
@@ -2246,6 +2246,11 @@ static int lan78xx_bind(struct lan78xx_net *dev, struct usb_interface *intf)int i; ret =lan78xx_get_endpoints (dev, intf); +if (ret) { +netdev_warn (dev->net,"lan78xx_get_endpoints failed: %d\n" , + ret); +return ret; + } dev->data[0 ] = (unsigned long )kzalloc (sizeof (*pdata),GFP_KERNEL );
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 15/44 ASoC: sgtl5000: avoid division by zero if lo_vag is zero
In reply to Sasha LevinFrom: Colin Ian King <[email protected]>
[ Upstream commit 9ab708aef61f5620113269a9d1bdb1543d1207d0 ]
In the case where lo_vag <= SGTL5000_LINE_OUT_GND_BASE, lo_vag is set to zero and later vol_quot is computed by dividing by lo_vag causing a division by zero error. Fix this by avoiding a zero division and set vol_quot to zero in this specific case so that the lowest setting for i is correctly set.
--- sound/soc/codecs/sgtl5000.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/codecs/sgtl5000.c +1 -1
@@ -1415,7 +1415,7 @@ static int sgtl5000_set_power_regs(struct snd_soc_codec *codec)* Searching for a suitable index solving this formula: * idx = 40 * log10(vag_val / lo_cagcntrl) + 15 */ - vol_quot = (vag *100 ) / lo_vag; + vol_quot = lo_vag ? (vag *100 ) / lo_vag :0 ; lo_vol =0 ;for (i =0 ; i <ARRAY_SIZE (vol_quot_table); i++) {if (vol_quot >= vol_quot_table[i])
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 16/44 ARM: dts: exynos: Disable pull control for S5M8767 PMIC
In reply to Sasha LevinFrom: Marek Szyprowski <[email protected]>
[ Upstream commit ef2ecab9af5feae97c47b7f61cdd96f7f49b2c23 ]
S5M8767 PMIC interrupt line on Exynos5250-based Arndale board has external pull-up resistors, so disable any pull control for it in in controller node. This fixes support for S5M8767 interrupts and enables operation of wakeup from S5M8767 RTC alarm.
--- arch/arm/boot/dts/exynos5250-arndale.dts | 9 +++++++++ 1 file changed, 9 insertions(+)
arch/arm/boot/dts/exynos5250-arndale.dts +9 -0
@@ -170,6 +170,8 @@ reg = <0x66>; interrupt-parent = <&gpx3>; interrupts = <2 IRQ_TYPE_LEVEL_LOW>; + pinctrl-names = "default"; + pinctrl-0 = <&s5m8767_irq>; vinb1-supply = <&main_dc_reg>; vinb2-supply = <&main_dc_reg>;
@@ -552,6 +554,13 @@ cap-sd-highspeed; }; +&pinctrl_0 { + s5m8767_irq: s5m8767-irq { + samsung,pins = "gpx3-2"; + samsung,pin-pud = <EXYNOS_PIN_PULL_NONE>; + }; +}; + &rtc { status = "okay"; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 17/44 ath10k: wmi: disable softirq's while calling ieee80211_rx
In reply to Sasha LevinFrom: Erik Stromdahl <[email protected]>
[ Upstream commit 37f62c0d5822f631b786b29a1b1069ab714d1a28 ]
This is done in order not to trig the below warning in ieee80211_rx_napi:
WARN_ON_ONCE(softirq_count() == 0);
ieee80211_rx_napi requires that softirq's are disabled during execution.
The High latency bus drivers (SDIO and USB) sometimes call the wmi ep_rx_complete callback from non softirq context, resulting in a trigger of the above warning.
Calling ieee80211_rx_ni with softirq's already disabled (e.g., from softirq context) should be safe as the local_bh_disable and local_bh_enable functions (called from ieee80211_rx_ni) are fully reentrant.
--- drivers/net/wireless/ath/ath10k/wmi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath10k/wmi.c +2 -1
@@ -2294,7 +2294,8 @@ int ath10k_wmi_event_mgmt_rx(struct ath10k *ar, struct sk_buff *skb) status->freq, status->band, status->signal, status->rate_idx); -ieee80211_rx (ar->hw, skb); +ieee80211_rx_ni (ar->hw, skb); +return 0 ; }
Signature · 7 lines
2.20.1 _______________________________________________ ath10k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath10k
Sasha Levin
maintainerPATCH 18/44 mips: txx9: fix iounmap related issue
In reply to Sasha LevinFrom: Ding Xiang <[email protected]>
[ Upstream commit c6e1241a82e6e74d1ae5cc34581dab2ffd6022d0 ]
if device_register return error, iounmap should be called, also iounmap need to call before put_device.
Patchwork: https://patchwork.linux-mips.org/patch/20476/
--- arch/mips/txx9/generic/setup.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/mips/txx9/generic/setup.c +2 -3
@@ -961,12 +961,11 @@ void __init txx9_sramc_init(struct resource *r) goto exit_put; err =sysfs_create_bin_file (&dev->dev.kobj, &dev->bindata_attr);if (err) { -device_unregister (&dev->dev);iounmap (dev->base); -kfree (dev); +device_unregister (&dev->dev); }return ; exit_put: +iounmap (dev->base);put_device (&dev->dev); -return ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 19/44 of: make PowerMac cache node search conditional on CONFIG_PPC_PMAC
In reply to Sasha LevinFrom: Rob Herring <[email protected]>
[ Upstream commit f6707fd6241e483f6fea2caae82d876e422bb11a ]
Cache nodes under the cpu node(s) is PowerMac specific according to the comment above, so make the code enforce that.
--- drivers/of/base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/of/base.c +1 -1
@@ -2125,7 +2125,7 @@ struct device_node *of_find_next_cache_node(const struct device_node *np)/* OF on pmac has nodes instead of properties named "l2-cache" * beneath CPU nodes. */ -if (!strcmp (np->type,"cpu" )) +if (IS_ENABLED (CONFIG_PPC_PMAC ) && !strcmp (np->type,"cpu" ))for_each_child_of_node (np, child)if (!strcmp (child->type,"cache" ))return child;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 20/44 ARM: dts: omap3-gta04: give spi_lcd node a label so that we can overwrite in other DTS files
In reply to Sasha LevinFrom: "H. Nikolaus Schaller" <[email protected]>
[ Upstream commit fa0d7dc355c890725b6178dab0cc11b194203afa ]
needed for device variants based on GTA04 board but with different display panel (driver).
--- arch/arm/boot/dts/omap3-gta04.dtsi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/omap3-gta04.dtsi +1 -1
@@ -70,7 +70,7 @@ #sound-dai-cells = <0>; }; - spi_lcd { + spi_lcd: spi_lcd { compatible = "spi-gpio"; #address-cells = <0x1>; #size-cells = <0x0>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 21/44 ARM: dts: omap3-gta04: tvout: enable as display1 alias
In reply to Sasha LevinFrom: "H. Nikolaus Schaller" <[email protected]>
[ Upstream commit 8905592b6e50cec905e6c6035bbd36201a3bfac1 ]
The omap dss susbystem takes the display aliases to find out which displays exist. To enable tv-out we must define an alias.
--- arch/arm/boot/dts/omap3-gta04.dtsi | 1 + 1 file changed, 1 insertion(+)
arch/arm/boot/dts/omap3-gta04.dtsi +1 -0
@@ -28,6 +28,7 @@ aliases { display0 = &lcd; + display1 = &tv0; }; gpio-keys {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 22/44 ARM: dts: omap3-gta04: make NAND partitions compatible with recent U-Boot
In reply to Sasha LevinFrom: "H. Nikolaus Schaller" <[email protected]>
[ Upstream commit fa99c21ecb3cd4021a60d0e8bf880e78b5bd0729 ]
Vendor defined U-Boot has changed the partition scheme a while ago:
* kernel partition 6MB
* file system partition uses the remainder up to end of the NAND
* increased size of the environment partition (to get an OneNAND compatible base address)
* shrink the U-Boot partition
Let's be compatible (e.g. Debian kernel built from upstream).
--- arch/arm/boot/dts/omap3-gta04.dtsi | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
arch/arm/boot/dts/omap3-gta04.dtsi +6 -6
@@ -523,22 +523,22 @@ bootloaders@80000 { label = "U-Boot"; - reg = <0x80000 0x1e0000>; + reg = <0x80000 0x1c0000>; }; - bootloaders_env@260000 { + bootloaders_env@240000 { label = "U-Boot Env"; - reg = <0x260000 0x20000>; + reg = <0x240000 0x40000>; }; kernel@280000 { label = "Kernel"; - reg = <0x280000 0x400000>; + reg = <0x280000 0x600000>; }; - filesystem@680000 { + filesystem@880000 { label = "File System"; - reg = <0x680000 0xf980000>; + reg = <0x880000 0>; /* 0 = MTDPART_SIZ_FULL */ }; }; };
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 23/44 ARM: dts: omap3-gta04: keep vpll2 always on
In reply to Sasha LevinFrom: "H. Nikolaus Schaller" <[email protected]>
[ Upstream commit 1ae00833e30c9b4af5cbfda65d75b1de12f74013 ]
This is needed to make the display and venc work properly. Compare to omap3-beagle.dts.
--- arch/arm/boot/dts/omap3-gta04.dtsi | 6 ++++++ 1 file changed, 6 insertions(+)
arch/arm/boot/dts/omap3-gta04.dtsi +6 -0
@@ -460,6 +460,12 @@ regulator-max-microvolt = <3150000>; }; +/* Needed to power the DPI pins */ + +&vpll2 { + regulator-always-on; +}; + &dss { pinctrl-names = "default"; pinctrl-0 = < &dss_dpi_pins >;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 24/44 dmaengine: dma-jz4780: Further residue status fix
In reply to Sasha LevinFrom: Daniel Silsby <[email protected]>
[ Upstream commit 83ef4fb7556b6a673f755da670cbacab7e2c7f1b ]
Func jz4780_dma_desc_residue() expects the index to the next hw descriptor as its last parameter. Caller func jz4780_dma_tx_status(), however, applied modulus before passing it. When the current hw descriptor was last in the list, the index passed became zero.
The resulting excess of reported residue especially caused problems with cyclic DMA transfer clients, i.e. ALSA AIC audio output, which rely on this for determining current DMA location within buffer.
Combined with the recent and related residue-reporting fixes, spurious ALSA audio underruns on jz4770 hardware are now fixed.
--- drivers/dma/dma-jz4780.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/dma-jz4780.c +1 -1
@@ -576,7 +576,7 @@ static enum dma_status jz4780_dma_tx_status(struct dma_chan *chan, to_jz4780_dma_desc(vdesc), 0); }else if (cookie == jzchan->desc->vdesc.tx.cookie) { txstate->residue =jz4780_dma_desc_residue (jzchan, jzchan->desc, - (jzchan->curr_hwdesc +1 ) % jzchan->desc->count); + jzchan->curr_hwdesc +1 ); }else txstate->residue =0 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 25/44 signal: Always ignore SIGKILL and SIGSTOP sent to the global init
In reply to Sasha LevinFrom: "Eric W. Biederman" <[email protected]>
[ Upstream commit 86989c41b5ea08776c450cb759592532314a4ed6 ]
If the first process started (aka /sbin/init) receives a SIGKILL it will panic the system if it is delivered. Making the system unusable and undebugable. It isn't much better if the first process started receives SIGSTOP.
So always ignore SIGSTOP and SIGKILL sent to init.
This is done in a separate clause in sig_task_ignored as force_sig_info can clear SIG_UNKILLABLE and this protection should work even then.
--- kernel/signal.c | 4 ++++ 1 file changed, 4 insertions(+)
kernel/signal.c +4 -0
@@ -71,6 +71,10 @@ static int sig_task_ignored(struct task_struct *t, int sig, bool force) handler =sig_handler (t, sig); +/* SIGKILL and SIGSTOP may not be sent to the global init */ +if (unlikely (is_global_init (t) &&sig_kernel_only (sig))) +return true; +if (unlikely (t->signal->flags &SIGNAL_UNKILLABLE ) && handler ==SIG_DFL && !(force &&sig_kernel_only (sig)))return 1 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 26/44 signal: Properly deliver SIGILL from uprobes
In reply to Sasha LevinFrom: "Eric W. Biederman" <[email protected]>
[ Upstream commit 55a3235fc71bf34303e34a95eeee235b2d2a35dd ]
For userspace to tell the difference between a random signal and an exception, the exception must include siginfo information.
Using SEND_SIG_FORCED for SIGILL is thus wrong, and it will result in userspace seeing si_code == SI_USER (like a random signal) instead of si_code == SI_KERNEL or a more specific si_code as all exceptions deliver.
Therefore replace force_sig_info(SIGILL, SEND_SIG_FORCE, current) with force_sig(SIG_ILL, current) which gets this right and is shorter and easier to type.
--- kernel/events/uprobes.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
kernel/events/uprobes.c +2 -2
@@ -1836,7 +1836,7 @@ static void handle_trampoline(struct pt_regs *regs) sigill:uprobe_warn (current,"handle uretprobe, sending SIGILL." ); -force_sig_info (SIGILL ,SEND_SIG_FORCED , current); +force_sig (SIGILL , current); }
@@ -1952,7 +1952,7 @@ static void handle_singlestep(struct uprobe_task *utask, struct pt_regs *regs)if (unlikely (err)) {uprobe_warn (current,"execute the probed insn, sending SIGILL." ); -force_sig_info (SIGILL ,SEND_SIG_FORCED , current); +force_sig (SIGILL , current); } }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 27/44 signal: Properly deliver SIGSEGV from x86 uprobes
In reply to Sasha LevinFrom: "Eric W. Biederman" <[email protected]>
[ Upstream commit 4a63c1ffd384ebdce40aac9c997dab68379137be ]
For userspace to tell the difference between an random signal and an exception, the exception must include siginfo information.
Using SEND_SIG_FORCED for SIGSEGV is thus wrong, and it will result in userspace seeing si_code == SI_USER (like a random signal) instead of si_code == SI_KERNEL or a more specific si_code as all exceptions deliver.
Therefore replace force_sig_info(SIGSEGV, SEND_SIG_FORCE, current) with force_sig(SIG_SEGV, current) which gets this right and is shorter and easier to type.
--- arch/x86/kernel/uprobes.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/x86/kernel/uprobes.c +1 -1
@@ -983,7 +983,7 @@ arch_uretprobe_hijack_return_addr(unsigned long trampoline_vaddr, struct pt_regspr_err ("uprobe: return address clobbered: pid=%d, %%sp=%#lx, " "%%ip=%#lx\n" , current->pid, regs->sp, regs->ip); -force_sig_info (SIGSEGV ,SEND_SIG_FORCED , current); +force_sig (SIGSEGV , current); }return -1 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 28/44 scsi: sym53c8xx: fix NULL pointer dereference panic in sym_int_sir()
In reply to Sasha LevinFrom: George Kennedy <[email protected]>
[ Upstream commit 288315e95264b6355e26609e9dec5dc4563d4ab0 ]
sym_int_sir() in sym_hipd.c does not check the command pointer for NULL before using it in debug message prints.
--- drivers/scsi/sym53c8xx_2/sym_hipd.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
drivers/scsi/sym53c8xx_2/sym_hipd.c +11 -4
@@ -4371,6 +4371,13 @@ static void sym_nego_rejected(struct sym_hcb *np, struct sym_tcb *tp, struct symOUTB (np,HS_PRT ,HS_BUSY ); } +#define sym_printk(lvl, tp, cp, fmt, v...) do { \ + if (cp) \ + scmd_printk(lvl, cp->cmd, fmt, ##v); \ + else \ + starget_printk(lvl, tp->starget, fmt, ##v); \ +} while (0) +/* * chip exception handler for programmed interrupts. */
@@ -4416,7 +4423,7 @@ static void sym_int_sir(struct sym_hcb *np)* been selected with ATN. We do not want to handle that. */ case SIR_SEL_ATN_NO_MSG_OUT : -scmd_printk (KERN_WARNING , cp->cmd, +sym_printk (KERN_WARNING , tp, cp,"No MSG OUT phase after selection with ATN\n" ); goto out_stuck;/*
@@ -4424,7 +4431,7 @@ static void sym_int_sir(struct sym_hcb *np)* having reselected the initiator. */ case SIR_RESEL_NO_MSG_IN : -scmd_printk (KERN_WARNING , cp->cmd, +sym_printk (KERN_WARNING , tp, cp,"No MSG IN phase after reselection\n" ); goto out_stuck;/*
@@ -4432,7 +4439,7 @@ static void sym_int_sir(struct sym_hcb *np)* an IDENTIFY. */ case SIR_RESEL_NO_IDENTIFY : -scmd_printk (KERN_WARNING , cp->cmd, +sym_printk (KERN_WARNING , tp, cp,"No IDENTIFY after reselection\n" ); goto out_stuck;/*
@@ -4461,7 +4468,7 @@ static void sym_int_sir(struct sym_hcb *np)case SIR_RESEL_ABORTED : np->lastmsg = np->msgout[0 ]; np->msgout[0 ] =M_NOOP ; -scmd_printk (KERN_WARNING , cp->cmd, +sym_printk (KERN_WARNING , tp, cp,"message %x sent on bad reselection\n" , np->lastmsg); goto out;/*
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 29/44 ARM: imx6: register pm_power_off handler if "fsl,pmic-stby-poweroff" is set
In reply to Sasha LevinFrom: Oleksij Rempel <[email protected]>
[ Upstream commit 8148d2136002da2e2887caf6a07bbd9c033f14f3 ]
One of the Freescale recommended sequences for power off with external PMIC is the following:
...
3. SoC is programming PMIC for power off when standby is asserted.
4. In CCM STOP mode, Standby is asserted, PMIC gates SoC supplies.
See:
http://www.nxp.com/assets/documents/data/en/reference-manuals/IMX6DQRM.pdf
page 5083
This patch implements step 4. of this sequence.
--- arch/arm/mach-imx/pm-imx6.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+)
arch/arm/mach-imx/pm-imx6.c +25 -0
@@ -602,6 +602,28 @@ static void __init imx6_pm_common_init(const struct imx6_pm_socdata IMX6Q_GPR1_GINT); } +static void imx6_pm_stby_poweroff (void ) +{ +imx6_set_lpm (STOP_POWER_OFF ); +imx6q_suspend_finish (0 ); + +mdelay (1000 ); + +pr_emerg ("Unable to poweroff system\n" ); +} + +static int imx6_pm_stby_poweroff_probe (void ) +{ +if (pm_power_off) { +pr_warn ("%s: pm_power_off already claimed %p %pf!\n" , + __func__, pm_power_off, pm_power_off); +return -EBUSY ; + } + + pm_power_off = imx6_pm_stby_poweroff; +return 0 ; +} +void __init imx6_pm_ccm_init (const char *ccm_compat) {struct device_node *np;
@@ -618,6 +640,9 @@ void __init imx6_pm_ccm_init(const char *ccm_compat) val =readl_relaxed (ccm_base +CLPCR ); val &= ~BM_CLPCR_LPM ;writel_relaxed (val, ccm_base +CLPCR ); + +if (of_property_read_bool (np,"fsl,pmic-stby-poweroff" )) +imx6_pm_stby_poweroff_probe (); }void __init imx6q_pm_init (void )
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 30/44 scsi: pm80xx: Corrected dma_unmap_sg() parameter
In reply to Sasha LevinFrom: Deepak Ukey <[email protected]>
[ Upstream commit 76cb25b058034d37244be6aca97a2ad52a5fbcad ]
For the function dma_unmap_sg(), the <nents> parameter should be number of elements in the scatter list prior to the mapping, not after the mapping.
--- drivers/scsi/pm8001/pm8001_sas.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/pm8001/pm8001_sas.c +1 -1
@@ -463,7 +463,7 @@ static int pm8001_task_exec(struct sas_task *task,dev_printk (KERN_ERR , pm8001_ha->dev,"pm8001 exec failed[%d]!\n" , rc);if (!sas_protocol_ata (t->task_proto))if (n_elem) -dma_unmap_sg (pm8001_ha->dev, t->scatter, n_elem, +dma_unmap_sg (pm8001_ha->dev, t->scatter, t->num_scatter, t->data_dir); out_done:spin_unlock_irqrestore (&pm8001_ha->lock, flags);
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 31/44 scsi: pm80xx: Fixed system hang issue during kexec boot
In reply to Sasha LevinFrom: Deepak Ukey <[email protected]>
[ Upstream commit 72349b62a571effd6faadd0600b8e657dd87afbf ]
When the firmware is not responding, execution of kexec boot causes a system hang. When firmware assertion happened, driver get notified with interrupt vector updated in MPI configuration table. Then, the driver will read scratchpad register and set controller_fatal_error flag to true.
--- drivers/scsi/pm8001/pm8001_hwi.c | 6 +++ drivers/scsi/pm8001/pm8001_sas.c | 7 +++ drivers/scsi/pm8001/pm8001_sas.h | 1 + drivers/scsi/pm8001/pm80xx_hwi.c | 80 +++++++++++++++++++++++++++++--- drivers/scsi/pm8001/pm80xx_hwi.h | 3 ++ 5 files changed, 91 insertions(+), 6 deletions(-)
drivers/scsi/pm8001/pm8001_hwi.c +6 -0
@@ -1479,6 +1479,12 @@ u32 pm8001_mpi_msg_consume(struct pm8001_hba_info *pm8001_ha, }else {u32 producer_index;void *pi_virt = circularQ->pi_virt; +/* spurious interrupt during setup if +* kexec-ing and driver doing a doorbell access +* with the pre-kexec oq interrupt setup +*/ +if (!pi_virt) +break ;/* Update the producer index from SPC */ producer_index =pm8001_read_32 (pi_virt); circularQ->producer_index =cpu_to_le32 (producer_index);
drivers/scsi/pm8001/pm8001_sas.c +7 -0
@@ -371,6 +371,13 @@ static int pm8001_task_exec(struct sas_task *task,return 0 ; } pm8001_ha =pm8001_find_ha_by_dev (task->dev); +if (pm8001_ha->controller_fatal_error) { +struct task_status_struct *ts = &t->task_status; + + ts->resp =SAS_TASK_UNDELIVERED ; + t->task_done (t); +return 0 ; + }PM8001_IO_DBG (pm8001_ha,pm8001_printk ("pm8001_task_exec device \n " ));spin_lock_irqsave (&pm8001_ha->lock, flags); do {
drivers/scsi/pm8001/pm8001_sas.h +1 -0
@@ -531,6 +531,7 @@ struct pm8001_hba_info {u32 logging_level;u32 fw_status;u32 smp_exp_mode; +bool controller_fatal_error;const struct firmware *fw_image;struct isr_param irq_vector[PM8001_MAX_MSIX_VEC ]; };
drivers/scsi/pm8001/pm80xx_hwi.c +74 -6
115 lines not on this page · raw message
drivers/scsi/pm8001/pm80xx_hwi.h +3 -0
@@ -1288,6 +1288,9 @@ typedef struct SASProtocolTimerConfig SASProtocolTimerConfig_t;#define SCRATCH_PAD_BOOT_LOAD_SUCCESS 0x0#define SCRATCH_PAD_IOP0_READY 0xC00#define SCRATCH_PAD_IOP1_READY 0x3000 +#define SCRATCH_PAD_MIPSALL_READY (SCRATCH_PAD_IOP1_READY | \ + SCRATCH_PAD_IOP0_READY | \ + SCRATCH_PAD_RAAE_READY)/* boot loader state */ #define SCRATCH_PAD1_BOOTSTATE_MASK 0x70/* Bit 4-6 */
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 32/44 kprobes: Don't call BUG_ON() if there is a kprobe in use on free list
In reply to Sasha LevinFrom: Masami Hiramatsu <[email protected]>
[ Upstream commit cbdd96f5586151e48317d90a403941ec23f12660 ]
Instead of calling BUG_ON(), if we find a kprobe in use on free kprobe list, just remove it from the list and keep it on kprobe hash list as same as other in-use kprobes.
--- kernel/kprobes.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-)
kernel/kprobes.c +7 -1
@@ -514,8 +514,14 @@ static void do_free_cleaned_kprobes(void)struct optimized_kprobe *op, *tmp;list_for_each_entry_safe (op, tmp, &freeing_list, list) { -BUG_ON (!kprobe_unused (&op->kp));list_del_init (&op->list); +if (WARN_ON_ONCE (!kprobe_unused (&op->kp))) { +/* +* This must not happen, but if there is a kprobe +* still in use, keep it on kprobes hash list. +*/ +continue ; + }free_aggr_kprobe (&op->kp); } }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 33/44 nvmem: core: return error code instead of NULL from nvmem_device_get
In reply to Sasha LevinFrom: Srinivas Kandagatla <[email protected]>
[ Upstream commit ca6ac25cecf0e740d7cc8e03e0ebbf8acbeca3df ]
nvmem_device_get() should return ERR_PTR() on error or valid pointer on success, but one of the code path seems to return NULL, so fix it.
--- drivers/nvmem/core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/nvmem/core.c +1 -1
@@ -457,7 +457,7 @@ static struct nvmem_device *nvmem_find(const char *name) d =bus_find_device (&nvmem_bus_type,NULL , (void *)name, nvmem_match);if (!d) -return NULL ; +return ERR_PTR (-ENOENT );return to_nvmem_device (d); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 34/44 media: fix: media: pci: meye: validate offset to avoid arbitrary access
In reply to Sasha LevinFrom: Lao Wei <[email protected]>
[ Upstream commit eac7230fdb4672c2cb56f6a01a1744f562c01f80 ]
Motion eye video4linux driver for Sony Vaio PictureBook desn't validate user-controlled parameter 'vma->vm_pgoff', a malicious process might access all of kernel memory from user space by trying pass different arbitrary address.
Discussion: http://www.openwall.com/lists/oss-security/2018/07/06/1
--- drivers/media/pci/meye/meye.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/pci/meye/meye.c +1 -1
@@ -1469,7 +1469,7 @@ static int meye_mmap(struct file *file, struct vm_area_struct *vma)unsigned long page, pos;mutex_lock (&meye.lock); -if (size > gbuffers * gbufsize) { +if (size > gbuffers * gbufsize || offset > gbuffers * gbufsize - size) {mutex_unlock (&meye.lock);return -EINVAL ; }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 35/44 ALSA: intel8x0m: Register irq handler after register initializations
In reply to Sasha LevinFrom: Takashi Iwai <[email protected]>
[ Upstream commit 7064f376d4a10686f51c879401a569bb4babf9c6 ]
The interrupt handler has to be acquired after the other resource initialization when allocated with IRQF_SHARED. Otherwise it's triggered before the resource gets ready, and may lead to unpleasant behavior.
--- sound/pci/intel8x0m.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-)
sound/pci/intel8x0m.c +10 -10
@@ -1171,16 +1171,6 @@ static int snd_intel8x0m_create(struct snd_card *card, } port_inited: -if (request_irq (pci->irq, snd_intel8x0m_interrupt,IRQF_SHARED , -KBUILD_MODNAME , chip)) { -dev_err (card->dev,"unable to grab IRQ %d\n" , pci->irq); -snd_intel8x0m_free (chip); -return -EBUSY ; - } - chip->irq = pci->irq; -pci_set_master (pci); -synchronize_irq (chip->irq); -/* initialize offsets */ chip->bdbars_count =2 ; tbl = intel_regs;
@@ -1224,11 +1214,21 @@ static int snd_intel8x0m_create(struct snd_card *card, chip->int_sta_reg =ICH_REG_GLOB_STA ; chip->int_sta_mask = int_sta_masks; +pci_set_master (pci); +if ((err =snd_intel8x0m_chip_init (chip,1 )) <0 ) {snd_intel8x0m_free (chip);return err; } +if (request_irq (pci->irq, snd_intel8x0m_interrupt,IRQF_SHARED , +KBUILD_MODNAME , chip)) { +dev_err (card->dev,"unable to grab IRQ %d\n" , pci->irq); +snd_intel8x0m_free (chip); +return -EBUSY ; + } + chip->irq = pci->irq; +if ((err =snd_device_new (card,SNDRV_DEV_LOWLEVEL , chip, &ops)) <0 ) {snd_intel8x0m_free (chip);return err;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 36/44 pinctrl: at91-pio4: fix has_config check in atmel_pctl_dt_subnode_to_map()
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit b97760ae8e3dc8bb91881c13425a0bff55f2bd85 ]
Smatch complains about this condition:
if (has_config && num_pins >= 1)
The "has_config" variable is either uninitialized or true. The "num_pins" variable is unsigned and we verified that it is non-zero on the lines before so we know "num_pines >= 1" is true. Really, we could just check "num_configs" directly and remove the "has_config" variable.
--- drivers/pinctrl/pinctrl-at91-pio4.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/pinctrl/pinctrl-at91-pio4.c +2 -6
@@ -477,7 +477,6 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,unsigned num_pins, num_configs, reserve;unsigned long *configs;struct property *pins; -bool has_config;u32 pinfunc;int ret, i;
@@ -493,9 +492,6 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,return ret; } -if (num_configs) - has_config = true; - num_pins = pins->length /sizeof (u32);if (!num_pins) { dev_err(pctldev->dev, "no pins found in node %s\n",
@@ -508,7 +504,7 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,* map for each pin. */ reserve =1 ; -if (has_config && num_pins >=1 ) +if (num_configs) reserve++; reserve *= num_pins; ret = pinctrl_utils_reserve_map(pctldev, map, reserved_maps, num_maps,
@@ -531,7 +527,7 @@ static int atmel_pctl_dt_subnode_to_map(struct pinctrl_dev *pctldev,pinctrl_utils_add_map_mux (pctldev, map, reserved_maps, num_maps, group, func); -if (has_config) { +if (num_configs) { ret = pinctrl_utils_add_map_configs(pctldev, map, reserved_maps, num_maps, group, configs, num_configs,
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 37/44 llc: avoid blocking in llc_sap_close()
In reply to Sasha LevinFrom: Cong Wang <[email protected]>
[ Upstream commit 9708d2b5b7c648e8e0a40d11e8cea12f6277f33c ]
llc_sap_close() is called by llc_sap_put() which could be called in BH context in llc_rcv(). We can't block in BH.
There is no reason to block it here, kfree_rcu() should be sufficient.
--- include/net/llc.h | 1 + net/llc/llc_core.c | 4 +--- 2 files changed, 2 insertions(+), 3 deletions(-)
include/net/llc.h +1 -0
@@ -66,6 +66,7 @@ struct llc_sap {int sk_count;struct hlist_nulls_head sk_laddr_hash[LLC_SK_LADDR_HASH_ENTRIES ];struct hlist_head sk_dev_hash[LLC_SK_DEV_HASH_ENTRIES ]; +struct rcu_head rcu; }; static inline
net/llc/llc_core.c +1 -3
@@ -127,9 +127,7 @@ void llc_sap_close(struct llc_sap *sap)list_del_rcu (&sap->node);spin_unlock_bh (&llc_sap_list_lock); -synchronize_rcu (); - -kfree (sap); +kfree_rcu (sap, rcu); }static struct packet_type llc_packet_type__read_mostly = {
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 38/44 powerpc/vdso: Correct call frame information
In reply to Sasha LevinFrom: Alan Modra <[email protected]>
[ Upstream commit 56d20861c027498b5a1112b4f9f05b56d906fdda ]
Call Frame Information is used by gdb for back-traces and inserting breakpoints on function return for the "finish" command. This failed when inside __kernel_clock_gettime. More concerning than difficulty debugging is that CFI is also used by stack frame unwinding code to implement exceptions. If you have an app that needs to handle asynchronous exceptions for some reason, and you are unlucky enough to get one inside the VDSO time functions, your app will crash.
What's wrong: There is control flow in __kernel_clock_gettime that reaches label 99 without saving lr in r12. CFI info however is interpreted by the unwinder without reference to control flow: It's a simple matter of "Execute all the CFI opcodes up to the current address". That means the unwinder thinks r12 contains the return address at label 99. Disabuse it of that notion by resetting CFI for the return address at label 99.
Note that the ".cfi_restore lr" could have gone anywhere from the "mtlr r12" a few instructions earlier to the instruction at label 99. I put the CFI as late as possible, because in general that's best practice (and if possible grouped with other CFI in order to reduce the number of CFI opcodes executed when unwinding). Using r12 as the return address is perfectly fine after the "mtlr r12" since r12 on that code path still contains the return address.
__get_datapage also has a CFI error. That function temporarily saves lr in r0, and reflects that fact with ".cfi_register lr,r0". A later use of r0 means the CFI at that point isn't correct, as r0 no longer contains the return address. Fix that too.
--- arch/powerpc/kernel/vdso32/datapage.S | 1 + arch/powerpc/kernel/vdso32/gettimeofday.S | 1 + arch/powerpc/kernel/vdso64/datapage.S | 1 + arch/powerpc/kernel/vdso64/gettimeofday.S | 1 + 4 files changed, 4 insertions(+)
arch/powerpc/kernel/vdso32/datapage.S +1 -0
@@ -37,6 +37,7 @@ data_page_branch: mtlr r0 addi r3, r3, __kernel_datapage_offset-data_page_branch lwz r0,0(r3) + .cfi_restore lr add r3,r0,r3 blr .cfi_endproc
arch/powerpc/kernel/vdso32/gettimeofday.S +1 -0
@@ -139,6 +139,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) */ 99: li r0,__NR_clock_gettime + .cfi_restore lr sc blr .cfi_endproc
arch/powerpc/kernel/vdso64/datapage.S +1 -0
@@ -37,6 +37,7 @@ data_page_branch: mtlr r0 addi r3, r3, __kernel_datapage_offset-data_page_branch lwz r0,0(r3) + .cfi_restore lr add r3,r0,r3 blr .cfi_endproc
arch/powerpc/kernel/vdso64/gettimeofday.S +1 -0
@@ -124,6 +124,7 @@ V_FUNCTION_BEGIN(__kernel_clock_gettime) */ 99: li r0,__NR_clock_gettime + .cfi_restore lr sc blr .cfi_endproc
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 39/44 ARM: dts: socfpga: Fix I2C bus unit-address error
In reply to Sasha LevinFrom: Dinh Nguyen <[email protected]>
[ Upstream commit cbbc488ed85061a765cf370c3e41f383c1e0add6 ]
dtc has new checks for I2C buses. Fix the warnings in unit-addresses.
arch/arm/boot/dts/socfpga_cyclone5_de0_sockit.dtb: Warning (i2c_bus_reg): /soc/i2c@ffc04000/adxl345@0: I2C bus unit address format error, expected "53"
--- arch/arm/boot/dts/socfpga_cyclone5_de0_sockit.dts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm/boot/dts/socfpga_cyclone5_de0_sockit.dts +1 -1
@@ -88,7 +88,7 @@ status = "okay"; speed-mode = <0>; - adxl345: adxl345@0 { + adxl345: adxl345@53 { compatible = "adi,adxl345"; reg = <0x53>;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 40/44 pinctrl: at91: don't use the same irqchip with multiple gpiochips
In reply to Sasha LevinFrom: Ludovic Desroches <[email protected]>
[ Upstream commit 0c3dfa176912b5f87732545598200fb55e9c1978 ]
Sharing the same irqchip with multiple gpiochips is not a good practice. For instance, when installing hooks, we change the state of the irqchip. The initial state of the irqchip for the second gpiochip to register is then disrupted.
--- drivers/pinctrl/pinctrl-at91.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
drivers/pinctrl/pinctrl-at91.c +14 -14
@@ -1556,16 +1556,6 @@ void at91_pinctrl_gpio_resume(void)#define gpio_irq_set_wake NULL#endif /* CONFIG_PM */ -static struct irq_chip gpio_irqchip = { - .name ="GPIO" , - .irq_ack = gpio_irq_ack, - .irq_disable = gpio_irq_mask, - .irq_mask = gpio_irq_mask, - .irq_unmask = gpio_irq_unmask, -/* .irq_set_type is set dynamically */ - .irq_set_wake = gpio_irq_set_wake, -}; -static void gpio_irq_handler (struct irq_desc *desc) {struct irq_chip *chip =irq_desc_get_chip (desc);
@@ -1608,12 +1598,22 @@ static int at91_gpio_of_irq_setup(struct platform_device *pdev,struct gpio_chip *gpiochip_prev =NULL ;struct at91_gpio_chip *prev =NULL ;struct irq_data *d =irq_get_irq_data (at91_gpio->pioc_virq); +struct irq_chip *gpio_irqchip;int ret, i; + gpio_irqchip =devm_kzalloc (&pdev->dev,sizeof (*gpio_irqchip),GFP_KERNEL ); +if (!gpio_irqchip) +return -ENOMEM ; + at91_gpio->pioc_hwirq =irqd_to_hwirq (d); -/* Setup proper .irq_set_type function */ - gpio_irqchip.irq_set_type = at91_gpio->ops->irq_type; + gpio_irqchip->name ="GPIO" ; + gpio_irqchip->irq_ack = gpio_irq_ack; + gpio_irqchip->irq_disable = gpio_irq_mask; + gpio_irqchip->irq_mask = gpio_irq_mask; + gpio_irqchip->irq_unmask = gpio_irq_unmask; + gpio_irqchip->irq_set_wake = gpio_irq_set_wake, + gpio_irqchip->irq_set_type = at91_gpio->ops->irq_type;/* Disable irqs of this PIO controller */ writel_relaxed (~0 , at91_gpio->regbase +PIO_IDR );
@@ -1624,7 +1624,7 @@ static int at91_gpio_of_irq_setup(struct platform_device *pdev,* interrupt. */ ret =gpiochip_irqchip_add (&at91_gpio->chip, - &gpio_irqchip, + gpio_irqchip,0 , handle_edge_irq,IRQ_TYPE_EDGE_BOTH );
@@ -1642,7 +1642,7 @@ static int at91_gpio_of_irq_setup(struct platform_device *pdev,if (!gpiochip_prev) {/* Then register the chain on the parent IRQ */ gpiochip_set_chained_irqchip (&at91_gpio->chip, - &gpio_irqchip, + gpio_irqchip, at91_gpio->pioc_virq, gpio_irq_handler);return 0 ;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 41/44 cxgb4: Fix endianness issue in t4_fwcache()
In reply to Sasha LevinFrom: Ganesh Goudar <[email protected]>
[ Upstream commit 0dc235afc59a226d951352b0adf4a89b532a9d13 ]
Do not put host-endian 0 or 1 into big endian feild.
--- drivers/net/ethernet/chelsio/cxgb4/t4_hw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/t4_hw.c +1 -1
@@ -3482,7 +3482,7 @@ int t4_fwcache(struct adapter *adap, enum fw_params_param_dev_fwcache op) c.param[0 ].mnem =cpu_to_be32 (FW_PARAMS_MNEM_V (FW_PARAMS_MNEM_DEV ) |FW_PARAMS_PARAM_X_V (FW_PARAMS_PARAM_DEV_FWCACHE )); - c.param[0 ].val = (__force __be32 )op; + c.param[0 ].val =cpu_to_be32 (op);return t4_wr_mbox (adap, adap->mbox, &c,sizeof (c),NULL ); }
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 42/44 power: supply: ab8500_fg: silence uninitialized variable warnings
In reply to Sasha LevinFrom: Dan Carpenter <[email protected]>
[ Upstream commit 54baff8d4e5dce2cef61953b1dc22079cda1ddb1 ]
If kstrtoul() fails then we print "charge_full" when it's uninitialized. The debug printk doesn't add anything so I deleted it and cleaned these two functions up a bit.
--- drivers/power/ab8500_fg.c | 31 ++++++++++++------------------- 1 file changed, 12 insertions(+), 19 deletions(-)
drivers/power/ab8500_fg.c +12 -19
@@ -2447,17 +2447,14 @@ static ssize_t charge_full_store(struct ab8500_fg *di, const char *buf, size_t count) {unsigned long charge_full; -ssize_t ret; +int ret; ret =kstrtoul (buf,10 , &charge_full); +if (ret) +return ret; -dev_dbg (di->dev,"Ret %zd charge_full %lu" , ret, charge_full); - -if (!ret) { - di->bat_cap.max_mah = (int ) charge_full; - ret = count; - } -return ret; + di->bat_cap.max_mah = (int ) charge_full; +return count; }static ssize_t charge_now_show (struct ab8500_fg *di,char *buf)
@@ -2469,20 +2466,16 @@ static ssize_t charge_now_store(struct ab8500_fg *di, const char *buf, size_t count) {unsigned long charge_now; -ssize_t ret; +int ret; ret =kstrtoul (buf,10 , &charge_now); +if (ret) +return ret; -dev_dbg (di->dev,"Ret %zd charge_now %lu was %d" , - ret, charge_now, di->bat_cap.prev_mah); - -if (!ret) { - di->bat_cap.user_mah = (int ) charge_now; - di->flags.user_cap = true; - ret = count; -queue_delayed_work (di->fg_wq, &di->fg_periodic_work,0 ); - } -return ret; + di->bat_cap.user_mah = (int ) charge_now; + di->flags.user_cap = true; +queue_delayed_work (di->fg_wq, &di->fg_periodic_work,0 ); +return count; } static struct ab8500_fg_sysfs_entry charge_full_attr =
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 43/44 power: supply: max8998-charger: Fix platform data retrieval
In reply to Sasha LevinFrom: Tomasz Figa <[email protected]>
[ Upstream commit cb90a2c6f77fe9b43d1e3f759bb2f13fe7fa1811 ]
Since the max8998 MFD driver supports instantiation by DT, platform data retrieval is handled in MFD probe and cell drivers should get use the pdata field of max8998_dev struct to obtain them.
--- drivers/power/max8998_charger.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/power/max8998_charger.c +1 -1
@@ -85,7 +85,7 @@ static const struct power_supply_desc max8998_battery_desc = {static int max8998_battery_probe (struct platform_device *pdev) {struct max8998_dev *iodev =dev_get_drvdata (pdev->dev.parent); -struct max8998_platform_data *pdata =dev_get_platdata (iodev->dev); +struct max8998_platform_data *pdata = iodev->pdata;struct power_supply_config psy_cfg = {};struct max8998_battery_data *max8998;struct i2c_client *i2c;
Signature · 1 line
2.20.1
Sasha Levin
maintainerPATCH 44/44 kernfs: Fix range checks in kernfs_get_target_path
In reply to Sasha LevinFrom: Bernd Edlinger <[email protected]>
[ Upstream commit a75e78f21f9ad4b810868c89dbbabcc3931591ca ]
The terminating NUL byte is only there because the buffer is allocated with kzalloc(PAGE_SIZE, GFP_KERNEL), but since the range-check is off-by-one, and PAGE_SIZE==PATH_MAX, the returned string may not be zero-terminated if it is exactly PATH_MAX characters long. Furthermore also the initial loop may theoretically exceed PATH_MAX and cause a fault.
--- fs/kernfs/symlink.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
fs/kernfs/symlink.c +4 -1
@@ -63,6 +63,9 @@ static int kernfs_get_target_path(struct kernfs_node *parent,if (base == kn)break ; +if ((s - path) +3 >=PATH_MAX ) +return -ENAMETOOLONG ; +strcpy (s,"../" ); s +=3 ; base = base->parent;
@@ -79,7 +82,7 @@ static int kernfs_get_target_path(struct kernfs_node *parent,if (len <2 )return -EINVAL ; len--; -if ((s - path) + len >PATH_MAX ) +if ((s - path) + len >=PATH_MAX )return -ENAMETOOLONG ;/* reverse fillup of target string from target to base */
Signature · 1 line
2.20.1