Automated build results for all ARM defconfigs. Summarizes all build
errors, warnings and section mismatches followed by a per-defconfig
summary.
Tree/Branch: linus/master
Git describe: v3.12-rc2-32-ga153e67
Commit: a153e67bda Merge branch 'akpm' (patches from Andrew Morton)
Build Time: 118 min 28 sec
Passed: 129 / 129 (100.00 %)
Failed: 0 / 129 ( 0.00 %)
Errors: 0
Warnings: 16
Section Mismatches: 0
-------------------------------------------------------------------------------
defconfigs with issues (other than build errors):
arm-spitz_defconfig: 1 warnings 0 mismatches
arm-mini2440_defconfig: 1 warnings 0 mismatches
arm-multi_v7_defconfig+lpae.config: 15 warnings 0 mismatches
arm-iop13xx_defconfig: 1 warnings 0 mismatches
arm-corgi_defconfig: 1 warnings 0 mismatches
arm-iop32x_defconfig: 1 warnings 0 mismatches
-------------------------------------------------------------------------------
Warnings Summary: 16
5 crypto/wp512.c:987:1: warning: the frame size of 1168 bytes is larger than 1024 bytes [-Wframe-larger-than=]
1 drivers/tty/serial/imx.c:1542:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
1 drivers/gpu/host1x/hw/debug_hw.c:175:10: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘dma_addr_t’ [-Wformat]
1 drivers/gpu/host1x/hw/cdma_hw.c:57:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/ipu/ipu_idmac.c:1235:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/ipu/ipu_idmac.c:1235:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/imx-sdma.c:1166:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/imx-sdma.c:1092:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/imx-dma.c:960:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/imx-dma.c:960:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/imx-dma.c:930:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/imx-dma.c:930:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/imx-dma.c:603:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 9 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/imx-dma.c:593:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 9 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/imx-dma.c:579:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has type ‘dma_addr_t’ [-Wformat]
1 drivers/dma/imx-dma.c:579:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
===============================================================================
Detailed per-defconfig build reports below:
-------------------------------------------------------------------------------
arm-spitz_defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
crypto/wp512.c:987:1: warning: the frame size of 1168 bytes is larger than 1024 bytes [-Wframe-larger-than=]
-------------------------------------------------------------------------------
arm-mini2440_defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
crypto/wp512.c:987:1: warning: the frame size of 1168 bytes is larger than 1024 bytes [-Wframe-larger-than=]
-------------------------------------------------------------------------------
arm-multi_v7_defconfig+lpae.config : PASS, 0 errors, 15 warnings, 0 section mismatches
Warnings:
drivers/dma/imx-sdma.c:1092:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/imx-sdma.c:1166:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/imx-dma.c:579:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/imx-dma.c:579:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/imx-dma.c:593:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 9 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/imx-dma.c:603:4: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 9 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/imx-dma.c:930:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/imx-dma.c:930:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/imx-dma.c:960:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/imx-dma.c:960:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 7 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/ipu/ipu_idmac.c:1235:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘dma_addr_t’ [-Wformat]
drivers/dma/ipu/ipu_idmac.c:1235:2: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 6 has type ‘dma_addr_t’ [-Wformat]
drivers/gpu/host1x/hw/cdma_hw.c:57:3: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 5 has type ‘dma_addr_t’ [-Wformat]
drivers/gpu/host1x/hw/debug_hw.c:175:10: warning: format ‘%x’ expects argument of type ‘unsigned int’, but argument 3 has type ‘dma_addr_t’ [-Wformat]
drivers/tty/serial/imx.c:1542:6: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
-------------------------------------------------------------------------------
arm-iop13xx_defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
crypto/wp512.c:987:1: warning: the frame size of 1168 bytes is larger than 1024 bytes [-Wframe-larger-than=]
-------------------------------------------------------------------------------
arm-corgi_defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
crypto/wp512.c:987:1: warning: the frame size of 1168 bytes is larger than 1024 bytes [-Wframe-larger-than=]
-------------------------------------------------------------------------------
arm-iop32x_defconfig : PASS, 0 errors, 1 warnings, 0 section mismatches
Warnings:
crypto/wp512.c:987:1: warning: the frame size of 1168 bytes is larger than 1024 bytes [-Wframe-larger-than=]
-------------------------------------------------------------------------------
Passed with no errors, warnings or mismatches:
arm-realview-smp_defconfig
arm-at91rm9200_defconfig
arm-pcm027_defconfig
arm-rmk-omap3430-ldp.config
arm-bcm2835_defconfig
arm-ixp4xx_defconfig
arm-dove_defconfig
arm-nuc950_defconfig
arm-ebsa110_defconfig
arm-at91sam9261_9g10_defconfig
arm-omap2plus_defconfig
arm-bockw_defconfig
arm-hackkit_defconfig
arm-cns3420vb_defconfig
arm-u300_defconfig
arm-bcm_defconfig
arm-exynos_defconfig
arm-imx_v4_v5_defconfig
arm-zeus_defconfig
arm-rmk-sa11x0-neponset.config
arm-davinci_all_defconfig
arm-badge4_defconfig
arm-exynos_defconfig+lpae.config
arm-nuc960_defconfig
arm-shark_defconfig
arm-allnoconfig
arm-em_x270_defconfig
arm-armadillo800eva_defconfig
arm-trizeps4_defconfig
arm-acs5k_defconfig
arm-rmk-realview.config
arm-at91sam9260_9g20_defconfig
arm-lpc32xx_defconfig
arm-rmk-omap4430-ldp-allnoconfig.config
arm-rmk-versatile.config
arm-vexpress_defconfig
arm-ape6evm_defconfig
arm-netx_defconfig
arm-socfpga_defconfig
arm-orion5x_defconfig
arm-cm_x2xx_defconfig
arm-da8xx_omapl_defconfig
arm-omap2plus_defconfig+pm.config
arm-at91x40_defconfig
arm-cerfcube_defconfig
arm-versatile_defconfig
arm-am200epdkit_defconfig
arm-rmk-omap3430-ldp-allnoconfig.config
arm-simpad_defconfig
arm-pxa910_defconfig
arm-acs5k_tiny_defconfig
arm-xcep_defconfig
arm-s5pv210_defconfig
arm-at91_dt_defconfig
arm-palmz72_defconfig
arm-ezx_defconfig
arm-imote2_defconfig
arm-netwinder_defconfig
arm-iop33x_defconfig
arm-rmk-pxa.config
arm-assabet_defconfig
arm-magician_defconfig
arm-mainstone_defconfig
arm-s5pc100_defconfig
arm-lager_defconfig
arm-spear3xx_defconfig
arm-shannon_defconfig
arm-at91sam9g45_defconfig
arm-prima2_defconfig
arm-jornada720_defconfig
arm-s3c2410_defconfig
arm-pxa255-idp_defconfig
arm-h3600_defconfig
arm-colibri_pxa270_defconfig
arm-nhk8815_defconfig
arm-nuc910_defconfig
arm-viper_defconfig
arm-colibri_pxa300_defconfig
arm-pleb_defconfig
arm-mmp2_defconfig
arm-spear6xx_defconfig
arm-eseries_pxa_defconfig
arm-ks8695_defconfig
arm-raumfeld_defconfig
arm-integrator_defconfig
arm-footbridge_defconfig
arm-pxa168_defconfig
arm-multi_v7_defconfig
arm-s5p64x0_defconfig
arm-rpc_defconfig
arm-mxs_defconfig
arm-pxa3xx_defconfig
arm-omap1_defconfig
arm-kzm9d_defconfig
arm-rmk-vexpress-ct9x4.config
arm-ep93xx_defconfig
arm-keystone_defconfig
arm-at91sam9rl_defconfig
arm-lubbock_defconfig
arm-s3c6400_defconfig
arm-imx_v6_v7_defconfig
arm-at91sam9263_defconfig
arm-mackerel_defconfig
arm-clps711x_defconfig
arm-collie_defconfig
arm-tegra_defconfig
arm-lart_defconfig
arm-marzen_defconfig
arm-kzm9g_defconfig
arm-tct_hammer_defconfig
arm-mv78xx0_defconfig
arm-realview_defconfig
arm-msm_defconfig
arm-u8500_defconfig
arm-cm_x300_defconfig
arm-h5000_defconfig
arm-kirkwood_defconfig
arm-mvebu_defconfig
arm-lpd270_defconfig
arm-rmk-omap4430-ldp.config
arm-sama5_defconfig
arm-neponset_defconfig
arm-spear13xx_defconfig
The memory pinning code in uaccess_with_memcpy.c does not check
for HugeTLB or THP pmds, and will enter an infinite loop should
a __copy_to_user or __clear_user occur against a huge page.
This patch adds detection code for huge pages to pin_page_for_write.
As this code can be executed in a fast path it refers to the actual
pmds rather than the vma. If a HugeTLB or THP is found (they have
the same pmd representation on ARM), the page table spinlock is
taken to prevent modification whilst the page is pinned.
On ARM, huge pages are only represented as pmds, thus no huge pud
checks are performed. (For huge puds one would lock the page table
in a similar manner as in the pmd case).
Two helper functions are introduced; pmd_thp_or_huge will check
whether or not a page is huge or transparent huge (which have the
same pmd layout on ARM), and pmd_hugewillfault will detect whether
or not a page fault will occur on write to the page.
---
Changes since second RFC:
* After some more thought about the potential impact on the
overall latency, I have decided not to widen the page mask
for huge pages.
Changes since first RFC:
* The page mask is widened for hugepages to reduce the number
of potential locks/unlocks.
(A knobbled /dev/zero with its latency reduction chunks
removed shows a 2x data rate boost with hugepages backing:
dd if=/dev/zero of=/dev/null bs=10M count=1024 )
---
Signed-off-by: Steve Capper <steve.capper(a)linaro.org>
---
arch/arm/include/asm/pgtable-3level.h | 3 +++
arch/arm/lib/uaccess_with_memcpy.c | 41 ++++++++++++++++++++++++++++++++---
2 files changed, 41 insertions(+), 3 deletions(-)
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
index 5689c18..39c54cf 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -206,6 +206,9 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
#define __HAVE_ARCH_PMD_WRITE
#define pmd_write(pmd) (!(pmd_val(pmd) & PMD_SECT_RDONLY))
+#define pmd_hugewillfault(pmd) (!pmd_young(pmd) || !pmd_write(pmd))
+#define pmd_thp_or_huge(pmd) (pmd_huge(pmd) || pmd_trans_huge(pmd))
+
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
#define pmd_trans_huge(pmd) (pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT))
#define pmd_trans_splitting(pmd) (pmd_val(pmd) & PMD_SECT_SPLITTING)
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c
index 025f742..3e58d71 100644
--- a/arch/arm/lib/uaccess_with_memcpy.c
+++ b/arch/arm/lib/uaccess_with_memcpy.c
@@ -18,6 +18,7 @@
#include <linux/hardirq.h> /* for in_atomic() */
#include <linux/gfp.h>
#include <linux/highmem.h>
+#include <linux/hugetlb.h>
#include <asm/current.h>
#include <asm/page.h>
@@ -40,7 +41,35 @@ pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
return 0;
pmd = pmd_offset(pud, addr);
- if (unlikely(pmd_none(*pmd) || pmd_bad(*pmd)))
+ if (unlikely(pmd_none(*pmd)))
+ return 0;
+
+ /*
+ * A pmd can be bad if it refers to a HugeTLB or THP page.
+ *
+ * Both THP and HugeTLB pages have the same pmd layout
+ * and should not be manipulated by the pte functions.
+ *
+ * Lock the page table for the destination and check
+ * to see that it's still huge and whether or not we will
+ * need to fault on write, or if we have a splitting THP.
+ */
+ if (unlikely(pmd_thp_or_huge(*pmd))) {
+ ptl = ¤t->mm->page_table_lock;
+ spin_lock(ptl);
+ if (unlikely(!pmd_thp_or_huge(*pmd)
+ || pmd_hugewillfault(*pmd)
+ || pmd_trans_splitting(*pmd))) {
+ spin_unlock(ptl);
+ return 0;
+ }
+
+ *ptep = NULL;
+ *ptlp = ptl;
+ return 1;
+ }
+
+ if (unlikely(pmd_bad(*pmd)))
return 0;
pte = pte_offset_map_lock(current->mm, pmd, addr, &ptl);
@@ -94,7 +123,10 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n)
from += tocopy;
n -= tocopy;
- pte_unmap_unlock(pte, ptl);
+ if (pte)
+ pte_unmap_unlock(pte, ptl);
+ else
+ spin_unlock(ptl);
}
if (!atomic)
up_read(¤t->mm->mmap_sem);
@@ -147,7 +179,10 @@ __clear_user_memset(void __user *addr, unsigned long n)
addr += tocopy;
n -= tocopy;
- pte_unmap_unlock(pte, ptl);
+ if (pte)
+ pte_unmap_unlock(pte, ptl);
+ else
+ spin_unlock(ptl);
}
up_read(¤t->mm->mmap_sem);
--
1.8.1.4
On hardware reduced platforms, there is no support for the following:
- PM Event and Control registers
- SCI interrupt (and handler)
- Fixed Events
- General Purpose Events (GPEs)
- Global Lock
- ACPI PM timer
- FACS table (Waking vectors and Global Lock)
acpi_gbl_reduced_hardware is a global flag and can be used to prevent
misbehavior on hardware reduced platforms, and this flag is initialized at
the very beginning of the system boot when FADT is parsed, this flag is set
to 1 when the FACP Hardware Reduced flag is set, so we can use it to prevent
accessing registers which do not exist on reduced hardware platform.
but when FACP Hardware Reduced flag is set, ACPI drivers will still access
some registers directly which do not exist on reduced hardware platform
and cause boot failure:
[ 9.024370] Unable to handle kernel paging request at virtual address ffffffbffbe00001
[ 9.024423] pgd = ffffffc00007d000
[ 9.024468] [ffffffbffbe00001] *pgd=000000008007f003, *pmd=0000000000000000
[ 9.024538] Internal error: Oops: 96000006 [#1] SMP
[ 9.024577] Modules linked in:
[ 9.024627] CPU: 0 Not tainted (3.9.0+ #3)
[ 9.024691] PC is at acpi_os_read_port+0x58/0xc8
[ 9.024753] LR is at acpi_hw_read_port+0x4c/0xc4
[ 9.024810] pc : [<ffffffc0002810cc>] lr : [<ffffffc0002a4fc4>] pstate: 600003c5
....
[ 9.031956] Call trace:
[ 9.032021] [<ffffffc0002810cc>] acpi_os_read_port+0x58/0xc8
[ 9.032094] [<ffffffc0002a4fc4>] acpi_hw_read_port+0x4c/0xc4
[ 9.032165] [<ffffffc0002a4198>] acpi_hw_read+0x6c/0x100
[ 9.032237] [<ffffffc0002a4250>] acpi_hw_read_multiple+0x24/0x70
[ 9.032312] [<ffffffc0002a457c>] acpi_hw_register_read+0xa8/0x164
[ 9.032386] [<ffffffc0002a52dc>] acpi_write_bit_register+0x9c/0x194
[ 9.032472] [<ffffffc0002bffb4>] acpi_processor_get_power_info+0x6c4/0x748
[ 9.032550] [<ffffffc000565220>] acpi_processor_power_init+0xac/0x138
[ 9.032630] [<ffffffc0003f3c00>] acpi_processor_start+0x48/0x138
[ 9.032704] [<ffffffc000565118>] acpi_processor_add+0x43c/0x498
[ 9.032784] [<ffffffc000283a74>] acpi_device_probe+0x3c/0x198
[ 9.032862] [<ffffffc0002ef0fc>] driver_probe_device+0x90/0x348
[ 9.032940] [<ffffffc0002ef450>] __driver_attach+0x9c/0xa0
[ 9.033015] [<ffffffc0002ed40c>] bus_for_each_dev+0x4c/0x8c
[ 9.033090] [<ffffffc0002eeb98>] driver_attach+0x20/0x28
[ 9.033166] [<ffffffc0002ee6e0>] bus_add_driver+0xfc/0x254
[ 9.033244] [<ffffffc0002ef8b0>] driver_register+0x6c/0x184
[ 9.033325] [<ffffffc000284894>] acpi_bus_register_driver+0x34/0x44
[ 9.033400] [<ffffffc000559c60>] acpi_processor_init+0x28/0x40
[ 9.033469] [<ffffffc000081438>] do_one_initcall+0x100/0x138
[ 9.033544] [<ffffffc0005448c8>] kernel_init_freeable+0x128/0x1cc
[ 9.033620] [<ffffffc0003f2f90>] kernel_init+0x10/0xcc
[ 9.033700] Code: d2bf7c02 f2dff7e2 f2ffffe2 8b020000 (79400000)
[ 9.033843] ---[ end trace 64376967e6bc20a9 ]---
[ 9.033995] Kernel panic - not syncing: Attempted to kill init! exitcode=0x0000000b
So acpi_gbl_reduced_hardware should be used to check if reduced hardware or
not, if it is reduced hardware, just return with some error and do not access
the no-existent registers.
Signed-off-by: Hanjun Guo <hanjun.guo(a)linaro.org>
---
drivers/acpi/acpica/hwregs.c | 24 ++++++++++++++++++++++++
1 file changed, 24 insertions(+)
diff --git a/drivers/acpi/acpica/hwregs.c b/drivers/acpi/acpica/hwregs.c
index 8d2e866..4c270c3 100644
--- a/drivers/acpi/acpica/hwregs.c
+++ b/drivers/acpi/acpica/hwregs.c
@@ -265,6 +265,11 @@ acpi_status acpi_hw_clear_acpi_status(void)
ACPI_FUNCTION_TRACE(hw_clear_acpi_status);
+ /* If Hardware Reduced flag is set, there are no GPEs */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
ACPI_DEBUG_PRINT((ACPI_DB_IO, "About to write %04X to %8.8X%8.8X\n",
ACPI_BITMASK_ALL_FIXED_STATUS,
ACPI_FORMAT_UINT64(acpi_gbl_xpm1a_status.address)));
@@ -305,6 +310,10 @@ struct acpi_bit_register_info *acpi_hw_get_bit_register_info(u32 register_id)
{
ACPI_FUNCTION_ENTRY();
+ if (acpi_gbl_reduced_hardware) {
+ return (NULL);
+ }
+
if (register_id > ACPI_BITREG_MAX) {
ACPI_ERROR((AE_INFO, "Invalid BitRegister ID: 0x%X",
register_id));
@@ -337,6 +346,11 @@ acpi_status acpi_hw_write_pm1_control(u32 pm1a_control, u32 pm1b_control)
ACPI_FUNCTION_TRACE(hw_write_pm1_control);
+ /* If Hardware Reduced flag is set, there are no PM Control registers */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
status =
acpi_hw_write(pm1a_control, &acpi_gbl_FADT.xpm1a_control_block);
if (ACPI_FAILURE(status)) {
@@ -370,6 +384,11 @@ acpi_status acpi_hw_register_read(u32 register_id, u32 *return_value)
ACPI_FUNCTION_TRACE(hw_register_read);
+ /* If Hardware Reduced flag is set, there are no PM Control registers */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
switch (register_id) {
case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
@@ -465,6 +484,11 @@ acpi_status acpi_hw_register_write(u32 register_id, u32 value)
ACPI_FUNCTION_TRACE(hw_register_write);
+ /* If Hardware Reduced flag is set, there are no PM Control registers */
+ if (acpi_gbl_reduced_hardware) {
+ return_ACPI_STATUS(AE_NOT_IMPLEMENTED);
+ }
+
switch (register_id) {
case ACPI_REGISTER_PM1_STATUS: /* PM1 A/B: 16-bit access each */
/*
--
1.7.9.5
I installed the ubuntu on my pandabard es. and update kernel is fine. But I try to remake the initrd to include new modules. the kernel booting failed with the following complain:
[ 2.768005] Power Management for TI OMAP4.
[ 2.890472] pinctrl-single 4a31e040.pinmux: mux offset out of range: 0x38 (0x38)
[ 2.898651] pinctrl-single 4a31e040.pinmux: could not add functions for pinmux_wl12xx_pins 56x
[ 3.616088] RAMDISK: incomplete write (17747 != 32768)
[ 3.616088] write error
[ 3.624877] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)
[ 3.633789] CPU1: stopping
[ 3.633789] CPU: 1 PID: 0 Comm: swapper/1 Not tainted 3.12.0-rc2 #8
I even just remake the same initrd without anything change. the new initrd still cross the same problem.
So Where I am wrong to remake this initrd?
1, cd initrd; zcat ../initrd.img-3.2.0-1412-omap4 | cpio -i -d -H newc --no-absolute-filenames
2, find . | cpio -o -H newc | gzip &> ../new-initrd
3, copy the new-initrd to pandaboard es system, and reflash it to uInitrd by 'flash-kernel'
google said maybe some memory broken. but clearly it is not in case.
Any hints are appreciated!
--
Thanks
Alex
From: Mark Brown <broonie(a)linaro.org>
The registers that are being kept uncached are marked as volatile anyway
so the call has no practical impact.
Signed-off-by: Mark Brown <broonie(a)linaro.org>
---
sound/soc/codecs/max98095.c | 25 ++++---------------------
1 file changed, 4 insertions(+), 21 deletions(-)
diff --git a/sound/soc/codecs/max98095.c b/sound/soc/codecs/max98095.c
index 8dbcacd..29c266b 100644
--- a/sound/soc/codecs/max98095.c
+++ b/sound/soc/codecs/max98095.c
@@ -612,23 +612,6 @@ static int max98095_volatile(struct snd_soc_codec *codec, unsigned int reg)
}
/*
- * Filter coefficients are in a separate register segment
- * and they share the address space of the normal registers.
- * The coefficient registers do not need or share the cache.
- */
-static int max98095_hw_write(struct snd_soc_codec *codec, unsigned int reg,
- unsigned int value)
-{
- int ret;
-
- codec->cache_bypass = 1;
- ret = snd_soc_write(codec, reg, value);
- codec->cache_bypass = 0;
-
- return ret ? -EIO : 0;
-}
-
-/*
* Load equalizer DSP coefficient configurations registers
*/
static void m98095_eq_band(struct snd_soc_codec *codec, unsigned int dai,
@@ -648,8 +631,8 @@ static void m98095_eq_band(struct snd_soc_codec *codec, unsigned int dai,
/* Step through the registers and coefs */
for (i = 0; i < M98095_COEFS_PER_BAND; i++) {
- max98095_hw_write(codec, eq_reg++, M98095_BYTE1(coefs[i]));
- max98095_hw_write(codec, eq_reg++, M98095_BYTE0(coefs[i]));
+ snd_soc_write(codec, eq_reg++, M98095_BYTE1(coefs[i]));
+ snd_soc_write(codec, eq_reg++, M98095_BYTE0(coefs[i]));
}
}
@@ -673,8 +656,8 @@ static void m98095_biquad_band(struct snd_soc_codec *codec, unsigned int dai,
/* Step through the registers and coefs */
for (i = 0; i < M98095_COEFS_PER_BAND; i++) {
- max98095_hw_write(codec, bq_reg++, M98095_BYTE1(coefs[i]));
- max98095_hw_write(codec, bq_reg++, M98095_BYTE0(coefs[i]));
+ snd_soc_write(codec, bq_reg++, M98095_BYTE1(coefs[i]));
+ snd_soc_write(codec, bq_reg++, M98095_BYTE0(coefs[i]));
}
}
--
1.8.4.rc3
Resending, as I ommitted a few important CC's.
---
The memory pinning code in uaccess_with_memcpy.c does not check
for HugeTLB or THP pmds, and will enter an infinite loop should
a __copy_to_user or __clear_user occur against a huge page.
This patch adds detection code for huge pages to pin_page_for_write.
As this code can be executed in a fast path it refers to the actual
pmds rather than the vma. If a HugeTLB or THP is found (they have
the same pmd representation on ARM), the page table spinlock is
taken to prevent modification whilst the page is pinned.
On ARM, huge pages are only represented as pmds, thus no huge pud
checks are performed. (For huge puds one would lock the page table
in a similar manner as in the pmd case).
Two helper functions are introduced; pmd_thp_or_huge will check
whether or not a page is huge or transparent huge (which have the
same pmd layout on ARM), and pmd_hugewillfault will detect whether
or not a page fault will occur on write to the page.
Changes since first RFC:
* The page mask is widened for hugepages to reduce the number
of potential locks/unlocks.
(A knobbled /dev/zero with its latency reduction chunks
removed shows a 2x data rate boost with hugepages backing:
dd if=/dev/zero of=/dev/null bs=10M count=1024 )
Signed-off-by: Steve Capper <steve.capper(a)linaro.org>
---
arch/arm/include/asm/pgtable-3level.h | 3 ++
arch/arm/lib/uaccess_with_memcpy.c | 57 ++++++++++++++++++++++++++++++-----
2 files changed, 52 insertions(+), 8 deletions(-)
diff --git a/arch/arm/include/asm/pgtable-3level.h b/arch/arm/include/asm/pgtable-3level.h
index 5689c18..39c54cf 100644
--- a/arch/arm/include/asm/pgtable-3level.h
+++ b/arch/arm/include/asm/pgtable-3level.h
@@ -206,6 +206,9 @@ static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
#define __HAVE_ARCH_PMD_WRITE
#define pmd_write(pmd) (!(pmd_val(pmd) & PMD_SECT_RDONLY))
+#define pmd_hugewillfault(pmd) (!pmd_young(pmd) || !pmd_write(pmd))
+#define pmd_thp_or_huge(pmd) (pmd_huge(pmd) || pmd_trans_huge(pmd))
+
#ifdef CONFIG_TRANSPARENT_HUGEPAGE
#define pmd_trans_huge(pmd) (pmd_val(pmd) && !(pmd_val(pmd) & PMD_TABLE_BIT))
#define pmd_trans_splitting(pmd) (pmd_val(pmd) & PMD_SECT_SPLITTING)
diff --git a/arch/arm/lib/uaccess_with_memcpy.c b/arch/arm/lib/uaccess_with_memcpy.c
index 025f742..78756db 100644
--- a/arch/arm/lib/uaccess_with_memcpy.c
+++ b/arch/arm/lib/uaccess_with_memcpy.c
@@ -18,11 +18,13 @@
#include <linux/hardirq.h> /* for in_atomic() */
#include <linux/gfp.h>
#include <linux/highmem.h>
+#include <linux/hugetlb.h>
#include <asm/current.h>
#include <asm/page.h>
static int
-pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
+pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp,
+ unsigned long *page_mask)
{
unsigned long addr = (unsigned long)_addr;
pgd_t *pgd;
@@ -40,7 +42,36 @@ pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
return 0;
pmd = pmd_offset(pud, addr);
- if (unlikely(pmd_none(*pmd) || pmd_bad(*pmd)))
+ if (unlikely(pmd_none(*pmd)))
+ return 0;
+
+ /*
+ * A pmd can be bad if it refers to a HugeTLB or THP page.
+ *
+ * Both THP and HugeTLB pages have the same pmd layout
+ * and should not be manipulated by the pte functions.
+ *
+ * Lock the page table for the destination and check
+ * to see that it's still huge and whether or not we will
+ * need to fault on write, or if we have a splitting THP.
+ */
+ if (unlikely(pmd_thp_or_huge(*pmd))) {
+ ptl = ¤t->mm->page_table_lock;
+ spin_lock(ptl);
+ if (unlikely(!pmd_thp_or_huge(*pmd)
+ || pmd_hugewillfault(*pmd)
+ || pmd_trans_splitting(*pmd))) {
+ spin_unlock(ptl);
+ return 0;
+ }
+
+ *ptep = NULL;
+ *ptlp = ptl;
+ *page_mask = HPAGE_MASK;
+ return 1;
+ }
+
+ if (unlikely(pmd_bad(*pmd)))
return 0;
pte = pte_offset_map_lock(current->mm, pmd, addr, &ptl);
@@ -52,6 +83,7 @@ pin_page_for_write(const void __user *_addr, pte_t **ptep, spinlock_t **ptlp)
*ptep = pte;
*ptlp = ptl;
+ *page_mask = PAGE_MASK;
return 1;
}
@@ -60,6 +92,7 @@ static unsigned long noinline
__copy_to_user_memcpy(void __user *to, const void *from, unsigned long n)
{
int atomic;
+ unsigned long page_mask;
if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
memcpy((void *)to, from, n);
@@ -76,7 +109,7 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n)
spinlock_t *ptl;
int tocopy;
- while (!pin_page_for_write(to, &pte, &ptl)) {
+ while (!pin_page_for_write(to, &pte, &ptl, &page_mask)) {
if (!atomic)
up_read(¤t->mm->mmap_sem);
if (__put_user(0, (char __user *)to))
@@ -85,7 +118,7 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n)
down_read(¤t->mm->mmap_sem);
}
- tocopy = (~(unsigned long)to & ~PAGE_MASK) + 1;
+ tocopy = (~(unsigned long)to & ~page_mask) + 1;
if (tocopy > n)
tocopy = n;
@@ -94,7 +127,10 @@ __copy_to_user_memcpy(void __user *to, const void *from, unsigned long n)
from += tocopy;
n -= tocopy;
- pte_unmap_unlock(pte, ptl);
+ if (pte)
+ pte_unmap_unlock(pte, ptl);
+ else
+ spin_unlock(ptl);
}
if (!atomic)
up_read(¤t->mm->mmap_sem);
@@ -121,6 +157,8 @@ __copy_to_user(void __user *to, const void *from, unsigned long n)
static unsigned long noinline
__clear_user_memset(void __user *addr, unsigned long n)
{
+ unsigned long page_mask;
+
if (unlikely(segment_eq(get_fs(), KERNEL_DS))) {
memset((void *)addr, 0, n);
return 0;
@@ -132,14 +170,14 @@ __clear_user_memset(void __user *addr, unsigned long n)
spinlock_t *ptl;
int tocopy;
- while (!pin_page_for_write(addr, &pte, &ptl)) {
+ while (!pin_page_for_write(addr, &pte, &ptl, &page_mask)) {
up_read(¤t->mm->mmap_sem);
if (__put_user(0, (char __user *)addr))
goto out;
down_read(¤t->mm->mmap_sem);
}
- tocopy = (~(unsigned long)addr & ~PAGE_MASK) + 1;
+ tocopy = (~(unsigned long)addr & ~page_mask) + 1;
if (tocopy > n)
tocopy = n;
@@ -147,7 +185,10 @@ __clear_user_memset(void __user *addr, unsigned long n)
addr += tocopy;
n -= tocopy;
- pte_unmap_unlock(pte, ptl);
+ if (pte)
+ pte_unmap_unlock(pte, ptl);
+ else
+ spin_unlock(ptl);
}
up_read(¤t->mm->mmap_sem);
--
1.8.1.4