5.12.9-rc1 review
Subsystems (5)
Greg Kroah-Hartman
maintainerPATCH 160/296 platform/x86: hp_accel: Avoid invoking _INI to speed up resume
In reply to Greg Kroah-HartmanFrom: Kai-Heng Feng <[email protected]>
[ Upstream commit 79d341e26ebcdbc622348aaaab6f8f89b6fdb25f ]
hp_accel can take almost two seconds to resume on some HP laptops.
The bottleneck is on evaluating _INI, which is only needed to run once.
Resolve the issue by only invoking _INI when it's necessary. Namely, on probe and on hibernation restore.
--- drivers/misc/lis3lv02d/lis3lv02d.h | 1 + drivers/platform/x86/hp_accel.c | 22 +++++++++++++++++++++- 2 files changed, 22 insertions(+), 1 deletion(-)
drivers/misc/lis3lv02d/lis3lv02d.h +1 -0
@@ -271,6 +271,7 @@ struct lis3lv02d {int regs_size;u8 *reg_cache;bool regs_stored; +bool init_required;u8 odr_mask;/* ODR bit mask */ u8 whoami;/* indicates measurement precision */ s16 (*read_data) (struct lis3lv02d *lis3,int reg);
drivers/platform/x86/hp_accel.c +21 -1
@@ -88,6 +88,9 @@ MODULE_DEVICE_TABLE(acpi, lis3lv02d_device_ids);static int lis3lv02d_acpi_init (struct lis3lv02d *lis3) {struct acpi_device *dev = lis3->bus_priv; +if (!lis3->init_required) +return 0 ; +if (acpi_evaluate_object (dev->handle,METHOD_NAME__INI ,NULL ,NULL ) !=AE_OK )return -EINVAL ;
@@ -356,6 +359,7 @@ static int lis3lv02d_add(struct acpi_device *device) }/* call the core layer do its init */ + lis3_dev.init_required = true; ret =lis3lv02d_init_device (&lis3_dev);if (ret)return ret;
@@ -403,11 +407,27 @@ static int lis3lv02d_suspend(struct device *dev)static int lis3lv02d_resume (struct device *dev) { + lis3_dev.init_required = false; +lis3lv02d_poweron (&lis3_dev); +return 0 ; +} + +static int lis3lv02d_restore (struct device *dev) +{ + lis3_dev.init_required = true;lis3lv02d_poweron (&lis3_dev);return 0 ; } -static SIMPLE_DEV_PM_OPS(hp_accel_pm, lis3lv02d_suspend, lis3lv02d_resume); +static const struct dev_pm_ops hp_accel_pm = { + .suspend = lis3lv02d_suspend, + .resume = lis3lv02d_resume, + .freeze = lis3lv02d_suspend, + .thaw = lis3lv02d_resume, + .poweroff = lis3lv02d_suspend, + .restore = lis3lv02d_restore, +}; +#define HP_ACCEL_PM (&hp_accel_pm)#else #define HP_ACCEL_PM NULL
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 161/296 gpio: cadence: Add missing MODULE_DEVICE_TABLE
In reply to Greg Kroah-HartmanFrom: Zou Wei <[email protected]>
[ Upstream commit 1e948b1752b58c9c570989ab29ceef5b38fdccda ]
This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module.
--- drivers/gpio/gpio-cadence.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-cadence.c +1 -0
@@ -278,6 +278,7 @@ static const struct of_device_id cdns_of_ids[] = { { .compatible = "cdns,gpio-r1p02" }, { /* sentinel */ }, }; +MODULE_DEVICE_TABLE (of, cdns_of_ids);static struct platform_driver cdns_gpio_driver = { .driver = {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 162/296 Revert "crypto: cavium/nitrox - add an error message to explain the failure of pci_request_mem_regions"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 6a3239a738d86c5e9b5aad17fefe2c2bfd6ced83 ]
This reverts commit 9fcddaf2e28d779cb946d23838ba6d50f299aa80 as it was submitted under a fake name and we can not knowingly accept anonymous contributions to the repository.
This commit was part of a submission "test" to the Linux kernel community by some "researchers" at umn.edu. As outlined at:
https://www-users.cs.umn.edu/%7Ekjlu/papers/full-disclosure.pdf
it was done so as an attempt to submit a known-buggy patch to see if it could get by our review. However, the submission turned out to actually be correct, and not have a bug in it as the author did not understand how the PCI driver model works at all, and so the submission was accepted.
As this change is of useless consequence, there is no loss of functionality in reverting it.
Email: Herbert Xu <[email protected]>
--- drivers/crypto/cavium/nitrox/nitrox_main.c | 1 - 1 file changed, 1 deletion(-)
drivers/crypto/cavium/nitrox/nitrox_main.c +0 -1
@@ -442,7 +442,6 @@ static int nitrox_probe(struct pci_dev *pdev, err =pci_request_mem_regions (pdev, nitrox_driver_name);if (err) {pci_disable_device (pdev); -dev_err (&pdev->dev,"Failed to request mem regions!\n" );return err; }pci_set_master (pdev);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 163/296 Revert "media: usb: gspca: add a missed check for goto_low_power"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit fd013265e5b5576a74a033920d6c571e08d7c423 ]
This reverts commit 5b711870bec4dc9a6d705d41e127e73944fa3650.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to do does nothing useful as a user can do nothing with this information and if an error did happen, the code would continue on as before. Because of this, just revert it.
--- drivers/media/usb/gspca/cpia1.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/media/usb/gspca/cpia1.c +1 -5
@@ -1424,7 +1424,6 @@ static int sd_config(struct gspca_dev *gspca_dev, {struct sd *sd = (struct sd *) gspca_dev;struct cam *cam; -int ret; sd->mainsFreq =FREQ_DEF ==V4L2_CID_POWER_LINE_FREQUENCY_60HZ ;reset_camera_params (gspca_dev);
@@ -1436,10 +1435,7 @@ static int sd_config(struct gspca_dev *gspca_dev, cam->cam_mode = mode; cam->nmodes =ARRAY_SIZE (mode); - ret =goto_low_power (gspca_dev); -if (ret) -gspca_err (gspca_dev,"Cannot go to low power mode: %d\n" , - ret); +goto_low_power (gspca_dev);/* Check the firmware version. */ sd->params.version.firmwareVersion =0 ;get_version_information (gspca_dev);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 164/296 Revert "ALSA: sb: fix a missing check of snd_ctl_add"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 4b059ce1f4b368208c2310925f49be77f15e527b ]
This reverts commit beae77170c60aa786f3e4599c18ead2854d8694d.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It is safe to ignore this error as the mixer element is optional, and the driver is very legacy.
--- sound/isa/sb/sb16_main.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
sound/isa/sb/sb16_main.c +3 -7
@@ -846,14 +846,10 @@ int snd_sb16dsp_pcm(struct snd_sb *chip, int device)snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_PLAYBACK , &snd_sb16_playback_ops);snd_pcm_set_ops (pcm,SNDRV_PCM_STREAM_CAPTURE , &snd_sb16_capture_ops); -if (chip->dma16 >=0 && chip->dma8 != chip->dma16) { - err =snd_ctl_add (card,snd_ctl_new1 ( - &snd_sb16_dma_control, chip)); -if (err) -return err; - }else { +if (chip->dma16 >=0 && chip->dma8 != chip->dma16) +snd_ctl_add (card,snd_ctl_new1 (&snd_sb16_dma_control, chip)); +else pcm->info_flags =SNDRV_PCM_INFO_HALF_DUPLEX ; - }snd_pcm_set_managed_buffer_all (pcm,SNDRV_DMA_TYPE_DEV , card->dev,64 *1024 ,128 *1024 );
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 165/296 Revert "serial: max310x: pass return value of spi_register_driver"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit b0a85abbe92e1a6f3e8580a4590fa7245de7090b ]
This reverts commit 51f689cc11333944c7a457f25ec75fcb41e99410.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
This change did not properly unwind from the error condition, so it was not correct.
--- drivers/tty/serial/max310x.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/tty/serial/max310x.c +2 -2
@@ -1518,10 +1518,10 @@ static int __init max310x_uart_init(void)return ret;#ifdef CONFIG_SPI_MASTER - ret =spi_register_driver (&max310x_spi_driver); +spi_register_driver (&max310x_spi_driver);#endif -return ret; +return 0 ; }module_init (max310x_uart_init);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 166/296 serial: max310x: unregister uart driver in case of failure and abort
In reply to Greg Kroah-HartmanFrom: Atul Gopinathan <[email protected]>
[ Upstream commit 3890e3dea315f1a257d1b940a2a4e2fa16a7b095 ]
The macro "spi_register_driver" invokes the function "__spi_register_driver()" which has a return type of int and can fail, returning a negative value in such a case. This is currently ignored and the init() function yields success even if the spi driver failed to register.
Fix this by collecting the return value of "__spi_register_driver()" and also unregister the uart driver in case of failure.
--- drivers/tty/serial/max310x.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/tty/serial/max310x.c +4 -2
@@ -1518,10 +1518,12 @@ static int __init max310x_uart_init(void)return ret;#ifdef CONFIG_SPI_MASTER -spi_register_driver (&max310x_spi_driver); + ret =spi_register_driver (&max310x_spi_driver); +if (ret) +uart_unregister_driver (&max310x_uart);#endif -return 0 ; +return ret; }module_init (max310x_uart_init);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 167/296 Revert "net: fujitsu: fix a potential NULL pointer dereference"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 5f94eaa4ee23e80841fa359a372f84cfe25daee1 ]
This reverts commit 9f4d6358e11bbc7b839f9419636188e4151fb6e4.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The original change does not change any behavior as the caller of this function onlyu checks for "== -1" as an error condition so this error is not handled properly. Remove this change and it will be fixed up properly in a later commit.
--- drivers/net/ethernet/fujitsu/fmvj18x_cs.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/net/ethernet/fujitsu/fmvj18x_cs.c +0 -5
@@ -547,11 +547,6 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)return -1 ; base =ioremap (link->resource[2 ]->start,resource_size (link->resource[2 ])); -if (!base) { -pcmcia_release_window (link, link->resource[2 ]); -return -ENOMEM ; - } -pcmcia_map_mem_page (link, link->resource[2 ],0 );/*
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 168/296 net: fujitsu: fix potential null-ptr-deref
In reply to Greg Kroah-HartmanFrom: Anirudh Rayabharam <[email protected]>
[ Upstream commit 52202be1cd996cde6e8969a128dc27ee45a7cb5e ]
In fmvj18x_get_hwinfo(), if ioremap fails there will be NULL pointer deref. To fix this, check the return value of ioremap and return -1 to the caller in case of failure.
--- drivers/net/ethernet/fujitsu/fmvj18x_cs.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/net/ethernet/fujitsu/fmvj18x_cs.c +5 -0
@@ -547,6 +547,11 @@ static int fmvj18x_get_hwinfo(struct pcmcia_device *link, u_char *node_id)return -1 ; base =ioremap (link->resource[2 ]->start,resource_size (link->resource[2 ])); +if (!base) { +pcmcia_release_window (link, link->resource[2 ]); +return -1 ; + } +pcmcia_map_mem_page (link, link->resource[2 ],0 );/*
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 169/296 Revert "net/smc: fix a NULL pointer dereference"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 5369ead83f5aff223b6418c99cb1fe9a8f007363 ]
This reverts commit e183d4e414b64711baf7a04e214b61969ca08dfa.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The original commit causes a memory leak and does not properly fix the issue it claims to fix. I will send a follow-on patch to resolve this properly.
--- net/smc/smc_ism.c | 5 ----- 1 file changed, 5 deletions(-)
net/smc/smc_ism.c +0 -5
@@ -417,11 +417,6 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,init_waitqueue_head (&smcd->lgrs_deleted); smcd->event_wq =alloc_ordered_workqueue ("ism_evt_wq-%s)" ,WQ_MEM_RECLAIM , name); -if (!smcd->event_wq) { -kfree (smcd->conn); -kfree (smcd); -return NULL ; - }return smcd; }EXPORT_SYMBOL_GPL (smcd_alloc_dev);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 170/296 net/smc: properly handle workqueue allocation failure
In reply to Greg Kroah-HartmanFrom: Anirudh Rayabharam <[email protected]>
[ Upstream commit bbeb18f27a44ce6adb00d2316968bc59dc640b9b ]
In smcd_alloc_dev(), if alloc_ordered_workqueue() fails, properly catch it, clean up and return NULL to let the caller know there was a failure. Move the call to alloc_ordered_workqueue higher in the function in order to abort earlier without needing to unwind the call to device_initialize().
--- net/smc/smc_ism.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
net/smc/smc_ism.c +8 -2
@@ -402,6 +402,14 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,return NULL ; } + smcd->event_wq =alloc_ordered_workqueue ("ism_evt_wq-%s)" , +WQ_MEM_RECLAIM , name); +if (!smcd->event_wq) { +kfree (smcd->conn); +kfree (smcd); +return NULL ; + } + smcd->dev.parent = parent; smcd->dev.release = smcd_release;device_initialize (&smcd->dev);
@@ -415,8 +423,6 @@ struct smcd_dev *smcd_alloc_dev(struct device *parent, const char *name,INIT_LIST_HEAD (&smcd->vlan);INIT_LIST_HEAD (&smcd->lgr_list);init_waitqueue_head (&smcd->lgrs_deleted); - smcd->event_wq =alloc_ordered_workqueue ("ism_evt_wq-%s)" , -WQ_MEM_RECLAIM , name);return smcd; }EXPORT_SYMBOL_GPL (smcd_alloc_dev);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 171/296 Revert "net: caif: replace BUG_ON with recovery code"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 4df07045fcfd684379a394d0f2aa0cc4067bda2a ]
This reverts commit c5dea815834c7d2e9fc633785455bc428b7a1956.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The original change here was pointless as dev can never be NULL in this function so the claim in the changelog that this "fixes" anything is incorrect (also the developer forgot about panic_on_warn). A follow-up change will resolve this issue properly.
--- drivers/net/caif/caif_serial.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/net/caif/caif_serial.c +1 -3
@@ -269,9 +269,7 @@ static netdev_tx_t caif_xmit(struct sk_buff *skb, struct net_device *dev) {struct ser_device *ser; -if (WARN_ON (!dev)) -return -EINVAL ; - +BUG_ON (dev ==NULL ); ser =netdev_priv (dev);/* Send flow off once, on high water mark */
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 172/296 net: caif: remove BUG_ON(dev == NULL) in caif_xmit
In reply to Greg Kroah-HartmanFrom: Du Cheng <[email protected]>
[ Upstream commit 65a67792e3416f7c5d7daa47d99334cbb19a7449 ]
The condition of dev == NULL is impossible in caif_xmit(), hence it is for the removal.
Explanation:
The static caif_xmit() is only called upon via a function pointer ndo_start_xmit defined in include/linux/netdevice.h:
```
struct net_device_ops {
...
netdev_tx_t (*ndo_start_xmit)(struct sk_buff *skb, struct net_device *dev);
...
}
```The exhausive list of call points are:
```
drivers/net/ethernet/qualcomm/rmnet/rmnet_map_command.c
dev->netdev_ops->ndo_start_xmit(skb, dev);
^ ^
drivers/infiniband/ulp/opa_vnic/opa_vnic_netdev.c
struct opa_vnic_adapter *adapter = opa_vnic_priv(netdev);
^ ^
return adapter->rn_ops->ndo_start_xmit(skb, netdev); // adapter would crash first
^ ^
drivers/usb/gadget/function/f_ncm.c
ncm->netdev->netdev_ops->ndo_start_xmit(NULL, ncm->netdev);
^ ^
include/linux/netdevice.h
static inline netdev_tx_t __netdev_start_xmit(...
{
return ops->ndo_start_xmit(skb, dev);
^
}
const struct net_device_ops *ops = dev->netdev_ops;
^
rc = __netdev_start_xmit(ops, skb, dev, more);
^
```In each of the enumerated scenarios, it is impossible for the NULL-valued dev to reach the caif_xmit() without crashing the kernel earlier, therefore BUG_ON(dev == NULL) is rather useless, hence the removal.
--- drivers/net/caif/caif_serial.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/caif/caif_serial.c +0 -1
@@ -269,7 +269,6 @@ static netdev_tx_t caif_xmit(struct sk_buff *skb, struct net_device *dev) {struct ser_device *ser; -BUG_ON (dev ==NULL ); ser =netdev_priv (dev);/* Send flow off once, on high water mark */
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 173/296 Revert "char: hpet: fix a missing check of ioremap"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 566f53238da74801b48e985788e5f7c9159e5940 ]
This reverts commit 13bd14a41ce3105d5b1f3cd8b4d1e249d17b6d9b.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
While this is technically correct, it is only fixing ONE of these errors in this function, so the patch is not fully correct. I'll leave this revert and provide a fix for this later that resolves this same "problem" everywhere in this function.
--- drivers/char/hpet.c | 2 -- 1 file changed, 2 deletions(-)
drivers/char/hpet.c +0 -2
@@ -969,8 +969,6 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)if (ACPI_SUCCESS (status)) { hdp->hd_phys_address = addr.address.minimum; hdp->hd_address =ioremap (addr.address.minimum, addr.address.address_length); -if (!hdp->hd_address) -return AE_ERROR ;if (hpet_is_known (hdp)) {iounmap (hdp->hd_address);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 174/296 char: hpet: add checks after calling ioremap
In reply to Greg Kroah-HartmanFrom: Tom Seewald <[email protected]>
[ Upstream commit b11701c933112d49b808dee01cb7ff854ba6a77a ]
The function hpet_resources() calls ioremap() two times, but in both cases it does not check if ioremap() returned a null pointer. Fix this by adding null pointer checks and returning an appropriate error.
--- drivers/char/hpet.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/char/hpet.c +4 -0
@@ -969,6 +969,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data)if (ACPI_SUCCESS (status)) { hdp->hd_phys_address = addr.address.minimum; hdp->hd_address =ioremap (addr.address.minimum, addr.address.address_length); +if (!hdp->hd_address) +return AE_ERROR ;if (hpet_is_known (hdp)) {iounmap (hdp->hd_address);
@@ -982,6 +984,8 @@ static acpi_status hpet_resources(struct acpi_resource *res, void *data) hdp->hd_phys_address = fixmem32->address; hdp->hd_address =ioremap (fixmem32->address,HPET_RANGE_SIZE ); +if (!hdp->hd_address) +return AE_ERROR ;if (hpet_is_known (hdp)) {iounmap (hdp->hd_address);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 175/296 Revert "ALSA: gus: add a check of the status of snd_ctl_add"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 1dacca7fa1ebea47d38d20cd2df37094805d2649 ]
This reverts commit 0f25e000cb4398081748e54f62a902098aa79ec1.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The original commit did nothing if there was an error, except to print out a message, which is pointless. So remove the commit as it gives a "false sense of doing something".
--- sound/isa/gus/gus_main.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
sound/isa/gus/gus_main.c +2 -11
@@ -77,17 +77,8 @@ static const struct snd_kcontrol_new snd_gus_joystick_control = {static void snd_gus_init_control (struct snd_gus_card *gus) { -int ret; - -if (!gus->ace_flag) { - ret = -snd_ctl_add (gus->card, -snd_ctl_new1 (&snd_gus_joystick_control, - gus)); -if (ret) -snd_printk (KERN_ERR "gus: snd_ctl_add failed: %d\n" , - ret); - } +if (!gus->ace_flag) +snd_ctl_add (gus->card,snd_ctl_new1 (&snd_gus_joystick_control, gus)); }/*
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 176/296 ALSA: sb8: Add a comment note regarding an unused pointer
In reply to Greg Kroah-HartmanFrom: Atul Gopinathan <[email protected]>
[ Upstream commit a28591f61b60fac820c6de59826ffa710e5e314e ]
The field "fm_res" of "struct snd_sb8" is never used/dereferenced throughout the sb8.c code. Therefore there is no need for any null value check after the "request_region()".
Add a comment note to make developers know about this and prevent any "NULL check" patches on this part of code.
--- sound/isa/sb/sb8.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
sound/isa/sb/sb8.c +5 -1
@@ -93,7 +93,11 @@ static int snd_sb8_probe(struct device *pdev, unsigned int dev) acard = card->private_data; card->private_free = snd_sb8_free; -/* block the 0x388 port to avoid PnP conflicts */ +/* +* Block the 0x388 port to avoid PnP conflicts. +* No need to check this value after request_region, +* as we never do anything with it. +*/ acard->fm_res =request_region (0x388 ,4 ,"SoundBlaster FM" );if (port[dev] !=SNDRV_AUTO_PORT ) {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 177/296 Revert "ALSA: usx2y: Fix potential NULL pointer dereference"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 4667a6fc1777ce071504bab570d3599107f4790f ]
This reverts commit a2c6433ee5a35a8de6d563f6512a26f87835ea0f.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The original patch was incorrect, and would leak memory if the error path the patch added was hit.
--- sound/usb/usx2y/usb_stream.c | 5 ----- 1 file changed, 5 deletions(-)
sound/usb/usx2y/usb_stream.c +0 -5
@@ -91,12 +91,7 @@ static int init_urbs(struct usb_stream_kernel *sk, unsigned use_packsize,for (u =0 ; u <USB_STREAM_NURBS ; ++u) { sk->inurb[u] =usb_alloc_urb (sk->n_o_ps,GFP_KERNEL ); -if (!sk->inurb[u]) -return -ENOMEM ; - sk->outurb[u] =usb_alloc_urb (sk->n_o_ps,GFP_KERNEL ); -if (!sk->outurb[u]) -return -ENOMEM ; } if (init_pipe_urbs(sk, use_packsize, sk->inurb, indata, dev, in_pipe) ||
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 178/296 Revert "isdn: mISDNinfineon: fix potential NULL pointer dereference"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit abd7bca23bd4247124265152d00ffd4b2b0d6877 ]
This reverts commit d721fe99f6ada070ae8fc0ec3e01ce5a42def0d9.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The original commit was incorrect, it should have never have used "unlikely()" and if it ever does trigger, resources are left grabbed.
Given there are no users for this code around, I'll just revert this and leave it "as is" as the odds that ioremap() will ever fail here is horrendiously low.
--- drivers/isdn/hardware/mISDN/mISDNinfineon.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-)
drivers/isdn/hardware/mISDN/mISDNinfineon.c +1 -4
@@ -697,11 +697,8 @@ setup_io(struct inf_hw *hw) (ulong)hw->addr.start, (ulong)hw->addr.size);return err; } -if (hw->ci->addr_mode ==AM_MEMIO ) { +if (hw->ci->addr_mode ==AM_MEMIO ) hw->addr.p =ioremap (hw->addr.start, hw->addr.size); -if (unlikely (!hw->addr.p)) -return -ENOMEM ; - } hw->addr.mode = hw->ci->addr_mode;if (debug &DEBUG_HW ) pr_notice("%s: IO addr %lx (%lu bytes) mode%d\n",
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 179/296 isdn: mISDNinfineon: check/cleanup ioremap failure correctly in setup_io
In reply to Greg Kroah-HartmanFrom: Phillip Potter <[email protected]>
[ Upstream commit c446f0d4702d316e1c6bf621f70e79678d28830a ]
Move hw->cfg.mode and hw->addr.mode assignments from hw->ci->cfg_mode and hw->ci->addr_mode respectively, to be before the subsequent checks for memory IO mode (and possible ioremap calls in this case).
Also introduce ioremap error checks at both locations. This allows resources to be properly freed on ioremap failure, as when the caller of setup_io then subsequently calls release_io via its error path, release_io can now correctly determine the mode as it has been set before the ioremap call.
Finally, refactor release_io function so that it will call release_mem_region in the memory IO case, regardless of whether or not hw->cfg.p/hw->addr.p are NULL. This means resources are then properly released on failure.
This properly implements the original reverted commit (d721fe99f6ad) from the University of Minnesota, whilst also implementing the ioremap check for the hw->ci->cfg_mode if block as well.
--- drivers/isdn/hardware/mISDN/mISDNinfineon.c | 24 ++++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-)
drivers/isdn/hardware/mISDN/mISDNinfineon.c +16 -8
@@ -630,17 +630,19 @@ static void release_io(struct inf_hw *hw) {if (hw->cfg.mode) { -if (hw->cfg.p) { +if (hw->cfg.mode ==AM_MEMIO ) {release_mem_region (hw->cfg.start, hw->cfg.size); -iounmap (hw->cfg.p); +if (hw->cfg.p) +iounmap (hw->cfg.p); }else release_region (hw->cfg.start, hw->cfg.size); hw->cfg.mode =AM_NONE ; }if (hw->addr.mode) { -if (hw->addr.p) { +if (hw->addr.mode ==AM_MEMIO ) {release_mem_region (hw->addr.start, hw->addr.size); -iounmap (hw->addr.p); +if (hw->addr.p) +iounmap (hw->addr.p); }else release_region (hw->addr.start, hw->addr.size); hw->addr.mode =AM_NONE ;
@@ -670,9 +672,12 @@ setup_io(struct inf_hw *hw) (ulong)hw->cfg.start, (ulong)hw->cfg.size);return err; } -if (hw->ci->cfg_mode ==AM_MEMIO ) - hw->cfg.p =ioremap (hw->cfg.start, hw->cfg.size); hw->cfg.mode = hw->ci->cfg_mode; +if (hw->ci->cfg_mode ==AM_MEMIO ) { + hw->cfg.p =ioremap (hw->cfg.start, hw->cfg.size); +if (!hw->cfg.p) +return -ENOMEM ; + }if (debug &DEBUG_HW ) pr_notice("%s: IO cfg %lx (%lu bytes) mode%d\n", hw->name, (ulong)hw->cfg.start,
@@ -697,9 +702,12 @@ setup_io(struct inf_hw *hw) (ulong)hw->addr.start, (ulong)hw->addr.size);return err; } -if (hw->ci->addr_mode ==AM_MEMIO ) - hw->addr.p =ioremap (hw->addr.start, hw->addr.size); hw->addr.mode = hw->ci->addr_mode; +if (hw->ci->addr_mode ==AM_MEMIO ) { + hw->addr.p =ioremap (hw->addr.start, hw->addr.size); +if (!hw->addr.p) +return -ENOMEM ; + }if (debug &DEBUG_HW ) pr_notice("%s: IO addr %lx (%lu bytes) mode%d\n", hw->name, (ulong)hw->addr.start,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 180/296 Revert "ath6kl: return error code in ath6kl_wmi_set_roam_lrssi_cmd()"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit efba106f89fc6848726716c101f4c84e88720a9c ]
This reverts commit fc6a6521556c8250e356ddc6a3f2391aa62dc976.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The change being reverted does NOTHING as the caller to this function does not even look at the return value of the call. So the "claim" that this fixed an an issue is not true. It will be fixed up properly in a future patch by propagating the error up the stack correctly.
--- drivers/net/wireless/ath/ath6kl/wmi.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/wireless/ath/ath6kl/wmi.c +3 -1
@@ -776,8 +776,10 @@ int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi) cmd->info.params.roam_rssi_floor =DEF_LRSSI_ROAM_FLOOR ; cmd->roam_ctrl =WMI_SET_LRSSI_SCAN_PARAMS ; -return ath6kl_wmi_cmd_send (wmi,0 , skb,WMI_SET_ROAM_CTRL_CMDID , +ath6kl_wmi_cmd_send (wmi,0 , skb,WMI_SET_ROAM_CTRL_CMDID ,NO_SYNC_WMIFLAG ); + +return 0 ; }int ath6kl_wmi_force_roam_cmd (struct wmi *wmi,const u8 *bssid)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 181/296 ath6kl: return error code in ath6kl_wmi_set_roam_lrssi_cmd()
In reply to Greg Kroah-HartmanFrom: Anirudh Rayabharam <[email protected]>
[ Upstream commit 54433367840b46a1555c8ed36c4c0cfc5dbf1358 ]
Propagate error code from failure of ath6kl_wmi_cmd_send() to the caller.
--- drivers/net/wireless/ath/ath6kl/debug.c | 5 ++++- drivers/net/wireless/ath/ath6kl/wmi.c | 4 +--- 2 files changed, 5 insertions(+), 4 deletions(-)
drivers/net/wireless/ath/ath6kl/debug.c +4 -1
@@ -1027,14 +1027,17 @@ static ssize_t ath6kl_lrssi_roam_write(struct file *file, {struct ath6kl *ar = file->private_data;unsigned long lrssi_roam_threshold; +int ret;if (kstrtoul_from_user (user_buf, count,0 , &lrssi_roam_threshold))return -EINVAL ; ar->lrssi_roam_threshold = lrssi_roam_threshold; -ath6kl_wmi_set_roam_lrssi_cmd (ar->wmi, ar->lrssi_roam_threshold); + ret =ath6kl_wmi_set_roam_lrssi_cmd (ar->wmi, ar->lrssi_roam_threshold); +if (ret) +return ret;return count; }
drivers/net/wireless/ath/ath6kl/wmi.c +1 -3
@@ -776,10 +776,8 @@ int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi) cmd->info.params.roam_rssi_floor =DEF_LRSSI_ROAM_FLOOR ; cmd->roam_ctrl =WMI_SET_LRSSI_SCAN_PARAMS ; -ath6kl_wmi_cmd_send (wmi,0 , skb,WMI_SET_ROAM_CTRL_CMDID , +return ath6kl_wmi_cmd_send (wmi,0 , skb,WMI_SET_ROAM_CTRL_CMDID ,NO_SYNC_WMIFLAG ); - -return 0 ; }int ath6kl_wmi_force_roam_cmd (struct wmi *wmi,const u8 *bssid)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 182/296 Revert "isdn: mISDN: Fix potential NULL pointer dereference of kzalloc"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 36a2c87f7ed9e305d05b9a5c044cc6c494771504 ]
This reverts commit 38d22659803a033b1b66cd2624c33570c0dde77d.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
While it looks like the original change is correct, it is not, as none of the setup actually happens, and the error value is not propagated upwards.
--- drivers/isdn/hardware/mISDN/hfcsusb.c | 3 --- 1 file changed, 3 deletions(-)
drivers/isdn/hardware/mISDN/hfcsusb.c +0 -3
@@ -249,9 +249,6 @@ hfcsusb_ph_info(struct hfcsusb *hw)int i; phi =kzalloc (struct_size (phi, bch, dch->dev.nrbchan),GFP_ATOMIC ); -if (!phi) -return ; - phi->dch.ch.protocol = hw->protocol; phi->dch.ch.Flags = dch->Flags; phi->dch.state = dch->state;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 183/296 isdn: mISDN: correctly handle ph_info allocation failure in hfcsusb_ph_info
In reply to Greg Kroah-HartmanFrom: Phillip Potter <[email protected]>
[ Upstream commit 5265db2ccc735e2783b790d6c19fb5cee8c025ed ]
Modify return type of hfcusb_ph_info to int, so that we can pass error value up the call stack when allocation of ph_info fails. Also change three of four call sites to actually account for the memory failure. The fourth, in ph_state_nt, is infeasible to change as it is in turn called by ph_state which is used as a function pointer argument to mISDN_initdchannel, which would necessitate changing its signature and updating all the places where it is used (too many).
Fixes original flawed commit (38d22659803a) from the University of Minnesota.
--- drivers/isdn/hardware/mISDN/hfcsusb.c | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-)
drivers/isdn/hardware/mISDN/hfcsusb.c +10 -8
@@ -46,7 +46,7 @@ static void hfcsusb_start_endpoint(struct hfcsusb *hw, int channel);static void hfcsusb_stop_endpoint (struct hfcsusb *hw,int channel);static int hfcsusb_setup_bch (struct bchannel *bch,int protocol);static void deactivate_bchannel (struct bchannel *bch); -static void hfcsusb_ph_info (struct hfcsusb *hw); +static int hfcsusb_ph_info (struct hfcsusb *hw);/* start next background transfer for control channel */ static void
@@ -241,7 +241,7 @@ hfcusb_l2l1B(struct mISDNchannel *ch, struct sk_buff *skb)* send full D/B channel status information * as MPH_INFORMATION_IND */ -static void +static int hfcsusb_ph_info (struct hfcsusb *hw) {struct ph_info *phi;
@@ -249,6 +249,9 @@ hfcsusb_ph_info(struct hfcsusb *hw)int i; phi =kzalloc (struct_size (phi, bch, dch->dev.nrbchan),GFP_ATOMIC ); +if (!phi) +return -ENOMEM ; + phi->dch.ch.protocol = hw->protocol; phi->dch.ch.Flags = dch->Flags; phi->dch.state = dch->state;
@@ -260,6 +263,8 @@ hfcsusb_ph_info(struct hfcsusb *hw)_queue_data (&dch->dev.D,MPH_INFORMATION_IND ,MISDN_ID_ANY ,struct_size (phi, bch, dch->dev.nrbchan), phi,GFP_ATOMIC );kfree (phi); + +return 0 ; }/*
@@ -344,8 +349,7 @@ hfcusb_l2l1D(struct mISDNchannel *ch, struct sk_buff *skb) ret =l1_event (dch->l1, hh->prim);break ;case MPH_INFORMATION_REQ : -hfcsusb_ph_info (hw); - ret =0 ; + ret =hfcsusb_ph_info (hw);break ; }
@@ -400,8 +404,7 @@ hfc_l1callback(struct dchannel *dch, u_int cmd) hw->name, __func__, cmd);return -1 ; } -hfcsusb_ph_info (hw); -return 0 ; +return hfcsusb_ph_info (hw); } static int
@@ -743,8 +746,7 @@ hfcsusb_setup_bch(struct bchannel *bch, int protocol)handle_led (hw, (bch->nr ==1 ) ?LED_B1_OFF :LED_B2_OFF ); } -hfcsusb_ph_info (hw); -return 0 ; +return hfcsusb_ph_info (hw); } static void
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 184/296 Revert "dmaengine: qcom_hidma: Check for driver register failure"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 43ed0fcf613a87dd0221ec72d1ade4d6544f2ffc ]
This reverts commit a474b3f0428d6b02a538aa10b3c3b722751cb382.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The original change is NOT correct, as it does not correctly unwind from the resources that was allocated before the call to platform_driver_register().
--- drivers/dma/qcom/hidma_mgmt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/dma/qcom/hidma_mgmt.c +2 -1
@@ -418,8 +418,9 @@ static int __init hidma_mgmt_init(void) hidma_mgmt_of_populate_channels(child); }#endif -return platform_driver_register (&hidma_mgmt_driver); +platform_driver_register (&hidma_mgmt_driver); +return 0 ; }module_init (hidma_mgmt_init);MODULE_LICENSE ("GPL v2" );
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 185/296 dmaengine: qcom_hidma: comment platform_driver_register call
In reply to Greg Kroah-HartmanFrom: Phillip Potter <[email protected]>
[ Upstream commit 4df2a8b0ad634d98a67e540a4e18a60f943e7d9f ]
Place a comment in hidma_mgmt_init explaining why success must currently be assumed, due to the cleanup issue that would need to be considered were this module ever to be unloadable or were this platform_driver_register call ever to fail.
--- drivers/dma/qcom/hidma_mgmt.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
drivers/dma/qcom/hidma_mgmt.c +14 -0
@@ -418,6 +418,20 @@ static int __init hidma_mgmt_init(void) hidma_mgmt_of_populate_channels(child); }#endif +/* +* We do not check for return value here, as it is assumed that +* platform_driver_register must not fail. The reason for this is that +* the (potential) hidma_mgmt_of_populate_channels calls above are not +* cleaned up if it does fail, and to do this work is quite +* complicated. In particular, various calls of of_address_to_resource, +* of_irq_to_resource, platform_device_register_full, of_dma_configure, +* and of_msi_configure which then call other functions and so on, must +* be cleaned up - this is not a trivial exercise. +* +* Currently, this module is not intended to be unloaded, and there is +* no module_exit function defined which does the needed cleanup. For +* this reason, we have to assume success here. +*/ platform_driver_register (&hidma_mgmt_driver);return 0 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 186/296 Revert "libertas: add checks for the return value of sysfs_create_group"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 46651077765c80a0d6f87f3469129a72e49ce91b ]
This reverts commit 434256833d8eb988cb7f3b8a41699e2fe48d9332.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The original commit was incorrect, the error needs to be propagated back to the caller AND if the second group call fails, the first needs to be removed. There are much better ways to solve this, the driver should NOT be calling sysfs_create_group() on its own as it is racing userspace and loosing.
--- drivers/net/wireless/marvell/libertas/mesh.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/net/wireless/marvell/libertas/mesh.c +0 -5
@@ -805,12 +805,7 @@ static void lbs_persist_config_init(struct net_device *dev) {int ret; ret =sysfs_create_group (&(dev->dev.kobj), &boot_opts_group); -if (ret) -pr_err ("failed to create boot_opts_group.\n" ); - ret =sysfs_create_group (&(dev->dev.kobj), &mesh_ie_group); -if (ret) -pr_err ("failed to create mesh_ie_group.\n" ); }static void lbs_persist_config_remove (struct net_device *dev)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 187/296 libertas: register sysfs groups properly
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 7e79b38fe9a403b065ac5915465f620a8fb3de84 ]
The libertas driver was trying to register sysfs groups "by hand" which causes them to be created _after_ the device is initialized and announced to userspace, which causes races and can prevent userspace tools from seeing the sysfs files correctly.
Fix this up by using the built-in sysfs_groups pointers in struct net_device which were created for this very reason, fixing the race condition, and properly allowing for any error that might have occured to be handled properly.
--- drivers/net/wireless/marvell/libertas/mesh.c | 28 +++----------------- 1 file changed, 4 insertions(+), 24 deletions(-)
drivers/net/wireless/marvell/libertas/mesh.c +4 -24
@@ -801,19 +801,6 @@ static const struct attribute_group mesh_ie_group = { .attrs = mesh_ie_attrs, }; -static void lbs_persist_config_init (struct net_device *dev) -{ -int ret; - ret =sysfs_create_group (&(dev->dev.kobj), &boot_opts_group); - ret =sysfs_create_group (&(dev->dev.kobj), &mesh_ie_group); -} - -static void lbs_persist_config_remove (struct net_device *dev) -{ -sysfs_remove_group (&(dev->dev.kobj), &boot_opts_group); -sysfs_remove_group (&(dev->dev.kobj), &mesh_ie_group); -} -/*************************************************************************** * Initializing and starting, stopping mesh
@@ -1009,6 +996,10 @@ static int lbs_add_mesh(struct lbs_private *priv)SET_NETDEV_DEV (priv->mesh_dev, priv->dev->dev.parent); mesh_dev->flags |=IFF_BROADCAST |IFF_MULTICAST ; + mesh_dev->sysfs_groups[0 ] = &lbs_mesh_attr_group; + mesh_dev->sysfs_groups[1 ] = &boot_opts_group; + mesh_dev->sysfs_groups[2 ] = &mesh_ie_group; +/* Register virtual mesh interface */ ret =register_netdev (mesh_dev);if (ret) {
@@ -1016,19 +1007,10 @@ static int lbs_add_mesh(struct lbs_private *priv) goto err_free_netdev; } - ret =sysfs_create_group (&(mesh_dev->dev.kobj), &lbs_mesh_attr_group); -if (ret) - goto err_unregister; - -lbs_persist_config_init (mesh_dev); -/* Everything successful */ ret =0 ; goto done; -err_unregister: -unregister_netdev (mesh_dev); - err_free_netdev:free_netdev (mesh_dev);
@@ -1049,8 +1031,6 @@ void lbs_remove_mesh(struct lbs_private *priv)netif_stop_queue (mesh_dev);netif_carrier_off (mesh_dev); -sysfs_remove_group (&(mesh_dev->dev.kobj), &lbs_mesh_attr_group); -lbs_persist_config_remove (mesh_dev);unregister_netdev (mesh_dev); priv->mesh_dev =NULL ;kfree (mesh_dev->ieee80211_ptr);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 188/296 Revert "ASoC: cs43130: fix a NULL pointer dereference"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit fdda0dd2686ecd1f2e616c9e0366ea71b40c485d ]
This reverts commit a2be42f18d409213bb7e7a736e3ef6ba005115bb.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The original patch here is not correct, sysfs files that were created are not unwound.
--- sound/soc/codecs/cs43130.c | 2 -- 1 file changed, 2 deletions(-)
sound/soc/codecs/cs43130.c +0 -2
@@ -2319,8 +2319,6 @@ static int cs43130_probe(struct snd_soc_component *component)return ret; cs43130->wq =create_singlethread_workqueue ("cs43130_hp" ); -if (!cs43130->wq) -return -ENOMEM ;INIT_WORK (&cs43130->work, cs43130_imp_meas); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 189/296 ASoC: cs43130: handle errors in cs43130_probe() properly
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 2da441a6491d93eff8ffff523837fd621dc80389 ]
cs43130_probe() does not do any valid error checking of things it initializes, OR what it does, it does not unwind properly if there are errors.
Fix this up by moving the sysfs files to an attribute group so the driver core will correctly add/remove them all at once and handle errors with them, and correctly check for creating a new workqueue and unwinding if that fails.
--- sound/soc/codecs/cs43130.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
sound/soc/codecs/cs43130.c +14 -14
@@ -1735,6 +1735,14 @@ static DEVICE_ATTR(hpload_dc_r, 0444, cs43130_show_dc_r, NULL); static DEVICE_ATTR(hpload_ac_l, 0444, cs43130_show_ac_l, NULL); static DEVICE_ATTR(hpload_ac_r, 0444, cs43130_show_ac_r, NULL); +static struct attribute *hpload_attrs[] = { + &dev_attr_hpload_dc_l.attr, + &dev_attr_hpload_dc_r.attr, + &dev_attr_hpload_ac_l.attr, + &dev_attr_hpload_ac_r.attr, +}; +ATTRIBUTE_GROUPS (hpload); +static struct reg_sequence hp_en_cal_seq[] = { {CS43130_INT_MASK_4 ,CS43130_INT_MASK_ALL }, {CS43130_HP_MEAS_LOAD_1 ,0 },
@@ -2302,23 +2310,15 @@ static int cs43130_probe(struct snd_soc_component *component) cs43130->hpload_done = false;if (cs43130->dc_meas) { - ret =device_create_file (component->dev, &dev_attr_hpload_dc_l); -if (ret <0 ) -return ret; - - ret =device_create_file (component->dev, &dev_attr_hpload_dc_r); -if (ret <0 ) -return ret; - - ret =device_create_file (component->dev, &dev_attr_hpload_ac_l); -if (ret <0 ) -return ret; - - ret =device_create_file (component->dev, &dev_attr_hpload_ac_r); -if (ret <0 ) + ret =sysfs_create_groups (&component->dev->kobj, hpload_groups); +if (ret)return ret; cs43130->wq =create_singlethread_workqueue ("cs43130_hp" ); +if (!cs43130->wq) { +sysfs_remove_groups (&component->dev->kobj, hpload_groups); +return -ENOMEM ; + }INIT_WORK (&cs43130->work, cs43130_imp_meas); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 190/296 Revert "media: dvb: Add check on sp8870_readreg"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 47e4ff06fa7f5ba4860543a2913bbd0c164640aa ]
This reverts commit 467a37fba93f2b4fe3ab597ff6a517b22b566882.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
This commit is not properly checking for an error at all, so if a read succeeds from this device, it will error out.
--- drivers/media/dvb-frontends/sp8870.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/media/dvb-frontends/sp8870.c +1 -3
@@ -280,9 +280,7 @@ static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)sp8870_writereg (state,0xc05 , reg0xc05);// read status reg in order to clear pending irqs - err =sp8870_readreg (state,0x200 ); -if (err) -return err; +sp8870_readreg (state,0x200 );// system controller start sp8870_microcontroller_start (state);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 191/296 media: dvb: Add check on sp8870_readreg return
In reply to Greg Kroah-HartmanFrom: Alaa Emad <[email protected]>
[ Upstream commit c6d822c56e7fd29e6fa1b1bb91b98f6a1e942b3c ]
The function sp8870_readreg returns a negative value when i2c_transfer fails so properly check for this and return the error if it happens.
--- drivers/media/dvb-frontends/sp8870.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/media/dvb-frontends/sp8870.c +3 -1
@@ -280,7 +280,9 @@ static int sp8870_set_frontend_parameters(struct dvb_frontend *fe)sp8870_writereg (state,0xc05 , reg0xc05);// read status reg in order to clear pending irqs -sp8870_readreg (state,0x200 ); + err =sp8870_readreg (state,0x200 ); +if (err <0 ) +return err;// system controller start sp8870_microcontroller_start (state);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 192/296 Revert "media: gspca: mt9m111: Check write_bridge for timeout"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit d8c3be2fb2079d0cb4cd29d6aba58dbe54771e42 ]
This reverts commit 656025850074f5c1ba2e05be37bda57ba2b8d491.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
Different error values should never be "OR" together and expect anything sane to come out of the result.
--- drivers/media/usb/gspca/m5602/m5602_mt9m111.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-)
drivers/media/usb/gspca/m5602/m5602_mt9m111.c +3 -5
@@ -195,7 +195,7 @@ static const struct v4l2_ctrl_config mt9m111_greenbal_cfg = {int mt9m111_probe (struct sd *sd) {u8 data[2 ] = {0x00 ,0x00 }; -int i, rc =0 ; +int i;struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;if (force_sensor) {
@@ -213,18 +213,16 @@ int mt9m111_probe(struct sd *sd)/* Do the preinit */ for (i =0 ; i <ARRAY_SIZE (preinit_mt9m111); i++) {if (preinit_mt9m111[i][0 ] ==BRIDGE ) { - rc |=m5602_write_bridge (sd, +m5602_write_bridge (sd, preinit_mt9m111[i][1 ], preinit_mt9m111[i][2 ]); }else { data[0 ] = preinit_mt9m111[i][2 ]; data[1 ] = preinit_mt9m111[i][3 ]; - rc |=m5602_write_sensor (sd, +m5602_write_sensor (sd, preinit_mt9m111[i][1 ], data,2 ); } } -if (rc <0 ) -return rc;if (m5602_read_sensor (sd,MT9M111_SC_CHIPVER , data,2 ))return -ENODEV ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 193/296 media: gspca: mt9m111: Check write_bridge for timeout
In reply to Greg Kroah-HartmanFrom: Alaa Emad <[email protected]>
[ Upstream commit e932f5b458eee63d013578ea128b9ff8ef5f5496 ]
If m5602_write_bridge times out, it will return a negative error value. So properly check for this and handle the error correctly instead of just ignoring it.
--- drivers/media/usb/gspca/m5602/m5602_mt9m111.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-)
drivers/media/usb/gspca/m5602/m5602_mt9m111.c +8 -6
@@ -195,7 +195,7 @@ static const struct v4l2_ctrl_config mt9m111_greenbal_cfg = {int mt9m111_probe (struct sd *sd) {u8 data[2 ] = {0x00 ,0x00 }; -int i; +int i, err;struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;if (force_sensor) {
@@ -213,15 +213,17 @@ int mt9m111_probe(struct sd *sd)/* Do the preinit */ for (i =0 ; i <ARRAY_SIZE (preinit_mt9m111); i++) {if (preinit_mt9m111[i][0 ] ==BRIDGE ) { -m5602_write_bridge (sd, - preinit_mt9m111[i][1 ], - preinit_mt9m111[i][2 ]); + err =m5602_write_bridge (sd, + preinit_mt9m111[i][1 ], + preinit_mt9m111[i][2 ]); }else { data[0 ] = preinit_mt9m111[i][2 ]; data[1 ] = preinit_mt9m111[i][3 ]; -m5602_write_sensor (sd, - preinit_mt9m111[i][1 ], data,2 ); + err =m5602_write_sensor (sd, + preinit_mt9m111[i][1 ], data,2 ); } +if (err <0 ) +return err; }if (m5602_read_sensor (sd,MT9M111_SC_CHIPVER , data,2 ))
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 194/296 Revert "media: gspca: Check the return value of write_bridge for timeout"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 8e23e83c752b54e98102627a1cc09281ad71a299 ]
This reverts commit a21a0eb56b4e8fe4a330243af8030f890cde2283.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
Different error values should never be "OR" together and expect anything sane to come out of the result.
--- drivers/media/usb/gspca/m5602/m5602_po1030.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/media/usb/gspca/m5602/m5602_po1030.c +2 -6
@@ -154,7 +154,6 @@ static const struct v4l2_ctrl_config po1030_greenbal_cfg = {int po1030_probe (struct sd *sd) { -int rc =0 ;u8 dev_id_h =0 , i;struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;
@@ -174,14 +173,11 @@ int po1030_probe(struct sd *sd)for (i =0 ; i <ARRAY_SIZE (preinit_po1030); i++) {u8 data = preinit_po1030[i][2 ];if (preinit_po1030[i][0 ] ==SENSOR ) - rc |=m5602_write_sensor (sd, +m5602_write_sensor (sd, preinit_po1030[i][1 ], &data,1 );else - rc |=m5602_write_bridge (sd, preinit_po1030[i][1 ], - data); +m5602_write_bridge (sd, preinit_po1030[i][1 ], data); } -if (rc <0 ) -return rc;if (m5602_read_sensor (sd,PO1030_DEVID_H , &dev_id_h,1 ))return -ENODEV ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 195/296 media: gspca: properly check for errors in po1030_probe()
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit dacb408ca6f0e34df22b40d8dd5fae7f8e777d84 ]
If m5602_write_sensor() or m5602_write_bridge() fail, do not continue to initialize the device but return the error to the calling funtion.
--- drivers/media/usb/gspca/m5602/m5602_po1030.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/media/usb/gspca/m5602/m5602_po1030.c +7 -3
@@ -155,6 +155,7 @@ static const struct v4l2_ctrl_config po1030_greenbal_cfg = {int po1030_probe (struct sd *sd) {u8 dev_id_h =0 , i; +int err;struct gspca_dev *gspca_dev = (struct gspca_dev *)sd;if (force_sensor) {
@@ -173,10 +174,13 @@ int po1030_probe(struct sd *sd)for (i =0 ; i <ARRAY_SIZE (preinit_po1030); i++) {u8 data = preinit_po1030[i][2 ];if (preinit_po1030[i][0 ] ==SENSOR ) -m5602_write_sensor (sd, - preinit_po1030[i][1 ], &data,1 ); + err =m5602_write_sensor (sd, preinit_po1030[i][1 ], + &data,1 );else -m5602_write_bridge (sd, preinit_po1030[i][1 ], data); + err =m5602_write_bridge (sd, preinit_po1030[i][1 ], + data); +if (err <0 ) +return err; }if (m5602_read_sensor (sd,PO1030_DEVID_H , &dev_id_h,1 ))
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 196/296 Revert "net: liquidio: fix a NULL pointer dereference"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 4fd798a5a89114c1892574c50f2aebd49bc5b4f5 ]
This reverts commit fe543b2f174f34a7a751aa08b334fe6b105c4569.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
While the original commit does keep the immediate "NULL dereference" from happening, it does not properly propagate the error back to the callers, AND it does not fix this same identical issue in the drivers/net/ethernet/cavium/liquidio/lio_vf_main.c for some reason.
--- drivers/net/ethernet/cavium/liquidio/lio_main.c | 5 ----- 1 file changed, 5 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_main.c +0 -5
@@ -1166,11 +1166,6 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop) sc = (struct octeon_soft_command *)octeon_alloc_soft_command (oct,OCTNET_CMD_SIZE ,16 ,0 ); -if (!sc) { -netif_info (lio, rx_err, lio->netdev, -"Failed to allocate octeon_soft_command\n" ); -return ; - } ncmd = (union octnet_cmd *)sc->virtdptr;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 197/296 net: liquidio: Add missing null pointer checks
In reply to Greg Kroah-HartmanFrom: Tom Seewald <[email protected]>
[ Upstream commit dbc97bfd3918ed9268bfc174cae8a7d6b3d51aad ]
The functions send_rx_ctrl_cmd() in both liquidio/lio_main.c and liquidio/lio_vf_main.c do not check if the call to octeon_alloc_soft_command() fails and returns a null pointer. Both functions also return void so errors are not propagated back to the caller.
Fix these issues by updating both instances of send_rx_ctrl_cmd() to return an integer rather than void, and have them return -ENOMEM if an allocation failure occurs. Also update all callers of send_rx_ctrl_cmd() so that they now check the return value.
--- .../net/ethernet/cavium/liquidio/lio_main.c | 28 +++++++++++++------ .../ethernet/cavium/liquidio/lio_vf_main.c | 27 +++++++++++++----- 2 files changed, 40 insertions(+), 15 deletions(-)
drivers/net/ethernet/cavium/liquidio/lio_main.c +20 -8
@@ -1153,7 +1153,7 @@ static void octeon_destroy_resources(struct octeon_device *oct)* @lio: per-network private data * @start_stop: whether to start or stop */ -static void send_rx_ctrl_cmd (struct lio *lio,int start_stop) +static int send_rx_ctrl_cmd (struct lio *lio,int start_stop) {struct octeon_soft_command *sc;union octnet_cmd *ncmd;
@@ -1161,11 +1161,16 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)int retval;if (oct->props[lio->ifidx].rx_on == start_stop) -return ; +return 0 ; sc = (struct octeon_soft_command *)octeon_alloc_soft_command (oct,OCTNET_CMD_SIZE ,16 ,0 ); +if (!sc) { +netif_info (lio, rx_err, lio->netdev, +"Failed to allocate octeon_soft_command struct\n" ); +return -ENOMEM ; + } ncmd = (union octnet_cmd *)sc->virtdptr;
@@ -1187,18 +1192,19 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)if (retval ==IQ_SEND_FAILED ) {netif_info (lio, rx_err, lio->netdev,"Failed to send RX Control message\n" );octeon_free_soft_command (oct, sc); -return ; }else {/* Sleep on a wait queue till the cond flag indicates that the * response arrived or timed-out. */ retval =wait_for_sc_completion_timeout (oct, sc,0 );if (retval) -return ; +return retval; oct->props[lio->ifidx].rx_on = start_stop;WRITE_ONCE (sc->caller_is_done, true); } + +return retval; }/**
@@ -1773,6 +1779,7 @@ static int liquidio_open(struct net_device *netdev)struct octeon_device_priv *oct_priv = (struct octeon_device_priv *)oct->priv;struct napi_struct *napi, *n; +int ret =0 ;if (oct->props[lio->ifidx].napi_enabled ==0 ) {tasklet_disable (&oct_priv->droq_tasklet);
@@ -1808,7 +1815,9 @@ static int liquidio_open(struct net_device *netdev)netif_info (lio, ifup, lio->netdev,"Interface Open, ready for traffic\n" );/* tell Octeon to start forwarding packets to host */ -send_rx_ctrl_cmd (lio,1 ); + ret =send_rx_ctrl_cmd (lio,1 ); +if (ret) +return ret;/* start periodical statistics fetch */ INIT_DELAYED_WORK (&lio->stats_wk.work, lio_fetch_stats);
@@ -1819,7 +1828,7 @@ static int liquidio_open(struct net_device *netdev)dev_info (&oct->pci_dev->dev,"%s interface is opened\n" , netdev->name); -return 0 ; +return ret; }/**
@@ -1833,6 +1842,7 @@ static int liquidio_stop(struct net_device *netdev)struct octeon_device_priv *oct_priv = (struct octeon_device_priv *)oct->priv;struct napi_struct *napi, *n; +int ret =0 ;ifstate_reset (lio,LIO_IFSTATE_RUNNING );
@@ -1849,7 +1859,9 @@ static int liquidio_stop(struct net_device *netdev) lio->link_changes++;/* Tell Octeon that nic interface is down. */ -send_rx_ctrl_cmd (lio,0 ); + ret =send_rx_ctrl_cmd (lio,0 ); +if (ret) +return ret;if (OCTEON_CN23XX_PF (oct)) {if (!oct->msix_on)
@@ -1884,7 +1896,7 @@ static int liquidio_stop(struct net_device *netdev)dev_info (&oct->pci_dev->dev,"%s interface is stopped\n" , netdev->name); -return 0 ; +return ret; }/**
drivers/net/ethernet/cavium/liquidio/lio_vf_main.c +20 -7
@@ -595,7 +595,7 @@ static void octeon_destroy_resources(struct octeon_device *oct)* @lio: per-network private data * @start_stop: whether to start or stop */ -static void send_rx_ctrl_cmd (struct lio *lio,int start_stop) +static int send_rx_ctrl_cmd (struct lio *lio,int start_stop) {struct octeon_device *oct = (struct octeon_device *)lio->oct_dev;struct octeon_soft_command *sc;
@@ -603,11 +603,16 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)int retval;if (oct->props[lio->ifidx].rx_on == start_stop) -return ; +return 0 ; sc = (struct octeon_soft_command *)octeon_alloc_soft_command (oct,OCTNET_CMD_SIZE ,16 ,0 ); +if (!sc) { +netif_info (lio, rx_err, lio->netdev, +"Failed to allocate octeon_soft_command struct\n" ); +return -ENOMEM ; + } ncmd = (union octnet_cmd *)sc->virtdptr;
@@ -635,11 +640,13 @@ static void send_rx_ctrl_cmd(struct lio *lio, int start_stop)*/ retval =wait_for_sc_completion_timeout (oct, sc,0 );if (retval) -return ; +return retval; oct->props[lio->ifidx].rx_on = start_stop;WRITE_ONCE (sc->caller_is_done, true); } + +return retval; }/**
@@ -906,6 +913,7 @@ static int liquidio_open(struct net_device *netdev)struct octeon_device_priv *oct_priv = (struct octeon_device_priv *)oct->priv;struct napi_struct *napi, *n; +int ret =0 ;if (!oct->props[lio->ifidx].napi_enabled) {tasklet_disable (&oct_priv->droq_tasklet);
@@ -932,11 +940,13 @@ static int liquidio_open(struct net_device *netdev) (LIQUIDIO_NDEV_STATS_POLL_TIME_MS));/* tell Octeon to start forwarding packets to host */ -send_rx_ctrl_cmd (lio,1 ); + ret =send_rx_ctrl_cmd (lio,1 ); +if (ret) +return ret;dev_info (&oct->pci_dev->dev,"%s interface is opened\n" , netdev->name); -return 0 ; +return ret; }/**
@@ -950,9 +960,12 @@ static int liquidio_stop(struct net_device *netdev)struct octeon_device_priv *oct_priv = (struct octeon_device_priv *)oct->priv;struct napi_struct *napi, *n; +int ret =0 ;/* tell Octeon to stop forwarding packets to host */ -send_rx_ctrl_cmd (lio,0 ); + ret =send_rx_ctrl_cmd (lio,0 ); +if (ret) +return ret;netif_info (lio, ifdown, lio->netdev,"Stopping interface!\n" );/* Inform that netif carrier is down */
@@ -986,7 +999,7 @@ static int liquidio_stop(struct net_device *netdev)dev_info (&oct->pci_dev->dev,"%s interface is stopped\n" , netdev->name); -return 0 ; +return ret; }/**
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 198/296 Revert "brcmfmac: add a check for the status of usb_register"
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 30a350947692f794796f563029d29764497f2887 ]
This reverts commit 42daad3343be4a4e1ee03e30a5f5cc731dadfef5.
Because of recent interactions with developers from @umn.edu, all commits from them have been recently re-reviewed to ensure if they were correct or not.
Upon review, this commit was found to be incorrect for the reasons below, so it must be reverted. It will be fixed up "correctly" in a later kernel change.
The original commit here did nothing to actually help if usb_register() failed, so it gives a "false sense of security" when there is none. The correct solution is to correctly unwind from this error.
--- drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +1 -5
@@ -1586,10 +1586,6 @@ void brcmf_usb_exit(void)void brcmf_usb_register (void ) { -int ret; -brcmf_dbg (USB ,"Enter\n" ); - ret =usb_register (&brcmf_usbdrvr); -if (ret) -brcmf_err ("usb_register failed %d\n" , ret); +usb_register (&brcmf_usbdrvr); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 199/296 brcmfmac: properly check for bus register errors
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
[ Upstream commit 419b4a142a7ece36cebcd434f8ce2af59ef94b85 ]
The brcmfmac driver ignores any errors on initialization with the different busses by deferring the initialization to a workqueue and ignoring all possible errors that might happen. Fix up all of this by only allowing the module to load if all bus registering worked properly.
--- .../broadcom/brcm80211/brcmfmac/bcmsdh.c | 8 +--- .../broadcom/brcm80211/brcmfmac/bus.h | 19 ++++++++- .../broadcom/brcm80211/brcmfmac/core.c | 42 ++++++++----------- .../broadcom/brcm80211/brcmfmac/pcie.c | 9 +--- .../broadcom/brcm80211/brcmfmac/pcie.h | 5 --- .../broadcom/brcm80211/brcmfmac/usb.c | 4 +- 6 files changed, 41 insertions(+), 46 deletions(-)
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c +2 -6
@@ -1217,13 +1217,9 @@ static struct sdio_driver brcmf_sdmmc_driver = { }, }; -void brcmf_sdio_register (void ) +int brcmf_sdio_register (void ) { -int ret; - - ret =sdio_register_driver (&brcmf_sdmmc_driver); -if (ret) -brcmf_err ("sdio_register_driver failed: %d\n" , ret); +return sdio_register_driver (&brcmf_sdmmc_driver); }void brcmf_sdio_exit (void )
drivers/net/wireless/broadcom/brcm80211/brcmfmac/bus.h +17 -2
@@ -275,11 +275,26 @@ void brcmf_bus_add_txhdrlen(struct device *dev, uint len);#ifdef CONFIG_BRCMFMAC_SDIO void brcmf_sdio_exit (void ); -void brcmf_sdio_register (void ); +int brcmf_sdio_register (void ); +#else +static inline void brcmf_sdio_exit (void ) { } +static inline int brcmf_sdio_register (void ) {return 0 ; }#endif +#ifdef CONFIG_BRCMFMAC_USB void brcmf_usb_exit (void ); -void brcmf_usb_register (void ); +int brcmf_usb_register (void ); +#else +static inline void brcmf_usb_exit (void ) { } +static inline int brcmf_usb_register (void ) {return 0 ; } +#endif + +#ifdef CONFIG_BRCMFMAC_PCIE +void brcmf_pcie_exit (void ); +int brcmf_pcie_register (void ); +#else +static inline void brcmf_pcie_exit (void ) { } +static inline int brcmf_pcie_register (void ) {return 0 ; }#endif #endif /* BRCMFMAC_BUS_H */
drivers/net/wireless/broadcom/brcm80211/brcmfmac/core.c +18 -24
58 lines not on this page · raw message
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.c +2 -7
@@ -2140,15 +2140,10 @@ static struct pci_driver brcmf_pciedrvr = { }; -void brcmf_pcie_register (void ) +int brcmf_pcie_register (void ) { -int err; -brcmf_dbg (PCIE ,"Enter\n" ); - err =pci_register_driver (&brcmf_pciedrvr); -if (err) -brcmf_err (NULL ,"PCIE driver registration failed, err=%d\n" , - err); +return pci_register_driver (&brcmf_pciedrvr); }
drivers/net/wireless/broadcom/brcm80211/brcmfmac/pcie.h +0 -5
@@ -11,9 +11,4 @@ struct brcmf_pciedev { struct brcmf_pciedev_info *devinfo; }; - -void brcmf_pcie_exit (void ); -void brcmf_pcie_register (void ); - -#endif /* BRCMFMAC_PCIE_H */
drivers/net/wireless/broadcom/brcm80211/brcmfmac/usb.c +2 -2
@@ -1584,8 +1584,8 @@ void brcmf_usb_exit(void)usb_deregister (&brcmf_usbdrvr); } -void brcmf_usb_register (void ) +int brcmf_usb_register (void ) {brcmf_dbg (USB ,"Enter\n" ); -usb_register (&brcmf_usbdrvr); +return usb_register (&brcmf_usbdrvr); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 200/296 btrfs: return whole extents in fiemap
In reply to Greg Kroah-HartmanFrom: Boris Burkov <[email protected]>
[ Upstream commit 15c7745c9a0078edad1f7df5a6bb7b80bc8cca23 ]
xfs_io -c 'fiemap <off> <len>' <file>
can give surprising results on btrfs that differ from xfs.
btrfs prints out extents trimmed to fit the user input. If the user's fiemap request has an offset, then rather than returning each whole extent which intersects that range, we also trim the start extent to not have start < off.
Documentation in filesystems/fiemap.txt and the xfs_io man page suggests that returning the whole extent is expected.
Some cases which all yield the same fiemap in xfs, but not btrfs:
dd if=/dev/zero of=$f bs=4k count=1
sudo xfs_io -c 'fiemap 0 1024' $f
0: [0..7]: 26624..26631
sudo xfs_io -c 'fiemap 2048 1024' $f
0: [4..7]: 26628..26631
sudo xfs_io -c 'fiemap 2048 4096' $f
0: [4..7]: 26628..26631
sudo xfs_io -c 'fiemap 3584 512' $f
0: [7..7]: 26631..26631
sudo xfs_io -c 'fiemap 4091 5' $f
0: [7..6]: 26631..26630I believe this is a consequence of the logic for merging contiguous extents represented by separate extent items. That logic needs to track the last offset as it loops through the extent items, which happens to pick up the start offset on the first iteration, and trim off the beginning of the full extent. To fix it, start off at 0 rather than start so that we keep the iteration/merging intact without cutting off the start of the extent.
after the fix, all the above commands give:
0: [0..7]: 26624..26631
The merging logic is exercised by fstest generic/483, and I have written a new fstest for checking we don't have backwards or zero-length fiemaps for cases like those above.
--- fs/btrfs/extent_io.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
fs/btrfs/extent_io.c +6 -1
@@ -4975,7 +4975,7 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, u64 start, u64 len) {int ret =0 ; -u64 off = start; +u64 off;u64 max = start + len;u32 flags =0 ;u32 found_type;
@@ -5010,6 +5010,11 @@ int extent_fiemap(struct btrfs_inode *inode, struct fiemap_extent_info *fieinfo, goto out_free_ulist; } +/* +* We can't initialize that to 'start' as this could miss extents due +* to extent item merging +*/ + off =0 ; start =round_down (start,btrfs_inode_sectorsize (inode)); len =round_up (max,btrfs_inode_sectorsize (inode)) - start;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 201/296 scsi: ufs: ufs-mediatek: Fix power down spec violation
In reply to Greg Kroah-HartmanFrom: Peter Wang <[email protected]>
[ Upstream commit c625b80b9d00f3546722cd77527f9697c8c4c911 ]
As per spec, e.g. JESD220E chapter 7.2, while powering off the UFS device, RST_N signal should be between VSS(Ground) and VCCQ/VCCQ2. The power down sequence after fixing:
Power down:
1. Assert RST_N low
2. Turn-off VCC
3. Turn-off VCCQ/VCCQ2
--- drivers/scsi/ufs/ufs-mediatek.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/scsi/ufs/ufs-mediatek.c +4 -0
@@ -922,6 +922,7 @@ static void ufs_mtk_vreg_set_lpm(struct ufs_hba *hba, bool lpm)static int ufs_mtk_suspend (struct ufs_hba *hba,enum ufs_pm_op pm_op) {int err; +struct arm_smccc_res res;if (ufshcd_is_link_hibern8 (hba)) { err =ufs_mtk_link_set_lpm (hba);
@@ -941,6 +942,9 @@ static int ufs_mtk_suspend(struct ufs_hba *hba, enum ufs_pm_op pm_op) goto fail; } +if (ufshcd_is_link_off (hba)) +ufs_mtk_device_reset_ctrl (0 , res); +return 0 ; fail:/*
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 202/296 scsi: BusLogic: Fix 64-bit system enumeration error for Buslogic
In reply to Greg Kroah-HartmanFrom: Matt Wang <[email protected]>
[ Upstream commit 56f396146af278135c0ff958c79b5ee1bd22453d ]
Commit 391e2f25601e ("[SCSI] BusLogic: Port driver to 64-bit") introduced a serious issue for 64-bit systems. With this commit, 64-bit kernel will enumerate 8*15 non-existing disks. This is caused by the broken CCB structure. The change from u32 data to void *data increased CCB length on 64-bit system, which introduced an extra 4 byte offset of the CDB. This leads to incorrect response to INQUIRY commands during enumeration.
Fix disk enumeration failure by reverting the portion of the commit above which switched the data pointer from u32 to void.
--- drivers/scsi/BusLogic.c | 6 +++--- drivers/scsi/BusLogic.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-)
drivers/scsi/BusLogic.c +3 -3
@@ -3078,11 +3078,11 @@ static int blogic_qcmd_lck(struct scsi_cmnd *command, ccb->opcode =BLOGIC_INITIATOR_CCB_SG ; ccb->datalen = count *sizeof (struct blogic_sg_seg );if (blogic_multimaster_type (adapter)) - ccb->data = (void *)((unsigned int ) ccb->dma_handle + + ccb->data = (unsigned int ) ccb->dma_handle + ((unsigned long ) &ccb->sglist - - (unsigned long ) ccb)); + (unsigned long ) ccb);else - ccb->data = ccb->sglist; + ccb->data =virt_to_32bit_virt (ccb->sglist);scsi_for_each_sg (command, sg, count, i) { ccb->sglist[i].segbytes =sg_dma_len (sg);
drivers/scsi/BusLogic.h +1 -1
@@ -814,7 +814,7 @@ struct blogic_ccb {unsigned char cdblen;/* Byte 2 */ unsigned char sense_datalen;/* Byte 3 */ u32 datalen;/* Bytes 4-7 */ -void *data;/* Bytes 8-11 */ +u32 data;/* Bytes 8-11 */ unsigned char:8; /* Byte 12 */ unsigned char:8; /* Byte 13 */enum blogic_adapter_status adapter_status;/* Byte 14 */
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 203/296 openrisc: Define memory barrier mb
In reply to Greg Kroah-HartmanFrom: Peter Zijlstra <[email protected]>
[ Upstream commit 8b549c18ae81dbc36fb11e4aa08b8378c599ca95 ]
This came up in the discussion of the requirements of qspinlock on an architecture. OpenRISC uses qspinlock, but it was noticed that the memmory barrier was not defined.
Peter defined it in the mail thread writing:
As near as I can tell this should do. The arch spec only lists this one instruction and the text makes it sound like a completion barrier.
This is correct so applying this patch.
--- arch/openrisc/include/asm/barrier.h | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 arch/openrisc/include/asm/barrier.h
arch/openrisc/include/asm/barrier.h new file +9 -0
@@ -0,0 +1,9 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +#ifndef __ASM_BARRIER_H +#define __ASM_BARRIER_H + +#define mb () asm volatile ("l.msync" ::: "memory") + +#include <asm-generic/barrier.h> + +#endif /* __ASM_BARRIER_H */
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 204/296 scsi: pm80xx: Fix drives missing during rmmod/insmod loop
In reply to Greg Kroah-HartmanFrom: Ajish Koshy <[email protected]>
[ Upstream commit d1acd81bd6eb685aa9fef25624fb36d297f6404e ]
When driver is loaded after rmmod some drives are not showing up during discovery.
SATA drives are directly attached to the controller connected phys. During device discovery, the IDENTIFY command (qc timeout (cmd 0xec)) is timing out during revalidation. This will trigger abort from host side and controller successfully aborts the command and returns success. Post this successful abort response ATA library decides to mark the disk as NODEV.
To overcome this, inside pm8001_scan_start() after phy_start() call, add get start response and wait for few milliseconds to trigger next phy start. This millisecond delay will give sufficient time for the controller state machine to accept next phy start.
--- drivers/scsi/pm8001/pm8001_hwi.c | 10 ++++++---- drivers/scsi/pm8001/pm8001_init.c | 2 +- drivers/scsi/pm8001/pm8001_sas.c | 7 ++++++- drivers/scsi/pm8001/pm80xx_hwi.c | 12 ++++++------ 4 files changed, 19 insertions(+), 12 deletions(-)
drivers/scsi/pm8001/pm8001_hwi.c +6 -4
@@ -3709,11 +3709,13 @@ static int mpi_hw_event(struct pm8001_hba_info *pm8001_ha, void* piomb)case HW_EVENT_PHY_START_STATUS :pm8001_dbg (pm8001_ha,MSG ,"HW_EVENT_PHY_START_STATUS status = %x\n" , status); -if (status ==0 ) { +if (status ==0 ) phy->phy_state =1 ; -if (pm8001_ha->flags ==PM8001F_RUN_TIME && - phy->enable_completion !=NULL ) -complete (phy->enable_completion); + +if (pm8001_ha->flags ==PM8001F_RUN_TIME && + phy->enable_completion !=NULL ) { +complete (phy->enable_completion); + phy->enable_completion =NULL ; }break ;case HW_EVENT_SAS_PHY_UP :
drivers/scsi/pm8001/pm8001_init.c +1 -1
@@ -1144,8 +1144,8 @@ static int pm8001_pci_probe(struct pci_dev *pdev, goto err_out_shost; }list_add_tail (&pm8001_ha->list, &hba_list); -scsi_scan_host (pm8001_ha->shost); pm8001_ha->flags =PM8001F_RUN_TIME ; +scsi_scan_host (pm8001_ha->shost);return 0 ; err_out_shost:
drivers/scsi/pm8001/pm8001_sas.c +6 -1
@@ -264,12 +264,17 @@ void pm8001_scan_start(struct Scsi_Host *shost)int i;struct pm8001_hba_info *pm8001_ha;struct sas_ha_struct *sha =SHOST_TO_SAS_HA (shost); +DECLARE_COMPLETION_ONSTACK (completion); pm8001_ha = sha->lldd_ha;/* SAS_RE_INITIALIZATION not available in SPCv/ve */ if (pm8001_ha->chip_id == chip_8001)PM8001_CHIP_DISP ->sas_re_init_req (pm8001_ha); -for (i =0 ; i < pm8001_ha->chip->n_phy; ++i) +for (i =0 ; i < pm8001_ha->chip->n_phy; ++i) { + pm8001_ha->phy[i].enable_completion = &completion;PM8001_CHIP_DISP ->phy_start_req (pm8001_ha, i); +wait_for_completion (&completion); +msleep (300 ); + } }int pm8001_scan_finished (struct Scsi_Host *shost,unsigned long time)
drivers/scsi/pm8001/pm80xx_hwi.c +6 -6
@@ -3485,13 +3485,13 @@ static int mpi_phy_start_resp(struct pm8001_hba_info *pm8001_ha, void *piomb)pm8001_dbg (pm8001_ha,INIT ,"phy start resp status:0x%x, phyid:0x%x\n" , status, phy_id); -if (status ==0 ) { +if (status ==0 ) phy->phy_state =PHY_LINK_DOWN ; -if (pm8001_ha->flags ==PM8001F_RUN_TIME && - phy->enable_completion !=NULL ) { -complete (phy->enable_completion); - phy->enable_completion =NULL ; - } + +if (pm8001_ha->flags ==PM8001F_RUN_TIME && + phy->enable_completion !=NULL ) { +complete (phy->enable_completion); + phy->enable_completion =NULL ; }return 0 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 205/296 btrfs: release path before starting transaction when cloning inline extent
In reply to Greg Kroah-HartmanFrom: Filipe Manana <[email protected]>
[ Upstream commit 6416954ca75baed71640bf3828625bf165fb9b5e ]
When cloning an inline extent there are a few cases, such as when we have an implicit hole at file offset 0, where we start a transaction while holding a read lock on a leaf. Starting the transaction results in a call to sb_start_intwrite(), which results in doing a read lock on a percpu semaphore. Lockdep doesn't like this and complains about it:
[46.580704] ======================================================
[46.580752] WARNING: possible circular locking dependency detected
[46.580799] 5.13.0-rc1 #28 Not tainted
[46.580832] ------------------------------------------------------
[46.580877] cloner/3835 is trying to acquire lock:
[46.580918] c00000001301d638 (sb_internal#2){.+.+}-{0:0}, at: clone_copy_inline_extent+0xe4/0x5a0
[46.581167]
[46.581167] but task is already holding lock:
[46.581217] c000000007fa2550 (btrfs-tree-00){++++}-{3:3}, at: __btrfs_tree_read_lock+0x70/0x1d0
[46.581293]
[46.581293] which lock already depends on the new lock.
[46.581293]
[46.581351]
[46.581351] the existing dependency chain (in reverse order) is:
[46.581410]
[46.581410] -> #1 (btrfs-tree-00){++++}-{3:3}:
[46.581464] down_read_nested+0x68/0x200
[46.581536] __btrfs_tree_read_lock+0x70/0x1d0
[46.581577] btrfs_read_lock_root_node+0x88/0x200
[46.581623] btrfs_search_slot+0x298/0xb70
[46.581665] btrfs_set_inode_index+0xfc/0x260
[46.581708] btrfs_new_inode+0x26c/0x950
[46.581749] btrfs_create+0xf4/0x2b0
[46.581782] lookup_open.isra.57+0x55c/0x6a0
[46.581855] path_openat+0x418/0xd20
[46.581888] do_filp_open+0x9c/0x130
[46.581920] do_sys_openat2+0x2ec/0x430
[46.581961] do_sys_open+0x90/0xc0
[46.581993] system_call_exception+0x3d4/0x410
[46.582037] system_call_common+0xec/0x278
[46.582078]
[46.582078] -> #0 (sb_internal#2){.+.+}-{0:0}:
[46.582135] __lock_acquire+0x1e90/0x2c50
[46.582176] lock_acquire+0x2b4/0x5b0
[46.582263] start_transaction+0x3cc/0x950
[46.582308] clone_copy_inline_extent+0xe4/0x5a0
[46.582353] btrfs_clone+0x5fc/0x880
[46.582388] btrfs_clone_files+0xd8/0x1c0
[46.582434] btrfs_remap_file_range+0x3d8/0x590
[46.582481] do_clone_file_range+0x10c/0x270
[46.582558] vfs_clone_file_range+0x1b0/0x310
[46.582605] ioctl_file_clone+0x90/0x130
[46.582651] do_vfs_ioctl+0x874/0x1ac0
[46.582697] sys_ioctl+0x6c/0x120
[46.582733] system_call_exception+0x3d4/0x410
[46.582777] system_call_common+0xec/0x278
[46.582822]
[46.582822] other info that might help us debug this:
[46.582822]
[46.582888] Possible unsafe locking scenario:
[46.582888]
[46.582942] CPU0 CPU1
[46.582984] ---- ----
[46.583028] lock(btrfs-tree-00);
[46.583062] lock(sb_internal#2);
[46.583119] lock(btrfs-tree-00);
[46.583174] lock(sb_internal#2);
[46.583212]
[46.583212] *** DEADLOCK ***
[46.583212]
[46.583266] 6 locks held by cloner/3835:
[46.583299] #0: c00000001301d448 (sb_writers#12){.+.+}-{0:0}, at: ioctl_file_clone+0x90/0x130
[46.583382] #1: c00000000f6d3768 (&sb->s_type->i_mutex_key#15){+.+.}-{3:3}, at: lock_two_nondirectories+0x58/0xc0
[46.583477] #2: c00000000f6d72a8 (&sb->s_type->i_mutex_key#15/4){+.+.}-{3:3}, at: lock_two_nondirectories+0x9c/0xc0
[46.583574] #3: c00000000f6d7138 (&ei->i_mmap_lock){+.+.}-{3:3}, at: btrfs_remap_file_range+0xd0/0x590
[46.583657] #4: c00000000f6d35f8 (&ei->i_mmap_lock/1){+.+.}-{3:3}, at: btrfs_remap_file_range+0xe0/0x590
[46.583743] #5: c000000007fa2550 (btrfs-tree-00){++++}-{3:3}, at: __btrfs_tree_read_lock+0x70/0x1d0
[46.583828]
[46.583828] stack backtrace:
[46.583872] CPU: 1 PID: 3835 Comm: cloner Not tainted 5.13.0-rc1 #28
[46.583931] Call Trace:
[46.583955] [c0000000167c7200] [c000000000c1ee78] dump_stack+0xec/0x144 (unreliable)
[46.584052] [c0000000167c7240] [c000000000274058] print_circular_bug.isra.32+0x3a8/0x400
[46.584123] [c0000000167c72e0] [c0000000002741f4] check_noncircular+0x144/0x190
[46.584191] [c0000000167c73b0] [c000000000278fc0] __lock_acquire+0x1e90/0x2c50
[46.584259] [c0000000167c74f0] [c00000000027aa94] lock_acquire+0x2b4/0x5b0
[46.584317] [c0000000167c75e0] [c000000000a0d6cc] start_transaction+0x3cc/0x950
[46.584388] [c0000000167c7690] [c000000000af47a4] clone_copy_inline_extent+0xe4/0x5a0
[46.584457] [c0000000167c77c0] [c000000000af525c] btrfs_clone+0x5fc/0x880
[46.584514] [c0000000167c7990] [c000000000af5698] btrfs_clone_files+0xd8/0x1c0
[46.584583] [c0000000167c7a00] [c000000000af5b58] btrfs_remap_file_range+0x3d8/0x590
[46.584652] [c0000000167c7ae0] [c0000000005d81dc] do_clone_file_range+0x10c/0x270
[46.584722] [c0000000167c7b40] [c0000000005d84f0] vfs_clone_file_range+0x1b0/0x310
[46.584793] [c0000000167c7bb0] [c00000000058bf80] ioctl_file_clone+0x90/0x130
[46.584861] [c0000000167c7c10] [c00000000058c894] do_vfs_ioctl+0x874/0x1ac0
[46.584922] [c0000000167c7d10] [c00000000058db4c] sys_ioctl+0x6c/0x120
[46.584978] [c0000000167c7d60] [c0000000000364a4] system_call_exception+0x3d4/0x410
[46.585046] [c0000000167c7e10] [c00000000000d45c] system_call_common+0xec/0x278
[46.585114] --- interrupt: c00 at 0x7ffff7e22990
[46.585160] NIP: 00007ffff7e22990 LR: 00000001000010ec CTR: 0000000000000000
[46.585224] REGS: c0000000167c7e80 TRAP: 0c00 Not tainted (5.13.0-rc1)
[46.585280] MSR: 800000000280f033 <SF,VEC,VSX,EE,PR,FP,ME,IR,DR,RI,LE> CR: 28000244 XER: 00000000
[46.585374] IRQMASK: 0
[46.585374] GPR00: 0000000000000036 00007fffffffdec0 00007ffff7f17100 0000000000000004
[46.585374] GPR04: 000000008020940d 00007fffffffdf40 0000000000000000 0000000000000000
[46.585374] GPR08: 0000000000000004 0000000000000000 0000000000000000 0000000000000000
[46.585374] GPR12: 0000000000000000 00007ffff7ffa940 0000000000000000 0000000000000000
[46.585374] GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
[46.585374] GPR20: 0000000000000000 000000009123683e 00007fffffffdf40 0000000000000000
[46.585374] GPR24: 0000000000000000 0000000000000000 0000000000000000 0000000000000004
[46.585374] GPR28: 0000000100030260 0000000100030280 0000000000000003 000000000000005f
[46.585919] NIP [00007ffff7e22990] 0x7ffff7e22990
[46.585964] LR [00000001000010ec] 0x1000010ec
[46.586010] --- interrupt: c00This should be a false positive, as both locks are acquired in read mode. Nevertheless, we don't need to hold a leaf locked when we start the transaction, so just release the leaf (path) before starting it.
--- fs/btrfs/reflink.c | 5 +++++ 1 file changed, 5 insertions(+)
fs/btrfs/reflink.c +5 -0
@@ -285,6 +285,11 @@ copy_inline_extent: ret =btrfs_inode_set_file_extent_range (BTRFS_I (dst),0 , aligned_end); out:if (!ret && !trans) { +/* +* Release path before starting a new transaction so we don't +* hold locks that would confuse lockdep. +*/ +btrfs_release_path (path);/* * No transaction here means we copied the inline extent into a * page of the destination inode.
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 206/296 btrfs: do not BUG_ON in link_to_fixup_dir
In reply to Greg Kroah-HartmanFrom: Josef Bacik <[email protected]>
[ Upstream commit 91df99a6eb50d5a1bc70fff4a09a0b7ae6aab96d ]
While doing error injection testing I got the following panic
kernel BUG at fs/btrfs/tree-log.c:1862!
invalid opcode: 0000 [#1] SMP NOPTI
CPU: 1 PID: 7836 Comm: mount Not tainted 5.13.0-rc1+ #305 Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS 1.13.0-2.fc32 04/01/2014 RIP: 0010:link_to_fixup_dir+0xd5/0xe0 RSP: 0018:ffffb5800180fa30 EFLAGS: 00010216 RAX: fffffffffffffffb RBX: 00000000fffffffb RCX: ffff8f595287faf0 RDX: ffffb5800180fa37 RSI: ffff8f5954978800 RDI: 0000000000000000 RBP: ffff8f5953af9450 R08: 0000000000000019 R09: 0000000000000001 R10: 000151f408682970 R11: 0000000120021001 R12: ffff8f5954978800 R13: ffff8f595287faf0 R14: ffff8f5953c77dd0 R15: 0000000000000065 FS: 00007fc5284c8c40(0000) GS:ffff8f59bbd00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007fc5287f47c0 CR3: 000000011275e002 CR4: 0000000000370ee0 Call Trace: replay_one_buffer+0x409/0x470 ? btree_read_extent_buffer_pages+0xd0/0x110 walk_up_log_tree+0x157/0x1e0 walk_log_tree+0xa6/0x1d0 btrfs_recover_log_trees+0x1da/0x360 ? replay_one_extent+0x7b0/0x7b0 open_ctree+0x1486/0x1720 btrfs_mount_root.cold+0x12/0xea ? __kmalloc_track_caller+0x12f/0x240 legacy_get_tree+0x24/0x40 vfs_get_tree+0x22/0xb0 vfs_kern_mount.part.0+0x71/0xb0 btrfs_mount+0x10d/0x380 ? vfs_parse_fs_string+0x4d/0x90 legacy_get_tree+0x24/0x40 vfs_get_tree+0x22/0xb0 path_mount+0x433/0xa10 __x64_sys_mount+0xe3/0x120 do_syscall_64+0x3d/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae
We can get -EIO or any number of legitimate errors from btrfs_search_slot(), panicing here is not the appropriate response. The error path for this code handles errors properly, simply return the error.
--- fs/btrfs/tree-log.c | 2 -- 1 file changed, 2 deletions(-)
fs/btrfs/tree-log.c +0 -2
@@ -1858,8 +1858,6 @@ static noinline int link_to_fixup_dir(struct btrfs_trans_handle *trans, ret =btrfs_update_inode (trans, root,BTRFS_I (inode)); }else if (ret == -EEXIST ) { ret =0 ; - }else { -BUG ();/* Logic Error */ }iput (inode);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 207/296 ALSA: dice: disable double_pcm_frames mode for M-Audio Profire 610, 2626 and Avid M-Box 3 Pro
In reply to Greg Kroah-HartmanFrom: Takashi Sakamoto <[email protected]>
[ Upstream commit 9f079c1bdc9087842dc5ac9d81b1d7f2578e81ce ]
ALSA dice driver detects jumbo payload at high sampling transfer frequency for below models:
* Avid M-Box 3 Pro
* M-Audio Profire 610
* M-Audio Profire 2626
Although many DICE-based devices have a quirk at high sampling transfer frequency to multiplex double number of PCM frames into data block than the number in IEC 61883-1/6, the above devices are just compliant to IEC 61883-1/6.
This commit disables the mode of double_pcm_frames for the models.
--- sound/firewire/dice/dice-pcm.c | 4 ++-- sound/firewire/dice/dice-stream.c | 2 +- sound/firewire/dice/dice.c | 24 ++++++++++++++++++++++++ sound/firewire/dice/dice.h | 3 ++- 4 files changed, 29 insertions(+), 4 deletions(-)
sound/firewire/dice/dice-pcm.c +2 -2
@@ -218,7 +218,7 @@ static int pcm_open(struct snd_pcm_substream *substream)if (frames_per_period >0 ) {// For double_pcm_frame quirk. -if (rate >96000 ) { +if (rate >96000 && !dice->disable_double_pcm_frames) { frames_per_period *=2 ; frames_per_buffer *=2 ; }
@@ -273,7 +273,7 @@ static int pcm_hw_params(struct snd_pcm_substream *substream,mutex_lock (&dice->mutex);// For double_pcm_frame quirk. -if (rate >96000 ) { +if (rate >96000 && !dice->disable_double_pcm_frames) { events_per_period /=2 ; events_per_buffer /=2 ; }
sound/firewire/dice/dice-stream.c +1 -1
@@ -181,7 +181,7 @@ static int keep_resources(struct snd_dice *dice, struct amdtp_stream *stream,// as 'Dual Wire'. // For this quirk, blocking mode is required and PCM buffer size should // be aligned to SYT_INTERVAL. - double_pcm_frames = rate >96000 ; + double_pcm_frames = (rate >96000 && !dice->disable_double_pcm_frames);if (double_pcm_frames) { rate /=2 ; pcm_chs *=2 ;
sound/firewire/dice/dice.c +24 -0
@@ -21,6 +21,7 @@ MODULE_LICENSE("GPL v2");#define OUI_SSL 0x0050c2 // Actually ID reserved by IEEE.#define OUI_PRESONUS 0x000a92#define OUI_HARMAN 0x000fd7 +#define OUI_AVID 0x00a07e#define DICE_CATEGORY_ID 0x04#define WEISS_CATEGORY_ID 0x00
@@ -222,6 +223,14 @@ static int dice_probe(struct fw_unit *unit, (snd_dice_detect_formats_t )entry->driver_data; } +// Below models are compliant to IEC 61883-1/6 and have no quirk at high sampling transfer +// frequency. +// * Avid M-Box 3 Pro +// * M-Audio Profire 610 +// * M-Audio Profire 2626 +if (entry->vendor_id ==OUI_MAUDIO || entry->vendor_id ==OUI_AVID ) + dice->disable_double_pcm_frames = true; +spin_lock_init (&dice->lock);mutex_init (&dice->mutex);init_completion (&dice->clock_accepted);
@@ -278,7 +287,22 @@ static void dice_bus_reset(struct fw_unit *unit)#define DICE_INTERFACE 0x000001 +#define DICE_DEV_ENTRY_TYPICAL (vendor, model, data) \ + { \ + .match_flags = IEEE1394_MATCH_VENDOR_ID | \ + IEEE1394_MATCH_MODEL_ID | \ + IEEE1394_MATCH_SPECIFIER_ID | \ + IEEE1394_MATCH_VERSION, \ + .vendor_id = (vendor), \ + .model_id = (model), \ + .specifier_id = (vendor), \ + .version = DICE_INTERFACE, \ + .driver_data = (kernel_ulong_t)(data), \ + } +static const struct ieee1394_device_id dice_id_table[] = { +// Avid M-Box 3 Pro. To match in probe function. +DICE_DEV_ENTRY_TYPICAL (OUI_AVID ,0x000004 , snd_dice_detect_extension_formats),/* M-Audio Profire 2626 has a different value in version field. */ { .match_flags = IEEE1394_MATCH_VENDOR_ID |
sound/firewire/dice/dice.h +2 -1
@@ -109,7 +109,8 @@ struct snd_dice {struct fw_iso_resources rx_resources[MAX_STREAMS ];struct amdtp_stream tx_stream[MAX_STREAMS ];struct amdtp_stream rx_stream[MAX_STREAMS ]; -bool global_enabled; + bool global_enabled:1; + bool disable_double_pcm_frames:1;struct completion clock_accepted;unsigned int substreams_counter;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 208/296 platform/x86: hp-wireless: add AMDs hardware id to the supported list
In reply to Greg Kroah-HartmanFrom: Shyam Sundar S K <[email protected]>
[ Upstream commit f048630bdd55eb5379ef35f971639fe52fabe499 ]
Newer AMD based laptops uses AMDI0051 as the hardware id to support the airplane mode button. Adding this to the supported list.
--- drivers/platform/x86/hp-wireless.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/platform/x86/hp-wireless.c +2 -0
@@ -17,12 +17,14 @@ MODULE_LICENSE("GPL");MODULE_AUTHOR ("Alex Hung" );MODULE_ALIAS ("acpi*:HPQ6001:*" );MODULE_ALIAS ("acpi*:WSTADEF:*" ); +MODULE_ALIAS ("acpi*:AMDI0051:*" );static struct input_dev *hpwl_input_dev;static const struct acpi_device_id hpwl_ids[] = { {"HPQ6001" ,0 }, {"WSTADEF" ,0 }, + {"AMDI0051" ,0 }, {"" ,0 }, };
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 209/296 platform/x86: intel_punit_ipc: Append MODULE_DEVICE_TABLE for ACPI
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit bc1eca606d8084465e6f89fd646cc71defbad490 ]
The intel_punit_ipc driver might be compiled as a module. When udev handles the event of the devices appearing the intel_punit_ipc module is missing.
Append MODULE_DEVICE_TABLE for ACPI case to fix the loading issue.
--- drivers/platform/x86/intel_punit_ipc.c | 1 + 1 file changed, 1 insertion(+)
drivers/platform/x86/intel_punit_ipc.c +1 -0
@@ -312,6 +312,7 @@ static const struct acpi_device_id punit_ipc_acpi_ids[] = { { "INT34D4", 0 }, { } }; +MODULE_DEVICE_TABLE (acpi, punit_ipc_acpi_ids);static struct platform_driver intel_punit_ipc_driver = { .probe = intel_punit_ipc_probe,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 210/296 platform/x86: touchscreen_dmi: Add info for the Mediacom Winpad 7.0 W700 tablet
In reply to Greg Kroah-HartmanFrom: Teava Radu <[email protected]>
[ Upstream commit 39a6172ea88b3117353ae16cbb0a53cd80a9340a ]
Add touchscreen info for the Mediacom Winpad 7.0 W700 tablet. Tested on 5.11 hirsute.
Note: it's hw clone to Wintron surftab 7.
--- drivers/platform/x86/touchscreen_dmi.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/platform/x86/touchscreen_dmi.c +8 -0
@@ -1070,6 +1070,14 @@ const struct dmi_system_id touchscreen_dmi_table[] = { DMI_MATCH(DMI_BIOS_VERSION, "jumperx.T87.KFBNEEA"), }, }, + { +/* Mediacom WinPad 7.0 W700 (same hw as Wintron surftab 7") */ + .driver_data = (void *)&trekstor_surftab_wintron70_data, + .matches = { +DMI_MATCH (DMI_SYS_VENDOR ,"MEDIACOM" ), + DMI_MATCH(DMI_PRODUCT_NAME, "WinPad 7 W10 - WPW700"), + }, + }, {/* Mediacom Flexbook Edge 11 (same hw as TS Primebook C11) */ .driver_data = (void *)&trekstor_primebook_c11_data,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 211/296 SMB3: incorrect file id in requests compounded with open
In reply to Greg Kroah-HartmanFrom: Steve French <[email protected]>
[ Upstream commit c0d46717b95735b0eacfddbcca9df37a49de9c7a ]
See MS-SMB2 3.2.4.1.4, file ids in compounded requests should be set to 0xFFFFFFFFFFFFFFFF (we were treating it as u32 not u64 and setting it incorrectly).
--- fs/cifs/smb2pdu.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
fs/cifs/smb2pdu.c +3 -3
@@ -3907,10 +3907,10 @@ smb2_new_read_req(void **buf, unsigned int *total_len,* Related requests use info from previous read request * in chain. */ - shdr->SessionId =0xFFFFFFFF ; + shdr->SessionId =0xFFFFFFFFFFFFFFFF ; shdr->TreeId =0xFFFFFFFF ; - req->PersistentFileId =0xFFFFFFFF ; - req->VolatileFileId =0xFFFFFFFF ; + req->PersistentFileId =0xFFFFFFFFFFFFFFFF ; + req->VolatileFileId =0xFFFFFFFFFFFFFFFF ; } }if (remaining_bytes > io_parms->length)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 212/296 drm/amd/display: Disconnect non-DP with no EDID
In reply to Greg Kroah-HartmanFrom: Chris Park <[email protected]>
[ Upstream commit 080039273b126eeb0185a61c045893a25dbc046e ]
[Why]
Active DP dongles return no EDID when dongle is connected, but VGA display is taken out. Current driver behavior does not remove the active display when this happens, and this is a gap between dongle DTP and dongle behavior.
[How]
For active DP dongles and non-DP scenario,
disconnect sink on detection when no EDID
is read due to timeout.
--- drivers/gpu/drm/amd/display/dc/core/dc_link.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+)
drivers/gpu/drm/amd/display/dc/core/dc_link.c +18 -0
@@ -1067,6 +1067,24 @@ static bool dc_link_detect_helper(struct dc_link *link, dc_is_dvi_signal(link->connector_signal)) {if (prev_sink)dc_sink_release (prev_sink); +link_disconnect_sink (link); + +return false; + } +/* +* Abort detection for DP connectors if we have +* no EDID and connector is active converter +* as there are no display downstream +* +*/ +if (dc_is_dp_sst_signal (link->connector_signal) && + (link->dpcd_caps.dongle_type == +DISPLAY_DONGLE_DP_VGA_CONVERTER || + link->dpcd_caps.dongle_type == +DISPLAY_DONGLE_DP_DVI_CONVERTER )) { +if (prev_sink) +dc_sink_release (prev_sink); +link_disconnect_sink (link);return false; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 213/296 drm/amd/amdgpu: fix refcount leak
In reply to Greg Kroah-HartmanFrom: Jingwen Chen <[email protected]>
[ Upstream commit fa7e6abc75f3d491bc561734312d065dc9dc2a77 ]
[Why]
the gem object rfb->base.obj[0] is get according to num_planes in amdgpufb_create, but is not put according to num_planes
[How]
put rfb->base.obj[0] in amdgpu_fbdev_destroy according to num_planes
--- drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_fb.c +3 -0
@@ -290,10 +290,13 @@ out:static int amdgpu_fbdev_destroy (struct drm_device *dev,struct amdgpu_fbdev *rfbdev) {struct amdgpu_framebuffer *rfb = &rfbdev->rfb; +int i;drm_fb_helper_unregister_fbi (&rfbdev->helper);if (rfb->base.obj[0 ]) { +for (i =0 ; i < rfb->base.format->num_planes; i++) +drm_gem_object_put (rfb->base.obj[0 ]);amdgpufb_destroy_pinned_object (rfb->base.obj[0 ]); rfb->base.obj[0 ] =NULL ;drm_framebuffer_unregister_private (&rfb->base);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 214/296 drm/amdgpu: Fix a use-after-free
In reply to Greg Kroah-HartmanFrom: xinhui pan <[email protected]>
[ Upstream commit 1e5c37385097c35911b0f8a0c67ffd10ee1af9a2 ]
looks like we forget to set ttm->sg to NULL.
Hit panic below
[ 1235.844104] general protection fault, probably for non-canonical address 0x6b6b6b6b6b6b7b4b: 0000 [#1] SMP DEBUG_PAGEALLOC NOPTI [ 1235.989074] Call Trace: [ 1235.991751] sg_free_table+0x17/0x20 [ 1235.995667] amdgpu_ttm_backend_unbind.cold+0x4d/0xf7 [amdgpu] [ 1236.002288] amdgpu_ttm_backend_destroy+0x29/0x130 [amdgpu] [ 1236.008464] ttm_tt_destroy+0x1e/0x30 [ttm] [ 1236.013066] ttm_bo_cleanup_memtype_use+0x51/0xa0 [ttm] [ 1236.018783] ttm_bo_release+0x262/0xa50 [ttm] [ 1236.023547] ttm_bo_put+0x82/0xd0 [ttm] [ 1236.027766] amdgpu_bo_unref+0x26/0x50 [amdgpu] [ 1236.032809] amdgpu_amdkfd_gpuvm_alloc_memory_of_gpu+0x7aa/0xd90 [amdgpu] [ 1236.040400] kfd_ioctl_alloc_memory_of_gpu+0xe2/0x330 [amdgpu] [ 1236.046912] kfd_ioctl+0x463/0x690 [amdgpu]
--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -0
@@ -1287,6 +1287,7 @@ static void amdgpu_ttm_tt_unpopulate(struct ttm_bo_device *bdev,if (gtt && gtt->userptr) {amdgpu_ttm_tt_set_user_pages (ttm,NULL );kfree (ttm->sg); + ttm->sg =NULL ; ttm->page_flags &= ~TTM_PAGE_FLAG_SG ;return ; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 215/296 drm/amd/amdgpu: fix a potential deadlock in gpu reset
In reply to Greg Kroah-HartmanFrom: Lang Yu <[email protected]>
[ Upstream commit 9c2876d56f1ce9b6b2072f1446fb1e8d1532cb3d ]
When amdgpu_ib_ring_tests failed, the reset logic called amdgpu_device_ip_suspend twice, then deadlock occurred. Deadlock log:
[ 805.655192] amdgpu 0000:04:00.0: amdgpu: ib ring test failed (-110). [ 806.290952] [drm] free PSP TMR buffer
[ 806.319406] ============================================
[ 806.320315] WARNING: possible recursive locking detected
[ 806.321225] 5.11.0-custom #1 Tainted: G W OEL
[ 806.322135] --------------------------------------------
[ 806.323043] cat/2593 is trying to acquire lock:
[ 806.323825] ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.325668]
but task is already holding lock:
[ 806.326664] ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.328430]
other info that might help us debug this:
[ 806.329539] Possible unsafe locking scenario:[ 806.330549] CPU0
[ 806.330983] ----
[ 806.331416] lock(&adev->dm.dc_lock);
[ 806.332086] lock(&adev->dm.dc_lock);
[ 806.332738]
*** DEADLOCK ***[ 806.333747] May be due to missing lock nesting notation
[ 806.334899] 3 locks held by cat/2593:
[ 806.335537] #0: ffff888100d3f1b8 (&attr->mutex){+.+.}-{3:3}, at: simple_attr_read+0x4e/0x110
[ 806.337009] #1: ffff888136b1fd78 (&adev->reset_sem){++++}-{3:3}, at: amdgpu_device_lock_adev+0x42/0x94 [amdgpu]
[ 806.339018] #2: ffff888136b1cdc8 (&adev->dm.dc_lock){+.+.}-{3:3}, at: dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.340869]
stack backtrace:
[ 806.341621] CPU: 6 PID: 2593 Comm: cat Tainted: G W OEL 5.11.0-custom #1
[ 806.342921] Hardware name: AMD Celadon-CZN/Celadon-CZN, BIOS WLD0C23N_Weekly_20_12_2 12/23/2020
[ 806.344413] Call Trace:
[ 806.344849] dump_stack+0x93/0xbd
[ 806.345435] __lock_acquire.cold+0x18a/0x2cf
[ 806.346179] lock_acquire+0xca/0x390
[ 806.346807] ? dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.347813] __mutex_lock+0x9b/0x930
[ 806.348454] ? dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.349434] ? amdgpu_device_indirect_rreg+0x58/0x70 [amdgpu]
[ 806.350581] ? _raw_spin_unlock_irqrestore+0x47/0x50
[ 806.351437] ? dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.352437] ? rcu_read_lock_sched_held+0x4f/0x80
[ 806.353252] ? rcu_read_lock_sched_held+0x4f/0x80
[ 806.354064] mutex_lock_nested+0x1b/0x20
[ 806.354747] ? mutex_lock_nested+0x1b/0x20
[ 806.355457] dm_suspend+0xb8/0x1d0 [amdgpu]
[ 806.356427] ? soc15_common_set_clockgating_state+0x17d/0x19 [amdgpu]
[ 806.357736] amdgpu_device_ip_suspend_phase1+0x78/0xd0 [amdgpu]
[ 806.360394] amdgpu_device_ip_suspend+0x21/0x70 [amdgpu]
[ 806.362926] amdgpu_device_pre_asic_reset+0xb3/0x270 [amdgpu]
[ 806.365560] amdgpu_device_gpu_recover.cold+0x679/0x8eb [amdgpu]--- drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 1 - 1 file changed, 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +0 -1
@@ -4356,7 +4356,6 @@ out: r =amdgpu_ib_ring_tests (tmp_adev);if (r) {dev_err (tmp_adev->dev,"ib ring test failed (%d).\n" , r); - r =amdgpu_device_ip_suspend (tmp_adev); need_full_reset = true; r = -EAGAIN ; goto end;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 216/296 drm/amdgpu: stop touching sched.ready in the backend
In reply to Greg Kroah-HartmanFrom: Christian König <[email protected]>
[ Upstream commit a2b4785f01280a4291edb9fda69032fc2e4bfd3f ]
This unfortunately comes up in regular intervals and breaks GPU reset for the engine in question.
The sched.ready flag controls if an engine can't get working during hw_init, but should never be set to false during hw_fini.
v2: squash in unused variable fix (Alex)
--- drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c | 2 -- drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c | 2 -- drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c | 5 ----- drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c | 8 +------- 4 files changed, 1 insertion(+), 16 deletions(-)
drivers/gpu/drm/amd/amdgpu/jpeg_v2_5.c +0 -2
@@ -198,8 +198,6 @@ static int jpeg_v2_5_hw_fini(void *handle)if (adev->jpeg.cur_state !=AMD_PG_STATE_GATE &&RREG32_SOC15 (JPEG , i, mmUVD_JRBC_STATUS))jpeg_v2_5_set_powergating_state (adev,AMD_PG_STATE_GATE ); - - ring->sched.ready = false; }return 0 ;
drivers/gpu/drm/amd/amdgpu/jpeg_v3_0.c +0 -2
@@ -166,8 +166,6 @@ static int jpeg_v3_0_hw_fini(void *handle) RREG32_SOC15(JPEG, 0, mmUVD_JRBC_STATUS))jpeg_v3_0_set_powergating_state (adev,AMD_PG_STATE_GATE ); - ring->sched.ready = false; -return 0 ; }
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +0 -5
@@ -470,11 +470,6 @@ static void sdma_v5_2_gfx_stop(struct amdgpu_device *adev) ib_cntl =REG_SET_FIELD (ib_cntl,SDMA0_GFX_IB_CNTL ,IB_ENABLE ,0 );WREG32 (sdma_v5_2_get_reg_offset (adev, i, mmSDMA0_GFX_IB_CNTL), ib_cntl); } - - sdma0->sched.ready = false; - sdma1->sched.ready = false; - sdma2->sched.ready = false; - sdma3->sched.ready = false; }/**
drivers/gpu/drm/amd/amdgpu/vcn_v3_0.c +1 -7
@@ -368,7 +368,7 @@ static int vcn_v3_0_hw_fini(void *handle) {struct amdgpu_device *adev = (struct amdgpu_device *)handle;struct amdgpu_ring *ring; -int i, j; +int i;for (i =0 ; i < adev->vcn.num_vcn_inst; ++i) {if (adev->vcn.harvest_config & (1 << i))
@@ -383,12 +383,6 @@ static int vcn_v3_0_hw_fini(void *handle)vcn_v3_0_set_powergating_state (adev,AMD_PG_STATE_GATE ); } } - ring->sched.ready = false; - -for (j =0 ; j < adev->vcn.num_enc_rings; ++j) { - ring = &adev->vcn.inst[i].ring_enc[j]; - ring->sched.ready = false; - } }return 0 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 217/296 platform/x86: touchscreen_dmi: Add info for the Chuwi Hi10 Pro (CWI529) tablet
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
[ Upstream commit e68671e9e1275dfdda333c3e83b6d28963af16b6 ]
Add touchscreen info for the Chuwi Hi10 Pro (CWI529) tablet. This includes info for getting the firmware directly from the UEFI, so that the user does not need to manually install the firmware in /lib/firmware/silead.
This change will make the touchscreen on these devices work OOTB, without requiring any manual setup.
--- drivers/platform/x86/touchscreen_dmi.c | 35 ++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
drivers/platform/x86/touchscreen_dmi.c +35 -0
@@ -115,6 +115,32 @@ static const struct ts_dmi_data chuwi_hi10_plus_data = { .properties = chuwi_hi10_plus_props, }; +static const struct property_entry chuwi_hi10_pro_props[] = { +PROPERTY_ENTRY_U32 ("touchscreen-min-x" ,8 ), +PROPERTY_ENTRY_U32 ("touchscreen-min-y" ,8 ), +PROPERTY_ENTRY_U32 ("touchscreen-size-x" ,1912 ), +PROPERTY_ENTRY_U32 ("touchscreen-size-y" ,1272 ), +PROPERTY_ENTRY_BOOL ("touchscreen-swapped-x-y" ), +PROPERTY_ENTRY_STRING ("firmware-name" ,"gsl1680-chuwi-hi10-pro.fw" ), +PROPERTY_ENTRY_U32 ("silead,max-fingers" ,10 ), +PROPERTY_ENTRY_BOOL ("silead,home-button" ), + { } +}; + +static const struct ts_dmi_data chuwi_hi10_pro_data = { + .embedded_fw = { + .name ="silead/gsl1680-chuwi-hi10-pro.fw" , + .prefix = {0xf0 ,0x00 ,0x00 ,0x00 ,0x02 ,0x00 ,0x00 ,0x00 }, + .length =42504 , + .sha256 = {0xdb ,0x92 ,0x68 ,0xa8 ,0xdb ,0x81 ,0x31 ,0x00 , +0x1f ,0x58 ,0x89 ,0xdb ,0x19 ,0x1b ,0x15 ,0x8c , +0x05 ,0x14 ,0xf4 ,0x95 ,0xba ,0x15 ,0x45 ,0x98 , +0x42 ,0xa3 ,0xbb ,0x65 ,0xe3 ,0x30 ,0xa5 ,0x93 }, + }, + .acpi_name ="MSSL1680:00" , + .properties = chuwi_hi10_pro_props, +}; +static const struct property_entry chuwi_vi8_props[] = {PROPERTY_ENTRY_U32 ("touchscreen-min-x" ,4 ),PROPERTY_ENTRY_U32 ("touchscreen-min-y" ,6 ),
@@ -889,6 +915,15 @@ const struct dmi_system_id touchscreen_dmi_table[] = { DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), }, }, + { +/* Chuwi Hi10 Prus (CWI597) */ + .driver_data = (void *)&chuwi_hi10_pro_data, + .matches = { +DMI_MATCH (DMI_BOARD_VENDOR ,"Hampoo" ), +DMI_MATCH (DMI_PRODUCT_NAME ,"Hi10 pro tablet" ), + DMI_MATCH(DMI_BOARD_NAME, "Cherry Trail CR"), + }, + }, {/* Chuwi Vi8 (CWI506) */ .driver_data = (void *)&chuwi_vi8_data,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 218/296 block: fix a race between del_gendisk and BLKRRPART
In reply to Greg Kroah-HartmanFrom: Gulam Mohamed <[email protected]>
[ Upstream commit bc6a385132601c29a6da1dbf8148c0d3c9ad36dc ]
When BLKRRPART is called concurrently with del_gendisk, the partitions rescan can create a stale partition that will never be be cleaned up.
Fix this by checking the the disk is up before rescanning partitions while under bd_mutex.
--- fs/block_dev.c | 3 +++ 1 file changed, 3 insertions(+)
fs/block_dev.c +3 -0
@@ -1244,6 +1244,9 @@ int bdev_disk_changed(struct block_device *bdev, bool invalidate)lockdep_assert_held (&bdev->bd_mutex); +if (!(disk->flags &GENHD_FL_UP )) +return -ENXIO ; + rescan: ret =blk_drop_partitions (bdev);if (ret)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 219/296 linux/bits.h: fix compilation error with GENMASK
In reply to Greg Kroah-HartmanFrom: Rikard Falkeborn <[email protected]>
[ Upstream commit f747e6667ebb2ffb8133486c9cd19800d72b0d98 ]
GENMASK() has an input check which uses __builtin_choose_expr() to enable a compile time sanity check of its inputs if they are known at compile time.
However, it turns out that __builtin_constant_p() does not always return a compile time constant [0]. It was thought this problem was fixed with gcc 4.9 [1], but apparently this is not the case [2].
Switch to use __is_constexpr() instead which always returns a compile time constant, regardless of its inputs.
--- include/linux/bits.h | 2 +- include/linux/const.h | 8 ++++++++ include/linux/minmax.h | 10 ++-------- tools/include/linux/bits.h | 2 +- tools/include/linux/const.h | 8 ++++++++ 5 files changed, 20 insertions(+), 10 deletions(-)
include/linux/bits.h +1 -1
@@ -22,7 +22,7 @@#include <linux/build_bug.h> #define GENMASK_INPUT_CHECK (h, l) \ (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \ - __builtin_constant_p((l) > (h)), (l) > (h), 0))) + __is_constexpr((l) > (h)), (l) > (h), 0)))#else /* * BUILD_BUG_ON_ZERO is not available in h files included from asm files,
include/linux/const.h +8 -0
@@ -3,4 +3,12 @@#include <vdso/const.h> +/* +* This returns a constant expression while determining if an argument is +* a constant expression, most importantly without evaluating the argument. +* Glory to Martin Uecker <[email protected]> +*/ +#define __is_constexpr (x) \ + (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8))) +#endif /* _LINUX_CONST_H */
include/linux/minmax.h +2 -8
@@ -2,6 +2,8 @@#ifndef _LINUX_MINMAX_H#define _LINUX_MINMAX_H +#include <linux/const.h> +/* * min()/max()/clamp() macros must accomplish three things: *
@@ -17,14 +19,6 @@#define __typecheck (x, y) \ (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1))) -/* -* This returns a constant expression while determining if an argument is -* a constant expression, most importantly without evaluating the argument. -* Glory to Martin Uecker <[email protected]> -*/ -#define __is_constexpr (x) \ - (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8))) -#define __no_side_effects (x, y) \ (__is_constexpr(x) && __is_constexpr(y))
tools/include/linux/bits.h +1 -1
@@ -22,7 +22,7 @@#include <linux/build_bug.h> #define GENMASK_INPUT_CHECK (h, l) \ (BUILD_BUG_ON_ZERO(__builtin_choose_expr( \ - __builtin_constant_p((l) > (h)), (l) > (h), 0))) + __is_constexpr((l) > (h)), (l) > (h), 0)))#else /* * BUILD_BUG_ON_ZERO is not available in h files included from asm files,
tools/include/linux/const.h +8 -0
@@ -3,4 +3,12 @@#include <vdso/const.h> +/* +* This returns a constant expression while determining if an argument is +* a constant expression, most importantly without evaluating the argument. +* Glory to Martin Uecker <[email protected]> +*/ +#define __is_constexpr (x) \ + (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8))) +#endif /* _LINUX_CONST_H */
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 220/296 spi: take the SPI IO-mutex in the spi_set_cs_timing method
In reply to Greg Kroah-HartmanFrom: Leilk Liu <[email protected]>
[ Upstream commit dc5fa590273890a8541ce6e999d606bfb2d73797 ]
this patch takes the io_mutex to prevent an unprotected HW register modification in the set_cs_timing callback.
--- drivers/spi/spi.c | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-)
drivers/spi/spi.c +7 -2
@@ -3463,9 +3463,12 @@ int spi_set_cs_timing(struct spi_device *spi, struct spi_delay *setup,if (spi->controller->set_cs_timing && !(spi->cs_gpiod ||gpio_is_valid (spi->cs_gpio))) { +mutex_lock (&spi->controller->io_mutex); +if (spi->controller->auto_runtime_pm) { status =pm_runtime_get_sync (parent);if (status <0 ) { +mutex_unlock (&spi->controller->io_mutex);pm_runtime_put_noidle (parent);dev_err (&spi->controller->dev,"Failed to power device: %d\n" , status);
@@ -3476,11 +3479,13 @@ int spi_set_cs_timing(struct spi_device *spi, struct spi_delay *setup, hold, inactive);pm_runtime_mark_last_busy (parent);pm_runtime_put_autosuspend (parent); -return status; }else { -return spi->controller->set_cs_timing (spi, setup, hold, + status = spi->controller->set_cs_timing (spi, setup, hold, inactive); } + +mutex_unlock (&spi->controller->io_mutex); +return status; } if ((setup && setup->unit == SPI_DELAY_UNIT_SCK) ||
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 221/296 net: netcp: Fix an error message
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit ddb6e00f8413e885ff826e32521cff7924661de0 ]
'ret' is known to be 0 here.
The expected error code is stored in 'tx_pipe->dma_queue', so use it instead.
While at it, switch from %d to %pe which is more user friendly.
--- drivers/net/ethernet/ti/netcp_core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/net/ethernet/ti/netcp_core.c +2 -2
@@ -1350,8 +1350,8 @@ int netcp_txpipe_open(struct netcp_tx_pipe *tx_pipe) tx_pipe->dma_queue =knav_queue_open (name, tx_pipe->dma_queue_id,KNAV_QUEUE_SHARED );if (IS_ERR (tx_pipe->dma_queue)) { -dev_err (dev,"Could not open DMA queue for channel \"%s\": %d\n" , - name, ret); +dev_err (dev,"Could not open DMA queue for channel \"%s\": %pe\n" , + name, tx_pipe->dma_queue); ret =PTR_ERR (tx_pipe->dma_queue); goto err; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 222/296 net: dsa: fix error code getting shifted with 4 in dsa_slave_get_sset_count
In reply to Greg Kroah-HartmanFrom: Vladimir Oltean <[email protected]>
[ Upstream commit b94cbc909f1d80378a1f541968309e5c1178c98b ]
DSA implements a bunch of 'standardized' ethtool statistics counters, namely tx_packets, tx_bytes, rx_packets, rx_bytes. So whatever the hardware driver returns in .get_sset_count(), we need to add 4 to that.
That is ok, except that .get_sset_count() can return a negative error code, for example:
b53_get_sset_count
-> phy_ethtool_get_sset_count
-> return -EIO
-EIO is -5, and with 4 added to it, it becomes -1, aka -EPERM. One can imagine that certain error codes may even become positive, although based on code inspection I did not see instances of that.
Check the error code first, if it is negative return it as-is.
Based on a similar patch for dsa_master_get_strings from Dan Carpenter:
https://patchwork.kernel.org/project/netdevbpf/patch/YJaSe3RPgn7gKxZv@mwanda/
--- net/dsa/slave.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-)
net/dsa/slave.c +7 -5
@@ -787,13 +787,15 @@ static int dsa_slave_get_sset_count(struct net_device *dev, int sset)struct dsa_switch *ds = dp->ds;if (sset ==ETH_SS_STATS ) { -int count; +int count =0 ; - count =4 ; -if (ds->ops->get_sset_count) - count += ds->ops->get_sset_count (ds, dp->index, sset); +if (ds->ops->get_sset_count) { + count = ds->ops->get_sset_count (ds, dp->index, sset); +if (count <0 ) +return count; + } -return count; +return count +4 ; }return -EOPNOTSUPP ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 223/296 interconnect: qcom: bcm-voter: add a missing of_node_put()
In reply to Greg Kroah-HartmanFrom: Subbaraman Narayanamurthy <[email protected]>
[ Upstream commit a00593737f8bac2c9e97b696e7ff84a4446653e8 ]
Add a missing of_node_put() in of_bcm_voter_get() to avoid the reference leak.
--- drivers/interconnect/qcom/bcm-voter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/interconnect/qcom/bcm-voter.c +2 -1
@@ -1,6 +1,6 @@// SPDX-License-Identifier: GPL-2.0 /* -* Copyright (c) 2020, The Linux Foundation. All rights reserved. +* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. */ #include <asm/div64.h>
@@ -205,6 +205,7 @@ struct bcm_voter *of_bcm_voter_get(struct device *dev, const char *name) }mutex_unlock (&bcm_voter_lock); +of_node_put (node);return voter; }EXPORT_SYMBOL_GPL (of_bcm_voter_get);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 224/296 interconnect: qcom: Add missing MODULE_DEVICE_TABLE
In reply to Greg Kroah-HartmanFrom: Zou Wei <[email protected]>
[ Upstream commit 1fd86e280d8b21762901e43d42d66dbfe8b8e0d3 ]
This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module.
--- drivers/interconnect/qcom/bcm-voter.c | 1 + 1 file changed, 1 insertion(+)
drivers/interconnect/qcom/bcm-voter.c +1 -0
@@ -363,6 +363,7 @@ static const struct of_device_id bcm_voter_of_match[] = { { .compatible = "qcom,bcm-voter" }, { } }; +MODULE_DEVICE_TABLE (of, bcm_voter_of_match);static struct platform_driver qcom_icc_bcm_voter_driver = { .probe = qcom_icc_bcm_voter_probe,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 225/296 usb: cdnsp: Fix lack of removing request from pending list.
In reply to Greg Kroah-HartmanFrom: Pawel Laszczak <[email protected]>
[ Upstream commit 3b414d1b0107fa51ad6063de9752d4b2a8063980 ]
Patch fixes lack of removing request from ep->pending_list on failure of the stop endpoint command. Driver even after failing this command must remove request from ep->pending_list.
Without this fix driver can stuck in cdnsp_gadget_ep_disable function in loop:
while (!list_empty(&pep->pending_list)) {
preq = next_request(&pep->pending_list);
cdnsp_ep_dequeue(pep, preq);
}--- drivers/usb/cdns3/cdnsp-gadget.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/usb/cdns3/cdnsp-gadget.c +7 -7
@@ -422,17 +422,17 @@ unmap:int cdnsp_ep_dequeue (struct cdnsp_ep *pep,struct cdnsp_request *preq) {struct cdnsp_device *pdev = pep->pdev; -int ret; +int ret_stop =0 ; +int ret_rem;trace_cdnsp_request_dequeue (preq); -if (GET_EP_CTX_STATE (pep->out_ctx) ==EP_STATE_RUNNING ) { - ret =cdnsp_cmd_stop_ep (pdev, pep); -if (ret) -return ret; - } +if (GET_EP_CTX_STATE (pep->out_ctx) ==EP_STATE_RUNNING ) + ret_stop =cdnsp_cmd_stop_ep (pdev, pep); + + ret_rem =cdnsp_remove_request (pdev, preq, pep); -return cdnsp_remove_request (pdev, preq, pep); +return ret_rem ? ret_rem : ret_stop; }static void cdnsp_zero_in_ctx (struct cdnsp_device *pdev)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 226/296 ASoC: cs42l42: Regmap must use_single_read/write
In reply to Greg Kroah-HartmanFrom: Richard Fitzgerald <[email protected]>
[ Upstream commit 0fad605fb0bdc00d8ad78696300ff2fbdee6e048 ]
cs42l42 does not support standard burst transfers so the use_single_read and use_single_write flags must be set in the regmap config.
Because of this bug, the patch:
commit 0a0eb567e1d4 ("ASoC: cs42l42: Minor error paths fixups")
broke cs42l42 probe() because without the use_single_* flags it causes regmap to issue a burst read.
However, the missing use_single_* could cause problems anyway because the regmap cache can attempt burst transfers if these flags are not set.
--- sound/soc/codecs/cs42l42.c | 3 +++ 1 file changed, 3 insertions(+)
sound/soc/codecs/cs42l42.c +3 -0
@@ -398,6 +398,9 @@ static const struct regmap_config cs42l42_regmap = { .reg_defaults = cs42l42_reg_defaults, .num_reg_defaults = ARRAY_SIZE(cs42l42_reg_defaults), .cache_type = REGCACHE_RBTREE, + + .use_single_read = true, + .use_single_write = true, }; static DECLARE_TLV_DB_SCALE(adc_tlv, -9600, 100, false);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 227/296 net: stmmac: Fix MAC WoL not working if PHY does not support WoL
In reply to Greg Kroah-HartmanFrom: Joakim Zhang <[email protected]>
[ Upstream commit 576f9eacc680d2b1f37e8010cff62f7b227ea769 ]
Both get and set WoL will check device_can_wakeup(), if MAC supports PMT, it will set device wakeup capability. After commit 1d8e5b0f3f2c ("net: stmmac:
Support WOL with phy"), device wakeup capability will be overwrite in stmmac_init_phy() according to phy's Wol feature. If phy doesn't support WoL, then MAC will lose wakeup capability. To fix this issue, only overwrite device wakeup capability when MAC doesn't support PMT.
For STMMAC now driver checks MAC's WoL capability if MAC supports PMT, if not support, driver will check PHY's WoL capability.
--- drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
drivers/net/ethernet/stmicro/stmmac/stmmac_main.c +6 -3
@@ -1076,7 +1076,6 @@ static void stmmac_check_pcs_mode(struct stmmac_priv *priv)*/ static int stmmac_init_phy (struct net_device *dev) { -struct ethtool_wolinfo wol = { .cmd =ETHTOOL_GWOL };struct stmmac_priv *priv =netdev_priv (dev);struct device_node *node;int ret;
@@ -1102,8 +1101,12 @@ static int stmmac_init_phy(struct net_device *dev) ret =phylink_connect_phy (priv->phylink, phydev); } -phylink_ethtool_get_wol (priv->phylink, &wol); -device_set_wakeup_capable (priv->device, !!wol.supported); +if (!priv->plat->pmt) { +struct ethtool_wolinfo wol = { .cmd =ETHTOOL_GWOL }; + +phylink_ethtool_get_wol (priv->phylink, &wol); +device_set_wakeup_capable (priv->device, !!wol.supported); + }return ret; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 228/296 net: ipa: memory region array is variable size
In reply to Greg Kroah-HartmanFrom: Alex Elder <[email protected]>
[ Upstream commit 440c3247cba3d9433ac435d371dd7927d68772a7 ]
IPA configuration data includes an array of memory region descriptors. That was a fixed-size array at one time, but at some point we started defining it such that it was only as big as required for a given platform. The actual number of entries in the array is recorded in the configuration data along with the array.
A loop in ipa_mem_config() still assumes the array has entries for all defined memory region IDs. As a result, this loop can go past the end of the actual array and attempt to write "canary" values based on nonsensical data.
Fix this, by stashing the number of entries in the array, and using that rather than IPA_MEM_COUNT in the initialization loop found in ipa_mem_config().
The only remaining use of IPA_MEM_COUNT is in a validation check to ensure configuration data doesn't have too many entries. That's fine for now.
--- drivers/net/ipa/ipa.h | 2 ++ drivers/net/ipa/ipa_mem.c | 3 ++- 2 files changed, 4 insertions(+), 1 deletion(-)
drivers/net/ipa/ipa.h +2 -0
@@ -56,6 +56,7 @@ enum ipa_flag {* @mem_virt: Virtual address of IPA-local memory space * @mem_offset: Offset from @mem_virt used for access to IPA memory * @mem_size: Total size (bytes) of memory at @mem_virt +* @mem_count: Number of entries in the mem array * @mem: Array of IPA-local memory region descriptors * @imem_iova: I/O virtual address of IPA region in IMEM * @imem_size; Size of IMEM region
@@ -102,6 +103,7 @@ struct ipa {void *mem_virt;u32 mem_offset;u32 mem_size; +u32 mem_count;const struct ipa_mem *mem;unsigned long imem_iova;
drivers/net/ipa/ipa_mem.c +2 -1
@@ -181,7 +181,7 @@ int ipa_mem_config(struct ipa *ipa)* for the region, write "canary" values in the space prior to * the region's base address. */ -for (mem_id =0 ; mem_id <IPA_MEM_COUNT ; mem_id++) { +for (mem_id =0 ; mem_id < ipa->mem_count; mem_id++) {const struct ipa_mem *mem = &ipa->mem[mem_id];u16 canary_count;__le32 *canary;
@@ -488,6 +488,7 @@ int ipa_mem_init(struct ipa *ipa, const struct ipa_mem_data *mem_data) ipa->mem_size =resource_size (res);/* The ipa->mem[] array is indexed by enum ipa_mem_id values */ + ipa->mem_count = mem_data->local_count; ipa->mem = mem_data->local; ret =ipa_imem_init (ipa, mem_data->imem_addr, mem_data->imem_size);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 229/296 vfio-ccw: Check initialized flag in cp_init()
In reply to Greg Kroah-HartmanFrom: Eric Farman <[email protected]>
[ Upstream commit c6c82e0cd8125d30f2f1b29205c7e1a2f1a6785b ]
We have a really nice flag in the channel_program struct that indicates if it had been initialized by cp_init(), and use it as a guard in the other cp accessor routines, but not for a duplicate call into cp_init(). The possibility of this occurring is low, because that flow is protected by the private->io_mutex and FSM CP_PROCESSING state. But then why bother checking it in (for example) cp_prefetch() then?
Let's just be consistent and check for that in cp_init() too.
Message-Id: <[email protected]>
--- drivers/s390/cio/vfio_ccw_cp.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/s390/cio/vfio_ccw_cp.c +4 -0
@@ -638,6 +638,10 @@ int cp_init(struct channel_program *cp, struct device *mdev, union orb *orb) static DEFINE_RATELIMIT_STATE(ratelimit_state, 5 * HZ, 1);int ret; +/* this is an error in the caller */ +if (cp->initialized) +return -EBUSY ; +/* * We only support prefetching the channel program. We assume all channel * programs executed by supported guests likewise support prefetching.
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 230/296 spi: Assume GPIO CS active high in ACPI case
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
[ Upstream commit 6b69546912a57ff8c31061f98e56383cc0beffd3 ]
Currently GPIO CS handling, when descriptors are in use, doesn't take into consideration that in ACPI case the default polarity is Active High and can't be altered. Instead we have to use the per-chip definition provided by SPISerialBus() resource.
--- drivers/spi/spi.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-)
drivers/spi/spi.c +18 -5
@@ -823,16 +823,29 @@ static void spi_set_cs(struct spi_device *spi, bool enable, bool force)if (spi->cs_gpiod ||gpio_is_valid (spi->cs_gpio)) {if (!(spi->mode &SPI_NO_CS )) { -if (spi->cs_gpiod) -/* polarity handled by gpiolib */ -gpiod_set_value_cansleep (spi->cs_gpiod, - enable1); -else +if (spi->cs_gpiod) { +/* +* Historically ACPI has no means of the GPIO polarity and +* thus the SPISerialBus() resource defines it on the per-chip +* basis. In order to avoid a chain of negations, the GPIO +* polarity is considered being Active High. Even for the cases +* when _DSD() is involved (in the updated versions of ACPI) +* the GPIO CS polarity must be defined Active High to avoid +* ambiguity. That's why we use enable, that takes SPI_CS_HIGH +* into account. +*/ +if (has_acpi_companion (&spi->dev)) +gpiod_set_value_cansleep (spi->cs_gpiod, !enable); +else +/* Polarity handled by GPIO library */ +gpiod_set_value_cansleep (spi->cs_gpiod, enable1); + }else {/* * invert the enable line, as active low is * default for SPI. */ gpio_set_value_cansleep (spi->cs_gpio, !enable); + } }/* Some SPI masters need both GPIO CS & slave_select */ if ((spi->controller->flags & SPI_MASTER_GPIO_SS) &&
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 231/296 net: really orphan skbs tied to closing sk
In reply to Greg Kroah-HartmanFrom: Paolo Abeni <[email protected]>
[ Upstream commit 098116e7e640ba677d9e345cbee83d253c13d556 ]
If the owing socket is shutting down - e.g. the sock reference count already dropped to 0 and only sk_wmem_alloc is keeping the sock alive, skb_orphan_partial() becomes a no-op.
When forwarding packets over veth with GRO enabled, the above causes refcount errors.
This change addresses the issue with a plain skb_orphan() call in the critical scenario.
--- include/net/sock.h | 4 +++- net/core/sock.c | 8 ++++---- 2 files changed, 7 insertions(+), 5 deletions(-)
include/net/sock.h +3 -1
@@ -2225,13 +2225,15 @@ static inline void skb_set_owner_r(struct sk_buff *skb, struct sock *sk)sk_mem_charge (sk, skb->truesize); } -static inline void skb_set_owner_sk_safe (struct sk_buff *skb,struct sock *sk) +static inline __must_check bool skb_set_owner_sk_safe (struct sk_buff *skb,struct sock *sk) {if (sk &&refcount_inc_not_zero (&sk->sk_refcnt)) {skb_orphan (skb); skb->destructor = sock_efree; skb->sk = sk; +return true; } +return false; } void sk_reset_timer(struct sock *sk, struct timer_list *timer,
net/core/sock.c +4 -4
@@ -2132,10 +2132,10 @@ void skb_orphan_partial(struct sk_buff *skb)if (skb_is_tcp_pure_ack (skb))return ; -if (can_skb_orphan_partial (skb)) -skb_set_owner_sk_safe (skb, skb->sk); -else -skb_orphan (skb); +if (can_skb_orphan_partial (skb) &&skb_set_owner_sk_safe (skb, skb->sk)) +return ; + +skb_orphan (skb); }EXPORT_SYMBOL (skb_orphan_partial);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 232/296 net: packetmmap: fix only tx timestamp on request
In reply to Greg Kroah-HartmanFrom: Richard Sanger <[email protected]>
[ Upstream commit 171c3b151118a2fe0fc1e2a9d1b5a1570cfe82d2 ]
The packetmmap tx ring should only return timestamps if requested via setsockopt PACKET_TIMESTAMP, as documented. This allows compatibility with non-timestamp aware user-space code which checks tp_status == TP_STATUS_AVAILABLE; not expecting additional timestamp flags to be set in tp_status.
--- net/packet/af_packet.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
net/packet/af_packet.c +8 -2
@@ -422,7 +422,8 @@ static __u32 tpacket_get_timestamp(struct sk_buff *skb, struct timespec64 *ts, ktime_to_timespec64_cond(shhwtstamps->hwtstamp, ts))return TP_STATUS_TS_RAW_HARDWARE ; -if (ktime_to_timespec64_cond (skb->tstamp, ts)) +if ((flags &SOF_TIMESTAMPING_SOFTWARE ) && +ktime_to_timespec64_cond (skb->tstamp, ts))return TP_STATUS_TS_SOFTWARE ;return 0 ;
@@ -2340,7 +2341,12 @@ static int tpacket_rcv(struct sk_buff *skb, struct net_device *dev,skb_copy_bits (skb,0 , h.raw + macoff, snaplen); -if (!(ts_status =tpacket_get_timestamp (skb, &ts, po->tp_tstamp))) +/* Always timestamp; prefer an existing software timestamp taken +* closer to the time of capture. +*/ + ts_status =tpacket_get_timestamp (skb, &ts, + po->tp_tstamp |SOF_TIMESTAMPING_SOFTWARE ); +if (!ts_status)ktime_get_real_ts64 (&ts); status |= ts_status;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 233/296 net: fec: fix the potential memory leak in fec_enet_init()
In reply to Greg Kroah-HartmanFrom: Fugang Duan <[email protected]>
[ Upstream commit 619fee9eb13b5d29e4267cb394645608088c28a8 ]
If the memory allocated for cbd_base is failed, it should free the memory allocated for the queues, otherwise it causes memory leak.
And if the memory allocated for the queues is failed, it can return error directly.
--- drivers/net/ethernet/freescale/fec_main.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
drivers/net/ethernet/freescale/fec_main.c +9 -2
@@ -3282,7 +3282,9 @@ static int fec_enet_init(struct net_device *ndev)return ret; } -fec_enet_alloc_queue (ndev); + ret =fec_enet_alloc_queue (ndev); +if (ret) +return ret; bd_size = (fep->total_tx_ring_size + fep->total_rx_ring_size) * dsize;
@@ -3290,7 +3292,8 @@ static int fec_enet_init(struct net_device *ndev) cbd_base =dmam_alloc_coherent (&fep->pdev->dev, bd_size, &bd_dma,GFP_KERNEL );if (!cbd_base) { -return -ENOMEM ; + ret = -ENOMEM ; + goto free_queue_mem; }/* Get the Ethernet address */
@@ -3368,6 +3371,10 @@ static int fec_enet_init(struct net_device *ndev)fec_enet_update_ethtool_stats (ndev);return 0 ; + +free_queue_mem: +fec_enet_free_queue (ndev); +return ret; }#ifdef CONFIG_OF
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 234/296 octeontx2-pf: fix a buffer overflow in otx2_set_rxfh_context()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit e5cc361e21648b75f935f9571d4003aaee480214 ]
This function is called from ethtool_set_rxfh() and "*rss_context" comes from the user. Add some bounds checking to prevent memory corruption.
--- drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/net/ethernet/marvell/octeontx2/nic/otx2_ethtool.c +4 -0
@@ -786,6 +786,10 @@ static int otx2_set_rxfh_context(struct net_device *dev, const u32 *indir,if (hfunc !=ETH_RSS_HASH_NO_CHANGE && hfunc !=ETH_RSS_HASH_TOP )return -EOPNOTSUPP ; +if (*rss_context !=ETH_RXFH_CONTEXT_ALLOC && + *rss_context >=MAX_RSS_GROUPS ) +return -EINVAL ; + rss = &pfvf->hw.rss_info;if (!rss->enable) {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 235/296 ptp: ocp: Fix a resource leak in an error handling path
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit 9c1bb37f8cad5e2ee1933fa1da9a6baa7876a8e4 ]
If an error occurs after a successful 'pci_ioremap_bar()' call, it must be undone by a corresponding 'pci_iounmap()' call, as already done in the remove function.
--- drivers/ptp/ptp_ocp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/ptp/ptp_ocp.c +3 -1
@@ -324,7 +324,7 @@ ptp_ocp_probe(struct pci_dev *pdev, const struct pci_device_id *id)if (!bp->base) {dev_err (&pdev->dev,"io_remap bar0\n" ); err = -ENOMEM ; - goto out; + goto out_release_regions; } bp->reg = bp->base +OCP_REGISTER_OFFSET ; bp->tod = bp->base +TOD_REGISTER_OFFSET ;
@@ -347,6 +347,8 @@ ptp_ocp_probe(struct pci_dev *pdev, const struct pci_device_id *id)return 0 ; out: +pci_iounmap (pdev, bp->base); +out_release_regions:pci_release_regions (pdev); out_disable:pci_disable_device (pdev);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 236/296 chelsio/chtls: unlock on error in chtls_pt_recvmsg()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 832ce924b1a14e139e184a6da9f5a69a5e47b256 ]
This error path needs to release some memory and call release_sock(sk); before returning.
--- drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/net/ethernet/chelsio/inline_crypto/chtls/chtls_io.c +4 -2
@@ -1564,8 +1564,10 @@ found_ok_skb: cerr =put_cmsg (msg,SOL_TLS ,TLS_GET_RECORD_TYPE ,sizeof (thdr->type), &thdr->type); -if (cerr && thdr->type !=TLS_RECORD_TYPE_DATA ) -return -EIO ; +if (cerr && thdr->type !=TLS_RECORD_TYPE_DATA ) { + copied = -EIO ; +break ; + }/* don't send tls header, skip copy */ goto skip_copy; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 237/296 net: mdio: thunder: Fix a double free issue in the .remove function
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit a93a0a15876d2a077a3bc260b387d2457a051f24 ]
'bus->mii_bus' have been allocated with 'devm_mdiobus_alloc_size()' in the probe function. So it must not be freed explicitly or there will be a double free.
Remove the incorrect 'mdiobus_free' in the remove function.
--- drivers/net/mdio/mdio-thunder.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/mdio/mdio-thunder.c +0 -1
@@ -126,7 +126,6 @@ static void thunder_mdiobus_pci_remove(struct pci_dev *pdev)continue ;mdiobus_unregister (bus->mii_bus); -mdiobus_free (bus->mii_bus);oct_mdio_writeq (0 , bus->register_base +SMI_EN ); }pci_release_regions (pdev);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 238/296 net: mdio: octeon: Fix some double free issues
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
[ Upstream commit e1d027dd97e1e750669cdc0d3b016a4f54e473eb ]
'bus->mii_bus' has been allocated with 'devm_mdiobus_alloc_size()' in the probe function. So it must not be freed explicitly or there will be a double free.
Remove the incorrect 'mdiobus_free' in the error handling path of the probe function and in remove function.
--- drivers/net/mdio/mdio-octeon.c | 2 -- 1 file changed, 2 deletions(-)
drivers/net/mdio/mdio-octeon.c +0 -2
@@ -71,7 +71,6 @@ static int octeon_mdiobus_probe(struct platform_device *pdev)return 0 ; fail_register: -mdiobus_free (bus->mii_bus); smi_en.u64 =0 ;oct_mdio_writeq (smi_en.u64, bus->register_base +SMI_EN );return err;
@@ -85,7 +84,6 @@ static int octeon_mdiobus_remove(struct platform_device *pdev) bus =platform_get_drvdata (pdev);mdiobus_unregister (bus->mii_bus); -mdiobus_free (bus->mii_bus); smi_en.u64 =0 ;oct_mdio_writeq (smi_en.u64, bus->register_base +SMI_EN );return 0 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 239/296 cxgb4/ch_ktls: Clear resources when pf4 device is removed
In reply to Greg Kroah-HartmanFrom: Ayush Sawal <[email protected]>
[ Upstream commit 65e302a9bd57b62872040d57eea1201562a7cbb2 ]
This patch maintain the list of active tids and clear all the active connection resources when DETACH notification comes.
--- .../net/ethernet/chelsio/cxgb4/cxgb4_main.c | 2 +- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.c | 80 ++++++++++++++++++- .../chelsio/inline_crypto/ch_ktls/chcr_ktls.h | 2 + 3 files changed, 82 insertions(+), 2 deletions(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_main.c +1 -1
@@ -6480,9 +6480,9 @@ static void cxgb4_ktls_dev_del(struct net_device *netdev, adap->uld[CXGB4_ULD_KTLS ].tlsdev_ops->tls_dev_del (netdev, tls_ctx, direction); -cxgb4_set_ktls_feature (adap,FW_PARAMS_PARAM_DEV_KTLS_HW_DISABLE ); out_unlock: +cxgb4_set_ktls_feature (adap,FW_PARAMS_PARAM_DEV_KTLS_HW_DISABLE );mutex_unlock (&uld_mutex); }
drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.c +79 -1
172 lines not on this page · raw message
drivers/net/ethernet/chelsio/inline_crypto/ch_ktls/chcr_ktls.h +2 -0
@@ -75,6 +75,8 @@ struct chcr_ktls_ofld_ctx_tx {struct chcr_ktls_uld_ctx {struct list_head entry;struct cxgb4_lld_info lldi; +struct xarray tid_list; +bool detach; }; static inline struct chcr_ktls_ofld_ctx_tx *
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 240/296 openvswitch: meter: fix race when getting now_ms.
In reply to Greg Kroah-HartmanFrom: Tao Liu <[email protected]>
[ Upstream commit e4df1b0c24350a0f00229ff895a91f1072bd850d ]
We have observed meters working unexpected if traffic is 3+Gbit/s with multiple connections.
now_ms is not pretected by meter->lock, we may get a negative long_delta_ms when another cpu updated meter->used, then:
delta_ms = (u32)long_delta_ms;
which will be a large value.
band->bucket += delta_ms * band->rate;
then we get a wrong band->bucket.
OpenVswitch userspace datapath has fixed the same issue[1] some time ago, and we port the implementation to kernel datapath.
[1] https://patchwork.ozlabs.org/project/openvswitch/patch/[email protected]/
--- net/openvswitch/meter.c | 8 ++++++++ 1 file changed, 8 insertions(+)
net/openvswitch/meter.c +8 -0
@@ -611,6 +611,14 @@ bool ovs_meter_execute(struct datapath *dp, struct sk_buff *skb,spin_lock (&meter->lock); long_delta_ms = (now_ms - meter->used);/* ms */ +if (long_delta_ms <0 ) { +/* This condition means that we have several threads fighting +* for a meter lock, and the one who received the packets a +* bit later wins. Assuming that all racing threads received +* packets at the same time to avoid overflow. +*/ + long_delta_ms =0 ; + }/* Make sure delta_ms will not be too large, so that bucket will not * wrap around below.
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 241/296 tls splice: check SPLICE_F_NONBLOCK instead of MSG_DONTWAIT
In reply to Greg Kroah-HartmanFrom: Jim Ma <[email protected]>
[ Upstream commit 974271e5ed45cfe4daddbeb16224a2156918530e ]
In tls_sw_splice_read, checkout MSG_* is inappropriate, should use SPLICE_*, update tls_wait_data to accept nonblock arguments instead of flags for recvmsg and splice.
--- net/tls/tls_sw.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
net/tls/tls_sw.c +6 -5
@@ -37,6 +37,7 @@#include <linux/sched/signal.h> #include <linux/module.h> +#include <linux/splice.h> #include <crypto/aead.h> #include <net/strparser.h>
@@ -1281,7 +1282,7 @@ int tls_sw_sendpage(struct sock *sk, struct page *page, }static struct sk_buff *tls_wait_data (struct sock *sk,struct sk_psock *psock, -int flags,long timeo,int *err) +bool nonblock,long timeo,int *err) {struct tls_context *tls_ctx =tls_get_ctx (sk);struct tls_sw_context_rx *ctx =tls_sw_ctx_rx (tls_ctx);
@@ -1306,7 +1307,7 @@ static struct sk_buff *tls_wait_data(struct sock *sk, struct sk_psock *psock,if (sock_flag (sk,SOCK_DONE ))return NULL ; -if ((flags &MSG_DONTWAIT ) || !timeo) { +if (nonblock || !timeo) { *err = -EAGAIN ;return NULL ; }
@@ -1786,7 +1787,7 @@ int tls_sw_recvmsg(struct sock *sk,bool async_capable;bool async = false; - skb =tls_wait_data (sk, psock, flags, timeo, &err); + skb =tls_wait_data (sk, psock, flags &MSG_DONTWAIT , timeo, &err);if (!skb) {if (psock) { int ret = __tcp_bpf_recvmsg(sk, psock,
@@ -1990,9 +1991,9 @@ ssize_t tls_sw_splice_read(struct socket *sock, loff_t *ppos,lock_sock (sk); - timeo =sock_rcvtimeo (sk, flags &MSG_DONTWAIT ); + timeo =sock_rcvtimeo (sk, flags &SPLICE_F_NONBLOCK ); - skb =tls_wait_data (sk,NULL , flags, timeo, &err); + skb =tls_wait_data (sk,NULL , flags &SPLICE_F_NONBLOCK , timeo, &err);if (!skb) goto splice_read_end;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 242/296 net: sched: fix packet stuck problem for lockless qdisc
In reply to Greg Kroah-HartmanFrom: Yunsheng Lin <[email protected]>
[ Upstream commit a90c57f2cedd52a511f739fb55e6244e22e1a2fb ]
Lockless qdisc has below concurrent problem:
cpu0 cpu1
. .
q->enqueue .
. .
qdisc_run_begin() .
. .
dequeue_skb() .
. .
sch_direct_xmit() .
. . . q->enqueue
. qdisc_run_begin()
. return and do nothing
. .qdisc_run_end() .
cpu1 enqueue a skb without calling __qdisc_run() because cpu0 has not released the lock yet and spin_trylock() return false for cpu1 in qdisc_run_begin(), and cpu0 do not see the skb enqueued by cpu1 when calling dequeue_skb() because cpu1 may enqueue the skb after cpu0 calling dequeue_skb() and before cpu0 calling qdisc_run_end().
Lockless qdisc has below another concurrent problem when tx_action is involved:
cpu0(serving tx_action) cpu1 cpu2
. . .
. q->enqueue .
. qdisc_run_begin() .
. dequeue_skb() .
. . q->enqueue
. . .
. sch_direct_xmit() .
. . qdisc_run_begin()
. . return and do nothing
. . .
clear __QDISC_STATE_SCHED . .
qdisc_run_begin() . .
return and do nothing . .
. . .
. qdisc_run_end() .This patch fixes the above data race by:
1. If the first spin_trylock() return false and STATE_MISSED is not set, set STATE_MISSED and retry another spin_trylock() in case other CPU may not see STATE_MISSED after it releases the lock.
2. reschedule if STATE_MISSED is set after the lock is released at the end of qdisc_run_end().
For tx_action case, STATE_MISSED is also set when cpu1 is at the end if qdisc_run_end(), so tx_action will be rescheduled again to dequeue the skb enqueued by cpu2.
Clear STATE_MISSED before retrying a dequeuing when dequeuing returns NULL in order to reduce the overhead of the second spin_trylock() and __netif_schedule() calling.
Also clear the STATE_MISSED before calling __netif_schedule() at the end of qdisc_run_end() to avoid doing another round of dequeuing in the pfifo_fast_dequeue().
The performance impact of this patch, tested using pktgen and dummy netdev with pfifo_fast qdisc attached:
threads without+this_patch with+this_patch delta
1 2.61Mpps 2.60Mpps -0.3%
2 3.97Mpps 3.82Mpps -3.7%
4 5.62Mpps 5.59Mpps -0.5%
8 2.78Mpps 2.77Mpps -0.3%
16 2.22Mpps 2.22Mpps -0.0%--- include/net/sch_generic.h | 35 ++++++++++++++++++++++++++++++++++- net/sched/sch_generic.c | 19 +++++++++++++++++++ 2 files changed, 53 insertions(+), 1 deletion(-)
include/net/sch_generic.h +34 -1
@@ -36,6 +36,7 @@ struct qdisc_rate_table {enum qdisc_state_t { __QDISC_STATE_SCHED, __QDISC_STATE_DEACTIVATED, + __QDISC_STATE_MISSED, };struct qdisc_size_table {
@@ -159,8 +160,33 @@ static inline bool qdisc_is_empty(const struct Qdisc *qdisc)static inline bool qdisc_run_begin (struct Qdisc *qdisc) {if (qdisc->flags &TCQ_F_NOLOCK ) { +if (spin_trylock (&qdisc->seqlock)) + goto nolock_empty; + +/* If the MISSED flag is set, it means other thread has +* set the MISSED flag before second spin_trylock(), so +* we can return false here to avoid multi cpus doing +* the set_bit() and second spin_trylock() concurrently. +*/ +if (test_bit (__QDISC_STATE_MISSED, &qdisc->state)) +return false; + +/* Set the MISSED flag before the second spin_trylock(), +* if the second spin_trylock() return false, it means +* other cpu holding the lock will do dequeuing for us +* or it will see the MISSED flag set after releasing +* lock and reschedule the net_tx_action() to do the +* dequeuing. +*/ +set_bit (__QDISC_STATE_MISSED, &qdisc->state); + +/* Retry again in case other CPU may not see the new flag +* after it releases the lock at the end of qdisc_run_end(). +*/ if (!spin_trylock (&qdisc->seqlock))return false; + +nolock_empty:WRITE_ONCE (qdisc->empty, false); }else if (qdisc_is_running (qdisc)) {return false;
@@ -176,8 +202,15 @@ static inline bool qdisc_run_begin(struct Qdisc *qdisc)static inline void qdisc_run_end (struct Qdisc *qdisc) {write_seqcount_end (&qdisc->running); -if (qdisc->flags &TCQ_F_NOLOCK ) +if (qdisc->flags &TCQ_F_NOLOCK ) {spin_unlock (&qdisc->seqlock); + +if (unlikely (test_bit (__QDISC_STATE_MISSED, + &qdisc->state))) { +clear_bit (__QDISC_STATE_MISSED, &qdisc->state); +__netif_schedule (qdisc); + } + } }static inline bool qdisc_may_bulk (const struct Qdisc *qdisc)
net/sched/sch_generic.c +19 -0
@@ -640,8 +640,10 @@ static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc) {struct pfifo_fast_priv *priv =qdisc_priv (qdisc);struct sk_buff *skb =NULL ; +bool need_retry = true;int band; +retry:for (band =0 ; band <PFIFO_FAST_BANDS && !skb; band++) {struct skb_array *q =band2list (priv, band);
@@ -652,6 +654,23 @@ static struct sk_buff *pfifo_fast_dequeue(struct Qdisc *qdisc) }if (likely (skb)) {qdisc_update_stats_at_dequeue (qdisc, skb); + }else if (need_retry && +test_bit (__QDISC_STATE_MISSED, &qdisc->state)) { +/* Delay clearing the STATE_MISSED here to reduce +* the overhead of the second spin_trylock() in +* qdisc_run_begin() and __netif_schedule() calling +* in qdisc_run_end(). +*/ +clear_bit (__QDISC_STATE_MISSED, &qdisc->state); + +/* Make sure dequeuing happens after clearing +* STATE_MISSED. +*/ +smp_mb__after_atomic (); + + need_retry = false; + + goto retry; }else {WRITE_ONCE (qdisc->empty, true); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 243/296 net: sched: fix tx action rescheduling issue during deactivation
In reply to Greg Kroah-HartmanFrom: Yunsheng Lin <[email protected]>
[ Upstream commit 102b55ee92f9fda4dde7a45d2b20538e6e3e3d1e ]
Currently qdisc_run() checks the STATE_DEACTIVATED of lockless qdisc before calling __qdisc_run(), which ultimately clear the STATE_MISSED when all the skb is dequeued. If STATE_DEACTIVATED is set before clearing STATE_MISSED, there may be rescheduling of net_tx_action() at the end of qdisc_run_end(), see below:
CPU0(net_tx_atcion) CPU1(__dev_xmit_skb) CPU2(dev_deactivate)
. . .
. set STATE_MISSED .
. __netif_schedule() .
. . set STATE_DEACTIVATED
. . qdisc_reset()
. . .
.<--------------- . synchronize_net()
clear __QDISC_STATE_SCHED | . .
. | . .
. | . some_qdisc_is_busy()
. | . return *false*
. | . .
test STATE_DEACTIVATED | . .
__qdisc_run() *not* called | . .
. | . .
test STATE_MISS | . .
__netif_schedule()--------| . .
. . .
. . .__qdisc_run() is not called by net_tx_atcion() in CPU0 because CPU2 has set STATE_DEACTIVATED flag during dev_deactivate(), and STATE_MISSED is only cleared in __qdisc_run(), __netif_schedule is called at the end of qdisc_run_end(), causing tx action rescheduling problem.
qdisc_run() called by net_tx_action() runs in the softirq context, which should has the same semantic as the qdisc_run() called by __dev_xmit_skb() protected by rcu_read_lock_bh(). And there is a synchronize_net() between STATE_DEACTIVATED flag being set and qdisc_reset()/some_qdisc_is_busy in dev_deactivate(), we can safely bail out for the deactived lockless qdisc in net_tx_action(), and qdisc_reset() will reset all skb not dequeued yet.
So add the rcu_read_lock() explicitly to protect the qdisc_run() and do the STATE_DEACTIVATED checking in net_tx_action() before calling qdisc_run_begin(). Another option is to do the checking in the qdisc_run_end(), but it will add unnecessary overhead for non-tx_action case, because __dev_queue_xmit() will not see qdisc with STATE_DEACTIVATED after synchronize_net(), the qdisc with STATE_DEACTIVATED can only be seen by net_tx_action() because of __netif_schedule().
The STATE_DEACTIVATED checking in qdisc_run() is to avoid race between net_tx_action() and qdisc_reset(), see:
commit d518d2ed8640 ("net/sched: fix race between deactivation and dequeue for NOLOCK qdisc"). As the bailout added above for deactived lockless qdisc in net_tx_action() provides better protection for the race without calling qdisc_run() at all, so remove the STATE_DEACTIVATED checking in qdisc_run().
After qdisc_reset(), there is no skb in qdisc to be dequeued, so clear the STATE_MISSED in dev_reset_queue() too.
V8: Clearing STATE_MISSED before calling __netif_schedule() has
avoid the endless rescheduling problem, but there may still be a unnecessary rescheduling, so adjust the commit log.
--- include/net/pkt_sched.h | 7 +------ net/core/dev.c | 26 ++++++++++++++++++++++---- net/sched/sch_generic.c | 4 +++- 3 files changed, 26 insertions(+), 11 deletions(-)
include/net/pkt_sched.h +1 -6
@@ -128,12 +128,7 @@ void __qdisc_run(struct Qdisc *q);static inline void qdisc_run (struct Qdisc *q) {if (qdisc_run_begin (q)) { -/* NOLOCK qdisc must check 'state' under the qdisc seqlock -* to avoid racing with dev_qdisc_reset() -*/ -if (!(q->flags &TCQ_F_NOLOCK ) || -likely (!test_bit (__QDISC_STATE_DEACTIVATED, &q->state))) -__qdisc_run (q); +__qdisc_run (q);qdisc_run_end (q); } }
net/core/dev.c +22 -4
@@ -4974,25 +4974,43 @@ static __latent_entropy void net_tx_action(struct softirq_action *h) sd->output_queue_tailp = &sd->output_queue;local_irq_enable (); +rcu_read_lock (); +while (head) {struct Qdisc *q = head;spinlock_t *root_lock =NULL ; head = head->next_sched; -if (!(q->flags &TCQ_F_NOLOCK )) { - root_lock =qdisc_lock (q); -spin_lock (root_lock); - }/* We need to make sure head->next_sched is read * before clearing __QDISC_STATE_SCHED */ smp_mb__before_atomic (); + +if (!(q->flags &TCQ_F_NOLOCK )) { + root_lock =qdisc_lock (q); +spin_lock (root_lock); + }else if (unlikely (test_bit (__QDISC_STATE_DEACTIVATED, + &q->state))) { +/* There is a synchronize_net() between +* STATE_DEACTIVATED flag being set and +* qdisc_reset()/some_qdisc_is_busy() in +* dev_deactivate(), so we can safely bail out +* early here to avoid data race between +* qdisc_deactivate() and some_qdisc_is_busy() +* for lockless qdisc. +*/ +clear_bit (__QDISC_STATE_SCHED, &q->state); +continue ; + } +clear_bit (__QDISC_STATE_SCHED, &q->state);qdisc_run (q);if (root_lock)spin_unlock (root_lock); } + +rcu_read_unlock (); }xfrm_dev_backlog (sd);
net/sched/sch_generic.c +3 -1
@@ -1177,8 +1177,10 @@ static void dev_reset_queue(struct net_device *dev,qdisc_reset (qdisc);spin_unlock_bh (qdisc_lock (qdisc)); -if (nolock) +if (nolock) { +clear_bit (__QDISC_STATE_MISSED, &qdisc->state);spin_unlock_bh (&qdisc->seqlock); + } }static bool some_qdisc_is_busy (struct net_device *dev)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 244/296 net: sched: fix tx action reschedule issue with stopped queue
In reply to Greg Kroah-HartmanFrom: Yunsheng Lin <[email protected]>
[ Upstream commit dcad9ee9e0663d74a89b25b987f9c7be86432812 ]
The netdev qeueue might be stopped when byte queue limit has reached or tx hw ring is full, net_tx_action() may still be rescheduled if STATE_MISSED is set, which consumes unnecessary cpu without dequeuing and transmiting any skb because the netdev queue is stopped, see qdisc_run_end().
This patch fixes it by checking the netdev queue state before calling qdisc_run() and clearing STATE_MISSED if netdev queue is stopped during qdisc_run(), the net_tx_action() is rescheduled again when netdev qeueue is restarted, see netif_tx_wake_queue().
As there is time window between netif_xmit_frozen_or_stopped() checking and STATE_MISSED clearing, between which STATE_MISSED may set by net_tx_action() scheduled by netif_tx_wake_queue(), so set the STATE_MISSED again if netdev queue is restarted.
--- net/core/dev.c | 3 ++- net/sched/sch_generic.c | 27 ++++++++++++++++++++++++++- 2 files changed, 28 insertions(+), 2 deletions(-)
net/core/dev.c +2 -1
@@ -3804,7 +3804,8 @@ static inline int __dev_xmit_skb(struct sk_buff *skb, struct Qdisc *q,if (q->flags &TCQ_F_NOLOCK ) { rc = q->enqueue (skb, q, &to_free) &NET_XMIT_MASK ; -qdisc_run (q); +if (likely (!netif_xmit_frozen_or_stopped (txq))) +qdisc_run (q);if (unlikely (to_free))kfree_skb_list (to_free);
net/sched/sch_generic.c +26 -1
@@ -35,6 +35,25 @@const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;EXPORT_SYMBOL (default_qdisc_ops); +static void qdisc_maybe_clear_missed (struct Qdisc *q, +const struct netdev_queue *txq) +{ +clear_bit (__QDISC_STATE_MISSED, &q->state); + +/* Make sure the below netif_xmit_frozen_or_stopped() +* checking happens after clearing STATE_MISSED. +*/ +smp_mb__after_atomic (); + +/* Checking netif_xmit_frozen_or_stopped() again to +* make sure STATE_MISSED is set if the STATE_MISSED +* set by netif_tx_wake_queue()'s rescheduling of +* net_tx_action() is cleared by the above clear_bit(). +*/ +if (!netif_xmit_frozen_or_stopped (txq)) +set_bit (__QDISC_STATE_MISSED, &q->state); +} +/* Main transmission queue. */ /* Modifications to data participating in scheduling must be protected with
@@ -74,6 +93,7 @@ static inline struct sk_buff *__skb_dequeue_bad_txq(struct Qdisc *q) } }else { skb =SKB_XOFF_MAGIC ; +qdisc_maybe_clear_missed (q, txq); } }
@@ -242,6 +262,7 @@ static struct sk_buff *dequeue_skb(struct Qdisc *q, bool *validate, } }else { skb =NULL ; +qdisc_maybe_clear_missed (q, txq); }if (lock)spin_unlock (lock);
@@ -251,8 +272,10 @@ validate: *validate = true;if ((q->flags &TCQ_F_ONETXQUEUE ) && -netif_xmit_frozen_or_stopped (txq)) +netif_xmit_frozen_or_stopped (txq)) { +qdisc_maybe_clear_missed (q, txq);return skb; + } skb =qdisc_dequeue_skb_bad_txq (q);if (unlikely (skb)) {
@@ -311,6 +334,8 @@ bool sch_direct_xmit(struct sk_buff *skb, struct Qdisc *q,HARD_TX_LOCK (dev, txq,smp_processor_id ());if (!netif_xmit_frozen_or_stopped (txq)) skb =dev_hard_start_xmit (skb, dev, txq, &ret); +else +qdisc_maybe_clear_missed (q, txq);HARD_TX_UNLOCK (dev, txq); }else {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 245/296 net: hso: check for allocation failure in hso_create_bulk_serial_device()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 31db0dbd72444abe645d90c20ecb84d668f5af5e ]
In current kernels, small allocations never actually fail so this patch shouldn't affect runtime.
Originally this error handling code written with the idea that if the "serial->tiocmget" allocation failed, then we would continue operating instead of bailing out early. But in later years we added an unchecked dereference on the next line.
serial->tiocmget->serial_state_notification = kzalloc();
^^^^^^^^^^^^^^^^^^Since these allocations are never going fail in real life, this is mostly a philosophical debate, but I think bailing out early is the correct behavior that the user would want. And generally it's safer to bail as soon an error happens.
--- drivers/net/usb/hso.c | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-)
drivers/net/usb/hso.c +18 -19
@@ -2618,29 +2618,28 @@ static struct hso_device *hso_create_bulk_serial_device( num_urbs =2 ; serial->tiocmget =kzalloc (sizeof (struct hso_tiocmget ),GFP_KERNEL ); +if (!serial->tiocmget) + goto exit; serial->tiocmget->serial_state_notification =kzalloc (sizeof (struct hso_serial_state_notification ),GFP_KERNEL ); -/* it isn't going to break our heart if serial->tiocmget -* allocation fails don't bother checking this. -*/ -if (serial->tiocmget && serial->tiocmget->serial_state_notification) { - tiocmget = serial->tiocmget; - tiocmget->endp =hso_get_ep (interface, -USB_ENDPOINT_XFER_INT , -USB_DIR_IN ); -if (!tiocmget->endp) { -dev_err (&interface->dev,"Failed to find INT IN ep\n" ); - goto exit; - } - - tiocmget->urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (tiocmget->urb) { -mutex_init (&tiocmget->mutex); -init_waitqueue_head (&tiocmget->waitq); - }else -hso_free_tiomget (serial); +if (!serial->tiocmget->serial_state_notification) + goto exit; + tiocmget = serial->tiocmget; + tiocmget->endp =hso_get_ep (interface, +USB_ENDPOINT_XFER_INT , +USB_DIR_IN ); +if (!tiocmget->endp) { +dev_err (&interface->dev,"Failed to find INT IN ep\n" ); + goto exit; } + + tiocmget->urb =usb_alloc_urb (0 ,GFP_KERNEL ); +if (tiocmget->urb) { +mutex_init (&tiocmget->mutex); +init_waitqueue_head (&tiocmget->waitq); + }else +hso_free_tiomget (serial); }else num_urbs =1 ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 246/296 net: bnx2: Fix error return code in bnx2_init_board()
In reply to Greg Kroah-HartmanFrom: Zhen Lei <[email protected]>
[ Upstream commit 28c66b6da4087b8cfe81c2ec0a46eb6116dafda9 ]
Fix to return -EPERM from the error handling case instead of 0, as done elsewhere in this function.
--- drivers/net/ethernet/broadcom/bnx2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnx2.c +1 -1
@@ -8247,9 +8247,9 @@ bnx2_init_board(struct pci_dev *pdev, struct net_device *dev)BNX2_WR (bp,PCI_COMMAND , reg); }else if ((BNX2_CHIP_ID (bp) ==BNX2_CHIP_ID_5706_A1 ) && !(bp->flags &BNX2_FLAG_PCIX )) { -dev_err (&pdev->dev,"5706 A1 can only be used in a PCIX bus, aborting\n" ); + rc = -EPERM ; goto err_out_unmap; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 247/296 bnxt_en: Include new P5 HV definition in VF check.
In reply to Greg Kroah-HartmanFrom: Andy Gospodarek <[email protected]>
[ Upstream commit ab21494be9dc7d62736c5fcd06be65d49df713ee ]
Otherwise, some of the recently added HyperV VF IDs would not be recognized as VF devices and they would not initialize properly.
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +2 -1
@@ -282,7 +282,8 @@ static bool bnxt_vf_pciid(enum board_idx idx) {return (idx ==NETXTREME_C_VF || idx ==NETXTREME_E_VF || idx ==NETXTREME_S_VF || idx ==NETXTREME_C_VF_HV || - idx ==NETXTREME_E_VF_HV || idx ==NETXTREME_E_P5_VF ); + idx ==NETXTREME_E_VF_HV || idx ==NETXTREME_E_P5_VF || + idx ==NETXTREME_E_P5_VF_HV ); }#define DB_CP_REARM_FLAGS (DB_KEY_CP | DB_IDX_VALID)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 248/296 bnxt_en: Fix context memory setup for 64K page size.
In reply to Greg Kroah-HartmanFrom: Michael Chan <[email protected]>
[ Upstream commit 702279d2ce4650000bb6302013630304e359dc13 ]
There was a typo in the code that checks for 64K BNXT_PAGE_SHIFT in bnxt_hwrm_set_pg_attr(). Fix it and make the code more understandable with a new macro BNXT_SET_CTX_PAGE_ATTR().
--- drivers/net/ethernet/broadcom/bnxt/bnxt.c | 9 +-------- drivers/net/ethernet/broadcom/bnxt/bnxt.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 8 deletions(-)
drivers/net/ethernet/broadcom/bnxt/bnxt.c +1 -8
@@ -6920,17 +6920,10 @@ ctx_err:static void bnxt_hwrm_set_pg_attr (struct bnxt_ring_mem_info *rmem,u8 *pg_attr,__le64 *pg_dir) { -u8 pg_size =0 ; -if (!rmem->nr_pages)return ; -if (BNXT_PAGE_SHIFT ==13 ) - pg_size =1 <<4 ; -else if (BNXT_PAGE_SIZE ==16 ) - pg_size =2 <<4 ; - - *pg_attr = pg_size; +BNXT_SET_CTX_PAGE_ATTR (*pg_attr);if (rmem->depth >=1 ) {if (rmem->depth ==2 ) *pg_attr |=2 ;
drivers/net/ethernet/broadcom/bnxt/bnxt.h +10 -0
@@ -1456,6 +1456,16 @@ struct bnxt_ctx_pg_info {#define BNXT_BACKING_STORE_CFG_LEGACY_LEN 256 +#define BNXT_SET_CTX_PAGE_ATTR (attr) \ +do { \ + if (BNXT_PAGE_SIZE == 0x2000) \ + attr = FUNC_BACKING_STORE_CFG_REQ_SRQ_PG_SIZE_PG_8K; \ + else if (BNXT_PAGE_SIZE == 0x10000) \ + attr = FUNC_BACKING_STORE_CFG_REQ_QPC_PG_SIZE_PG_64K; \ + else \ + attr = FUNC_BACKING_STORE_CFG_REQ_QPC_PG_SIZE_PG_4K; \ +} while (0) +struct bnxt_ctx_mem_info {u32 qp_max_entries;u16 qp_min_qp1_entries;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 249/296 mld: fix panic in mld_newpack()
In reply to Greg Kroah-HartmanFrom: Taehee Yoo <[email protected]>
[ Upstream commit 020ef930b826d21c5446fdc9db80fd72a791bc21 ]
mld_newpack() doesn't allow to allocate high order page, only order-0 allocation is allowed.
If headroom size is too large, a kernel panic could occur in skb_put().
Test commands:
ip netns del A
ip netns del B
ip netns add A
ip netns add B
ip link add veth0 type veth peer name veth1
ip link set veth0 netns A
ip link set veth1 netns B
ip netns exec A ip link set lo up
ip netns exec A ip link set veth0 up
ip netns exec A ip -6 a a 2001:db8:0::1/64 dev veth0 ip netns exec B ip link set lo up
ip netns exec B ip link set veth1 up
ip netns exec B ip -6 a a 2001:db8:0::2/64 dev veth1 for i in {1..99}
do
let A=$i-1
ip netns exec A ip link add ip6gre$i type ip6gre \
local 2001:db8:$A::1 remote 2001:db8:$A::2 encaplimit 100 ip netns exec A ip -6 a a 2001:db8:$i::1/64 dev ip6gre$i ip netns exec A ip link set ip6gre$i up
ip netns exec B ip link add ip6gre$i type ip6gre \
local 2001:db8:$A::2 remote 2001:db8:$A::1 encaplimit 100 ip netns exec B ip -6 a a 2001:db8:$i::2/64 dev ip6gre$i ip netns exec B ip link set ip6gre$i up
done
Splat looks like:
kernel BUG at net/core/skbuff.c:110!
invalid opcode: 0000 [#1] SMP DEBUG_PAGEALLOC KASAN PTI
CPU: 0 PID: 7 Comm: kworker/0:1 Not tainted 5.12.0+ #891 Workqueue: ipv6_addrconf addrconf_dad_work RIP: 0010:skb_panic+0x15d/0x15f Code: 92 fe 4c 8b 4c 24 10 53 8b 4d 70 45 89 e0 48 c7 c7 00 ae 79 83 41 57 41 56 41 55 48 8b 54 24 a6 26 f9 ff <0f> 0b 48 8b 6c 24 20 89 34 24 e8 4a 4e 92 fe 8b 34 24 48 c7 c1 20 RSP: 0018:ffff88810091f820 EFLAGS: 00010282 RAX: 0000000000000089 RBX: ffff8881086e9000 RCX: 0000000000000000 RDX: 0000000000000089 RSI: 0000000000000008 RDI: ffffed1020123efb RBP: ffff888005f6eac0 R08: ffffed1022fc0031 R09: ffffed1022fc0031 R10: ffff888117e00187 R11: ffffed1022fc0030 R12: 0000000000000028 R13: ffff888008284eb0 R14: 0000000000000ed8 R15: 0000000000000ec0 FS: 0000000000000000(0000) GS:ffff888117c00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8b801c5640 CR3: 0000000033c2c006 CR4: 00000000003706f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? ip6_mc_hdr.isra.26.constprop.46+0x12a/0x600 ? ip6_mc_hdr.isra.26.constprop.46+0x12a/0x600 skb_put.cold.104+0x22/0x22 ip6_mc_hdr.isra.26.constprop.46+0x12a/0x600 ? rcu_read_lock_sched_held+0x91/0xc0 mld_newpack+0x398/0x8f0 ? ip6_mc_hdr.isra.26.constprop.46+0x600/0x600 ? lock_contended+0xc40/0xc40 add_grhead.isra.33+0x280/0x380 add_grec+0x5ca/0xff0 ? mld_sendpack+0xf40/0xf40 ? lock_downgrade+0x690/0x690 mld_send_initial_cr.part.34+0xb9/0x180 ipv6_mc_dad_complete+0x15d/0x1b0 addrconf_dad_completed+0x8d2/0xbb0 ? lock_downgrade+0x690/0x690 ? addrconf_rs_timer+0x660/0x660 ? addrconf_dad_work+0x73c/0x10e0 addrconf_dad_work+0x73c/0x10e0
Allowing high order page allocation could fix this problem.
--- net/ipv6/mcast.c | 3 --- 1 file changed, 3 deletions(-)
net/ipv6/mcast.c +0 -3
@@ -1601,10 +1601,7 @@ static struct sk_buff *mld_newpack(struct inet6_dev *idev, unsigned int mtu) IPV6_TLV_PADN, 0 };/* we assume size > sizeof(ra) here */ -/* limit our allocations to order-0 page */ - size =min_t (int, size,SKB_MAX_ORDER (0 ,0 )); skb =sock_alloc_send_skb (sk, size,1 , &err); -if (!skb)return NULL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 250/296 net/smc: remove device from smcd_dev_list after failed device_add()
In reply to Greg Kroah-HartmanFrom: Julian Wiedmann <[email protected]>
[ Upstream commit 444d7be9532dcfda8e0385226c862fd7e986f607 ]
If the device_add() for a smcd_dev fails, there's no cleanup step that rolls back the earlier list_add(). The device subsequently gets freed, and we end up with a corrupted list.
Add some error handling that removes the device from the list.
--- net/smc/smc_ism.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-)
net/smc/smc_ism.c +10 -1
@@ -429,6 +429,8 @@ EXPORT_SYMBOL_GPL(smcd_alloc_dev);int smcd_register_dev (struct smcd_dev *smcd) { +int rc; +mutex_lock (&smcd_dev_list.mutex);if (list_empty (&smcd_dev_list.list)) {u8 *system_eid =NULL ;
@@ -448,7 +450,14 @@ int smcd_register_dev(struct smcd_dev *smcd)dev_name (&smcd->dev), smcd->pnetid, smcd->pnetid_by_user ? " (user defined)" : ""); -return device_add (&smcd->dev); + rc =device_add (&smcd->dev); +if (rc) { +mutex_lock (&smcd_dev_list.mutex); +list_del (&smcd->list); +mutex_unlock (&smcd_dev_list.mutex); + } + +return rc; }EXPORT_SYMBOL_GPL (smcd_register_dev);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 251/296 gve: Check TX QPL was actually assigned
In reply to Greg Kroah-HartmanFrom: Catherine Sullivan <[email protected]>
[ Upstream commit 5aec55b46c6238506cdf0c60cd0e42ab77a1e5e0 ]
Correctly check the TX QPL was assigned and unassigned if other steps in the allocation fail.
--- drivers/net/ethernet/google/gve/gve_tx.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-)
drivers/net/ethernet/google/gve/gve_tx.c +6 -2
@@ -212,10 +212,11 @@ static int gve_tx_alloc_ring(struct gve_priv *priv, int idx) tx->dev = &priv->pdev->dev;if (!tx->raw_addressing) { tx->tx_fifo.qpl =gve_assign_tx_qpl (priv); - +if (!tx->tx_fifo.qpl) + goto abort_with_desc;/* map Tx FIFO */ if (gve_tx_fifo_init (priv, &tx->tx_fifo)) - goto abort_with_desc; + goto abort_with_qpl; } tx->q_resources =
@@ -236,6 +237,9 @@ static int gve_tx_alloc_ring(struct gve_priv *priv, int idx) abort_with_fifo:if (!tx->raw_addressing)gve_tx_fifo_release (priv, &tx->tx_fifo); +abort_with_qpl: +if (!tx->raw_addressing) +gve_unassign_qpl (priv, tx->tx_fifo.qpl->id); abort_with_desc:dma_free_coherent (hdev, bytes, tx->desc, tx->bus); tx->desc =NULL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 252/296 gve: Update mgmt_msix_idx if num_ntfy changes
In reply to Greg Kroah-HartmanFrom: David Awogbemila <[email protected]>
[ Upstream commit e96b491a0ffa35a8a9607c193fa4d894ca9fb32f ]
If we do not get the expected number of vectors from pci_enable_msix_range, we update priv->num_ntfy_blks but not priv->mgmt_msix_idx. This patch fixes this so that priv->mgmt_msix_idx is updated accordingly.
--- drivers/net/ethernet/google/gve/gve_main.c | 1 + 1 file changed, 1 insertion(+)
drivers/net/ethernet/google/gve/gve_main.c +1 -0
@@ -220,6 +220,7 @@ static int gve_alloc_notify_blocks(struct gve_priv *priv)int vecs_left = new_num_ntfy_blks %2 ; priv->num_ntfy_blks = new_num_ntfy_blks; + priv->mgmt_msix_idx = priv->num_ntfy_blks; priv->tx_cfg.max_queues =min_t (int, priv->tx_cfg.max_queues, vecs_per_type); priv->rx_cfg.max_queues = min_t(int, priv->rx_cfg.max_queues,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 253/296 gve: Add NULL pointer checks when freeing irqs.
In reply to Greg Kroah-HartmanFrom: David Awogbemila <[email protected]>
[ Upstream commit 5218e919c8d06279884aa0baf76778a6817d5b93 ]
When freeing notification blocks, we index priv->msix_vectors. If we failed to allocate priv->msix_vectors (see abort_with_msix_vectors) this could lead to a NULL pointer dereference if the driver is unloaded.
--- drivers/net/ethernet/google/gve/gve_main.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-)
drivers/net/ethernet/google/gve/gve_main.c +11 -9
@@ -301,20 +301,22 @@ static void gve_free_notify_blocks(struct gve_priv *priv) {int i; -/* Free the irqs */ -for (i =0 ; i < priv->num_ntfy_blks; i++) { -struct gve_notify_block *block = &priv->ntfy_blocks[i]; -int msix_idx = i; - -irq_set_affinity_hint (priv->msix_vectors[msix_idx].vector, -NULL ); -free_irq (priv->msix_vectors[msix_idx].vector, block); +if (priv->msix_vectors) { +/* Free the irqs */ +for (i =0 ; i < priv->num_ntfy_blks; i++) { +struct gve_notify_block *block = &priv->ntfy_blocks[i]; +int msix_idx = i; + +irq_set_affinity_hint (priv->msix_vectors[msix_idx].vector, +NULL ); +free_irq (priv->msix_vectors[msix_idx].vector, block); + } +free_irq (priv->msix_vectors[priv->mgmt_msix_idx].vector, priv); }dma_free_coherent (&priv->pdev->dev, priv->num_ntfy_blks *sizeof (*priv->ntfy_blocks), priv->ntfy_blocks, priv->ntfy_block_bus); priv->ntfy_blocks =NULL ; -free_irq (priv->msix_vectors[priv->mgmt_msix_idx].vector, priv);pci_disable_msix (priv->pdev);kvfree (priv->msix_vectors); priv->msix_vectors =NULL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 254/296 gve: Upgrade memory barrier in poll routine
In reply to Greg Kroah-HartmanFrom: Catherine Sullivan <[email protected]>
[ Upstream commit f81781835f0adfae8d701545386030d223efcd6f ]
As currently written, if the driver checks for more work (via gve_tx_poll or gve_rx_poll) before the device posts work and the irq doorbell is not unmasked
(via iowrite32be(GVE_IRQ_ACK | GVE_IRQ_EVENT, ...)) before the device attempts to raise an interrupt, an interrupt is lost and this could potentially lead to the traffic being completely halted. For example, if a tx queue has already been stopped, the driver won't get the chance to complete work and egress will be halted.
We need a full memory barrier in the poll
routine to ensure that the irq doorbell is unmasked before the driver checks for more work.
--- drivers/net/ethernet/google/gve/gve_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/google/gve/gve_main.c +1 -1
@@ -180,7 +180,7 @@ static int gve_napi_poll(struct napi_struct *napi, int budget)/* Double check we have no extra work. * Ensure unmask synchronizes with checking for work. */ -dma_rmb (); +mb ();if (block->tx) reschedule |=gve_tx_poll (block,-1 );if (block->rx)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 255/296 gve: Correct SKB queue index validation.
In reply to Greg Kroah-HartmanFrom: David Awogbemila <[email protected]>
[ Upstream commit fbd4a28b4fa66faaa7f510c0adc531d37e0a7848 ]
SKBs with skb_get_queue_mapping(skb) == tx_cfg.num_queues should also be considered invalid.
--- drivers/net/ethernet/google/gve/gve_tx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/google/gve/gve_tx.c +1 -1
@@ -593,7 +593,7 @@ netdev_tx_t gve_tx(struct sk_buff *skb, struct net_device *dev)struct gve_tx_ring *tx;int nsegs; -WARN (skb_get_queue_mapping (skb) > priv->tx_cfg.num_queues, +WARN (skb_get_queue_mapping (skb) >= priv->tx_cfg.num_queues,"skb queue index out of range" ); tx = &priv->tx[skb_get_queue_mapping (skb)];if (unlikely (gve_maybe_stop_tx (tx, skb))) {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 256/296 iommu/amd: Clear DMA ops when switching domain
In reply to Greg Kroah-HartmanFrom: Jean-Philippe Brucker <[email protected]>
[ Upstream commit d6177a6556f853785867e2ec6d5b7f4906f0d809 ]
Since commit 08a27c1c3ecf ("iommu: Add support to change default domain of an iommu group") a user can switch a device between IOMMU and direct DMA through sysfs. This doesn't work for AMD IOMMU at the moment because dev->dma_ops is not cleared when switching from a DMA to an identity IOMMU domain. The DMA layer thus attempts to use the dma-iommu ops on an identity domain, causing an oops:
# echo 0000:00:05.0 > /sys/sys/bus/pci/drivers/e1000e/unbind
# echo identity > /sys/bus/pci/devices/0000:00:05.0/iommu_group/type
# echo 0000:00:05.0 > /sys/sys/bus/pci/drivers/e1000e/bind
...
BUG: kernel NULL pointer dereference, address: 0000000000000028
...
Call Trace:
iommu_dma_alloc
e1000e_setup_tx_resources
e1000e_openSince iommu_change_dev_def_domain() calls probe_finalize() again, clear the dma_ops there like Vt-d does.
--- drivers/iommu/amd/iommu.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/iommu/amd/iommu.c +2 -0
@@ -1747,6 +1747,8 @@ static void amd_iommu_probe_finalize(struct device *dev) domain =iommu_get_domain_for_dev (dev);if (domain->type ==IOMMU_DOMAIN_DMA )iommu_setup_dma_ops (dev,IOVA_START_PFN <<PAGE_SHIFT ,0 ); +else +set_dma_ops (dev,NULL ); }static void amd_iommu_release_device (struct device *dev)
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 257/296 iommu/virtio: Add missing MODULE_DEVICE_TABLE
In reply to Greg Kroah-HartmanFrom: Bixuan Cui <[email protected]>
[ Upstream commit 382d91fc0f4f1b13f8a0dcbf7145f4f175b71a18 ]
This patch adds missing MODULE_DEVICE_TABLE definition which generates correct modalias for automatic loading of this driver when it is built as an external module.
--- drivers/iommu/virtio-iommu.c | 1 + 1 file changed, 1 insertion(+)
drivers/iommu/virtio-iommu.c +1 -0
@@ -1138,6 +1138,7 @@ static struct virtio_device_id id_table[] = { { VIRTIO_ID_IOMMU, VIRTIO_DEV_ANY_ID }, { 0 }, }; +MODULE_DEVICE_TABLE (virtio, id_table);static struct virtio_driver virtio_iommu_drv = { .driver.name = KBUILD_MODNAME,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 258/296 net: hns3: fix incorrect resp_msg issue
In reply to Greg Kroah-HartmanFrom: Jiaran Zhang <[email protected]>
[ Upstream commit a710b9ffbebaf713f7dbd4dbd9524907e5d66f33 ]
In hclge_mbx_handler(), if there are two consecutive mailbox messages that requires resp_msg, the resp_msg is not cleared after processing the first message, which will cause the resp_msg data of second message incorrect.
Fix it by clearing the resp_msg before processing every mailbox message.
--- drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/net/ethernet/hisilicon/hns3/hns3pf/hclge_mbx.c +3 -1
@@ -694,7 +694,6 @@ void hclge_mbx_handler(struct hclge_dev *hdev)unsigned int flag;int ret =0 ; -memset (&resp_msg,0 ,sizeof (resp_msg));/* handle all the mailbox requests in the queue */ while (!hclge_cmd_crq_empty (&hdev->hw)) {if (test_bit (HCLGE_STATE_CMD_DISABLE , &hdev->state)) {
@@ -722,6 +721,9 @@ void hclge_mbx_handler(struct hclge_dev *hdev)trace_hclge_pf_mbx_get (hdev, req); +/* clear the resp_msg before processing every mailbox message */ +memset (&resp_msg,0 ,sizeof (resp_msg)); +switch (req->msg.code) {case HCLGE_MBX_MAP_RING_TO_VECTOR : ret = hclge_map_unmap_ring_to_vf_vector(vport, true,
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 259/296 net: hns3: put off calling register_netdev() until client initialize complete
In reply to Greg Kroah-HartmanFrom: Jian Shen <[email protected]>
[ Upstream commit a289a7e5c1d49b7d47df9913c1cc81fb48fab613 ]
Currently, the netdevice is registered before client initializing complete. So there is a timewindow between netdevice available and usable. In this case, if user try to change the channel number or ring param, it may cause the hns3_set_rx_cpu_rmap() being called twice, and report bug.
[47199.416502] hns3 0000:35:00.0 eth1: set channels: tqp_num=1, rxfh=0 [47199.430340] hns3 0000:35:00.0 eth1: already uninitialized [47199.438554] hns3 0000:35:00.0: rss changes from 4 to 1 [47199.511854] hns3 0000:35:00.0: Channels changed, rss_size from 4 to 1, tqps from 4 to 1 [47200.163524] ------------[ cut here ]------------ [47200.171674] kernel BUG at lib/cpu_rmap.c:142! [47200.177847] Internal error: Oops - BUG: 0 [#1] PREEMPT SMP [47200.185259] Modules linked in: hclge(+) hns3(-) hns3_cae(O) hns_roce_hw_v2 hnae3 vfio_iommu_type1 vfio_pci vfio_virqfd vfio pv680_mii(O) [last unloaded: hclge] [47200.205912] CPU: 1 PID: 8260 Comm: ethtool Tainted: G O 5.11.0-rc3+ #1 [47200.215601] Hardware name: , xxxxxx 02/04/2021 [47200.223052] pstate: 60400009 (nZCv daif +PAN -UAO -TCO BTYPE=--) [47200.230188] pc : cpu_rmap_add+0x38/0x40 [47200.237472] lr : irq_cpu_rmap_add+0x84/0x140 [47200.243291] sp : ffff800010e93a30 [47200.247295] x29: ffff800010e93a30 x28: ffff082100584880 [47200.254155] x27: 0000000000000000 x26: 0000000000000000 [47200.260712] x25: 0000000000000000 x24: 0000000000000004 [47200.267241] x23: ffff08209ba03000 x22: ffff08209ba038c0 [47200.273789] x21: 000000000000003f x20: ffff0820e2bc1680 [47200.280400] x19: ffff0820c970ec80 x18: 00000000000000c0 [47200.286944] x17: 0000000000000000 x16: ffffb43debe4a0d0 [47200.293456] x15: fffffc2082990600 x14: dead000000000122 [47200.300059] x13: ffffffffffffffff x12: 000000000000003e [47200.306606] x11: ffff0820815b8080 x10: ffff53e411988000 [47200.313171] x9 : 0000000000000000 x8 : ffff0820e2bc1700 [47200.319682] x7 : 0000000000000000 x6 : 000000000000003f [47200.326170] x5 : 0000000000000040 x4 : ffff800010e93a20 [47200.332656] x3 : 0000000000000004 x2 : ffff0820c970ec80 [47200.339168] x1 : ffff0820e2bc1680 x0 : 0000000000000004 [47200.346058] Call trace: [47200.349324] cpu_rmap_add+0x38/0x40 [47200.354300] hns3_set_rx_cpu_rmap+0x6c/0xe0 [hns3] [47200.362294] hns3_reset_notify_init_enet+0x1cc/0x340 [hns3] [47200.370049] hns3_change_channels+0x40/0xb0 [hns3] [47200.376770] hns3_set_channels+0x12c/0x2a0 [hns3] [47200.383353] ethtool_set_channels+0x140/0x250 [47200.389772] dev_ethtool+0x714/0x23d0 [47200.394440] dev_ioctl+0x4cc/0x640 [47200.399277] sock_do_ioctl+0x100/0x2a0 [47200.404574] sock_ioctl+0x28c/0x470 [47200.409079] __arm64_sys_ioctl+0xb4/0x100 [47200.415217] el0_svc_common.constprop.0+0x84/0x210 [47200.422088] do_el0_svc+0x28/0x34 [47200.426387] el0_svc+0x28/0x70 [47200.431308] el0_sync_handler+0x1a4/0x1b0 [47200.436477] el0_sync+0x174/0x180 [47200.441562] Code: 11000405 79000c45 f8247861 d65f03c0 (d4210000) [47200.448869] ---[ end trace a01efe4ce42e5f34 ]---
The process is like below:
excuting hns3_client_init
|register_netdev()
| hns3_set_channels() | | hns3_set_rx_cpu_rmap() hns3_reset_notify_uninit_enet() | | | quit without calling function | hns3_free_rx_cpu_rmap for flag | HNS3_NIC_STATE_INITED is unset. | | | hns3_reset_notify_init_enet() | | set HNS3_NIC_STATE_INITED call hns3_set_rx_cpu_rmap()-- crash
Fix it by calling register_netdev() at the end of function hns3_client_init().
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +8 -8
@@ -4287,12 +4287,6 @@ static int hns3_client_init(struct hnae3_handle *handle)if (ret) goto out_init_phy; - ret =register_netdev (netdev); -if (ret) { -dev_err (priv->dev,"probe register netdev fail!\n" ); - goto out_reg_netdev_fail; - } -/* the device can work without cpu rmap, only aRFS needs it */ ret =hns3_set_rx_cpu_rmap (netdev);if (ret)
@@ -4325,17 +4319,23 @@ static int hns3_client_init(struct hnae3_handle *handle)if (ae_dev->dev_version >=HNAE3_DEVICE_VERSION_V3 )set_bit (HNAE3_PFLAG_LIMIT_PROMISC , &handle->supported_pflags); + ret =register_netdev (netdev); +if (ret) { +dev_err (priv->dev,"probe register netdev fail!\n" ); + goto out_reg_netdev_fail; + } +if (netif_msg_drv (handle))hns3_info_show (priv);return ret; +out_reg_netdev_fail: +hns3_dbg_uninit (handle); out_client_start:hns3_free_rx_cpu_rmap (netdev);hns3_nic_uninit_irq (priv); out_init_irq_fail: -unregister_netdev (netdev); -out_reg_netdev_fail:hns3_uninit_phy (netdev); out_init_phy:hns3_uninit_all_ring (priv);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 260/296 net: hns3: fix users coalesce configuration lost issue
In reply to Greg Kroah-HartmanFrom: Huazhong Tan <[email protected]>
[ Upstream commit 73a13d8dbe33e53a12400f2be0f5af169816c67f ]
Currently, when adaptive is on, the user's coalesce configuration may be overwritten by the dynamic one. The reason is that user's configurations are saved in struct hns3_enet_tqp_vector whose value maybe changed by the dynamic algorithm. To fix it, use struct hns3_nic_priv instead of struct hns3_enet_tqp_vector to save and get the user's configuration.
BTW, operations of storing and restoring coalesce info in the reset process are unnecessary now, so remove them as well.
--- .../net/ethernet/hisilicon/hns3/hns3_enet.c | 84 +++++++++---------- .../ethernet/hisilicon/hns3/hns3_ethtool.c | 64 +++++--------- 2 files changed, 63 insertions(+), 85 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +40 -44
@@ -265,22 +265,17 @@ static void hns3_vector_coalesce_init(struct hns3_enet_tqp_vector *tqp_vector,struct hnae3_ae_dev *ae_dev =pci_get_drvdata (priv->ae_handle->pdev);struct hns3_enet_coalesce *tx_coal = &tqp_vector->tx_group.coal;struct hns3_enet_coalesce *rx_coal = &tqp_vector->rx_group.coal; +struct hns3_enet_coalesce *ptx_coal = &priv->tx_coal; +struct hns3_enet_coalesce *prx_coal = &priv->rx_coal; -/* initialize the configuration for interrupt coalescing. -* 1. GL (Interrupt Gap Limiter) -* 2. RL (Interrupt Rate Limiter) -* 3. QL (Interrupt Quantity Limiter) -* -* Default: enable interrupt coalescing self-adaptive and GL -*/ - tx_coal->adapt_enable =1 ; - rx_coal->adapt_enable =1 ; + tx_coal->adapt_enable = ptx_coal->adapt_enable; + rx_coal->adapt_enable = prx_coal->adapt_enable; - tx_coal->int_gl =HNS3_INT_GL_50K ; - rx_coal->int_gl =HNS3_INT_GL_50K ; + tx_coal->int_gl = ptx_coal->int_gl; + rx_coal->int_gl = prx_coal->int_gl; - rx_coal->flow_level =HNS3_FLOW_LOW ; - tx_coal->flow_level =HNS3_FLOW_LOW ; + rx_coal->flow_level = prx_coal->flow_level; + tx_coal->flow_level = ptx_coal->flow_level;/* device version above V3(include V3), GL can configure 1us * unit, so uses 1us unit.
@@ -295,8 +290,8 @@ static void hns3_vector_coalesce_init(struct hns3_enet_tqp_vector *tqp_vector, rx_coal->ql_enable =1 ; tx_coal->int_ql_max = ae_dev->dev_specs.int_ql_max; rx_coal->int_ql_max = ae_dev->dev_specs.int_ql_max; - tx_coal->int_ql =HNS3_INT_QL_DEFAULT_CFG ; - rx_coal->int_ql =HNS3_INT_QL_DEFAULT_CFG ; + tx_coal->int_ql = ptx_coal->int_ql; + rx_coal->int_ql = prx_coal->int_ql; } }
@@ -3805,6 +3800,34 @@ map_ring_fail:return ret; } +static void hns3_nic_init_coal_cfg (struct hns3_nic_priv *priv) +{ +struct hnae3_ae_dev *ae_dev =pci_get_drvdata (priv->ae_handle->pdev); +struct hns3_enet_coalesce *tx_coal = &priv->tx_coal; +struct hns3_enet_coalesce *rx_coal = &priv->rx_coal; + +/* initialize the configuration for interrupt coalescing. +* 1. GL (Interrupt Gap Limiter) +* 2. RL (Interrupt Rate Limiter) +* 3. QL (Interrupt Quantity Limiter) +* +* Default: enable interrupt coalescing self-adaptive and GL +*/ + tx_coal->adapt_enable =1 ; + rx_coal->adapt_enable =1 ; + + tx_coal->int_gl =HNS3_INT_GL_50K ; + rx_coal->int_gl =HNS3_INT_GL_50K ; + + rx_coal->flow_level =HNS3_FLOW_LOW ; + tx_coal->flow_level =HNS3_FLOW_LOW ; + +if (ae_dev->dev_specs.int_ql_max) { + tx_coal->int_ql =HNS3_INT_QL_DEFAULT_CFG ; + rx_coal->int_ql =HNS3_INT_QL_DEFAULT_CFG ; + } +} +static int hns3_nic_alloc_vector_data (struct hns3_nic_priv *priv) {struct hnae3_handle *h = priv->ae_handle;
@@ -4265,6 +4288,8 @@ static int hns3_client_init(struct hnae3_handle *handle) goto out_get_ring_cfg; } +hns3_nic_init_coal_cfg (priv); + ret =hns3_nic_alloc_vector_data (priv);if (ret) { ret = -ENOMEM ;
@@ -4543,31 +4568,6 @@ int hns3_nic_reset_all_ring(struct hnae3_handle *h)return 0 ; } -static void hns3_store_coal (struct hns3_nic_priv *priv) -{ -/* ethtool only support setting and querying one coal -* configuration for now, so save the vector 0' coal -* configuration here in order to restore it. -*/ -memcpy (&priv->tx_coal, &priv->tqp_vector[0 ].tx_group.coal, -sizeof (struct hns3_enet_coalesce )); -memcpy (&priv->rx_coal, &priv->tqp_vector[0 ].rx_group.coal, -sizeof (struct hns3_enet_coalesce )); -} - -static void hns3_restore_coal (struct hns3_nic_priv *priv) -{ -u16 vector_num = priv->vector_num; -int i; - -for (i =0 ; i < vector_num; i++) { -memcpy (&priv->tqp_vector[i].tx_group.coal, &priv->tx_coal, -sizeof (struct hns3_enet_coalesce )); -memcpy (&priv->tqp_vector[i].rx_group.coal, &priv->rx_coal, -sizeof (struct hns3_enet_coalesce )); - } -} -static int hns3_reset_notify_down_enet (struct hnae3_handle *handle) {struct hnae3_knic_private_info *kinfo = &handle->kinfo;
@@ -4626,8 +4626,6 @@ static int hns3_reset_notify_init_enet(struct hnae3_handle *handle)if (ret) goto err_put_ring; -hns3_restore_coal (priv); - ret =hns3_nic_init_vector_data (priv);if (ret) goto err_dealloc_vector;
@@ -4693,8 +4691,6 @@ static int hns3_reset_notify_uninit_enet(struct hnae3_handle *handle)hns3_nic_uninit_vector_data (priv); -hns3_store_coal (priv); -hns3_nic_dealloc_vector_data (priv);hns3_uninit_all_ring (priv);
drivers/net/ethernet/hisilicon/hns3/hns3_ethtool.c +23 -41
104 lines not on this page · raw message
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 261/296 net/mlx5: SF, Fix show state inactive when its inactivated
In reply to Greg Kroah-HartmanFrom: Parav Pandit <[email protected]>
[ Upstream commit 82041634d96e87b41c600a673f10150d9f21f742 ]
When a SF is inactivated and when it is in a TEARDOWN_REQUEST state, driver still returns its state as active. This is incorrect. Fix it by treating TEARDOWN_REQEUST as inactive state. When a SF is still attached to the driver, on user request to reactivate EINVAL error is returned. Inform user about it with better code EBUSY and informative error message.
--- .../ethernet/mellanox/mlx5/core/sf/devlink.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/sf/devlink.c +11 -7
@@ -128,10 +128,10 @@ static enum devlink_port_fn_state mlx5_sf_to_devlink_state(u8 hw_state)switch (hw_state) {case MLX5_VHCA_STATE_ACTIVE :case MLX5_VHCA_STATE_IN_USE : -case MLX5_VHCA_STATE_TEARDOWN_REQUEST :return DEVLINK_PORT_FN_STATE_ACTIVE ;case MLX5_VHCA_STATE_INVALID :case MLX5_VHCA_STATE_ALLOCATED : +case MLX5_VHCA_STATE_TEARDOWN_REQUEST :default :return DEVLINK_PORT_FN_STATE_INACTIVE ; }
@@ -184,14 +184,17 @@ sf_err:return err; } -static int mlx5_sf_activate (struct mlx5_core_dev *dev,struct mlx5_sf *sf) +static int mlx5_sf_activate (struct mlx5_core_dev *dev,struct mlx5_sf *sf, +struct netlink_ext_ack *extack) {int err;if (mlx5_sf_is_active (sf))return 0 ; -if (sf->hw_state !=MLX5_VHCA_STATE_ALLOCATED ) -return -EINVAL ; +if (sf->hw_state !=MLX5_VHCA_STATE_ALLOCATED ) { +NL_SET_ERR_MSG_MOD (extack,"SF is inactivated but it is still attached" ); +return -EBUSY ; + } err =mlx5_cmd_sf_enable_hca (dev, sf->hw_fn_id);if (err)
@@ -218,7 +221,8 @@ static int mlx5_sf_deactivate(struct mlx5_core_dev *dev, struct mlx5_sf *sf)static int mlx5_sf_state_set (struct mlx5_core_dev *dev,struct mlx5_sf_table *table,struct mlx5_sf *sf, -enum devlink_port_fn_state state) +enum devlink_port_fn_state state, +struct netlink_ext_ack *extack) {int err =0 ;
@@ -226,7 +230,7 @@ static int mlx5_sf_state_set(struct mlx5_core_dev *dev, struct mlx5_sf_table *taif (state ==mlx5_sf_to_devlink_state (sf->hw_state)) goto out;if (state ==DEVLINK_PORT_FN_STATE_ACTIVE ) - err =mlx5_sf_activate (dev, sf); + err =mlx5_sf_activate (dev, sf, extack);else if (state ==DEVLINK_PORT_FN_STATE_INACTIVE ) err =mlx5_sf_deactivate (dev, sf);else
@@ -257,7 +261,7 @@ int mlx5_devlink_sf_port_fn_state_set(struct devlink *devlink, struct devlink_po goto out; } - err =mlx5_sf_state_set (dev, table, sf, state); + err =mlx5_sf_state_set (dev, table, sf, state, extack); out:mlx5_sf_table_put (table);return err;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 262/296 net/mlx5e: Make sure fib dev exists in fib event
In reply to Greg Kroah-HartmanFrom: Roi Dayan <[email protected]>
[ Upstream commit eb96cc15926f4ddde3a28c42feeffdf002451c24 ]
For unreachable route entry the fib dev does not exists.
--- drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/mellanox/mlx5/core/en/tc_tun_encap.c +1 -1
@@ -1504,7 +1504,7 @@ mlx5e_init_fib_work_ipv4(struct mlx5e_priv *priv, fen_info = container_of(info, struct fib_entry_notifier_info, info); fib_dev =fib_info_nh (fen_info->fi,0 )->fib_nh_dev; -if (fib_dev->netdev_ops != &mlx5e_netdev_ops || +if (!fib_dev || fib_dev->netdev_ops != &mlx5e_netdev_ops || fen_info->dst_len !=32 )return NULL ;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 263/296 net/mlx5e: Reject mirroring on source port change encap rules
In reply to Greg Kroah-HartmanFrom: Vlad Buslov <[email protected]>
[ Upstream commit 7d1a3d08c8a6398e7497a98cf3f7b73ea13d9939 ]
Rules with MLX5_ESW_DEST_CHAIN_WITH_SRC_PORT_CHANGE dest flag are translated to destination FT in eswitch. Currently it is not possible to mirror such rules because firmware doesn't support mixing FT and Vport destinations in single rule when one of them adds encapsulation. Since the only use case for MLX5_ESW_DEST_CHAIN_WITH_SRC_PORT_CHANGE destination is support for tunnel endpoints on VF and trying to offload such rule with mirror action causes either crash in fs_core or firmware error with syndrome 0xff6a1d, reject all such rules in mlx5 TC layer.
--- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 6 ++++++ 1 file changed, 6 insertions(+)
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +6 -0
@@ -1353,6 +1353,12 @@ mlx5e_tc_add_fdb_flow(struct mlx5e_priv *priv, esw_attr->dests[out_index].mdev = out_priv->mdev; } +if (vf_tun && esw_attr->out_count >1 ) { +NL_SET_ERR_MSG_MOD (extack,"VF tunnel encap with mirroring is not supported" ); + err = -EOPNOTSUPP ; + goto err_out; + } + err =mlx5_eswitch_add_vlan_action (esw, attr);if (err) goto err_out;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 264/296 iommu/vt-d: Check for allocation failure in aux_detach_device()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 1a590a1c8bf46bf80ea12b657ca44c345531ac80 ]
In current kernels small allocations never fail, but checking for allocation failure is the correct thing to do.
--- drivers/iommu/intel/iommu.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/iommu/intel/iommu.c +2 -0
@@ -4626,6 +4626,8 @@ static int auxiliary_link_device(struct dmar_domain *domain,if (!sinfo) { sinfo =kzalloc (sizeof (*sinfo),GFP_ATOMIC ); +if (!sinfo) +return -ENOMEM ; sinfo->domain = domain; sinfo->pdev = dev;list_add (&sinfo->link_phys, &info->subdevices);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 265/296 iommu/vt-d: Use user privilege for RID2PASID translation
In reply to Greg Kroah-HartmanFrom: Lu Baolu <[email protected]>
[ Upstream commit 54c80d907400189b09548039be8f3b6e297e8ae3 ]
When first-level page tables are used for IOVA translation, we use user privilege by setting U/S bit in the page table entry. This is to make it consistent with the second level translation, where the U/S enforcement is not available. Clear the SRE (Supervisor Request Enable) field in the pasid table entry of RID2PASID so that requests requesting the supervisor privilege are blocked and treated as DMA remapping faults.
--- drivers/iommu/intel/iommu.c | 7 +++++-- drivers/iommu/intel/pasid.c | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-)
drivers/iommu/intel/iommu.c +5 -2
@@ -2525,9 +2525,9 @@ static int domain_setup_first_level(struct intel_iommu *iommu, struct device *dev, u32 pasid) { - int flags = PASID_FLAG_SUPERVISOR_MODE;struct dma_pte *pgd = domain->pgd;int agaw, level; +int flags =0 ;/* * Skip top levels of page tables for iommu which has
@@ -2543,7 +2543,10 @@ static int domain_setup_first_level(struct intel_iommu *iommu,if (level !=4 && level !=5 )return -EINVAL ; - flags |= (level ==5 ) ?PASID_FLAG_FL5LP :0 ; +if (pasid !=PASID_RID2PASID ) + flags |=PASID_FLAG_SUPERVISOR_MODE ; +if (level ==5 ) + flags |=PASID_FLAG_FL5LP ;if (domain->domain.type ==IOMMU_DOMAIN_UNMANAGED ) flags |=PASID_FLAG_PAGE_SNOOP ;
drivers/iommu/intel/pasid.c +2 -1
@@ -663,7 +663,8 @@ int intel_pasid_setup_second_level(struct intel_iommu *iommu,* Since it is a second level only translation setup, we should * set SRE bit as well (addresses are expected to be GPAs). */ -pasid_set_sre (pte); +if (pasid !=PASID_RID2PASID ) +pasid_set_sre (pte);pasid_set_present (pte);pasid_flush_caches (iommu, pte, pasid, did);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 266/296 cxgb4: avoid accessing registers when clearing filters
In reply to Greg Kroah-HartmanFrom: Raju Rangoju <[email protected]>
[ Upstream commit 88c380df84fbd03f9b137c2b9d0a44b9f2f553b0 ]
Hardware register having the server TID base can contain invalid values when adapter is in bad state (for example, due to AER fatal error). Reading these invalid values in the register can lead to out-of-bound memory access. So, fix by using the saved server TID base when clearing filters.
--- drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/ethernet/chelsio/cxgb4/cxgb4_filter.c +1 -1
@@ -1042,7 +1042,7 @@ void clear_all_filters(struct adapter *adapter)cxgb4_del_filter (dev, f->tid, &f->fs); } - sb =t4_read_reg (adapter,LE_DB_SRVR_START_INDEX_A ); + sb = adapter->tids.stid_base;for (i =0 ; i < sb; i++) { f = (struct filter_entry *)adapter->tids.tid_tab[i];
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 267/296 staging: emxx_udc: fix loop in _nbu2ss_nuke()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit e0112a7c9e847ada15a631b88e279d547e8f26a7 ]
The _nbu2ss_ep_done() function calls:
list_del_init(&req->queue);
which means that the loop will never exit.
--- drivers/staging/emxx_udc/emxx_udc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/emxx_udc/emxx_udc.c +2 -2
@@ -2065,7 +2065,7 @@ static int _nbu2ss_nuke(struct nbu2ss_udc *udc, struct nbu2ss_ep *ep, int status) { -struct nbu2ss_req *req; +struct nbu2ss_req *req, *n;/* Endpoint Disable */ _nbu2ss_epn_exit (udc, ep);
@@ -2077,7 +2077,7 @@ static int _nbu2ss_nuke(struct nbu2ss_udc *udc,return 0 ;/* called with irqs blocked */ -list_for_each_entry (req, &ep->queue, queue) { +list_for_each_entry_safe (req, n, &ep->queue, queue) {_nbu2ss_ep_done (ep, req, status); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 268/296 ASoC: cs35l33: fix an error code in probe()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 833bc4cf9754643acc69b3c6b65988ca78df4460 ]
This error path returns zero (success) but it should return -EINVAL.
--- sound/soc/codecs/cs35l33.c | 1 + 1 file changed, 1 insertion(+)
sound/soc/codecs/cs35l33.c +1 -0
@@ -1201,6 +1201,7 @@ static int cs35l33_i2c_probe(struct i2c_client *i2c_client,dev_err (&i2c_client->dev,"CS35L33 Device ID (%X). Expected ID %X\n" , devid,CS35L33_CHIP_ID ); + ret = -EINVAL ; goto err_enable; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 269/296 bpf, offload: Reorder offload callback prepare in verifier
In reply to Greg Kroah-HartmanFrom: Yinjun Zhang <[email protected]>
[ Upstream commit ceb11679d9fcf3fdb358a310a38760fcbe9b63ed ]
Commit 4976b718c355 ("bpf: Introduce pseudo_btf_id") switched the order of resolve_pseudo_ldimm(), in which some pseudo instructions are rewritten. Thus those rewritten instructions cannot be passed to driver via 'prepare' offload callback.
Reorder the 'prepare' offload callback to fix it.
--- kernel/bpf/verifier.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
kernel/bpf/verifier.c +6 -6
@@ -12714,12 +12714,6 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr,if (is_priv) env->test_state_freq = attr->prog_flags &BPF_F_TEST_STATE_FREQ ; -if (bpf_prog_is_dev_bound (env->prog->aux)) { - ret =bpf_prog_offload_verifier_prep (env->prog); -if (ret) - goto skip_full_check; - } - env->explored_states =kvcalloc (state_htab_size (env),sizeof (struct bpf_verifier_state_list *),GFP_USER );
@@ -12743,6 +12737,12 @@ int bpf_check(struct bpf_prog **prog, union bpf_attr *attr,if (ret <0 ) goto skip_full_check; +if (bpf_prog_is_dev_bound (env->prog->aux)) { + ret =bpf_prog_offload_verifier_prep (env->prog); +if (ret) + goto skip_full_check; + } + ret =check_cfg (env);if (ret <0 ) goto skip_full_check;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 270/296 bpf: Set mac_len in bpf_skb_change_head
In reply to Greg Kroah-HartmanFrom: Jussi Maki <[email protected]>
[ Upstream commit 84316ca4e100d8cbfccd9f774e23817cb2059868 ]
The skb_change_head() helper did not set "skb->mac_len", which is problematic when it's used in combination with skb_redirect_peer(). Without it, redirecting a packet from a L3 device such as wireguard to the veth peer device will cause skb->data to point to the middle of the IP header on entry to tcp_v4_rcv() since the L2 header is not pulled correctly due to mac_len=0.
--- net/core/filter.c | 1 + 1 file changed, 1 insertion(+)
net/core/filter.c +1 -0
@@ -3782,6 +3782,7 @@ static inline int __bpf_skb_change_head(struct sk_buff *skb, u32 head_room,__skb_push (skb, head_room);memset (skb->data,0 , head_room);skb_reset_mac_header (skb); +skb_reset_mac_len (skb); }return ret;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 271/296 ixgbe: fix large MTU request from VF
In reply to Greg Kroah-HartmanFrom: Jesse Brandeburg <[email protected]>
[ Upstream commit 63e39d29b3da02e901349f6cd71159818a4737a6 ]
Check that the MTU value requested by the VF is in the supported range of MTUs before attempting to set the VF large packet enable, otherwise reject the request. This also avoids unnecessary register updates in the case of the 82599 controller.
--- drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-)
drivers/net/ethernet/intel/ixgbe/ixgbe_sriov.c +7 -9
@@ -467,12 +467,16 @@ static int ixgbe_set_vf_vlan(struct ixgbe_adapter *adapter, int add, int vid,return err; } -static s32 ixgbe_set_vf_lpe (struct ixgbe_adapter *adapter,u32 *msgbuf,u32 vf) +static int ixgbe_set_vf_lpe (struct ixgbe_adapter *adapter,u32 max_frame,u32 vf) {struct ixgbe_hw *hw = &adapter->hw; -int max_frame = msgbuf[1 ];u32 max_frs; +if (max_frame <ETH_MIN_MTU || max_frame >IXGBE_MAX_JUMBO_FRAME_SIZE ) { +e_err (drv,"VF max_frame %d out of range\n" , max_frame); +return -EINVAL ; + } +/* * For 82599EB we have to keep all PFs and VFs operating with * the same max_frame value in order to avoid sending an oversize
@@ -533,12 +537,6 @@ static s32 ixgbe_set_vf_lpe(struct ixgbe_adapter *adapter, u32 *msgbuf, u32 vf) } } -/* MTU < 68 is an error and causes problems on some kernels */ -if (max_frame >IXGBE_MAX_JUMBO_FRAME_SIZE ) { -e_err (drv,"VF max_frame %d out of range\n" , max_frame); -return -EINVAL ; - } -/* pull current max frame size from hardware */ max_frs =IXGBE_READ_REG (hw,IXGBE_MAXFRS ); max_frs &=IXGBE_MHADD_MFS_MASK ;
@@ -1249,7 +1247,7 @@ static int ixgbe_rcv_msg_from_vf(struct ixgbe_adapter *adapter, u32 vf) retval =ixgbe_set_vf_vlan_msg (adapter, msgbuf, vf);break ;case IXGBE_VF_SET_LPE : - retval =ixgbe_set_vf_lpe (adapter, msgbuf, vf); + retval =ixgbe_set_vf_lpe (adapter, msgbuf[1 ], vf);break ;case IXGBE_VF_SET_MACVLAN : retval =ixgbe_set_vf_macvlan_msg (adapter, msgbuf, vf);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 272/296 ASoC: qcom: lpass-cpu: Use optional clk APIs
In reply to Greg Kroah-HartmanFrom: Stephen Boyd <[email protected]>
[ Upstream commit af2702549d68519ac78228e915d9b2c199056787 ]
This driver spits out a warning for me at boot:
sc7180-lpass-cpu 62f00000.lpass: asoc_qcom_lpass_cpu_platform_probe() error getting optional null: -2
but it looks like it is all an optional clk. Use the optional clk APIs here so that we don't see this message and everything else is the same.
--- sound/soc/qcom/lpass-cpu.c | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-)
sound/soc/qcom/lpass-cpu.c +1 -11
@@ -835,18 +835,8 @@ int asoc_qcom_lpass_cpu_platform_probe(struct platform_device *pdev)if (dai_id ==LPASS_DP_RX )continue ; - drvdata->mi2s_osr_clk[dai_id] =devm_clk_get (dev, + drvdata->mi2s_osr_clk[dai_id] =devm_clk_get_optional (dev, variant->dai_osr_clk_names[i]); -if (IS_ERR (drvdata->mi2s_osr_clk[dai_id])) { -dev_warn (dev, -"%s() error getting optional %s: %ld\n" , - __func__, - variant->dai_osr_clk_names[i], -PTR_ERR (drvdata->mi2s_osr_clk[dai_id])); - - drvdata->mi2s_osr_clk[dai_id] =NULL ; - } - drvdata->mi2s_bit_clk[dai_id] =devm_clk_get (dev, variant->dai_bit_clk_names[i]);if (IS_ERR (drvdata->mi2s_bit_clk[dai_id])) {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 273/296 scsi: libsas: Use _safe() loop in sas_resume_port()
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
[ Upstream commit 8c7e7b8486cda21269d393245883c5e4737d5ee7 ]
If sas_notify_lldd_dev_found() fails then this code calls:
sas_unregister_dev(port, dev);
which removes "dev", our list iterator, from the list. This could lead to an endless loop. We need to use list_for_each_entry_safe().
--- drivers/scsi/libsas/sas_port.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/scsi/libsas/sas_port.c +2 -2
@@ -25,7 +25,7 @@ static bool phy_is_wideport_member(struct asd_sas_port *port, struct asd_sas_phystatic void sas_resume_port (struct asd_sas_phy *phy) { -struct domain_device *dev; +struct domain_device *dev, *n;struct asd_sas_port *port = phy->port;struct sas_ha_struct *sas_ha = phy->ha;struct sas_internal *si =to_sas_internal (sas_ha->core.shost->transportt);
@@ -44,7 +44,7 @@ static void sas_resume_port(struct asd_sas_phy *phy)* 1/ presume every device came back * 2/ force the next revalidation to check all expander phys */ -list_for_each_entry (dev, &port->dev_list, dev_list_node) { +list_for_each_entry_safe (dev, n, &port->dev_list, dev_list_node) {int i, rc; rc =sas_notify_lldd_dev_found (dev);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 274/296 net: lantiq: fix memory corruption in RX ring
In reply to Greg Kroah-HartmanFrom: Aleksander Jan Bajkowski <[email protected]>
[ Upstream commit c7718ee96dbc2f9c5fc3b578abdf296dd44b9c20 ]
In a situation where memory allocation or dma mapping fails, an invalid address is programmed into the descriptor. This can lead to memory corruption. If the memory allocation fails, DMA should reuse the previous skb and mapping and drop the packet. This patch also increments rx drop counter.
--- drivers/net/ethernet/lantiq_xrx200.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-)
drivers/net/ethernet/lantiq_xrx200.c +9 -5
@@ -154,6 +154,7 @@ static int xrx200_close(struct net_device *net_dev)static int xrx200_alloc_skb (struct xrx200_chan *ch) { +dma_addr_t mapping;int ret =0 ; ch->skb[ch->dma.desc] = netdev_alloc_skb_ip_align(ch->priv->net_dev,
@@ -163,16 +164,17 @@ static int xrx200_alloc_skb(struct xrx200_chan *ch) goto skip; } - ch->dma.desc_base[ch->dma.desc].addr =dma_map_single (ch->priv->dev, - ch->skb[ch->dma.desc]->data,XRX200_DMA_DATA_LEN , -DMA_FROM_DEVICE ); -if (unlikely (dma_mapping_error (ch->priv->dev, - ch->dma.desc_base[ch->dma.desc].addr))) { + mapping =dma_map_single (ch->priv->dev, ch->skb[ch->dma.desc]->data, +XRX200_DMA_DATA_LEN ,DMA_FROM_DEVICE ); +if (unlikely (dma_mapping_error (ch->priv->dev, mapping))) {dev_kfree_skb_any (ch->skb[ch->dma.desc]); ret = -ENOMEM ; goto skip; } + ch->dma.desc_base[ch->dma.desc].addr = mapping; +/* Make sure the address is written before we give it to HW */ +wmb (); skip: ch->dma.desc_base[ch->dma.desc].ctl = LTQ_DMA_OWN | LTQ_DMA_RX_OFFSET(NET_IP_ALIGN) |
@@ -196,6 +198,8 @@ static int xrx200_hw_receive(struct xrx200_chan *ch) ch->dma.desc %=LTQ_DESC_NUM ;if (ret) { + ch->skb[ch->dma.desc] = skb; + net_dev->stats.rx_dropped++;netdev_err (net_dev,"failed to allocate new rx buffer\n" );return ret; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 275/296 ipv6: record frag_max_size in atomic fragments in input path
In reply to Greg Kroah-HartmanFrom: Francesco Ruggeri <[email protected]>
[ Upstream commit e29f011e8fc04b2cdc742a2b9bbfa1b62518381a ]
Commit dbd1759e6a9c ("ipv6: on reassembly, record frag_max_size") filled the frag_max_size field in IP6CB in the input path. The field should also be filled in case of atomic fragments.
--- net/ipv6/reassembly.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
net/ipv6/reassembly.c +3 -1
@@ -343,7 +343,7 @@ static int ipv6_frag_rcv(struct sk_buff *skb) hdr =ipv6_hdr (skb); fhdr = (struct frag_hdr *)skb_transport_header (skb); -if (!(fhdr->frag_off &htons (0xFFF9 ))) { +if (!(fhdr->frag_off &htons (IP6_OFFSET |IP6_MF ))) {/* It is not a fragmented frame */ skb->transport_header +=sizeof (struct frag_hdr ); __IP6_INC_STATS(net,
@@ -351,6 +351,8 @@ static int ipv6_frag_rcv(struct sk_buff *skb)IP6CB (skb)->nhoff = (u8 *)fhdr -skb_network_header (skb);IP6CB (skb)->flags |=IP6SKB_FRAGMENTED ; +IP6CB (skb)->frag_max_size =ntohs (hdr->payload_len) + +sizeof (struct ipv6hdr );return 1 ; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 276/296 scsi: aic7xxx: Restore several defines for aic7xxx firmware build
In reply to Greg Kroah-HartmanFrom: Tom Rix <[email protected]>
[ Upstream commit 7e7606330b167a0ff483fb02caed9267bfab69ee ]
With CONFIG_AIC7XXX_BUILD_FIRMWARE, there is this representative error:
aicasm: Stopped at file ./drivers/scsi/aic7xxx/aic7xxx.seq,
line 271 - Undefined symbol MSG_SIMPLE_Q_TAG referenced
MSG_SIMPLE_Q_TAG used to be defined in drivers/scsi/aic7xxx/scsi_message.h as:
#define MSG_SIMPLE_Q_TAG 0x20 /* O/O */
The new definition in include/scsi/scsi.h is:
#define SIMPLE_QUEUE_TAG 0x20
But aicasm can not handle the all the preprocessor directives in scsi.h, so add MSG_SIMPLE_Q_TAB and other required defines back to scsi_message.h.
--- drivers/scsi/aic7xxx/scsi_message.h | 11 +++++++++++ 1 file changed, 11 insertions(+)
drivers/scsi/aic7xxx/scsi_message.h +11 -0
@@ -3,6 +3,17 @@* $FreeBSD: src/sys/cam/scsi/scsi_message.h,v 1.2 2000/05/01 20:21:29 peter Exp $ */ +/* Messages (1 byte) */ /* I/T (M)andatory or (O)ptional */ +#define MSG_SAVEDATAPOINTER 0x02/* O/O */ +#define MSG_RESTOREPOINTERS 0x03/* O/O */ +#define MSG_DISCONNECT 0x04/* O/O */ +#define MSG_MESSAGE_REJECT 0x07/* M/M */ +#define MSG_NOOP 0x08/* M/M */ + +/* Messages (2 byte) */ +#define MSG_SIMPLE_Q_TAG 0x20/* O/O */ +#define MSG_IGN_WIDE_RESIDUE 0x23/* O/O */ +/* Identify message */ /* M/M */ #define MSG_IDENTIFYFLAG 0x80#define MSG_IDENTIFY_DISCFLAG 0x40
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 277/296 ALSA: usb-audio: scarlett2: snd_scarlett_gen2_controls_create() can be static
In reply to Greg Kroah-HartmanFrom: kernel test robot <[email protected]>
[ Upstream commit 2b899f31f1a6db2db4608bac2ac04fe2c4ad89eb ]
sound/usb/mixer_scarlett_gen2.c:2000:5: warning: symbol 'snd_scarlett_gen2_controls_create' was not declared. Should it be static?
--- sound/usb/mixer_scarlett_gen2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
sound/usb/mixer_scarlett_gen2.c +2 -2
@@ -1997,8 +1997,8 @@ static int scarlett2_mixer_status_create(struct usb_mixer_interface *mixer)return usb_submit_urb (mixer->urb,GFP_KERNEL ); } -int snd_scarlett_gen2_controls_create (struct usb_mixer_interface *mixer, -const struct scarlett2_device_info *info) +static int snd_scarlett_gen2_controls_create (struct usb_mixer_interface *mixer, +const struct scarlett2_device_info *info) {int err;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 278/296 net: ethernet: mtk_eth_soc: Fix packet statistics support for MT7628/88
In reply to Greg Kroah-HartmanFrom: Stefan Roese <[email protected]>
[ Upstream commit ad79fd2c42f7626bdf6935cd72134c2a5a59ff2d ]
The MT7628/88 SoC(s) have other (limited) packet counter registers than currently supported in the mtk_eth_soc driver. This patch adds support for reading these registers, so that the packet statistics are correctly updated.
Additionally the defines for the non-MT7628 variant packet counter registers are added and used in this patch instead of using hard coded values.
--- drivers/net/ethernet/mediatek/mtk_eth_soc.c | 67 ++++++++++++++------- drivers/net/ethernet/mediatek/mtk_eth_soc.h | 24 +++++++- 2 files changed, 66 insertions(+), 25 deletions(-)
drivers/net/ethernet/mediatek/mtk_eth_soc.c +44 -23
@@ -679,32 +679,53 @@ static int mtk_set_mac_address(struct net_device *dev, void *p)void mtk_stats_update_mac (struct mtk_mac *mac) {struct mtk_hw_stats *hw_stats = mac->hw_stats; -unsigned int base =MTK_GDM1_TX_GBCNT ; -u64 stats; - - base += hw_stats->reg_offset; +struct mtk_eth *eth = mac->hw;u64_stats_update_begin (&hw_stats->syncp); - hw_stats->rx_bytes +=mtk_r32 (mac->hw, base); - stats =mtk_r32 (mac->hw, base +0x04 ); -if (stats) - hw_stats->rx_bytes += (stats <<32 ); - hw_stats->rx_packets +=mtk_r32 (mac->hw, base +0x08 ); - hw_stats->rx_overflow +=mtk_r32 (mac->hw, base +0x10 ); - hw_stats->rx_fcs_errors +=mtk_r32 (mac->hw, base +0x14 ); - hw_stats->rx_short_errors +=mtk_r32 (mac->hw, base +0x18 ); - hw_stats->rx_long_errors +=mtk_r32 (mac->hw, base +0x1c ); - hw_stats->rx_checksum_errors +=mtk_r32 (mac->hw, base +0x20 ); - hw_stats->rx_flow_control_packets += -mtk_r32 (mac->hw, base +0x24 ); - hw_stats->tx_skip +=mtk_r32 (mac->hw, base +0x28 ); - hw_stats->tx_collisions +=mtk_r32 (mac->hw, base +0x2c ); - hw_stats->tx_bytes +=mtk_r32 (mac->hw, base +0x30 ); - stats =mtk_r32 (mac->hw, base +0x34 ); -if (stats) - hw_stats->tx_bytes += (stats <<32 ); - hw_stats->tx_packets +=mtk_r32 (mac->hw, base +0x38 ); +if (MTK_HAS_CAPS (eth->soc->caps,MTK_SOC_MT7628 )) { + hw_stats->tx_packets +=mtk_r32 (mac->hw,MT7628_SDM_TPCNT ); + hw_stats->tx_bytes +=mtk_r32 (mac->hw,MT7628_SDM_TBCNT ); + hw_stats->rx_packets +=mtk_r32 (mac->hw,MT7628_SDM_RPCNT ); + hw_stats->rx_bytes +=mtk_r32 (mac->hw,MT7628_SDM_RBCNT ); + hw_stats->rx_checksum_errors += +mtk_r32 (mac->hw,MT7628_SDM_CS_ERR ); + }else { +unsigned int offs = hw_stats->reg_offset; +u64 stats; + + hw_stats->rx_bytes +=mtk_r32 (mac->hw, +MTK_GDM1_RX_GBCNT_L + offs); + stats =mtk_r32 (mac->hw,MTK_GDM1_RX_GBCNT_H + offs); +if (stats) + hw_stats->rx_bytes += (stats <<32 ); + hw_stats->rx_packets += +mtk_r32 (mac->hw,MTK_GDM1_RX_GPCNT + offs); + hw_stats->rx_overflow += +mtk_r32 (mac->hw,MTK_GDM1_RX_OERCNT + offs); + hw_stats->rx_fcs_errors += +mtk_r32 (mac->hw,MTK_GDM1_RX_FERCNT + offs); + hw_stats->rx_short_errors += +mtk_r32 (mac->hw,MTK_GDM1_RX_SERCNT + offs); + hw_stats->rx_long_errors += +mtk_r32 (mac->hw,MTK_GDM1_RX_LENCNT + offs); + hw_stats->rx_checksum_errors += +mtk_r32 (mac->hw,MTK_GDM1_RX_CERCNT + offs); + hw_stats->rx_flow_control_packets += +mtk_r32 (mac->hw,MTK_GDM1_RX_FCCNT + offs); + hw_stats->tx_skip += +mtk_r32 (mac->hw,MTK_GDM1_TX_SKIPCNT + offs); + hw_stats->tx_collisions += +mtk_r32 (mac->hw,MTK_GDM1_TX_COLCNT + offs); + hw_stats->tx_bytes += +mtk_r32 (mac->hw,MTK_GDM1_TX_GBCNT_L + offs); + stats =mtk_r32 (mac->hw,MTK_GDM1_TX_GBCNT_H + offs); +if (stats) + hw_stats->tx_bytes += (stats <<32 ); + hw_stats->tx_packets += +mtk_r32 (mac->hw,MTK_GDM1_TX_GPCNT + offs); + } +u64_stats_update_end (&hw_stats->syncp); }
drivers/net/ethernet/mediatek/mtk_eth_soc.h +22 -2
@@ -267,8 +267,21 @@/* QDMA FQ Free Page Buffer Length Register */ #define MTK_QDMA_FQ_BLEN 0x1B2C -/* GMA1 Received Good Byte Count Register */ -#define MTK_GDM1_TX_GBCNT 0x2400 +/* GMA1 counter / statics register */ +#define MTK_GDM1_RX_GBCNT_L 0x2400 +#define MTK_GDM1_RX_GBCNT_H 0x2404 +#define MTK_GDM1_RX_GPCNT 0x2408 +#define MTK_GDM1_RX_OERCNT 0x2410 +#define MTK_GDM1_RX_FERCNT 0x2414 +#define MTK_GDM1_RX_SERCNT 0x2418 +#define MTK_GDM1_RX_LENCNT 0x241c +#define MTK_GDM1_RX_CERCNT 0x2420 +#define MTK_GDM1_RX_FCCNT 0x2424 +#define MTK_GDM1_TX_SKIPCNT 0x2428 +#define MTK_GDM1_TX_COLCNT 0x242c +#define MTK_GDM1_TX_GBCNT_L 0x2430 +#define MTK_GDM1_TX_GBCNT_H 0x2434 +#define MTK_GDM1_TX_GPCNT 0x2438#define MTK_STAT_OFFSET 0x40/* QDMA descriptor txd4 */
@@ -484,6 +497,13 @@#define MT7628_SDM_MAC_ADRL (MT7628_SDM_OFFSET + 0x0c)#define MT7628_SDM_MAC_ADRH (MT7628_SDM_OFFSET + 0x10) +/* Counter / stat register */ +#define MT7628_SDM_TPCNT (MT7628_SDM_OFFSET + 0x100) +#define MT7628_SDM_TBCNT (MT7628_SDM_OFFSET + 0x104) +#define MT7628_SDM_RPCNT (MT7628_SDM_OFFSET + 0x108) +#define MT7628_SDM_RBCNT (MT7628_SDM_OFFSET + 0x10c) +#define MT7628_SDM_CS_ERR (MT7628_SDM_OFFSET + 0x110) +struct mtk_rx_dma {unsigned int rxd1;unsigned int rxd2;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 279/296 sch_dsmark: fix a NULL deref in qdisc_reset()
In reply to Greg Kroah-HartmanFrom: Taehee Yoo <[email protected]>
[ Upstream commit 9b76eade16423ef06829cccfe3e100cfce31afcd ]
If Qdisc_ops->init() is failed, Qdisc_ops->reset() would be called. When dsmark_init(Qdisc_ops->init()) is failed, it possibly doesn't initialize dsmark_qdisc_data->q. But dsmark_reset(Qdisc_ops->reset()) uses dsmark_qdisc_data->q pointer wihtout any null checking. So, panic would occur.
Test commands:
sysctl net.core.default_qdisc=dsmark -w
ip link add dummy0 type dummy
ip link add vw0 link dummy0 type virt_wifi
ip link set vw0 up
Splat looks like:
KASAN: null-ptr-deref in range [0x0000000000000018-0x000000000000001f] CPU: 3 PID: 684 Comm: ip Not tainted 5.12.0+ #910 RIP: 0010:qdisc_reset+0x2b/0x680 Code: 1f 44 00 00 48 b8 00 00 00 00 00 fc ff df 41 57 41 56 41 55 41 54 55 48 89 fd 48 83 c7 18 53 48 89 fa 48 c1 ea 03 48 83 ec 20 <80> 3c 02 00 0f 85 09 06 00 00 4c 8b 65 18 0f 1f 44 00 00 65 8b 1d RSP: 0018:ffff88800fda6bf8 EFLAGS: 00010282 RAX: dffffc0000000000 RBX: ffff8880050ed800 RCX: 0000000000000000 RDX: 0000000000000003 RSI: ffffffff99e34100 RDI: 0000000000000018 RBP: 0000000000000000 R08: fffffbfff346b553 R09: fffffbfff346b553 R10: 0000000000000001 R11: fffffbfff346b552 R12: ffffffffc0824940 R13: ffff888109e83800 R14: 00000000ffffffff R15: ffffffffc08249e0 FS: 00007f5042287680(0000) GS:ffff888119800000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 000055ae1f4dbd90 CR3: 0000000006760002 CR4: 00000000003706e0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000fffe0ff0 DR7: 0000000000000400 Call Trace: ? rcu_read_lock_bh_held+0xa0/0xa0 dsmark_reset+0x3d/0xf0 [sch_dsmark] qdisc_reset+0xa9/0x680 qdisc_destroy+0x84/0x370 qdisc_create_dflt+0x1fe/0x380 attach_one_default_qdisc.constprop.41+0xa4/0x180 dev_activate+0x4d5/0x8c0 ? __dev_open+0x268/0x390 __dev_open+0x270/0x390
--- net/sched/sch_dsmark.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/sched/sch_dsmark.c +2 -1
@@ -407,7 +407,8 @@ static void dsmark_reset(struct Qdisc *sch)struct dsmark_qdisc_data *p =qdisc_priv (sch);pr_debug ("%s(sch %p,[qdisc %p])\n" , __func__, sch, p); -qdisc_reset (p->q); +if (p->q) +qdisc_reset (p->q); sch->qstats.backlog =0 ; sch->q.qlen =0 ; }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 280/296 net: hsr: fix mac_len checks
In reply to Greg Kroah-HartmanFrom: George McCollister <[email protected]>
[ Upstream commit 48b491a5cc74333c4a6a82fe21cea42c055a3b0b ]
Commit 2e9f60932a2c ("net: hsr: check skb can contain struct hsr_ethhdr in fill_frame_info") added the following which resulted in -EINVAL always being returned:
if (skb->mac_len < sizeof(struct hsr_ethhdr)) return -EINVAL;
mac_len was not being set correctly so this check completely broke HSR/PRP since it was always 14, not 20.
Set mac_len correctly and modify the mac_len checks to test in the correct places since sometimes it is legitimately 14.
--- net/hsr/hsr_device.c | 2 ++ net/hsr/hsr_forward.c | 30 +++++++++++++++++++++--------- net/hsr/hsr_forward.h | 8 ++++---- net/hsr/hsr_main.h | 4 ++-- net/hsr/hsr_slave.c | 11 +++++------ 5 files changed, 34 insertions(+), 21 deletions(-)
net/hsr/hsr_device.c +2 -0
@@ -218,6 +218,7 @@ static netdev_tx_t hsr_dev_xmit(struct sk_buff *skb, struct net_device *dev)if (master) { skb->dev = master->dev;skb_reset_mac_header (skb); +skb_reset_mac_len (skb);hsr_forward_skb (skb, master); }else {atomic_long_inc (&dev->tx_dropped);
@@ -259,6 +260,7 @@ static struct sk_buff *hsr_init_skb(struct hsr_port *master) goto out;skb_reset_mac_header (skb); +skb_reset_mac_len (skb);skb_reset_network_header (skb);skb_reset_transport_header (skb);
net/hsr/hsr_forward.c +21 -9
@@ -474,8 +474,8 @@ static void handle_std_frame(struct sk_buff *skb, } } -void hsr_fill_frame_info (__be16 proto,struct sk_buff *skb, -struct hsr_frame_info *frame) +int hsr_fill_frame_info (__be16 proto,struct sk_buff *skb, +struct hsr_frame_info *frame) {struct hsr_port *port = frame->port_rcv;struct hsr_priv *hsr = port->hsr;
@@ -483,20 +483,26 @@ void hsr_fill_frame_info(__be16 proto, struct sk_buff *skb,/* HSRv0 supervisory frames double as a tag so treat them as tagged. */ if ((!hsr->prot_version && proto ==htons (ETH_P_PRP )) || proto ==htons (ETH_P_HSR )) { +/* Check if skb contains hsr_ethhdr */ +if (skb->mac_len <sizeof (struct hsr_ethhdr )) +return -EINVAL ; +/* HSR tagged frame :- Data or Supervision */ frame->skb_std =NULL ; frame->skb_prp =NULL ; frame->skb_hsr = skb; frame->sequence_nr =hsr_get_skb_sequence_nr (skb); -return ; +return 0 ; }/* Standard frame or PRP from master port */ handle_std_frame (skb, frame); + +return 0 ; } -void prp_fill_frame_info (__be16 proto,struct sk_buff *skb, -struct hsr_frame_info *frame) +int prp_fill_frame_info (__be16 proto,struct sk_buff *skb, +struct hsr_frame_info *frame) {/* Supervision frame */ struct prp_rct *rct =skb_get_PRP_rct (skb);
@@ -507,9 +513,11 @@ void prp_fill_frame_info(__be16 proto, struct sk_buff *skb, frame->skb_std =NULL ; frame->skb_prp = skb; frame->sequence_nr =prp_get_skb_sequence_nr (rct); -return ; +return 0 ; }handle_std_frame (skb, frame); + +return 0 ; } static int fill_frame_info(struct hsr_frame_info *frame,
@@ -519,9 +527,10 @@ static int fill_frame_info(struct hsr_frame_info *frame,struct hsr_vlan_ethhdr *vlan_hdr;struct ethhdr *ethhdr;__be16 proto; +int ret; -/* Check if skb contains hsr_ethhdr */ -if (skb->mac_len <sizeof (struct hsr_ethhdr )) +/* Check if skb contains ethhdr */ +if (skb->mac_len <sizeof (struct ethhdr ))return -EINVAL ;memset (frame,0 ,sizeof (*frame));
@@ -548,7 +557,10 @@ static int fill_frame_info(struct hsr_frame_info *frame, frame->is_from_san = false; frame->port_rcv = port; - hsr->proto_ops->fill_frame_info (proto, skb, frame); + ret = hsr->proto_ops->fill_frame_info (proto, skb, frame); +if (ret) +return ret; +check_local_dest (port->hsr, skb, frame);return 0 ;
net/hsr/hsr_forward.h +4 -4
@@ -24,8 +24,8 @@ struct sk_buff *prp_get_untagged_frame(struct hsr_frame_info *frame, struct hsr_port *port);bool prp_drop_frame (struct hsr_frame_info *frame,struct hsr_port *port);bool hsr_drop_frame (struct hsr_frame_info *frame,struct hsr_port *port); -void prp_fill_frame_info (__be16 proto,struct sk_buff *skb, -struct hsr_frame_info *frame); -void hsr_fill_frame_info (__be16 proto,struct sk_buff *skb, -struct hsr_frame_info *frame); +int prp_fill_frame_info (__be16 proto,struct sk_buff *skb, +struct hsr_frame_info *frame); +int hsr_fill_frame_info (__be16 proto,struct sk_buff *skb, +struct hsr_frame_info *frame);#endif /* __HSR_FORWARD_H */
net/hsr/hsr_main.h +2 -2
@@ -186,8 +186,8 @@ struct hsr_proto_ops { struct hsr_port *port);struct sk_buff * (*create_tagged_frame)(struct hsr_frame_info *frame,struct hsr_port *port); -void (*fill_frame_info)(__be16 proto,struct sk_buff *skb, -struct hsr_frame_info *frame); +int (*fill_frame_info)(__be16 proto,struct sk_buff *skb, +struct hsr_frame_info *frame);bool (*invalid_dan_ingress_frame)(__be16 protocol);void (*update_san_info)(struct hsr_node *node,bool is_sup); };
net/hsr/hsr_slave.c +5 -6
@@ -60,12 +60,11 @@ static rx_handler_result_t hsr_handle_frame(struct sk_buff **pskb) goto finish_pass;skb_push (skb,ETH_HLEN ); - -if (skb_mac_header (skb) != skb->data) { -WARN_ONCE (1 ,"%s:%d: Malformed frame at source port %s)\n" , - __func__, __LINE__, port->dev->name); - goto finish_consume; - } +skb_reset_mac_header (skb); +if ((!hsr->prot_version && protocol ==htons (ETH_P_PRP )) || + protocol ==htons (ETH_P_HSR )) +skb_set_network_header (skb,ETH_HLEN +HSR_HLEN ); +skb_reset_mac_len (skb);hsr_forward_skb (skb, port);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 281/296 MIPS: alchemy: xxs1500: add gpio-au1000.h header file
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit ff4cff962a7eedc73e54b5096693da7f86c61346 ]
board-xxs1500.c references 2 functions without declaring them, so add the header file to placate the build.
../arch/mips/alchemy/board-xxs1500.c: In function 'board_setup':../arch/mips/alchemy/board-xxs1500.c:56:2: error: implicit declaration of function 'alchemy_gpio1_input_enable' [-Werror=implicit-function-declaration]
56 | alchemy_gpio1_input_enable();../arch/mips/alchemy/board-xxs1500.c:57:2: error: implicit declaration of function 'alchemy_gpio2_enable'; did you mean 'alchemy_uart_enable'? [-Werror=implicit-function-declaration]
57 | alchemy_gpio2_enable();
--- arch/mips/alchemy/board-xxs1500.c | 1 + 1 file changed, 1 insertion(+)
arch/mips/alchemy/board-xxs1500.c +1 -0
@@ -18,6 +18,7 @@#include <asm/reboot.h> #include <asm/setup.h> #include <asm/mach-au1x00/au1000.h> +#include <asm/mach-au1x00/gpio-au1000.h> #include <prom.h> const char *get_system_type (void )
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 282/296 MIPS: ralink: export rt_sysc_membase for rt2880_wdt.c
In reply to Greg Kroah-HartmanFrom: Randy Dunlap <[email protected]>
[ Upstream commit fef532ea0cd871afab7d9a7b6e9da99ac2c24371 ]
rt2880_wdt.c uses (well, attempts to use) rt_sysc_membase. However, when this watchdog driver is built as a loadable module, there is a build error since the rt_sysc_membase symbol is not exported. Export it to quell the build error.
ERROR: modpost: "rt_sysc_membase" [drivers/watchdog/rt2880_wdt.ko] undefined!
--- arch/mips/ralink/of.c | 2 ++ 1 file changed, 2 insertions(+)
arch/mips/ralink/of.c +2 -0
@@ -8,6 +8,7 @@#include <linux/io.h> #include <linux/clk.h> +#include <linux/export.h> #include <linux/init.h> #include <linux/sizes.h> #include <linux/of_fdt.h>
@@ -25,6 +26,7 @@__iomem void *rt_sysc_membase;__iomem void *rt_memc_membase; +EXPORT_SYMBOL_GPL (rt_sysc_membase);__iomem void *plat_of_remap_node (const char *node) {
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 283/296 net: zero-initialize tc skb extension on allocation
In reply to Greg Kroah-HartmanFrom: Vlad Buslov <[email protected]>
[ Upstream commit 9453d45ecb6c2199d72e73c993e9d98677a2801b ]
Function skb_ext_add() doesn't initialize created skb extension with any value and leaves it up to the user. However, since extension of type TC_SKB_EXT originally contained only single value tc_skb_ext->chain its users used to just assign the chain value without setting whole extension memory to zero first. This assumption changed when TC_SKB_EXT extension was extended with additional fields but not all users were updated to initialize the new fields which leads to use of uninitialized memory afterwards. UBSAN log:
[ 778.299821] UBSAN: invalid-load in net/openvswitch/flow.c:899:28 [ 778.301495] load of value 107 is not a valid value for type '_Bool' [ 778.303215] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.12.0-rc7+ #2 [ 778.304933] Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.13.0-0-gf21b5a4aeb02-prebuilt.qemu.org 04/01/2014 [ 778.307901] Call Trace: [ 778.308680] <IRQ> [ 778.309358] dump_stack+0xbb/0x107 [ 778.310307] ubsan_epilogue+0x5/0x40 [ 778.311167] __ubsan_handle_load_invalid_value.cold+0x43/0x48 [ 778.312454] ? memset+0x20/0x40 [ 778.313230] ovs_flow_key_extract.cold+0xf/0x14 [openvswitch] [ 778.314532] ovs_vport_receive+0x19e/0x2e0 [openvswitch] [ 778.315749] ? ovs_vport_find_upcall_portid+0x330/0x330 [openvswitch] [ 778.317188] ? create_prof_cpu_mask+0x20/0x20 [ 778.318220] ? arch_stack_walk+0x82/0xf0 [ 778.319153] ? secondary_startup_64_no_verify+0xb0/0xbb [ 778.320399] ? stack_trace_save+0x91/0xc0 [ 778.321362] ? stack_trace_consume_entry+0x160/0x160 [ 778.322517] ? lock_release+0x52e/0x760 [ 778.323444] netdev_frame_hook+0x323/0x610 [openvswitch] [ 778.324668] ? ovs_netdev_get_vport+0xe0/0xe0 [openvswitch] [ 778.325950] __netif_receive_skb_core+0x771/0x2db0 [ 778.327067] ? lock_downgrade+0x6e0/0x6f0 [ 778.328021] ? lock_acquire+0x565/0x720 [ 778.328940] ? generic_xdp_tx+0x4f0/0x4f0 [ 778.329902] ? inet_gro_receive+0x2a7/0x10a0 [ 778.330914] ? lock_downgrade+0x6f0/0x6f0 [ 778.331867] ? udp4_gro_receive+0x4c4/0x13e0 [ 778.332876] ? lock_release+0x52e/0x760 [ 778.333808] ? dev_gro_receive+0xcc8/0x2380 [ 778.334810] ? lock_downgrade+0x6f0/0x6f0 [ 778.335769] __netif_receive_skb_list_core+0x295/0x820 [ 778.336955] ? process_backlog+0x780/0x780 [ 778.337941] ? mlx5e_rep_tc_netdevice_event_unregister+0x20/0x20 [mlx5_core] [ 778.339613] ? seqcount_lockdep_reader_access.constprop.0+0xa7/0xc0 [ 778.341033] ? kvm_clock_get_cycles+0x14/0x20 [ 778.342072] netif_receive_skb_list_internal+0x5f5/0xcb0 [ 778.343288] ? __kasan_kmalloc+0x7a/0x90 [ 778.344234] ? mlx5e_handle_rx_cqe_mpwrq+0x9e0/0x9e0 [mlx5_core] [ 778.345676] ? mlx5e_xmit_xdp_frame_mpwqe+0x14d0/0x14d0 [mlx5_core] [ 778.347140] ? __netif_receive_skb_list_core+0x820/0x820 [ 778.348351] ? mlx5e_post_rx_mpwqes+0xa6/0x25d0 [mlx5_core] [ 778.349688] ? napi_gro_flush+0x26c/0x3c0 [ 778.350641] napi_complete_done+0x188/0x6b0 [ 778.351627] mlx5e_napi_poll+0x373/0x1b80 [mlx5_core] [ 778.352853] __napi_poll+0x9f/0x510 [ 778.353704] ? mlx5_flow_namespace_set_mode+0x260/0x260 [mlx5_core] [ 778.355158] net_rx_action+0x34c/0xa40 [ 778.356060] ? napi_threaded_poll+0x3d0/0x3d0 [ 778.357083] ? sched_clock_cpu+0x18/0x190 [ 778.358041] ? __common_interrupt+0x8e/0x1a0 [ 778.359045] __do_softirq+0x1ce/0x984 [ 778.359938] __irq_exit_rcu+0x137/0x1d0 [ 778.360865] irq_exit_rcu+0xa/0x20 [ 778.361708] common_interrupt+0x80/0xa0 [ 778.362640] </IRQ> [ 778.363212] asm_common_interrupt+0x1e/0x40 [ 778.364204] RIP: 0010:native_safe_halt+0xe/0x10 [ 778.365273] Code: 4f ff ff ff 4c 89 e7 e8 50 3f 40 fe e9 dc fe ff ff 48 89 df e8 43 3f 40 fe eb 90 cc e9 07 00 00 00 0f 00 2d 74 05 62 00 fb f4 <c3> 90 e9 07 00 00 00 0f 00 2d 64 05 62 00 f4 c3 cc cc 0f 1f 44 00 [ 778.369355] RSP: 0018:ffffffff84407e48 EFLAGS: 00000246 [ 778.370570] RAX: ffff88842de46a80 RBX: ffffffff84425840 RCX: ffffffff83418468 [ 778.372143] RDX: 000000000026f1da RSI: 0000000000000004 RDI: ffffffff8343af5e [ 778.373722] RBP: fffffbfff0884b08 R08: 0000000000000000 R09: ffff88842de46bcb [ 778.375292] R10: ffffed1085bc8d79 R11: 0000000000000001 R12: 0000000000000000 [ 778.376860] R13: ffffffff851124a0 R14: 0000000000000000 R15: dffffc0000000000 [ 778.378491] ? rcu_eqs_enter.constprop.0+0xb8/0xe0 [ 778.379606] ? default_idle_call+0x5e/0xe0 [ 778.380578] default_idle+0xa/0x10 [ 778.381406] default_idle_call+0x96/0xe0 [ 778.382350] do_idle+0x3d4/0x550 [ 778.383153] ? arch_cpu_idle_exit+0x40/0x40 [ 778.384143] cpu_startup_entry+0x19/0x20 [ 778.385078] start_kernel+0x3c7/0x3e5 [ 778.385978] secondary_startup_64_no_verify+0xb0/0xbb
Fix the issue by providing new function tc_skb_ext_alloc() that allocates tc skb extension and initializes its memory to 0 before returning it to the caller. Change all existing users to use new API instead of calling skb_ext_add() directly.
--- drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c | 2 +- drivers/net/ethernet/mellanox/mlx5/core/en_tc.c | 2 +- include/net/pkt_cls.h | 11 +++++++++++ net/sched/cls_api.c | 2 +- 4 files changed, 14 insertions(+), 3 deletions(-)
drivers/net/ethernet/mellanox/mlx5/core/en/rep/tc.c +1 -1
@@ -645,7 +645,7 @@ bool mlx5e_rep_tc_update_skb(struct mlx5_cqe64 *cqe, }if (chain) { - tc_skb_ext =skb_ext_add (skb,TC_SKB_EXT ); + tc_skb_ext =tc_skb_ext_alloc (skb);if (!tc_skb_ext) {WARN_ON (1 );return false;
drivers/net/ethernet/mellanox/mlx5/core/en_tc.c +1 -1
@@ -4924,7 +4924,7 @@ bool mlx5e_tc_update_skb(struct mlx5_cqe64 *cqe, }if (chain) { - tc_skb_ext =skb_ext_add (skb,TC_SKB_EXT ); + tc_skb_ext =tc_skb_ext_alloc (skb);if (WARN_ON (!tc_skb_ext))return false;
include/net/pkt_cls.h +11 -0
@@ -709,6 +709,17 @@ tc_cls_common_offload_init(struct flow_cls_common_offload *cls_common, cls_common->extack = extack; } +#if IS_ENABLED (CONFIG_NET_TC_SKB_EXT ) +static inline struct tc_skb_ext *tc_skb_ext_alloc (struct sk_buff *skb) +{ +struct tc_skb_ext *tc_skb_ext =skb_ext_add (skb,TC_SKB_EXT ); + +if (tc_skb_ext) +memset (tc_skb_ext,0 ,sizeof (*tc_skb_ext)); +return tc_skb_ext; +} +#endif +enum tc_matchall_command {TC_CLSMATCHALL_REPLACE ,TC_CLSMATCHALL_DESTROY ,
net/sched/cls_api.c +1 -1
@@ -1624,7 +1624,7 @@ int tcf_classify_ingress(struct sk_buff *skb,/* If we missed on some chain */ if (ret ==TC_ACT_UNSPEC && last_executed_chain) { - ext =skb_ext_add (skb,TC_SKB_EXT ); + ext =tc_skb_ext_alloc (skb);if (WARN_ON_ONCE (!ext))return TC_ACT_SHOT ; ext->chain = last_executed_chain;
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 284/296 net: mvpp2: add buffer header handling in RX
In reply to Greg Kroah-HartmanFrom: Stefan Chulski <[email protected]>
[ Upstream commit 17f9c1b63cdd4439523cfcdf5683e5070b911f24 ]
If Link Partner sends frames larger than RX buffer size, MAC mark it as oversize but still would pass it to the Packet Processor. In this scenario, Packet Processor scatter frame between multiple buffers, but only a single buffer would be returned to the Buffer Manager pool and it would not refill the poll.
Patch add handling of oversize error with buffer header handling, so all buffers would be returned to the Buffer Manager pool.
--- drivers/net/ethernet/marvell/mvpp2/mvpp2.h | 22 ++++++++ .../net/ethernet/marvell/mvpp2/mvpp2_main.c | 54 +++++++++++++++---- 2 files changed, 67 insertions(+), 9 deletions(-)
drivers/net/ethernet/marvell/mvpp2/mvpp2.h +22 -0
@@ -993,6 +993,14 @@ enum mvpp22_ptp_packet_format {#define MVPP2_DESC_DMA_MASK DMA_BIT_MASK(40) +/* Buffer header info bits */ +#define MVPP2_B_HDR_INFO_MC_ID_MASK 0xfff +#define MVPP2_B_HDR_INFO_MC_ID (info) ((info) & MVPP2_B_HDR_INFO_MC_ID_MASK) +#define MVPP2_B_HDR_INFO_LAST_OFFS 12 +#define MVPP2_B_HDR_INFO_LAST_MASK BIT(12) +#define MVPP2_B_HDR_INFO_IS_LAST (info) \ + (((info) & MVPP2_B_HDR_INFO_LAST_MASK) >> MVPP2_B_HDR_INFO_LAST_OFFS) +struct mvpp2_tai ;/* Definitions */
@@ -1002,6 +1010,20 @@ struct mvpp2_rss_table {u32 indir[MVPP22_RSS_TABLE_ENTRIES ]; }; +struct mvpp2_buff_hdr { +__le32 next_phys_addr; +__le32 next_dma_addr; +__le16 byte_count; +__le16 info; +__le16 reserved1;/* bm_qset (for future use, BM) */ +u8 next_phys_addr_high; +u8 next_dma_addr_high; +__le16 reserved2; +__le16 reserved3; +__le16 reserved4; +__le16 reserved5; +}; +/* Shared Packet Processor resources */ struct mvpp2 {/* Shared registers' base addresses */
drivers/net/ethernet/marvell/mvpp2/mvpp2_main.c +45 -9
78 lines not on this page · raw message
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 285/296 SUNRPC: More fixes for backlog congestion
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
[ Upstream commit e86be3a04bc4aeaf12f93af35f08f8d4385bcd98 ]
Ensure that we fix the XPRT_CONGESTED starvation issue for RDMA as well as socket based transports.
Ensure we always initialise the request after waking up from the backlog list.
--- include/linux/sunrpc/xprt.h | 2 ++ net/sunrpc/xprt.c | 58 ++++++++++++++++----------------- net/sunrpc/xprtrdma/transport.c | 12 +++---- net/sunrpc/xprtrdma/verbs.c | 18 ++++++++-- net/sunrpc/xprtrdma/xprt_rdma.h | 1 + 5 files changed, 52 insertions(+), 39 deletions(-)
include/linux/sunrpc/xprt.h +2 -0
@@ -367,6 +367,8 @@ struct rpc_xprt * xprt_alloc(struct net *net, size_t size,unsigned int num_prealloc, unsigned int max_req);void xprt_free (struct rpc_xprt *); +void xprt_add_backlog (struct rpc_xprt *xprt,struct rpc_task *task); +bool xprt_wake_up_backlog (struct rpc_xprt *xprt,struct rpc_rqst *req);static inline int xprt_enable_swap (struct rpc_xprt *xprt)
net/sunrpc/xprt.c +28 -30
110 lines not on this page · raw message
net/sunrpc/xprtrdma/transport.c +6 -6
@@ -520,9 +520,8 @@ xprt_rdma_alloc_slot(struct rpc_xprt *xprt, struct rpc_task *task)return ; out_sleep: -set_bit (XPRT_CONGESTED , &xprt->state); -rpc_sleep_on (&xprt->backlog, task,NULL ); task->tk_status = -EAGAIN ; +xprt_add_backlog (xprt, task); }/**
@@ -537,10 +536,11 @@ xprt_rdma_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *rqst)struct rpcrdma_xprt *r_xprt = container_of(xprt, struct rpcrdma_xprt, rx_xprt); -memset (rqst,0 ,sizeof (*rqst)); -rpcrdma_buffer_put (&r_xprt->rx_buf,rpcr_to_rdmar (rqst)); -if (unlikely (!rpc_wake_up_next (&xprt->backlog))) -clear_bit (XPRT_CONGESTED , &xprt->state); +rpcrdma_reply_put (&r_xprt->rx_buf,rpcr_to_rdmar (rqst)); +if (!xprt_wake_up_backlog (xprt, rqst)) { +memset (rqst,0 ,sizeof (*rqst)); +rpcrdma_buffer_put (&r_xprt->rx_buf,rpcr_to_rdmar (rqst)); + } } static bool rpcrdma_check_regbuf(struct rpcrdma_xprt *r_xprt,
net/sunrpc/xprtrdma/verbs.c +15 -3
@@ -1184,6 +1184,20 @@ rpcrdma_mr_get(struct rpcrdma_xprt *r_xprt)return mr; } +/** +* rpcrdma_reply_put - Put reply buffers back into pool +* @buffers: buffer pool +* @req: object to return +* +*/ +void rpcrdma_reply_put (struct rpcrdma_buffer *buffers,struct rpcrdma_req *req) +{ +if (req->rl_reply) { +rpcrdma_rep_put (buffers, req->rl_reply); + req->rl_reply =NULL ; + } +} +/** * rpcrdma_buffer_get - Get a request buffer * @buffers: Buffer pool from which to obtain a buffer
@@ -1212,9 +1226,7 @@ rpcrdma_buffer_get(struct rpcrdma_buffer *buffers)*/ void rpcrdma_buffer_put (struct rpcrdma_buffer *buffers,struct rpcrdma_req *req) { -if (req->rl_reply) -rpcrdma_rep_put (buffers, req->rl_reply); - req->rl_reply =NULL ; +rpcrdma_reply_put (buffers, req);spin_lock (&buffers->rb_lock);list_add (&req->rl_list, &buffers->rb_send_bufs);
net/sunrpc/xprtrdma/xprt_rdma.h +1 -0
@@ -481,6 +481,7 @@ struct rpcrdma_req *rpcrdma_buffer_get(struct rpcrdma_buffer *);void rpcrdma_buffer_put (struct rpcrdma_buffer *buffers,struct rpcrdma_req *req);void rpcrdma_recv_buffer_put (struct rpcrdma_rep *); +void rpcrdma_reply_put (struct rpcrdma_buffer *buffers,struct rpcrdma_req *req);bool rpcrdma_regbuf_realloc (struct rpcrdma_regbuf *rb,size_t size,gfp_t flags);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 286/296 thermal/drivers/qcom: Fix error code in adc_tm5_get_dt_channel_data()
In reply to Greg Kroah-HartmanFrom: Yang Yingliang <[email protected]>
[ Upstream commit 5d8db38ad7660e4d78f4e2a63f14336f31f07a63 ]
Return -EINVAL when args is invalid instead of 'ret' which is set to zero by a previous successful call to a function.
--- drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/thermal/qcom/qcom-spmi-adc-tm5.c +1 -1
@@ -441,7 +441,7 @@ static int adc_tm5_get_dt_channel_data(struct adc_tm5_chip *adc_tm,if (args.args_count !=1 || args.args[0 ] >=ADC5_MAX_CHANNEL ) {dev_err (dev,"%s: invalid ADC channel number %d\n" , name, chan); -return ret; +return -EINVAL ; } channel->adc_channel = args.args[0 ];
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 287/296 KVM: X86: hyper-v: Task srcu lock when accessing kvm_memslots()
In reply to Greg Kroah-HartmanFrom: Wanpeng Li <[email protected]>
[ Upstream commit da6d63a0062a3ee721b84123b83ec093f25759b0 ]
WARNING: suspicious RCU usage
5.13.0-rc1 #4 Not tainted
-----------------------------
./include/linux/kvm_host.h:710 suspicious rcu_dereference_check() usage!
other info that might help us debug this:
rcu_scheduler_active = 2, debug_locks = 1
1 lock held by hyperv_clock/8318:
#0: ffffb6b8cb05a7d8 (&hv->hv_lock){+.+.}-{3:3}, at: kvm_hv_invalidate_tsc_page+0x3e/0xa0 [kvm]stack backtrace: CPU: 3 PID: 8318 Comm: hyperv_clock Not tainted 5.13.0-rc1 #4 Call Trace: dump_stack+0x87/0xb7 lockdep_rcu_suspicious+0xce/0xf0 kvm_write_guest_page+0x1c1/0x1d0 [kvm] kvm_write_guest+0x50/0x90 [kvm] kvm_hv_invalidate_tsc_page+0x79/0xa0 [kvm] kvm_gen_update_masterclock+0x1d/0x110 [kvm] kvm_arch_vm_ioctl+0x2a7/0xc50 [kvm] kvm_vm_ioctl+0x123/0x11d0 [kvm] __x64_sys_ioctl+0x3ed/0x9d0 do_syscall_64+0x3d/0x80 entry_SYSCALL_64_after_hwframe+0x44/0xae
kvm_memslots() will be called by kvm_write_guest(), so we should take the srcu lock.
Message-Id: <[email protected]>
--- arch/x86/kvm/hyperv.c | 8 ++++++++ 1 file changed, 8 insertions(+)
arch/x86/kvm/hyperv.c +8 -0
@@ -1172,6 +1172,7 @@ void kvm_hv_invalidate_tsc_page(struct kvm *kvm) {struct kvm_hv *hv =to_kvm_hv (kvm);u64 gfn; +int idx; if (hv->hv_tsc_page_status == HV_TSC_PAGE_BROKEN || hv->hv_tsc_page_status == HV_TSC_PAGE_UNSET ||
@@ -1190,9 +1191,16 @@ void kvm_hv_invalidate_tsc_page(struct kvm *kvm) gfn = hv->hv_tsc_page >>HV_X64_MSR_TSC_REFERENCE_ADDRESS_SHIFT ; hv->tsc_ref.tsc_sequence =0 ; + +/* +* Take the srcu lock as memslots will be accessed to check the gfn +* cache generation against the memslots generation. +*/ + idx =srcu_read_lock (&kvm->srcu);if (kvm_write_guest (kvm,gfn_to_gpa (gfn), &hv->tsc_ref,sizeof (hv->tsc_ref.tsc_sequence))) hv->hv_tsc_page_status =HV_TSC_PAGE_BROKEN ; +srcu_read_unlock (&kvm->srcu, idx); out_unlock:mutex_unlock (&hv->hv_lock);
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 288/296 xprtrdma: Revert 586a0787ce35
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
[ Upstream commit ae605ee9830840f14566a3b1cde27fa8096dbdd4 ]
Commit 9ed5af268e88 ("SUNRPC: Clean up the handling of page padding in rpc_prepare_reply_pages()") [Dec 2020] affects RPC Replies that have a data payload (i.e., Write chunks).
rpcrdma_prepare_readch(), as its name suggests, sets up Read chunks which are data payloads within RPC Calls. Those payloads are constructed by xdr_write_pages(), which continues to stuff the call buffer's tail kvec with the payload's XDR roundup. Thus removing the tail buffer logic in rpcrdma_prepare_readch() was the wrong thing to do.
--- net/sunrpc/xprtrdma/rpc_rdma.c | 27 ++++++++++++++++++--------- 1 file changed, 18 insertions(+), 9 deletions(-)
net/sunrpc/xprtrdma/rpc_rdma.c +18 -9
@@ -628,8 +628,9 @@ out_mapping_err:return false; } -/* The tail iovec might not reside in the same page as the -* head iovec. +/* The tail iovec may include an XDR pad for the page list, +* as well as additional content, and may not reside in the +* same page as the head iovec. */ static bool rpcrdma_prepare_tail_iov(struct rpcrdma_req *req, struct xdr_buf *xdr,
@@ -747,19 +748,27 @@ static bool rpcrdma_prepare_readch(struct rpcrdma_xprt *r_xprt, struct rpcrdma_req *req, struct xdr_buf *xdr) { - struct kvec *tail = &xdr->tail[0]; -if (!rpcrdma_prepare_head_iov (r_xprt, req, xdr->head[0 ].iov_len))return false; -/* If there is a Read chunk, the page list is handled +/* If there is a Read chunk, the page list is being handled * via explicit RDMA, and thus is skipped here. */ -if (tail->iov_len) { -if (!rpcrdma_prepare_tail_iov (req, xdr, -offset_in_page (tail->iov_base), - tail->iov_len)) +/* Do not include the tail if it is only an XDR pad */ +if (xdr->tail[0 ].iov_len >3 ) { +unsigned int page_base, len; + +/* If the content in the page list is an odd length, +* xdr_write_pages() adds a pad at the beginning of +* the tail iovec. Force the tail's non-pad content to +* land at the next XDR position in the Send message. +*/ + page_base =offset_in_page (xdr->tail[0 ].iov_base); + len = xdr->tail[0 ].iov_len; + page_base += len &3 ; + len -= len &3 ; +if (!rpcrdma_prepare_tail_iov (req, xdr, page_base, len))return false;kref_get (&req->rl_kref); }
Signature · 1 line
2.30.2
Greg Kroah-Hartman
maintainerPATCH 289/296 samples/bpf: Consider frame size in tx_only of xdpsock sample
In reply to Greg Kroah-HartmanFrom: Magnus Karlsson <[email protected]>
commit 3b80d106e110d39d3f678954d3b55078669cf07e upstream.
Fix the tx_only micro-benchmark in xdpsock to take frame size into consideration. It was hardcoded to the default value of frame_size which is 4K. Changing this on the command line to 2K made half of the packets illegal as they were outside the umem and were therefore discarded by the kernel.
--- samples/bpf/xdpsock_user.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
samples/bpf/xdpsock_user.c +1 -1
@@ -1282,7 +1282,7 @@ static void tx_only(struct xsk_socket_infor (i =0 ; i < batch_size; i++) {struct xdp_desc *tx_desc =xsk_ring_prod__tx_desc (&xsk->tx, idx + i); - tx_desc->addr = (*frame_nb + i) <<XSK_UMEM__DEFAULT_FRAME_SHIFT ; + tx_desc->addr = (*frame_nb + i) * opt_xsk_frame_size; tx_desc->len =PKT_SIZE ; }
Greg Kroah-Hartman
maintainerPATCH 290/296 net: hns3: check the return of skb_checksum_help()
In reply to Greg Kroah-HartmanFrom: Yunsheng Lin <[email protected]>
commit 9bb5a495424fd4bfa672eb1f31481248562fa156 upstream.
Currently skb_checksum_help()'s return is ignored, but it may return error when it fails to allocate memory when linearizing.
So adds checking for the return of skb_checksum_help().
--- drivers/net/ethernet/hisilicon/hns3/hns3_enet.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/net/ethernet/hisilicon/hns3/hns3_enet.c +3 -7
@@ -840,8 +840,6 @@ static bool hns3_tunnel_csum_bug(struct l4.udp->dest == htons(4790))))return false; -skb_checksum_help (skb); -return true; }
@@ -919,8 +917,7 @@ static int hns3_set_l2l3l4(struct sk_buf/* the stack computes the IP header already, * driver calculate l4 checksum when not TSO. */ -skb_checksum_help (skb); -return 0 ; +return skb_checksum_help (skb); }hns3_set_outer_l2l3l4 (skb, ol4_proto, ol_type_vlan_len_msec);
@@ -965,7 +962,7 @@ static int hns3_set_l2l3l4(struct sk_bufbreak ;case IPPROTO_UDP :if (hns3_tunnel_csum_bug (skb)) -break ; +return skb_checksum_help (skb);hns3_set_field (*type_cs_vlan_tso,HNS3_TXD_L4CS_B ,1 ); hns3_set_field(*type_cs_vlan_tso, HNS3_TXD_L4T_S,
@@ -990,8 +987,7 @@ static int hns3_set_l2l3l4(struct sk_buf/* the stack computes the IP header already, * driver calculate l4 checksum when not TSO. */ -skb_checksum_help (skb); -return 0 ; +return skb_checksum_help (skb); }return 0 ;
Greg Kroah-Hartman
maintainerPATCH 291/296 bpftool: Add sock_release help info for cgroup attach/prog load command
In reply to Greg Kroah-HartmanFrom: Liu Jian <[email protected]>
commit a8deba8547e39f26440101164a3bbc2899c5b305 upstream.
The help information was not added at the time when the function got added. Fix this and add the missing information to its cli, documentation and bash completion.
--- tools/bpf/bpftool/Documentation/bpftool-cgroup.rst | 4 +++- tools/bpf/bpftool/Documentation/bpftool-prog.rst | 2 +- tools/bpf/bpftool/bash-completion/bpftool | 6 +++--- tools/bpf/bpftool/cgroup.c | 3 ++- tools/bpf/bpftool/prog.c | 2 +- 5 files changed, 10 insertions(+), 7 deletions(-)
tools/bpf/bpftool/Documentation/bpftool-cgroup.rst +3 -1
@@ -30,7 +30,8 @@ CGROUP COMMANDS | *ATTACH_TYPE* := { **ingress** | **egress** | **sock_create** | **sock_ops** | **device** | | **bind4** | **bind6** | **post_bind4** | **post_bind6** | **connect4** | **connect6** | | **getpeername4** | **getpeername6** | **getsockname4** | **getsockname6** | **sendmsg4** | -| **sendmsg6** | **recvmsg4** | **recvmsg6** | **sysctl** | **getsockopt** | **setsockopt** } +| **sendmsg6** | **recvmsg4** | **recvmsg6** | **sysctl** | **getsockopt** | **setsockopt** | +| **sock_release** } | *ATTACH_FLAGS* := { **multi** | **override** } DESCRIPTION
@@ -106,6 +107,7 @@ DESCRIPTION **getpeername6** call to getpeername(2) for an inet6 socket (since 5.8); **getsockname4** call to getsockname(2) for an inet4 socket (since 5.8); **getsockname6** call to getsockname(2) for an inet6 socket (since 5.8). + **sock_release** closing an userspace inet socket (since 5.9). **bpftool cgroup detach** *CGROUP* *ATTACH_TYPE* *PROG* Detach *PROG* from the cgroup *CGROUP* and attach type
tools/bpf/bpftool/Documentation/bpftool-prog.rst +1 -1
@@ -44,7 +44,7 @@ PROG COMMANDS | **cgroup/connect4** | **cgroup/connect6** | **cgroup/getpeername4** | **cgroup/getpeername6** | | **cgroup/getsockname4** | **cgroup/getsockname6** | **cgroup/sendmsg4** | **cgroup/sendmsg6** | | **cgroup/recvmsg4** | **cgroup/recvmsg6** | **cgroup/sysctl** | -| **cgroup/getsockopt** | **cgroup/setsockopt** | +| **cgroup/getsockopt** | **cgroup/setsockopt** | **cgroup/sock_release** | | **struct_ops** | **fentry** | **fexit** | **freplace** | **sk_lookup** | } | *ATTACH_TYPE* := {
tools/bpf/bpftool/bash-completion/bpftool +3 -3
@@ -478,7 +478,7 @@ _bpftool() cgroup/recvmsg4 cgroup/recvmsg6 \ cgroup/post_bind4 cgroup/post_bind6 \ cgroup/sysctl cgroup/getsockopt \ - cgroup/setsockopt struct_ops \ + cgroup/setsockopt cgroup/sock_release struct_ops \ fentry fexit freplace sk_lookup" -- \ "$cur" ) ) return 0
@@ -1008,7 +1008,7 @@ _bpftool() device bind4 bind6 post_bind4 post_bind6 connect4 connect6 \ getpeername4 getpeername6 getsockname4 getsockname6 \ sendmsg4 sendmsg6 recvmsg4 recvmsg6 sysctl getsockopt \ - setsockopt' + setsockopt sock_release' local ATTACH_FLAGS='multi override' local PROG_TYPE='id pinned tag name' case $prev in
@@ -1019,7 +1019,7 @@ _bpftool() ingress|egress|sock_create|sock_ops|device|bind4|bind6|\ post_bind4|post_bind6|connect4|connect6|getpeername4|\ getpeername6|getsockname4|getsockname6|sendmsg4|sendmsg6|\ - recvmsg4|recvmsg6|sysctl|getsockopt|setsockopt) + recvmsg4|recvmsg6|sysctl|getsockopt|setsockopt|sock_release) COMPREPLY=( $( compgen -W "$PROG_TYPE" -- \ "$cur" ) ) return 0
tools/bpf/bpftool/cgroup.c +2 -1
@@ -28,7 +28,8 @@" connect6 | getpeername4 | getpeername6 |\n" \" getsockname4 | getsockname6 | sendmsg4 |\n" \" sendmsg6 | recvmsg4 | recvmsg6 |\n" \ -" sysctl | getsockopt | setsockopt }" +" sysctl | getsockopt | setsockopt |\n" \ +" sock_release }" static unsigned int query_flags;
tools/bpf/bpftool/prog.c +1 -1
@@ -2137,7 +2137,7 @@ static int do_help(int argc, char **argv" cgroup/getpeername4 | cgroup/getpeername6 |\n" " cgroup/getsockname4 | cgroup/getsockname6 | cgroup/sendmsg4 |\n" " cgroup/sendmsg6 | cgroup/recvmsg4 | cgroup/recvmsg6 |\n" -" cgroup/getsockopt | cgroup/setsockopt |\n" +" cgroup/getsockopt | cgroup/setsockopt | cgroup/sock_release |\n" " struct_ops | fentry | fexit | freplace | sk_lookup }\n" " ATTACH_TYPE := { msg_verdict | stream_verdict | stream_parser |\n" " flow_dissector }\n"
Greg Kroah-Hartman
maintainerPATCH 292/296 Revert "Revert "ALSA: usx2y: Fix potential NULL pointer dereference""
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
commit 27b57bb76a897be80494ee11ee4e85326d19383d upstream.
This reverts commit 4667a6fc1777ce071504bab570d3599107f4790f.
Takashi writes:
I have already started working on the bigger cleanup of this driver code based on 5.13-rc1, so could you drop this revert?
I missed our previous discussion about this, my fault for applying it.
--- sound/usb/usx2y/usb_stream.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/usb/usx2y/usb_stream.c +5 -0
@@ -91,7 +91,12 @@ static int init_urbs(struct usb_stream_kfor (u =0 ; u <USB_STREAM_NURBS ; ++u) { sk->inurb[u] =usb_alloc_urb (sk->n_o_ps,GFP_KERNEL ); +if (!sk->inurb[u]) +return -ENOMEM ; + sk->outurb[u] =usb_alloc_urb (sk->n_o_ps,GFP_KERNEL ); +if (!sk->outurb[u]) +return -ENOMEM ; } if (init_pipe_urbs(sk, use_packsize, sk->inurb, indata, dev, in_pipe) ||
Greg Kroah-Hartman
maintainerPATCH 293/296 net: hso: bail out on interrupt URB allocation failure
In reply to Greg Kroah-HartmanFrom: Johan Hovold <[email protected]>
commit 4d52ebc7ace491d58f96d1f4a1cb9070c506b2e7 upstream.
Commit 31db0dbd7244 ("net: hso: check for allocation failure in hso_create_bulk_serial_device()") recently started returning an error when the driver fails to allocate resources for the interrupt endpoint and tiocmget functionality.
For consistency let's bail out from probe also if the URB allocation fails.
--- drivers/net/usb/hso.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/net/usb/hso.c +7 -7
@@ -2635,14 +2635,14 @@ static struct hso_device *hso_create_bul } tiocmget->urb =usb_alloc_urb (0 ,GFP_KERNEL ); -if (tiocmget->urb) { -mutex_init (&tiocmget->mutex); -init_waitqueue_head (&tiocmget->waitq); - }else -hso_free_tiomget (serial); - } -else +if (!tiocmget->urb) + goto exit; + +mutex_init (&tiocmget->mutex); +init_waitqueue_head (&tiocmget->waitq); + }else { num_urbs =1 ; + }if (hso_serial_common_create (serial, num_urbs,BULK_URB_RX_SIZE ,BULK_URB_TX_SIZE ))
Greg Kroah-Hartman
maintainerPATCH 294/296 arm64: mm: dont use CON and BLK mapping if KFENCE is enabled
In reply to Greg Kroah-HartmanFrom: Jisheng Zhang <[email protected]>
commit e69012400b0cb42b2070748322cb72f9effec00f upstream.
When we added KFENCE support for arm64, we intended that it would force the entire linear map to be mapped at page granularity, but we only enforced this in arch_add_memory() and not in map_mem(), so memory mapped at boot time can be mapped at a larger granularity.
When booting a kernel with KFENCE=y and RODATA_FULL=n, this results in the following WARNING at boot:
[ 0.000000] ------------[ cut here ]------------ [ 0.000000] WARNING: CPU: 0 PID: 0 at mm/memory.c:2462 apply_to_pmd_range+0xec/0x190 [ 0.000000] CPU: 0 PID: 0 Comm: swapper/0 Not tainted 5.13.0-rc1+ #10 [ 0.000000] Hardware name: linux,dummy-virt (DT) [ 0.000000] pstate: 600000c5 (nZCv daIF -PAN -UAO -TCO BTYPE=--) [ 0.000000] pc : apply_to_pmd_range+0xec/0x190 [ 0.000000] lr : __apply_to_page_range+0x94/0x170 [ 0.000000] sp : ffffffc010573e20 [ 0.000000] x29: ffffffc010573e20 x28: ffffff801f400000 x27: ffffff801f401000 [ 0.000000] x26: 0000000000000001 x25: ffffff801f400fff x24: ffffffc010573f28 [ 0.000000] x23: ffffffc01002b710 x22: ffffffc0105fa450 x21: ffffffc010573ee4 [ 0.000000] x20: ffffff801fffb7d0 x19: ffffff801f401000 x18: 00000000fffffffe [ 0.000000] x17: 000000000000003f x16: 000000000000000a x15: ffffffc01060b940 [ 0.000000] x14: 0000000000000000 x13: 0098968000000000 x12: 0000000098968000 [ 0.000000] x11: 0000000000000000 x10: 0000000098968000 x9 : 0000000000000001 [ 0.000000] x8 : 0000000000000000 x7 : ffffffc010573ee4 x6 : 0000000000000001 [ 0.000000] x5 : ffffffc010573f28 x4 : ffffffc01002b710 x3 : 0000000040000000 [ 0.000000] x2 : ffffff801f5fffff x1 : 0000000000000001 x0 : 007800005f400705 [ 0.000000] Call trace: [ 0.000000] apply_to_pmd_range+0xec/0x190 [ 0.000000] __apply_to_page_range+0x94/0x170 [ 0.000000] apply_to_page_range+0x10/0x20 [ 0.000000] __change_memory_common+0x50/0xdc [ 0.000000] set_memory_valid+0x30/0x40 [ 0.000000] kfence_init_pool+0x9c/0x16c [ 0.000000] kfence_init+0x20/0x98 [ 0.000000] start_kernel+0x284/0x3f8
--- arch/arm64/mm/mmu.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
arch/arm64/mm/mmu.c +2 -1
@@ -492,7 +492,8 @@ static void __init map_mem(pgd_t *pgdp)int flags =0 ;u64 i; -if (rodata_full || crash_mem_map ||debug_pagealloc_enabled ()) +if (rodata_full || crash_mem_map ||debug_pagealloc_enabled () || +IS_ENABLED (CONFIG_KFENCE )) flags =NO_BLOCK_MAPPINGS |NO_CONT_MAPPINGS ;/*
Greg Kroah-Hartman
maintainerPATCH 295/296 neighbour: Prevent Race condition in neighbour subsytem
In reply to Greg Kroah-HartmanFrom: Chinmay Agarwal <[email protected]>
commit eefb45eef5c4c425e87667af8f5e904fbdd47abf upstream.
Following Race Condition was detected:
<CPU A, t0>: Executing: __netif_receive_skb() ->__netif_receive_skb_core() -> arp_rcv() -> arp_process().arp_process() calls __neigh_lookup() which takes a reference on neighbour entry 'n'.
Moves further along, arp_process() and calls neigh_update()-> __neigh_update(). Neighbour entry is unlocked just before a call to neigh_update_gc_list.
This unlocking paves way for another thread that may take a reference on the same and mark it dead and remove it from gc_list.
<CPU B, t1> - neigh_flush_dev() is under execution and calls neigh_mark_dead(n) marking the neighbour entry 'n' as dead. Also n will be removed from gc_list.
Moves further along neigh_flush_dev() and calls neigh_cleanup_and_release(n), but since reference count increased in t1, 'n' couldn't be destroyed.
<CPU A, t3>- Code hits neigh_update_gc_list, with neighbour entry set as dead.
<CPU A, t4> - arp_process() finally calls neigh_release(n), destroying the neighbour entry and we have a destroyed ntry still part of gc_list.
--- net/core/neighbour.c | 4 ++++ 1 file changed, 4 insertions(+)
net/core/neighbour.c +4 -0
@@ -131,6 +131,9 @@ static void neigh_update_gc_list(structwrite_lock_bh (&n->tbl->lock);write_lock (&n->lock); +if (n->dead) + goto out; +/* remove from the gc list if new state is permanent or if neighbor * is externally learned; otherwise entry should be on the gc list */
@@ -147,6 +150,7 @@ static void neigh_update_gc_list(structatomic_inc (&n->tbl->gc_entries); } +out:write_unlock (&n->lock);write_unlock_bh (&n->tbl->lock); }
Greg Kroah-Hartman
maintainerPATCH 296/296 usb: core: reduce power-on-good delay time of root hub
In reply to Greg Kroah-HartmanFrom: Chunfeng Yun <[email protected]>
commit 90d28fb53d4a51299ff324dede015d5cb11b88a2 upstream.
Return the exactly delay time given by root hub descriptor, this helps to reduce resume time etc.
Due to the root hub descriptor is usually provided by the host controller driver, if there is compatibility for a root hub, we can fix it easily without affect other root hub
--- drivers/usb/core/hub.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
drivers/usb/core/hub.h +4 -2
@@ -148,8 +148,10 @@ static inline unsigned hub_power_on_good {unsigned delay = hub->descriptor->bPwrOn2PwrGood *2 ; -/* Wait at least 100 msec for power to become stable */ -return max (delay,100U ); +if (!hub->hdev->parent)/* root hub */ +return delay; +else /* Wait at least 100 msec for power to become stable */ +return max (delay,100U ); } static inline int hub_port_debounce_be_connected(struct usb_hub *hub,
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.12.9 release. There are 296 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Jun 2021 13:06:20 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.12.y
and the diffstat can be found below.thanks,
greg k-h
5.12.9-rc1 Successfully Compiled and booted on my Raspberry PI 4b (8g) (bcm2711)
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.12.9 release. There are 296 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Jun 2021 13:06:20 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 9 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.12.y
and the diffstat can be found below.thanks,
greg k-h
Tested rc1 against the Fedora build system (aarch64, armv7, ppc64le, s390x, x86_64), and boot tested x86_64. No regressions noted.
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.12.9 release. There are 296 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Jun 2021 13:06:20 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.12.y
and the diffstat can be found below.thanks,
greg k-h
On ARCH_BRCMSTB, using 32-bit and 64-bit ARM kernels:
Signature · 1 line
Florian
Quoted 10 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.12.9 release. There are 296 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Jun 2021 13:06:20 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.12.y
and the diffstat can be found below.thanks,
greg k-h
Results from Linaro’s test farm.
No regressions on arm64, arm, x86_64, and i386.
## Build
* kernel: 5.12.9-rc1
* git: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git
* git branch: linux-5.12.y
* git commit: 327e3cf768fb44b16c21a0589a492bf7bccef28b
* git describe: v5.12.7-305-g327e3cf768fb
* test details:
https://qa-reports.linaro.org/lkft/linux-stable-rc-linux-5.12.y/build/v5.12.7-305-g327e3cf768fb
## No regressions (compared to v5.12.7-8-g6fc814b4a8b3)
## No fixes (compared to v5.12.7-8-g6fc814b4a8b3)
## Test result summary
total: 76833, pass: 64662, fail: 605, skip: 10956, xfail: 610,
## Build Summary
* arc: 10 total, 10 passed, 0 failed
* arm: 193 total, 193 passed, 0 failed
* arm64: 27 total, 27 passed, 0 failed
* i386: 25 total, 25 passed, 0 failed
* mips: 45 total, 45 passed, 0 failed
* parisc: 9 total, 9 passed, 0 failed
* powerpc: 27 total, 27 passed, 0 failed
* riscv: 21 total, 21 passed, 0 failed
* s390: 18 total, 18 passed, 0 failed
* sh: 18 total, 18 passed, 0 failed
* sparc: 9 total, 9 passed, 0 failed
* x86_64: 27 total, 27 passed, 0 failed
## Test suites summary
* fwts
* igt-gpu-tools
* kselftest-android
* kselftest-breakpoints
* kselftest-capabilities
* kselftest-cgroup
* kselftest-clone3
* kselftest-core
* kselftest-cpu-hotplug
* kselftest-cpufreq
* kselftest-drivers
* kselftest-efivarfs
* kselftest-filesystems
* kselftest-firmware
* kselftest-fpu
* kselftest-futex
* kselftest-gpio
* kselftest-intel_pstate
* kselftest-ipc
* kselftest-ir
* kselftest-kcmp
* kselftest-kvm
* kselftest-lib
* kselftest-livepatch
* kselftest-lkdtm
* kselftest-membarrier
* kselftest-memfd
* kselftest-memory-hotplug
* kselftest-mincore
* kselftest-mount
* kselftest-mqueue
* kselftest-net
* kselftest-netfilter
* kselftest-nsfs
* kselftest-openat2
* kselftest-pid_namespace
* kselftest-pidfd
* kselftest-proc
* kselftest-pstore
* kselftest-ptrace
* kselftest-rseq
* kselftest-rtc
* kselftest-seccomp
* kselftest-sigaltstack
* kselftest-size
* kselftest-splice
* kselftest-static_keys
* kselftest-sync
* kselftest-sysctl
* kselftest-timens
* kselftest-timers
* kselftest-tmpfs
* kselftest-tpm2
* kselftest-user
* kselftest-vm
* kselftest-x86
* kselftest-zram
* kunit
* kvm-unit-tests
* libhugetlbfs
* linux-log-parser
* ltp-cap_bounds-tests
* ltp-commands-tests
* ltp-containers-tests
* ltp-controllers-tests
* ltp-cpuhotplug-tests
* ltp-crypto-tests
* ltp-cve-tests
* ltp-dio-tests
* ltp-fcntl-locktests-tests
* ltp-filecaps-tests
* ltp-fs-tests
* ltp-fs_bind-tests
* ltp-fs_perms_simple-tests
* ltp-fsx-tests
* ltp-hugetlb-tests
* ltp-io-tests
* ltp-ipc-tests
* ltp-math-tests
* ltp-mm-tests
* ltp-nptl-tests
* ltp-open-posix-tests
* ltp-pty-tests
* ltp-sched-tests
* ltp-securebits-tests
* ltp-syscalls-tests
* ltp-tracing-tests
* network-basic-tests
* packetdrill
* perf
* rcutorture
* v4l2-compliance
--
Linaro LKFT
https://lkft.linaro.org
Quoted 9 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.12.9 release. There are 296 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Jun 2021 13:06:20 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
Quoted 8 lines
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.12.9-rc1.gzor in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.gitlinux-5.12.y
and the diffstat can be found below.thanks,
greg k-h
Tested ok on:
- Tiger Lake x86_64
- Radxa ROCK Pi N10 (rk3399pro)
Signature · 1 line
Rudi
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 5.12.9 release. There are 296 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Wed, 02 Jun 2021 13:06:20 +0000. Anything received after that time might be too late.
Build results:
total: 151 pass: 151 fail: 0 Qemu test results: total: 462 pass: 462 fail: 0
Guenter