@@ -11,7 +11,7 @@
|
||||
<Summary>Kernel module allowing to switch dedicated graphics card on Optimus laptops</Summary>
|
||||
<Description>kernel module allowing to switch dedicated graphics card on Optimus laptops</Description>
|
||||
<BuildDependencies>
|
||||
<Dependency version="4.1.7">kernel-module-headers</Dependency>
|
||||
<Dependency version="4.1.8">kernel-module-headers</Dependency>
|
||||
</BuildDependencies>
|
||||
<Archive sha1sum="e282ee682d794e3962baa4dead01917c42571e78" type="targz">https://github.com/Bumblebee-Project/bbswitch/archive/v0.8.tar.gz</Archive>
|
||||
<Patches>
|
||||
@@ -20,7 +20,7 @@
|
||||
<Package>
|
||||
<Name>module-bbswitch</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency version="4.1.7">kernel</Dependency>
|
||||
<Dependency version="4.1.8">kernel</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="library" permanent="true">/lib/modules</Path>
|
||||
@@ -34,6 +34,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="29">
|
||||
<Date>2015-09-23</Date>
|
||||
<Version>0.8</Version>
|
||||
<Comment>Rebuild for kernel-4.1.8.</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="28">
|
||||
<Date>2015-09-18</Date>
|
||||
<Version>0.8</Version>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<Archive sha1sum="e02beac9cc713011551c483ae5f20f065f5b88c7" type="targz" target="i686">http://www.broadcom.com/docs/linux_sta/hybrid-v35-nodebug-pcoem-6_30_223_248.tar.gz</Archive>
|
||||
<Archive sha1sum="bd55f1fdc6b0a4d0a70dc4ba4bb4169a824e238c" type="targz" target="x86_64">http://www.broadcom.com/docs/linux_sta/hybrid-v35_64-nodebug-pcoem-6_30_223_248.tar.gz</Archive>
|
||||
<BuildDependencies>
|
||||
<Dependency version="4.1.7">kernel-module-headers</Dependency>
|
||||
<Dependency version="4.1.8">kernel-module-headers</Dependency>
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<Patch level="1">patch/linux-40.patch</Patch>
|
||||
@@ -30,7 +30,7 @@
|
||||
<Package>
|
||||
<Name>module-broadcom-wl</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency version="4.1.7">kernel</Dependency>
|
||||
<Dependency version="4.1.8">kernel</Dependency>
|
||||
<Dependency release="current">module-broadcom-wl-userspace</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Replaces>
|
||||
@@ -62,6 +62,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="49">
|
||||
<Date>2015-09-23</Date>
|
||||
<Version>6.30.223.248</Version>
|
||||
<Comment>Rebuild for kernel 4.1.8.</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="48">
|
||||
<Date>2015-09-18</Date>
|
||||
<Version>6.30.223.248</Version>
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
<Description>This package provides the kernel modules needed for mouse integration and shared folder support between VirtualBox host and guest systems.</Description>
|
||||
<Archive sha1sum="82194515516139801fdc690198495b043d1c9cbe" type="tarxz">http://source.pisilinux.org/1.0/module-virtualbox-guest-4.3.28.tar.xz</Archive>
|
||||
<BuildDependencies>
|
||||
<Dependency version="4.1.7">kernel-module-headers</Dependency>
|
||||
<Dependency version="4.1.8">kernel-module-headers</Dependency>
|
||||
</BuildDependencies>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>module-virtualbox-guest</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency version="4.1.7">kernel</Dependency>
|
||||
<Dependency version="4.1.8">kernel</Dependency>
|
||||
<Dependency>baselayout</Dependency>
|
||||
<Dependency version="current">module-virtualbox-guest-userspace</Dependency>
|
||||
</RuntimeDependencies>
|
||||
@@ -52,7 +52,14 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="49">
|
||||
<Update release="50">
|
||||
<Date>2015-08-23</Date>
|
||||
<Version>4.3.28</Version>
|
||||
<Comment>Rebuild for kernel-4.1.8.</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="49">
|
||||
<Date>2015-08-18</Date>
|
||||
<Version>4.3.28</Version>
|
||||
<Comment>Rebuild for kernel-4.1.7.</Comment>
|
||||
|
||||
@@ -14,14 +14,14 @@
|
||||
<Description>This package provides the kernel support for VirtualBox.</Description>
|
||||
<Archive sha1sum="8850ebc24e00640835b682a5f8bbc8f05313d2d7" type="tarxz">http://source.pisilinux.org/1.0/module-virtualbox-4.3.28.tar.xz</Archive>
|
||||
<BuildDependencies>
|
||||
<Dependency version="4.1.7">kernel-module-headers</Dependency>
|
||||
<Dependency version="4.1.8">kernel-module-headers</Dependency>
|
||||
</BuildDependencies>
|
||||
</Source>
|
||||
|
||||
<Package>
|
||||
<Name>module-virtualbox</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency version="4.1.7">kernel</Dependency>
|
||||
<Dependency version="4.1.8">kernel</Dependency>
|
||||
<Dependency version="current">module-virtualbox-userspace</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
@@ -47,6 +47,13 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="53">
|
||||
<Date>2015-09-23</Date>
|
||||
<Version>4.3.28</Version>
|
||||
<Comment>Rebuild for kernel-4.1.8.</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="52">
|
||||
<Date>2015-09-18</Date>
|
||||
<Version>4.3.28</Version>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<Description>module-ndiswrapper allows you to use Windows XP drivers for WLAN cards without proper Linux drivers.</Description>
|
||||
<Archive sha1sum="75fbbda677fe91ee07a6f6a8e19b1f3e2479540f" type="targz">http://download.sourceforge.net/ndiswrapper/ndiswrapper-1.59.tar.gz</Archive>
|
||||
<BuildDependencies>
|
||||
<Dependency version="4.1.6">kernel-module-headers</Dependency>
|
||||
<Dependency version="4.1.8">kernel-module-headers</Dependency>
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<Patch>support_kernel-4.0.patch</Patch>
|
||||
@@ -28,7 +28,7 @@
|
||||
<Package>
|
||||
<Name>ndiswrapper</Name>
|
||||
<RuntimeDependencies>
|
||||
<Dependency version="4.1.6">kernel</Dependency>
|
||||
<Dependency version="4.1.8">kernel</Dependency>
|
||||
</RuntimeDependencies>
|
||||
<Files>
|
||||
<Path fileType="library" permanent="true">/lib/modules</Path>
|
||||
@@ -44,7 +44,14 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="2">
|
||||
<Update release="3">
|
||||
<Date>2014-09-23</Date>
|
||||
<Version>1.59</Version>
|
||||
<Comment>Rebuild for kernel-4.1.8.</Comment>
|
||||
<Name>PisiLinux Community</Name>
|
||||
<Email>admins@pisilinux.org</Email>
|
||||
</Update>
|
||||
<Update release="2">
|
||||
<Date>2014-08-18</Date>
|
||||
<Version>1.59</Version>
|
||||
<Comment>Rebuild for kernel-4.1.6.</Comment>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#
|
||||
# Automatically generated file; DO NOT EDIT.
|
||||
# Linux/x86_64 4.1.7 Kernel Configuration
|
||||
# Linux/x86_64 4.1.8 Kernel Configuration
|
||||
#
|
||||
CONFIG_64BIT=y
|
||||
CONFIG_X86_64=y
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,42 @@
|
||||
From cb8cc37f4d38d96552f2c52deb15e511cdacf906 Mon Sep 17 00:00:00 2001
|
||||
From: Caesar Wang <wxt@rock-chips.com>
|
||||
Date: Mon, 6 Jul 2015 11:37:23 +0800
|
||||
Subject: [PATCH] ARM: rockchip: fix broken build
|
||||
|
||||
The following was seen in branch[0] build.
|
||||
|
||||
arch/arm/mach-rockchip/platsmp.c:154:23: error:
|
||||
'rockchip_secondary_startup' undeclared (first use in this function)
|
||||
|
||||
branch[0]:
|
||||
git://git.kernel.org/pub/scm/linux/kernel/git/mmind/linux-rockchip.git
|
||||
v4.3-armsoc/soc
|
||||
|
||||
The broken build is caused by the commit fe4407c0dc58
|
||||
("ARM: rockchip: fix the CPU soft reset").
|
||||
|
||||
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
|
||||
|
||||
The breakage was a result of it being wrongly merged in my branch with
|
||||
the cache invalidation rework from Russell 02b4e2756e01c
|
||||
("ARM: v7 setup function should invalidate L1 cache").
|
||||
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
---
|
||||
arch/arm/mach-rockchip/platsmp.c | 3 +--
|
||||
1 file changed, 1 insertion(+), 2 deletions(-)
|
||||
|
||||
diff --git a/arch/arm/mach-rockchip/platsmp.c b/arch/arm/mach-rockchip/platsmp.c
|
||||
index 7ebd1c1..3e7a4b7 100644
|
||||
--- a/arch/arm/mach-rockchip/platsmp.c
|
||||
+++ b/arch/arm/mach-rockchip/platsmp.c
|
||||
@@ -152,8 +152,7 @@ static int __cpuinit rockchip_boot_secon
|
||||
* */
|
||||
mdelay(1); /* ensure the cpus other than cpu0 to startup */
|
||||
|
||||
- writel(virt_to_phys(rockchip_secondary_startup),
|
||||
- sram_base_addr + 8);
|
||||
+ writel(virt_to_phys(secondary_startup), sram_base_addr + 8);
|
||||
writel(0xDEADBEAF, sram_base_addr + 4);
|
||||
dsb_sev();
|
||||
}
|
||||
@@ -0,0 +1,81 @@
|
||||
From 2110d70c5e58326a10e93cfefdc0b3686e2ada12 Mon Sep 17 00:00:00 2001
|
||||
From: Borislav Petkov <bp@suse.de>
|
||||
Date: Sat, 8 Aug 2015 10:46:02 +0200
|
||||
Subject: cpu/cacheinfo: Fix teardown path
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
Philip Müller reported a hang when booting 32-bit 4.1 kernel on an AMD
|
||||
box. A fragment of the splat was enough to pinpoint the issue:
|
||||
|
||||
task: f58e0000 ti: f58e8000 task.ti: f58e800
|
||||
EIP: 0060:[<c135a903>] EFLAGS: 00010206 CPU: 0
|
||||
EIP is at free_cache_attributes+0x83/0xd0
|
||||
EAX: 00000001 EBX: f589d46c ECX: 00000090 EDX: 360c2000
|
||||
ESI: 00000000 EDI: c1724a80 EBP: f58e9ec0 ESP: f58e9ea0
|
||||
DS: 007b ES: 007b FS: 00d8 GS: 00e0 SS: 0068
|
||||
CR0: 8005003b CR2: 000000ac CR3: 01731000 CR4: 000006d0
|
||||
|
||||
cache_shared_cpu_map_setup() did check sibling CPUs cacheinfo descriptor
|
||||
while the respective teardown path cache_shared_cpu_map_remove() didn't.
|
||||
Fix that.
|
||||
|
||||
>From tglx's version: to be on the safe side, move the cacheinfo
|
||||
descriptor check to free_cache_attributes(), thus cleaning up the
|
||||
hotplug path a little and making this even more robust.
|
||||
|
||||
Reported-and-tested-by: Philip Müller <philm@manjaro.org>
|
||||
Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
|
||||
Acked-by: Sudeep Holla <sudeep.holla@arm.com>
|
||||
Cc: <stable@vger.kernel.org> # 4.1
|
||||
Cc: Andre Przywara <andre.przywara@arm.com>
|
||||
Cc: Guenter Roeck <linux@roeck-us.net>
|
||||
Cc: "H. Peter Anvin" <hpa@zytor.com>
|
||||
Cc: Ingo Molnar <mingo@redhat.com>
|
||||
Cc: linux-kernel@vger.kernel.org
|
||||
Cc: manjaro-dev@manjaro.org
|
||||
Cc: Philip Müller <philm@manjaro.org>
|
||||
Link: https://lkml.kernel.org/r/55B47BB8.6080202@manjaro.org
|
||||
Signed-off-by: Borislav Petkov <bp@suse.de>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
diff --git a/drivers/base/cacheinfo.c b/drivers/base/cacheinfo.c
|
||||
index 764280a..e9fd32e 100644
|
||||
--- a/drivers/base/cacheinfo.c
|
||||
+++ b/drivers/base/cacheinfo.c
|
||||
@@ -148,7 +148,11 @@ static void cache_shared_cpu_map_remove(unsigned int cpu)
|
||||
|
||||
if (sibling == cpu) /* skip itself */
|
||||
continue;
|
||||
+
|
||||
sib_cpu_ci = get_cpu_cacheinfo(sibling);
|
||||
+ if (!sib_cpu_ci->info_list)
|
||||
+ continue;
|
||||
+
|
||||
sib_leaf = sib_cpu_ci->info_list + index;
|
||||
cpumask_clear_cpu(cpu, &sib_leaf->shared_cpu_map);
|
||||
cpumask_clear_cpu(sibling, &this_leaf->shared_cpu_map);
|
||||
@@ -159,6 +163,9 @@ static void cache_shared_cpu_map_remove(unsigned int cpu)
|
||||
|
||||
static void free_cache_attributes(unsigned int cpu)
|
||||
{
|
||||
+ if (!per_cpu_cacheinfo(cpu))
|
||||
+ return;
|
||||
+
|
||||
cache_shared_cpu_map_remove(cpu);
|
||||
|
||||
kfree(per_cpu_cacheinfo(cpu));
|
||||
@@ -514,8 +521,7 @@ static int cacheinfo_cpu_callback(struct notifier_block *nfb,
|
||||
break;
|
||||
case CPU_DEAD:
|
||||
cache_remove_dev(cpu);
|
||||
- if (per_cpu_cacheinfo(cpu))
|
||||
- free_cache_attributes(cpu);
|
||||
+ free_cache_attributes(cpu);
|
||||
break;
|
||||
}
|
||||
return notifier_from_errno(rc);
|
||||
--
|
||||
cgit v0.10.2
|
||||
|
||||
@@ -0,0 +1,115 @@
|
||||
From bbb2dddd30f6b2079dca3e805bceb55328d7cb53 Mon Sep 17 00:00:00 2001
|
||||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Thu, 10 Sep 2015 20:13:47 +0100
|
||||
Subject: [PATCH] aufs mmap: bugfix, concurrent msync triggers NULL pointer
|
||||
dereference
|
||||
|
||||
On Thu, 2015-09-03 at 01:21 +0900, sfjro@users.sourceforge.net wrote:
|
||||
> sfjro@users.sourceforge.net:
|
||||
> >
|
||||
> > Xavier Chantry:
|
||||
> > > I can reproduce the bug on all my machines, so it shouldn't be too
|
||||
> > > difficult to reproduce. Applying the following hunk is enough to trigger
|
||||
> > > the bug.
|
||||
> >
|
||||
> > Unfortunately still I don't have enough time.
|
||||
> > I understand this bug has a big impact for you and any other user who
|
||||
> > have applied aufs3-mmap.patch. As soon as I get the time, I'm sure I
|
||||
> > will dive into this problem.
|
||||
>
|
||||
> I've thought about the problem a little (still I'm busy).
|
||||
> It looks like a race condition around mm->mmap_sem.
|
||||
>
|
||||
> - get_file(file);
|
||||
> + vma_get_file(vma);
|
||||
> up_read(&mm->mmap_sem);
|
||||
> error = vfs_fsync(file, 0);
|
||||
> - fput(file);
|
||||
> + vma_fput(vma);
|
||||
> if (error || start >= end)
|
||||
> goto out;
|
||||
> down_read(&mm->mmap_sem);
|
||||
>
|
||||
> Since this fput/vma_fput is between up(mmap_sem) and down(mmap_sem),
|
||||
> vma_fput() is not protected, and got vm_file NULL unexpectedly. It
|
||||
> means vma->vm_file is changed (or being changed) by someone else (other
|
||||
> thread in your case) after up_read(&mm->mmap_sem). This is surely a bug
|
||||
> in aufs[34]-mmap.patch. It shoule be done such like this essentially.
|
||||
> get_file(file);
|
||||
> pr = vma->vm_prfile;
|
||||
> ;;;
|
||||
> fput(file);
|
||||
> if (pr)
|
||||
> fput(pr);
|
||||
>
|
||||
> The fix will look a little smarter than above.
|
||||
> I hope I can post the fix in a few weeks.
|
||||
|
||||
I don't see any need for holding a reference to vma->vm_prfile here.
|
||||
|
||||
There is also a similar bug in madvise_remove() which I can trigger by
|
||||
calling madvise(..., MADV_REMOVE) in parallel with another thread that
|
||||
does mmap() and munmap() of the same address range.
|
||||
|
||||
This patch against 3.16 fixes both for me:
|
||||
|
||||
From: Ben Hutchings <ben@decadent.org.uk>
|
||||
Date: Thu, 10 Sep 2015 02:19:59 +0100
|
||||
Subject: aufs3: mmap: Fix races in madvise_remove() and sys_msync()
|
||||
Bug-Debian: https://bugs.debian.org/796036
|
||||
|
||||
In madvise_remove() and sys_msync() we drop the mmap_sem before
|
||||
dropping references to the mapped file(s). As soon as we drop the
|
||||
mmap_sem, the vma we got them from might be destroyed by another
|
||||
thread, so calling vma_do_fput() is a possible use-after-free.
|
||||
|
||||
In these cases we don't actually need a reference to the aufs file, so
|
||||
revert to using get_file() and fput() directly.
|
||||
|
||||
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
|
||||
Signed-off-by: J. R. Okajima <hooanon05g@gmail.com>
|
||||
(cherry picked from commit 9a6882cd8c6ec75a6393f80e743bf6b2bb91420e)
|
||||
|
||||
Conflicts:
|
||||
mm/msync.c
|
||||
---
|
||||
mm/madvise.c | 4 ++--
|
||||
mm/msync.c | 4 ++--
|
||||
2 files changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
diff --git a/mm/madvise.c b/mm/madvise.c
|
||||
index 1ebf71b..d551475 100644
|
||||
--- a/mm/madvise.c
|
||||
+++ b/mm/madvise.c
|
||||
@@ -320,12 +320,12 @@ static long madvise_remove(struct vm_area_struct *vma,
|
||||
* vma's reference to the file) can go away as soon as we drop
|
||||
* mmap_sem.
|
||||
*/
|
||||
- vma_get_file(vma);
|
||||
+ get_file(f);
|
||||
up_read(¤t->mm->mmap_sem);
|
||||
error = vfs_fallocate(f,
|
||||
FALLOC_FL_PUNCH_HOLE | FALLOC_FL_KEEP_SIZE,
|
||||
offset, end - start);
|
||||
- vma_fput(vma);
|
||||
+ fput(f);
|
||||
down_read(¤t->mm->mmap_sem);
|
||||
return error;
|
||||
}
|
||||
diff --git a/mm/msync.c b/mm/msync.c
|
||||
index 5c24c54..bb04d53 100644
|
||||
--- a/mm/msync.c
|
||||
+++ b/mm/msync.c
|
||||
@@ -84,10 +84,10 @@ SYSCALL_DEFINE3(msync, unsigned long, start, size_t, len, int, flags)
|
||||
start = vma->vm_end;
|
||||
if ((flags & MS_SYNC) && file &&
|
||||
(vma->vm_flags & VM_SHARED)) {
|
||||
- vma_get_file(vma);
|
||||
+ get_file(file);
|
||||
up_read(&mm->mmap_sem);
|
||||
error = vfs_fsync_range(file, fstart, fend, 1);
|
||||
- vma_fput(vma);
|
||||
+ fput(file);
|
||||
if (error || start >= end)
|
||||
goto out;
|
||||
down_read(&mm->mmap_sem);
|
||||
@@ -14,72 +14,6 @@
|
||||
###
|
||||
### Stable Queue
|
||||
###
|
||||
stable-x86-ldt-make-modify_ldt-synchronous.patch
|
||||
stable-x86-ldt-correct-ldt-access-in-single-stepping-logic.patch
|
||||
stable-x86-ldt-correct-fpu-emulation-access-to-ldt.patch
|
||||
stable-x86-ldt-further-fix-fpu-emulation.patch
|
||||
stable-drm-radeon-don-t-link-train-displayport-on-hpd-until-we-get-the-dpcd.patch
|
||||
stable-drm-i915-apply-the-pci_d0-d3-hibernation-workaround-everywhere-on-pre-gen6.patch
|
||||
stable-drm-i915-check-dp-link-status-on-long-hpd-too.patch
|
||||
stable-drm-radeon-atom-send-out-the-full-aux-address.patch
|
||||
stable-drm-radeon-native-send-out-the-full-aux-address.patch
|
||||
stable-drm-radeon-fix-hdmi-quantization_range-for-pre-dce5-asics.patch
|
||||
stable-drm-i915-preserve-ssc-earlier.patch
|
||||
stable-drm-qxl-validate-monitors-config-modes.patch
|
||||
stable-drm-i915-allow-dsi-dual-link-to-be-configured-on-any-pipe.patch
|
||||
stable-drm-i915-always-mark-the-object-as-dirty-when-used-by-the-gpu.patch
|
||||
stable-drm-i915-limit-the-number-of-loops-for-reading-a-split-64bit-register.patch
|
||||
stable-s390-sclp-fix-compile-error.patch
|
||||
stable-s390-setup-fix-novx-parameter.patch
|
||||
stable-iio-bmg160-iio_buffer-and-iio_triggered_buffer-are-required.patch
|
||||
stable-iio-event-remove-negative-error-code-from-iio_event_poll.patch
|
||||
stable-iio-industrialio-buffer-fix-iio_buffer_poll-return-value.patch
|
||||
stable-iio-adis16400-fix-adis16448-gyroscope-scale.patch
|
||||
stable-iio-add-inverse-unit-conversion-macros.patch
|
||||
stable-iio-adis16480-fix-scale-factors.patch
|
||||
stable-sched-fix-cpu_active_mask-cpu_online_mask-race.patch
|
||||
stable-staging-comedi-adl_pci7x3x-fix-digital-output-on-pci-7230.patch
|
||||
stable-staging-comedi-usbduxsigma-don-t-clobber-ai_timer-in-command-test.patch
|
||||
stable-staging-comedi-usbduxsigma-don-t-clobber-ao_timer-in-command-test.patch
|
||||
stable-pm-clk-don-t-return-int-on-__pm_clk_enable.patch
|
||||
stable-clk-rockchip-rk3288-add-clk_set_rate_parent-to-sclk_mac.patch
|
||||
stable-clk-exynos4-fix-wrong-clock-for-exynos4x12-adc.patch
|
||||
stable-clk-s5pv210-add-missing-call-to.patch
|
||||
stable-clk-pistachio-fix-override-of-clk-pll-settings-from-boot-loader.patch
|
||||
stable-clk-pistachio-correct-critical-clock-list.patch
|
||||
stable-clk-versatile-off-by-one-in-clk_sp810_timerclken_of_get.patch
|
||||
stable-clk-pxa-fix-core-frequency-reporting-unit.patch
|
||||
stable-clk-qcom-set-clk_set_rate_parent-on-ce1-clocks.patch
|
||||
stable-clk-qcom-fix-msm8916-prng-clock-enable-bit.patch
|
||||
stable-pci-fix-ti816x-class-code-quirk.patch
|
||||
stable-pci-add-dev_flags-bit-to-access-vpd-through-function-0.patch
|
||||
stable-pci-add-vpd-function-0-quirk-for-intel-ethernet-devices.patch
|
||||
stable-pci-disable-async-suspend-resume-for-jmicron-multi-function-sata-ahci.patch
|
||||
stable-spi-bcm2835-set-up-spi-mode-before-asserting-cs-gpio.patch
|
||||
stable-spi-fix-regression-in-spi-bitbang-txrx.h.patch
|
||||
stable-spi-sh-msiof-fix-fifo-size-to-64-word-from-256-word.patch
|
||||
stable-spi-img-spfi-check-for-timeout-error-before-proceeding.patch
|
||||
stable-spi-img-spfi-fix-multiple-calls-to-request-gpio.patch
|
||||
stable-spi-img-spfi-fix-kbuild-test-robot-warning.patch
|
||||
stable-spi-dw-allow-interface-drivers-to-limit-data-i-o-to-word-sizes.patch
|
||||
stable-usb-symbolserial-use-usb_get_serial_port_data.patch
|
||||
stable-usb-qcserial-add-hp-lt4111-lte-ev-do-hspa-gobi-4g-module.patch
|
||||
stable-usb-ftdi_sio-added-custom-pid-for-customware-products.patch
|
||||
stable-usb-pl2303-fix-baud-rate-divisor-calculations.patch
|
||||
stable-libxfs-readahead-of-dir3-data-blocks-should-use-the-read-verifier.patch
|
||||
stable-xfs-fix-xfs_attr_leafblock-definition.patch
|
||||
stable-xfs-fix-file-type-directory-corruption-for-btree-directories.patch
|
||||
stable-usb-gadget-m66592-udc-forever-loop-in-set_feature.patch
|
||||
stable-doc-usb-gadget-testing-using-the-updated-testusb.c.patch
|
||||
stable-usb-dwc3-ep0-fix-mem-corruption-on-out-transfers-of-more-than-512-bytes.patch
|
||||
stable-usb-gadget-f_uac2-finalize-wmaxpacketsize-according-to-bandwidth.patch
|
||||
stable-usb-host-ehci-sys-delete-useless-bus_to_hcd-conversion.patch
|
||||
stable-tty-serial-men_z135_uart.c-fix-race-between-irq-and-set_termios.patch
|
||||
stable-asoc-rt5640-fix-line-out-no-sound-issue.patch
|
||||
stable-asoc-samsung-remove-redundant-arndale_audio_remove.patch
|
||||
stable-asoc-adav80x-remove-.read_flag_mask-setting-from-adav80x_regmap_config.patch
|
||||
stable-asoc-arizona-fix-gain-settings-of-fll-in-free-run-mode.patch
|
||||
stable-asoc-arizona-poll-for-fll-clock-ok-rather-than-use-interrupts.patch
|
||||
|
||||
###
|
||||
### Arch x86
|
||||
@@ -108,6 +42,9 @@ Revert-cpufreq-pcc-Enable-autoload-of-pcc-cpufreq-fo.patch
|
||||
### Core
|
||||
###
|
||||
|
||||
# amd cpu boot crash (mga#16527)
|
||||
cpu-cacheinfo-Fix-teardown-path.patch
|
||||
|
||||
###
|
||||
### i2c
|
||||
###
|
||||
@@ -193,6 +130,8 @@ scsi-Fix-NULL-pointer-dereference-in-RTPM-of-block-layer.patch
|
||||
# aufs from: http://aufs.sourceforge.net/ (mga#8314)
|
||||
fs-aufs4.patch
|
||||
fs-aufs4-modular.patch
|
||||
# CVE pending
|
||||
fs-aufs-CVE-pending.patch
|
||||
|
||||
# ext4
|
||||
fs-Revert-ext4-remove-block_device_ejected.patch
|
||||
@@ -401,6 +340,7 @@ video-mageia-logo.patch
|
||||
###
|
||||
### ARM
|
||||
###
|
||||
arm-rockchip-fix-broken-build.patch
|
||||
|
||||
###
|
||||
### IA64
|
||||
|
||||
-31
@@ -1,31 +0,0 @@
|
||||
From 9d8352864907f0ad76124c5b28f65b5a382d7d7c Mon Sep 17 00:00:00 2001
|
||||
From: Axel Lin <axel.lin@ingics.com>
|
||||
Date: Fri, 14 Aug 2015 17:54:07 +0800
|
||||
Subject: ASoC: adav80x: Remove .read_flag_mask setting from adav80x_regmap_config
|
||||
|
||||
From: Axel Lin <axel.lin@ingics.com>
|
||||
|
||||
commit 9d8352864907f0ad76124c5b28f65b5a382d7d7c upstream.
|
||||
|
||||
Don't set .read_flag_mask for adav803, it's for adav801 only.
|
||||
|
||||
Fixes: 0c2d69645628 ("ASoC: adav80x: Split SPI and I2C code into different modules")
|
||||
Signed-off-by: Axel Lin <axel.lin@ingics.com>
|
||||
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
sound/soc/codecs/adav80x.c | 1 -
|
||||
1 file changed, 1 deletion(-)
|
||||
|
||||
--- a/sound/soc/codecs/adav80x.c
|
||||
+++ b/sound/soc/codecs/adav80x.c
|
||||
@@ -864,7 +864,6 @@ const struct regmap_config adav80x_regma
|
||||
.val_bits = 8,
|
||||
.pad_bits = 1,
|
||||
.reg_bits = 7,
|
||||
- .read_flag_mask = 0x01,
|
||||
|
||||
.max_register = ADAV80X_PLL_OUTE,
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
From 1cf5a330c05ae37a0a98ac7c9800a6f50d5579ec Mon Sep 17 00:00:00 2001
|
||||
From: Nikesh Oswal <Nikesh.Oswal@wolfsonmicro.com>
|
||||
Date: Wed, 19 Aug 2015 16:02:24 +0100
|
||||
Subject: ASoC: arizona: Fix gain settings of FLL in free-run mode
|
||||
|
||||
From: Nikesh Oswal <Nikesh.Oswal@wolfsonmicro.com>
|
||||
|
||||
commit 1cf5a330c05ae37a0a98ac7c9800a6f50d5579ec upstream.
|
||||
|
||||
The wrong register was used to set the gain of ref loop, when changing
|
||||
the FLL output on an active FLL. This patch corrects the offset of the
|
||||
gain register.
|
||||
|
||||
Signed-off-by: Nikesh Oswal <Nikesh.Oswal@wolfsonmicro.com>
|
||||
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
sound/soc/codecs/arizona.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/sound/soc/codecs/arizona.c
|
||||
+++ b/sound/soc/codecs/arizona.c
|
||||
@@ -1912,7 +1912,7 @@ static int arizona_enable_fll(struct ari
|
||||
|
||||
if (already_enabled) {
|
||||
/* Facilitate smooth refclk across the transition */
|
||||
- regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x7,
|
||||
+ regmap_update_bits_async(fll->arizona->regmap, fll->base + 0x9,
|
||||
ARIZONA_FLL1_GAIN_MASK, 0);
|
||||
regmap_update_bits_async(fll->arizona->regmap, fll->base + 1,
|
||||
ARIZONA_FLL1_FREERUN,
|
||||
-141
@@ -1,141 +0,0 @@
|
||||
From 0e7659712836ca59b4735bc5cc94de38698a5e01 Mon Sep 17 00:00:00 2001
|
||||
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
|
||||
Date: Tue, 25 Aug 2015 12:43:48 +0100
|
||||
Subject: ASoC: arizona: Poll for FLL clock OK rather than use interrupts
|
||||
|
||||
From: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
|
||||
|
||||
commit 0e7659712836ca59b4735bc5cc94de38698a5e01 upstream.
|
||||
|
||||
The extcon driver takes the DAPM mutex from within the interrupt thread
|
||||
in several places, which makes it possible to get into a situation where
|
||||
the interrupt thread is blocked waiting on the DAPM mutex whilst a DAPM
|
||||
sequence is running which is attempting to configure the FLL. In this
|
||||
case the FLL completion can't be completed as as the IRQ handler is
|
||||
ONE_SHOT, which cause the FLL lock to use the full time out (250mS) and
|
||||
report that the process timed out.
|
||||
|
||||
It is not really practical to make the extcon driver not take the DAPM
|
||||
mutex from within the interrupt thread, at least not without extensive
|
||||
modification. So this patch fixes the issue by switching the wait for
|
||||
the FLL lock to polling. A few fast polls are done first as the FLL
|
||||
should lock quickly for a good quality reference clock, (indeed it hits
|
||||
on the first poll on my system) and it will poll every 20mS after that
|
||||
until it times out.
|
||||
|
||||
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
sound/soc/codecs/arizona.c | 47 ++++++++++++++++++---------------------------
|
||||
sound/soc/codecs/arizona.h | 1
|
||||
2 files changed, 19 insertions(+), 29 deletions(-)
|
||||
|
||||
--- a/sound/soc/codecs/arizona.c
|
||||
+++ b/sound/soc/codecs/arizona.c
|
||||
@@ -1610,17 +1610,6 @@ int arizona_init_dai(struct arizona_priv
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(arizona_init_dai);
|
||||
|
||||
-static irqreturn_t arizona_fll_clock_ok(int irq, void *data)
|
||||
-{
|
||||
- struct arizona_fll *fll = data;
|
||||
-
|
||||
- arizona_fll_dbg(fll, "clock OK\n");
|
||||
-
|
||||
- complete(&fll->ok);
|
||||
-
|
||||
- return IRQ_HANDLED;
|
||||
-}
|
||||
-
|
||||
static struct {
|
||||
unsigned int min;
|
||||
unsigned int max;
|
||||
@@ -1902,10 +1891,11 @@ static int arizona_is_enabled_fll(struct
|
||||
static int arizona_enable_fll(struct arizona_fll *fll)
|
||||
{
|
||||
struct arizona *arizona = fll->arizona;
|
||||
- unsigned long time_left;
|
||||
bool use_sync = false;
|
||||
int already_enabled = arizona_is_enabled_fll(fll);
|
||||
struct arizona_fll_cfg cfg;
|
||||
+ int i;
|
||||
+ unsigned int val;
|
||||
|
||||
if (already_enabled < 0)
|
||||
return already_enabled;
|
||||
@@ -1964,9 +1954,6 @@ static int arizona_enable_fll(struct ari
|
||||
if (!already_enabled)
|
||||
pm_runtime_get(arizona->dev);
|
||||
|
||||
- /* Clear any pending completions */
|
||||
- try_wait_for_completion(&fll->ok);
|
||||
-
|
||||
regmap_update_bits_async(arizona->regmap, fll->base + 1,
|
||||
ARIZONA_FLL1_ENA, ARIZONA_FLL1_ENA);
|
||||
if (use_sync)
|
||||
@@ -1978,10 +1965,24 @@ static int arizona_enable_fll(struct ari
|
||||
regmap_update_bits_async(arizona->regmap, fll->base + 1,
|
||||
ARIZONA_FLL1_FREERUN, 0);
|
||||
|
||||
- time_left = wait_for_completion_timeout(&fll->ok,
|
||||
- msecs_to_jiffies(250));
|
||||
- if (time_left == 0)
|
||||
+ arizona_fll_dbg(fll, "Waiting for FLL lock...\n");
|
||||
+ val = 0;
|
||||
+ for (i = 0; i < 15; i++) {
|
||||
+ if (i < 5)
|
||||
+ usleep_range(200, 400);
|
||||
+ else
|
||||
+ msleep(20);
|
||||
+
|
||||
+ regmap_read(arizona->regmap,
|
||||
+ ARIZONA_INTERRUPT_RAW_STATUS_5,
|
||||
+ &val);
|
||||
+ if (val & (ARIZONA_FLL1_CLOCK_OK_STS << (fll->id - 1)))
|
||||
+ break;
|
||||
+ }
|
||||
+ if (i == 15)
|
||||
arizona_fll_warn(fll, "Timed out waiting for lock\n");
|
||||
+ else
|
||||
+ arizona_fll_dbg(fll, "FLL locked (%d polls)\n", i);
|
||||
|
||||
return 0;
|
||||
}
|
||||
@@ -2066,11 +2067,8 @@ EXPORT_SYMBOL_GPL(arizona_set_fll);
|
||||
int arizona_init_fll(struct arizona *arizona, int id, int base, int lock_irq,
|
||||
int ok_irq, struct arizona_fll *fll)
|
||||
{
|
||||
- int ret;
|
||||
unsigned int val;
|
||||
|
||||
- init_completion(&fll->ok);
|
||||
-
|
||||
fll->id = id;
|
||||
fll->base = base;
|
||||
fll->arizona = arizona;
|
||||
@@ -2092,13 +2090,6 @@ int arizona_init_fll(struct arizona *ari
|
||||
snprintf(fll->clock_ok_name, sizeof(fll->clock_ok_name),
|
||||
"FLL%d clock OK", id);
|
||||
|
||||
- ret = arizona_request_irq(arizona, ok_irq, fll->clock_ok_name,
|
||||
- arizona_fll_clock_ok, fll);
|
||||
- if (ret != 0) {
|
||||
- dev_err(arizona->dev, "Failed to get FLL%d clock OK IRQ: %d\n",
|
||||
- id, ret);
|
||||
- }
|
||||
-
|
||||
regmap_update_bits(arizona->regmap, fll->base + 1,
|
||||
ARIZONA_FLL1_FREERUN, 0);
|
||||
|
||||
--- a/sound/soc/codecs/arizona.h
|
||||
+++ b/sound/soc/codecs/arizona.h
|
||||
@@ -233,7 +233,6 @@ struct arizona_fll {
|
||||
int id;
|
||||
unsigned int base;
|
||||
unsigned int vco_mult;
|
||||
- struct completion ok;
|
||||
|
||||
unsigned int fout;
|
||||
int sync_src;
|
||||
-89
@@ -1,89 +0,0 @@
|
||||
From 9b850ca4f1c5acd7fcbbd4b38a2d27132801a8d5 Mon Sep 17 00:00:00 2001
|
||||
From: John Lin <john.lin@realtek.com>
|
||||
Date: Tue, 11 Aug 2015 14:27:25 +0800
|
||||
Subject: ASoC: rt5640: fix line out no sound issue
|
||||
|
||||
From: John Lin <john.lin@realtek.com>
|
||||
|
||||
commit 9b850ca4f1c5acd7fcbbd4b38a2d27132801a8d5 upstream.
|
||||
|
||||
The power for line out was not turned on when line out is enabled.
|
||||
So we add "LOUT amp" widget to turn on the power for line out.
|
||||
|
||||
Signed-off-by: John Lin <john.lin@realtek.com>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
sound/soc/codecs/rt5640.c | 40 +++++++++++++++++++++++++++++++++++++---
|
||||
1 file changed, 37 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/sound/soc/codecs/rt5640.c
|
||||
+++ b/sound/soc/codecs/rt5640.c
|
||||
@@ -985,6 +985,35 @@ static int rt5640_hp_event(struct snd_so
|
||||
return 0;
|
||||
}
|
||||
|
||||
+static int rt5640_lout_event(struct snd_soc_dapm_widget *w,
|
||||
+ struct snd_kcontrol *kcontrol, int event)
|
||||
+{
|
||||
+ struct snd_soc_codec *codec = snd_soc_dapm_to_codec(w->dapm);
|
||||
+
|
||||
+ switch (event) {
|
||||
+ case SND_SOC_DAPM_POST_PMU:
|
||||
+ hp_amp_power_on(codec);
|
||||
+ snd_soc_update_bits(codec, RT5640_PWR_ANLG1,
|
||||
+ RT5640_PWR_LM, RT5640_PWR_LM);
|
||||
+ snd_soc_update_bits(codec, RT5640_OUTPUT,
|
||||
+ RT5640_L_MUTE | RT5640_R_MUTE, 0);
|
||||
+ break;
|
||||
+
|
||||
+ case SND_SOC_DAPM_PRE_PMD:
|
||||
+ snd_soc_update_bits(codec, RT5640_OUTPUT,
|
||||
+ RT5640_L_MUTE | RT5640_R_MUTE,
|
||||
+ RT5640_L_MUTE | RT5640_R_MUTE);
|
||||
+ snd_soc_update_bits(codec, RT5640_PWR_ANLG1,
|
||||
+ RT5640_PWR_LM, 0);
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ return 0;
|
||||
+ }
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static int rt5640_hp_power_event(struct snd_soc_dapm_widget *w,
|
||||
struct snd_kcontrol *kcontrol, int event)
|
||||
{
|
||||
@@ -1180,13 +1209,16 @@ static const struct snd_soc_dapm_widget
|
||||
0, rt5640_spo_l_mix, ARRAY_SIZE(rt5640_spo_l_mix)),
|
||||
SND_SOC_DAPM_MIXER("SPOR MIX", SND_SOC_NOPM, 0,
|
||||
0, rt5640_spo_r_mix, ARRAY_SIZE(rt5640_spo_r_mix)),
|
||||
- SND_SOC_DAPM_MIXER("LOUT MIX", RT5640_PWR_ANLG1, RT5640_PWR_LM_BIT, 0,
|
||||
+ SND_SOC_DAPM_MIXER("LOUT MIX", SND_SOC_NOPM, 0, 0,
|
||||
rt5640_lout_mix, ARRAY_SIZE(rt5640_lout_mix)),
|
||||
SND_SOC_DAPM_SUPPLY_S("Improve HP Amp Drv", 1, SND_SOC_NOPM,
|
||||
0, 0, rt5640_hp_power_event, SND_SOC_DAPM_POST_PMU),
|
||||
SND_SOC_DAPM_PGA_S("HP Amp", 1, SND_SOC_NOPM, 0, 0,
|
||||
rt5640_hp_event,
|
||||
SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
|
||||
+ SND_SOC_DAPM_PGA_S("LOUT amp", 1, SND_SOC_NOPM, 0, 0,
|
||||
+ rt5640_lout_event,
|
||||
+ SND_SOC_DAPM_PRE_PMD | SND_SOC_DAPM_POST_PMU),
|
||||
SND_SOC_DAPM_SUPPLY("HP L Amp", RT5640_PWR_ANLG1,
|
||||
RT5640_PWR_HP_L_BIT, 0, NULL, 0),
|
||||
SND_SOC_DAPM_SUPPLY("HP R Amp", RT5640_PWR_ANLG1,
|
||||
@@ -1501,8 +1533,10 @@ static const struct snd_soc_dapm_route r
|
||||
{"HP R Playback", "Switch", "HP Amp"},
|
||||
{"HPOL", NULL, "HP L Playback"},
|
||||
{"HPOR", NULL, "HP R Playback"},
|
||||
- {"LOUTL", NULL, "LOUT MIX"},
|
||||
- {"LOUTR", NULL, "LOUT MIX"},
|
||||
+
|
||||
+ {"LOUT amp", NULL, "LOUT MIX"},
|
||||
+ {"LOUTL", NULL, "LOUT amp"},
|
||||
+ {"LOUTR", NULL, "LOUT amp"},
|
||||
};
|
||||
|
||||
static const struct snd_soc_dapm_route rt5640_specific_dapm_routes[] = {
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
From 14a500fe1396934c6b3ed8f009459a4723da7862 Mon Sep 17 00:00:00 2001
|
||||
From: Vaishali Thakkar <vthakkar1994@gmail.com>
|
||||
Date: Thu, 20 Aug 2015 22:11:15 +0530
|
||||
Subject: ASoC: samsung: Remove redundant arndale_audio_remove
|
||||
|
||||
From: Vaishali Thakkar <vthakkar1994@gmail.com>
|
||||
|
||||
commit 14a500fe1396934c6b3ed8f009459a4723da7862 upstream.
|
||||
|
||||
There is no use of snd_soc_unregister_card in remove function
|
||||
as devm_snd_soc_register_card in probe function automatically
|
||||
handles it. So, remove use of snd_soc_unregister_card and with
|
||||
this change remove arndale_audio_remove as it is now redundant.
|
||||
|
||||
Signed-off-by: Vaishali Thakkar <vthakkar1994@gmail.com>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
sound/soc/samsung/arndale_rt5631.c | 10 ----------
|
||||
1 file changed, 10 deletions(-)
|
||||
|
||||
--- a/sound/soc/samsung/arndale_rt5631.c
|
||||
+++ b/sound/soc/samsung/arndale_rt5631.c
|
||||
@@ -116,15 +116,6 @@ static int arndale_audio_probe(struct pl
|
||||
return ret;
|
||||
}
|
||||
|
||||
-static int arndale_audio_remove(struct platform_device *pdev)
|
||||
-{
|
||||
- struct snd_soc_card *card = platform_get_drvdata(pdev);
|
||||
-
|
||||
- snd_soc_unregister_card(card);
|
||||
-
|
||||
- return 0;
|
||||
-}
|
||||
-
|
||||
static const struct of_device_id samsung_arndale_rt5631_of_match[] __maybe_unused = {
|
||||
{ .compatible = "samsung,arndale-rt5631", },
|
||||
{ .compatible = "samsung,arndale-alc5631", },
|
||||
@@ -139,7 +130,6 @@ static struct platform_driver arndale_au
|
||||
.of_match_table = of_match_ptr(samsung_arndale_rt5631_of_match),
|
||||
},
|
||||
.probe = arndale_audio_probe,
|
||||
- .remove = arndale_audio_remove,
|
||||
};
|
||||
|
||||
module_platform_driver(arndale_audio_driver);
|
||||
-55
@@ -1,55 +0,0 @@
|
||||
From e323d56eb06b266b77c2b430cb5f1977ba549e03 Mon Sep 17 00:00:00 2001
|
||||
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
|
||||
Date: Fri, 12 Jun 2015 10:53:25 +0900
|
||||
Subject: clk: exynos4: Fix wrong clock for Exynos4x12 ADC
|
||||
|
||||
From: Krzysztof Kozlowski <k.kozlowski@samsung.com>
|
||||
|
||||
commit e323d56eb06b266b77c2b430cb5f1977ba549e03 upstream.
|
||||
|
||||
The TSADC gate clock was used in Exynos4x12 DTSI for exynos-adc driver.
|
||||
However TSADC is present only on Exynos4210 so on Trats2 board (with
|
||||
Exynos4412 SoC) the exynos-adc driver could not be probed:
|
||||
ERROR: could not get clock /adc@126C0000:adc(0)
|
||||
exynos-adc 126c0000.adc: failed getting clock, err = -2
|
||||
exynos-adc: probe of 126c0000.adc failed with error -2
|
||||
|
||||
Instead on Exynos4x12 SoCs the main clock used by Analog to Digital
|
||||
Converter is located in different register and it is named in datasheet
|
||||
as PCLK_ADC. Regardless of the name the purpose of this PCLK_ADC clock
|
||||
is the same as purpose of TSADC from Exynos4210.
|
||||
|
||||
The patch adds gate clock for Exynos4x12 using the proper register so
|
||||
backward compatibility is preserved. This fixes the probe of exynos-adc
|
||||
driver on Exynos4x12 boards and allows accessing sensors connected to it
|
||||
on Trats2 board (ntc,ncp15wb473 AP and battery thermistors).
|
||||
|
||||
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
|
||||
Fixes: c63c57433003 ("ARM: dts: Add ADC's dt data to read raw data for exynos4x12")
|
||||
Reviewed-by: Javier Martinez Canillas <javier.martinez@collabora.co.uk>
|
||||
Acked-by: Tomasz Figa <tomasz.figa@gmail.com>
|
||||
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/clk/samsung/clk-exynos4.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/clk/samsung/clk-exynos4.c
|
||||
+++ b/drivers/clk/samsung/clk-exynos4.c
|
||||
@@ -85,6 +85,7 @@
|
||||
#define DIV_PERIL4 0xc560
|
||||
#define DIV_PERIL5 0xc564
|
||||
#define E4X12_DIV_CAM1 0xc568
|
||||
+#define E4X12_GATE_BUS_FSYS1 0xc744
|
||||
#define GATE_SCLK_CAM 0xc820
|
||||
#define GATE_IP_CAM 0xc920
|
||||
#define GATE_IP_TV 0xc924
|
||||
@@ -1095,6 +1096,7 @@ static struct samsung_gate_clock exynos4
|
||||
0),
|
||||
GATE(CLK_PPMUIMAGE, "ppmuimage", "aclk200", E4X12_GATE_IP_IMAGE, 9, 0,
|
||||
0),
|
||||
+ GATE(CLK_TSADC, "tsadc", "aclk133", E4X12_GATE_BUS_FSYS1, 16, 0, 0),
|
||||
GATE(CLK_MIPI_HSI, "mipi_hsi", "aclk133", GATE_IP_FSYS, 10, 0, 0),
|
||||
GATE(CLK_CHIPID, "chipid", "aclk100", E4X12_GATE_IP_PERIR, 0, 0, 0),
|
||||
GATE(CLK_SYSREG, "sysreg", "aclk100", E4X12_GATE_IP_PERIR, 1,
|
||||
-81
@@ -1,81 +0,0 @@
|
||||
From d31ff5f7f3b142b8d1ebb3da89187c54cdf2bc71 Mon Sep 17 00:00:00 2001
|
||||
From: "Damien.Horsley" <Damien.Horsley@imgtec.com>
|
||||
Date: Wed, 26 Aug 2015 17:11:40 +0100
|
||||
Subject: clk: pistachio: correct critical clock list
|
||||
|
||||
From: "Damien.Horsley" <Damien.Horsley@imgtec.com>
|
||||
|
||||
commit d31ff5f7f3b142b8d1ebb3da89187c54cdf2bc71 upstream.
|
||||
|
||||
Current critical clock list for pistachio enables
|
||||
only mips and sys clocks by default but there are
|
||||
also other clocks that are not claimed by anyone and
|
||||
needs to be enabled by default.
|
||||
|
||||
This patch updates the critical clocks that need
|
||||
to be enabled by default.
|
||||
|
||||
Add a separate struct to distinguish the critical clocks
|
||||
as listed:
|
||||
1.) core clocks:
|
||||
a.) mips clock
|
||||
2.) peripheral system clocks:
|
||||
a.) sys clock
|
||||
b.) sys_bus clock
|
||||
c.) DDR clock
|
||||
d.) ROM clock
|
||||
|
||||
Fixes: b35d7c33419c("CLK: Pistachio: Register core clocks")
|
||||
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
|
||||
Signed-off-by: Ezequiel Garcia <ezequiel.garcia@imgtec.com>
|
||||
Signed-off-by: Damien.Horsley <Damien.Horsley@imgtec.com>
|
||||
Signed-off-by: Govindraj Raja <govindraj.raja@imgtec.com>
|
||||
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/clk/pistachio/clk-pistachio.c | 19 ++++++++++++++-----
|
||||
1 file changed, 14 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/clk/pistachio/clk-pistachio.c
|
||||
+++ b/drivers/clk/pistachio/clk-pistachio.c
|
||||
@@ -159,9 +159,15 @@ PNAME(mux_debug) = { "mips_pll_mux", "rp
|
||||
"wifi_pll_mux", "bt_pll_mux" };
|
||||
static u32 mux_debug_idx[] = { 0x0, 0x1, 0x2, 0x4, 0x8, 0x10 };
|
||||
|
||||
-static unsigned int pistachio_critical_clks[] __initdata = {
|
||||
- CLK_MIPS,
|
||||
- CLK_PERIPH_SYS,
|
||||
+static unsigned int pistachio_critical_clks_core[] __initdata = {
|
||||
+ CLK_MIPS
|
||||
+};
|
||||
+
|
||||
+static unsigned int pistachio_critical_clks_sys[] __initdata = {
|
||||
+ PERIPH_CLK_SYS,
|
||||
+ PERIPH_CLK_SYS_BUS,
|
||||
+ PERIPH_CLK_DDR,
|
||||
+ PERIPH_CLK_ROM,
|
||||
};
|
||||
|
||||
static void __init pistachio_clk_init(struct device_node *np)
|
||||
@@ -193,8 +199,8 @@ static void __init pistachio_clk_init(st
|
||||
|
||||
pistachio_clk_register_provider(p);
|
||||
|
||||
- pistachio_clk_force_enable(p, pistachio_critical_clks,
|
||||
- ARRAY_SIZE(pistachio_critical_clks));
|
||||
+ pistachio_clk_force_enable(p, pistachio_critical_clks_core,
|
||||
+ ARRAY_SIZE(pistachio_critical_clks_core));
|
||||
}
|
||||
CLK_OF_DECLARE(pistachio_clk, "img,pistachio-clk", pistachio_clk_init);
|
||||
|
||||
@@ -261,6 +267,9 @@ static void __init pistachio_clk_periph_
|
||||
ARRAY_SIZE(pistachio_periph_gates));
|
||||
|
||||
pistachio_clk_register_provider(p);
|
||||
+
|
||||
+ pistachio_clk_force_enable(p, pistachio_critical_clks_sys,
|
||||
+ ARRAY_SIZE(pistachio_critical_clks_sys));
|
||||
}
|
||||
CLK_OF_DECLARE(pistachio_clk_periph, "img,pistachio-clk-periph",
|
||||
pistachio_clk_periph_init);
|
||||
-54
@@ -1,54 +0,0 @@
|
||||
From e53f21c761d141bbcbce06e9ddab3b4e0a828f2c Mon Sep 17 00:00:00 2001
|
||||
From: Zdenko Pulitika <zdenko.pulitika@imgtec.com>
|
||||
Date: Wed, 26 Aug 2015 17:11:38 +0100
|
||||
Subject: clk: pistachio: Fix override of clk-pll settings from boot loader
|
||||
|
||||
From: Zdenko Pulitika <zdenko.pulitika@imgtec.com>
|
||||
|
||||
commit e53f21c761d141bbcbce06e9ddab3b4e0a828f2c upstream.
|
||||
|
||||
PLL enable callbacks are overriding PLL mode (int/frac) and
|
||||
Noise reduction (on/off) settings set by the boot loader which
|
||||
results in the incorrect clock rate.
|
||||
|
||||
PLL mode and noise reduction are defined by the DSMPD and DACPD bits
|
||||
of the PLL control register. PLL .enable() callbacks enable PLL
|
||||
by deasserting all power-down bits of the PLL control register,
|
||||
including DSMPD and DACPD bits, which is not necessary since
|
||||
these bits don't actually enable/disable PLL.
|
||||
|
||||
This commit fixes the problem by removing DSMPD and DACPD bits
|
||||
from the "PLL enable" mask.
|
||||
|
||||
Fixes: 43049b0c83f17("CLK: Pistachio: Add PLL driver")
|
||||
Reviewed-by: Andrew Bresitcker <abrestic@chromium.org>
|
||||
Signed-off-by: Zdenko Pulitika <zdenko.pulitika@imgtec.com>
|
||||
Signed-off-by: Govindraj Raja <govindraj.raja@imgtec.com>
|
||||
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/clk/pistachio/clk-pll.c | 5 ++---
|
||||
1 file changed, 2 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/clk/pistachio/clk-pll.c
|
||||
+++ b/drivers/clk/pistachio/clk-pll.c
|
||||
@@ -115,8 +115,7 @@ static int pll_gf40lp_frac_enable(struct
|
||||
u32 val;
|
||||
|
||||
val = pll_readl(pll, PLL_CTRL3);
|
||||
- val &= ~(PLL_FRAC_CTRL3_PD | PLL_FRAC_CTRL3_DACPD |
|
||||
- PLL_FRAC_CTRL3_DSMPD | PLL_FRAC_CTRL3_FOUTPOSTDIVPD |
|
||||
+ val &= ~(PLL_FRAC_CTRL3_PD | PLL_FRAC_CTRL3_FOUTPOSTDIVPD |
|
||||
PLL_FRAC_CTRL3_FOUT4PHASEPD | PLL_FRAC_CTRL3_FOUTVCOPD);
|
||||
pll_writel(pll, val, PLL_CTRL3);
|
||||
|
||||
@@ -233,7 +232,7 @@ static int pll_gf40lp_laint_enable(struc
|
||||
u32 val;
|
||||
|
||||
val = pll_readl(pll, PLL_CTRL1);
|
||||
- val &= ~(PLL_INT_CTRL1_PD | PLL_INT_CTRL1_DSMPD |
|
||||
+ val &= ~(PLL_INT_CTRL1_PD |
|
||||
PLL_INT_CTRL1_FOUTPOSTDIVPD | PLL_INT_CTRL1_FOUTVCOPD);
|
||||
pll_writel(pll, val, PLL_CTRL1);
|
||||
|
||||
-61
@@ -1,61 +0,0 @@
|
||||
From 4b5fb7dc9096d949a22651370bb6bf11f21edb30 Mon Sep 17 00:00:00 2001
|
||||
From: Robert Jarzmik <robert.jarzmik@free.fr>
|
||||
Date: Sun, 12 Jul 2015 22:49:53 +0200
|
||||
Subject: clk: pxa: fix core frequency reporting unit
|
||||
|
||||
From: Robert Jarzmik <robert.jarzmik@free.fr>
|
||||
|
||||
commit 4b5fb7dc9096d949a22651370bb6bf11f21edb30 upstream.
|
||||
|
||||
Legacy drivers which are not yet ported, such as cpufreq-pxa[23]xx, rely
|
||||
on pxaXXx_get_clk_frequency_khz() to find the CPU core frequency.
|
||||
|
||||
This reporting was broken because the expected unit is kHz and not
|
||||
Hz. Fix the reporting for pxa25x, pxa27x and pxa3xx.
|
||||
|
||||
Fixes: fe7710fae477 ("clk: add pxa25x clock drivers")
|
||||
Fixes: d40670dc6169 ("clk: add pxa27x clock drivers")
|
||||
Fixes: 9bbb8a338fb2 ("clk: pxa: add pxa3xx clock driver")
|
||||
Signed-off-by: Robert Jarzmik <robert.jarzmik@free.fr>
|
||||
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/clk/pxa/clk-pxa25x.c | 2 +-
|
||||
drivers/clk/pxa/clk-pxa27x.c | 2 +-
|
||||
drivers/clk/pxa/clk-pxa3xx.c | 2 +-
|
||||
3 files changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/clk/pxa/clk-pxa25x.c
|
||||
+++ b/drivers/clk/pxa/clk-pxa25x.c
|
||||
@@ -79,7 +79,7 @@ unsigned int pxa25x_get_clk_frequency_kh
|
||||
clks[3] / 1000000, (clks[3] % 1000000) / 10000);
|
||||
}
|
||||
|
||||
- return (unsigned int)clks[0];
|
||||
+ return (unsigned int)clks[0] / KHz;
|
||||
}
|
||||
|
||||
static unsigned long clk_pxa25x_memory_get_rate(struct clk_hw *hw,
|
||||
--- a/drivers/clk/pxa/clk-pxa27x.c
|
||||
+++ b/drivers/clk/pxa/clk-pxa27x.c
|
||||
@@ -80,7 +80,7 @@ unsigned int pxa27x_get_clk_frequency_kh
|
||||
pr_info("System bus clock: %ld.%02ldMHz\n",
|
||||
clks[4] / 1000000, (clks[4] % 1000000) / 10000);
|
||||
}
|
||||
- return (unsigned int)clks[0];
|
||||
+ return (unsigned int)clks[0] / KHz;
|
||||
}
|
||||
|
||||
bool pxa27x_is_ppll_disabled(void)
|
||||
--- a/drivers/clk/pxa/clk-pxa3xx.c
|
||||
+++ b/drivers/clk/pxa/clk-pxa3xx.c
|
||||
@@ -78,7 +78,7 @@ unsigned int pxa3xx_get_clk_frequency_kh
|
||||
pr_info("System bus clock: %ld.%02ldMHz\n",
|
||||
clks[4] / 1000000, (clks[4] % 1000000) / 10000);
|
||||
}
|
||||
- return (unsigned int)clks[0];
|
||||
+ return (unsigned int)clks[0] / KHz;
|
||||
}
|
||||
|
||||
static unsigned long clk_pxa3xx_ac97_get_rate(struct clk_hw *hw,
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
From 1c4b4b0eb1909010b8ebda1ef208bf3ed62e7487 Mon Sep 17 00:00:00 2001
|
||||
From: Georgi Djakov <georgi.djakov@linaro.org>
|
||||
Date: Tue, 25 Aug 2015 15:27:43 +0300
|
||||
Subject: clk: qcom: Fix MSM8916 prng clock enable bit
|
||||
|
||||
From: Georgi Djakov <georgi.djakov@linaro.org>
|
||||
|
||||
commit 1c4b4b0eb1909010b8ebda1ef208bf3ed62e7487 upstream.
|
||||
|
||||
Fix the enable bit of the pseudorandom number generator clock.
|
||||
|
||||
Reported-by: Stanimir Varbanov <stanimir.varbanov@linaro.org>
|
||||
Fixes: 3966fab8b6ab "clk: qcom: Add MSM8916 Global Clock Controller support"
|
||||
Signed-off-by: Georgi Djakov <georgi.djakov@linaro.org>
|
||||
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/clk/qcom/gcc-msm8916.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/clk/qcom/gcc-msm8916.c
|
||||
+++ b/drivers/clk/qcom/gcc-msm8916.c
|
||||
@@ -2278,7 +2278,7 @@ static struct clk_branch gcc_prng_ahb_cl
|
||||
.halt_check = BRANCH_HALT_VOTED,
|
||||
.clkr = {
|
||||
.enable_reg = 0x45004,
|
||||
- .enable_mask = BIT(0),
|
||||
+ .enable_mask = BIT(8),
|
||||
.hw.init = &(struct clk_init_data){
|
||||
.name = "gcc_prng_ahb_clk",
|
||||
.parent_names = (const char *[]){
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
From d7a304e9d018c99dda80f4c16ec0fe817b5be4a1 Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Boyd <sboyd@codeaurora.org>
|
||||
Date: Tue, 14 Jul 2015 16:57:29 -0700
|
||||
Subject: clk: qcom: Set CLK_SET_RATE_PARENT on ce1 clocks
|
||||
|
||||
From: Stephen Boyd <sboyd@codeaurora.org>
|
||||
|
||||
commit d7a304e9d018c99dda80f4c16ec0fe817b5be4a1 upstream.
|
||||
|
||||
The other ce clocks have the flag set, but ce1 doesn't, so
|
||||
clk_set_rate() doesn't propagate up the tree to the ce1_src_clk.
|
||||
Set the flag as this is supported.
|
||||
|
||||
Reported-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
|
||||
Tested-by: Bjorn Andersson <bjorn.andersson@sonymobile.com>
|
||||
Fixes: 02824653200b ("clk: qcom: Add APQ8084 Global Clock Controller support")
|
||||
Fixes: d33faa9ead8d ("clk: qcom: Add support for MSM8974's global clock controller (GCC)")
|
||||
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/clk/qcom/gcc-apq8084.c | 1 +
|
||||
drivers/clk/qcom/gcc-msm8974.c | 1 +
|
||||
2 files changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/clk/qcom/gcc-apq8084.c
|
||||
+++ b/drivers/clk/qcom/gcc-apq8084.c
|
||||
@@ -2105,6 +2105,7 @@ static struct clk_branch gcc_ce1_clk = {
|
||||
"ce1_clk_src",
|
||||
},
|
||||
.num_parents = 1,
|
||||
+ .flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_branch2_ops,
|
||||
},
|
||||
},
|
||||
--- a/drivers/clk/qcom/gcc-msm8974.c
|
||||
+++ b/drivers/clk/qcom/gcc-msm8974.c
|
||||
@@ -1783,6 +1783,7 @@ static struct clk_branch gcc_ce1_clk = {
|
||||
"ce1_clk_src",
|
||||
},
|
||||
.num_parents = 1,
|
||||
+ .flags = CLK_SET_RATE_PARENT,
|
||||
.ops = &clk_branch2_ops,
|
||||
},
|
||||
},
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
From 4791eb61dbe8100ccac59fecfac9d93a15db1447 Mon Sep 17 00:00:00 2001
|
||||
From: Heiko Stuebner <heiko@sntech.de>
|
||||
Date: Thu, 18 Jun 2015 16:18:28 +0200
|
||||
Subject: clk: rockchip: rk3288: add CLK_SET_RATE_PARENT to sclk_mac
|
||||
|
||||
From: Heiko Stuebner <heiko@sntech.de>
|
||||
|
||||
commit 4791eb61dbe8100ccac59fecfac9d93a15db1447 upstream.
|
||||
|
||||
The dwmac ethernet controller on the rk3288 supports phys connected
|
||||
via rgmii and rmii. With rgmii phys it is expected that the mac clock
|
||||
is provided externally while with rmii phys the clock can be external
|
||||
but also generated from the plls. In the later case it of course needs
|
||||
be at 50MHz, which gets set from the dwmac_rk driver.
|
||||
As most devices use a rgmii phy it never surfaced so far that the mac
|
||||
clk mux, doesn't go up one lever to the pll clock in the rmii case with
|
||||
internal clock generation, as it is missing the CLK_SET_RATE_PARENT flag,
|
||||
and thus will not set the correct frequency in most cases.
|
||||
|
||||
Fixes: b9e4ba541607 ("clk: rockchip: add clock controller for rk3288")
|
||||
Signed-off-by: Heiko Stuebner <heiko@sntech.de>
|
||||
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/clk/rockchip/clk-rk3288.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/clk/rockchip/clk-rk3288.c
|
||||
+++ b/drivers/clk/rockchip/clk-rk3288.c
|
||||
@@ -578,7 +578,7 @@ static struct rockchip_clk_branch rk3288
|
||||
COMPOSITE(0, "mac_pll_src", mux_pll_src_npll_cpll_gpll_p, 0,
|
||||
RK3288_CLKSEL_CON(21), 0, 2, MFLAGS, 8, 5, DFLAGS,
|
||||
RK3288_CLKGATE_CON(2), 5, GFLAGS),
|
||||
- MUX(SCLK_MAC, "mac_clk", mux_mac_p, 0,
|
||||
+ MUX(SCLK_MAC, "mac_clk", mux_mac_p, CLK_SET_RATE_PARENT,
|
||||
RK3288_CLKSEL_CON(21), 4, 1, MFLAGS),
|
||||
GATE(SCLK_MACREF_OUT, "sclk_macref_out", "mac_clk", 0,
|
||||
RK3288_CLKGATE_CON(5), 3, GFLAGS),
|
||||
@@ -1,37 +0,0 @@
|
||||
From ba30011577330b7e29ecb5916d89c6db9fbc5b3d Mon Sep 17 00:00:00 2001
|
||||
From: Marek Szyprowski <m.szyprowski@samsung.com>
|
||||
Date: Wed, 12 Aug 2015 10:58:22 +0200
|
||||
Subject: clk: s5pv210: add missing call to
|
||||
samsung_clk_of_add_provider()
|
||||
|
||||
From: Marek Szyprowski <m.szyprowski@samsung.com>
|
||||
|
||||
commit ba30011577330b7e29ecb5916d89c6db9fbc5b3d upstream.
|
||||
|
||||
Commit d5e136a21b2028fb1f45143ea7112d5869bfc6c7 ("clk: samsung: Register
|
||||
clk provider only after registering its all clocks", merged to v3.17-rc1)
|
||||
modified a way that driver registers registers to core framework. This
|
||||
change has not been applied to s5pv210 clocks driver, which has been
|
||||
merged in parallel to that commit. This patch adds a missing call to
|
||||
samsung_clk_of_add_provider(), so the driver is operational again.
|
||||
|
||||
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
|
||||
Acked-by: Tomasz Figa <tomasz.figa@gmail.com>
|
||||
Signed-off-by: Michael Turquette <mturquette@baylibre.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/clk/samsung/clk-s5pv210.c | 2 ++
|
||||
1 file changed, 2 insertions(+)
|
||||
|
||||
--- a/drivers/clk/samsung/clk-s5pv210.c
|
||||
+++ b/drivers/clk/samsung/clk-s5pv210.c
|
||||
@@ -828,6 +828,8 @@ static void __init __s5pv210_clk_init(st
|
||||
|
||||
s5pv210_clk_sleep_init();
|
||||
|
||||
+ samsung_clk_of_add_provider(np, ctx);
|
||||
+
|
||||
pr_info("%s clocks: mout_apll = %ld, mout_mpll = %ld\n"
|
||||
"\tmout_epll = %ld, mout_vpll = %ld\n",
|
||||
is_s5p6442 ? "S5P6442" : "S5PV210",
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
From 3294bee87091be5f179474f6c39d1d87769635e2 Mon Sep 17 00:00:00 2001
|
||||
From: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Date: Wed, 29 Jul 2015 13:17:06 +0300
|
||||
Subject: clk: versatile: off by one in clk_sp810_timerclken_of_get()
|
||||
|
||||
From: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
|
||||
commit 3294bee87091be5f179474f6c39d1d87769635e2 upstream.
|
||||
|
||||
The ">" should be ">=" or we end up reading beyond the end of the array.
|
||||
|
||||
Fixes: 6e973d2c4385 ('clk: vexpress: Add separate SP810 driver')
|
||||
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Acked-by: Pawel Moll <pawel.moll@arm.com>
|
||||
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/clk/versatile/clk-sp810.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/clk/versatile/clk-sp810.c
|
||||
+++ b/drivers/clk/versatile/clk-sp810.c
|
||||
@@ -128,8 +128,8 @@ static struct clk *clk_sp810_timerclken_
|
||||
{
|
||||
struct clk_sp810 *sp810 = data;
|
||||
|
||||
- if (WARN_ON(clkspec->args_count != 1 || clkspec->args[0] >
|
||||
- ARRAY_SIZE(sp810->timerclken)))
|
||||
+ if (WARN_ON(clkspec->args_count != 1 ||
|
||||
+ clkspec->args[0] >= ARRAY_SIZE(sp810->timerclken)))
|
||||
return NULL;
|
||||
|
||||
return sp810->timerclken[clkspec->args[0]].clk;
|
||||
-44
@@ -1,44 +0,0 @@
|
||||
From f811a38300be3cdb603171aea5ad3fb42b71ca53 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Chen <peter.chen@freescale.com>
|
||||
Date: Fri, 31 Jul 2015 16:36:30 +0800
|
||||
Subject: doc: usb: gadget-testing: using the updated testusb.c
|
||||
|
||||
From: Peter Chen <peter.chen@freescale.com>
|
||||
|
||||
commit f811a38300be3cdb603171aea5ad3fb42b71ca53 upstream.
|
||||
|
||||
testusb.c at http://www.linux-usb.org/usbtest/ is out of date,
|
||||
using the one at the kernel source folder.
|
||||
|
||||
Signed-off-by: Peter Chen <peter.chen@freescale.com>
|
||||
Signed-off-by: Felipe Balbi <balbi@ti.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
Documentation/usb/gadget-testing.txt | 7 ++-----
|
||||
1 file changed, 2 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/Documentation/usb/gadget-testing.txt
|
||||
+++ b/Documentation/usb/gadget-testing.txt
|
||||
@@ -237,9 +237,7 @@ Testing the LOOPBACK function
|
||||
-----------------------------
|
||||
|
||||
device: run the gadget
|
||||
-host: test-usb
|
||||
-
|
||||
-http://www.linux-usb.org/usbtest/testusb.c
|
||||
+host: test-usb (tools/usb/testusb.c)
|
||||
|
||||
8. MASS STORAGE function
|
||||
========================
|
||||
@@ -588,9 +586,8 @@ Testing the SOURCESINK function
|
||||
-------------------------------
|
||||
|
||||
device: run the gadget
|
||||
-host: test-usb
|
||||
+host: test-usb (tools/usb/testusb.c)
|
||||
|
||||
-http://www.linux-usb.org/usbtest/testusb.c
|
||||
|
||||
16. UAC1 function
|
||||
=================
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
From 824257857fd81f5e749831ff9cd63566b5a86abe Mon Sep 17 00:00:00 2001
|
||||
From: Gaurav K Singh <gaurav.k.singh@intel.com>
|
||||
Date: Mon, 3 Aug 2015 15:45:32 +0530
|
||||
Subject: drm/i915: Allow DSI dual link to be configured on any pipe
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
From: Gaurav K Singh <gaurav.k.singh@intel.com>
|
||||
|
||||
commit 824257857fd81f5e749831ff9cd63566b5a86abe upstream.
|
||||
|
||||
Just like single link MIPI panels, similarly for dual link panels, pipe
|
||||
to be configured is based on the DVO port from VBT Block 2. In hardware,
|
||||
Port A is mapped with Pipe A and Port C is mapped with Pipe B.
|
||||
|
||||
This issue got introduced in -
|
||||
|
||||
commit 7e9804fdcffc650515c60f524b8b2076ee59e710
|
||||
Author: Jani Nikula <jani.nikula@intel.com>
|
||||
Date: Fri Jan 16 14:27:23 2015 +0200
|
||||
|
||||
drm/i915/dsi: add drm mipi dsi host support
|
||||
|
||||
Signed-off-by: Gaurav K Singh <gaurav.k.singh@intel.com>
|
||||
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
||||
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/i915/intel_dsi.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/i915/intel_dsi.c
|
||||
+++ b/drivers/gpu/drm/i915/intel_dsi.c
|
||||
@@ -1036,11 +1036,7 @@ void intel_dsi_init(struct drm_device *d
|
||||
intel_connector->unregister = intel_connector_unregister;
|
||||
|
||||
/* Pipe A maps to MIPI DSI port A, pipe B maps to MIPI DSI port C */
|
||||
- if (dev_priv->vbt.dsi.config->dual_link) {
|
||||
- /* XXX: does dual link work on either pipe? */
|
||||
- intel_encoder->crtc_mask = (1 << PIPE_A);
|
||||
- intel_dsi->ports = ((1 << PORT_A) | (1 << PORT_C));
|
||||
- } else if (dev_priv->vbt.dsi.port == DVO_PORT_MIPIA) {
|
||||
+ if (dev_priv->vbt.dsi.port == DVO_PORT_MIPIA) {
|
||||
intel_encoder->crtc_mask = (1 << PIPE_A);
|
||||
intel_dsi->ports = (1 << PORT_A);
|
||||
} else if (dev_priv->vbt.dsi.port == DVO_PORT_MIPIC) {
|
||||
@@ -1048,6 +1044,9 @@ void intel_dsi_init(struct drm_device *d
|
||||
intel_dsi->ports = (1 << PORT_C);
|
||||
}
|
||||
|
||||
+ if (dev_priv->vbt.dsi.config->dual_link)
|
||||
+ intel_dsi->ports = ((1 << PORT_A) | (1 << PORT_C));
|
||||
+
|
||||
/* Create a DSI host (and a device) for each port. */
|
||||
for_each_dsi_port(port, intel_dsi->ports) {
|
||||
struct intel_dsi_host *host;
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
From 51bc140431e233284660b1d22c47dec9ecdb521e Mon Sep 17 00:00:00 2001
|
||||
From: Chris Wilson <chris@chris-wilson.co.uk>
|
||||
Date: Mon, 31 Aug 2015 15:10:39 +0100
|
||||
Subject: drm/i915: Always mark the object as dirty when used by the GPU
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
From: Chris Wilson <chris@chris-wilson.co.uk>
|
||||
|
||||
commit 51bc140431e233284660b1d22c47dec9ecdb521e upstream.
|
||||
|
||||
There have been many hard to track down bugs whereby userspace forgot to
|
||||
flag a write buffer and then cause graphics corruption or a hung GPU
|
||||
when that buffer was later purged under memory pressure (as the buffer
|
||||
appeared clean, its pages would have been evicted rather than preserved
|
||||
and any changes more recent than in the backing storage would be lost).
|
||||
In retrospect this is a rare optimisation against memory pressure,
|
||||
already the slow path. If we always mark the buffer as dirty when
|
||||
accessed by the GPU, anything not used can still be evicted cheaply
|
||||
(ideal behaviour for mark-and-sweep eviction) but we do not run the risk
|
||||
of corruption. For correct read serialisation, userspace still has to
|
||||
notify when the GPU writes to an object. However, there are certain
|
||||
situations under which userspace may wish to tell white lies to the
|
||||
kernel...
|
||||
|
||||
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
||||
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
|
||||
Cc: Kristian Høgsberg <krh@bitplanet.net>
|
||||
Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
|
||||
Cc: "Goel, Akash" <akash.goel@intel.co>
|
||||
Cc: Michał Winiarski <michal.winiarski@intel.com>
|
||||
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
||||
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/i915/i915_gem_execbuffer.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/gpu/drm/i915/i915_gem_execbuffer.c
|
||||
+++ b/drivers/gpu/drm/i915/i915_gem_execbuffer.c
|
||||
@@ -1025,6 +1025,7 @@ i915_gem_execbuffer_move_to_active(struc
|
||||
u32 old_read = obj->base.read_domains;
|
||||
u32 old_write = obj->base.write_domain;
|
||||
|
||||
+ obj->dirty = 1; /* be paranoid */
|
||||
obj->base.write_domain = obj->base.pending_write_domain;
|
||||
if (obj->base.write_domain == 0)
|
||||
obj->base.pending_read_domains |= obj->base.read_domains;
|
||||
@@ -1032,7 +1033,6 @@ i915_gem_execbuffer_move_to_active(struc
|
||||
|
||||
i915_vma_move_to_active(vma, ring);
|
||||
if (obj->base.write_domain) {
|
||||
- obj->dirty = 1;
|
||||
i915_gem_request_assign(&obj->last_write_req, req);
|
||||
|
||||
intel_fb_obj_invalidate(obj, ring, ORIGIN_CS);
|
||||
-79
@@ -1,79 +0,0 @@
|
||||
From 54875571bbfde00fc63741715c531cbb5246c3b2 Mon Sep 17 00:00:00 2001
|
||||
From: Imre Deak <imre.deak@intel.com>
|
||||
Date: Tue, 30 Jun 2015 17:06:47 +0300
|
||||
Subject: drm/i915: apply the PCI_D0/D3 hibernation workaround everywhere on pre GEN6
|
||||
|
||||
From: Imre Deak <imre.deak@intel.com>
|
||||
|
||||
commit 54875571bbfde00fc63741715c531cbb5246c3b2 upstream.
|
||||
|
||||
commit da2bc1b9db3351addd293e5b82757efe1f77ed1d
|
||||
Author: Imre Deak <imre.deak@intel.com>
|
||||
Date: Thu Oct 23 19:23:26 2014 +0300
|
||||
|
||||
drm/i915: add poweroff_late handler
|
||||
|
||||
introduced a regression on old platforms during hibernation. A workaround was
|
||||
added in
|
||||
|
||||
commit ab3be73fa7b43f4c3648ce29b5fd649ea54d3adb
|
||||
Author: Imre Deak <imre.deak@intel.com>
|
||||
Date: Mon Mar 2 13:04:41 2015 +0200
|
||||
|
||||
drm/i915: gen4: work around hang during hibernation
|
||||
|
||||
using an explicit blacklist for the GENs/BIOS vendors where the issue was
|
||||
reported. Later there we had reports of the same failure on platforms not on
|
||||
this list.
|
||||
|
||||
To my best knowledge the correct thing to do is still to put the device to PCI
|
||||
D3 state during hibernation, see [1] and [2] for the reasons. This also aligns
|
||||
with our future plans to unify more the runtime and system suspend/resume
|
||||
paths. Since an exact blacklist seems to be impractical (multiple GENs and
|
||||
BIOS vendors are affected) apply the workaround on everything pre GEN6.
|
||||
|
||||
[1] http://lists.freedesktop.org/archives/intel-gfx/2015-February/060710.html
|
||||
[2] https://lkml.org/lkml/2015/6/22/274
|
||||
|
||||
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=95061
|
||||
Reported-by: Ilya Tumaykin <itumaykin@gmail.com>
|
||||
Reported-by: Dirk Griesbach <spamthis@freenet.de>
|
||||
Reported-by: Pavel Machek <pavel@ucw.cz>
|
||||
Reported-by: Mikko Rapeli <mikko.rapeli@iki.fi>
|
||||
Tested-by: Mikko Rapeli <mikko.rapeli@iki.fi>
|
||||
Reported-by: Paul Bolle <pebolle@tiscali.nl>
|
||||
Signed-off-by: Imre Deak <imre.deak@intel.com>
|
||||
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/i915/i915_drv.c | 15 +++++++++------
|
||||
1 file changed, 9 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/i915/i915_drv.c
|
||||
+++ b/drivers/gpu/drm/i915/i915_drv.c
|
||||
@@ -647,15 +647,18 @@ static int i915_drm_suspend_late(struct
|
||||
|
||||
pci_disable_device(drm_dev->pdev);
|
||||
/*
|
||||
- * During hibernation on some GEN4 platforms the BIOS may try to access
|
||||
+ * During hibernation on some platforms the BIOS may try to access
|
||||
* the device even though it's already in D3 and hang the machine. So
|
||||
* leave the device in D0 on those platforms and hope the BIOS will
|
||||
- * power down the device properly. Platforms where this was seen:
|
||||
- * Lenovo Thinkpad X301, X61s
|
||||
+ * power down the device properly. The issue was seen on multiple old
|
||||
+ * GENs with different BIOS vendors, so having an explicit blacklist
|
||||
+ * is inpractical; apply the workaround on everything pre GEN6. The
|
||||
+ * platforms where the issue was seen:
|
||||
+ * Lenovo Thinkpad X301, X61s, X60, T60, X41
|
||||
+ * Fujitsu FSC S7110
|
||||
+ * Acer Aspire 1830T
|
||||
*/
|
||||
- if (!(hibernation &&
|
||||
- drm_dev->pdev->subsystem_vendor == PCI_VENDOR_ID_LENOVO &&
|
||||
- INTEL_INFO(dev_priv)->gen == 4))
|
||||
+ if (!(hibernation && INTEL_INFO(dev_priv)->gen < 6))
|
||||
pci_set_power_state(drm_dev->pdev, PCI_D3hot);
|
||||
|
||||
return 0;
|
||||
-75
@@ -1,75 +0,0 @@
|
||||
From d14e7b6d1d8747826cb900db852351c550e00fdd Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
|
||||
Date: Thu, 20 Aug 2015 19:37:29 +0300
|
||||
Subject: drm/i915: Check DP link status on long hpd too
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
|
||||
|
||||
commit d14e7b6d1d8747826cb900db852351c550e00fdd upstream.
|
||||
|
||||
We are no longer checkling the DP link status on long hpd. We used to do
|
||||
that from the .hot_plug() handler, but it was removed when MST got
|
||||
introduced.
|
||||
|
||||
If there's no userspace we now fail to retrain the link if the sink
|
||||
power is toggled (or cable yanked and replugged), meaning the user is
|
||||
left staring at a blank screen. With the retraining put back that should
|
||||
be fixed.
|
||||
|
||||
Also remove the leftover comment that referred to the old retraining
|
||||
from .hot_plug().
|
||||
|
||||
Fixes a regression introduced in:
|
||||
commit 0e32b39ceed665bfa4a77a4bc307b6652b991632
|
||||
Author: Dave Airlie <airlied@redhat.com>
|
||||
Date: Fri May 2 14:02:48 2014 +1000
|
||||
|
||||
drm/i915: add DP 1.2 MST support (v0.7)
|
||||
|
||||
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89453
|
||||
Tested-by: Palmer Dabbelt <palmer@dabbelt.com>
|
||||
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91407
|
||||
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89461
|
||||
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89594
|
||||
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85641
|
||||
Cc: Dave Airlie <airlied@redhat.com>
|
||||
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
||||
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
||||
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/i915/intel_dp.c | 11 +++++------
|
||||
1 file changed, 5 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/i915/intel_dp.c
|
||||
+++ b/drivers/gpu/drm/i915/intel_dp.c
|
||||
@@ -4691,9 +4691,12 @@ intel_dp_hpd_pulse(struct intel_digital_
|
||||
|
||||
intel_dp_probe_oui(intel_dp);
|
||||
|
||||
- if (!intel_dp_probe_mst(intel_dp))
|
||||
+ if (!intel_dp_probe_mst(intel_dp)) {
|
||||
+ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
|
||||
+ intel_dp_check_link_status(intel_dp);
|
||||
+ drm_modeset_unlock(&dev->mode_config.connection_mutex);
|
||||
goto mst_fail;
|
||||
-
|
||||
+ }
|
||||
} else {
|
||||
if (intel_dp->is_mst) {
|
||||
if (intel_dp_check_mst_status(intel_dp) == -EINVAL)
|
||||
@@ -4701,10 +4704,6 @@ intel_dp_hpd_pulse(struct intel_digital_
|
||||
}
|
||||
|
||||
if (!intel_dp->is_mst) {
|
||||
- /*
|
||||
- * we'll check the link status via the normal hot plug path later -
|
||||
- * but for short hpds we should check it now
|
||||
- */
|
||||
drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
|
||||
intel_dp_check_link_status(intel_dp);
|
||||
drm_modeset_unlock(&dev->mode_config.connection_mutex);
|
||||
-57
@@ -1,57 +0,0 @@
|
||||
From acd29f7b22262d9e848393b9b6ae13eb42d22514 Mon Sep 17 00:00:00 2001
|
||||
From: Chris Wilson <chris@chris-wilson.co.uk>
|
||||
Date: Tue, 8 Sep 2015 14:17:13 +0100
|
||||
Subject: drm/i915: Limit the number of loops for reading a split 64bit register
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
From: Chris Wilson <chris@chris-wilson.co.uk>
|
||||
|
||||
commit acd29f7b22262d9e848393b9b6ae13eb42d22514 upstream.
|
||||
|
||||
In I915_READ64_2x32 we attempt to read a 64bit register using 2 32bit
|
||||
reads. Due to the nature of the registers we try to read in this manner,
|
||||
they may increment between the two instruction (e.g. a timestamp
|
||||
counter). To keep the result accurate, we repeat the read if we detect
|
||||
an overflow (i.e. the upper value varies). However, some hardware is just
|
||||
plain flaky and may endless loop as the the upper 32bits are not stable.
|
||||
Just give up after a couple of tries and report whatever we read last.
|
||||
|
||||
v2: Use the most recent values when erring out on an unstable register.
|
||||
|
||||
Reported-by: russianneuromancer@ya.ru
|
||||
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=91906
|
||||
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
||||
Cc: Michał Winiarski <michal.winiarski@intel.com>
|
||||
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
|
||||
Cc: Jani Nikula <jani.nikula@linux.intel.com>
|
||||
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
|
||||
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/i915/i915_drv.h | 10 +++++-----
|
||||
1 file changed, 5 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/i915/i915_drv.h
|
||||
+++ b/drivers/gpu/drm/i915/i915_drv.h
|
||||
@@ -3190,13 +3190,13 @@ int intel_freq_opcode(struct drm_i915_pr
|
||||
#define I915_READ64(reg) dev_priv->uncore.funcs.mmio_readq(dev_priv, (reg), true)
|
||||
|
||||
#define I915_READ64_2x32(lower_reg, upper_reg) ({ \
|
||||
- u32 upper, lower, tmp; \
|
||||
- tmp = I915_READ(upper_reg); \
|
||||
+ u32 upper, lower, old_upper, loop = 0; \
|
||||
+ upper = I915_READ(upper_reg); \
|
||||
do { \
|
||||
- upper = tmp; \
|
||||
+ old_upper = upper; \
|
||||
lower = I915_READ(lower_reg); \
|
||||
- tmp = I915_READ(upper_reg); \
|
||||
- } while (upper != tmp); \
|
||||
+ upper = I915_READ(upper_reg); \
|
||||
+ } while (upper != old_upper && loop++ < 2); \
|
||||
(u64)upper << 32 | lower; })
|
||||
|
||||
#define POSTING_READ(reg) (void)I915_READ_NOTRACE(reg)
|
||||
@@ -1,117 +0,0 @@
|
||||
From 69f92f67b68ab7028ffe15f0eea76b59f8859383 Mon Sep 17 00:00:00 2001
|
||||
From: Lukas Wunner <lukas@wunner.de>
|
||||
Date: Wed, 15 Jul 2015 13:57:35 +0200
|
||||
Subject: drm/i915: Preserve SSC earlier
|
||||
|
||||
From: Lukas Wunner <lukas@wunner.de>
|
||||
|
||||
commit 69f92f67b68ab7028ffe15f0eea76b59f8859383 upstream.
|
||||
|
||||
Commit 92122789b2d6 ("drm/i915: preserve SSC if previously set v3")
|
||||
added code to intel_modeset_gem_init to override the SSC status read
|
||||
from VBT with the SSC status set by BIOS.
|
||||
|
||||
However, intel_modeset_gem_init is invoked *after* intel_modeset_init,
|
||||
which calls intel_setup_outputs, which *modifies* SSC status by way of
|
||||
intel_init_pch_refclk. So unlike advertised, intel_modeset_gem_init
|
||||
doesn't preserve the SSC status set by BIOS but whatever
|
||||
intel_init_pch_refclk decided on.
|
||||
|
||||
This is a problem on dual gpu laptops such as the MacBook Pro which
|
||||
require either a handler to switch DDC lines, or the discrete gpu
|
||||
to proxy DDC/AUX communication: Both the handler and the discrete
|
||||
gpu may initialize after the i915 driver, and consequently, an LVDS
|
||||
connector may initially seem disconnected and the SSC therefore
|
||||
is disabled by intel_init_pch_refclk, but on reprobe the connector
|
||||
may turn out to be connected and the SSC must then be enabled.
|
||||
|
||||
Due to 92122789b2d6 however, the SSC is not enabled on reprobe since
|
||||
it is assumed BIOS disabled it while in fact it was disabled by
|
||||
intel_init_pch_refclk.
|
||||
|
||||
Also, because the SSC status is preserved so late, the preserved value
|
||||
only ever gets used on resume but not on panel initialization:
|
||||
intel_modeset_init calls intel_init_display which indirectly calls
|
||||
intel_panel_use_ssc via multiple subroutines, *before* the BIOS value
|
||||
overrides the VBT value in intel_modeset_gem_init (intel_panel_use_ssc
|
||||
is the sole user of dev_priv->vbt.lvds_use_ssc).
|
||||
|
||||
Fix this by moving the code introduced by 92122789b2d6 from
|
||||
intel_modeset_gem_init to intel_modeset_init before the invocation
|
||||
of intel_setup_outputs and intel_init_display.
|
||||
|
||||
Add a DRM_DEBUG_KMS as suggested way back by Jani:
|
||||
http://lists.freedesktop.org/archives/intel-gfx/2014-June/046666.html
|
||||
|
||||
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=88861
|
||||
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=61115
|
||||
Tested-by: Paul Hordiienko <pvt.gord@gmail.com>
|
||||
[MBP 6,2 2010 intel ILK + nvidia GT216 pre-retina]
|
||||
Tested-by: William Brown <william@blackhats.net.au>
|
||||
[MBP 8,2 2011 intel SNB + amd turks pre-retina]
|
||||
Tested-by: Lukas Wunner <lukas@wunner.de>
|
||||
[MBP 9,1 2012 intel IVB + nvidia GK107 pre-retina]
|
||||
Tested-by: Bruno Bierbaumer <bruno@bierbaumer.net>
|
||||
[MBP 11,3 2013 intel HSW + nvidia GK107 retina -- work in progress]
|
||||
Fixes: 92122789b2d6 ("drm/i915: preserve SSC if previously set v3")
|
||||
Signed-off-by: Lukas Wunner <lukas@wunner.de>
|
||||
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
|
||||
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/i915/intel_display.c | 29 ++++++++++++++++++-----------
|
||||
1 file changed, 18 insertions(+), 11 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/i915/intel_display.c
|
||||
+++ b/drivers/gpu/drm/i915/intel_display.c
|
||||
@@ -13781,6 +13781,24 @@ void intel_modeset_init(struct drm_devic
|
||||
if (INTEL_INFO(dev)->num_pipes == 0)
|
||||
return;
|
||||
|
||||
+ /*
|
||||
+ * There may be no VBT; and if the BIOS enabled SSC we can
|
||||
+ * just keep using it to avoid unnecessary flicker. Whereas if the
|
||||
+ * BIOS isn't using it, don't assume it will work even if the VBT
|
||||
+ * indicates as much.
|
||||
+ */
|
||||
+ if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev)) {
|
||||
+ bool bios_lvds_use_ssc = !!(I915_READ(PCH_DREF_CONTROL) &
|
||||
+ DREF_SSC1_ENABLE);
|
||||
+
|
||||
+ if (dev_priv->vbt.lvds_use_ssc != bios_lvds_use_ssc) {
|
||||
+ DRM_DEBUG_KMS("SSC %sabled by BIOS, overriding VBT which says %sabled\n",
|
||||
+ bios_lvds_use_ssc ? "en" : "dis",
|
||||
+ dev_priv->vbt.lvds_use_ssc ? "en" : "dis");
|
||||
+ dev_priv->vbt.lvds_use_ssc = bios_lvds_use_ssc;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
intel_init_display(dev);
|
||||
intel_init_audio(dev);
|
||||
|
||||
@@ -14266,7 +14284,6 @@ void intel_modeset_setup_hw_state(struct
|
||||
|
||||
void intel_modeset_gem_init(struct drm_device *dev)
|
||||
{
|
||||
- struct drm_i915_private *dev_priv = dev->dev_private;
|
||||
struct drm_crtc *c;
|
||||
struct drm_i915_gem_object *obj;
|
||||
int ret;
|
||||
@@ -14275,16 +14292,6 @@ void intel_modeset_gem_init(struct drm_d
|
||||
intel_init_gt_powersave(dev);
|
||||
mutex_unlock(&dev->struct_mutex);
|
||||
|
||||
- /*
|
||||
- * There may be no VBT; and if the BIOS enabled SSC we can
|
||||
- * just keep using it to avoid unnecessary flicker. Whereas if the
|
||||
- * BIOS isn't using it, don't assume it will work even if the VBT
|
||||
- * indicates as much.
|
||||
- */
|
||||
- if (HAS_PCH_IBX(dev) || HAS_PCH_CPT(dev))
|
||||
- dev_priv->vbt.lvds_use_ssc = !!(I915_READ(PCH_DREF_CONTROL) &
|
||||
- DREF_SSC1_ENABLE);
|
||||
-
|
||||
intel_modeset_init_hw(dev);
|
||||
|
||||
intel_setup_overlay(dev);
|
||||
-147
@@ -1,147 +0,0 @@
|
||||
From bd3e1c7c6de9f5f70d97cdb6c817151c0477c5e3 Mon Sep 17 00:00:00 2001
|
||||
From: Jonathon Jongsma <jjongsma@redhat.com>
|
||||
Date: Thu, 20 Aug 2015 14:04:32 -0500
|
||||
Subject: drm/qxl: validate monitors config modes
|
||||
|
||||
From: Jonathon Jongsma <jjongsma@redhat.com>
|
||||
|
||||
commit bd3e1c7c6de9f5f70d97cdb6c817151c0477c5e3 upstream.
|
||||
|
||||
Due to some recent changes in
|
||||
drm_helper_probe_single_connector_modes_merge_bits(), old custom modes
|
||||
were not being pruned properly. In current kernels,
|
||||
drm_mode_validate_basic() is called to sanity-check each mode in the
|
||||
list. If the sanity-check passes, the mode's status gets set to to
|
||||
MODE_OK. In older kernels this check was not done, so old custom modes
|
||||
would still have a status of MODE_UNVERIFIED at this point, and would
|
||||
therefore be pruned later in the function.
|
||||
|
||||
As a result of this new behavior, the list of modes for a device always
|
||||
includes every custom mode ever configured for the device, with the
|
||||
largest one listed first. Since desktop environments usually choose the
|
||||
first preferred mode when a hotplug event is emitted, this had the
|
||||
result of making it very difficult for the user to reduce the size of
|
||||
the display.
|
||||
|
||||
The qxl driver did implement the mode_valid connector function, but it
|
||||
was empty. In order to restore the old behavior where old custom modes
|
||||
are pruned, we implement a proper mode_valid function for the qxl
|
||||
driver. This function now checks each mode against the last configured
|
||||
custom mode and the list of standard modes. If the mode doesn't match
|
||||
any of these, its status is set to MODE_BAD so that it will be pruned as
|
||||
expected.
|
||||
|
||||
Signed-off-by: Jonathon Jongsma <jjongsma@redhat.com>
|
||||
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/qxl/qxl_display.c | 66 +++++++++++++++++++++++---------------
|
||||
drivers/gpu/drm/qxl/qxl_drv.h | 2 +
|
||||
2 files changed, 42 insertions(+), 26 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/qxl/qxl_display.c
|
||||
+++ b/drivers/gpu/drm/qxl/qxl_display.c
|
||||
@@ -160,9 +160,35 @@ static int qxl_add_monitors_config_modes
|
||||
*pwidth = head->width;
|
||||
*pheight = head->height;
|
||||
drm_mode_probed_add(connector, mode);
|
||||
+ /* remember the last custom size for mode validation */
|
||||
+ qdev->monitors_config_width = mode->hdisplay;
|
||||
+ qdev->monitors_config_height = mode->vdisplay;
|
||||
return 1;
|
||||
}
|
||||
|
||||
+static struct mode_size {
|
||||
+ int w;
|
||||
+ int h;
|
||||
+} common_modes[] = {
|
||||
+ { 640, 480},
|
||||
+ { 720, 480},
|
||||
+ { 800, 600},
|
||||
+ { 848, 480},
|
||||
+ {1024, 768},
|
||||
+ {1152, 768},
|
||||
+ {1280, 720},
|
||||
+ {1280, 800},
|
||||
+ {1280, 854},
|
||||
+ {1280, 960},
|
||||
+ {1280, 1024},
|
||||
+ {1440, 900},
|
||||
+ {1400, 1050},
|
||||
+ {1680, 1050},
|
||||
+ {1600, 1200},
|
||||
+ {1920, 1080},
|
||||
+ {1920, 1200}
|
||||
+};
|
||||
+
|
||||
static int qxl_add_common_modes(struct drm_connector *connector,
|
||||
unsigned pwidth,
|
||||
unsigned pheight)
|
||||
@@ -170,29 +196,6 @@ static int qxl_add_common_modes(struct d
|
||||
struct drm_device *dev = connector->dev;
|
||||
struct drm_display_mode *mode = NULL;
|
||||
int i;
|
||||
- struct mode_size {
|
||||
- int w;
|
||||
- int h;
|
||||
- } common_modes[] = {
|
||||
- { 640, 480},
|
||||
- { 720, 480},
|
||||
- { 800, 600},
|
||||
- { 848, 480},
|
||||
- {1024, 768},
|
||||
- {1152, 768},
|
||||
- {1280, 720},
|
||||
- {1280, 800},
|
||||
- {1280, 854},
|
||||
- {1280, 960},
|
||||
- {1280, 1024},
|
||||
- {1440, 900},
|
||||
- {1400, 1050},
|
||||
- {1680, 1050},
|
||||
- {1600, 1200},
|
||||
- {1920, 1080},
|
||||
- {1920, 1200}
|
||||
- };
|
||||
-
|
||||
for (i = 0; i < ARRAY_SIZE(common_modes); i++) {
|
||||
mode = drm_cvt_mode(dev, common_modes[i].w, common_modes[i].h,
|
||||
60, false, false, false);
|
||||
@@ -823,11 +826,22 @@ static int qxl_conn_get_modes(struct drm
|
||||
static int qxl_conn_mode_valid(struct drm_connector *connector,
|
||||
struct drm_display_mode *mode)
|
||||
{
|
||||
+ struct drm_device *ddev = connector->dev;
|
||||
+ struct qxl_device *qdev = ddev->dev_private;
|
||||
+ int i;
|
||||
+
|
||||
/* TODO: is this called for user defined modes? (xrandr --add-mode)
|
||||
* TODO: check that the mode fits in the framebuffer */
|
||||
- DRM_DEBUG("%s: %dx%d status=%d\n", mode->name, mode->hdisplay,
|
||||
- mode->vdisplay, mode->status);
|
||||
- return MODE_OK;
|
||||
+
|
||||
+ if(qdev->monitors_config_width == mode->hdisplay &&
|
||||
+ qdev->monitors_config_height == mode->vdisplay)
|
||||
+ return MODE_OK;
|
||||
+
|
||||
+ for (i = 0; i < ARRAY_SIZE(common_modes); i++) {
|
||||
+ if (common_modes[i].w == mode->hdisplay && common_modes[i].h == mode->vdisplay)
|
||||
+ return MODE_OK;
|
||||
+ }
|
||||
+ return MODE_BAD;
|
||||
}
|
||||
|
||||
static struct drm_encoder *qxl_best_encoder(struct drm_connector *connector)
|
||||
--- a/drivers/gpu/drm/qxl/qxl_drv.h
|
||||
+++ b/drivers/gpu/drm/qxl/qxl_drv.h
|
||||
@@ -325,6 +325,8 @@ struct qxl_device {
|
||||
struct work_struct fb_work;
|
||||
|
||||
struct drm_property *hotplug_mode_update_property;
|
||||
+ int monitors_config_width;
|
||||
+ int monitors_config_height;
|
||||
};
|
||||
|
||||
/* forward declaration for QXL_INFO_IO */
|
||||
-39
@@ -1,39 +0,0 @@
|
||||
From 3f8340cc72c9a1a4b49bce7802afd7f248400ef5 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
|
||||
Date: Thu, 27 Aug 2015 17:23:31 +0300
|
||||
Subject: drm/radeon/atom: Send out the full AUX address
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
From: =?UTF-8?q?Ville=20Syrj=C3=A4l=C3=A4?= <ville.syrjala@linux.intel.com>
|
||||
|
||||
commit 3f8340cc72c9a1a4b49bce7802afd7f248400ef5 upstream.
|
||||
|
||||
AUX addresses are 20 bits long. Send out the entire address instead of
|
||||
just the low 16 bits.
|
||||
|
||||
Cc: Alex Deucher <alexander.deucher@amd.com>
|
||||
Cc: "Christian König" <christian.koenig@amd.com>
|
||||
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/radeon/atombios_dp.c | 5 +++--
|
||||
1 file changed, 3 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/radeon/atombios_dp.c
|
||||
+++ b/drivers/gpu/drm/radeon/atombios_dp.c
|
||||
@@ -171,8 +171,9 @@ radeon_dp_aux_transfer_atom(struct drm_d
|
||||
return -E2BIG;
|
||||
|
||||
tx_buf[0] = msg->address & 0xff;
|
||||
- tx_buf[1] = msg->address >> 8;
|
||||
- tx_buf[2] = msg->request << 4;
|
||||
+ tx_buf[1] = (msg->address >> 8) & 0xff;
|
||||
+ tx_buf[2] = (msg->request << 4) |
|
||||
+ ((msg->address >> 16) & 0xf);
|
||||
tx_buf[3] = msg->size ? (msg->size - 1) : 0;
|
||||
|
||||
switch (msg->request & ~DP_AUX_I2C_MOT) {
|
||||
-75
@@ -1,75 +0,0 @@
|
||||
From 924f92bf12bfbef3662619e3ed24a1cea7c1cbcd Mon Sep 17 00:00:00 2001
|
||||
From: Stephen Chandler Paul <cpaul@redhat.com>
|
||||
Date: Fri, 21 Aug 2015 14:16:12 -0400
|
||||
Subject: DRM - radeon: Don't link train DisplayPort on HPD until we get the dpcd
|
||||
|
||||
From: Stephen Chandler Paul <cpaul@redhat.com>
|
||||
|
||||
commit 924f92bf12bfbef3662619e3ed24a1cea7c1cbcd upstream.
|
||||
|
||||
Most of the time this isn't an issue since hotplugging an adaptor will
|
||||
trigger a crtc mode change which in turn, causes the driver to probe
|
||||
every DisplayPort for a dpcd. However, in cases where hotplugging
|
||||
doesn't cause a mode change (specifically when one unplugs a monitor
|
||||
from a DisplayPort connector, then plugs that same monitor back in
|
||||
seconds later on the same port without any other monitors connected), we
|
||||
never probe for the dpcd before starting the initial link training. What
|
||||
happens from there looks like this:
|
||||
|
||||
- GPU has only one monitor connected. It's connected via
|
||||
DisplayPort, and does not go through an adaptor of any sort.
|
||||
|
||||
- User unplugs DisplayPort connector from GPU.
|
||||
|
||||
- Change in HPD is detected by the driver, we probe every
|
||||
DisplayPort for a possible connection.
|
||||
|
||||
- Probe the port the user originally had the monitor connected
|
||||
on for it's dpcd. This fails, and we clear the first (and only
|
||||
the first) byte of the dpcd to indicate we no longer have a
|
||||
dpcd for this port.
|
||||
|
||||
- User plugs the previously disconnected monitor back into the
|
||||
same DisplayPort.
|
||||
|
||||
- radeon_connector_hotplug() is called before everyone else,
|
||||
and tries to handle the link training. Since only the first
|
||||
byte of the dpcd is zeroed, the driver is able to complete
|
||||
link training but does so against the wrong dpcd, causing it
|
||||
to initialize the link with the wrong settings.
|
||||
|
||||
- Display stays blank (usually), dpcd is probed after the
|
||||
initial link training, and the driver prints no obvious
|
||||
messages to the log.
|
||||
|
||||
In theory, since only one byte of the dpcd is chopped off (specifically,
|
||||
the byte that contains the revision information for DisplayPort), it's
|
||||
not entirely impossible that this bug may not show on certain monitors.
|
||||
For instance, the only reason this bug was visible on my ASUS PB238
|
||||
monitor was due to the fact that this monitor using the enhanced framing
|
||||
symbol sequence, the flag for which is ignored if the radeon driver
|
||||
thinks that the DisplayPort version is below 1.1.
|
||||
|
||||
Signed-off-by: Stephen Chandler Paul <cpaul@redhat.com>
|
||||
Reviewed-by: Jerome Glisse <jglisse@redhat.com>
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/radeon/radeon_connectors.c | 5 +++++
|
||||
1 file changed, 5 insertions(+)
|
||||
|
||||
--- a/drivers/gpu/drm/radeon/radeon_connectors.c
|
||||
+++ b/drivers/gpu/drm/radeon/radeon_connectors.c
|
||||
@@ -95,6 +95,11 @@ void radeon_connector_hotplug(struct drm
|
||||
if (!radeon_hpd_sense(rdev, radeon_connector->hpd.hpd)) {
|
||||
drm_helper_connector_dpms(connector, DRM_MODE_DPMS_OFF);
|
||||
} else if (radeon_dp_needs_link_train(radeon_connector)) {
|
||||
+ /* Don't try to start link training before we
|
||||
+ * have the dpcd */
|
||||
+ if (!radeon_dp_getdpcd(radeon_connector))
|
||||
+ return;
|
||||
+
|
||||
/* set it to OFF so that drm_helper_connector_dpms()
|
||||
* won't return immediately since the current state
|
||||
* is ON at this point.
|
||||
-47
@@ -1,47 +0,0 @@
|
||||
From 86b7709d48f0df8796bddd7e1ce45c6fb7a7c6ec Mon Sep 17 00:00:00 2001
|
||||
From: Alex Deucher <alexander.deucher@amd.com>
|
||||
Date: Thu, 27 Aug 2015 09:52:22 -0400
|
||||
Subject: drm/radeon: fix HDMI quantization_range for pre-DCE5 asics
|
||||
|
||||
From: Alex Deucher <alexander.deucher@amd.com>
|
||||
|
||||
commit 86b7709d48f0df8796bddd7e1ce45c6fb7a7c6ec upstream.
|
||||
|
||||
Support for output_csc is only available on DCE5 and newer so
|
||||
don't mess with the HDMI quantization_range on pre-DCE5 asics.
|
||||
|
||||
bug:
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=83226
|
||||
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/radeon/radeon_audio.c | 16 +++++++++-------
|
||||
1 file changed, 9 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/radeon/radeon_audio.c
|
||||
+++ b/drivers/gpu/drm/radeon/radeon_audio.c
|
||||
@@ -522,13 +522,15 @@ static int radeon_audio_set_avi_packet(s
|
||||
return err;
|
||||
}
|
||||
|
||||
- if (drm_rgb_quant_range_selectable(radeon_connector_edid(connector))) {
|
||||
- if (radeon_encoder->output_csc == RADEON_OUTPUT_CSC_TVRGB)
|
||||
- frame.quantization_range = HDMI_QUANTIZATION_RANGE_LIMITED;
|
||||
- else
|
||||
- frame.quantization_range = HDMI_QUANTIZATION_RANGE_FULL;
|
||||
- } else {
|
||||
- frame.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT;
|
||||
+ if (radeon_encoder->output_csc != RADEON_OUTPUT_CSC_BYPASS) {
|
||||
+ if (drm_rgb_quant_range_selectable(radeon_connector_edid(connector))) {
|
||||
+ if (radeon_encoder->output_csc == RADEON_OUTPUT_CSC_TVRGB)
|
||||
+ frame.quantization_range = HDMI_QUANTIZATION_RANGE_LIMITED;
|
||||
+ else
|
||||
+ frame.quantization_range = HDMI_QUANTIZATION_RANGE_FULL;
|
||||
+ } else {
|
||||
+ frame.quantization_range = HDMI_QUANTIZATION_RANGE_DEFAULT;
|
||||
+ }
|
||||
}
|
||||
|
||||
err = hdmi_avi_infoframe_pack(&frame, buffer, sizeof(buffer));
|
||||
-40
@@ -1,40 +0,0 @@
|
||||
From 7040c399aea2b0213a9aefd73e507369a6d641d6 Mon Sep 17 00:00:00 2001
|
||||
From: Alex Deucher <alexander.deucher@amd.com>
|
||||
Date: Mon, 31 Aug 2015 11:15:05 -0400
|
||||
Subject: drm/radeon/native: Send out the full AUX address
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
From: Alex Deucher <alexander.deucher@amd.com>
|
||||
|
||||
commit 7040c399aea2b0213a9aefd73e507369a6d641d6 upstream.
|
||||
|
||||
AUX addresses are 20 bits long. Send out the entire address instead of
|
||||
just the low 16 bits.
|
||||
|
||||
Port of:
|
||||
drm/radeon/atom: Send out the full AUX address
|
||||
to radeon non-atom aux path
|
||||
|
||||
Reviewed-by: Christian König <christian.koenig@amd.com>
|
||||
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/gpu/drm/radeon/radeon_dp_auxch.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/gpu/drm/radeon/radeon_dp_auxch.c
|
||||
+++ b/drivers/gpu/drm/radeon/radeon_dp_auxch.c
|
||||
@@ -116,8 +116,8 @@ radeon_dp_aux_transfer_native(struct drm
|
||||
AUX_SW_WR_BYTES(bytes));
|
||||
|
||||
/* write the data header into the registers */
|
||||
- /* request, addres, msg size */
|
||||
- byte = (msg->request << 4);
|
||||
+ /* request, address, msg size */
|
||||
+ byte = (msg->request << 4) | ((msg->address >> 16) & 0xf);
|
||||
WREG32(AUX_SW_DATA + aux_offset[instance],
|
||||
AUX_SW_DATA_MASK(byte) | AUX_SW_AUTOINCREMENT_DISABLE);
|
||||
|
||||
-70
@@ -1,70 +0,0 @@
|
||||
From c689a923c867eac40ed3826c1d9328edea8b6bc7 Mon Sep 17 00:00:00 2001
|
||||
From: Lars-Peter Clausen <lars@metafoo.de>
|
||||
Date: Wed, 5 Aug 2015 15:38:14 +0200
|
||||
Subject: iio: Add inverse unit conversion macros
|
||||
|
||||
From: Lars-Peter Clausen <lars@metafoo.de>
|
||||
|
||||
commit c689a923c867eac40ed3826c1d9328edea8b6bc7 upstream.
|
||||
|
||||
Add inverse unit conversion macro to convert from standard IIO units to
|
||||
units that might be used by some devices.
|
||||
|
||||
Those are useful in combination with scale factors that are specified as
|
||||
IIO_VAL_FRACTIONAL. Typically the denominator for those specifications will
|
||||
contain the maximum raw value the sensor will generate and the numerator
|
||||
the value it maps to in a specific unit. Sometimes datasheets specify those
|
||||
in different units than the standard IIO units (e.g. degree/s instead of
|
||||
rad/s) and so we need to do a unit conversion.
|
||||
|
||||
From a mathematical point of view it does not make a difference whether we
|
||||
apply the unit conversion to the numerator or the inverse unit conversion
|
||||
to the denominator since (x / y) / z = x / (y * z). But as the denominator
|
||||
is typically a larger value and we are rounding both the numerator and
|
||||
denominator to integer values using the later method gives us a better
|
||||
precision (E.g. the relative error is smaller if we round 8000.3 to 8000
|
||||
rather than rounding 8.3 to 8).
|
||||
|
||||
This is where in inverse unit conversion macros will be used.
|
||||
|
||||
Marked for stable as used by some upcoming fixes.
|
||||
|
||||
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
|
||||
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
include/linux/iio/iio.h | 17 +++++++++++++++++
|
||||
1 file changed, 17 insertions(+)
|
||||
|
||||
--- a/include/linux/iio/iio.h
|
||||
+++ b/include/linux/iio/iio.h
|
||||
@@ -642,6 +642,15 @@ int iio_str_to_fixpoint(const char *str,
|
||||
#define IIO_DEGREE_TO_RAD(deg) (((deg) * 314159ULL + 9000000ULL) / 18000000ULL)
|
||||
|
||||
/**
|
||||
+ * IIO_RAD_TO_DEGREE() - Convert rad to degree
|
||||
+ * @rad: A value in rad
|
||||
+ *
|
||||
+ * Returns the given value converted from rad to degree
|
||||
+ */
|
||||
+#define IIO_RAD_TO_DEGREE(rad) \
|
||||
+ (((rad) * 18000000ULL + 314159ULL / 2) / 314159ULL)
|
||||
+
|
||||
+/**
|
||||
* IIO_G_TO_M_S_2() - Convert g to meter / second**2
|
||||
* @g: A value in g
|
||||
*
|
||||
@@ -649,4 +658,12 @@ int iio_str_to_fixpoint(const char *str,
|
||||
*/
|
||||
#define IIO_G_TO_M_S_2(g) ((g) * 980665ULL / 100000ULL)
|
||||
|
||||
+/**
|
||||
+ * IIO_M_S_2_TO_G() - Convert meter / second**2 to g
|
||||
+ * @ms2: A value in meter / second**2
|
||||
+ *
|
||||
+ * Returns the given value converted from meter / second**2 to g
|
||||
+ */
|
||||
+#define IIO_M_S_2_TO_G(ms2) (((ms2) * 100000ULL + 980665ULL / 2) / 980665ULL)
|
||||
+
|
||||
#endif /* _INDUSTRIAL_IO_H_ */
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
From 8166537283b31d7abaae9e56bd48fbbc30cdc579 Mon Sep 17 00:00:00 2001
|
||||
From: Lars-Peter Clausen <lars@metafoo.de>
|
||||
Date: Wed, 5 Aug 2015 15:38:13 +0200
|
||||
Subject: iio: adis16400: Fix adis16448 gyroscope scale
|
||||
|
||||
From: Lars-Peter Clausen <lars@metafoo.de>
|
||||
|
||||
commit 8166537283b31d7abaae9e56bd48fbbc30cdc579 upstream.
|
||||
|
||||
Use the correct scale for the adis16448 gyroscope output.
|
||||
|
||||
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
|
||||
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/iio/imu/adis16400_core.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/iio/imu/adis16400_core.c
|
||||
+++ b/drivers/iio/imu/adis16400_core.c
|
||||
@@ -780,7 +780,7 @@ static struct adis16400_chip_info adis16
|
||||
.flags = ADIS16400_HAS_PROD_ID |
|
||||
ADIS16400_HAS_SERIAL_NUMBER |
|
||||
ADIS16400_BURST_DIAG_STAT,
|
||||
- .gyro_scale_micro = IIO_DEGREE_TO_RAD(10000), /* 0.01 deg/s */
|
||||
+ .gyro_scale_micro = IIO_DEGREE_TO_RAD(40000), /* 0.04 deg/s */
|
||||
.accel_scale_micro = IIO_G_TO_M_S_2(833), /* 1/1200 g */
|
||||
.temp_scale_nano = 73860000, /* 0.07386 C */
|
||||
.temp_offset = 31000000 / 73860, /* 31 C = 0x00 */
|
||||
@@ -1,101 +0,0 @@
|
||||
From 7abad1063deb0f77d275c61f58863ec319c58c5c Mon Sep 17 00:00:00 2001
|
||||
From: Lars-Peter Clausen <lars@metafoo.de>
|
||||
Date: Wed, 5 Aug 2015 15:38:15 +0200
|
||||
Subject: iio: adis16480: Fix scale factors
|
||||
|
||||
From: Lars-Peter Clausen <lars@metafoo.de>
|
||||
|
||||
commit 7abad1063deb0f77d275c61f58863ec319c58c5c upstream.
|
||||
|
||||
The different devices support by the adis16480 driver have slightly
|
||||
different scales for the gyroscope and accelerometer channels.
|
||||
|
||||
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
|
||||
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/iio/imu/adis16480.c | 39 +++++++++++++++++++++++++++++++++------
|
||||
1 file changed, 33 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/iio/imu/adis16480.c
|
||||
+++ b/drivers/iio/imu/adis16480.c
|
||||
@@ -110,6 +110,10 @@
|
||||
struct adis16480_chip_info {
|
||||
unsigned int num_channels;
|
||||
const struct iio_chan_spec *channels;
|
||||
+ unsigned int gyro_max_val;
|
||||
+ unsigned int gyro_max_scale;
|
||||
+ unsigned int accel_max_val;
|
||||
+ unsigned int accel_max_scale;
|
||||
};
|
||||
|
||||
struct adis16480 {
|
||||
@@ -497,19 +501,21 @@ static int adis16480_set_filter_freq(str
|
||||
static int adis16480_read_raw(struct iio_dev *indio_dev,
|
||||
const struct iio_chan_spec *chan, int *val, int *val2, long info)
|
||||
{
|
||||
+ struct adis16480 *st = iio_priv(indio_dev);
|
||||
+
|
||||
switch (info) {
|
||||
case IIO_CHAN_INFO_RAW:
|
||||
return adis_single_conversion(indio_dev, chan, 0, val);
|
||||
case IIO_CHAN_INFO_SCALE:
|
||||
switch (chan->type) {
|
||||
case IIO_ANGL_VEL:
|
||||
- *val = 0;
|
||||
- *val2 = IIO_DEGREE_TO_RAD(20000); /* 0.02 degree/sec */
|
||||
- return IIO_VAL_INT_PLUS_MICRO;
|
||||
+ *val = st->chip_info->gyro_max_scale;
|
||||
+ *val2 = st->chip_info->gyro_max_val;
|
||||
+ return IIO_VAL_FRACTIONAL;
|
||||
case IIO_ACCEL:
|
||||
- *val = 0;
|
||||
- *val2 = IIO_G_TO_M_S_2(800); /* 0.8 mg */
|
||||
- return IIO_VAL_INT_PLUS_MICRO;
|
||||
+ *val = st->chip_info->accel_max_scale;
|
||||
+ *val2 = st->chip_info->accel_max_val;
|
||||
+ return IIO_VAL_FRACTIONAL;
|
||||
case IIO_MAGN:
|
||||
*val = 0;
|
||||
*val2 = 100; /* 0.0001 gauss */
|
||||
@@ -674,18 +680,39 @@ static const struct adis16480_chip_info
|
||||
[ADIS16375] = {
|
||||
.channels = adis16485_channels,
|
||||
.num_channels = ARRAY_SIZE(adis16485_channels),
|
||||
+ /*
|
||||
+ * storing the value in rad/degree and the scale in degree
|
||||
+ * gives us the result in rad and better precession than
|
||||
+ * storing the scale directly in rad.
|
||||
+ */
|
||||
+ .gyro_max_val = IIO_RAD_TO_DEGREE(22887),
|
||||
+ .gyro_max_scale = 300,
|
||||
+ .accel_max_val = IIO_M_S_2_TO_G(21973),
|
||||
+ .accel_max_scale = 18,
|
||||
},
|
||||
[ADIS16480] = {
|
||||
.channels = adis16480_channels,
|
||||
.num_channels = ARRAY_SIZE(adis16480_channels),
|
||||
+ .gyro_max_val = IIO_RAD_TO_DEGREE(22500),
|
||||
+ .gyro_max_scale = 450,
|
||||
+ .accel_max_val = IIO_M_S_2_TO_G(12500),
|
||||
+ .accel_max_scale = 5,
|
||||
},
|
||||
[ADIS16485] = {
|
||||
.channels = adis16485_channels,
|
||||
.num_channels = ARRAY_SIZE(adis16485_channels),
|
||||
+ .gyro_max_val = IIO_RAD_TO_DEGREE(22500),
|
||||
+ .gyro_max_scale = 450,
|
||||
+ .accel_max_val = IIO_M_S_2_TO_G(20000),
|
||||
+ .accel_max_scale = 5,
|
||||
},
|
||||
[ADIS16488] = {
|
||||
.channels = adis16480_channels,
|
||||
.num_channels = ARRAY_SIZE(adis16480_channels),
|
||||
+ .gyro_max_val = IIO_RAD_TO_DEGREE(22500),
|
||||
+ .gyro_max_scale = 450,
|
||||
+ .accel_max_val = IIO_M_S_2_TO_G(22500),
|
||||
+ .accel_max_scale = 18,
|
||||
},
|
||||
};
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
From 06d2f6ca5a38abe92f1f3a132b331eee773868c3 Mon Sep 17 00:00:00 2001
|
||||
From: Markus Pargmann <mpa@pengutronix.de>
|
||||
Date: Wed, 29 Jul 2015 15:46:03 +0200
|
||||
Subject: iio: bmg160: IIO_BUFFER and IIO_TRIGGERED_BUFFER are required
|
||||
|
||||
From: Markus Pargmann <mpa@pengutronix.de>
|
||||
|
||||
commit 06d2f6ca5a38abe92f1f3a132b331eee773868c3 upstream.
|
||||
|
||||
This patch adds selects for IIO_BUFFER and IIO_TRIGGERED_BUFFER. Without
|
||||
IIO_BUFFER, the driver does not compile.
|
||||
|
||||
Signed-off-by: Markus Pargmann <mpa@pengutronix.de>
|
||||
Reviewed-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
|
||||
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/iio/gyro/Kconfig | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/iio/gyro/Kconfig
|
||||
+++ b/drivers/iio/gyro/Kconfig
|
||||
@@ -53,7 +53,8 @@ config ADXRS450
|
||||
config BMG160
|
||||
tristate "BOSCH BMG160 Gyro Sensor"
|
||||
depends on I2C
|
||||
- select IIO_TRIGGERED_BUFFER if IIO_BUFFER
|
||||
+ select IIO_BUFFER
|
||||
+ select IIO_TRIGGERED_BUFFER
|
||||
help
|
||||
Say yes here to build support for Bosch BMG160 Tri-axis Gyro Sensor
|
||||
driver. This driver also supports BMI055 gyroscope.
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
From 41d903c00051d8f31c98a8136edbac67e6f8688f Mon Sep 17 00:00:00 2001
|
||||
From: Cristina Opriceana <cristina.opriceana@gmail.com>
|
||||
Date: Mon, 3 Aug 2015 13:00:47 +0300
|
||||
Subject: iio: event: Remove negative error code from iio_event_poll
|
||||
|
||||
From: Cristina Opriceana <cristina.opriceana@gmail.com>
|
||||
|
||||
commit 41d903c00051d8f31c98a8136edbac67e6f8688f upstream.
|
||||
|
||||
Negative return values are not supported by iio_event_poll since
|
||||
its return type is unsigned int.
|
||||
|
||||
Fixes: f18e7a068a0a3 ("iio: Return -ENODEV for file operations if the device has been unregistered")
|
||||
|
||||
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
|
||||
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/iio/industrialio-event.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/iio/industrialio-event.c
|
||||
+++ b/drivers/iio/industrialio-event.c
|
||||
@@ -84,7 +84,7 @@ static unsigned int iio_event_poll(struc
|
||||
unsigned int events = 0;
|
||||
|
||||
if (!indio_dev->info)
|
||||
- return -ENODEV;
|
||||
+ return events;
|
||||
|
||||
poll_wait(filep, &ev_int->wait, wait);
|
||||
|
||||
-34
@@ -1,34 +0,0 @@
|
||||
From 1bdc0293901cbea23c6dc29432e81919d4719844 Mon Sep 17 00:00:00 2001
|
||||
From: Cristina Opriceana <cristina.opriceana@gmail.com>
|
||||
Date: Mon, 3 Aug 2015 13:37:40 +0300
|
||||
Subject: iio: industrialio-buffer: Fix iio_buffer_poll return value
|
||||
|
||||
From: Cristina Opriceana <cristina.opriceana@gmail.com>
|
||||
|
||||
commit 1bdc0293901cbea23c6dc29432e81919d4719844 upstream.
|
||||
|
||||
Change return value to 0 if no device is bound since
|
||||
unsigned int cannot support negative error codes.
|
||||
|
||||
Fixes: f18e7a068 ("iio: Return -ENODEV for file operations if the
|
||||
device has been unregistered")
|
||||
|
||||
Signed-off-by: Cristina Opriceana <cristina.opriceana@gmail.com>
|
||||
Signed-off-by: Jonathan Cameron <jic23@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/iio/industrialio-buffer.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/iio/industrialio-buffer.c
|
||||
+++ b/drivers/iio/industrialio-buffer.c
|
||||
@@ -151,7 +151,7 @@ unsigned int iio_buffer_poll(struct file
|
||||
struct iio_buffer *rb = indio_dev->buffer;
|
||||
|
||||
if (!indio_dev->info)
|
||||
- return -ENODEV;
|
||||
+ return 0;
|
||||
|
||||
poll_wait(filp, &rb->pollq, wait);
|
||||
if (iio_buffer_ready(indio_dev, rb, rb->watermark, 0))
|
||||
-37
@@ -1,37 +0,0 @@
|
||||
From 2f123bce18943fff819bc10f8868ffb9149fc622 Mon Sep 17 00:00:00 2001
|
||||
From: "Darrick J. Wong" <darrick.wong@oracle.com>
|
||||
Date: Wed, 19 Aug 2015 10:33:58 +1000
|
||||
Subject: libxfs: readahead of dir3 data blocks should use the read verifier
|
||||
|
||||
From: "Darrick J. Wong" <darrick.wong@oracle.com>
|
||||
|
||||
commit 2f123bce18943fff819bc10f8868ffb9149fc622 upstream.
|
||||
|
||||
In the dir3 data block readahead function, use the regular read
|
||||
verifier to check the block's CRC and spot-check the block contents
|
||||
instead of directly calling only the spot-checking routine. This
|
||||
prevents corrupted directory data blocks from being read into the
|
||||
kernel, which can lead to garbage ls output and directory loops (if
|
||||
say one of the entries contains slashes and other junk).
|
||||
|
||||
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
|
||||
Reviewed-by: Dave Chinner <dchinner@redhat.com>
|
||||
Signed-off-by: Dave Chinner <david@fromorbit.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
fs/xfs/libxfs/xfs_dir2_data.c | 3 ++-
|
||||
1 file changed, 2 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/fs/xfs/libxfs/xfs_dir2_data.c
|
||||
+++ b/fs/xfs/libxfs/xfs_dir2_data.c
|
||||
@@ -252,7 +252,8 @@ xfs_dir3_data_reada_verify(
|
||||
return;
|
||||
case cpu_to_be32(XFS_DIR2_DATA_MAGIC):
|
||||
case cpu_to_be32(XFS_DIR3_DATA_MAGIC):
|
||||
- xfs_dir3_data_verify(bp);
|
||||
+ bp->b_ops = &xfs_dir3_data_buf_ops;
|
||||
+ bp->b_ops->verify_read(bp);
|
||||
return;
|
||||
default:
|
||||
xfs_buf_ioerror(bp, -EFSCORRUPTED);
|
||||
-135
@@ -1,135 +0,0 @@
|
||||
From 932c435caba8a2ce473a91753bad0173269ef334 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Rustad <mark.d.rustad@intel.com>
|
||||
Date: Mon, 13 Jul 2015 11:40:02 -0700
|
||||
Subject: PCI: Add dev_flags bit to access VPD through function 0
|
||||
|
||||
From: Mark Rustad <mark.d.rustad@intel.com>
|
||||
|
||||
commit 932c435caba8a2ce473a91753bad0173269ef334 upstream.
|
||||
|
||||
Add a dev_flags bit, PCI_DEV_FLAGS_VPD_REF_F0, to access VPD through
|
||||
function 0 to provide VPD access on other functions. This is for hardware
|
||||
devices that provide copies of the same VPD capability registers in
|
||||
multiple functions. Because the kernel expects that each function has its
|
||||
own registers, both the locking and the state tracking are affected by VPD
|
||||
accesses to different functions.
|
||||
|
||||
On such devices for example, if a VPD write is performed on function 0,
|
||||
*any* later attempt to read VPD from any other function of that device will
|
||||
hang. This has to do with how the kernel tracks the expected value of the
|
||||
F bit per function.
|
||||
|
||||
Concurrent accesses to different functions of the same device can not only
|
||||
hang but also corrupt both read and write VPD data.
|
||||
|
||||
When hangs occur, typically the error message:
|
||||
|
||||
vpd r/w failed. This is likely a firmware bug on this device.
|
||||
|
||||
will be seen.
|
||||
|
||||
Never set this bit on function 0 or there will be an infinite recursion.
|
||||
|
||||
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Acked-by: Alexander Duyck <alexander.h.duyck@redhat.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/pci/access.c | 61 ++++++++++++++++++++++++++++++++++++++++++++++++++-
|
||||
include/linux/pci.h | 2 +
|
||||
2 files changed, 62 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/pci/access.c
|
||||
+++ b/drivers/pci/access.c
|
||||
@@ -439,6 +439,56 @@ static const struct pci_vpd_ops pci_vpd_
|
||||
.release = pci_vpd_pci22_release,
|
||||
};
|
||||
|
||||
+static ssize_t pci_vpd_f0_read(struct pci_dev *dev, loff_t pos, size_t count,
|
||||
+ void *arg)
|
||||
+{
|
||||
+ struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
|
||||
+ ssize_t ret;
|
||||
+
|
||||
+ if (!tdev)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ ret = pci_read_vpd(tdev, pos, count, arg);
|
||||
+ pci_dev_put(tdev);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static ssize_t pci_vpd_f0_write(struct pci_dev *dev, loff_t pos, size_t count,
|
||||
+ const void *arg)
|
||||
+{
|
||||
+ struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
|
||||
+ ssize_t ret;
|
||||
+
|
||||
+ if (!tdev)
|
||||
+ return -ENODEV;
|
||||
+
|
||||
+ ret = pci_write_vpd(tdev, pos, count, arg);
|
||||
+ pci_dev_put(tdev);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
+static const struct pci_vpd_ops pci_vpd_f0_ops = {
|
||||
+ .read = pci_vpd_f0_read,
|
||||
+ .write = pci_vpd_f0_write,
|
||||
+ .release = pci_vpd_pci22_release,
|
||||
+};
|
||||
+
|
||||
+static int pci_vpd_f0_dev_check(struct pci_dev *dev)
|
||||
+{
|
||||
+ struct pci_dev *tdev = pci_get_slot(dev->bus, PCI_SLOT(dev->devfn));
|
||||
+ int ret = 0;
|
||||
+
|
||||
+ if (!tdev)
|
||||
+ return -ENODEV;
|
||||
+ if (!tdev->vpd || !tdev->multifunction ||
|
||||
+ dev->class != tdev->class || dev->vendor != tdev->vendor ||
|
||||
+ dev->device != tdev->device)
|
||||
+ ret = -ENODEV;
|
||||
+
|
||||
+ pci_dev_put(tdev);
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
int pci_vpd_pci22_init(struct pci_dev *dev)
|
||||
{
|
||||
struct pci_vpd_pci22 *vpd;
|
||||
@@ -447,12 +497,21 @@ int pci_vpd_pci22_init(struct pci_dev *d
|
||||
cap = pci_find_capability(dev, PCI_CAP_ID_VPD);
|
||||
if (!cap)
|
||||
return -ENODEV;
|
||||
+ if (dev->dev_flags & PCI_DEV_FLAGS_VPD_REF_F0) {
|
||||
+ int ret = pci_vpd_f0_dev_check(dev);
|
||||
+
|
||||
+ if (ret)
|
||||
+ return ret;
|
||||
+ }
|
||||
vpd = kzalloc(sizeof(*vpd), GFP_ATOMIC);
|
||||
if (!vpd)
|
||||
return -ENOMEM;
|
||||
|
||||
vpd->base.len = PCI_VPD_PCI22_SIZE;
|
||||
- vpd->base.ops = &pci_vpd_pci22_ops;
|
||||
+ if (dev->dev_flags & PCI_DEV_FLAGS_VPD_REF_F0)
|
||||
+ vpd->base.ops = &pci_vpd_f0_ops;
|
||||
+ else
|
||||
+ vpd->base.ops = &pci_vpd_pci22_ops;
|
||||
mutex_init(&vpd->lock);
|
||||
vpd->cap = cap;
|
||||
vpd->busy = false;
|
||||
--- a/include/linux/pci.h
|
||||
+++ b/include/linux/pci.h
|
||||
@@ -180,6 +180,8 @@ enum pci_dev_flags {
|
||||
PCI_DEV_FLAGS_NO_BUS_RESET = (__force pci_dev_flags_t) (1 << 6),
|
||||
/* Do not use PM reset even if device advertises NoSoftRst- */
|
||||
PCI_DEV_FLAGS_NO_PM_RESET = (__force pci_dev_flags_t) (1 << 7),
|
||||
+ /* Get VPD from function 0 VPD */
|
||||
+ PCI_DEV_FLAGS_VPD_REF_F0 = (__force pci_dev_flags_t) (1 << 8),
|
||||
};
|
||||
|
||||
enum pci_irq_reroute_variant {
|
||||
-41
@@ -1,41 +0,0 @@
|
||||
From 7aa6ca4d39edf01f997b9e02cf6d2fdeb224f351 Mon Sep 17 00:00:00 2001
|
||||
From: Mark Rustad <mark.d.rustad@intel.com>
|
||||
Date: Mon, 13 Jul 2015 11:40:07 -0700
|
||||
Subject: PCI: Add VPD function 0 quirk for Intel Ethernet devices
|
||||
|
||||
From: Mark Rustad <mark.d.rustad@intel.com>
|
||||
|
||||
commit 7aa6ca4d39edf01f997b9e02cf6d2fdeb224f351 upstream.
|
||||
|
||||
Set the PCI_DEV_FLAGS_VPD_REF_F0 flag on all Intel Ethernet device
|
||||
functions other than function 0, so that on multi-function devices, we will
|
||||
always read VPD from function 0 instead of from the other functions.
|
||||
|
||||
[bhelgaas: changelog]
|
||||
Signed-off-by: Mark Rustad <mark.d.rustad@intel.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Acked-by: Alexander Duyck <alexander.h.duyck@redhat.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/pci/quirks.c | 9 +++++++++
|
||||
1 file changed, 9 insertions(+)
|
||||
|
||||
--- a/drivers/pci/quirks.c
|
||||
+++ b/drivers/pci/quirks.c
|
||||
@@ -1903,6 +1903,15 @@ static void quirk_netmos(struct pci_dev
|
||||
DECLARE_PCI_FIXUP_CLASS_HEADER(PCI_VENDOR_ID_NETMOS, PCI_ANY_ID,
|
||||
PCI_CLASS_COMMUNICATION_SERIAL, 8, quirk_netmos);
|
||||
|
||||
+static void quirk_f0_vpd_link(struct pci_dev *dev)
|
||||
+{
|
||||
+ if (!dev->multifunction || !PCI_FUNC(dev->devfn))
|
||||
+ return;
|
||||
+ dev->dev_flags |= PCI_DEV_FLAGS_VPD_REF_F0;
|
||||
+}
|
||||
+DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
|
||||
+ PCI_CLASS_NETWORK_ETHERNET, 8, quirk_f0_vpd_link);
|
||||
+
|
||||
static void quirk_e100_interrupt(struct pci_dev *dev)
|
||||
{
|
||||
u16 command, pmcsr;
|
||||
-120
@@ -1,120 +0,0 @@
|
||||
From 91f15fb30c77d4a0d0d9b97e5cec647650853145 Mon Sep 17 00:00:00 2001
|
||||
From: Zhang Rui <rui.zhang@intel.com>
|
||||
Date: Mon, 24 Aug 2015 15:27:11 -0500
|
||||
Subject: PCI: Disable async suspend/resume for JMicron multi-function SATA/AHCI
|
||||
|
||||
From: Zhang Rui <rui.zhang@intel.com>
|
||||
|
||||
commit 91f15fb30c77d4a0d0d9b97e5cec647650853145 upstream.
|
||||
|
||||
On multi-function JMicron SATA/PATA/AHCI devices, the PATA controller at
|
||||
function 1 doesn't work if it is powered on before the SATA controller at
|
||||
function 0. The result is that PATA doesn't work after resume, and we
|
||||
print messages like this:
|
||||
|
||||
pata_jmicron 0000:02:00.1: Refused to change power state, currently in D3
|
||||
irq 17: nobody cared (try booting with the "irqpoll" option)
|
||||
|
||||
Async resume was introduced in v3.15 by 76569faa62c4 ("PM / sleep:
|
||||
Asynchronous threads for resume_noirq"). Prior to that, we powered on
|
||||
the functions in order, so this problem shouldn't happen.
|
||||
|
||||
e6b7e41cdd8c ("ata: Disabling the async PM for JMicron chip 363/361")
|
||||
solved the problem for JMicron 361 and 363 devices. With async suspend
|
||||
disabled, we always power on function 0 before function 1.
|
||||
|
||||
Barto then reported the same problem with a JMicron 368 (see comment #57 in
|
||||
the bugzilla).
|
||||
|
||||
Rather than extending the blacklist piecemeal, disable async suspend for
|
||||
all JMicron multi-function SATA/PATA/AHCI devices.
|
||||
|
||||
This quirk could stay in the ahci and pata_jmicron drivers, but it's likely
|
||||
the problem will occur even if pata_jmicron isn't loaded until after the
|
||||
suspend/resume. Making it a PCI quirk ensures that we'll preserve the
|
||||
power-on order even if the drivers aren't loaded.
|
||||
|
||||
[bhelgaas: changelog, limit to multi-function, limit to IDE/ATA]
|
||||
Link: https://bugzilla.kernel.org/show_bug.cgi?id=81551
|
||||
Reported-and-tested-by: Barto <mister.freeman@laposte.net>
|
||||
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/ata/ahci.c | 13 +------------
|
||||
drivers/ata/pata_jmicron.c | 12 ------------
|
||||
drivers/pci/quirks.c | 12 ++++++++++++
|
||||
3 files changed, 13 insertions(+), 24 deletions(-)
|
||||
|
||||
--- a/drivers/ata/ahci.c
|
||||
+++ b/drivers/ata/ahci.c
|
||||
@@ -349,6 +349,7 @@ static const struct pci_device_id ahci_p
|
||||
/* JMicron 362B and 362C have an AHCI function with IDE class code */
|
||||
{ PCI_VDEVICE(JMICRON, 0x2362), board_ahci_ign_iferr },
|
||||
{ PCI_VDEVICE(JMICRON, 0x236f), board_ahci_ign_iferr },
|
||||
+ /* May need to update quirk_jmicron_async_suspend() for additions */
|
||||
|
||||
/* ATI */
|
||||
{ PCI_VDEVICE(ATI, 0x4380), board_ahci_sb600 }, /* ATI SB600 */
|
||||
@@ -1377,18 +1378,6 @@ static int ahci_init_one(struct pci_dev
|
||||
else if (pdev->vendor == 0x1c44 && pdev->device == 0x8000)
|
||||
ahci_pci_bar = AHCI_PCI_BAR_ENMOTUS;
|
||||
|
||||
- /*
|
||||
- * The JMicron chip 361/363 contains one SATA controller and one
|
||||
- * PATA controller,for powering on these both controllers, we must
|
||||
- * follow the sequence one by one, otherwise one of them can not be
|
||||
- * powered on successfully, so here we disable the async suspend
|
||||
- * method for these chips.
|
||||
- */
|
||||
- if (pdev->vendor == PCI_VENDOR_ID_JMICRON &&
|
||||
- (pdev->device == PCI_DEVICE_ID_JMICRON_JMB363 ||
|
||||
- pdev->device == PCI_DEVICE_ID_JMICRON_JMB361))
|
||||
- device_disable_async_suspend(&pdev->dev);
|
||||
-
|
||||
/* acquire resources */
|
||||
rc = pcim_enable_device(pdev);
|
||||
if (rc)
|
||||
--- a/drivers/ata/pata_jmicron.c
|
||||
+++ b/drivers/ata/pata_jmicron.c
|
||||
@@ -143,18 +143,6 @@ static int jmicron_init_one (struct pci_
|
||||
};
|
||||
const struct ata_port_info *ppi[] = { &info, NULL };
|
||||
|
||||
- /*
|
||||
- * The JMicron chip 361/363 contains one SATA controller and one
|
||||
- * PATA controller,for powering on these both controllers, we must
|
||||
- * follow the sequence one by one, otherwise one of them can not be
|
||||
- * powered on successfully, so here we disable the async suspend
|
||||
- * method for these chips.
|
||||
- */
|
||||
- if (pdev->vendor == PCI_VENDOR_ID_JMICRON &&
|
||||
- (pdev->device == PCI_DEVICE_ID_JMICRON_JMB363 ||
|
||||
- pdev->device == PCI_DEVICE_ID_JMICRON_JMB361))
|
||||
- device_disable_async_suspend(&pdev->dev);
|
||||
-
|
||||
return ata_pci_bmdma_init_one(pdev, ppi, &jmicron_sht, NULL, 0);
|
||||
}
|
||||
|
||||
--- a/drivers/pci/quirks.c
|
||||
+++ b/drivers/pci/quirks.c
|
||||
@@ -1576,6 +1576,18 @@ DECLARE_PCI_FIXUP_RESUME_EARLY(PCI_VENDO
|
||||
|
||||
#endif
|
||||
|
||||
+static void quirk_jmicron_async_suspend(struct pci_dev *dev)
|
||||
+{
|
||||
+ if (dev->multifunction) {
|
||||
+ device_disable_async_suspend(&dev->dev);
|
||||
+ dev_info(&dev->dev, "async suspend disabled to avoid multi-function power-on ordering issue\n");
|
||||
+ }
|
||||
+}
|
||||
+DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_CLASS_STORAGE_IDE, 8, quirk_jmicron_async_suspend);
|
||||
+DECLARE_PCI_FIXUP_CLASS_FINAL(PCI_VENDOR_ID_JMICRON, PCI_ANY_ID, PCI_CLASS_STORAGE_SATA_AHCI, 0, quirk_jmicron_async_suspend);
|
||||
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_JMICRON, 0x2362, quirk_jmicron_async_suspend);
|
||||
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_JMICRON, 0x236f, quirk_jmicron_async_suspend);
|
||||
+
|
||||
#ifdef CONFIG_X86_IO_APIC
|
||||
static void quirk_alder_ioapic(struct pci_dev *pdev)
|
||||
{
|
||||
@@ -1,45 +0,0 @@
|
||||
From d1541dc977d376406f4584d8eb055488655c98ec Mon Sep 17 00:00:00 2001
|
||||
From: Bjorn Helgaas <bhelgaas@google.com>
|
||||
Date: Fri, 19 Jun 2015 15:58:24 -0500
|
||||
Subject: PCI: Fix TI816X class code quirk
|
||||
|
||||
From: Bjorn Helgaas <bhelgaas@google.com>
|
||||
|
||||
commit d1541dc977d376406f4584d8eb055488655c98ec upstream.
|
||||
|
||||
In fixup_ti816x_class(), we assigned "class = PCI_CLASS_MULTIMEDIA_VIDEO".
|
||||
But PCI_CLASS_MULTIMEDIA_VIDEO is only the two-byte base class/sub-class
|
||||
and needs to be shifted to make space for the low-order interface byte.
|
||||
|
||||
Shift PCI_CLASS_MULTIMEDIA_VIDEO to set the correct class code.
|
||||
|
||||
Fixes: 63c4408074cb ("PCI: Add quirk for setting valid class for TI816X Endpoint")
|
||||
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
|
||||
CC: Hemant Pedanekar <hemantp@ti.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/pci/quirks.c | 9 ++++++---
|
||||
1 file changed, 6 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/pci/quirks.c
|
||||
+++ b/drivers/pci/quirks.c
|
||||
@@ -2838,12 +2838,15 @@ DECLARE_PCI_FIXUP_EARLY(PCI_VENDOR_ID_IN
|
||||
|
||||
static void fixup_ti816x_class(struct pci_dev *dev)
|
||||
{
|
||||
+ u32 class = dev->class;
|
||||
+
|
||||
/* TI 816x devices do not have class code set when in PCIe boot mode */
|
||||
- dev_info(&dev->dev, "Setting PCI class for 816x PCIe device\n");
|
||||
- dev->class = PCI_CLASS_MULTIMEDIA_VIDEO;
|
||||
+ dev->class = PCI_CLASS_MULTIMEDIA_VIDEO << 8;
|
||||
+ dev_info(&dev->dev, "PCI class overridden (%#08x -> %#08x)\n",
|
||||
+ class, dev->class);
|
||||
}
|
||||
DECLARE_PCI_FIXUP_CLASS_EARLY(PCI_VENDOR_ID_TI, 0xb800,
|
||||
- PCI_CLASS_NOT_DEFINED, 0, fixup_ti816x_class);
|
||||
+ PCI_CLASS_NOT_DEFINED, 0, fixup_ti816x_class);
|
||||
|
||||
/* Some PCIe devices do not work reliably with the claimed maximum
|
||||
* payload size supported.
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
From f4745a92781b872455f32feb01d1dce92aefcb6c Mon Sep 17 00:00:00 2001
|
||||
From: Colin Ian King <colin.king@canonical.com>
|
||||
Date: Mon, 29 Jun 2015 22:13:38 +0100
|
||||
Subject: PM / clk: don't return int on __pm_clk_enable()
|
||||
|
||||
From: Colin Ian King <colin.king@canonical.com>
|
||||
|
||||
commit f4745a92781b872455f32feb01d1dce92aefcb6c upstream.
|
||||
|
||||
Static analysis by cppcheck found an issue that was recently introduced by
|
||||
commit 471f7707b6f0b1 ("PM / clock_ops: make __pm_clk_enable more generic")
|
||||
where a return status in ret was not being initialised and garbage
|
||||
being returned when ce->status >= PCE_STATUS_ERROR.
|
||||
|
||||
The fact that ret is not being checked by the caller and that
|
||||
ret is only used internally __pm_clk_enable() to check if clk_enable()
|
||||
was OK means we can ignore returning it instead turn
|
||||
__pm_clk_enable() into function with a void return.
|
||||
|
||||
Fixes: 471f7707b6f0b1 ("PM / clock_ops: make __pm_clk_enable more generic")
|
||||
Signed-off-by: Colin Ian King <colin.king@canonical.com>
|
||||
Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/base/power/clock_ops.c | 4 +---
|
||||
1 file changed, 1 insertion(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/base/power/clock_ops.c
|
||||
+++ b/drivers/base/power/clock_ops.c
|
||||
@@ -37,7 +37,7 @@ struct pm_clock_entry {
|
||||
* @dev: The device for the given clock
|
||||
* @ce: PM clock entry corresponding to the clock.
|
||||
*/
|
||||
-static inline int __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce)
|
||||
+static inline void __pm_clk_enable(struct device *dev, struct pm_clock_entry *ce)
|
||||
{
|
||||
int ret;
|
||||
|
||||
@@ -49,8 +49,6 @@ static inline int __pm_clk_enable(struct
|
||||
dev_err(dev, "%s: failed to enable clk %p, error %d\n",
|
||||
__func__, ce->clk, ret);
|
||||
}
|
||||
-
|
||||
- return ret;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -1,35 +0,0 @@
|
||||
From a313bdc5310dd807655d3ca3eb2219cd65dfe45a Mon Sep 17 00:00:00 2001
|
||||
From: Sebastian Ott <sebott@linux.vnet.ibm.com>
|
||||
Date: Thu, 25 Jun 2015 09:32:22 +0200
|
||||
Subject: s390/sclp: fix compile error
|
||||
|
||||
From: Sebastian Ott <sebott@linux.vnet.ibm.com>
|
||||
|
||||
commit a313bdc5310dd807655d3ca3eb2219cd65dfe45a upstream.
|
||||
|
||||
Fix this error when compiling with CONFIG_SMP=n and
|
||||
CONFIG_DYNAMIC_DEBUG=y:
|
||||
|
||||
drivers/s390/char/sclp_early.c: In function 'sclp_read_info_early':
|
||||
drivers/s390/char/sclp_early.c:87:19: error: 'EBUSY' undeclared (first use in this function)
|
||||
} while (rc == -EBUSY);
|
||||
^
|
||||
|
||||
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
|
||||
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/s390/char/sclp_early.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/s390/char/sclp_early.c
|
||||
+++ b/drivers/s390/char/sclp_early.c
|
||||
@@ -7,6 +7,7 @@
|
||||
#define KMSG_COMPONENT "sclp_early"
|
||||
#define pr_fmt(fmt) KMSG_COMPONENT ": " fmt
|
||||
|
||||
+#include <linux/errno.h>
|
||||
#include <asm/ctl_reg.h>
|
||||
#include <asm/sclp.h>
|
||||
#include <asm/ipl.h>
|
||||
@@ -1,74 +0,0 @@
|
||||
From 89b1145e93771d727645c96e323539c029b63f1c Mon Sep 17 00:00:00 2001
|
||||
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
|
||||
Date: Fri, 14 Aug 2015 13:20:28 +0200
|
||||
Subject: s390/setup: fix novx parameter
|
||||
|
||||
From: Martin Schwidefsky <schwidefsky@de.ibm.com>
|
||||
|
||||
commit 89b1145e93771d727645c96e323539c029b63f1c upstream.
|
||||
|
||||
The novx parameter disables the vector facility but the HWCAP_S390_VXRS
|
||||
bit in the ELf hardware capabilies is always set if the machine has
|
||||
the vector facility. If the user space program uses the "vx" string
|
||||
in the features field of /proc/cpuinfo to utilize vector instruction
|
||||
it will crash if the novx kernel paramter is set.
|
||||
|
||||
Convert setup_hwcaps to an arch_initcall and use MACHINE_HAS_VX to
|
||||
decide if the HWCAPS_S390_VXRS bit needs to be set.
|
||||
|
||||
Reported-by: Ulrich Weigand <uweigand@de.ibm.com>
|
||||
Reviewed-by: Heiko Carstens <heiko.carstens@de.ibm.com>
|
||||
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
arch/s390/kernel/setup.c | 15 +++++++--------
|
||||
1 file changed, 7 insertions(+), 8 deletions(-)
|
||||
|
||||
--- a/arch/s390/kernel/setup.c
|
||||
+++ b/arch/s390/kernel/setup.c
|
||||
@@ -683,7 +683,7 @@ static void __init setup_memory(void)
|
||||
/*
|
||||
* Setup hardware capabilities.
|
||||
*/
|
||||
-static void __init setup_hwcaps(void)
|
||||
+static int __init setup_hwcaps(void)
|
||||
{
|
||||
static const int stfl_bits[6] = { 0, 2, 7, 17, 19, 21 };
|
||||
struct cpuid cpu_id;
|
||||
@@ -749,9 +749,11 @@ static void __init setup_hwcaps(void)
|
||||
elf_hwcap |= HWCAP_S390_TE;
|
||||
|
||||
/*
|
||||
- * Vector extension HWCAP_S390_VXRS is bit 11.
|
||||
+ * Vector extension HWCAP_S390_VXRS is bit 11. The Vector extension
|
||||
+ * can be disabled with the "novx" parameter. Use MACHINE_HAS_VX
|
||||
+ * instead of facility bit 129.
|
||||
*/
|
||||
- if (test_facility(129))
|
||||
+ if (MACHINE_HAS_VX)
|
||||
elf_hwcap |= HWCAP_S390_VXRS;
|
||||
get_cpu_id(&cpu_id);
|
||||
add_device_randomness(&cpu_id, sizeof(cpu_id));
|
||||
@@ -788,7 +790,9 @@ static void __init setup_hwcaps(void)
|
||||
strcpy(elf_platform, "z13");
|
||||
break;
|
||||
}
|
||||
+ return 0;
|
||||
}
|
||||
+arch_initcall(setup_hwcaps);
|
||||
|
||||
/*
|
||||
* Add system information as device randomness
|
||||
@@ -871,11 +875,6 @@ void __init setup_arch(char **cmdline_p)
|
||||
cpu_init();
|
||||
|
||||
/*
|
||||
- * Setup capabilities (ELF_HWCAP & ELF_PLATFORM).
|
||||
- */
|
||||
- setup_hwcaps();
|
||||
-
|
||||
- /*
|
||||
* Create kernel page tables and switch to virtual addressing.
|
||||
*/
|
||||
paging_init();
|
||||
-146
@@ -1,146 +0,0 @@
|
||||
From dd9d3843755da95f63dd3a376f62b3e45c011210 Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= <jschoenh@amazon.de>
|
||||
Date: Wed, 12 Aug 2015 21:35:56 +0200
|
||||
Subject: sched: Fix cpu_active_mask/cpu_online_mask race
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
From: =?UTF-8?q?Jan=20H=2E=20Sch=C3=B6nherr?= <jschoenh@amazon.de>
|
||||
|
||||
commit dd9d3843755da95f63dd3a376f62b3e45c011210 upstream.
|
||||
|
||||
There is a race condition in SMP bootup code, which may result
|
||||
in
|
||||
|
||||
WARNING: CPU: 0 PID: 1 at kernel/workqueue.c:4418
|
||||
workqueue_cpu_up_callback()
|
||||
or
|
||||
kernel BUG at kernel/smpboot.c:135!
|
||||
|
||||
It can be triggered with a bit of luck in Linux guests running
|
||||
on busy hosts.
|
||||
|
||||
CPU0 CPUn
|
||||
==== ====
|
||||
|
||||
_cpu_up()
|
||||
__cpu_up()
|
||||
start_secondary()
|
||||
set_cpu_online()
|
||||
cpumask_set_cpu(cpu,
|
||||
to_cpumask(cpu_online_bits));
|
||||
cpu_notify(CPU_ONLINE)
|
||||
<do stuff, see below>
|
||||
cpumask_set_cpu(cpu,
|
||||
to_cpumask(cpu_active_bits));
|
||||
|
||||
During the various CPU_ONLINE callbacks CPUn is online but not
|
||||
active. Several things can go wrong at that point, depending on
|
||||
the scheduling of tasks on CPU0.
|
||||
|
||||
Variant 1:
|
||||
|
||||
cpu_notify(CPU_ONLINE)
|
||||
workqueue_cpu_up_callback()
|
||||
rebind_workers()
|
||||
set_cpus_allowed_ptr()
|
||||
|
||||
This call fails because it requires an active CPU; rebind_workers()
|
||||
ends with a warning:
|
||||
|
||||
WARNING: CPU: 0 PID: 1 at kernel/workqueue.c:4418
|
||||
workqueue_cpu_up_callback()
|
||||
|
||||
Variant 2:
|
||||
|
||||
cpu_notify(CPU_ONLINE)
|
||||
smpboot_thread_call()
|
||||
smpboot_unpark_threads()
|
||||
..
|
||||
__kthread_unpark()
|
||||
__kthread_bind()
|
||||
wake_up_state()
|
||||
..
|
||||
select_task_rq()
|
||||
select_fallback_rq()
|
||||
|
||||
The ->wake_cpu of the unparked thread is not allowed, making a call
|
||||
to select_fallback_rq() necessary. Then, select_fallback_rq() cannot
|
||||
find an allowed, active CPU and promptly resets the allowed CPUs, so
|
||||
that the task in question ends up on CPU0.
|
||||
|
||||
When those unparked tasks are eventually executed, they run
|
||||
immediately into a BUG:
|
||||
|
||||
kernel BUG at kernel/smpboot.c:135!
|
||||
|
||||
Just changing the order in which the online/active bits are set
|
||||
(and adding some memory barriers), would solve the two issues
|
||||
above. However, it would change the order of operations back to
|
||||
the one before commit 6acbfb96976f ("sched: Fix hotplug vs.
|
||||
set_cpus_allowed_ptr()"), thus, reintroducing that particular
|
||||
problem.
|
||||
|
||||
Going further back into history, we have at least the following
|
||||
commits touching this topic:
|
||||
- commit 2baab4e90495 ("sched: Fix select_fallback_rq() vs cpu_active/cpu_online")
|
||||
- commit 5fbd036b552f ("sched: Cleanup cpu_active madness")
|
||||
|
||||
Together, these give us the following non-working solutions:
|
||||
|
||||
- secondary CPU sets active before online, because active is assumed to
|
||||
be a subset of online;
|
||||
|
||||
- secondary CPU sets online before active, because the primary CPU
|
||||
assumes that an online CPU is also active;
|
||||
|
||||
- secondary CPU sets online and waits for primary CPU to set active,
|
||||
because it might deadlock.
|
||||
|
||||
Commit 875ebe940d77 ("powerpc/smp: Wait until secondaries are
|
||||
active & online") introduces an arch-specific solution to this
|
||||
arch-independent problem.
|
||||
|
||||
Now, go for a more general solution without explicit waiting and
|
||||
simply set active twice: once on the secondary CPU after online
|
||||
was set and once on the primary CPU after online was seen.
|
||||
|
||||
set_cpus_allowed_ptr()")
|
||||
|
||||
Signed-off-by: Jan H. Schönherr <jschoenh@amazon.de>
|
||||
Acked-by: Peter Zijlstra <a.p.zijlstra@chello.nl>
|
||||
Cc: Anton Blanchard <anton@samba.org>
|
||||
Cc: Borislav Petkov <bp@alien8.de>
|
||||
Cc: Joerg Roedel <jroedel@suse.de>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Matt Wilson <msw@amazon.com>
|
||||
Cc: Michael Ellerman <mpe@ellerman.id.au>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Fixes: 6acbfb96976f ("sched: Fix hotplug vs. set_cpus_allowed_ptr()")
|
||||
Link: http://lkml.kernel.org/r/1439408156-18840-1-git-send-email-jschoenh@amazon.de
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
kernel/sched/core.c | 8 ++++++++
|
||||
1 file changed, 8 insertions(+)
|
||||
|
||||
--- a/kernel/sched/core.c
|
||||
+++ b/kernel/sched/core.c
|
||||
@@ -5328,6 +5328,14 @@ static int sched_cpu_active(struct notif
|
||||
case CPU_STARTING:
|
||||
set_cpu_rq_start_time();
|
||||
return NOTIFY_OK;
|
||||
+ case CPU_ONLINE:
|
||||
+ /*
|
||||
+ * At this point a starting CPU has marked itself as online via
|
||||
+ * set_cpu_online(). But it might not yet have marked itself
|
||||
+ * as active, which is essential from here on.
|
||||
+ *
|
||||
+ * Thus, fall-through and help the starting CPU along.
|
||||
+ */
|
||||
case CPU_DOWN_FAILED:
|
||||
set_cpu_active((long)hcpu, true);
|
||||
return NOTIFY_OK;
|
||||
-88
@@ -1,88 +0,0 @@
|
||||
From acace73df2c1913a526c1b41e4741a4a6704c863 Mon Sep 17 00:00:00 2001
|
||||
From: Martin Sperl <kernel@martin.sperl.org>
|
||||
Date: Tue, 28 Jul 2015 14:03:12 +0000
|
||||
Subject: spi: bcm2835: set up spi-mode before asserting cs-gpio
|
||||
|
||||
From: Martin Sperl <kernel@martin.sperl.org>
|
||||
|
||||
commit acace73df2c1913a526c1b41e4741a4a6704c863 upstream.
|
||||
|
||||
When using reverse polarity for clock (spi-cpol) on a device
|
||||
the clock line gets altered after chip-select has been asserted
|
||||
resulting in an additional clock beat, which confuses hardware.
|
||||
|
||||
This did not show when using native-CS, as the same register
|
||||
is used to control cs as well as polarity, so the changes came
|
||||
into effect at the same time. Unfortunately this is not true
|
||||
with gpio-cs.
|
||||
|
||||
To avoid this situation this patch moves the setup of polarity
|
||||
(spi-cpol and spi-cpha) outside of the chip-select into
|
||||
prepare_message, which is run prior to asserting chip-select.
|
||||
|
||||
Also fixes resetting 3-wire mode after use of rx-mode, so that
|
||||
a 3-Wire sequence TX, RX, TX works as well (right now it runs
|
||||
TX, RX, RX instead)
|
||||
|
||||
Reported-by: Noralf Tronnes <noralf@tronnes.org>
|
||||
Signed-off-by: Martin Sperl <kernel@martin.sperl.org>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/spi/spi-bcm2835.c | 28 +++++++++++++++++++++++-----
|
||||
1 file changed, 23 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/spi/spi-bcm2835.c
|
||||
+++ b/drivers/spi/spi-bcm2835.c
|
||||
@@ -257,13 +257,11 @@ static int bcm2835_spi_transfer_one(stru
|
||||
spi_used_hz = cdiv ? (clk_hz / cdiv) : (clk_hz / 65536);
|
||||
bcm2835_wr(bs, BCM2835_SPI_CLK, cdiv);
|
||||
|
||||
- /* handle all the modes */
|
||||
+ /* handle all the 3-wire mode */
|
||||
if ((spi->mode & SPI_3WIRE) && (tfr->rx_buf))
|
||||
cs |= BCM2835_SPI_CS_REN;
|
||||
- if (spi->mode & SPI_CPOL)
|
||||
- cs |= BCM2835_SPI_CS_CPOL;
|
||||
- if (spi->mode & SPI_CPHA)
|
||||
- cs |= BCM2835_SPI_CS_CPHA;
|
||||
+ else
|
||||
+ cs &= ~BCM2835_SPI_CS_REN;
|
||||
|
||||
/* for gpio_cs set dummy CS so that no HW-CS get changed
|
||||
* we can not run this in bcm2835_spi_set_cs, as it does
|
||||
@@ -291,6 +289,25 @@ static int bcm2835_spi_transfer_one(stru
|
||||
return bcm2835_spi_transfer_one_irq(master, spi, tfr, cs);
|
||||
}
|
||||
|
||||
+static int bcm2835_spi_prepare_message(struct spi_master *master,
|
||||
+ struct spi_message *msg)
|
||||
+{
|
||||
+ struct spi_device *spi = msg->spi;
|
||||
+ struct bcm2835_spi *bs = spi_master_get_devdata(master);
|
||||
+ u32 cs = bcm2835_rd(bs, BCM2835_SPI_CS);
|
||||
+
|
||||
+ cs &= ~(BCM2835_SPI_CS_CPOL | BCM2835_SPI_CS_CPHA);
|
||||
+
|
||||
+ if (spi->mode & SPI_CPOL)
|
||||
+ cs |= BCM2835_SPI_CS_CPOL;
|
||||
+ if (spi->mode & SPI_CPHA)
|
||||
+ cs |= BCM2835_SPI_CS_CPHA;
|
||||
+
|
||||
+ bcm2835_wr(bs, BCM2835_SPI_CS, cs);
|
||||
+
|
||||
+ return 0;
|
||||
+}
|
||||
+
|
||||
static void bcm2835_spi_handle_err(struct spi_master *master,
|
||||
struct spi_message *msg)
|
||||
{
|
||||
@@ -429,6 +446,7 @@ static int bcm2835_spi_probe(struct plat
|
||||
master->set_cs = bcm2835_spi_set_cs;
|
||||
master->transfer_one = bcm2835_spi_transfer_one;
|
||||
master->handle_err = bcm2835_spi_handle_err;
|
||||
+ master->prepare_message = bcm2835_spi_prepare_message;
|
||||
master->dev.of_node = pdev->dev.of_node;
|
||||
|
||||
bs = spi_master_get_devdata(master);
|
||||
-129
@@ -1,129 +0,0 @@
|
||||
From c4fe57f76269dbb2af135071513f260ca40229a3 Mon Sep 17 00:00:00 2001
|
||||
From: Michael van der Westhuizen <michael@smart-africa.com>
|
||||
Date: Tue, 18 Aug 2015 22:21:53 +0200
|
||||
Subject: spi: dw: Allow interface drivers to limit data I/O to word sizes
|
||||
|
||||
From: Michael van der Westhuizen <michael@smart-africa.com>
|
||||
|
||||
commit c4fe57f76269dbb2af135071513f260ca40229a3 upstream.
|
||||
|
||||
The commit dd11444327ce ("spi: dw-spi: Convert 16bit accesses to 32bit
|
||||
accesses") changed all 16bit accesses in the DW_apb_ssi driver to 32bit.
|
||||
This, unfortunately, breaks data register access on picoXcell, where the
|
||||
DW IP needs data register accesses to be word accesses (all other
|
||||
accesses appear to be OK).
|
||||
|
||||
This change introduces a new master variable to allow interface drivers
|
||||
to specify that 16bit data transfer I/O is required. This change also
|
||||
introduces the ability to set this variable via device tree bindings in
|
||||
the MMIO interface driver. Both the core and the MMIO interface driver
|
||||
default to the current 32bit behaviour.
|
||||
|
||||
Before this change, on a picoXcell pc3x3:
|
||||
spi_master spi32766: interrupt_transfer: fifo overrun/underrun
|
||||
m25p80 spi32766.0: error -5 reading 9f
|
||||
m25p80: probe of spi32766.0 failed with error -5
|
||||
|
||||
After this change:
|
||||
m25p80 spi32766.0: m25p40 (512 Kbytes)
|
||||
|
||||
Fixes: dd11444327ce ("spi: dw-spi: Convert 16bit accesses to 32bit accesses")
|
||||
Signed-off-by: Michael van der Westhuizen <michael@smart-africa.com>
|
||||
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/spi/spi-dw-mmio.c | 3 +++
|
||||
drivers/spi/spi-dw.c | 4 ++--
|
||||
drivers/spi/spi-dw.h | 35 +++++++++++++++++++++++++++++++++++
|
||||
3 files changed, 40 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/spi/spi-dw-mmio.c
|
||||
+++ b/drivers/spi/spi-dw-mmio.c
|
||||
@@ -74,6 +74,9 @@ static int dw_spi_mmio_probe(struct plat
|
||||
|
||||
dws->max_freq = clk_get_rate(dwsmmio->clk);
|
||||
|
||||
+ of_property_read_u32(pdev->dev.of_node, "reg-io-width",
|
||||
+ &dws->reg_io_width);
|
||||
+
|
||||
num_cs = 4;
|
||||
|
||||
if (pdev->dev.of_node)
|
||||
--- a/drivers/spi/spi-dw.c
|
||||
+++ b/drivers/spi/spi-dw.c
|
||||
@@ -194,7 +194,7 @@ static void dw_writer(struct dw_spi *dws
|
||||
else
|
||||
txw = *(u16 *)(dws->tx);
|
||||
}
|
||||
- dw_writel(dws, DW_SPI_DR, txw);
|
||||
+ dw_write_io_reg(dws, DW_SPI_DR, txw);
|
||||
dws->tx += dws->n_bytes;
|
||||
}
|
||||
}
|
||||
@@ -205,7 +205,7 @@ static void dw_reader(struct dw_spi *dws
|
||||
u16 rxw;
|
||||
|
||||
while (max--) {
|
||||
- rxw = dw_readl(dws, DW_SPI_DR);
|
||||
+ rxw = dw_read_io_reg(dws, DW_SPI_DR);
|
||||
/* Care rx only if the transfer's original "rx" is not null */
|
||||
if (dws->rx_end - dws->len) {
|
||||
if (dws->n_bytes == 1)
|
||||
--- a/drivers/spi/spi-dw.h
|
||||
+++ b/drivers/spi/spi-dw.h
|
||||
@@ -109,6 +109,7 @@ struct dw_spi {
|
||||
u32 fifo_len; /* depth of the FIFO buffer */
|
||||
u32 max_freq; /* max bus freq supported */
|
||||
|
||||
+ u32 reg_io_width; /* DR I/O width in bytes */
|
||||
u16 bus_num;
|
||||
u16 num_cs; /* supported slave numbers */
|
||||
|
||||
@@ -145,11 +146,45 @@ static inline u32 dw_readl(struct dw_spi
|
||||
return __raw_readl(dws->regs + offset);
|
||||
}
|
||||
|
||||
+static inline u16 dw_readw(struct dw_spi *dws, u32 offset)
|
||||
+{
|
||||
+ return __raw_readw(dws->regs + offset);
|
||||
+}
|
||||
+
|
||||
static inline void dw_writel(struct dw_spi *dws, u32 offset, u32 val)
|
||||
{
|
||||
__raw_writel(val, dws->regs + offset);
|
||||
}
|
||||
|
||||
+static inline void dw_writew(struct dw_spi *dws, u32 offset, u16 val)
|
||||
+{
|
||||
+ __raw_writew(val, dws->regs + offset);
|
||||
+}
|
||||
+
|
||||
+static inline u32 dw_read_io_reg(struct dw_spi *dws, u32 offset)
|
||||
+{
|
||||
+ switch (dws->reg_io_width) {
|
||||
+ case 2:
|
||||
+ return dw_readw(dws, offset);
|
||||
+ case 4:
|
||||
+ default:
|
||||
+ return dw_readl(dws, offset);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
+static inline void dw_write_io_reg(struct dw_spi *dws, u32 offset, u32 val)
|
||||
+{
|
||||
+ switch (dws->reg_io_width) {
|
||||
+ case 2:
|
||||
+ dw_writew(dws, offset, val);
|
||||
+ break;
|
||||
+ case 4:
|
||||
+ default:
|
||||
+ dw_writel(dws, offset, val);
|
||||
+ break;
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
static inline void spi_enable_chip(struct dw_spi *dws, int enable)
|
||||
{
|
||||
dw_writel(dws, DW_SPI_SSIENR, (enable ? 1 : 0));
|
||||
-43
@@ -1,43 +0,0 @@
|
||||
From 26a67ec47a4c58fe79c6421c3dc3d697d322d2d6 Mon Sep 17 00:00:00 2001
|
||||
From: Lars Persson <lars.persson@axis.com>
|
||||
Date: Wed, 29 Jul 2015 09:32:02 +0200
|
||||
Subject: spi: Fix regression in spi-bitbang-txrx.h
|
||||
|
||||
From: Lars Persson <lars.persson@axis.com>
|
||||
|
||||
commit 26a67ec47a4c58fe79c6421c3dc3d697d322d2d6 upstream.
|
||||
|
||||
This patch fixes a regression introduced by commit 232a5adc5199 ("spi:
|
||||
bitbang: only toggle bitchanges"). The attempt to optimize writes of
|
||||
consecutive bit patterns broke most of the combinations of word size
|
||||
and SPI modes due to selecting the wrong bit as the MSB value.
|
||||
|
||||
Fixes: 232a5adc5199 (spi: bitbang: only toggle bitchanges)
|
||||
Signed-off-by: Lars Persson <larper@axis.com>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/spi/spi-bitbang-txrx.h | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/spi/spi-bitbang-txrx.h
|
||||
+++ b/drivers/spi/spi-bitbang-txrx.h
|
||||
@@ -49,7 +49,7 @@ bitbang_txrx_be_cpha0(struct spi_device
|
||||
{
|
||||
/* if (cpol == 0) this is SPI_MODE_0; else this is SPI_MODE_2 */
|
||||
|
||||
- bool oldbit = !(word & 1);
|
||||
+ u32 oldbit = (!(word & (1<<(bits-1)))) << 31;
|
||||
/* clock starts at inactive polarity */
|
||||
for (word <<= (32 - bits); likely(bits); bits--) {
|
||||
|
||||
@@ -81,7 +81,7 @@ bitbang_txrx_be_cpha1(struct spi_device
|
||||
{
|
||||
/* if (cpol == 0) this is SPI_MODE_1; else this is SPI_MODE_3 */
|
||||
|
||||
- bool oldbit = !(word & (1 << 31));
|
||||
+ u32 oldbit = (!(word & (1<<(bits-1)))) << 31;
|
||||
/* clock starts at inactive polarity */
|
||||
for (word <<= (32 - bits); likely(bits); bits--) {
|
||||
|
||||
-48
@@ -1,48 +0,0 @@
|
||||
From 011710e2ab659c7ad6e5e554806414bd7a9508be Mon Sep 17 00:00:00 2001
|
||||
From: Sifan Naeem <sifan.naeem@imgtec.com>
|
||||
Date: Mon, 27 Jul 2015 13:11:15 +0100
|
||||
Subject: spi: img-spfi: check for timeout error before proceeding
|
||||
|
||||
From: Sifan Naeem <sifan.naeem@imgtec.com>
|
||||
|
||||
commit 011710e2ab659c7ad6e5e554806414bd7a9508be upstream.
|
||||
|
||||
Calling spfi_wait_all_done is not required if the transfer has timed
|
||||
out before all data is transferred.
|
||||
|
||||
spfi_wait_all_done polls for Alldone interrupt which is triggered to
|
||||
mark the transfer as complete and to indicate it is now safe to issue
|
||||
a new transfer.
|
||||
|
||||
Fixes: 8c2c8c0 ("spi: img-spfi: Control CS lines with GPIO")
|
||||
Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
|
||||
Reviewed-by: Andrew Bresticker <abrestic@chromium.org>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/spi/spi-img-spfi.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/spi/spi-img-spfi.c
|
||||
+++ b/drivers/spi/spi-img-spfi.c
|
||||
@@ -267,15 +267,15 @@ static int img_spfi_start_pio(struct spi
|
||||
cpu_relax();
|
||||
}
|
||||
|
||||
- ret = spfi_wait_all_done(spfi);
|
||||
- if (ret < 0)
|
||||
- return ret;
|
||||
-
|
||||
if (rx_bytes > 0 || tx_bytes > 0) {
|
||||
dev_err(spfi->dev, "PIO transfer timed out\n");
|
||||
return -ETIMEDOUT;
|
||||
}
|
||||
|
||||
+ ret = spfi_wait_all_done(spfi);
|
||||
+ if (ret < 0)
|
||||
+ return ret;
|
||||
+
|
||||
return 0;
|
||||
}
|
||||
|
||||
-33
@@ -1,33 +0,0 @@
|
||||
From 9176c6657b5c313cf504d157e6d91496ee5c8708 Mon Sep 17 00:00:00 2001
|
||||
From: Sifan Naeem <sifan.naeem@imgtec.com>
|
||||
Date: Thu, 6 Aug 2015 10:33:01 +0100
|
||||
Subject: spi: img-spfi: fix kbuild test robot warning
|
||||
|
||||
From: Sifan Naeem <sifan.naeem@imgtec.com>
|
||||
|
||||
commit 9176c6657b5c313cf504d157e6d91496ee5c8708 upstream.
|
||||
|
||||
drivers/spi/spi-img-spfi.c: In function 'img_spfi_setup':
|
||||
drivers/spi/spi-img-spfi.c:446: warning: 'ret' may be used
|
||||
uninitialized in this function.
|
||||
|
||||
Fixes: commit b03ba9e314c1 ("spi: img-spfi: fix multiple calls to request gpio")
|
||||
Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/spi/spi-img-spfi.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/spi/spi-img-spfi.c
|
||||
+++ b/drivers/spi/spi-img-spfi.c
|
||||
@@ -444,7 +444,7 @@ static int img_spfi_unprepare(struct spi
|
||||
|
||||
static int img_spfi_setup(struct spi_device *spi)
|
||||
{
|
||||
- int ret;
|
||||
+ int ret = -EINVAL;
|
||||
struct img_spfi_device_data *spfi_data = spi_get_ctldata(spi);
|
||||
|
||||
if (!spfi_data) {
|
||||
-97
@@ -1,97 +0,0 @@
|
||||
From b03ba9e314c12b2127243145b5c1f41b2408de62 Mon Sep 17 00:00:00 2001
|
||||
From: Sifan Naeem <sifan.naeem@imgtec.com>
|
||||
Date: Wed, 29 Jul 2015 11:55:26 +0100
|
||||
Subject: spi: img-spfi: fix multiple calls to request gpio
|
||||
|
||||
From: Sifan Naeem <sifan.naeem@imgtec.com>
|
||||
|
||||
commit b03ba9e314c12b2127243145b5c1f41b2408de62 upstream.
|
||||
|
||||
spfi_setup may be called many times by the spi framework, but
|
||||
gpio_request_one can only be called once without freeing, repeatedly
|
||||
calling gpio_request_one will cause an error to be thrown, which
|
||||
causes the request to spi_setup to be marked as failed.
|
||||
|
||||
We can have a per-spi_device flag that indicates whether or not the
|
||||
gpio has been requested. If the gpio has already been requested use
|
||||
gpio_direction_output to set the direction of the gpio.
|
||||
|
||||
Fixes: 8c2c8c03cdcb ("spi: img-spfi: Control CS lines with GPIO")
|
||||
Signed-off-by: Sifan Naeem <sifan.naeem@imgtec.com>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/spi/spi-img-spfi.c | 47 ++++++++++++++++++++++++++++++++++++++-------
|
||||
1 file changed, 40 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/drivers/spi/spi-img-spfi.c
|
||||
+++ b/drivers/spi/spi-img-spfi.c
|
||||
@@ -105,6 +105,10 @@ struct img_spfi {
|
||||
bool rx_dma_busy;
|
||||
};
|
||||
|
||||
+struct img_spfi_device_data {
|
||||
+ bool gpio_requested;
|
||||
+};
|
||||
+
|
||||
static inline u32 spfi_readl(struct img_spfi *spfi, u32 reg)
|
||||
{
|
||||
return readl(spfi->regs + reg);
|
||||
@@ -441,20 +445,49 @@ static int img_spfi_unprepare(struct spi
|
||||
static int img_spfi_setup(struct spi_device *spi)
|
||||
{
|
||||
int ret;
|
||||
+ struct img_spfi_device_data *spfi_data = spi_get_ctldata(spi);
|
||||
|
||||
- ret = gpio_request_one(spi->cs_gpio, (spi->mode & SPI_CS_HIGH) ?
|
||||
- GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH,
|
||||
- dev_name(&spi->dev));
|
||||
- if (ret)
|
||||
- dev_err(&spi->dev, "can't request chipselect gpio %d\n",
|
||||
+ if (!spfi_data) {
|
||||
+ spfi_data = kzalloc(sizeof(*spfi_data), GFP_KERNEL);
|
||||
+ if (!spfi_data)
|
||||
+ return -ENOMEM;
|
||||
+ spfi_data->gpio_requested = false;
|
||||
+ spi_set_ctldata(spi, spfi_data);
|
||||
+ }
|
||||
+ if (!spfi_data->gpio_requested) {
|
||||
+ ret = gpio_request_one(spi->cs_gpio,
|
||||
+ (spi->mode & SPI_CS_HIGH) ?
|
||||
+ GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH,
|
||||
+ dev_name(&spi->dev));
|
||||
+ if (ret)
|
||||
+ dev_err(&spi->dev, "can't request chipselect gpio %d\n",
|
||||
spi->cs_gpio);
|
||||
-
|
||||
+ else
|
||||
+ spfi_data->gpio_requested = true;
|
||||
+ } else {
|
||||
+ if (gpio_is_valid(spi->cs_gpio)) {
|
||||
+ int mode = ((spi->mode & SPI_CS_HIGH) ?
|
||||
+ GPIOF_OUT_INIT_LOW : GPIOF_OUT_INIT_HIGH);
|
||||
+
|
||||
+ ret = gpio_direction_output(spi->cs_gpio, mode);
|
||||
+ if (ret)
|
||||
+ dev_err(&spi->dev, "chipselect gpio %d setup failed (%d)\n",
|
||||
+ spi->cs_gpio, ret);
|
||||
+ }
|
||||
+ }
|
||||
return ret;
|
||||
}
|
||||
|
||||
static void img_spfi_cleanup(struct spi_device *spi)
|
||||
{
|
||||
- gpio_free(spi->cs_gpio);
|
||||
+ struct img_spfi_device_data *spfi_data = spi_get_ctldata(spi);
|
||||
+
|
||||
+ if (spfi_data) {
|
||||
+ if (spfi_data->gpio_requested)
|
||||
+ gpio_free(spi->cs_gpio);
|
||||
+ kfree(spfi_data);
|
||||
+ spi_set_ctldata(spi, NULL);
|
||||
+ }
|
||||
}
|
||||
|
||||
static void img_spfi_config(struct spi_master *master, struct spi_device *spi,
|
||||
-66
@@ -1,66 +0,0 @@
|
||||
From fe78d0b7691c02744004b15f6979b3f106464bc4 Mon Sep 17 00:00:00 2001
|
||||
From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
|
||||
Date: Mon, 15 Jun 2015 02:25:05 +0900
|
||||
Subject: spi: sh-msiof: Fix FIFO size to 64 word from 256 word
|
||||
|
||||
From: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
|
||||
|
||||
commit fe78d0b7691c02744004b15f6979b3f106464bc4 upstream.
|
||||
|
||||
The upper limit of Tx/Rx FIFO size is 64 word by the
|
||||
specification of H/W. This patch corrects to 64 word from 256 word.
|
||||
|
||||
Signed-off-by: Koji Matsuoka <koji.matsuoka.xm@renesas.com>
|
||||
Signed-off-by: Yoshihiro Kaneko <ykaneko0929@gmail.com>
|
||||
Signed-off-by: Mark Brown <broonie@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/spi/spi-sh-msiof.c | 15 +++++++++------
|
||||
1 file changed, 9 insertions(+), 6 deletions(-)
|
||||
|
||||
--- a/drivers/spi/spi-sh-msiof.c
|
||||
+++ b/drivers/spi/spi-sh-msiof.c
|
||||
@@ -48,8 +48,8 @@ struct sh_msiof_spi_priv {
|
||||
const struct sh_msiof_chipdata *chipdata;
|
||||
struct sh_msiof_spi_info *info;
|
||||
struct completion done;
|
||||
- int tx_fifo_size;
|
||||
- int rx_fifo_size;
|
||||
+ unsigned int tx_fifo_size;
|
||||
+ unsigned int rx_fifo_size;
|
||||
void *tx_dma_page;
|
||||
void *rx_dma_page;
|
||||
dma_addr_t tx_dma_addr;
|
||||
@@ -95,8 +95,6 @@ struct sh_msiof_spi_priv {
|
||||
#define MDR2_WDLEN1(i) (((i) - 1) << 16) /* Word Count (1-64/256 (SH, A1))) */
|
||||
#define MDR2_GRPMASK1 0x00000001 /* Group Output Mask 1 (SH, A1) */
|
||||
|
||||
-#define MAX_WDLEN 256U
|
||||
-
|
||||
/* TSCR and RSCR */
|
||||
#define SCR_BRPS_MASK 0x1f00 /* Prescaler Setting (1-32) */
|
||||
#define SCR_BRPS(i) (((i) - 1) << 8)
|
||||
@@ -850,7 +848,12 @@ static int sh_msiof_transfer_one(struct
|
||||
* DMA supports 32-bit words only, hence pack 8-bit and 16-bit
|
||||
* words, with byte resp. word swapping.
|
||||
*/
|
||||
- unsigned int l = min(len, MAX_WDLEN * 4);
|
||||
+ unsigned int l = 0;
|
||||
+
|
||||
+ if (tx_buf)
|
||||
+ l = min(len, p->tx_fifo_size * 4);
|
||||
+ if (rx_buf)
|
||||
+ l = min(len, p->rx_fifo_size * 4);
|
||||
|
||||
if (bits <= 8) {
|
||||
if (l & 3)
|
||||
@@ -963,7 +966,7 @@ static const struct sh_msiof_chipdata sh
|
||||
|
||||
static const struct sh_msiof_chipdata r8a779x_data = {
|
||||
.tx_fifo_size = 64,
|
||||
- .rx_fifo_size = 256,
|
||||
+ .rx_fifo_size = 64,
|
||||
.master_flags = SPI_MASTER_MUST_TX,
|
||||
};
|
||||
|
||||
-56
@@ -1,56 +0,0 @@
|
||||
From ad83dbd974feb2e2a8cc071a1d28782bd4d2c70e Mon Sep 17 00:00:00 2001
|
||||
From: Ian Abbott <abbotti@mev.co.uk>
|
||||
Date: Tue, 11 Aug 2015 13:05:10 +0100
|
||||
Subject: staging: comedi: adl_pci7x3x: fix digital output on PCI-7230
|
||||
|
||||
From: Ian Abbott <abbotti@mev.co.uk>
|
||||
|
||||
commit ad83dbd974feb2e2a8cc071a1d28782bd4d2c70e upstream.
|
||||
|
||||
The "adl_pci7x3x" driver replaced the "adl_pci7230" and "adl_pci7432"
|
||||
drivers in commits 8f567c373c4b ("staging: comedi: new adl_pci7x3x
|
||||
driver") and 657f77d173d3 ("staging: comedi: remove adl_pci7230 and
|
||||
adl_pci7432 drivers"). Although the new driver code agrees with the
|
||||
user manuals for the respective boards, digital outputs stopped working
|
||||
on the PCI-7230. This has 16 digital output channels and the previous
|
||||
adl_pci7230 driver shifted the 16 bit output state left by 16 bits
|
||||
before writing to the hardware register. The new adl_pci7x3x driver
|
||||
doesn't do that. Fix it in `adl_pci7x3x_do_insn_bits()` by checking
|
||||
for the special case of the subdevice having only 16 channels and
|
||||
duplicating the 16 bit output state into both halves of the 32-bit
|
||||
register. That should work both for what the board actually does and
|
||||
for what the user manual says it should do.
|
||||
|
||||
Fixes: 8f567c373c4b ("staging: comedi: new adl_pci7x3x driver")
|
||||
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/staging/comedi/drivers/adl_pci7x3x.c | 16 ++++++++++++++--
|
||||
1 file changed, 14 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/staging/comedi/drivers/adl_pci7x3x.c
|
||||
+++ b/drivers/staging/comedi/drivers/adl_pci7x3x.c
|
||||
@@ -120,8 +120,20 @@ static int adl_pci7x3x_do_insn_bits(stru
|
||||
{
|
||||
unsigned long reg = (unsigned long)s->private;
|
||||
|
||||
- if (comedi_dio_update_state(s, data))
|
||||
- outl(s->state, dev->iobase + reg);
|
||||
+ if (comedi_dio_update_state(s, data)) {
|
||||
+ unsigned int val = s->state;
|
||||
+
|
||||
+ if (s->n_chan == 16) {
|
||||
+ /*
|
||||
+ * It seems the PCI-7230 needs the 16-bit DO state
|
||||
+ * to be shifted left by 16 bits before being written
|
||||
+ * to the 32-bit register. Set the value in both
|
||||
+ * halves of the register to be sure.
|
||||
+ */
|
||||
+ val |= val << 16;
|
||||
+ }
|
||||
+ outl(val, dev->iobase + reg);
|
||||
+ }
|
||||
|
||||
data[1] = s->state;
|
||||
|
||||
-87
@@ -1,87 +0,0 @@
|
||||
From 423b24c37dd5794a674c74b0ed56392003a69891 Mon Sep 17 00:00:00 2001
|
||||
From: Ian Abbott <abbotti@mev.co.uk>
|
||||
Date: Thu, 23 Jul 2015 16:46:57 +0100
|
||||
Subject: staging: comedi: usbduxsigma: don't clobber ai_timer in command test
|
||||
|
||||
From: Ian Abbott <abbotti@mev.co.uk>
|
||||
|
||||
commit 423b24c37dd5794a674c74b0ed56392003a69891 upstream.
|
||||
|
||||
`devpriv->ai_timer` is used while an asynchronous command is running on
|
||||
the AI subdevice. It also gets modified by the subdevice's `cmdtest`
|
||||
handler for checking new asynchronous commands
|
||||
(`usbduxsigma_ai_cmdtest()`), which is not correct as it's allowed to
|
||||
check new commands while an old command is still running. Fix it by
|
||||
moving the code which sets up `devpriv->ai_timer` and
|
||||
`devpriv->ai_interval` into the subdevice's `cmd` handler,
|
||||
`usbduxsigma_ai_cmd()`.
|
||||
|
||||
Note that the removed code in `usbduxsigma_ai_cmdtest()` checked that
|
||||
`devpriv->ai_timer` did not end up less than than 1, but that could not
|
||||
happen because `cmd->scan_begin_arg` had already been checked to be at
|
||||
least the minimum required value (at least when `cmd->scan_begin_src ==
|
||||
TRIG_TIMER`, which had also been checked to be the case).
|
||||
|
||||
Fixes: b986be8527c7 ("staging: comedi: usbduxsigma: tidy up analog input command support)
|
||||
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
|
||||
Reviewed-by: Bernd Porr <mail@berndporr.me.uk>
|
||||
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/staging/comedi/drivers/usbduxsigma.c | 37 +++++++++++----------------
|
||||
1 file changed, 16 insertions(+), 21 deletions(-)
|
||||
|
||||
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
|
||||
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
|
||||
@@ -550,27 +550,6 @@ static int usbduxsigma_ai_cmdtest(struct
|
||||
if (err)
|
||||
return 3;
|
||||
|
||||
- /* Step 4: fix up any arguments */
|
||||
-
|
||||
- if (high_speed) {
|
||||
- /*
|
||||
- * every 2 channels get a time window of 125us. Thus, if we
|
||||
- * sample all 16 channels we need 1ms. If we sample only one
|
||||
- * channel we need only 125us
|
||||
- */
|
||||
- devpriv->ai_interval = interval;
|
||||
- devpriv->ai_timer = cmd->scan_begin_arg / (125000 * interval);
|
||||
- } else {
|
||||
- /* interval always 1ms */
|
||||
- devpriv->ai_interval = 1;
|
||||
- devpriv->ai_timer = cmd->scan_begin_arg / 1000000;
|
||||
- }
|
||||
- if (devpriv->ai_timer < 1)
|
||||
- err |= -EINVAL;
|
||||
-
|
||||
- if (err)
|
||||
- return 4;
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -668,6 +647,22 @@ static int usbduxsigma_ai_cmd(struct com
|
||||
|
||||
down(&devpriv->sem);
|
||||
|
||||
+ if (devpriv->high_speed) {
|
||||
+ /*
|
||||
+ * every 2 channels get a time window of 125us. Thus, if we
|
||||
+ * sample all 16 channels we need 1ms. If we sample only one
|
||||
+ * channel we need only 125us
|
||||
+ */
|
||||
+ unsigned int interval = usbduxsigma_chans_to_interval(len);
|
||||
+
|
||||
+ devpriv->ai_interval = interval;
|
||||
+ devpriv->ai_timer = cmd->scan_begin_arg / (125000 * interval);
|
||||
+ } else {
|
||||
+ /* interval always 1ms */
|
||||
+ devpriv->ai_interval = 1;
|
||||
+ devpriv->ai_timer = cmd->scan_begin_arg / 1000000;
|
||||
+ }
|
||||
+
|
||||
for (i = 0; i < len; i++) {
|
||||
unsigned int chan = CR_CHAN(cmd->chanlist[i]);
|
||||
|
||||
-90
@@ -1,90 +0,0 @@
|
||||
From c04a1f17803e0d3eeada586ca34a6b436959bc20 Mon Sep 17 00:00:00 2001
|
||||
From: Ian Abbott <abbotti@mev.co.uk>
|
||||
Date: Thu, 23 Jul 2015 16:46:58 +0100
|
||||
Subject: staging: comedi: usbduxsigma: don't clobber ao_timer in command test
|
||||
|
||||
From: Ian Abbott <abbotti@mev.co.uk>
|
||||
|
||||
commit c04a1f17803e0d3eeada586ca34a6b436959bc20 upstream.
|
||||
|
||||
`devpriv->ao_timer` is used while an asynchronous command is running on
|
||||
the AO subdevice. It also gets modified by the subdevice's `cmdtest`
|
||||
handler for checking new asynchronous commands,
|
||||
`usbduxsigma_ao_cmdtest()`, which is not correct as it's allowed to
|
||||
check new commands while an old command is still running. Fix it by
|
||||
moving the code which sets up `devpriv->ao_timer` into the subdevice's
|
||||
`cmd` handler, `usbduxsigma_ao_cmd()`.
|
||||
|
||||
Note that the removed code in `usbduxsigma_ao_cmdtest()` checked that
|
||||
`devpriv->ao_timer` did not end up less that 1, but that could not
|
||||
happen due because `cmd->scan_begin_arg` or `cmd->convert_arg` had
|
||||
already been range-checked.
|
||||
|
||||
Also note that we tested the `high_speed` variable in the old code, but
|
||||
that is currently always 0 and means that we always use "scan" timing
|
||||
(`cmd->scan_begin_src == TRIG_TIMER` and `cmd->convert_src == TRIG_NOW`)
|
||||
and never "convert" (individual sample) timing (`cmd->scan_begin_src ==
|
||||
TRIG_FOLLOW` and `cmd->convert_src == TRIG_TIMER`). The moved code
|
||||
tests `cmd->convert_src` instead to decide whether "scan" or "convert"
|
||||
timing is being used, although currently only "scan" timing is
|
||||
supported.
|
||||
|
||||
Fixes: fb1ef622e7a3 ("staging: comedi: usbduxsigma: tidy up analog output command support")
|
||||
Signed-off-by: Ian Abbott <abbotti@mev.co.uk>
|
||||
Reviewed-by: Bernd Porr <mail@berndporr.me.uk>
|
||||
Reviewed-by: H Hartley Sweeten <hsweeten@visionengravers.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/staging/comedi/drivers/usbduxsigma.c | 33 +++++++++++----------------
|
||||
1 file changed, 14 insertions(+), 19 deletions(-)
|
||||
|
||||
--- a/drivers/staging/comedi/drivers/usbduxsigma.c
|
||||
+++ b/drivers/staging/comedi/drivers/usbduxsigma.c
|
||||
@@ -912,25 +912,6 @@ static int usbduxsigma_ao_cmdtest(struct
|
||||
if (err)
|
||||
return 3;
|
||||
|
||||
- /* Step 4: fix up any arguments */
|
||||
-
|
||||
- /* we count in timer steps */
|
||||
- if (high_speed) {
|
||||
- /* timing of the conversion itself: every 125 us */
|
||||
- devpriv->ao_timer = cmd->convert_arg / 125000;
|
||||
- } else {
|
||||
- /*
|
||||
- * timing of the scan: every 1ms
|
||||
- * we get all channels at once
|
||||
- */
|
||||
- devpriv->ao_timer = cmd->scan_begin_arg / 1000000;
|
||||
- }
|
||||
- if (devpriv->ao_timer < 1)
|
||||
- err |= -EINVAL;
|
||||
-
|
||||
- if (err)
|
||||
- return 4;
|
||||
-
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -943,6 +924,20 @@ static int usbduxsigma_ao_cmd(struct com
|
||||
|
||||
down(&devpriv->sem);
|
||||
|
||||
+ if (cmd->convert_src == TRIG_TIMER) {
|
||||
+ /*
|
||||
+ * timing of the conversion itself: every 125 us
|
||||
+ * at high speed (not used yet)
|
||||
+ */
|
||||
+ devpriv->ao_timer = cmd->convert_arg / 125000;
|
||||
+ } else {
|
||||
+ /*
|
||||
+ * timing of the scan: every 1ms
|
||||
+ * we get all channels at once
|
||||
+ */
|
||||
+ devpriv->ao_timer = cmd->scan_begin_arg / 1000000;
|
||||
+ }
|
||||
+
|
||||
devpriv->ao_counter = devpriv->ao_timer;
|
||||
|
||||
if (cmd->start_src == TRIG_NOW) {
|
||||
-75
@@ -1,75 +0,0 @@
|
||||
From 8117e347406278fd399b077add4e638cd017ae2d Mon Sep 17 00:00:00 2001
|
||||
From: Johannes Thumshirn <jthumshirn@suse.de>
|
||||
Date: Thu, 6 Aug 2015 09:16:37 +0200
|
||||
Subject: tty: serial: men_z135_uart.c: Fix race between IRQ and set_termios()
|
||||
|
||||
From: Johannes Thumshirn <jthumshirn@suse.de>
|
||||
|
||||
commit 8117e347406278fd399b077add4e638cd017ae2d upstream.
|
||||
|
||||
Fix panic caused by a race between men_z135_intr() and men_z135_set_termios().
|
||||
|
||||
men_z135_intr() and men_z135_set_termios() both hold the struct uart_port::lock
|
||||
spinlock, but men_z135_intr() does a spin_lock_irqsave() and
|
||||
men_z135_set_termios() does a normal spin_lock(), which can lead to a deadlock
|
||||
when an interrupt is called while the lock is being helt by
|
||||
men_z135_set_termios().
|
||||
|
||||
This was discovered using a insmod, hardware looppback send/receive, rmmod
|
||||
stress test.
|
||||
|
||||
Signed-off-by: Johannes Thumshirn <jthumshirn@suse.de>
|
||||
Reviewed-by: Peter Hurley <peter@hurleysoftware.com>
|
||||
Cc: Andreas Werner <andreas.werner@men.de>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/tty/serial/men_z135_uart.c | 9 ++++-----
|
||||
1 file changed, 4 insertions(+), 5 deletions(-)
|
||||
|
||||
--- a/drivers/tty/serial/men_z135_uart.c
|
||||
+++ b/drivers/tty/serial/men_z135_uart.c
|
||||
@@ -392,7 +392,6 @@ static irqreturn_t men_z135_intr(int irq
|
||||
struct men_z135_port *uart = (struct men_z135_port *)data;
|
||||
struct uart_port *port = &uart->port;
|
||||
bool handled = false;
|
||||
- unsigned long flags;
|
||||
int irq_id;
|
||||
|
||||
uart->stat_reg = ioread32(port->membase + MEN_Z135_STAT_REG);
|
||||
@@ -401,7 +400,7 @@ static irqreturn_t men_z135_intr(int irq
|
||||
if (!irq_id)
|
||||
goto out;
|
||||
|
||||
- spin_lock_irqsave(&port->lock, flags);
|
||||
+ spin_lock(&port->lock);
|
||||
/* It's save to write to IIR[7:6] RXC[9:8] */
|
||||
iowrite8(irq_id, port->membase + MEN_Z135_STAT_REG);
|
||||
|
||||
@@ -427,7 +426,7 @@ static irqreturn_t men_z135_intr(int irq
|
||||
handled = true;
|
||||
}
|
||||
|
||||
- spin_unlock_irqrestore(&port->lock, flags);
|
||||
+ spin_unlock(&port->lock);
|
||||
out:
|
||||
return IRQ_RETVAL(handled);
|
||||
}
|
||||
@@ -717,7 +716,7 @@ static void men_z135_set_termios(struct
|
||||
|
||||
baud = uart_get_baud_rate(port, termios, old, 0, uart_freq / 16);
|
||||
|
||||
- spin_lock(&port->lock);
|
||||
+ spin_lock_irq(&port->lock);
|
||||
if (tty_termios_baud_rate(termios))
|
||||
tty_termios_encode_baud_rate(termios, baud, baud);
|
||||
|
||||
@@ -725,7 +724,7 @@ static void men_z135_set_termios(struct
|
||||
iowrite32(bd_reg, port->membase + MEN_Z135_BAUD_REG);
|
||||
|
||||
uart_update_timeout(port, termios->c_cflag, baud);
|
||||
- spin_unlock(&port->lock);
|
||||
+ spin_unlock_irq(&port->lock);
|
||||
}
|
||||
|
||||
static const char *men_z135_type(struct uart_port *port)
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
From b2fb5b1a0f50d3ebc12342c8d8dead245e9c9d4e Mon Sep 17 00:00:00 2001
|
||||
From: Kishon Vijay Abraham I <kishon@ti.com>
|
||||
Date: Mon, 27 Jul 2015 12:25:27 +0530
|
||||
Subject: usb: dwc3: ep0: Fix mem corruption on OUT transfers of more than 512 bytes
|
||||
|
||||
From: Kishon Vijay Abraham I <kishon@ti.com>
|
||||
|
||||
commit b2fb5b1a0f50d3ebc12342c8d8dead245e9c9d4e upstream.
|
||||
|
||||
DWC3 uses bounce buffer to handle non max packet aligned OUT transfers and
|
||||
the size of bounce buffer is 512 bytes. However if the host initiates OUT
|
||||
transfers of size more than 512 bytes (and non max packet aligned), the
|
||||
driver throws a WARN dump but still programs the TRB to receive more than
|
||||
512 bytes. This will cause bounce buffer to overflow and corrupt the
|
||||
adjacent memory locations which can be fatal.
|
||||
|
||||
Fix it by programming the TRB to receive a maximum of DWC3_EP0_BOUNCE_SIZE
|
||||
(512) bytes.
|
||||
|
||||
Signed-off-by: Kishon Vijay Abraham I <kishon@ti.com>
|
||||
Signed-off-by: Felipe Balbi <balbi@ti.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/usb/dwc3/ep0.c | 12 ++++++++++--
|
||||
1 file changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/usb/dwc3/ep0.c
|
||||
+++ b/drivers/usb/dwc3/ep0.c
|
||||
@@ -820,6 +820,11 @@ static void dwc3_ep0_complete_data(struc
|
||||
unsigned maxp = ep0->endpoint.maxpacket;
|
||||
|
||||
transfer_size += (maxp - (transfer_size % maxp));
|
||||
+
|
||||
+ /* Maximum of DWC3_EP0_BOUNCE_SIZE can only be received */
|
||||
+ if (transfer_size > DWC3_EP0_BOUNCE_SIZE)
|
||||
+ transfer_size = DWC3_EP0_BOUNCE_SIZE;
|
||||
+
|
||||
transferred = min_t(u32, ur->length,
|
||||
transfer_size - length);
|
||||
memcpy(ur->buf, dwc->ep0_bounce, transferred);
|
||||
@@ -941,11 +946,14 @@ static void __dwc3_ep0_do_control_data(s
|
||||
return;
|
||||
}
|
||||
|
||||
- WARN_ON(req->request.length > DWC3_EP0_BOUNCE_SIZE);
|
||||
-
|
||||
maxpacket = dep->endpoint.maxpacket;
|
||||
transfer_size = roundup(req->request.length, maxpacket);
|
||||
|
||||
+ if (transfer_size > DWC3_EP0_BOUNCE_SIZE) {
|
||||
+ dev_WARN(dwc->dev, "bounce buf can't handle req len\n");
|
||||
+ transfer_size = DWC3_EP0_BOUNCE_SIZE;
|
||||
+ }
|
||||
+
|
||||
dwc->ep0_bounced = true;
|
||||
|
||||
/*
|
||||
-51
@@ -1,51 +0,0 @@
|
||||
From 1fb8dc36384ae1140ee6ccc470de74397606a9d5 Mon Sep 17 00:00:00 2001
|
||||
From: Matthijs Kooijman <matthijs@stdin.nl>
|
||||
Date: Tue, 18 Aug 2015 10:33:56 +0200
|
||||
Subject: USB: ftdi_sio: Added custom PID for CustomWare products
|
||||
|
||||
From: Matthijs Kooijman <matthijs@stdin.nl>
|
||||
|
||||
commit 1fb8dc36384ae1140ee6ccc470de74397606a9d5 upstream.
|
||||
|
||||
CustomWare uses the FTDI VID with custom PIDs for their ShipModul MiniPlex
|
||||
products.
|
||||
|
||||
Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
|
||||
Signed-off-by: Johan Hovold <johan@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/usb/serial/ftdi_sio.c | 4 ++++
|
||||
drivers/usb/serial/ftdi_sio_ids.h | 8 ++++++++
|
||||
2 files changed, 12 insertions(+)
|
||||
|
||||
--- a/drivers/usb/serial/ftdi_sio.c
|
||||
+++ b/drivers/usb/serial/ftdi_sio.c
|
||||
@@ -605,6 +605,10 @@ static const struct usb_device_id id_tab
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_NT_ORIONLXM_PID),
|
||||
.driver_info = (kernel_ulong_t)&ftdi_jtag_quirk },
|
||||
{ USB_DEVICE(FTDI_VID, FTDI_SYNAPSE_SS200_PID) },
|
||||
+ { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX_PID) },
|
||||
+ { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2_PID) },
|
||||
+ { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX2WI_PID) },
|
||||
+ { USB_DEVICE(FTDI_VID, FTDI_CUSTOMWARE_MINIPLEX3_PID) },
|
||||
/*
|
||||
* ELV devices:
|
||||
*/
|
||||
--- a/drivers/usb/serial/ftdi_sio_ids.h
|
||||
+++ b/drivers/usb/serial/ftdi_sio_ids.h
|
||||
@@ -568,6 +568,14 @@
|
||||
*/
|
||||
#define FTDI_SYNAPSE_SS200_PID 0x9090 /* SS200 - SNAP Stick 200 */
|
||||
|
||||
+/*
|
||||
+ * CustomWare / ShipModul NMEA multiplexers product ids (FTDI_VID)
|
||||
+ */
|
||||
+#define FTDI_CUSTOMWARE_MINIPLEX_PID 0xfd48 /* MiniPlex first generation NMEA Multiplexer */
|
||||
+#define FTDI_CUSTOMWARE_MINIPLEX2_PID 0xfd49 /* MiniPlex-USB and MiniPlex-2 series */
|
||||
+#define FTDI_CUSTOMWARE_MINIPLEX2WI_PID 0xfd4a /* MiniPlex-2Wi */
|
||||
+#define FTDI_CUSTOMWARE_MINIPLEX3_PID 0xfd4b /* MiniPlex-3 series */
|
||||
+
|
||||
|
||||
/********************************/
|
||||
/** third-party VID/PID combos **/
|
||||
-87
@@ -1,87 +0,0 @@
|
||||
From 913e4a90b6f9687ac0f543e7b632753e4f51c441 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Chen <peter.chen@freescale.com>
|
||||
Date: Thu, 30 Jul 2015 13:13:03 +0800
|
||||
Subject: usb: gadget: f_uac2: finalize wMaxPacketSize according to bandwidth
|
||||
|
||||
From: Peter Chen <peter.chen@freescale.com>
|
||||
|
||||
commit 913e4a90b6f9687ac0f543e7b632753e4f51c441 upstream.
|
||||
|
||||
According to USB Audio Device 2.0 Spec, Ch4.10.1.1:
|
||||
wMaxPacketSize is defined as follows:
|
||||
Maximum packet size this endpoint is capable of sending or receiving
|
||||
when this configuration is selected.
|
||||
This is determined by the audio bandwidth constraints of the endpoint.
|
||||
|
||||
In current code, the wMaxPacketSize is defined as the maximum packet size
|
||||
for ISO endpoint, and it will let the host reserve much more space than
|
||||
it really needs, so that we can't let more endpoints work together at
|
||||
one frame.
|
||||
|
||||
We find this issue when we try to let 4 f_uac2 gadgets work together [1]
|
||||
at FS connection.
|
||||
|
||||
[1]http://www.spinics.net/lists/linux-usb/msg123478.html
|
||||
|
||||
Acked-by: Daniel Mack <zonque@gmail.com>
|
||||
Cc: andrzej.p@samsung.com
|
||||
Cc: Daniel Mack <zonque@gmail.com>
|
||||
Cc: tiwai@suse.de
|
||||
Cc: Alan Stern <stern@rowland.harvard.edu>
|
||||
Signed-off-by: Peter Chen <peter.chen@freescale.com>
|
||||
Signed-off-by: Felipe Balbi <balbi@ti.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/usb/gadget/function/f_uac2.c | 31 +++++++++++++++++++++++++++++--
|
||||
1 file changed, 29 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/drivers/usb/gadget/function/f_uac2.c
|
||||
+++ b/drivers/usb/gadget/function/f_uac2.c
|
||||
@@ -975,6 +975,29 @@ free_ep(struct uac2_rtd_params *prm, str
|
||||
"%s:%d Error!\n", __func__, __LINE__);
|
||||
}
|
||||
|
||||
+static void set_ep_max_packet_size(const struct f_uac2_opts *uac2_opts,
|
||||
+ struct usb_endpoint_descriptor *ep_desc,
|
||||
+ unsigned int factor, bool is_playback)
|
||||
+{
|
||||
+ int chmask, srate, ssize;
|
||||
+ u16 max_packet_size;
|
||||
+
|
||||
+ if (is_playback) {
|
||||
+ chmask = uac2_opts->p_chmask;
|
||||
+ srate = uac2_opts->p_srate;
|
||||
+ ssize = uac2_opts->p_ssize;
|
||||
+ } else {
|
||||
+ chmask = uac2_opts->c_chmask;
|
||||
+ srate = uac2_opts->c_srate;
|
||||
+ ssize = uac2_opts->c_ssize;
|
||||
+ }
|
||||
+
|
||||
+ max_packet_size = num_channels(chmask) * ssize *
|
||||
+ DIV_ROUND_UP(srate, factor / (1 << (ep_desc->bInterval - 1)));
|
||||
+ ep_desc->wMaxPacketSize = cpu_to_le16(min(max_packet_size,
|
||||
+ le16_to_cpu(ep_desc->wMaxPacketSize)));
|
||||
+}
|
||||
+
|
||||
static int
|
||||
afunc_bind(struct usb_configuration *cfg, struct usb_function *fn)
|
||||
{
|
||||
@@ -1070,10 +1093,14 @@ afunc_bind(struct usb_configuration *cfg
|
||||
uac2->p_prm.uac2 = uac2;
|
||||
uac2->c_prm.uac2 = uac2;
|
||||
|
||||
+ /* Calculate wMaxPacketSize according to audio bandwidth */
|
||||
+ set_ep_max_packet_size(uac2_opts, &fs_epin_desc, 1000, true);
|
||||
+ set_ep_max_packet_size(uac2_opts, &fs_epout_desc, 1000, false);
|
||||
+ set_ep_max_packet_size(uac2_opts, &hs_epin_desc, 8000, true);
|
||||
+ set_ep_max_packet_size(uac2_opts, &hs_epout_desc, 8000, false);
|
||||
+
|
||||
hs_epout_desc.bEndpointAddress = fs_epout_desc.bEndpointAddress;
|
||||
- hs_epout_desc.wMaxPacketSize = fs_epout_desc.wMaxPacketSize;
|
||||
hs_epin_desc.bEndpointAddress = fs_epin_desc.bEndpointAddress;
|
||||
- hs_epin_desc.wMaxPacketSize = fs_epin_desc.wMaxPacketSize;
|
||||
|
||||
ret = usb_assign_descriptors(fn, fs_audio_desc, hs_audio_desc, NULL);
|
||||
if (ret)
|
||||
-32
@@ -1,32 +0,0 @@
|
||||
From 5feb5d2003499b1094d898c010a7604d7afddc4c Mon Sep 17 00:00:00 2001
|
||||
From: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Date: Thu, 30 Jul 2015 00:30:58 +0300
|
||||
Subject: usb: gadget: m66592-udc: forever loop in set_feature()
|
||||
|
||||
From: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
|
||||
commit 5feb5d2003499b1094d898c010a7604d7afddc4c upstream.
|
||||
|
||||
There is an "&&" vs "||" typo here so this loops 3000 times or if we get
|
||||
unlucky it could loop forever.
|
||||
|
||||
Fixes: ceaa0a6eeadf ('usb: gadget: m66592-udc: add support for TEST_MODE')
|
||||
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
|
||||
Signed-off-by: Felipe Balbi <balbi@ti.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/usb/gadget/udc/m66592-udc.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/drivers/usb/gadget/udc/m66592-udc.c
|
||||
+++ b/drivers/usb/gadget/udc/m66592-udc.c
|
||||
@@ -1052,7 +1052,7 @@ static void set_feature(struct m66592 *m
|
||||
tmp = m66592_read(m66592, M66592_INTSTS0) &
|
||||
M66592_CTSQ;
|
||||
udelay(1);
|
||||
- } while (tmp != M66592_CS_IDST || timeout-- > 0);
|
||||
+ } while (tmp != M66592_CS_IDST && timeout-- > 0);
|
||||
|
||||
if (tmp == M66592_CS_IDST)
|
||||
m66592_bset(m66592,
|
||||
-58
@@ -1,58 +0,0 @@
|
||||
From 0521cfd06e1ebcd575e7ae36aab068b38df23850 Mon Sep 17 00:00:00 2001
|
||||
From: Peter Chen <peter.chen@freescale.com>
|
||||
Date: Mon, 17 Aug 2015 10:23:03 +0800
|
||||
Subject: usb: host: ehci-sys: delete useless bus_to_hcd conversion
|
||||
|
||||
From: Peter Chen <peter.chen@freescale.com>
|
||||
|
||||
commit 0521cfd06e1ebcd575e7ae36aab068b38df23850 upstream.
|
||||
|
||||
The ehci platform device's drvdata is the pointer of struct usb_hcd
|
||||
already, so we doesn't need to call bus_to_hcd conversion again.
|
||||
|
||||
Signed-off-by: Peter Chen <peter.chen@freescale.com>
|
||||
Acked-by: Alan Stern <stern@rowland.harvard.edu>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/usb/host/ehci-sysfs.c | 8 ++++----
|
||||
1 file changed, 4 insertions(+), 4 deletions(-)
|
||||
|
||||
--- a/drivers/usb/host/ehci-sysfs.c
|
||||
+++ b/drivers/usb/host/ehci-sysfs.c
|
||||
@@ -29,7 +29,7 @@ static ssize_t show_companion(struct dev
|
||||
int count = PAGE_SIZE;
|
||||
char *ptr = buf;
|
||||
|
||||
- ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
|
||||
+ ehci = hcd_to_ehci(dev_get_drvdata(dev));
|
||||
nports = HCS_N_PORTS(ehci->hcs_params);
|
||||
|
||||
for (index = 0; index < nports; ++index) {
|
||||
@@ -54,7 +54,7 @@ static ssize_t store_companion(struct de
|
||||
struct ehci_hcd *ehci;
|
||||
int portnum, new_owner;
|
||||
|
||||
- ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
|
||||
+ ehci = hcd_to_ehci(dev_get_drvdata(dev));
|
||||
new_owner = PORT_OWNER; /* Owned by companion */
|
||||
if (sscanf(buf, "%d", &portnum) != 1)
|
||||
return -EINVAL;
|
||||
@@ -85,7 +85,7 @@ static ssize_t show_uframe_periodic_max(
|
||||
struct ehci_hcd *ehci;
|
||||
int n;
|
||||
|
||||
- ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
|
||||
+ ehci = hcd_to_ehci(dev_get_drvdata(dev));
|
||||
n = scnprintf(buf, PAGE_SIZE, "%d\n", ehci->uframe_periodic_max);
|
||||
return n;
|
||||
}
|
||||
@@ -101,7 +101,7 @@ static ssize_t store_uframe_periodic_max
|
||||
unsigned long flags;
|
||||
ssize_t ret;
|
||||
|
||||
- ehci = hcd_to_ehci(bus_to_hcd(dev_get_drvdata(dev)));
|
||||
+ ehci = hcd_to_ehci(dev_get_drvdata(dev));
|
||||
if (kstrtouint(buf, 0, &uframe_periodic_max) < 0)
|
||||
return -EINVAL;
|
||||
|
||||
-97
@@ -1,97 +0,0 @@
|
||||
From 49bda21266fdf195142e8b5dea057f09e96ada9f Mon Sep 17 00:00:00 2001
|
||||
From: =?UTF-8?q?Micha=C5=82=20Pecio?= <michal.pecio@gmail.com>
|
||||
Date: Sun, 26 Jul 2015 11:14:34 +0200
|
||||
Subject: USB: pl2303: fix baud-rate divisor calculations
|
||||
|
||||
From: =?UTF-8?q?Micha=C5=82=20Pecio?= <michal.pecio@gmail.com>
|
||||
|
||||
commit 49bda21266fdf195142e8b5dea057f09e96ada9f upstream.
|
||||
|
||||
This commit fixes the following issues:
|
||||
|
||||
1. The 9th bit of buf was believed to be the LSB of divisor's
|
||||
exponent, but the hardware interprets it as MSB (9th bit) of the
|
||||
mantissa. The exponent is actually one bit shorter and applies
|
||||
to base 4, not 2 as previously believed.
|
||||
|
||||
2. Loop iterations doubled the exponent instead of incrementing.
|
||||
|
||||
3. The exponent wasn't checked for overflow.
|
||||
|
||||
4. The function returned requested rate instead of actual rate.
|
||||
|
||||
Due to issue #2, the old code deviated from the wrong formula
|
||||
described in #1 and actually yielded correct rates when divisor
|
||||
was lower than 4096 by using exponents of 0, 2 or 4 base-2,
|
||||
interpreted as 0, 1, 2 base-4 with the 9th mantissa bit clear.
|
||||
However, at 93.75 kbaud or less the rate turned out too slow
|
||||
due to #2 or too fast due to #2 and #3.
|
||||
|
||||
I tested this patch by sending and validating 0x00,0x01,..,0xff
|
||||
to an FTDI dongle at 234, 987, 2401, 9601, 31415, 115199, 250k,
|
||||
500k, 750k, 1M, 1.5M, 3M+1 baud. All rates passed.
|
||||
|
||||
I also used pv to check speed at some rates unsupported by FTDI:
|
||||
45 (the lowest possible), 2M, 4M, 5M and 6M-1. Looked sane.
|
||||
|
||||
Signed-off-by: Michal Pecio <michal.pecio@gmail.com>
|
||||
Fixes: 399aa9a75ad3 ("USB: pl2303: use divisors for unsupported baud
|
||||
rates")
|
||||
[johan: update summary ]
|
||||
Signed-off-by: Johan Hovold <johan@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/usb/serial/pl2303.c | 35 ++++++++++++++++++++++++++---------
|
||||
1 file changed, 26 insertions(+), 9 deletions(-)
|
||||
|
||||
--- a/drivers/usb/serial/pl2303.c
|
||||
+++ b/drivers/usb/serial/pl2303.c
|
||||
@@ -362,21 +362,38 @@ static speed_t pl2303_encode_baud_rate_d
|
||||
static speed_t pl2303_encode_baud_rate_divisor(unsigned char buf[4],
|
||||
speed_t baud)
|
||||
{
|
||||
- unsigned int tmp;
|
||||
+ unsigned int baseline, mantissa, exponent;
|
||||
|
||||
/*
|
||||
* Apparently the formula is:
|
||||
- * baudrate = 12M * 32 / (2^buf[1]) / buf[0]
|
||||
+ * baudrate = 12M * 32 / (mantissa * 4^exponent)
|
||||
+ * where
|
||||
+ * mantissa = buf[8:0]
|
||||
+ * exponent = buf[11:9]
|
||||
*/
|
||||
- tmp = 12000000 * 32 / baud;
|
||||
+ baseline = 12000000 * 32;
|
||||
+ mantissa = baseline / baud;
|
||||
+ if (mantissa == 0)
|
||||
+ mantissa = 1; /* Avoid dividing by zero if baud > 32*12M. */
|
||||
+ exponent = 0;
|
||||
+ while (mantissa >= 512) {
|
||||
+ if (exponent < 7) {
|
||||
+ mantissa >>= 2; /* divide by 4 */
|
||||
+ exponent++;
|
||||
+ } else {
|
||||
+ /* Exponent is maxed. Trim mantissa and leave. */
|
||||
+ mantissa = 511;
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
buf[3] = 0x80;
|
||||
buf[2] = 0;
|
||||
- buf[1] = (tmp >= 256);
|
||||
- while (tmp >= 256) {
|
||||
- tmp >>= 2;
|
||||
- buf[1] <<= 1;
|
||||
- }
|
||||
- buf[0] = tmp;
|
||||
+ buf[1] = exponent << 1 | mantissa >> 8;
|
||||
+ buf[0] = mantissa & 0xff;
|
||||
+
|
||||
+ /* Calculate and return the exact baud rate. */
|
||||
+ baud = (baseline / mantissa) >> (exponent << 1);
|
||||
|
||||
return baud;
|
||||
}
|
||||
-30
@@ -1,30 +0,0 @@
|
||||
From 44840dec6127e4d7c5074f75d2dd96bc4ab85fe3 Mon Sep 17 00:00:00 2001
|
||||
From: David Ward <david.ward@ll.mit.edu>
|
||||
Date: Tue, 18 Aug 2015 10:36:23 +0200
|
||||
Subject: USB: qcserial: add HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module
|
||||
|
||||
From: David Ward <david.ward@ll.mit.edu>
|
||||
|
||||
commit 44840dec6127e4d7c5074f75d2dd96bc4ab85fe3 upstream.
|
||||
|
||||
This is an HP-branded Sierra Wireless EM7355:
|
||||
https://bugzilla.redhat.com/show_bug.cgi?id=1223646#c2
|
||||
|
||||
Signed-off-by: David Ward <david.ward@ll.mit.edu>
|
||||
Signed-off-by: Johan Hovold <johan@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/usb/serial/qcserial.c | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
--- a/drivers/usb/serial/qcserial.c
|
||||
+++ b/drivers/usb/serial/qcserial.c
|
||||
@@ -139,6 +139,7 @@ static const struct usb_device_id id_tab
|
||||
{USB_DEVICE(0x0AF0, 0x8120)}, /* Option GTM681W */
|
||||
|
||||
/* non-Gobi Sierra Wireless devices */
|
||||
+ {DEVICE_SWI(0x03f0, 0x4e1d)}, /* HP lt4111 LTE/EV-DO/HSPA+ Gobi 4G Module */
|
||||
{DEVICE_SWI(0x0f3d, 0x68a2)}, /* Sierra Wireless MC7700 */
|
||||
{DEVICE_SWI(0x114f, 0x68a2)}, /* Sierra Wireless MC7750 */
|
||||
{DEVICE_SWI(0x1199, 0x68a2)}, /* Sierra Wireless MC7710 */
|
||||
-52
@@ -1,52 +0,0 @@
|
||||
From 951d3793bbfc0a441d791d820183aa3085c83ea9 Mon Sep 17 00:00:00 2001
|
||||
From: Philipp Hachtmann <hachti@hachti.de>
|
||||
Date: Mon, 17 Aug 2015 17:31:46 +0200
|
||||
Subject: USB: symbolserial: Use usb_get_serial_port_data
|
||||
|
||||
From: Philipp Hachtmann <hachti@hachti.de>
|
||||
|
||||
commit 951d3793bbfc0a441d791d820183aa3085c83ea9 upstream.
|
||||
|
||||
The driver used usb_get_serial_data(port->serial) which compiled but resulted
|
||||
in a NULL pointer being returned (and subsequently used). I did not go deeper
|
||||
into this but I guess this is a regression.
|
||||
|
||||
Signed-off-by: Philipp Hachtmann <hachti@hachti.de>
|
||||
Fixes: a85796ee5149 ("USB: symbolserial: move private-data allocation to
|
||||
port_probe")
|
||||
Acked-by: Johan Hovold <johan@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
drivers/usb/serial/symbolserial.c | 6 +++---
|
||||
1 file changed, 3 insertions(+), 3 deletions(-)
|
||||
|
||||
--- a/drivers/usb/serial/symbolserial.c
|
||||
+++ b/drivers/usb/serial/symbolserial.c
|
||||
@@ -94,7 +94,7 @@ exit:
|
||||
|
||||
static int symbol_open(struct tty_struct *tty, struct usb_serial_port *port)
|
||||
{
|
||||
- struct symbol_private *priv = usb_get_serial_data(port->serial);
|
||||
+ struct symbol_private *priv = usb_get_serial_port_data(port);
|
||||
unsigned long flags;
|
||||
int result = 0;
|
||||
|
||||
@@ -120,7 +120,7 @@ static void symbol_close(struct usb_seri
|
||||
static void symbol_throttle(struct tty_struct *tty)
|
||||
{
|
||||
struct usb_serial_port *port = tty->driver_data;
|
||||
- struct symbol_private *priv = usb_get_serial_data(port->serial);
|
||||
+ struct symbol_private *priv = usb_get_serial_port_data(port);
|
||||
|
||||
spin_lock_irq(&priv->lock);
|
||||
priv->throttled = true;
|
||||
@@ -130,7 +130,7 @@ static void symbol_throttle(struct tty_s
|
||||
static void symbol_unthrottle(struct tty_struct *tty)
|
||||
{
|
||||
struct usb_serial_port *port = tty->driver_data;
|
||||
- struct symbol_private *priv = usb_get_serial_data(port->serial);
|
||||
+ struct symbol_private *priv = usb_get_serial_port_data(port);
|
||||
int result;
|
||||
bool was_throttled;
|
||||
|
||||
-98
@@ -1,98 +0,0 @@
|
||||
From 4809146b86c3d41ce588fdb767d021e2a80600dd Mon Sep 17 00:00:00 2001
|
||||
From: Juergen Gross <jgross@suse.com>
|
||||
Date: Thu, 6 Aug 2015 19:54:34 +0200
|
||||
Subject: x86/ldt: Correct FPU emulation access to LDT
|
||||
|
||||
From: Juergen Gross <jgross@suse.com>
|
||||
|
||||
commit 4809146b86c3d41ce588fdb767d021e2a80600dd upstream.
|
||||
|
||||
Commit 37868fe113ff ("x86/ldt: Make modify_ldt synchronous")
|
||||
introduced a new struct ldt_struct anchored at mm->context.ldt.
|
||||
|
||||
Adapt the x86 fpu emulation code to use that new structure.
|
||||
|
||||
Signed-off-by: Juergen Gross <jgross@suse.com>
|
||||
Reviewed-by: Andy Lutomirski <luto@kernel.org>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: billm@melbpc.org.au
|
||||
Link: http://lkml.kernel.org/r/1438883674-1240-1-git-send-email-jgross@suse.com
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
arch/x86/math-emu/fpu_entry.c | 3 +--
|
||||
arch/x86/math-emu/fpu_system.h | 21 ++++++++++++++++++---
|
||||
arch/x86/math-emu/get_address.c | 3 +--
|
||||
3 files changed, 20 insertions(+), 7 deletions(-)
|
||||
|
||||
--- a/arch/x86/math-emu/fpu_entry.c
|
||||
+++ b/arch/x86/math-emu/fpu_entry.c
|
||||
@@ -29,7 +29,6 @@
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
#include <asm/traps.h>
|
||||
-#include <asm/desc.h>
|
||||
#include <asm/user.h>
|
||||
#include <asm/i387.h>
|
||||
|
||||
@@ -185,7 +184,7 @@ void math_emulate(struct math_emu_info *
|
||||
math_abort(FPU_info, SIGILL);
|
||||
}
|
||||
|
||||
- code_descriptor = LDT_DESCRIPTOR(FPU_CS);
|
||||
+ code_descriptor = FPU_get_ldt_descriptor(FPU_CS);
|
||||
if (SEG_D_SIZE(code_descriptor)) {
|
||||
/* The above test may be wrong, the book is not clear */
|
||||
/* Segmented 32 bit protected mode */
|
||||
--- a/arch/x86/math-emu/fpu_system.h
|
||||
+++ b/arch/x86/math-emu/fpu_system.h
|
||||
@@ -16,9 +16,24 @@
|
||||
#include <linux/kernel.h>
|
||||
#include <linux/mm.h>
|
||||
|
||||
-/* s is always from a cpu register, and the cpu does bounds checking
|
||||
- * during register load --> no further bounds checks needed */
|
||||
-#define LDT_DESCRIPTOR(s) (((struct desc_struct *)current->mm->context.ldt)[(s) >> 3])
|
||||
+#include <asm/desc.h>
|
||||
+#include <asm/mmu_context.h>
|
||||
+
|
||||
+static inline struct desc_struct FPU_get_ldt_descriptor(unsigned seg)
|
||||
+{
|
||||
+ static struct desc_struct zero_desc;
|
||||
+ struct desc_struct ret = zero_desc;
|
||||
+
|
||||
+#ifdef CONFIG_MODIFY_LDT_SYSCALL
|
||||
+ seg >>= 3;
|
||||
+ mutex_lock(¤t->mm->context.lock);
|
||||
+ if (current->mm->context.ldt && seg < current->mm->context.ldt->size)
|
||||
+ ret = current->mm->context.ldt->entries[seg];
|
||||
+ mutex_unlock(¤t->mm->context.lock);
|
||||
+#endif
|
||||
+ return ret;
|
||||
+}
|
||||
+
|
||||
#define SEG_D_SIZE(x) ((x).b & (3 << 21))
|
||||
#define SEG_G_BIT(x) ((x).b & (1 << 23))
|
||||
#define SEG_GRANULARITY(x) (((x).b & (1 << 23)) ? 4096 : 1)
|
||||
--- a/arch/x86/math-emu/get_address.c
|
||||
+++ b/arch/x86/math-emu/get_address.c
|
||||
@@ -20,7 +20,6 @@
|
||||
#include <linux/stddef.h>
|
||||
|
||||
#include <asm/uaccess.h>
|
||||
-#include <asm/desc.h>
|
||||
|
||||
#include "fpu_system.h"
|
||||
#include "exception.h"
|
||||
@@ -158,7 +157,7 @@ static long pm_address(u_char FPU_modrm,
|
||||
addr->selector = PM_REG_(segment);
|
||||
}
|
||||
|
||||
- descriptor = LDT_DESCRIPTOR(PM_REG_(segment));
|
||||
+ descriptor = FPU_get_ldt_descriptor(segment);
|
||||
base_address = SEG_BASE_ADDR(descriptor);
|
||||
address = base_address + offset;
|
||||
limit = base_address
|
||||
-45
@@ -1,45 +0,0 @@
|
||||
From 136d9d83c07c5e30ac49fc83b27e8c4842f108fc Mon Sep 17 00:00:00 2001
|
||||
From: Juergen Gross <jgross@suse.com>
|
||||
Date: Thu, 6 Aug 2015 10:04:38 +0200
|
||||
Subject: x86/ldt: Correct LDT access in single stepping logic
|
||||
|
||||
From: Juergen Gross <jgross@suse.com>
|
||||
|
||||
commit 136d9d83c07c5e30ac49fc83b27e8c4842f108fc upstream.
|
||||
|
||||
Commit 37868fe113ff ("x86/ldt: Make modify_ldt synchronous")
|
||||
introduced a new struct ldt_struct anchored at mm->context.ldt.
|
||||
|
||||
convert_ip_to_linear() was changed to reflect this, but indexing
|
||||
into the ldt has to be changed as the pointer is no longer void *.
|
||||
|
||||
Signed-off-by: Juergen Gross <jgross@suse.com>
|
||||
Reviewed-by: Andy Lutomirski <luto@kernel.org>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: bp@suse.de
|
||||
Link: http://lkml.kernel.org/r/1438848278-12906-1-git-send-email-jgross@suse.com
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
arch/x86/kernel/step.c | 4 ++--
|
||||
1 file changed, 2 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/arch/x86/kernel/step.c
|
||||
+++ b/arch/x86/kernel/step.c
|
||||
@@ -28,11 +28,11 @@ unsigned long convert_ip_to_linear(struc
|
||||
struct desc_struct *desc;
|
||||
unsigned long base;
|
||||
|
||||
- seg &= ~7UL;
|
||||
+ seg >>= 3;
|
||||
|
||||
mutex_lock(&child->mm->context.lock);
|
||||
if (unlikely(!child->mm->context.ldt ||
|
||||
- (seg >> 3) >= child->mm->context.ldt->size))
|
||||
+ seg >= child->mm->context.ldt->size))
|
||||
addr = -1L; /* bogus selector, access would fault */
|
||||
else {
|
||||
desc = &child->mm->context.ldt->entries[seg];
|
||||
@@ -1,35 +0,0 @@
|
||||
From 12e244f4b550498bbaf654a52f93633f7dde2dc7 Mon Sep 17 00:00:00 2001
|
||||
From: Andy Lutomirski <luto@kernel.org>
|
||||
Date: Fri, 14 Aug 2015 15:02:55 -0700
|
||||
Subject: x86/ldt: Further fix FPU emulation
|
||||
|
||||
From: Andy Lutomirski <luto@kernel.org>
|
||||
|
||||
commit 12e244f4b550498bbaf654a52f93633f7dde2dc7 upstream.
|
||||
|
||||
The previous fix confused a selector with a segment prefix. Fix it.
|
||||
|
||||
Compile-tested only.
|
||||
|
||||
Cc: Juergen Gross <jgross@suse.com>
|
||||
Reported-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Fixes: 4809146b86c3 ("x86/ldt: Correct FPU emulation access to LDT")
|
||||
Signed-off-by: Andy Lutomirski <luto@kernel.org>
|
||||
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
arch/x86/math-emu/get_address.c | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
--- a/arch/x86/math-emu/get_address.c
|
||||
+++ b/arch/x86/math-emu/get_address.c
|
||||
@@ -157,7 +157,7 @@ static long pm_address(u_char FPU_modrm,
|
||||
addr->selector = PM_REG_(segment);
|
||||
}
|
||||
|
||||
- descriptor = FPU_get_ldt_descriptor(segment);
|
||||
+ descriptor = FPU_get_ldt_descriptor(addr->selector);
|
||||
base_address = SEG_BASE_ADDR(descriptor);
|
||||
address = base_address + offset;
|
||||
limit = base_address
|
||||
@@ -1,628 +0,0 @@
|
||||
From 37868fe113ff2ba814b3b4eb12df214df555f8dc Mon Sep 17 00:00:00 2001
|
||||
From: Andy Lutomirski <luto@kernel.org>
|
||||
Date: Thu, 30 Jul 2015 14:31:32 -0700
|
||||
Subject: x86/ldt: Make modify_ldt synchronous
|
||||
|
||||
From: Andy Lutomirski <luto@kernel.org>
|
||||
|
||||
commit 37868fe113ff2ba814b3b4eb12df214df555f8dc upstream.
|
||||
|
||||
modify_ldt() has questionable locking and does not synchronize
|
||||
threads. Improve it: redesign the locking and synchronize all
|
||||
threads' LDTs using an IPI on all modifications.
|
||||
|
||||
This will dramatically slow down modify_ldt in multithreaded
|
||||
programs, but there shouldn't be any multithreaded programs that
|
||||
care about modify_ldt's performance in the first place.
|
||||
|
||||
This fixes some fallout from the CVE-2015-5157 fixes.
|
||||
|
||||
Signed-off-by: Andy Lutomirski <luto@kernel.org>
|
||||
Reviewed-by: Borislav Petkov <bp@suse.de>
|
||||
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
|
||||
Cc: Andy Lutomirski <luto@amacapital.net>
|
||||
Cc: Boris Ostrovsky <boris.ostrovsky@oracle.com>
|
||||
Cc: Borislav Petkov <bp@alien8.de>
|
||||
Cc: Brian Gerst <brgerst@gmail.com>
|
||||
Cc: Denys Vlasenko <dvlasenk@redhat.com>
|
||||
Cc: H. Peter Anvin <hpa@zytor.com>
|
||||
Cc: Jan Beulich <jbeulich@suse.com>
|
||||
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
|
||||
Cc: Linus Torvalds <torvalds@linux-foundation.org>
|
||||
Cc: Peter Zijlstra <peterz@infradead.org>
|
||||
Cc: Sasha Levin <sasha.levin@oracle.com>
|
||||
Cc: Steven Rostedt <rostedt@goodmis.org>
|
||||
Cc: Thomas Gleixner <tglx@linutronix.de>
|
||||
Cc: security@kernel.org <security@kernel.org>
|
||||
Cc: xen-devel <xen-devel@lists.xen.org>
|
||||
Link: http://lkml.kernel.org/r/4c6978476782160600471bd865b318db34c7b628.1438291540.git.luto@kernel.org
|
||||
Signed-off-by: Ingo Molnar <mingo@kernel.org>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
arch/x86/include/asm/desc.h | 15 --
|
||||
arch/x86/include/asm/mmu.h | 3
|
||||
arch/x86/include/asm/mmu_context.h | 54 ++++++-
|
||||
arch/x86/kernel/cpu/common.c | 4
|
||||
arch/x86/kernel/cpu/perf_event.c | 12 +
|
||||
arch/x86/kernel/ldt.c | 264 ++++++++++++++++++++-----------------
|
||||
arch/x86/kernel/process_64.c | 4
|
||||
arch/x86/kernel/step.c | 6
|
||||
arch/x86/power/cpu.c | 3
|
||||
9 files changed, 211 insertions(+), 154 deletions(-)
|
||||
|
||||
--- a/arch/x86/include/asm/desc.h
|
||||
+++ b/arch/x86/include/asm/desc.h
|
||||
@@ -280,21 +280,6 @@ static inline void clear_LDT(void)
|
||||
set_ldt(NULL, 0);
|
||||
}
|
||||
|
||||
-/*
|
||||
- * load one particular LDT into the current CPU
|
||||
- */
|
||||
-static inline void load_LDT_nolock(mm_context_t *pc)
|
||||
-{
|
||||
- set_ldt(pc->ldt, pc->size);
|
||||
-}
|
||||
-
|
||||
-static inline void load_LDT(mm_context_t *pc)
|
||||
-{
|
||||
- preempt_disable();
|
||||
- load_LDT_nolock(pc);
|
||||
- preempt_enable();
|
||||
-}
|
||||
-
|
||||
static inline unsigned long get_desc_base(const struct desc_struct *desc)
|
||||
{
|
||||
return (unsigned)(desc->base0 | ((desc->base1) << 16) | ((desc->base2) << 24));
|
||||
--- a/arch/x86/include/asm/mmu.h
|
||||
+++ b/arch/x86/include/asm/mmu.h
|
||||
@@ -9,8 +9,7 @@
|
||||
* we put the segment information here.
|
||||
*/
|
||||
typedef struct {
|
||||
- void *ldt;
|
||||
- int size;
|
||||
+ struct ldt_struct *ldt;
|
||||
|
||||
#ifdef CONFIG_X86_64
|
||||
/* True if mm supports a task running in 32 bit compatibility mode. */
|
||||
--- a/arch/x86/include/asm/mmu_context.h
|
||||
+++ b/arch/x86/include/asm/mmu_context.h
|
||||
@@ -34,6 +34,50 @@ static inline void load_mm_cr4(struct mm
|
||||
#endif
|
||||
|
||||
/*
|
||||
+ * ldt_structs can be allocated, used, and freed, but they are never
|
||||
+ * modified while live.
|
||||
+ */
|
||||
+struct ldt_struct {
|
||||
+ /*
|
||||
+ * Xen requires page-aligned LDTs with special permissions. This is
|
||||
+ * needed to prevent us from installing evil descriptors such as
|
||||
+ * call gates. On native, we could merge the ldt_struct and LDT
|
||||
+ * allocations, but it's not worth trying to optimize.
|
||||
+ */
|
||||
+ struct desc_struct *entries;
|
||||
+ int size;
|
||||
+};
|
||||
+
|
||||
+static inline void load_mm_ldt(struct mm_struct *mm)
|
||||
+{
|
||||
+ struct ldt_struct *ldt;
|
||||
+
|
||||
+ /* lockless_dereference synchronizes with smp_store_release */
|
||||
+ ldt = lockless_dereference(mm->context.ldt);
|
||||
+
|
||||
+ /*
|
||||
+ * Any change to mm->context.ldt is followed by an IPI to all
|
||||
+ * CPUs with the mm active. The LDT will not be freed until
|
||||
+ * after the IPI is handled by all such CPUs. This means that,
|
||||
+ * if the ldt_struct changes before we return, the values we see
|
||||
+ * will be safe, and the new values will be loaded before we run
|
||||
+ * any user code.
|
||||
+ *
|
||||
+ * NB: don't try to convert this to use RCU without extreme care.
|
||||
+ * We would still need IRQs off, because we don't want to change
|
||||
+ * the local LDT after an IPI loaded a newer value than the one
|
||||
+ * that we can see.
|
||||
+ */
|
||||
+
|
||||
+ if (unlikely(ldt))
|
||||
+ set_ldt(ldt->entries, ldt->size);
|
||||
+ else
|
||||
+ clear_LDT();
|
||||
+
|
||||
+ DEBUG_LOCKS_WARN_ON(preemptible());
|
||||
+}
|
||||
+
|
||||
+/*
|
||||
* Used for LDT copy/destruction.
|
||||
*/
|
||||
int init_new_context(struct task_struct *tsk, struct mm_struct *mm);
|
||||
@@ -78,12 +122,12 @@ static inline void switch_mm(struct mm_s
|
||||
* was called and then modify_ldt changed
|
||||
* prev->context.ldt but suppressed an IPI to this CPU.
|
||||
* In this case, prev->context.ldt != NULL, because we
|
||||
- * never free an LDT while the mm still exists. That
|
||||
- * means that next->context.ldt != prev->context.ldt,
|
||||
- * because mms never share an LDT.
|
||||
+ * never set context.ldt to NULL while the mm still
|
||||
+ * exists. That means that next->context.ldt !=
|
||||
+ * prev->context.ldt, because mms never share an LDT.
|
||||
*/
|
||||
if (unlikely(prev->context.ldt != next->context.ldt))
|
||||
- load_LDT_nolock(&next->context);
|
||||
+ load_mm_ldt(next);
|
||||
}
|
||||
#ifdef CONFIG_SMP
|
||||
else {
|
||||
@@ -106,7 +150,7 @@ static inline void switch_mm(struct mm_s
|
||||
load_cr3(next->pgd);
|
||||
trace_tlb_flush(TLB_FLUSH_ON_TASK_SWITCH, TLB_FLUSH_ALL);
|
||||
load_mm_cr4(next);
|
||||
- load_LDT_nolock(&next->context);
|
||||
+ load_mm_ldt(next);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
--- a/arch/x86/kernel/cpu/common.c
|
||||
+++ b/arch/x86/kernel/cpu/common.c
|
||||
@@ -1434,7 +1434,7 @@ void cpu_init(void)
|
||||
load_sp0(t, ¤t->thread);
|
||||
set_tss_desc(cpu, t);
|
||||
load_TR_desc();
|
||||
- load_LDT(&init_mm.context);
|
||||
+ load_mm_ldt(&init_mm);
|
||||
|
||||
clear_all_debug_regs();
|
||||
dbg_restore_debug_regs();
|
||||
@@ -1483,7 +1483,7 @@ void cpu_init(void)
|
||||
load_sp0(t, thread);
|
||||
set_tss_desc(cpu, t);
|
||||
load_TR_desc();
|
||||
- load_LDT(&init_mm.context);
|
||||
+ load_mm_ldt(&init_mm);
|
||||
|
||||
t->x86_tss.io_bitmap_base = offsetof(struct tss_struct, io_bitmap);
|
||||
|
||||
--- a/arch/x86/kernel/cpu/perf_event.c
|
||||
+++ b/arch/x86/kernel/cpu/perf_event.c
|
||||
@@ -2170,21 +2170,25 @@ static unsigned long get_segment_base(un
|
||||
int idx = segment >> 3;
|
||||
|
||||
if ((segment & SEGMENT_TI_MASK) == SEGMENT_LDT) {
|
||||
+ struct ldt_struct *ldt;
|
||||
+
|
||||
if (idx > LDT_ENTRIES)
|
||||
return 0;
|
||||
|
||||
- if (idx > current->active_mm->context.size)
|
||||
+ /* IRQs are off, so this synchronizes with smp_store_release */
|
||||
+ ldt = lockless_dereference(current->active_mm->context.ldt);
|
||||
+ if (!ldt || idx > ldt->size)
|
||||
return 0;
|
||||
|
||||
- desc = current->active_mm->context.ldt;
|
||||
+ desc = &ldt->entries[idx];
|
||||
} else {
|
||||
if (idx > GDT_ENTRIES)
|
||||
return 0;
|
||||
|
||||
- desc = raw_cpu_ptr(gdt_page.gdt);
|
||||
+ desc = raw_cpu_ptr(gdt_page.gdt) + idx;
|
||||
}
|
||||
|
||||
- return get_desc_base(desc + idx);
|
||||
+ return get_desc_base(desc);
|
||||
}
|
||||
|
||||
#ifdef CONFIG_COMPAT
|
||||
--- a/arch/x86/kernel/ldt.c
|
||||
+++ b/arch/x86/kernel/ldt.c
|
||||
@@ -12,6 +12,7 @@
|
||||
#include <linux/string.h>
|
||||
#include <linux/mm.h>
|
||||
#include <linux/smp.h>
|
||||
+#include <linux/slab.h>
|
||||
#include <linux/vmalloc.h>
|
||||
#include <linux/uaccess.h>
|
||||
|
||||
@@ -20,82 +21,82 @@
|
||||
#include <asm/mmu_context.h>
|
||||
#include <asm/syscalls.h>
|
||||
|
||||
-#ifdef CONFIG_SMP
|
||||
+/* context.lock is held for us, so we don't need any locking. */
|
||||
static void flush_ldt(void *current_mm)
|
||||
{
|
||||
- if (current->active_mm == current_mm)
|
||||
- load_LDT(¤t->active_mm->context);
|
||||
+ mm_context_t *pc;
|
||||
+
|
||||
+ if (current->active_mm != current_mm)
|
||||
+ return;
|
||||
+
|
||||
+ pc = ¤t->active_mm->context;
|
||||
+ set_ldt(pc->ldt->entries, pc->ldt->size);
|
||||
}
|
||||
-#endif
|
||||
|
||||
-static int alloc_ldt(mm_context_t *pc, int mincount, int reload)
|
||||
+/* The caller must call finalize_ldt_struct on the result. LDT starts zeroed. */
|
||||
+static struct ldt_struct *alloc_ldt_struct(int size)
|
||||
{
|
||||
- void *oldldt, *newldt;
|
||||
- int oldsize;
|
||||
+ struct ldt_struct *new_ldt;
|
||||
+ int alloc_size;
|
||||
|
||||
- if (mincount <= pc->size)
|
||||
- return 0;
|
||||
- oldsize = pc->size;
|
||||
- mincount = (mincount + (PAGE_SIZE / LDT_ENTRY_SIZE - 1)) &
|
||||
- (~(PAGE_SIZE / LDT_ENTRY_SIZE - 1));
|
||||
- if (mincount * LDT_ENTRY_SIZE > PAGE_SIZE)
|
||||
- newldt = vmalloc(mincount * LDT_ENTRY_SIZE);
|
||||
- else
|
||||
- newldt = (void *)__get_free_page(GFP_KERNEL);
|
||||
+ if (size > LDT_ENTRIES)
|
||||
+ return NULL;
|
||||
|
||||
- if (!newldt)
|
||||
- return -ENOMEM;
|
||||
+ new_ldt = kmalloc(sizeof(struct ldt_struct), GFP_KERNEL);
|
||||
+ if (!new_ldt)
|
||||
+ return NULL;
|
||||
+
|
||||
+ BUILD_BUG_ON(LDT_ENTRY_SIZE != sizeof(struct desc_struct));
|
||||
+ alloc_size = size * LDT_ENTRY_SIZE;
|
||||
+
|
||||
+ /*
|
||||
+ * Xen is very picky: it requires a page-aligned LDT that has no
|
||||
+ * trailing nonzero bytes in any page that contains LDT descriptors.
|
||||
+ * Keep it simple: zero the whole allocation and never allocate less
|
||||
+ * than PAGE_SIZE.
|
||||
+ */
|
||||
+ if (alloc_size > PAGE_SIZE)
|
||||
+ new_ldt->entries = vzalloc(alloc_size);
|
||||
+ else
|
||||
+ new_ldt->entries = kzalloc(PAGE_SIZE, GFP_KERNEL);
|
||||
|
||||
- if (oldsize)
|
||||
- memcpy(newldt, pc->ldt, oldsize * LDT_ENTRY_SIZE);
|
||||
- oldldt = pc->ldt;
|
||||
- memset(newldt + oldsize * LDT_ENTRY_SIZE, 0,
|
||||
- (mincount - oldsize) * LDT_ENTRY_SIZE);
|
||||
-
|
||||
- paravirt_alloc_ldt(newldt, mincount);
|
||||
-
|
||||
-#ifdef CONFIG_X86_64
|
||||
- /* CHECKME: Do we really need this ? */
|
||||
- wmb();
|
||||
-#endif
|
||||
- pc->ldt = newldt;
|
||||
- wmb();
|
||||
- pc->size = mincount;
|
||||
- wmb();
|
||||
-
|
||||
- if (reload) {
|
||||
-#ifdef CONFIG_SMP
|
||||
- preempt_disable();
|
||||
- load_LDT(pc);
|
||||
- if (!cpumask_equal(mm_cpumask(current->mm),
|
||||
- cpumask_of(smp_processor_id())))
|
||||
- smp_call_function(flush_ldt, current->mm, 1);
|
||||
- preempt_enable();
|
||||
-#else
|
||||
- load_LDT(pc);
|
||||
-#endif
|
||||
- }
|
||||
- if (oldsize) {
|
||||
- paravirt_free_ldt(oldldt, oldsize);
|
||||
- if (oldsize * LDT_ENTRY_SIZE > PAGE_SIZE)
|
||||
- vfree(oldldt);
|
||||
- else
|
||||
- put_page(virt_to_page(oldldt));
|
||||
+ if (!new_ldt->entries) {
|
||||
+ kfree(new_ldt);
|
||||
+ return NULL;
|
||||
}
|
||||
- return 0;
|
||||
+
|
||||
+ new_ldt->size = size;
|
||||
+ return new_ldt;
|
||||
}
|
||||
|
||||
-static inline int copy_ldt(mm_context_t *new, mm_context_t *old)
|
||||
+/* After calling this, the LDT is immutable. */
|
||||
+static void finalize_ldt_struct(struct ldt_struct *ldt)
|
||||
{
|
||||
- int err = alloc_ldt(new, old->size, 0);
|
||||
- int i;
|
||||
+ paravirt_alloc_ldt(ldt->entries, ldt->size);
|
||||
+}
|
||||
+
|
||||
+/* context.lock is held */
|
||||
+static void install_ldt(struct mm_struct *current_mm,
|
||||
+ struct ldt_struct *ldt)
|
||||
+{
|
||||
+ /* Synchronizes with lockless_dereference in load_mm_ldt. */
|
||||
+ smp_store_release(¤t_mm->context.ldt, ldt);
|
||||
+
|
||||
+ /* Activate the LDT for all CPUs using current_mm. */
|
||||
+ on_each_cpu_mask(mm_cpumask(current_mm), flush_ldt, current_mm, true);
|
||||
+}
|
||||
|
||||
- if (err < 0)
|
||||
- return err;
|
||||
+static void free_ldt_struct(struct ldt_struct *ldt)
|
||||
+{
|
||||
+ if (likely(!ldt))
|
||||
+ return;
|
||||
|
||||
- for (i = 0; i < old->size; i++)
|
||||
- write_ldt_entry(new->ldt, i, old->ldt + i * LDT_ENTRY_SIZE);
|
||||
- return 0;
|
||||
+ paravirt_free_ldt(ldt->entries, ldt->size);
|
||||
+ if (ldt->size * LDT_ENTRY_SIZE > PAGE_SIZE)
|
||||
+ vfree(ldt->entries);
|
||||
+ else
|
||||
+ kfree(ldt->entries);
|
||||
+ kfree(ldt);
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -104,17 +105,37 @@ static inline int copy_ldt(mm_context_t
|
||||
*/
|
||||
int init_new_context(struct task_struct *tsk, struct mm_struct *mm)
|
||||
{
|
||||
+ struct ldt_struct *new_ldt;
|
||||
struct mm_struct *old_mm;
|
||||
int retval = 0;
|
||||
|
||||
mutex_init(&mm->context.lock);
|
||||
- mm->context.size = 0;
|
||||
old_mm = current->mm;
|
||||
- if (old_mm && old_mm->context.size > 0) {
|
||||
- mutex_lock(&old_mm->context.lock);
|
||||
- retval = copy_ldt(&mm->context, &old_mm->context);
|
||||
- mutex_unlock(&old_mm->context.lock);
|
||||
+ if (!old_mm) {
|
||||
+ mm->context.ldt = NULL;
|
||||
+ return 0;
|
||||
}
|
||||
+
|
||||
+ mutex_lock(&old_mm->context.lock);
|
||||
+ if (!old_mm->context.ldt) {
|
||||
+ mm->context.ldt = NULL;
|
||||
+ goto out_unlock;
|
||||
+ }
|
||||
+
|
||||
+ new_ldt = alloc_ldt_struct(old_mm->context.ldt->size);
|
||||
+ if (!new_ldt) {
|
||||
+ retval = -ENOMEM;
|
||||
+ goto out_unlock;
|
||||
+ }
|
||||
+
|
||||
+ memcpy(new_ldt->entries, old_mm->context.ldt->entries,
|
||||
+ new_ldt->size * LDT_ENTRY_SIZE);
|
||||
+ finalize_ldt_struct(new_ldt);
|
||||
+
|
||||
+ mm->context.ldt = new_ldt;
|
||||
+
|
||||
+out_unlock:
|
||||
+ mutex_unlock(&old_mm->context.lock);
|
||||
return retval;
|
||||
}
|
||||
|
||||
@@ -125,53 +146,47 @@ int init_new_context(struct task_struct
|
||||
*/
|
||||
void destroy_context(struct mm_struct *mm)
|
||||
{
|
||||
- if (mm->context.size) {
|
||||
-#ifdef CONFIG_X86_32
|
||||
- /* CHECKME: Can this ever happen ? */
|
||||
- if (mm == current->active_mm)
|
||||
- clear_LDT();
|
||||
-#endif
|
||||
- paravirt_free_ldt(mm->context.ldt, mm->context.size);
|
||||
- if (mm->context.size * LDT_ENTRY_SIZE > PAGE_SIZE)
|
||||
- vfree(mm->context.ldt);
|
||||
- else
|
||||
- put_page(virt_to_page(mm->context.ldt));
|
||||
- mm->context.size = 0;
|
||||
- }
|
||||
+ free_ldt_struct(mm->context.ldt);
|
||||
+ mm->context.ldt = NULL;
|
||||
}
|
||||
|
||||
static int read_ldt(void __user *ptr, unsigned long bytecount)
|
||||
{
|
||||
- int err;
|
||||
+ int retval;
|
||||
unsigned long size;
|
||||
struct mm_struct *mm = current->mm;
|
||||
|
||||
- if (!mm->context.size)
|
||||
- return 0;
|
||||
+ mutex_lock(&mm->context.lock);
|
||||
+
|
||||
+ if (!mm->context.ldt) {
|
||||
+ retval = 0;
|
||||
+ goto out_unlock;
|
||||
+ }
|
||||
+
|
||||
if (bytecount > LDT_ENTRY_SIZE * LDT_ENTRIES)
|
||||
bytecount = LDT_ENTRY_SIZE * LDT_ENTRIES;
|
||||
|
||||
- mutex_lock(&mm->context.lock);
|
||||
- size = mm->context.size * LDT_ENTRY_SIZE;
|
||||
+ size = mm->context.ldt->size * LDT_ENTRY_SIZE;
|
||||
if (size > bytecount)
|
||||
size = bytecount;
|
||||
|
||||
- err = 0;
|
||||
- if (copy_to_user(ptr, mm->context.ldt, size))
|
||||
- err = -EFAULT;
|
||||
- mutex_unlock(&mm->context.lock);
|
||||
- if (err < 0)
|
||||
- goto error_return;
|
||||
+ if (copy_to_user(ptr, mm->context.ldt->entries, size)) {
|
||||
+ retval = -EFAULT;
|
||||
+ goto out_unlock;
|
||||
+ }
|
||||
+
|
||||
if (size != bytecount) {
|
||||
- /* zero-fill the rest */
|
||||
- if (clear_user(ptr + size, bytecount - size) != 0) {
|
||||
- err = -EFAULT;
|
||||
- goto error_return;
|
||||
+ /* Zero-fill the rest and pretend we read bytecount bytes. */
|
||||
+ if (clear_user(ptr + size, bytecount - size)) {
|
||||
+ retval = -EFAULT;
|
||||
+ goto out_unlock;
|
||||
}
|
||||
}
|
||||
- return bytecount;
|
||||
-error_return:
|
||||
- return err;
|
||||
+ retval = bytecount;
|
||||
+
|
||||
+out_unlock:
|
||||
+ mutex_unlock(&mm->context.lock);
|
||||
+ return retval;
|
||||
}
|
||||
|
||||
static int read_default_ldt(void __user *ptr, unsigned long bytecount)
|
||||
@@ -195,6 +210,8 @@ static int write_ldt(void __user *ptr, u
|
||||
struct desc_struct ldt;
|
||||
int error;
|
||||
struct user_desc ldt_info;
|
||||
+ int oldsize, newsize;
|
||||
+ struct ldt_struct *new_ldt, *old_ldt;
|
||||
|
||||
error = -EINVAL;
|
||||
if (bytecount != sizeof(ldt_info))
|
||||
@@ -213,34 +230,39 @@ static int write_ldt(void __user *ptr, u
|
||||
goto out;
|
||||
}
|
||||
|
||||
- mutex_lock(&mm->context.lock);
|
||||
- if (ldt_info.entry_number >= mm->context.size) {
|
||||
- error = alloc_ldt(¤t->mm->context,
|
||||
- ldt_info.entry_number + 1, 1);
|
||||
- if (error < 0)
|
||||
- goto out_unlock;
|
||||
- }
|
||||
-
|
||||
- /* Allow LDTs to be cleared by the user. */
|
||||
- if (ldt_info.base_addr == 0 && ldt_info.limit == 0) {
|
||||
- if (oldmode || LDT_empty(&ldt_info)) {
|
||||
- memset(&ldt, 0, sizeof(ldt));
|
||||
- goto install;
|
||||
+ if ((oldmode && !ldt_info.base_addr && !ldt_info.limit) ||
|
||||
+ LDT_empty(&ldt_info)) {
|
||||
+ /* The user wants to clear the entry. */
|
||||
+ memset(&ldt, 0, sizeof(ldt));
|
||||
+ } else {
|
||||
+ if (!IS_ENABLED(CONFIG_X86_16BIT) && !ldt_info.seg_32bit) {
|
||||
+ error = -EINVAL;
|
||||
+ goto out;
|
||||
}
|
||||
+
|
||||
+ fill_ldt(&ldt, &ldt_info);
|
||||
+ if (oldmode)
|
||||
+ ldt.avl = 0;
|
||||
}
|
||||
|
||||
- if (!IS_ENABLED(CONFIG_X86_16BIT) && !ldt_info.seg_32bit) {
|
||||
- error = -EINVAL;
|
||||
+ mutex_lock(&mm->context.lock);
|
||||
+
|
||||
+ old_ldt = mm->context.ldt;
|
||||
+ oldsize = old_ldt ? old_ldt->size : 0;
|
||||
+ newsize = max((int)(ldt_info.entry_number + 1), oldsize);
|
||||
+
|
||||
+ error = -ENOMEM;
|
||||
+ new_ldt = alloc_ldt_struct(newsize);
|
||||
+ if (!new_ldt)
|
||||
goto out_unlock;
|
||||
- }
|
||||
|
||||
- fill_ldt(&ldt, &ldt_info);
|
||||
- if (oldmode)
|
||||
- ldt.avl = 0;
|
||||
-
|
||||
- /* Install the new entry ... */
|
||||
-install:
|
||||
- write_ldt_entry(mm->context.ldt, ldt_info.entry_number, &ldt);
|
||||
+ if (old_ldt)
|
||||
+ memcpy(new_ldt->entries, old_ldt->entries, oldsize * LDT_ENTRY_SIZE);
|
||||
+ new_ldt->entries[ldt_info.entry_number] = ldt;
|
||||
+ finalize_ldt_struct(new_ldt);
|
||||
+
|
||||
+ install_ldt(mm, new_ldt);
|
||||
+ free_ldt_struct(old_ldt);
|
||||
error = 0;
|
||||
|
||||
out_unlock:
|
||||
--- a/arch/x86/kernel/process_64.c
|
||||
+++ b/arch/x86/kernel/process_64.c
|
||||
@@ -122,11 +122,11 @@ void __show_regs(struct pt_regs *regs, i
|
||||
void release_thread(struct task_struct *dead_task)
|
||||
{
|
||||
if (dead_task->mm) {
|
||||
- if (dead_task->mm->context.size) {
|
||||
+ if (dead_task->mm->context.ldt) {
|
||||
pr_warn("WARNING: dead process %s still has LDT? <%p/%d>\n",
|
||||
dead_task->comm,
|
||||
dead_task->mm->context.ldt,
|
||||
- dead_task->mm->context.size);
|
||||
+ dead_task->mm->context.ldt->size);
|
||||
BUG();
|
||||
}
|
||||
}
|
||||
--- a/arch/x86/kernel/step.c
|
||||
+++ b/arch/x86/kernel/step.c
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <linux/mm.h>
|
||||
#include <linux/ptrace.h>
|
||||
#include <asm/desc.h>
|
||||
+#include <asm/mmu_context.h>
|
||||
|
||||
unsigned long convert_ip_to_linear(struct task_struct *child, struct pt_regs *regs)
|
||||
{
|
||||
@@ -30,10 +31,11 @@ unsigned long convert_ip_to_linear(struc
|
||||
seg &= ~7UL;
|
||||
|
||||
mutex_lock(&child->mm->context.lock);
|
||||
- if (unlikely((seg >> 3) >= child->mm->context.size))
|
||||
+ if (unlikely(!child->mm->context.ldt ||
|
||||
+ (seg >> 3) >= child->mm->context.ldt->size))
|
||||
addr = -1L; /* bogus selector, access would fault */
|
||||
else {
|
||||
- desc = child->mm->context.ldt + seg;
|
||||
+ desc = &child->mm->context.ldt->entries[seg];
|
||||
base = get_desc_base(desc);
|
||||
|
||||
/* 16-bit code segment? */
|
||||
--- a/arch/x86/power/cpu.c
|
||||
+++ b/arch/x86/power/cpu.c
|
||||
@@ -23,6 +23,7 @@
|
||||
#include <asm/debugreg.h>
|
||||
#include <asm/fpu-internal.h> /* pcntxt_mask */
|
||||
#include <asm/cpu.h>
|
||||
+#include <asm/mmu_context.h>
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
__visible unsigned long saved_context_ebx;
|
||||
@@ -154,7 +155,7 @@ static void fix_processor_context(void)
|
||||
syscall_init(); /* This sets MSR_*STAR and related */
|
||||
#endif
|
||||
load_TR_desc(); /* This does ltr */
|
||||
- load_LDT(¤t->active_mm->context); /* This does lldt */
|
||||
+ load_mm_ldt(current->active_mm); /* This does lldt */
|
||||
}
|
||||
|
||||
/**
|
||||
-65
@@ -1,65 +0,0 @@
|
||||
From 037542345a82aaaa228ec280fe6ddff1568d169f Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.com>
|
||||
Date: Tue, 25 Aug 2015 10:05:13 +1000
|
||||
Subject: xfs: Fix file type directory corruption for btree directories
|
||||
|
||||
From: Jan Kara <jack@suse.com>
|
||||
|
||||
commit 037542345a82aaaa228ec280fe6ddff1568d169f upstream.
|
||||
|
||||
Users have occasionally reported that file type for some directory
|
||||
entries is wrong. This mostly happened after updating libraries some
|
||||
libraries. After some debugging the problem was traced down to
|
||||
xfs_dir2_node_replace(). The function uses args->filetype as a file type
|
||||
to store in the replaced directory entry however it also calls
|
||||
xfs_da3_node_lookup_int() which will store file type of the current
|
||||
directory entry in args->filetype. Thus we fail to change file type of a
|
||||
directory entry to a proper type.
|
||||
|
||||
Fix the problem by storing new file type in a local variable before
|
||||
calling xfs_da3_node_lookup_int().
|
||||
|
||||
Reported-by: Giacomo Comes <comes@naic.edu>
|
||||
Signed-off-by: Jan Kara <jack@suse.com>
|
||||
Reviewed-by: Dave Chinner <dchinner@redhat.com>
|
||||
Signed-off-by: Dave Chinner <david@fromorbit.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
fs/xfs/libxfs/xfs_dir2_node.c | 10 +++++++++-
|
||||
1 file changed, 9 insertions(+), 1 deletion(-)
|
||||
|
||||
--- a/fs/xfs/libxfs/xfs_dir2_node.c
|
||||
+++ b/fs/xfs/libxfs/xfs_dir2_node.c
|
||||
@@ -2132,6 +2132,7 @@ xfs_dir2_node_replace(
|
||||
int error; /* error return value */
|
||||
int i; /* btree level */
|
||||
xfs_ino_t inum; /* new inode number */
|
||||
+ int ftype; /* new file type */
|
||||
xfs_dir2_leaf_t *leaf; /* leaf structure */
|
||||
xfs_dir2_leaf_entry_t *lep; /* leaf entry being changed */
|
||||
int rval; /* internal return value */
|
||||
@@ -2145,7 +2146,14 @@ xfs_dir2_node_replace(
|
||||
state = xfs_da_state_alloc();
|
||||
state->args = args;
|
||||
state->mp = args->dp->i_mount;
|
||||
+
|
||||
+ /*
|
||||
+ * We have to save new inode number and ftype since
|
||||
+ * xfs_da3_node_lookup_int() is going to overwrite them
|
||||
+ */
|
||||
inum = args->inumber;
|
||||
+ ftype = args->filetype;
|
||||
+
|
||||
/*
|
||||
* Lookup the entry to change in the btree.
|
||||
*/
|
||||
@@ -2183,7 +2191,7 @@ xfs_dir2_node_replace(
|
||||
* Fill in the new inode number and log the entry.
|
||||
*/
|
||||
dep->inumber = cpu_to_be64(inum);
|
||||
- args->dp->d_ops->data_put_ftype(dep, args->filetype);
|
||||
+ args->dp->d_ops->data_put_ftype(dep, ftype);
|
||||
xfs_dir2_data_log_entry(args, state->extrablk.bp, dep);
|
||||
rval = 0;
|
||||
}
|
||||
@@ -1,47 +0,0 @@
|
||||
From ffeecc5213024ae663377b442eedcfbacf6d0c5d Mon Sep 17 00:00:00 2001
|
||||
From: Jan Kara <jack@suse.com>
|
||||
Date: Wed, 19 Aug 2015 10:34:32 +1000
|
||||
Subject: xfs: Fix xfs_attr_leafblock definition
|
||||
|
||||
From: Jan Kara <jack@suse.com>
|
||||
|
||||
commit ffeecc5213024ae663377b442eedcfbacf6d0c5d upstream.
|
||||
|
||||
struct xfs_attr_leafblock contains 'entries' array which is declared
|
||||
with size 1 altough it can in fact contain much more entries. Since this
|
||||
array is followed by further struct members, gcc (at least in version
|
||||
4.8.3) thinks that the array has the fixed size of 1 element and thus
|
||||
may optimize away all accesses beyond the end of array resulting in
|
||||
non-working code. This problem was only observed with userspace code in
|
||||
xfsprogs, however it's better to be safe in kernel as well and have
|
||||
matching kernel and xfsprogs definitions.
|
||||
|
||||
Signed-off-by: Jan Kara <jack@suse.com>
|
||||
Reviewed-by: Dave Chinner <dchinner@redhat.com>
|
||||
Signed-off-by: Dave Chinner <david@fromorbit.com>
|
||||
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
|
||||
|
||||
---
|
||||
fs/xfs/libxfs/xfs_da_format.h | 11 +++++++++--
|
||||
1 file changed, 9 insertions(+), 2 deletions(-)
|
||||
|
||||
--- a/fs/xfs/libxfs/xfs_da_format.h
|
||||
+++ b/fs/xfs/libxfs/xfs_da_format.h
|
||||
@@ -680,8 +680,15 @@ typedef struct xfs_attr_leaf_name_remote
|
||||
typedef struct xfs_attr_leafblock {
|
||||
xfs_attr_leaf_hdr_t hdr; /* constant-structure header block */
|
||||
xfs_attr_leaf_entry_t entries[1]; /* sorted on key, not name */
|
||||
- xfs_attr_leaf_name_local_t namelist; /* grows from bottom of buf */
|
||||
- xfs_attr_leaf_name_remote_t valuelist; /* grows from bottom of buf */
|
||||
+ /*
|
||||
+ * The rest of the block contains the following structures after the
|
||||
+ * leaf entries, growing from the bottom up. The variables are never
|
||||
+ * referenced and definining them can actually make gcc optimize away
|
||||
+ * accesses to the 'entries' array above index 0 so don't do that.
|
||||
+ *
|
||||
+ * xfs_attr_leaf_name_local_t namelist;
|
||||
+ * xfs_attr_leaf_name_remote_t valuelist;
|
||||
+ */
|
||||
} xfs_attr_leafblock_t;
|
||||
|
||||
/*
|
||||
+13
-2
@@ -29,13 +29,14 @@
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<!-- Linux patches -->
|
||||
<Patch level="1" compressionType="xz">patches/linux/patch-4.1.7.xz</Patch>
|
||||
<!-- Mageia Linux patches // compatible with http://svnweb.mageia.org/packages/cauldron/kernel/releases/4.1.7/1.mga6/PATCHES/patches/series-->
|
||||
<Patch level="1" compressionType="xz">patches/linux/patch-4.1.8.xz</Patch>
|
||||
<!-- Mageia Linux patches // compatible with http://svnweb.mageia.org/packages/cauldron/kernel/releases/4.1.8/1.mga6/PATCHES/patches/series-->
|
||||
<Patch level="1">patches/mageia/x86-pci-toshiba-equium-a60-assign-busses.patch</Patch>
|
||||
<Patch level="1">patches/mageia/x86-boot-video-80x25-if-break.patch</Patch>
|
||||
<Patch level="1">patches/mageia/x86-default_poweroff_up_machines.patch</Patch>
|
||||
<Patch level="1">patches/mageia/x86-increase-default-minimum-vmalloc-area-by-64MB-to-192MB.patch</Patch>
|
||||
<Patch level="1">patches/mageia/Revert-cpufreq-pcc-Enable-autoload-of-pcc-cpufreq-fo.patch</Patch>
|
||||
<Patch level="1">patches/mageia/cpu-cacheinfo-Fix-teardown-path.patch</Patch>
|
||||
<Patch level="1">patches/mageia/pci-add-ALI-M5229-ide-compatibility-mode-quirk.patch</Patch>
|
||||
<Patch level="1">patches/mageia/pci-quirks-drop-devinit-exit.patch</Patch>
|
||||
<Patch level="1">patches/mageia/pci-acs-quirks-for-Intel-9-series-PCH-root-ports.patch</Patch>
|
||||
@@ -57,6 +58,7 @@
|
||||
<Patch level="1">patches/mageia/block-cfq-iosched-fix-the-setting-of-IOPS-mode-on-SSDs.patch</Patch>
|
||||
<Patch level="1">patches/mageia/fs-aufs4.patch</Patch>
|
||||
<Patch level="1">patches/mageia/fs-aufs4-modular.patch</Patch>
|
||||
<Patch level="1">patches/mageia/fs-aufs-CVE-pending.patch</Patch>
|
||||
<Patch level="1">patches/mageia/firewire-ieee1394-module-aliases.patch</Patch>
|
||||
<Patch level="1">patches/mageia/char-agp-intel-new-Q57-id.patch</Patch>
|
||||
<Patch level="1">patches/mageia/gpu-drm-mach64.patch</Patch>
|
||||
@@ -123,6 +125,7 @@
|
||||
<Patch level="1">patches/mageia/3rd-rtl8723bs-buildfix.patch</Patch>
|
||||
<Patch level="1">patches/mageia/3rd-rtl8723bs-updates.patch</Patch>
|
||||
<Patch level="1">patches/mageia/fs-Revert-ext4-remove-block_device_ejected.patch</Patch>
|
||||
<!--Patch level="1">patches/mageia/arm-rockchip-fix-broken-build.patch</Patch-->
|
||||
<Patch level="1">patches/mageia/Input-evdev-do-not-report-errors-form-flush.patch</Patch>
|
||||
<Patch level="1">patches/mageia/scsi-Fix-NULL-pointer-dereference-in-RTPM-of-block-layer.patch</Patch>
|
||||
<Patch level="1">patches/mageia/scsi-Revert-SCSI-Fix-NULL-pointer-dereference-in-runtime-PM.patch</Patch>
|
||||
@@ -180,6 +183,14 @@
|
||||
</Package>
|
||||
|
||||
<History>
|
||||
<Update release="61">
|
||||
<Date>2015-09-23</Date>
|
||||
<Version>4.1.8</Version>
|
||||
<Comment>Version bump to 4.1.8 https://www.kernel.org/pub/linux/kernel/v4.x/ChangeLog-4.1.8</Comment>
|
||||
<Type package="kernel">security</Type>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="60">
|
||||
<Date>2015-09-18</Date>
|
||||
<Version>4.1.7</Version>
|
||||
|
||||
Binary file not shown.
@@ -18,7 +18,7 @@
|
||||
</BuildDependencies>
|
||||
<Patches>
|
||||
<!-- Linux patches -->
|
||||
<Patch level="1" compressionType="xz">patches/linux/patch-4.1.7.xz</Patch>
|
||||
<Patch level="1" compressionType="xz">patches/linux/patch-4.1.8.xz</Patch>
|
||||
</Patches>
|
||||
</Source>
|
||||
|
||||
@@ -44,6 +44,13 @@
|
||||
</Provides>-->
|
||||
</Package>
|
||||
<History>
|
||||
<Update release="60">
|
||||
<Date>2015-09-23</Date>
|
||||
<Version>4.1.8</Version>
|
||||
<Comment>Version bump.</Comment>
|
||||
<Name>Ertuğrul Erata</Name>
|
||||
<Email>ertugrulerata@gmail.com</Email>
|
||||
</Update>
|
||||
<Update release="59">
|
||||
<Date>2015-09-18</Date>
|
||||
<Version>4.1.7</Version>
|
||||
|
||||
Reference in New Issue
Block a user