4.11.3-stable review
Subsystems (7)
Greg Kroah-Hartman
maintainerPATCH 125/197 powerpc/pseries: Fix of_node_put() underflow during DLPAR remove
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyrel Datwyler <[email protected]>
commit 68baf692c435339e6295cb470ea5545cbc28160e upstream.
Historically struct device_node references were tracked using a kref embedded as a struct field. Commit 75b57ecf9d1d ("of: Make device nodes kobjects so they show up in sysfs") (Mar 2014) refactored device_nodes to be kobjects such that the device tree could by more simply exposed to userspace using sysfs.
Commit 0829f6d1f69e ("of: device_node kobject lifecycle fixes") (Mar 2014) followed up these changes to better control the kobject lifecycle and in particular the referecne counting via of_node_get(), of_node_put(), and of_node_init().
A result of this second commit was that it introduced an of_node_put() call when a dynamic node is detached, in of_node_remove(), that removes the initial kobj reference created by of_node_init().
Traditionally as the original dynamic device node user the pseries code had assumed responsibilty for releasing this final reference in its platform specific DLPAR detach code.
This patch fixes a refcount underflow introduced by commit 0829f6d1f6, and recently exposed by the upstreaming of the recount API.
Messages like the following are no longer seen in the kernel log with this patch following DLPAR remove operations of cpus and pci devices.
rpadlpar_io: slot PHB 72 removed
refcount_t: underflow; use-after-free.
------------[ cut here ]------------ WARNING: CPU: 5 PID: 3335 at lib/refcount.c:128 refcount_sub_and_test+0xf4/0x110
--- arch/powerpc/platforms/pseries/dlpar.c | 1 - 1 file changed, 1 deletion(-)
arch/powerpc/platforms/pseries/dlpar.c +0 -1
@@ -288,7 +288,6 @@ int dlpar_detach_node(struct device_nodeif (rc)return rc; -of_node_put (dn);/* Must decrement the refcount */ return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 126/197 powerpc/sysfs: Fix reference leak of cpu device_nodes present at boot
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tyrel Datwyler <[email protected]>
commit e76ca27790a514590af782f83f6eae49e0ccf8c9 upstream.
For CPUs present at boot each logical CPU acquires a reference to the associated device node of the core. This happens in register_cpu() which is called by topology_init(). The result of this is that we end up with a reference held by each thread of the core. However, these references are never freed if the CPU core is DLPAR removed.
This patch fixes the reference leaks by acquiring and releasing the references in the CPU hotplug callbacks un/register_cpu_online(). With this patch symmetric reference counting is observed with both CPUs present at boot, and those DLPAR added after boot.
--- arch/powerpc/kernel/sysfs.c | 6 ++++++ 1 file changed, 6 insertions(+)
arch/powerpc/kernel/sysfs.c +6 -0
@@ -710,6 +710,10 @@ static int register_cpu_online(unsignedstruct device_attribute *attrs, *pmc_attrs;int i, nattrs; +/* For cpus present at boot a reference was already grabbed in register_cpu() */ +if (!s->of_node) + s->of_node =of_get_cpu_node (cpu,NULL ); +#ifdef CONFIG_PPC64 if (cpu_has_feature (CPU_FTR_SMT ))device_create_file (s, &dev_attr_smt_snooze_delay);
@@ -864,6 +868,8 @@ static int unregister_cpu_online(unsigne }#endif cacheinfo_cpu_offline (cpu); +of_node_put (s->of_node); + s->of_node =NULL ;#endif /* CONFIG_HOTPLUG_CPU */ return 0 ; }
Re: [PATCH 4.11 044/197] x86: fix 32-bit case of __get_user_asm_u64()
In reply to Greg Kroah-HartmanQuoted 1 line · Greg Kroah-Hartman
4.11-stable review patch. If anyone has any objections, please let me know.
No objections, but I do want to note that I verified with a "allyesconfig" build on i386 that this code actually never triggers at least in current -git. I might have screwed something up, but I added a "fsin" instruction to that inline asm, and then verified that "objdump" didn't find any fsin instructions in any object files after the build.
There are people who do 64-bit reads from user space, but they all seem to happily use "get_user()" that gets it right, not the "__get_user()" helper that did not.
So it's still worth putting in stable (just in case of future or external users), but at least it doesn't seem to be a potential security issue (which it might have been - with the right unlucky code generation you could make the 64-bit load basically be a pointer following thing).
Linus
Greg Kroah-Hartman
maintainerPATCH 127/197 powerpc/iommu: Do not call PageTransHuge() on tail pages
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Alexey Kardashevskiy <[email protected]>
commit e889e96e98e8da97bd39e46b7253615eabe14397 upstream.
The CMA pages migration code does not support compound pages at the moment so it performs few tests before proceeding to actual page migration.
One of the tests - PageTransHuge() - has VM_BUG_ON_PAGE(PageTail()) as it is designed to be called on head pages only. Since we also test for PageCompound(), and it contains PageTail() and PageHead(), we can simplify the check by leaving just PageCompound() and therefore avoid possible VM_BUG_ON_PAGE.
--- arch/powerpc/mm/mmu_context_iommu.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
arch/powerpc/mm/mmu_context_iommu.c +2 -2
@@ -81,7 +81,7 @@ struct page *new_iommu_non_cma_page(strugfp_t gfp_mask =GFP_USER ;struct page *new_page; -if (PageHuge (page) ||PageTransHuge (page) ||PageCompound (page)) +if (PageCompound (page))return NULL ;if (PageHighMem (page))
@@ -100,7 +100,7 @@ static int mm_iommu_move_page_from_cma(sLIST_HEAD (cma_migrate_pages);/* Ignore huge pages for now */ -if (PageHuge (page) ||PageTransHuge (page) ||PageCompound (page)) +if (PageCompound (page))return -EBUSY ;lru_add_drain ();
Greg Kroah-Hartman
maintainerPATCH 120/197 cx231xx-audio: fix NULL-deref at probe
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Johan Hovold <[email protected]>
commit 65f921647f4c89a2068478c89691f39b309b58f7 upstream.
Make sure to check the number of endpoints to avoid dereferencing a NULL-pointer or accessing memory beyond the endpoint array should a malicious device lack the expected endpoints.
--- drivers/media/usb/cx231xx/cx231xx-audio.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-)
drivers/media/usb/cx231xx/cx231xx-audio.c +15 -2
@@ -697,6 +697,11 @@ static int cx231xx_audio_init(struct cx2 hs_config_info[0 ].interface_info. audio_index + 1]; +if (uif->altsetting[0 ].desc.bNumEndpoints < isoc_pipe +1 ) { + err = -ENODEV ; + goto err_free_card; + } + adev->end_point_addr = uif->altsetting[0 ].endpoint[isoc_pipe].desc. bEndpointAddress;
@@ -712,8 +717,14 @@ static int cx231xx_audio_init(struct cx2 }for (i =0 ; i < adev->num_alt; i++) { -u16 tmp = -le16_to_cpu (uif->altsetting[i].endpoint[isoc_pipe].desc. +u16 tmp; + +if (uif->altsetting[i].desc.bNumEndpoints < isoc_pipe +1 ) { + err = -ENODEV ; + goto err_free_pkt_size; + } + + tmp =le16_to_cpu (uif->altsetting[i].endpoint[isoc_pipe].desc. wMaxPacketSize); adev->alt_max_pkt_size[i] = (tmp &0x07ff ) * (((tmp &0x1800 ) >>11 ) +1 );
@@ -724,6 +735,8 @@ static int cx231xx_audio_init(struct cx2return 0 ; +err_free_pkt_size: +kfree (adev->alt_max_pkt_size); err_free_card:snd_card_free (card);
Greg Kroah-Hartman
maintainerPATCH 170/197 drbd: fix request leak introduced by locking/atomic, kref: Kill kref_sub()
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Lars Ellenberg <[email protected]>
commit a00ebd1cf12c378a1d4f7a1d6daf1d76c1eaad82 upstream.
When killing kref_sub(), the unconditional additional kref_get() was not properly paired with the necessary kref_put(), causing a leak of struct drbd_requests (~ 224 Bytes) per submitted bio, and breaking DRBD in general, as the destructor of those "drbd_requests" does more than just the mempoll_free().
--- drivers/block/drbd/drbd_req.c | 27 +++++++++++++++------------ 1 file changed, 15 insertions(+), 12 deletions(-)
drivers/block/drbd/drbd_req.c +15 -12
@@ -314,24 +314,32 @@ void drbd_req_complete(struct drbd_reque }/* still holds resource->req_lock */ -static int drbd_req_put_completion_ref (struct drbd_request *req,struct bio_and_error *m,int put) +static void drbd_req_put_completion_ref (struct drbd_request *req,struct bio_and_error *m,int put) {struct drbd_device *device = req->device;D_ASSERT (device, m || (req->rq_state &RQ_POSTPONED )); +if (!put) +return ; +if (!atomic_sub_and_test (put, &req->completion_ref)) -return 0 ; +return ;drbd_req_complete (req, m); +/* local completion may still come in later, +* we need to keep the req object around. */ +if (req->rq_state &RQ_LOCAL_ABORTED ) +return ; +if (req->rq_state &RQ_POSTPONED ) {/* don't destroy the req object just yet, * but queue it for retry */ drbd_restart_request (req); -return 0 ; +return ; } -return 1 ; +kref_put (&req->kref, drbd_req_destroy); }static void set_if_null_req_next (struct drbd_peer_device *peer_device,struct drbd_request *req)
@@ -518,12 +526,8 @@ static void mod_rq_state(struct drbd_reqif (req->i.waiting)wake_up (&device->misc_wait); -if (c_put) { -if (drbd_req_put_completion_ref (req, m, c_put)) -kref_put (&req->kref, drbd_req_destroy); - }else { -kref_put (&req->kref, drbd_req_destroy); - } +drbd_req_put_completion_ref (req, m, c_put); +kref_put (&req->kref, drbd_req_destroy); }static void drbd_report_io_error (struct drbd_device *device,struct drbd_request *req)
@@ -1363,8 +1367,7 @@ nodata: } out: -if (drbd_req_put_completion_ref (req, &m,1 )) -kref_put (&req->kref, drbd_req_destroy); +drbd_req_put_completion_ref (req, &m,1 );spin_unlock_irq (&resource->req_lock);/* Even though above is a kref_put(), this is safe.
Greg Kroah-Hartman
maintainerPATCH 176/197 PCI/ACPI: Add ThunderX pass2.x 2nd node MCFG quirk
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tomasz Nowicki <[email protected]>
commit cd183740480f045600aa1fa38fe70809b5498f05 upstream.
Currently SoCs pass2.x do not emulate EA headers for ACPI boot method at all. However, for pass2.x some devices (like EDAC) advertise incorrect base addresses in their BARs which results in driver probe failure during resource request. Since all problematic blocks are on 2nd NUMA node under domain 10 add necessary quirk entry to obtain BAR addresses correction using EA header emulation.
--- drivers/acpi/pci_mcfg.c | 1 + 1 file changed, 1 insertion(+)
drivers/acpi/pci_mcfg.c +1 -0
@@ -101,6 +101,7 @@ static struct mcfg_fixup mcfg_quirks[] =/* SoC pass2.x */ THUNDER_PEM_QUIRK (1 ,0 ),THUNDER_PEM_QUIRK (1 ,1 ), +THUNDER_ECAM_QUIRK (1 ,10 ),/* SoC pass1.x */ THUNDER_PEM_QUIRK(2, 0), /* off-chip devices */
Greg Kroah-Hartman
maintainerPATCH 175/197 PCI/ACPI: Tidy up MCFG quirk whitespace
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Bjorn Helgaas <[email protected]>
commit ced414a14f709fc0af60bd381ba8a566dc566869 upstream.
With no blank lines, it's not obvious where the macro definitions end and the uses begin. Add some blank lines and reorder the ThunderX definitions. No functional change intended.
--- drivers/acpi/pci_mcfg.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-)
drivers/acpi/pci_mcfg.c +10 -3
@@ -54,6 +54,7 @@ static struct mcfg_fixup mcfg_quirks[] =#define QCOM_ECAM32 (seg) \ { "QCOM ", "QDF2432 ", 1, seg, MCFG_BUS_ANY, &pci_32b_ops } +QCOM_ECAM32 (0 ),QCOM_ECAM32 (1 ), QCOM_ECAM32(2),
@@ -68,6 +69,7 @@ static struct mcfg_fixup mcfg_quirks[] = { "HISI ", table_id, 0, (seg) + 1, MCFG_BUS_ANY, ops }, \ { "HISI ", table_id, 0, (seg) + 2, MCFG_BUS_ANY, ops }, \ { "HISI ", table_id, 0, (seg) + 3, MCFG_BUS_ANY, ops } +HISI_QUAD_DOM ("HIP05 " ,0 , &hisi_pcie_ops),HISI_QUAD_DOM ("HIP06 " ,0 , &hisi_pcie_ops), HISI_QUAD_DOM("HIP07 ", 0, &hisi_pcie_ops),
@@ -77,6 +79,7 @@ static struct mcfg_fixup mcfg_quirks[] =#define THUNDER_PEM_RES (addr, node) \ DEFINE_RES_MEM((addr) + ((u64) (node) << 44), 0x39 * SZ_16M) +#define THUNDER_PEM_QUIRK (rev, node) \ { "CAVIUM", "THUNDERX", rev, 4 + (10 * (node)), MCFG_BUS_ANY, \ &thunder_pem_ecam_ops, THUNDER_PEM_RES(0x88001f000000UL, node) }, \
@@ -90,13 +93,15 @@ static struct mcfg_fixup mcfg_quirks[] = &thunder_pem_ecam_ops, THUNDER_PEM_RES(0x894057000000UL, node) }, \ {"CAVIUM" ,"THUNDERX" , rev,9 + (10 * (node)),MCFG_BUS_ANY , \ &thunder_pem_ecam_ops, THUNDER_PEM_RES(0x89808f000000UL, node) } -/* SoC pass2.x */ - THUNDER_PEM_QUIRK(1, 0), - THUNDER_PEM_QUIRK(1, 1),#define THUNDER_ECAM_QUIRK (rev, seg) \ { "CAVIUM", "THUNDERX", rev, seg, MCFG_BUS_ANY, \ &pci_thunder_ecam_ops } + +/* SoC pass2.x */ + THUNDER_PEM_QUIRK(1, 0), + THUNDER_PEM_QUIRK(1, 1), +/* SoC pass1.x */ THUNDER_PEM_QUIRK(2, 0), /* off-chip devices */ THUNDER_PEM_QUIRK(2, 1), /* off-chip devices */
@@ -112,9 +117,11 @@ static struct mcfg_fixup mcfg_quirks[] =#define XGENE_V1_ECAM_MCFG (rev, seg) \ {"APM ", "XGENE ", rev, seg, MCFG_BUS_ANY, \ &xgene_v1_pcie_ecam_ops } +#define XGENE_V2_ECAM_MCFG (rev, seg) \ {"APM ", "XGENE ", rev, seg, MCFG_BUS_ANY, \ &xgene_v2_pcie_ecam_ops } +/* X-Gene SoC with v1 PCIe controller */ XGENE_V1_ECAM_MCFG (1 ,0 ), XGENE_V1_ECAM_MCFG(1, 1),
Greg Kroah-Hartman
maintainerPATCH 177/197 PCI: hv: Allocate interrupt descriptors with GFP_ATOMIC
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: K. Y. Srinivasan <[email protected]>
commit 59c58ceeea9cdc6144d7b0303753e6bd26d87455 upstream.
The memory allocation here needs to be non-blocking. Fix the issue.
--- drivers/pci/host/pci-hyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/host/pci-hyperv.c +1 -1
@@ -876,7 +876,7 @@ static void hv_compose_msi_msg(struct irhv_int_desc_free (hpdev, int_desc); } - int_desc =kzalloc (sizeof (*int_desc),GFP_KERNEL ); + int_desc =kzalloc (sizeof (*int_desc),GFP_ATOMIC );if (!int_desc) goto drop_reference;
Greg Kroah-Hartman
maintainerPATCH 178/197 PCI: hv: Specify CPU_AFFINITY_ALL for MSI affinity when >= 32 CPUs
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: K. Y. Srinivasan <[email protected]>
commit 433fcf6b7b31f1f233dd50aeb9d066a0f6ed4b9d upstream.
When we have 32 or more CPUs in the affinity mask, we should use a special constant to specify that to the host. Fix this issue.
--- drivers/pci/host/pci-hyperv.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
drivers/pci/host/pci-hyperv.c +8 -3
@@ -72,6 +72,7 @@ enum { PCI_PROTOCOL_VERSION_CURRENT = PCI_PROTOCOL_VERSION_1_1 }; +#define CPU_AFFINITY_ALL -1ULL#define PCI_CONFIG_MMIO_LENGTH 0x2000#define CFG_PAGE_OFFSET 0x1000#define CFG_PAGE_SIZE (PCI_CONFIG_MMIO_LENGTH - CFG_PAGE_OFFSET)
@@ -897,9 +898,13 @@ static void hv_compose_msi_msg(struct ir* processors because Hyper-V only supports 64 in a guest. */ affinity =irq_data_get_affinity_mask (data); -for_each_cpu_and (cpu, affinity, cpu_online_mask) { - int_pkt->int_desc.cpu_mask |= - (1ULL <<vmbus_cpu_number_to_vp_number (cpu)); +if (cpumask_weight (affinity) >=32 ) { + int_pkt->int_desc.cpu_mask =CPU_AFFINITY_ALL ; + }else { +for_each_cpu_and (cpu, affinity, cpu_online_mask) { + int_pkt->int_desc.cpu_mask |= + (1ULL <<vmbus_cpu_number_to_vp_number (cpu)); + } } ret = vmbus_sendpacket(hpdev->hbus->hdev->channel, int_pkt,
Greg Kroah-Hartman
maintainerPATCH 179/197 PCI: Fix pci_mmap_fits() for HAVE_PCI_RESOURCE_TO_USER platforms
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <[email protected]>
commit 6bccc7f426abd640f08d8c75fb22f99483f201b4 upstream.
In the PCI_MMAP_PROCFS case when the address being passed by the user is a 'user visible' resource address based on the bus window, and not the actual contents of the resource, that's what we need to be checking it against.
--- drivers/pci/pci-sysfs.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
drivers/pci/pci-sysfs.c +7 -3
@@ -985,15 +985,19 @@ void pci_remove_legacy_files(struct pci_int pci_mmap_fits (struct pci_dev *pdev,int resno,struct vm_area_struct *vma,enum pci_mmap_api mmap_api) { -unsigned long nr, start, size, pci_start; +unsigned long nr, start, size; +resource_size_t pci_start =0 , pci_end;if (pci_resource_len (pdev, resno) ==0 )return 0 ; nr =vma_pages (vma); start = vma->vm_pgoff; size = ((pci_resource_len (pdev, resno) -1 ) >>PAGE_SHIFT ) +1 ; - pci_start = (mmap_api ==PCI_MMAP_PROCFS ) ? -pci_resource_start (pdev, resno) >>PAGE_SHIFT :0 ; +if (mmap_api ==PCI_MMAP_PROCFS ) { +pci_resource_to_user (pdev, resno, &pdev->resource[resno], + &pci_start, &pci_end); + pci_start >>=PAGE_SHIFT ; + }if (start >= pci_start && start < pci_start + size && start + nr <= pci_start + size)return 1 ;
Greg Kroah-Hartman
maintainerPATCH 181/197 PCI: Only allow WC mmap on prefetchable resources
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: David Woodhouse <[email protected]>
commit cef4d02305a06be581bb7f4353446717a1b319ec upstream.
The /proc/bus/pci mmap interface allows the user to specify whether they want WC or not. Don't let them do so on non-prefetchable BARs.
--- drivers/pci/proc.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-)
drivers/pci/proc.c +8 -5
@@ -231,7 +231,7 @@ static int proc_bus_pci_mmap(struct file {struct pci_dev *dev =PDE_DATA (file_inode (file));struct pci_filp_private *fpriv = file->private_data; -int i, ret, write_combine, res_bit; +int i, ret, write_combine =0 , res_bit;if (!capable (CAP_SYS_RAWIO ))return -EPERM ;
@@ -251,10 +251,13 @@ static int proc_bus_pci_mmap(struct fileif (i >=PCI_ROM_RESOURCE )return -ENODEV ; -if (fpriv->mmap_state == pci_mmap_mem) - write_combine = fpriv->write_combine; -else - write_combine =0 ; +if (fpriv->mmap_state == pci_mmap_mem && + fpriv->write_combine) { +if (dev->resource[i].flags &IORESOURCE_PREFETCH ) + write_combine =1 ; +else +return -EINVAL ; + } ret =pci_mmap_page_range (dev, vma, fpriv->mmap_state, write_combine);if (ret <0 )
Greg Kroah-Hartman
maintainerPATCH 183/197 mtd: nand: orion: fix clk handling
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Simon Baatz <[email protected]>
commit 675b11d94ce9baa5eb365a51b35d2793f77c8ab8 upstream.
The clk handling in orion_nand.c had two problems:
- In the probe function, clk_put() was called for an enabled clock, which violates the API (see documentation for clk_put() in include/linux/clk.h)
- In the error path of the probe function, clk_put() could be called twice for the same clock.
In order to clean this up, use the managed function devm_clk_get() and store the pointer to the clk in the driver data.
--- drivers/mtd/nand/orion_nand.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-)
drivers/mtd/nand/orion_nand.c +21 -21
@@ -23,6 +23,11 @@#include <asm/sizes.h> #include <linux/platform_data/mtd-orion_nand.h> +struct orion_nand_info { +struct nand_chip chip; +struct clk *clk; +}; +static void orion_nand_cmd_ctrl (struct mtd_info *mtd,int cmd,unsigned int ctrl) {struct nand_chip *nc =mtd_to_nand (mtd);
@@ -75,20 +80,21 @@ static void orion_nand_read_buf(struct mstatic int __init orion_nand_probe (struct platform_device *pdev) { +struct orion_nand_info *info;struct mtd_info *mtd;struct nand_chip *nc;struct orion_nand_data *board;struct resource *res; -struct clk *clk;void __iomem *io_base;int ret =0 ;u32 val =0 ; - nc =devm_kzalloc (&pdev->dev, -sizeof (struct nand_chip ), + info =devm_kzalloc (&pdev->dev, +sizeof (struct orion_nand_info ),GFP_KERNEL ); -if (!nc) +if (!info)return -ENOMEM ; + nc = &info->chip; mtd =nand_to_mtd (nc); res =platform_get_resource (pdev,IORESOURCE_MEM ,0 );
@@ -145,15 +151,13 @@ static int __init orion_nand_probe(strucif (board->dev_ready) nc->dev_ready = board->dev_ready; -platform_set_drvdata (pdev, mtd); +platform_set_drvdata (pdev, info);/* Not all platforms can gate the clock, so it is not an error if the clock does not exists. */ - clk =clk_get (&pdev->dev,NULL ); -if (!IS_ERR (clk)) { -clk_prepare_enable (clk); -clk_put (clk); - } + info->clk =devm_clk_get (&pdev->dev,NULL ); +if (!IS_ERR (info->clk)) +clk_prepare_enable (info->clk); ret =nand_scan (mtd,1 );if (ret)
@@ -169,26 +173,22 @@ static int __init orion_nand_probe(strucreturn 0 ; no_dev: -if (!IS_ERR (clk)) { -clk_disable_unprepare (clk); -clk_put (clk); - } +if (!IS_ERR (info->clk)) +clk_disable_unprepare (info->clk);return ret; }static int orion_nand_remove (struct platform_device *pdev) { -struct mtd_info *mtd =platform_get_drvdata (pdev); -struct clk *clk; +struct orion_nand_info *info =platform_get_drvdata (pdev); +struct nand_chip *chip = &info->chip; +struct mtd_info *mtd =nand_to_mtd (chip);nand_release (mtd); - clk =clk_get (&pdev->dev,NULL ); -if (!IS_ERR (clk)) { -clk_disable_unprepare (clk); -clk_put (clk); - } +if (!IS_ERR (info->clk)) +clk_disable_unprepare (info->clk);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 186/197 drm/edid: Add 10 bpc quirk for LGD 764 panel in HP zBook 17 G2
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Mario Kleiner <[email protected]>
commit e345da82bd6bdfa8492f80b3ce4370acfd868d95 upstream.
The builtin eDP panel in the HP zBook 17 G2 supports 10 bpc, as advertised by the Laptops product specs and verified via injecting a fixed edid + photometer measurements, but edid reports unknown depth, so drivers fall back to 6 bpc.
Add a quirk to get the full 10 bpc.
--- drivers/gpu/drm/drm_edid.c | 8 ++++++++ 1 file changed, 8 insertions(+)
drivers/gpu/drm/drm_edid.c +8 -0
@@ -79,6 +79,8 @@#define EDID_QUIRK_FORCE_12BPC (1 << 9)/* Force 6bpc */ #define EDID_QUIRK_FORCE_6BPC (1 << 10) +/* Force 10bpc */ +#define EDID_QUIRK_FORCE_10BPC (1 << 11)struct detailed_mode_closure {struct drm_connector *connector;
@@ -121,6 +123,9 @@ static const struct edid_quirk { {"FCM" ,13600 ,EDID_QUIRK_PREFER_LARGE_75 | EDID_QUIRK_DETAILED_IN_CM }, +/* LGD panel of HP zBook 17 G2, eDP 10 bpc, but reports unknown bpc */ + { "LGD", 764, EDID_QUIRK_FORCE_10BPC }, +/* LG Philips LCD LP154W01-A5 */ { "LPL", 0, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE }, { "LPL", 0x2a00, EDID_QUIRK_DETAILED_USE_MAXIMUM_SIZE },
@@ -4174,6 +4179,9 @@ int drm_add_edid_modes(struct drm_connecif (quirks &EDID_QUIRK_FORCE_8BPC ) connector->display_info.bpc =8 ; +if (quirks &EDID_QUIRK_FORCE_10BPC ) + connector->display_info.bpc =10 ; +if (quirks &EDID_QUIRK_FORCE_12BPC ) connector->display_info.bpc =12 ;
Greg Kroah-Hartman
maintainerPATCH 189/197 NFS: Use GFP_NOIO for two allocations in writeback
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Benjamin Coddington <[email protected]>
commit ae97aa524ef495b6276fd26f5d5449fb22975d7c upstream.
Prevent a deadlock that can occur if we wait on allocations that try to write back our pages.
--- fs/nfs/pagelist.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-)
fs/nfs/pagelist.c +11 -4
@@ -29,13 +29,14 @@static struct kmem_cache *nfs_page_cachep;static const struct rpc_call_ops nfs_pgio_common_ops; -static bool nfs_pgarray_set (struct nfs_page_array *p,unsigned int pagecount) +static bool nfs_pgarray_set (struct nfs_page_array *p,unsigned int pagecount, +gfp_t gfp_flags) { p->npages = pagecount;if (pagecount <=ARRAY_SIZE (p->page_array)) p->pagevec = p->page_array;else { - p->pagevec =kcalloc (pagecount,sizeof (struct page *),GFP_KERNEL ); + p->pagevec =kcalloc (pagecount,sizeof (struct page *), gfp_flags);if (!p->pagevec) p->npages =0 ; }
@@ -681,6 +682,7 @@ void nfs_pageio_init(struct nfs_pageio_d {struct nfs_pgio_mirror *new;int i; +gfp_t gfp_flags =GFP_KERNEL ; desc->pg_moreio =0 ; desc->pg_inode = inode;
@@ -700,8 +702,10 @@ void nfs_pageio_init(struct nfs_pageio_dif (pg_ops->pg_get_mirror_count) {/* until we have a request, we don't have an lseg and no * idea how many mirrors there will be */ +if (desc->pg_rw_ops->rw_mode ==FMODE_WRITE ) + gfp_flags =GFP_NOIO ; new =kcalloc (NFS_PAGEIO_DESCRIPTOR_MIRROR_MAX , -sizeof (struct nfs_pgio_mirror ),GFP_KERNEL ); +sizeof (struct nfs_pgio_mirror ), gfp_flags); desc->pg_mirrors_dynamic = new; desc->pg_mirrors = new;
@@ -755,9 +759,12 @@ int nfs_generic_pgio(struct nfs_pageio_dstruct list_head *head = &mirror->pg_list;struct nfs_commit_info cinfo;unsigned int pagecount, pageused; +gfp_t gfp_flags =GFP_KERNEL ; pagecount =nfs_page_array_len (mirror->pg_base, mirror->pg_count); -if (!nfs_pgarray_set (&hdr->page_array, pagecount)) { +if (desc->pg_rw_ops->rw_mode ==FMODE_WRITE ) + gfp_flags =GFP_NOIO ; +if (!nfs_pgarray_set (&hdr->page_array, pagecount, gfp_flags)) {nfs_pgio_error (hdr); desc->pg_error = -ENOMEM ;return desc->pg_error;
Greg Kroah-Hartman
maintainerPATCH 165/197 MIPS: Loongson-3: Select MIPS_L1_CACHE_SHIFT_6
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Huacai Chen <[email protected]>
commit 17c99d9421695a0e0de18bf1e7091d859e20ec1d upstream.
Some newer Loongson-3 have 64 bytes cache lines, so select MIPS_L1_CACHE_SHIFT_6.
Patchwork: https://patchwork.linux-mips.org/patch/15755/
--- arch/mips/Kconfig | 1 + 1 file changed, 1 insertion(+)
arch/mips/Kconfig +1 -0
@@ -1373,6 +1373,7 @@ config CPU_LOONGSON3 select WEAK_ORDERING select WEAK_REORDERING_BEYOND_LLSC select MIPS_PGD_C0_CONTEXT + select MIPS_L1_CACHE_SHIFT_6 select GPIOLIB help The Loongson 3 processor implements the MIPS64R2 instruction
Greg Kroah-Hartman
maintainerPATCH 164/197 nvme: unmap CMB and remove sysfs file in reset path
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Jon Derrick <[email protected]>
commit f63572dff1421b6ca6abce71d46e03411e605c94 upstream.
CMB doesn't get unmapped until removal while getting remapped on every reset. Add the unmapping and sysfs file removal to the reset path in nvme_pci_disable to match the mapping path in nvme_pci_enable.
--- drivers/nvme/host/pci.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/nvme/host/pci.c +6 -1
@@ -1394,6 +1394,11 @@ static inline void nvme_release_cmb(struif (dev->cmb) {iounmap (dev->cmb); dev->cmb =NULL ; +if (dev->cmbsz) { +sysfs_remove_file_from_group (&dev->ctrl.device->kobj, + &dev_attr_cmb.attr,NULL ); + dev->cmbsz =0 ; + } } }
@@ -1665,6 +1670,7 @@ static void nvme_pci_disable(struct nvme {struct pci_dev *pdev =to_pci_dev (dev->dev); +nvme_release_cmb (dev);pci_free_irq_vectors (pdev);if (pci_is_enabled (pdev)) {
@@ -2062,7 +2068,6 @@ static void nvme_remove(struct pci_dev *nvme_dev_disable (dev, true);nvme_dev_remove_admin (dev);nvme_free_queues (dev,0 ); -nvme_release_cmb (dev);nvme_release_prp_pools (dev);nvme_dev_unmap (dev);nvme_put_ctrl (&dev->ctrl);
Greg Kroah-Hartman
maintainerPATCH 196/197 drm/i915/gvt: Disable access to stolen memory as a guest
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Chris Wilson <[email protected]>
commit 04a68a35ce6d7b54749989f943993020f48fed62 upstream.
Explicitly disable stolen memory when running as a guest in a virtual machine, since the memory is not mediated between clients and reserved entirely for the host. The actual size should be reported as zero, but like every other quirk we want to tell the user what is happening.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99028
--- drivers/gpu/drm/i915/i915_gem_stolen.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/i915_gem_stolen.c +5 -0
@@ -410,6 +410,11 @@ int i915_gem_init_stolen(struct drm_i915return 0 ; } +if (intel_vgpu_active (dev_priv)) { +DRM_INFO ("iGVT-g active, disabling use of stolen memory\n" ); +return 0 ; + } +#ifdef CONFIG_INTEL_IOMMU if (intel_iommu_gfx_mapped &&INTEL_GEN (dev_priv) <8 ) {DRM_INFO ("DMAR active, disabling use of stolen memory\n" );
Greg Kroah-Hartman
maintainerPATCH 197/197 IB/hfi1: Protect the global dev_cntr_names and port_cntr_names
In reply to Greg Kroah-Hartman4.11-stable review patch. If anyone has any objections, please let me know.
------------------
From: Tadeusz Struk <[email protected]>
commit 62eed66e98b4c2286fef2ce5911d8d75b7515f7b upstream.
Protect the global dev_cntr_names and port_cntr_names with the global mutex as they are allocated and freed in a function called per device. Otherwise there is a danger of double free and memory leaks.
--- drivers/infiniband/hw/hfi1/verbs.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-)
drivers/infiniband/hw/hfi1/verbs.c +11 -1
@@ -1524,6 +1524,7 @@ static const char * const driver_cntr_na "DRIVER_EgrHdrFull" }; +static DEFINE_MUTEX (cntr_names_lock);/* protects the *_cntr_names bufers */ static const char **dev_cntr_names;static const char **port_cntr_names;static int num_driver_cntrs =ARRAY_SIZE (driver_cntr_names);
@@ -1578,6 +1579,7 @@ static struct rdma_hw_stats *alloc_hw_st {int i, err; +mutex_lock (&cntr_names_lock);if (!cntr_names_initialized) {struct hfi1_devdata *dd =dd_from_ibdev (ibdev);
@@ -1586,8 +1588,10 @@ static struct rdma_hw_stats *alloc_hw_st num_driver_cntrs, &num_dev_cntrs, &dev_cntr_names); -if (err) +if (err) { +mutex_unlock (&cntr_names_lock);return NULL ; + }for (i =0 ; i < num_driver_cntrs; i++) dev_cntr_names[num_dev_cntrs + i] =
@@ -1601,10 +1605,12 @@ static struct rdma_hw_stats *alloc_hw_stif (err) {kfree (dev_cntr_names); dev_cntr_names =NULL ; +mutex_unlock (&cntr_names_lock);return NULL ; } cntr_names_initialized =1 ; } +mutex_unlock (&cntr_names_lock);if (!port_num) return rdma_alloc_hw_stats_struct(
@@ -1823,9 +1829,13 @@ void hfi1_unregister_ib_device(struct hfdel_timer_sync (&dev->mem_timer);verbs_txreq_exit (dev); +mutex_lock (&cntr_names_lock);kfree (dev_cntr_names);kfree (port_cntr_names); + dev_cntr_names =NULL ; + port_cntr_names =NULL ; cntr_names_initialized =0 ; +mutex_unlock (&cntr_names_lock); }void hfi1_cnp_rcv (struct hfi1_packet *packet)
Quoted 8 lines · Greg Kroah-Hartman
This is the start of the stable review cycle for the 4.11.3 release. There are 197 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 Thu May 25 20:07:44 UTC 2017. Anything received after that time might be too late.
Build results:
total: 145 pass: 145 fail: 0 Qemu test results: total: 122 pass: 122 fail: 0
Details are available at http://kerneltests.org/builders.
Guenter