From: Greg Kroah-Hartman Date: Fri, 12 Sep 2014 23:07:42 +0000 (-0700) Subject: 3.10-stable patches X-Git-Tag: v3.10.55~43 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ddb1fc395d898458758c4eaa0f515c4c7afbb647;p=thirdparty%2Fkernel%2Fstable-queue.git 3.10-stable patches added patches: firmware-do-not-use-warn_on-spin_is_locked.patch iommu-amd-fix-cleanup_domain-for-mass-device-removal.patch media-media-device-remove-duplicated-memset-in-media_enum_entities.patch spi-omap2-mcspi-configure-hardware-when-slave-driver-changes-mode.patch spi-orion-fix-incorrect-handling-of-cell-index-dt-property.patch --- diff --git a/queue-3.10/firmware-do-not-use-warn_on-spin_is_locked.patch b/queue-3.10/firmware-do-not-use-warn_on-spin_is_locked.patch new file mode 100644 index 00000000000..078f126186b --- /dev/null +++ b/queue-3.10/firmware-do-not-use-warn_on-spin_is_locked.patch @@ -0,0 +1,60 @@ +From aee530cfecf4f3ec83b78406bac618cec35853f8 Mon Sep 17 00:00:00 2001 +From: Guenter Roeck +Date: Wed, 13 Aug 2014 11:21:34 -0700 +Subject: firmware: Do not use WARN_ON(!spin_is_locked()) + +From: Guenter Roeck + +commit aee530cfecf4f3ec83b78406bac618cec35853f8 upstream. + +spin_is_locked() always returns false for uniprocessor configurations +in several architectures, so do not use WARN_ON with it. +Use lockdep_assert_held() instead to also reduce overhead in +non-debug kernels. + +Signed-off-by: Guenter Roeck +Signed-off-by: Matt Fleming +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/firmware/efi/vars.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +--- a/drivers/firmware/efi/vars.c ++++ b/drivers/firmware/efi/vars.c +@@ -481,7 +481,7 @@ EXPORT_SYMBOL_GPL(efivar_entry_remove); + */ + static void efivar_entry_list_del_unlock(struct efivar_entry *entry) + { +- WARN_ON(!spin_is_locked(&__efivars->lock)); ++ lockdep_assert_held(&__efivars->lock); + + list_del(&entry->list); + spin_unlock_irq(&__efivars->lock); +@@ -507,7 +507,7 @@ int __efivar_entry_delete(struct efivar_ + const struct efivar_operations *ops = __efivars->ops; + efi_status_t status; + +- WARN_ON(!spin_is_locked(&__efivars->lock)); ++ lockdep_assert_held(&__efivars->lock); + + status = ops->set_variable(entry->var.VariableName, + &entry->var.VendorGuid, +@@ -667,7 +667,7 @@ struct efivar_entry *efivar_entry_find(e + int strsize1, strsize2; + bool found = false; + +- WARN_ON(!spin_is_locked(&__efivars->lock)); ++ lockdep_assert_held(&__efivars->lock); + + list_for_each_entry_safe(entry, n, head, list) { + strsize1 = ucs2_strsize(name, 1024); +@@ -731,7 +731,7 @@ int __efivar_entry_get(struct efivar_ent + const struct efivar_operations *ops = __efivars->ops; + efi_status_t status; + +- WARN_ON(!spin_is_locked(&__efivars->lock)); ++ lockdep_assert_held(&__efivars->lock); + + status = ops->get_variable(entry->var.VariableName, + &entry->var.VendorGuid, diff --git a/queue-3.10/iommu-amd-fix-cleanup_domain-for-mass-device-removal.patch b/queue-3.10/iommu-amd-fix-cleanup_domain-for-mass-device-removal.patch new file mode 100644 index 00000000000..243bda18fd1 --- /dev/null +++ b/queue-3.10/iommu-amd-fix-cleanup_domain-for-mass-device-removal.patch @@ -0,0 +1,47 @@ +From 9b29d3c6510407d91786c1cf9183ff4debb3473a Mon Sep 17 00:00:00 2001 +From: Joerg Roedel +Date: Tue, 5 Aug 2014 17:50:15 +0200 +Subject: iommu/amd: Fix cleanup_domain for mass device removal + +From: Joerg Roedel + +commit 9b29d3c6510407d91786c1cf9183ff4debb3473a upstream. + +When multiple devices are detached in __detach_device, they +are also removed from the domains dev_list. This makes it +unsafe to use list_for_each_entry_safe, as the next pointer +might also not be in the list anymore after __detach_device +returns. So just repeatedly remove the first element of the +list until it is empty. + +Tested-by: Marti Raudsepp +Signed-off-by: Joerg Roedel +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/iommu/amd_iommu.c | 10 ++++++---- + 1 file changed, 6 insertions(+), 4 deletions(-) + +--- a/drivers/iommu/amd_iommu.c ++++ b/drivers/iommu/amd_iommu.c +@@ -3187,14 +3187,16 @@ free_domains: + + static void cleanup_domain(struct protection_domain *domain) + { +- struct iommu_dev_data *dev_data, *next; ++ struct iommu_dev_data *entry; + unsigned long flags; + + write_lock_irqsave(&amd_iommu_devtable_lock, flags); + +- list_for_each_entry_safe(dev_data, next, &domain->dev_list, list) { +- __detach_device(dev_data); +- atomic_set(&dev_data->bind, 0); ++ while (!list_empty(&domain->dev_list)) { ++ entry = list_first_entry(&domain->dev_list, ++ struct iommu_dev_data, list); ++ __detach_device(entry); ++ atomic_set(&entry->bind, 0); + } + + write_unlock_irqrestore(&amd_iommu_devtable_lock, flags); diff --git a/queue-3.10/media-media-device-remove-duplicated-memset-in-media_enum_entities.patch b/queue-3.10/media-media-device-remove-duplicated-memset-in-media_enum_entities.patch new file mode 100644 index 00000000000..a957ccd6e69 --- /dev/null +++ b/queue-3.10/media-media-device-remove-duplicated-memset-in-media_enum_entities.patch @@ -0,0 +1,35 @@ +From f8ca6ac00d2ba24c5557f08f81439cd3432f0802 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Salva=20Peir=C3=B3?= +Date: Sat, 7 Jun 2014 11:41:44 -0300 +Subject: media: media-device: Remove duplicated memset() in media_enum_entities() +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +From: Salva Peiró + +commit f8ca6ac00d2ba24c5557f08f81439cd3432f0802 upstream. + +After the zeroing the whole struct struct media_entity_desc u_ent, +it is no longer necessary to memset(0) its u_ent.name field. + +Signed-off-by: Salva Peiró +Signed-off-by: Laurent Pinchart +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/media/media-device.c | 2 -- + 1 file changed, 2 deletions(-) + +--- a/drivers/media/media-device.c ++++ b/drivers/media/media-device.c +@@ -106,8 +106,6 @@ static long media_device_enum_entities(s + if (ent->name) { + strncpy(u_ent.name, ent->name, sizeof(u_ent.name)); + u_ent.name[sizeof(u_ent.name) - 1] = '\0'; +- } else { +- memset(u_ent.name, 0, sizeof(u_ent.name)); + } + u_ent.type = ent->type; + u_ent.revision = ent->revision; diff --git a/queue-3.10/series b/queue-3.10/series index f07180b6024..3555c9d9239 100644 --- a/queue-3.10/series +++ b/queue-3.10/series @@ -1,3 +1,8 @@ media-xc5000-fix-get_frequency.patch media-xc4000-fix-get_frequency.patch media-au0828-only-alt-setting-logic-when-needed.patch +media-media-device-remove-duplicated-memset-in-media_enum_entities.patch +iommu-amd-fix-cleanup_domain-for-mass-device-removal.patch +spi-orion-fix-incorrect-handling-of-cell-index-dt-property.patch +spi-omap2-mcspi-configure-hardware-when-slave-driver-changes-mode.patch +firmware-do-not-use-warn_on-spin_is_locked.patch diff --git a/queue-3.10/spi-omap2-mcspi-configure-hardware-when-slave-driver-changes-mode.patch b/queue-3.10/spi-omap2-mcspi-configure-hardware-when-slave-driver-changes-mode.patch new file mode 100644 index 00000000000..5d3dfc29748 --- /dev/null +++ b/queue-3.10/spi-omap2-mcspi-configure-hardware-when-slave-driver-changes-mode.patch @@ -0,0 +1,79 @@ +From 97ca0d6cc118716840ea443e010cb3d5f2d25eaf Mon Sep 17 00:00:00 2001 +From: "Mark A. Greer" +Date: Tue, 1 Jul 2014 20:28:32 -0700 +Subject: spi: omap2-mcspi: Configure hardware when slave driver changes mode + +From: "Mark A. Greer" + +commit 97ca0d6cc118716840ea443e010cb3d5f2d25eaf upstream. + +Commit id 2bd16e3e23d9df41592c6b257c59b6860a9cc3ea +(spi: omap2-mcspi: Do not configure the controller +on each transfer unless needed) does its job too +well so omap2_mcspi_setup_transfer() isn't called +even when an SPI slave driver changes 'spi->mode'. +The result is that the mode requested by the SPI +slave driver never takes effect. + +Fix this by adding the 'mode' member to the +omap2_mcspi_cs structure which holds the mode +value that the hardware is configured for. +When the SPI slave driver changes 'spi->mode' +it will be different than the value of this new +member and the SPI master driver will know that +the hardware must be reconfigured (by calling +omap2_mcspi_setup_transfer()). + +Fixes: 2bd16e3e23 (spi: omap2-mcspi: Do not configure the controller on each transfer unless needed) +Signed-off-by: Mark A. Greer +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-omap2-mcspi.c | 14 ++++++++++++++ + 1 file changed, 14 insertions(+) + +--- a/drivers/spi/spi-omap2-mcspi.c ++++ b/drivers/spi/spi-omap2-mcspi.c +@@ -136,6 +136,7 @@ struct omap2_mcspi_cs { + void __iomem *base; + unsigned long phys; + int word_len; ++ u16 mode; + struct list_head node; + /* Context save and restore shadow register */ + u32 chconf0; +@@ -801,6 +802,8 @@ static int omap2_mcspi_setup_transfer(st + + mcspi_write_chconf0(spi, l); + ++ cs->mode = spi->mode; ++ + dev_dbg(&spi->dev, "setup: speed %d, sample %s edge, clk %s\n", + OMAP2_MCSPI_MAX_FREQ >> div, + (spi->mode & SPI_CPHA) ? "trailing" : "leading", +@@ -871,6 +874,7 @@ static int omap2_mcspi_setup(struct spi_ + return -ENOMEM; + cs->base = mcspi->base + spi->chip_select * 0x14; + cs->phys = mcspi->phys + spi->chip_select * 0x14; ++ cs->mode = 0; + cs->chconf0 = 0; + spi->controller_state = cs; + /* Link this to context save list */ +@@ -1043,6 +1047,16 @@ static void omap2_mcspi_work(struct omap + mcspi_read_cs_reg(spi, OMAP2_MCSPI_MODULCTRL); + } + ++ /* ++ * The slave driver could have changed spi->mode in which case ++ * it will be different from cs->mode (the current hardware setup). ++ * If so, set par_override (even though its not a parity issue) so ++ * omap2_mcspi_setup_transfer will be called to configure the hardware ++ * with the correct mode on the first iteration of the loop below. ++ */ ++ if (spi->mode != cs->mode) ++ par_override = 1; ++ + omap2_mcspi_set_enable(spi, 0); + + m->status = status; diff --git a/queue-3.10/spi-orion-fix-incorrect-handling-of-cell-index-dt-property.patch b/queue-3.10/spi-orion-fix-incorrect-handling-of-cell-index-dt-property.patch new file mode 100644 index 00000000000..592b2e76751 --- /dev/null +++ b/queue-3.10/spi-orion-fix-incorrect-handling-of-cell-index-dt-property.patch @@ -0,0 +1,61 @@ +From e06871cd2c92e5c65d7ca1d32866b4ca5dd4ac30 Mon Sep 17 00:00:00 2001 +From: Thomas Petazzoni +Date: Sun, 27 Jul 2014 23:53:19 +0200 +Subject: spi: orion: fix incorrect handling of cell-index DT property + +From: Thomas Petazzoni + +commit e06871cd2c92e5c65d7ca1d32866b4ca5dd4ac30 upstream. + +In commit f814f9ac5a81 ("spi/orion: add device tree binding"), Device +Tree support was added to the spi-orion driver. However, this commit +reads the "cell-index" property, without taking into account the fact +that DT properties are big-endian encoded. + +Since most of the platforms using spi-orion with DT have apparently +not used anything but cell-index = <0>, the problem was not +visible. But as soon as one starts using cell-index = <1>, the problem +becomes clearly visible, as the master->bus_num gets a wrong value +(actually it gets the value 0, which conflicts with the first bus that +has cell-index = <0>). + +This commit fixes that by using of_property_read_u32() to read the +property value, which does the appropriate endianness conversion when +needed. + +Fixes: f814f9ac5a81 ("spi/orion: add device tree binding") +Signed-off-by: Thomas Petazzoni +Acked-by: Sebastian Hesselbarth +Signed-off-by: Mark Brown +Signed-off-by: Greg Kroah-Hartman + +--- + drivers/spi/spi-orion.c | 10 ++++------ + 1 file changed, 4 insertions(+), 6 deletions(-) + +--- a/drivers/spi/spi-orion.c ++++ b/drivers/spi/spi-orion.c +@@ -403,8 +403,6 @@ static int orion_spi_probe(struct platfo + struct resource *r; + unsigned long tclk_hz; + int status = 0; +- const u32 *iprop; +- int size; + + master = spi_alloc_master(&pdev->dev, sizeof *spi); + if (master == NULL) { +@@ -415,10 +413,10 @@ static int orion_spi_probe(struct platfo + if (pdev->id != -1) + master->bus_num = pdev->id; + if (pdev->dev.of_node) { +- iprop = of_get_property(pdev->dev.of_node, "cell-index", +- &size); +- if (iprop && size == sizeof(*iprop)) +- master->bus_num = *iprop; ++ u32 cell_index; ++ if (!of_property_read_u32(pdev->dev.of_node, "cell-index", ++ &cell_index)) ++ master->bus_num = cell_index; + } + + /* we support only mode 0, and no options */