diff --git a/arch/arm/boot/dts/tegra20-harmony.dts b/arch/arm/boot/dts/tegra20-harmony.dts index c3ef1ad..e701d3d 100644 --- a/arch/arm/boot/dts/tegra20-harmony.dts +++ b/arch/arm/boot/dts/tegra20-harmony.dts @@ -7,7 +7,11 @@ compatible = "nvidia,harmony", "nvidia,tegra20"; memory { - reg = <0x00000000 0x40000000>; + reg = <0x00000000 0x20000000>; + }; + + chosen { + bootargs = "console=ttyS0,115200n8 root=LABEL=boot:/rootfs.img ro ignore_loglevel earlyprintk"; }; pinmux { diff --git a/arch/arm/configs/tegra_defconfig b/arch/arm/configs/tegra_defconfig index e2184f6..aefd42c 100644 --- a/arch/arm/configs/tegra_defconfig +++ b/arch/arm/configs/tegra_defconfig @@ -24,7 +24,6 @@ CONFIG_EFI_PARTITION=y # CONFIG_IOSCHED_DEADLINE is not set # CONFIG_IOSCHED_CFQ is not set CONFIG_ARCH_TEGRA=y -CONFIG_GPIO_PCA953X=y CONFIG_ARCH_TEGRA_2x_SOC=y CONFIG_ARCH_TEGRA_3x_SOC=y CONFIG_TEGRA_PCI=y @@ -80,6 +79,14 @@ CONFIG_RFKILL_GPIO=y CONFIG_DEVTMPFS=y CONFIG_DEVTMPFS_MOUNT=y # CONFIG_FIRMWARE_IN_KERNEL is not set +CONFIG_CMA=y +CONFIG_CMA_DEBUG=y +CONFIG_CMA_SIZE_MBYTES=256 +CONFIG_CMA_TEST=m +CONFIG_MTD=m +CONFIG_MTD_CHAR=m +CONFIG_MTD_M25P80=m +CONFIG_MTD_NAND=m CONFIG_PROC_DEVICETREE=y CONFIG_BLK_DEV_LOOP=y CONFIG_AD525X_DPOT=y @@ -112,71 +119,51 @@ CONFIG_SERIAL_OF_PLATFORM=y # CONFIG_HW_RANDOM is not set CONFIG_I2C=y # CONFIG_I2C_COMPAT is not set -CONFIG_I2C_MUX=y -CONFIG_I2C_MUX_PINCTRL=y +CONFIG_I2C_CHARDEV=y +CONFIG_I2C_OCORES=m CONFIG_I2C_TEGRA=y CONFIG_SPI=y -CONFIG_SPI_TEGRA=y -CONFIG_GPIO_PCA953X_IRQ=y +CONFIG_GPIO_SYSFS=y CONFIG_GPIO_TPS6586X=y -CONFIG_GPIO_TPS65910=y CONFIG_POWER_SUPPLY=y CONFIG_BATTERY_SBS=y CONFIG_SENSORS_LM90=y CONFIG_MFD_TPS6586X=y -CONFIG_MFD_TPS65910=y -CONFIG_MFD_MAX8907=y CONFIG_REGULATOR=y CONFIG_REGULATOR_FIXED_VOLTAGE=y CONFIG_REGULATOR_VIRTUAL_CONSUMER=y CONFIG_REGULATOR_GPIO=y -CONFIG_REGULATOR_MAX8907=y -CONFIG_REGULATOR_TPS62360=y CONFIG_REGULATOR_TPS6586X=y -CONFIG_REGULATOR_TPS65910=y -CONFIG_MEDIA_SUPPORT=y -CONFIG_MEDIA_CAMERA_SUPPORT=y -CONFIG_MEDIA_USB_SUPPORT=y -CONFIG_USB_VIDEO_CLASS=m +CONFIG_DRM=m +CONFIG_FB=m +CONFIG_FIRMWARE_EDID=y +CONFIG_FB_MODE_HELPERS=y +CONFIG_FB_TILEBLITTING=y +CONFIG_BACKLIGHT_LCD_SUPPORT=y +# CONFIG_LCD_CLASS_DEVICE is not set +# CONFIG_BACKLIGHT_GENERIC is not set +CONFIG_BACKLIGHT_PWM=m +CONFIG_LOGO=y CONFIG_SOUND=y CONFIG_SND=y # CONFIG_SND_SUPPORT_OLD_API is not set # CONFIG_SND_DRIVERS is not set +# CONFIG_SND_PCI is not set # CONFIG_SND_ARM is not set # CONFIG_SND_SPI is not set # CONFIG_SND_USB is not set CONFIG_SND_SOC=y -CONFIG_SND_SOC_TEGRA=y -CONFIG_SND_SOC_TEGRA_WM8753=y -CONFIG_SND_SOC_TEGRA_WM8903=y -CONFIG_SND_SOC_TEGRA_TRIMSLICE=y -CONFIG_SND_SOC_TEGRA_ALC5632=y CONFIG_USB=y CONFIG_USB_EHCI_HCD=y CONFIG_USB_EHCI_TEGRA=y -CONFIG_USB_ACM=y -CONFIG_USB_WDM=y CONFIG_USB_STORAGE=y CONFIG_MMC=y CONFIG_MMC_BLOCK_MINORS=16 CONFIG_MMC_SDHCI=y CONFIG_MMC_SDHCI_PLTFM=y CONFIG_MMC_SDHCI_TEGRA=y -CONFIG_NEW_LEDS=y -CONFIG_LEDS_CLASS=y -CONFIG_LEDS_GPIO=y -CONFIG_LEDS_TRIGGERS=y -CONFIG_LEDS_TRIGGER_GPIO=y CONFIG_RTC_CLASS=y -CONFIG_RTC_INTF_SYSFS=y -CONFIG_RTC_INTF_PROC=y -CONFIG_RTC_INTF_DEV=y -CONFIG_RTC_DRV_MAX8907=y -CONFIG_RTC_DRV_TPS65910=y -CONFIG_RTC_DRV_EM3027=y CONFIG_RTC_DRV_TEGRA=y -CONFIG_DMADEVICES=y -CONFIG_TEGRA20_APB_DMA=y CONFIG_STAGING=y CONFIG_SENSORS_ISL29018=y CONFIG_SENSORS_ISL29028=y @@ -184,14 +171,12 @@ CONFIG_SENSORS_AK8975=y CONFIG_MFD_NVEC=y CONFIG_KEYBOARD_NVEC=y CONFIG_SERIO_NVEC_PS2=y -CONFIG_NVEC_POWER=y -CONFIG_NVEC_PAZ00=y CONFIG_TEGRA_IOMMU_GART=y CONFIG_TEGRA_IOMMU_SMMU=y CONFIG_MEMORY=y CONFIG_IIO=y CONFIG_PWM=y -CONFIG_PWM_TEGRA=y +CONFIG_PWM_TEGRA=m CONFIG_EXT2_FS=y CONFIG_EXT2_FS_XATTR=y CONFIG_EXT2_FS_POSIX_ACL=y @@ -204,14 +189,16 @@ CONFIG_EXT4_FS=y # CONFIG_DNOTIFY is not set CONFIG_VFAT_FS=y CONFIG_TMPFS=y -CONFIG_TMPFS_POSIX_ACL=y -CONFIG_NFS_FS=y -CONFIG_ROOT_NFS=y +CONFIG_SQUASHFS=y +CONFIG_SQUASHFS_XATTR=y +CONFIG_SQUASHFS_LZO=y +CONFIG_SQUASHFS_XZ=y CONFIG_NLS_CODEPAGE_437=y CONFIG_NLS_ISO8859_1=y CONFIG_PRINTK_TIME=y CONFIG_MAGIC_SYSRQ=y CONFIG_DEBUG_FS=y +CONFIG_DEBUG_SECTION_MISMATCH=y CONFIG_DETECT_HUNG_TASK=y CONFIG_SCHEDSTATS=y CONFIG_TIMER_STATS=y diff --git a/drivers/base/Kconfig b/drivers/base/Kconfig index 08b4c52..431d387 100644 --- a/drivers/base/Kconfig +++ b/drivers/base/Kconfig @@ -280,6 +280,9 @@ config CMA_AREAS If unsure, leave the default value "7". +config CMA_TEST + tristate "CMA test module" + endif endmenu diff --git a/drivers/base/Makefile b/drivers/base/Makefile index 5aa2d70..c4b2a97 100644 --- a/drivers/base/Makefile +++ b/drivers/base/Makefile @@ -7,6 +7,7 @@ obj-y := core.o bus.o dd.o syscore.o \ topology.o obj-$(CONFIG_DEVTMPFS) += devtmpfs.o obj-$(CONFIG_CMA) += dma-contiguous.o +obj-$(CONFIG_CMA_TEST) += cmatest.o obj-y += power/ obj-$(CONFIG_HAS_DMA) += dma-mapping.o obj-$(CONFIG_HAVE_GENERIC_DMA_COHERENT) += dma-coherent.o diff --git a/drivers/base/cmatest.c b/drivers/base/cmatest.c new file mode 100644 index 0000000..23d8f7f --- /dev/null +++ b/drivers/base/cmatest.c @@ -0,0 +1,38 @@ +#ifdef CONFIG_CMA_DEBUG +# ifndef DEBUG +# define DEBUG +# endif +#endif + +#include +#include + +static int cmatest_init(void) +{ + unsigned int i; + + for (i = 12; i <= 28; i++) { + dma_addr_t phys; + void *ptr; + + ptr = dma_alloc_writecombine(NULL, 1 << i, &phys, GFP_KERNEL); + if (ptr) { + pr_debug("successfully allocated %u bytes\n", 1 << i); + dma_free_writecombine(NULL, 1 << i, ptr, phys); + } else { + pr_debug("failed to allocate %u bytes\n", 1 << i); + } + } + + return 0; +} +module_init(cmatest_init); + +static void cmatest_exit(void) +{ +} +module_exit(cmatest_exit); + +MODULE_AUTHOR("Thierry Reding "); +MODULE_DESCRIPTION("Contiguous Memory Allocator test module"); +MODULE_LICENSE("GPL v2"); diff --git a/include/linux/audit.h b/include/linux/audit.h index 50faabe..a7a7db9 100644 --- a/include/linux/audit.h +++ b/include/linux/audit.h @@ -528,7 +528,7 @@ static inline void audit_ptrace(struct task_struct *t) extern unsigned int audit_serial(void); extern int auditsc_get_stamp(struct audit_context *ctx, struct timespec *t, unsigned int *serial); -extern int audit_set_loginuid(kuid_t loginuid); +extern int audit_set_loginuid(kuid_t loginuid); #define audit_get_loginuid(t) ((t)->loginuid) #define audit_get_sessionid(t) ((t)->sessionid) extern void audit_log_task_context(struct audit_buffer *ab); @@ -627,97 +627,38 @@ static inline void audit_mmap_fd(int fd, int flags) extern int audit_n_rules; extern int audit_signals; #else /* CONFIG_AUDITSYSCALL */ -static inline int audit_alloc(struct task_struct *task) -{ - return 0; -} -static inline void audit_free(struct task_struct *task) -{ } -static inline void audit_syscall_entry(int arch, int major, unsigned long a0, - unsigned long a1, unsigned long a2, - unsigned long a3) -{ } -static inline void audit_syscall_exit(void *pt_regs) -{ } -static inline int audit_dummy_context(void) -{ - return 1; -} -static inline void audit_getname(const char *name) -{ } -static inline void audit_putname(const char *name) -{ } -static inline void __audit_inode(const char *name, const struct dentry *dentry) -{ } -static inline void __audit_inode_child(const struct dentry *dentry, - const struct inode *parent) -{ } -static inline void audit_inode(const char *name, const struct dentry *dentry) -{ } -static inline void audit_inode_child(const struct dentry *dentry, - const struct inode *parent) -{ } -static inline void audit_core_dumps(long signr) -{ } -static inline void __audit_seccomp(unsigned long syscall, long signr, int code) -{ } -static inline void audit_seccomp(unsigned long syscall, long signr, int code) -{ } -static inline int auditsc_get_stamp(struct audit_context *ctx, - struct timespec *t, unsigned int *serial) -{ - return 0; -} -static inline int audit_get_loginuid(struct task_struct *tsk) -{ - return INVALID_UID; -} -static inline void audit_log_task_context(struct audit_buffer *ab) -{ } -static inline void audit_log_task_info(struct audit_buffer *ab, - struct task_struct *tsk) -{ } -static inline void audit_ipc_obj(struct kern_ipc_perm *ipcp) -{ } -static inline void audit_ipc_set_perm(unsigned long qbytes, uid_t uid, - gid_t gid, umode_t mode) -{ } -static inline int audit_bprm(struct linux_binprm *bprm) -{ - return 0; -} -static inline void audit_socketcall(int nargs, unsigned long *args) -{ } -static inline void audit_fd_pair(int fd1, int fd2) -{ } -static inline int audit_sockaddr(int len, void *addr) -{ - return 0; -} -static inline void audit_mq_open(int oflag, umode_t mode, struct mq_attr *attr) -{ } -static inline void audit_mq_sendrecv(mqd_t mqdes, size_t msg_len, - unsigned int msg_prio, - const struct timespec *abs_timeout) -{ } -static inline void audit_mq_notify(mqd_t mqdes, - const struct sigevent *notification) -{ } -static inline void audit_mq_getsetattr(mqd_t mqdes, struct mq_attr *mqstat) -{ } -static inline int audit_log_bprm_fcaps(struct linux_binprm *bprm, - const struct cred *new, - const struct cred *old) -{ - return 0; -} -static inline void audit_log_capset(pid_t pid, const struct cred *new, - const struct cred *old) -{ } -static inline void audit_mmap_fd(int fd, int flags) -{ } -static inline void audit_ptrace(struct task_struct *t) -{ } +#define audit_alloc(t) ({ 0; }) +#define audit_free(t) do { ; } while (0) +#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0) +#define audit_syscall_exit(r) do { ; } while (0) +#define audit_dummy_context() 1 +#define audit_getname(n) do { ; } while (0) +#define audit_putname(n) do { ; } while (0) +#define __audit_inode(n,d) do { ; } while (0) +#define __audit_inode_child(i,p) do { ; } while (0) +#define audit_inode(n,d) do { (void)(d); } while (0) +#define audit_inode_child(i,p) do { ; } while (0) +#define audit_core_dumps(i) do { ; } while (0) +#define audit_seccomp(i,s,c) do { ; } while (0) +#define auditsc_get_stamp(c,t,s) (0) +#define audit_get_loginuid(t) (INVALID_UID) +#define audit_get_sessionid(t) (-1) +#define audit_log_task_context(b) do { ; } while (0) +#define audit_log_task_info(b, t) do { ; } while (0) +#define audit_ipc_obj(i) ((void)0) +#define audit_ipc_set_perm(q,u,g,m) ((void)0) +#define audit_bprm(p) ({ 0; }) +#define audit_socketcall(n,a) ((void)0) +#define audit_fd_pair(n,a) ((void)0) +#define audit_sockaddr(len, addr) ({ 0; }) +#define audit_mq_open(o,m,a) ((void)0) +#define audit_mq_sendrecv(d,l,p,t) ((void)0) +#define audit_mq_notify(d,n) ((void)0) +#define audit_mq_getsetattr(d,s) ((void)0) +#define audit_log_bprm_fcaps(b, ncr, ocr) ({ 0; }) +#define audit_log_capset(pid, ncr, ocr) ((void)0) +#define audit_mmap_fd(fd, flags) ((void)0) +#define audit_ptrace(t) ((void)0) #define audit_n_rules 0 #define audit_signals 0 #endif /* CONFIG_AUDITSYSCALL */ @@ -741,6 +682,7 @@ extern void audit_log_n_hex(struct audit_buffer *ab, extern void audit_log_n_string(struct audit_buffer *ab, const char *buf, size_t n); +#define audit_log_string(a,b) audit_log_n_string(a, b, strlen(b)); extern void audit_log_n_untrustedstring(struct audit_buffer *ab, const char *string, size_t n); @@ -757,8 +699,7 @@ extern void audit_log_lost(const char *message); #ifdef CONFIG_SECURITY extern void audit_log_secctx(struct audit_buffer *ab, u32 secid); #else -static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid) -{ } +#define audit_log_secctx(b,s) do { ; } while (0) #endif extern int audit_update_lsm_rules(void); @@ -770,50 +711,22 @@ extern int audit_receive_filter(int type, int pid, int seq, void *data, size_t datasz, kuid_t loginuid, u32 sessionid, u32 sid); extern int audit_enabled; -#else /* CONFIG_AUDIT */ -static inline __printf(4, 5) -void audit_log(struct audit_context *ctx, gfp_t gfp_mask, int type, - const char *fmt, ...) -{ } -static inline struct audit_buffer *audit_log_start(struct audit_context *ctx, - gfp_t gfp_mask, int type) -{ - return NULL; -} -static inline __printf(2, 3) -void audit_log_format(struct audit_buffer *ab, const char *fmt, ...) -{ } -static inline void audit_log_end(struct audit_buffer *ab) -{ } -static inline void audit_log_n_hex(struct audit_buffer *ab, - const unsigned char *buf, size_t len) -{ } -static inline void audit_log_n_string(struct audit_buffer *ab, - const char *buf, size_t n) -{ } -static inline void audit_log_n_untrustedstring(struct audit_buffer *ab, - const char *string, size_t n) -{ } -static inline void audit_log_untrustedstring(struct audit_buffer *ab, - const char *string) -{ } -static inline void audit_log_d_path(struct audit_buffer *ab, - const char *prefix, - const struct path *path) -{ } -static inline void audit_log_key(struct audit_buffer *ab, char *key) -{ } -static inline void audit_log_link_denied(const char *string, - const struct path *link) -{ } -static inline void audit_log_secctx(struct audit_buffer *ab, u32 secid) -{ } +#else +#define audit_log(c,g,t,f,...) do { ; } while (0) +#define audit_log_start(c,g,t) ({ NULL; }) +#define audit_log_vformat(b,f,a) do { ; } while (0) +#define audit_log_format(b,f,...) do { ; } while (0) +#define audit_log_end(b) do { ; } while (0) +#define audit_log_n_hex(a,b,l) do { ; } while (0) +#define audit_log_n_string(a,c,l) do { ; } while (0) +#define audit_log_string(a,c) do { ; } while (0) +#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) +#define audit_log_untrustedstring(a,s) do { ; } while (0) +#define audit_log_d_path(b, p, d) do { ; } while (0) +#define audit_log_key(b, k) do { ; } while (0) +#define audit_log_link_denied(o, l) do { ; } while (0) +#define audit_log_secctx(b,s) do { ; } while (0) #define audit_enabled 0 -#endif /* CONFIG_AUDIT */ -static inline void audit_log_string(struct audit_buffer *ab, const char *buf) -{ - audit_log_n_string(ab, buf, strlen(buf)); -} - +#endif #endif #endif diff --git a/include/linux/pageblock-flags.h b/include/linux/pageblock-flags.h index eed27f4..9ed5841 100644 --- a/include/linux/pageblock-flags.h +++ b/include/linux/pageblock-flags.h @@ -30,7 +30,7 @@ enum pageblock_bits { PB_migrate, PB_migrate_end = PB_migrate + 3 - 1, /* 3 bits required for migrate types */ -#ifdef CONFIG_COMPACTION +#if defined(CONFIG_COMPACTION) || defined(CONFIG_CMA) PB_migrate_skip,/* If set the block is skipped by compaction */ #endif /* CONFIG_COMPACTION */ NR_PAGEBLOCK_BITS @@ -68,7 +68,7 @@ unsigned long get_pageblock_flags_group(struct page *page, void set_pageblock_flags_group(struct page *page, unsigned long flags, int start_bitidx, int end_bitidx); -#ifdef CONFIG_COMPACTION +#if defined(CONFIG_COMPACTION) || defined(CONFIG_CMA) #define get_pageblock_skip(page) \ get_pageblock_flags_group(page, PB_migrate_skip, \ PB_migrate_skip + 1) diff --git a/mm/compaction.c b/mm/compaction.c index 2769d96..3382869 100644 --- a/mm/compaction.c +++ b/mm/compaction.c @@ -238,6 +238,7 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, struct list_head *freelist, bool strict) { + unsigned long nr_strict_required = end_pfn - blockpfn; int nr_scanned = 0, total_isolated = 0; struct page *cursor, *valid_page = NULL; unsigned long flags; @@ -300,10 +301,10 @@ static unsigned long isolate_freepages_block(struct compact_control *cc, /* * If strict isolation is requested by CMA then check that all the - * pages scanned were isolated. If there were any failures, 0 is + * pages requested were isolated. If there were any failures, 0 is * returned and CMA will fail. */ - if (strict && nr_scanned != total_isolated) + if (strict && nr_strict_required != total_isolated) total_isolated = 0; if (locked)