update to 3.10.38 [release 3.10.38-1mamba;Tue Apr 29 2014]
This commit is contained in:
parent
620169b2f9
commit
94b2133739
146
0001-vfs-add-i_op-dentry_open.patch
Normal file
146
0001-vfs-add-i_op-dentry_open.patch
Normal file
@ -0,0 +1,146 @@
|
|||||||
|
From 241ccca7d4e91d2b9d7249bc0b2758d9470b4c65 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
Date: Thu, 27 Jun 2013 16:39:49 +0200
|
||||||
|
Subject: [PATCH 1/9] vfs: add i_op->dentry_open()
|
||||||
|
|
||||||
|
Add a new inode operation i_op->dentry_open(). This is for stacked filesystems
|
||||||
|
that want to return a struct file from a different filesystem.
|
||||||
|
|
||||||
|
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
---
|
||||||
|
Documentation/filesystems/Locking | 2 ++
|
||||||
|
Documentation/filesystems/vfs.txt | 7 +++++++
|
||||||
|
fs/namei.c | 9 ++++++---
|
||||||
|
fs/open.c | 23 +++++++++++++++++++++--
|
||||||
|
include/linux/fs.h | 2 ++
|
||||||
|
5 files changed, 38 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/Documentation/filesystems/Locking b/Documentation/filesystems/Locking
|
||||||
|
index 0706d32..4331290 100644
|
||||||
|
--- a/Documentation/filesystems/Locking
|
||||||
|
+++ b/Documentation/filesystems/Locking
|
||||||
|
@@ -66,6 +66,7 @@ prototypes:
|
||||||
|
int (*atomic_open)(struct inode *, struct dentry *,
|
||||||
|
struct file *, unsigned open_flag,
|
||||||
|
umode_t create_mode, int *opened);
|
||||||
|
+ int (*dentry_open)(struct dentry *, struct file *, const struct cred *);
|
||||||
|
|
||||||
|
locking rules:
|
||||||
|
all may block
|
||||||
|
@@ -93,6 +94,7 @@ removexattr: yes
|
||||||
|
fiemap: no
|
||||||
|
update_time: no
|
||||||
|
atomic_open: yes
|
||||||
|
+dentry_open: no
|
||||||
|
|
||||||
|
Additionally, ->rmdir(), ->unlink() and ->rename() have ->i_mutex on
|
||||||
|
victim.
|
||||||
|
diff --git a/Documentation/filesystems/vfs.txt b/Documentation/filesystems/vfs.txt
|
||||||
|
index bc4b06b..f64a4d1 100644
|
||||||
|
--- a/Documentation/filesystems/vfs.txt
|
||||||
|
+++ b/Documentation/filesystems/vfs.txt
|
||||||
|
@@ -362,6 +362,7 @@ struct inode_operations {
|
||||||
|
int (*atomic_open)(struct inode *, struct dentry *,
|
||||||
|
struct file *, unsigned open_flag,
|
||||||
|
umode_t create_mode, int *opened);
|
||||||
|
+ int (*dentry_open)(struct dentry *, struct file *, const struct cred *);
|
||||||
|
};
|
||||||
|
|
||||||
|
Again, all methods are called without any locks being held, unless
|
||||||
|
@@ -681,6 +682,12 @@ struct address_space_operations {
|
||||||
|
but instead uses bmap to find out where the blocks in the file
|
||||||
|
are and uses those addresses directly.
|
||||||
|
|
||||||
|
+ dentry_open: this is an alternative to f_op->open(), the difference is that
|
||||||
|
+ this method may open a file not necessarily originating from the same
|
||||||
|
+ filesystem as the one i_op->open() was called on. It may be
|
||||||
|
+ useful for stacking filesystems which want to allow native I/O directly
|
||||||
|
+ on underlying files.
|
||||||
|
+
|
||||||
|
|
||||||
|
invalidatepage: If a page has PagePrivate set, then invalidatepage
|
||||||
|
will be called when part or all of the page is to be removed
|
||||||
|
diff --git a/fs/namei.c b/fs/namei.c
|
||||||
|
index 9ed9361..c06e521 100644
|
||||||
|
--- a/fs/namei.c
|
||||||
|
+++ b/fs/namei.c
|
||||||
|
@@ -2867,9 +2867,12 @@ finish_open_created:
|
||||||
|
error = may_open(&nd->path, acc_mode, open_flag);
|
||||||
|
if (error)
|
||||||
|
goto out;
|
||||||
|
- file->f_path.mnt = nd->path.mnt;
|
||||||
|
- error = finish_open(file, nd->path.dentry, NULL, opened);
|
||||||
|
- if (error) {
|
||||||
|
+
|
||||||
|
+ BUG_ON(*opened & FILE_OPENED); /* once it's opened, it's opened */
|
||||||
|
+ error = vfs_open(&nd->path, file, current_cred());
|
||||||
|
+ if (!error) {
|
||||||
|
+ *opened |= FILE_OPENED;
|
||||||
|
+ } else {
|
||||||
|
if (error == -EOPENSTALE)
|
||||||
|
goto stale_open;
|
||||||
|
goto out;
|
||||||
|
diff --git a/fs/open.c b/fs/open.c
|
||||||
|
index 8c74100..ab07bc9 100644
|
||||||
|
--- a/fs/open.c
|
||||||
|
+++ b/fs/open.c
|
||||||
|
@@ -800,8 +800,7 @@ struct file *dentry_open(const struct path *path, int flags,
|
||||||
|
f = get_empty_filp();
|
||||||
|
if (!IS_ERR(f)) {
|
||||||
|
f->f_flags = flags;
|
||||||
|
- f->f_path = *path;
|
||||||
|
- error = do_dentry_open(f, NULL, cred);
|
||||||
|
+ error = vfs_open(path, f, cred);
|
||||||
|
if (!error) {
|
||||||
|
/* from now on we need fput() to dispose of f */
|
||||||
|
error = open_check_o_direct(f);
|
||||||
|
@@ -818,6 +817,26 @@ struct file *dentry_open(const struct path *path, int flags,
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL(dentry_open);
|
||||||
|
|
||||||
|
+/**
|
||||||
|
+ * vfs_open - open the file at the given path
|
||||||
|
+ * @path: path to open
|
||||||
|
+ * @filp: newly allocated file with f_flag initialized
|
||||||
|
+ * @cred: credentials to use
|
||||||
|
+ */
|
||||||
|
+int vfs_open(const struct path *path, struct file *filp,
|
||||||
|
+ const struct cred *cred)
|
||||||
|
+{
|
||||||
|
+ struct inode *inode = path->dentry->d_inode;
|
||||||
|
+
|
||||||
|
+ if (inode->i_op->dentry_open)
|
||||||
|
+ return inode->i_op->dentry_open(path->dentry, filp, cred);
|
||||||
|
+ else {
|
||||||
|
+ filp->f_path = *path;
|
||||||
|
+ return do_dentry_open(filp, NULL, cred);
|
||||||
|
+ }
|
||||||
|
+}
|
||||||
|
+EXPORT_SYMBOL(vfs_open);
|
||||||
|
+
|
||||||
|
static inline int build_open_flags(int flags, umode_t mode, struct open_flags *op)
|
||||||
|
{
|
||||||
|
int lookup_flags = 0;
|
||||||
|
diff --git a/include/linux/fs.h b/include/linux/fs.h
|
||||||
|
index 65c2be2..0a87abc 100644
|
||||||
|
--- a/include/linux/fs.h
|
||||||
|
+++ b/include/linux/fs.h
|
||||||
|
@@ -1575,6 +1575,7 @@ struct inode_operations {
|
||||||
|
int (*atomic_open)(struct inode *, struct dentry *,
|
||||||
|
struct file *, unsigned open_flag,
|
||||||
|
umode_t create_mode, int *opened);
|
||||||
|
+ int (*dentry_open)(struct dentry *, struct file *, const struct cred *);
|
||||||
|
} ____cacheline_aligned;
|
||||||
|
|
||||||
|
ssize_t rw_copy_check_uvector(int type, const struct iovec __user * uvector,
|
||||||
|
@@ -2008,6 +2009,7 @@ extern struct file *file_open_name(struct filename *, int, umode_t);
|
||||||
|
extern struct file *filp_open(const char *, int, umode_t);
|
||||||
|
extern struct file *file_open_root(struct dentry *, struct vfsmount *,
|
||||||
|
const char *, int);
|
||||||
|
+extern int vfs_open(const struct path *, struct file *, const struct cred *);
|
||||||
|
extern struct file * dentry_open(const struct path *, int, const struct cred *);
|
||||||
|
extern int filp_close(struct file *, fl_owner_t id);
|
||||||
|
|
||||||
|
--
|
||||||
|
1.8.3.2
|
||||||
|
|
60
0002-vfs-export-do_splice_direct-to-modules.patch
Normal file
60
0002-vfs-export-do_splice_direct-to-modules.patch
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
From bbe04b17053d192844389840b6b981cd98417517 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
Date: Thu, 27 Jun 2013 16:39:49 +0200
|
||||||
|
Subject: [PATCH 2/9] vfs: export do_splice_direct() to modules
|
||||||
|
|
||||||
|
Export do_splice_direct() to modules. Needed by overlay filesystem.
|
||||||
|
|
||||||
|
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
---
|
||||||
|
fs/internal.h | 6 ------
|
||||||
|
fs/splice.c | 1 +
|
||||||
|
include/linux/fs.h | 3 +++
|
||||||
|
3 files changed, 4 insertions(+), 6 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/fs/internal.h b/fs/internal.h
|
||||||
|
index 6812158..eaa75f7 100644
|
||||||
|
--- a/fs/internal.h
|
||||||
|
+++ b/fs/internal.h
|
||||||
|
@@ -132,12 +132,6 @@ extern struct dentry *__d_alloc(struct super_block *, const struct qstr *);
|
||||||
|
extern ssize_t __kernel_write(struct file *, const char *, size_t, loff_t *);
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * splice.c
|
||||||
|
- */
|
||||||
|
-extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
|
||||||
|
- loff_t *opos, size_t len, unsigned int flags);
|
||||||
|
-
|
||||||
|
-/*
|
||||||
|
* pipe.c
|
||||||
|
*/
|
||||||
|
extern const struct file_operations pipefifo_fops;
|
||||||
|
diff --git a/fs/splice.c b/fs/splice.c
|
||||||
|
index 9eca476..8d415fc 100644
|
||||||
|
--- a/fs/splice.c
|
||||||
|
+++ b/fs/splice.c
|
||||||
|
@@ -1312,6 +1312,7 @@ long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
|
||||||
|
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
+EXPORT_SYMBOL(do_splice_direct);
|
||||||
|
|
||||||
|
static int splice_pipe_to_pipe(struct pipe_inode_info *ipipe,
|
||||||
|
struct pipe_inode_info *opipe,
|
||||||
|
diff --git a/include/linux/fs.h b/include/linux/fs.h
|
||||||
|
index 0a87abc..80690b3 100644
|
||||||
|
--- a/include/linux/fs.h
|
||||||
|
+++ b/include/linux/fs.h
|
||||||
|
@@ -2416,6 +2416,9 @@ extern ssize_t generic_file_splice_write(struct pipe_inode_info *,
|
||||||
|
struct file *, loff_t *, size_t, unsigned int);
|
||||||
|
extern ssize_t generic_splice_sendpage(struct pipe_inode_info *pipe,
|
||||||
|
struct file *out, loff_t *, size_t len, unsigned int flags);
|
||||||
|
+extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
|
||||||
|
+ loff_t *opos, size_t len, unsigned int flags);
|
||||||
|
+
|
||||||
|
|
||||||
|
extern void
|
||||||
|
file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
|
||||||
|
--
|
||||||
|
1.8.3.2
|
||||||
|
|
58
0003-vfs-export-__inode_permission-to-modules.patch
Normal file
58
0003-vfs-export-__inode_permission-to-modules.patch
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
From 268ab52e6c604555f81807307a845ffe654c3aa9 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
Date: Thu, 27 Jun 2013 16:39:49 +0200
|
||||||
|
Subject: [PATCH 3/9] vfs: export __inode_permission() to modules
|
||||||
|
|
||||||
|
We need to be able to check inode permissions (but not filesystem implied
|
||||||
|
permissions) for stackable filesystems. Expose this interface for overlayfs.
|
||||||
|
|
||||||
|
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
---
|
||||||
|
fs/internal.h | 5 -----
|
||||||
|
fs/namei.c | 1 +
|
||||||
|
include/linux/fs.h | 1 +
|
||||||
|
3 files changed, 2 insertions(+), 5 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/fs/internal.h b/fs/internal.h
|
||||||
|
index eaa75f7..6c9ec69 100644
|
||||||
|
--- a/fs/internal.h
|
||||||
|
+++ b/fs/internal.h
|
||||||
|
@@ -42,11 +42,6 @@ static inline int __sync_blockdev(struct block_device *bdev, int wait)
|
||||||
|
extern void __init chrdev_init(void);
|
||||||
|
|
||||||
|
/*
|
||||||
|
- * namei.c
|
||||||
|
- */
|
||||||
|
-extern int __inode_permission(struct inode *, int);
|
||||||
|
-
|
||||||
|
-/*
|
||||||
|
* namespace.c
|
||||||
|
*/
|
||||||
|
extern int copy_mount_options(const void __user *, unsigned long *);
|
||||||
|
diff --git a/fs/namei.c b/fs/namei.c
|
||||||
|
index c06e521..df058f5 100644
|
||||||
|
--- a/fs/namei.c
|
||||||
|
+++ b/fs/namei.c
|
||||||
|
@@ -402,6 +402,7 @@ int __inode_permission(struct inode *inode, int mask)
|
||||||
|
|
||||||
|
return security_inode_permission(inode, mask);
|
||||||
|
}
|
||||||
|
+EXPORT_SYMBOL(__inode_permission);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* sb_permission - Check superblock-level permissions
|
||||||
|
diff --git a/include/linux/fs.h b/include/linux/fs.h
|
||||||
|
index 80690b3..8a6752b 100644
|
||||||
|
--- a/include/linux/fs.h
|
||||||
|
+++ b/include/linux/fs.h
|
||||||
|
@@ -2210,6 +2210,7 @@ extern sector_t bmap(struct inode *, sector_t);
|
||||||
|
#endif
|
||||||
|
extern int notify_change(struct dentry *, struct iattr *);
|
||||||
|
extern int inode_permission(struct inode *, int);
|
||||||
|
+extern int __inode_permission(struct inode *, int);
|
||||||
|
extern int generic_permission(struct inode *, int);
|
||||||
|
|
||||||
|
static inline bool execute_ok(struct inode *inode)
|
||||||
|
--
|
||||||
|
1.8.3.2
|
||||||
|
|
69
0004-vfs-introduce-clone_private_mount.patch
Normal file
69
0004-vfs-introduce-clone_private_mount.patch
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
From 04c7737b94059b8935abd0c09ac8745eba89ad90 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
Date: Thu, 27 Jun 2013 16:39:49 +0200
|
||||||
|
Subject: [PATCH 4/9] vfs: introduce clone_private_mount()
|
||||||
|
|
||||||
|
Overlayfs needs a private clone of the mount, so create a function for
|
||||||
|
this and export to modules.
|
||||||
|
|
||||||
|
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
---
|
||||||
|
fs/namespace.c | 27 +++++++++++++++++++++++++++
|
||||||
|
include/linux/mount.h | 3 +++
|
||||||
|
2 files changed, 30 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/fs/namespace.c b/fs/namespace.c
|
||||||
|
index 7b1ca9b..455e6ea 100644
|
||||||
|
--- a/fs/namespace.c
|
||||||
|
+++ b/fs/namespace.c
|
||||||
|
@@ -1442,6 +1442,33 @@ void drop_collected_mounts(struct vfsmount *mnt)
|
||||||
|
namespace_unlock();
|
||||||
|
}
|
||||||
|
|
||||||
|
+/**
|
||||||
|
+ * clone_private_mount - create a private clone of a path
|
||||||
|
+ *
|
||||||
|
+ * This creates a new vfsmount, which will be the clone of @path. The new will
|
||||||
|
+ * not be attached anywhere in the namespace and will be private (i.e. changes
|
||||||
|
+ * to the originating mount won't be propagated into this).
|
||||||
|
+ *
|
||||||
|
+ * Release with mntput().
|
||||||
|
+ */
|
||||||
|
+struct vfsmount *clone_private_mount(struct path *path)
|
||||||
|
+{
|
||||||
|
+ struct mount *old_mnt = real_mount(path->mnt);
|
||||||
|
+ struct mount *new_mnt;
|
||||||
|
+
|
||||||
|
+ if (IS_MNT_UNBINDABLE(old_mnt))
|
||||||
|
+ return ERR_PTR(-EINVAL);
|
||||||
|
+
|
||||||
|
+ down_read(&namespace_sem);
|
||||||
|
+ new_mnt = clone_mnt(old_mnt, path->dentry, CL_PRIVATE);
|
||||||
|
+ up_read(&namespace_sem);
|
||||||
|
+ if (IS_ERR(new_mnt))
|
||||||
|
+ return ERR_CAST(new_mnt);
|
||||||
|
+
|
||||||
|
+ return &new_mnt->mnt;
|
||||||
|
+}
|
||||||
|
+EXPORT_SYMBOL_GPL(clone_private_mount);
|
||||||
|
+
|
||||||
|
int iterate_mounts(int (*f)(struct vfsmount *, void *), void *arg,
|
||||||
|
struct vfsmount *root)
|
||||||
|
{
|
||||||
|
diff --git a/include/linux/mount.h b/include/linux/mount.h
|
||||||
|
index 73005f9..435f281 100644
|
||||||
|
--- a/include/linux/mount.h
|
||||||
|
+++ b/include/linux/mount.h
|
||||||
|
@@ -68,6 +68,9 @@ extern void mnt_pin(struct vfsmount *mnt);
|
||||||
|
extern void mnt_unpin(struct vfsmount *mnt);
|
||||||
|
extern int __mnt_is_readonly(struct vfsmount *mnt);
|
||||||
|
|
||||||
|
+struct path;
|
||||||
|
+extern struct vfsmount *clone_private_mount(struct path *path);
|
||||||
|
+
|
||||||
|
struct file_system_type;
|
||||||
|
extern struct vfsmount *vfs_kern_mount(struct file_system_type *type,
|
||||||
|
int flags, const char *name,
|
||||||
|
--
|
||||||
|
1.8.3.2
|
||||||
|
|
2808
0005-overlay-filesystem.patch
Normal file
2808
0005-overlay-filesystem.patch
Normal file
File diff suppressed because it is too large
Load Diff
114
0006-overlayfs-add-statfs-support.patch
Normal file
114
0006-overlayfs-add-statfs-support.patch
Normal file
@ -0,0 +1,114 @@
|
|||||||
|
From 57c8073caecaaaeb087d1bad0de1baa497189181 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy Whitcroft <apw@canonical.com>
|
||||||
|
Date: Thu, 27 Jun 2013 16:39:50 +0200
|
||||||
|
Subject: [PATCH 6/9] overlayfs: add statfs support
|
||||||
|
|
||||||
|
Add support for statfs to the overlayfs filesystem. As the upper layer
|
||||||
|
is the target of all write operations assume that the space in that
|
||||||
|
filesystem is the space in the overlayfs. There will be some inaccuracy as
|
||||||
|
overwriting a file will copy it up and consume space we were not expecting,
|
||||||
|
but it is better than nothing.
|
||||||
|
|
||||||
|
Use the upper layer dentry and mount from the overlayfs root inode,
|
||||||
|
passing the statfs call to that filesystem.
|
||||||
|
|
||||||
|
Signed-off-by: Andy Whitcroft <apw@canonical.com>
|
||||||
|
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
---
|
||||||
|
fs/overlayfs/super.c | 40 ++++++++++++++++++++++++++++++++++++++++
|
||||||
|
1 file changed, 40 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
|
||||||
|
index d209dd9..a9970b5 100644
|
||||||
|
--- a/fs/overlayfs/super.c
|
||||||
|
+++ b/fs/overlayfs/super.c
|
||||||
|
@@ -17,15 +17,19 @@
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/cred.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
+#include <linux/statfs.h>
|
||||||
|
#include "overlayfs.h"
|
||||||
|
|
||||||
|
MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
|
||||||
|
MODULE_DESCRIPTION("Overlay filesystem");
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
|
||||||
|
+#define OVERLAYFS_SUPER_MAGIC 0x794c764f
|
||||||
|
+
|
||||||
|
struct ovl_fs {
|
||||||
|
struct vfsmount *upper_mnt;
|
||||||
|
struct vfsmount *lower_mnt;
|
||||||
|
+ long lower_namelen;
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ovl_entry {
|
||||||
|
@@ -406,9 +410,36 @@ static int ovl_remount_fs(struct super_block *sb, int *flagsp, char *data)
|
||||||
|
return mnt_want_write(ufs->upper_mnt);
|
||||||
|
}
|
||||||
|
|
||||||
|
+/**
|
||||||
|
+ * ovl_statfs
|
||||||
|
+ * @sb: The overlayfs super block
|
||||||
|
+ * @buf: The struct kstatfs to fill in with stats
|
||||||
|
+ *
|
||||||
|
+ * Get the filesystem statistics. As writes always target the upper layer
|
||||||
|
+ * filesystem pass the statfs to the same filesystem.
|
||||||
|
+ */
|
||||||
|
+static int ovl_statfs(struct dentry *dentry, struct kstatfs *buf)
|
||||||
|
+{
|
||||||
|
+ struct ovl_fs *ofs = dentry->d_sb->s_fs_info;
|
||||||
|
+ struct dentry *root_dentry = dentry->d_sb->s_root;
|
||||||
|
+ struct path path;
|
||||||
|
+ int err;
|
||||||
|
+
|
||||||
|
+ ovl_path_upper(root_dentry, &path);
|
||||||
|
+
|
||||||
|
+ err = vfs_statfs(&path, buf);
|
||||||
|
+ if (!err) {
|
||||||
|
+ buf->f_namelen = max(buf->f_namelen, ofs->lower_namelen);
|
||||||
|
+ buf->f_type = OVERLAYFS_SUPER_MAGIC;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return err;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static const struct super_operations ovl_super_operations = {
|
||||||
|
.put_super = ovl_put_super,
|
||||||
|
.remount_fs = ovl_remount_fs,
|
||||||
|
+ .statfs = ovl_statfs,
|
||||||
|
};
|
||||||
|
|
||||||
|
struct ovl_config {
|
||||||
|
@@ -474,6 +505,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
|
struct ovl_entry *oe;
|
||||||
|
struct ovl_fs *ufs;
|
||||||
|
struct ovl_config config;
|
||||||
|
+ struct kstatfs statfs;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
err = ovl_parse_opt((char *) data, &config);
|
||||||
|
@@ -508,6 +540,13 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
|
!S_ISDIR(lowerpath.dentry->d_inode->i_mode))
|
||||||
|
goto out_put_lowerpath;
|
||||||
|
|
||||||
|
+ err = vfs_statfs(&lowerpath, &statfs);
|
||||||
|
+ if (err) {
|
||||||
|
+ pr_err("overlayfs: statfs failed on lowerpath\n");
|
||||||
|
+ goto out_put_lowerpath;
|
||||||
|
+ }
|
||||||
|
+ ufs->lower_namelen = statfs.f_namelen;
|
||||||
|
+
|
||||||
|
ufs->upper_mnt = clone_private_mount(&upperpath);
|
||||||
|
err = PTR_ERR(ufs->upper_mnt);
|
||||||
|
if (IS_ERR(ufs->upper_mnt)) {
|
||||||
|
@@ -556,6 +595,7 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
|
root_dentry->d_fsdata = oe;
|
||||||
|
root_dentry->d_op = &ovl_dentry_operations;
|
||||||
|
|
||||||
|
+ sb->s_magic = OVERLAYFS_SUPER_MAGIC;
|
||||||
|
sb->s_op = &ovl_super_operations;
|
||||||
|
sb->s_root = root_dentry;
|
||||||
|
sb->s_fs_info = ufs;
|
||||||
|
--
|
||||||
|
1.8.3.2
|
||||||
|
|
155
0007-overlayfs-implement-show_options.patch
Normal file
155
0007-overlayfs-implement-show_options.patch
Normal file
@ -0,0 +1,155 @@
|
|||||||
|
From 4ff99cccd67514e258c97d71593ba495e1b2a89f Mon Sep 17 00:00:00 2001
|
||||||
|
From: Erez Zadok <ezk@fsl.cs.sunysb.edu>
|
||||||
|
Date: Thu, 27 Jun 2013 16:39:50 +0200
|
||||||
|
Subject: [PATCH 7/9] overlayfs: implement show_options
|
||||||
|
|
||||||
|
This is useful because of the stacking nature of overlayfs. Users like to
|
||||||
|
find out (via /proc/mounts) which lower/upper directory were used at mount
|
||||||
|
time.
|
||||||
|
|
||||||
|
Signed-off-by: Erez Zadok <ezk@cs.sunysb.edu>
|
||||||
|
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
---
|
||||||
|
fs/overlayfs/super.c | 63 +++++++++++++++++++++++++++++++++++-----------------
|
||||||
|
1 file changed, 43 insertions(+), 20 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
|
||||||
|
index a9970b5..066ea5a 100644
|
||||||
|
--- a/fs/overlayfs/super.c
|
||||||
|
+++ b/fs/overlayfs/super.c
|
||||||
|
@@ -18,6 +18,7 @@
|
||||||
|
#include <linux/cred.h>
|
||||||
|
#include <linux/sched.h>
|
||||||
|
#include <linux/statfs.h>
|
||||||
|
+#include <linux/seq_file.h>
|
||||||
|
#include "overlayfs.h"
|
||||||
|
|
||||||
|
MODULE_AUTHOR("Miklos Szeredi <miklos@szeredi.hu>");
|
||||||
|
@@ -26,12 +27,21 @@ MODULE_LICENSE("GPL");
|
||||||
|
|
||||||
|
#define OVERLAYFS_SUPER_MAGIC 0x794c764f
|
||||||
|
|
||||||
|
+struct ovl_config {
|
||||||
|
+ char *lowerdir;
|
||||||
|
+ char *upperdir;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+/* private information held for overlayfs's superblock */
|
||||||
|
struct ovl_fs {
|
||||||
|
struct vfsmount *upper_mnt;
|
||||||
|
struct vfsmount *lower_mnt;
|
||||||
|
long lower_namelen;
|
||||||
|
+ /* pathnames of lower and upper dirs, for show_options */
|
||||||
|
+ struct ovl_config config;
|
||||||
|
};
|
||||||
|
|
||||||
|
+/* private information held for every overlayfs dentry */
|
||||||
|
struct ovl_entry {
|
||||||
|
/*
|
||||||
|
* Keep "double reference" on upper dentries, so that
|
||||||
|
@@ -388,6 +398,8 @@ static void ovl_put_super(struct super_block *sb)
|
||||||
|
mntput(ufs->upper_mnt);
|
||||||
|
mntput(ufs->lower_mnt);
|
||||||
|
|
||||||
|
+ kfree(ufs->config.lowerdir);
|
||||||
|
+ kfree(ufs->config.upperdir);
|
||||||
|
kfree(ufs);
|
||||||
|
}
|
||||||
|
|
||||||
|
@@ -436,15 +448,27 @@ static int ovl_statfs(struct dentry *dentry, struct kstatfs *buf)
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
+/**
|
||||||
|
+ * ovl_show_options
|
||||||
|
+ *
|
||||||
|
+ * Prints the mount options for a given superblock.
|
||||||
|
+ * Returns zero; does not fail.
|
||||||
|
+ */
|
||||||
|
+static int ovl_show_options(struct seq_file *m, struct dentry *dentry)
|
||||||
|
+{
|
||||||
|
+ struct super_block *sb = dentry->d_sb;
|
||||||
|
+ struct ovl_fs *ufs = sb->s_fs_info;
|
||||||
|
+
|
||||||
|
+ seq_printf(m, ",lowerdir=%s", ufs->config.lowerdir);
|
||||||
|
+ seq_printf(m, ",upperdir=%s", ufs->config.upperdir);
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static const struct super_operations ovl_super_operations = {
|
||||||
|
.put_super = ovl_put_super,
|
||||||
|
.remount_fs = ovl_remount_fs,
|
||||||
|
.statfs = ovl_statfs,
|
||||||
|
-};
|
||||||
|
-
|
||||||
|
-struct ovl_config {
|
||||||
|
- char *lowerdir;
|
||||||
|
- char *upperdir;
|
||||||
|
+ .show_options = ovl_show_options,
|
||||||
|
};
|
||||||
|
|
||||||
|
enum {
|
||||||
|
@@ -504,34 +528,33 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
|
struct dentry *root_dentry;
|
||||||
|
struct ovl_entry *oe;
|
||||||
|
struct ovl_fs *ufs;
|
||||||
|
- struct ovl_config config;
|
||||||
|
struct kstatfs statfs;
|
||||||
|
int err;
|
||||||
|
|
||||||
|
- err = ovl_parse_opt((char *) data, &config);
|
||||||
|
- if (err)
|
||||||
|
+ err = -ENOMEM;
|
||||||
|
+ ufs = kmalloc(sizeof(struct ovl_fs), GFP_KERNEL);
|
||||||
|
+ if (!ufs)
|
||||||
|
goto out;
|
||||||
|
|
||||||
|
+ err = ovl_parse_opt((char *) data, &ufs->config);
|
||||||
|
+ if (err)
|
||||||
|
+ goto out_free_ufs;
|
||||||
|
+
|
||||||
|
err = -EINVAL;
|
||||||
|
- if (!config.upperdir || !config.lowerdir) {
|
||||||
|
+ if (!ufs->config.upperdir || !ufs->config.lowerdir) {
|
||||||
|
pr_err("overlayfs: missing upperdir or lowerdir\n");
|
||||||
|
goto out_free_config;
|
||||||
|
}
|
||||||
|
|
||||||
|
- err = -ENOMEM;
|
||||||
|
- ufs = kmalloc(sizeof(struct ovl_fs), GFP_KERNEL);
|
||||||
|
- if (!ufs)
|
||||||
|
- goto out_free_config;
|
||||||
|
-
|
||||||
|
oe = ovl_alloc_entry();
|
||||||
|
if (oe == NULL)
|
||||||
|
- goto out_free_ufs;
|
||||||
|
+ goto out_free_config;
|
||||||
|
|
||||||
|
- err = kern_path(config.upperdir, LOOKUP_FOLLOW, &upperpath);
|
||||||
|
+ err = kern_path(ufs->config.upperdir, LOOKUP_FOLLOW, &upperpath);
|
||||||
|
if (err)
|
||||||
|
goto out_free_oe;
|
||||||
|
|
||||||
|
- err = kern_path(config.lowerdir, LOOKUP_FOLLOW, &lowerpath);
|
||||||
|
+ err = kern_path(ufs->config.lowerdir, LOOKUP_FOLLOW, &lowerpath);
|
||||||
|
if (err)
|
||||||
|
goto out_put_upperpath;
|
||||||
|
|
||||||
|
@@ -615,11 +638,11 @@ out_put_upperpath:
|
||||||
|
path_put(&upperpath);
|
||||||
|
out_free_oe:
|
||||||
|
kfree(oe);
|
||||||
|
+out_free_config:
|
||||||
|
+ kfree(ufs->config.lowerdir);
|
||||||
|
+ kfree(ufs->config.upperdir);
|
||||||
|
out_free_ufs:
|
||||||
|
kfree(ufs);
|
||||||
|
-out_free_config:
|
||||||
|
- kfree(config.lowerdir);
|
||||||
|
- kfree(config.upperdir);
|
||||||
|
out:
|
||||||
|
return err;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
1.8.3.2
|
||||||
|
|
240
0008-overlay-overlay-filesystem-documentation.patch
Normal file
240
0008-overlay-overlay-filesystem-documentation.patch
Normal file
@ -0,0 +1,240 @@
|
|||||||
|
From 4484d918c1b719ae6ee3999c8173077eb7a7864e Mon Sep 17 00:00:00 2001
|
||||||
|
From: Neil Brown <neilb@suse.de>
|
||||||
|
Date: Thu, 27 Jun 2013 16:39:50 +0200
|
||||||
|
Subject: [PATCH 8/9] overlay: overlay filesystem documentation
|
||||||
|
|
||||||
|
Document the overlay filesystem.
|
||||||
|
|
||||||
|
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
---
|
||||||
|
Documentation/filesystems/overlayfs.txt | 199 ++++++++++++++++++++++++++++++++
|
||||||
|
MAINTAINERS | 7 ++
|
||||||
|
2 files changed, 206 insertions(+)
|
||||||
|
create mode 100644 Documentation/filesystems/overlayfs.txt
|
||||||
|
|
||||||
|
diff --git a/Documentation/filesystems/overlayfs.txt b/Documentation/filesystems/overlayfs.txt
|
||||||
|
new file mode 100644
|
||||||
|
index 0000000..00dbab0
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/Documentation/filesystems/overlayfs.txt
|
||||||
|
@@ -0,0 +1,199 @@
|
||||||
|
+Written by: Neil Brown <neilb@suse.de>
|
||||||
|
+
|
||||||
|
+Overlay Filesystem
|
||||||
|
+==================
|
||||||
|
+
|
||||||
|
+This document describes a prototype for a new approach to providing
|
||||||
|
+overlay-filesystem functionality in Linux (sometimes referred to as
|
||||||
|
+union-filesystems). An overlay-filesystem tries to present a
|
||||||
|
+filesystem which is the result over overlaying one filesystem on top
|
||||||
|
+of the other.
|
||||||
|
+
|
||||||
|
+The result will inevitably fail to look exactly like a normal
|
||||||
|
+filesystem for various technical reasons. The expectation is that
|
||||||
|
+many use cases will be able to ignore these differences.
|
||||||
|
+
|
||||||
|
+This approach is 'hybrid' because the objects that appear in the
|
||||||
|
+filesystem do not all appear to belong to that filesystem. In many
|
||||||
|
+cases an object accessed in the union will be indistinguishable
|
||||||
|
+from accessing the corresponding object from the original filesystem.
|
||||||
|
+This is most obvious from the 'st_dev' field returned by stat(2).
|
||||||
|
+
|
||||||
|
+While directories will report an st_dev from the overlay-filesystem,
|
||||||
|
+all non-directory objects will report an st_dev from the lower or
|
||||||
|
+upper filesystem that is providing the object. Similarly st_ino will
|
||||||
|
+only be unique when combined with st_dev, and both of these can change
|
||||||
|
+over the lifetime of a non-directory object. Many applications and
|
||||||
|
+tools ignore these values and will not be affected.
|
||||||
|
+
|
||||||
|
+Upper and Lower
|
||||||
|
+---------------
|
||||||
|
+
|
||||||
|
+An overlay filesystem combines two filesystems - an 'upper' filesystem
|
||||||
|
+and a 'lower' filesystem. When a name exists in both filesystems, the
|
||||||
|
+object in the 'upper' filesystem is visible while the object in the
|
||||||
|
+'lower' filesystem is either hidden or, in the case of directories,
|
||||||
|
+merged with the 'upper' object.
|
||||||
|
+
|
||||||
|
+It would be more correct to refer to an upper and lower 'directory
|
||||||
|
+tree' rather than 'filesystem' as it is quite possible for both
|
||||||
|
+directory trees to be in the same filesystem and there is no
|
||||||
|
+requirement that the root of a filesystem be given for either upper or
|
||||||
|
+lower.
|
||||||
|
+
|
||||||
|
+The lower filesystem can be any filesystem supported by Linux and does
|
||||||
|
+not need to be writable. The lower filesystem can even be another
|
||||||
|
+overlayfs. The upper filesystem will normally be writable and if it
|
||||||
|
+is it must support the creation of trusted.* extended attributes, and
|
||||||
|
+must provide valid d_type in readdir responses, at least for symbolic
|
||||||
|
+links - so NFS is not suitable.
|
||||||
|
+
|
||||||
|
+A read-only overlay of two read-only filesystems may use any
|
||||||
|
+filesystem type.
|
||||||
|
+
|
||||||
|
+Directories
|
||||||
|
+-----------
|
||||||
|
+
|
||||||
|
+Overlaying mainly involves directories. If a given name appears in both
|
||||||
|
+upper and lower filesystems and refers to a non-directory in either,
|
||||||
|
+then the lower object is hidden - the name refers only to the upper
|
||||||
|
+object.
|
||||||
|
+
|
||||||
|
+Where both upper and lower objects are directories, a merged directory
|
||||||
|
+is formed.
|
||||||
|
+
|
||||||
|
+At mount time, the two directories given as mount options are combined
|
||||||
|
+into a merged directory:
|
||||||
|
+
|
||||||
|
+ mount -t overlayfs overlayfs -olowerdir=/lower,upperdir=/upper /overlay
|
||||||
|
+
|
||||||
|
+Then whenever a lookup is requested in such a merged directory, the
|
||||||
|
+lookup is performed in each actual directory and the combined result
|
||||||
|
+is cached in the dentry belonging to the overlay filesystem. If both
|
||||||
|
+actual lookups find directories, both are stored and a merged
|
||||||
|
+directory is created, otherwise only one is stored: the upper if it
|
||||||
|
+exists, else the lower.
|
||||||
|
+
|
||||||
|
+Only the lists of names from directories are merged. Other content
|
||||||
|
+such as metadata and extended attributes are reported for the upper
|
||||||
|
+directory only. These attributes of the lower directory are hidden.
|
||||||
|
+
|
||||||
|
+whiteouts and opaque directories
|
||||||
|
+--------------------------------
|
||||||
|
+
|
||||||
|
+In order to support rm and rmdir without changing the lower
|
||||||
|
+filesystem, an overlay filesystem needs to record in the upper filesystem
|
||||||
|
+that files have been removed. This is done using whiteouts and opaque
|
||||||
|
+directories (non-directories are always opaque).
|
||||||
|
+
|
||||||
|
+The overlay filesystem uses extended attributes with a
|
||||||
|
+"trusted.overlay." prefix to record these details.
|
||||||
|
+
|
||||||
|
+A whiteout is created as a symbolic link with target
|
||||||
|
+"(overlay-whiteout)" and with xattr "trusted.overlay.whiteout" set to "y".
|
||||||
|
+When a whiteout is found in the upper level of a merged directory, any
|
||||||
|
+matching name in the lower level is ignored, and the whiteout itself
|
||||||
|
+is also hidden.
|
||||||
|
+
|
||||||
|
+A directory is made opaque by setting the xattr "trusted.overlay.opaque"
|
||||||
|
+to "y". Where the upper filesystem contains an opaque directory, any
|
||||||
|
+directory in the lower filesystem with the same name is ignored.
|
||||||
|
+
|
||||||
|
+readdir
|
||||||
|
+-------
|
||||||
|
+
|
||||||
|
+When a 'readdir' request is made on a merged directory, the upper and
|
||||||
|
+lower directories are each read and the name lists merged in the
|
||||||
|
+obvious way (upper is read first, then lower - entries that already
|
||||||
|
+exist are not re-added). This merged name list is cached in the
|
||||||
|
+'struct file' and so remains as long as the file is kept open. If the
|
||||||
|
+directory is opened and read by two processes at the same time, they
|
||||||
|
+will each have separate caches. A seekdir to the start of the
|
||||||
|
+directory (offset 0) followed by a readdir will cause the cache to be
|
||||||
|
+discarded and rebuilt.
|
||||||
|
+
|
||||||
|
+This means that changes to the merged directory do not appear while a
|
||||||
|
+directory is being read. This is unlikely to be noticed by many
|
||||||
|
+programs.
|
||||||
|
+
|
||||||
|
+seek offsets are assigned sequentially when the directories are read.
|
||||||
|
+Thus if
|
||||||
|
+ - read part of a directory
|
||||||
|
+ - remember an offset, and close the directory
|
||||||
|
+ - re-open the directory some time later
|
||||||
|
+ - seek to the remembered offset
|
||||||
|
+
|
||||||
|
+there may be little correlation between the old and new locations in
|
||||||
|
+the list of filenames, particularly if anything has changed in the
|
||||||
|
+directory.
|
||||||
|
+
|
||||||
|
+Readdir on directories that are not merged is simply handled by the
|
||||||
|
+underlying directory (upper or lower).
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+Non-directories
|
||||||
|
+---------------
|
||||||
|
+
|
||||||
|
+Objects that are not directories (files, symlinks, device-special
|
||||||
|
+files etc.) are presented either from the upper or lower filesystem as
|
||||||
|
+appropriate. When a file in the lower filesystem is accessed in a way
|
||||||
|
+the requires write-access, such as opening for write access, changing
|
||||||
|
+some metadata etc., the file is first copied from the lower filesystem
|
||||||
|
+to the upper filesystem (copy_up). Note that creating a hard-link
|
||||||
|
+also requires copy_up, though of course creation of a symlink does
|
||||||
|
+not.
|
||||||
|
+
|
||||||
|
+The copy_up may turn out to be unnecessary, for example if the file is
|
||||||
|
+opened for read-write but the data is not modified.
|
||||||
|
+
|
||||||
|
+The copy_up process first makes sure that the containing directory
|
||||||
|
+exists in the upper filesystem - creating it and any parents as
|
||||||
|
+necessary. It then creates the object with the same metadata (owner,
|
||||||
|
+mode, mtime, symlink-target etc.) and then if the object is a file, the
|
||||||
|
+data is copied from the lower to the upper filesystem. Finally any
|
||||||
|
+extended attributes are copied up.
|
||||||
|
+
|
||||||
|
+Once the copy_up is complete, the overlay filesystem simply
|
||||||
|
+provides direct access to the newly created file in the upper
|
||||||
|
+filesystem - future operations on the file are barely noticed by the
|
||||||
|
+overlay filesystem (though an operation on the name of the file such as
|
||||||
|
+rename or unlink will of course be noticed and handled).
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+Non-standard behavior
|
||||||
|
+---------------------
|
||||||
|
+
|
||||||
|
+The copy_up operation essentially creates a new, identical file and
|
||||||
|
+moves it over to the old name. The new file may be on a different
|
||||||
|
+filesystem, so both st_dev and st_ino of the file may change.
|
||||||
|
+
|
||||||
|
+Any open files referring to this inode will access the old data and
|
||||||
|
+metadata. Similarly any file locks obtained before copy_up will not
|
||||||
|
+apply to the copied up file.
|
||||||
|
+
|
||||||
|
+On a file opened with O_RDONLY fchmod(2), fchown(2), futimesat(2) and
|
||||||
|
+fsetxattr(2) will fail with EROFS.
|
||||||
|
+
|
||||||
|
+If a file with multiple hard links is copied up, then this will
|
||||||
|
+"break" the link. Changes will not be propagated to other names
|
||||||
|
+referring to the same inode.
|
||||||
|
+
|
||||||
|
+Symlinks in /proc/PID/ and /proc/PID/fd which point to a non-directory
|
||||||
|
+object in overlayfs will not contain valid absolute paths, only
|
||||||
|
+relative paths leading up to the filesystem's root. This will be
|
||||||
|
+fixed in the future.
|
||||||
|
+
|
||||||
|
+Some operations are not atomic, for example a crash during copy_up or
|
||||||
|
+rename will leave the filesystem in an inconsistent state. This will
|
||||||
|
+be addressed in the future.
|
||||||
|
+
|
||||||
|
+Changes to underlying filesystems
|
||||||
|
+---------------------------------
|
||||||
|
+
|
||||||
|
+Offline changes, when the overlay is not mounted, are allowed to either
|
||||||
|
+the upper or the lower trees.
|
||||||
|
+
|
||||||
|
+Changes to the underlying filesystems while part of a mounted overlay
|
||||||
|
+filesystem are not allowed. If the underlying filesystem is changed,
|
||||||
|
+the behavior of the overlay is undefined, though it will not result in
|
||||||
|
+a crash or deadlock.
|
||||||
|
diff --git a/MAINTAINERS b/MAINTAINERS
|
||||||
|
index 5be702c..8911997 100644
|
||||||
|
--- a/MAINTAINERS
|
||||||
|
+++ b/MAINTAINERS
|
||||||
|
@@ -6019,6 +6019,13 @@ F: drivers/scsi/osd/
|
||||||
|
F: include/scsi/osd_*
|
||||||
|
F: fs/exofs/
|
||||||
|
|
||||||
|
+OVERLAYFS FILESYSTEM
|
||||||
|
+M: Miklos Szeredi <miklos@szeredi.hu>
|
||||||
|
+L: linux-fsdevel@vger.kernel.org
|
||||||
|
+S: Supported
|
||||||
|
+F: fs/overlayfs/*
|
||||||
|
+F: Documentation/filesystems/overlayfs.txt
|
||||||
|
+
|
||||||
|
P54 WIRELESS DRIVER
|
||||||
|
M: Christian Lamparter <chunkeey@googlemail.com>
|
||||||
|
L: linux-wireless@vger.kernel.org
|
||||||
|
--
|
||||||
|
1.8.3.2
|
||||||
|
|
94
0009-fs-limit-filesystem-stacking-depth.patch
Normal file
94
0009-fs-limit-filesystem-stacking-depth.patch
Normal file
@ -0,0 +1,94 @@
|
|||||||
|
From 094e2fc56d5a0dd9d5c579e08bd4df3013bb171a Mon Sep 17 00:00:00 2001
|
||||||
|
From: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
Date: Thu, 27 Jun 2013 16:39:50 +0200
|
||||||
|
Subject: [PATCH 9/9] fs: limit filesystem stacking depth
|
||||||
|
|
||||||
|
Add a simple read-only counter to super_block that indicates deep this
|
||||||
|
is in the stack of filesystems. Previously ecryptfs was the only
|
||||||
|
stackable filesystem and it explicitly disallowed multiple layers of
|
||||||
|
itself.
|
||||||
|
|
||||||
|
Overlayfs, however, can be stacked recursively and also may be stacked
|
||||||
|
on top of ecryptfs or vice versa.
|
||||||
|
|
||||||
|
To limit the kernel stack usage we must limit the depth of the
|
||||||
|
filesystem stack. Initially the limit is set to 2.
|
||||||
|
|
||||||
|
Signed-off-by: Miklos Szeredi <mszeredi@suse.cz>
|
||||||
|
---
|
||||||
|
fs/ecryptfs/main.c | 7 +++++++
|
||||||
|
fs/overlayfs/super.c | 10 ++++++++++
|
||||||
|
include/linux/fs.h | 11 +++++++++++
|
||||||
|
3 files changed, 28 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/fs/ecryptfs/main.c b/fs/ecryptfs/main.c
|
||||||
|
index e924cf4..8b0957e 100644
|
||||||
|
--- a/fs/ecryptfs/main.c
|
||||||
|
+++ b/fs/ecryptfs/main.c
|
||||||
|
@@ -567,6 +567,13 @@ static struct dentry *ecryptfs_mount(struct file_system_type *fs_type, int flags
|
||||||
|
s->s_maxbytes = path.dentry->d_sb->s_maxbytes;
|
||||||
|
s->s_blocksize = path.dentry->d_sb->s_blocksize;
|
||||||
|
s->s_magic = ECRYPTFS_SUPER_MAGIC;
|
||||||
|
+ s->s_stack_depth = path.dentry->d_sb->s_stack_depth + 1;
|
||||||
|
+
|
||||||
|
+ rc = -EINVAL;
|
||||||
|
+ if (s->s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH) {
|
||||||
|
+ pr_err("eCryptfs: maximum fs stacking depth exceeded\n");
|
||||||
|
+ goto out_free;
|
||||||
|
+ }
|
||||||
|
|
||||||
|
inode = ecryptfs_get_inode(path.dentry->d_inode, s);
|
||||||
|
rc = PTR_ERR(inode);
|
||||||
|
diff --git a/fs/overlayfs/super.c b/fs/overlayfs/super.c
|
||||||
|
index 066ea5a..9473e79 100644
|
||||||
|
--- a/fs/overlayfs/super.c
|
||||||
|
+++ b/fs/overlayfs/super.c
|
||||||
|
@@ -570,6 +570,16 @@ static int ovl_fill_super(struct super_block *sb, void *data, int silent)
|
||||||
|
}
|
||||||
|
ufs->lower_namelen = statfs.f_namelen;
|
||||||
|
|
||||||
|
+ sb->s_stack_depth = max(upperpath.mnt->mnt_sb->s_stack_depth,
|
||||||
|
+ lowerpath.mnt->mnt_sb->s_stack_depth) + 1;
|
||||||
|
+
|
||||||
|
+ err = -EINVAL;
|
||||||
|
+ if (sb->s_stack_depth > FILESYSTEM_MAX_STACK_DEPTH) {
|
||||||
|
+ pr_err("overlayfs: maximum fs stacking depth exceeded\n");
|
||||||
|
+ goto out_put_lowerpath;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+
|
||||||
|
ufs->upper_mnt = clone_private_mount(&upperpath);
|
||||||
|
err = PTR_ERR(ufs->upper_mnt);
|
||||||
|
if (IS_ERR(ufs->upper_mnt)) {
|
||||||
|
diff --git a/include/linux/fs.h b/include/linux/fs.h
|
||||||
|
index 8a6752b..72d04f8 100644
|
||||||
|
--- a/include/linux/fs.h
|
||||||
|
+++ b/include/linux/fs.h
|
||||||
|
@@ -244,6 +244,12 @@ struct iattr {
|
||||||
|
*/
|
||||||
|
#include <linux/quota.h>
|
||||||
|
|
||||||
|
+/*
|
||||||
|
+ * Maximum number of layers of fs stack. Needs to be limited to
|
||||||
|
+ * prevent kernel stack overflow
|
||||||
|
+ */
|
||||||
|
+#define FILESYSTEM_MAX_STACK_DEPTH 2
|
||||||
|
+
|
||||||
|
/**
|
||||||
|
* enum positive_aop_returns - aop return codes with specific semantics
|
||||||
|
*
|
||||||
|
@@ -1322,6 +1328,11 @@ struct super_block {
|
||||||
|
|
||||||
|
/* Being remounted read-only */
|
||||||
|
int s_readonly_remount;
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Indicates how deep in a filesystem stack this SB is
|
||||||
|
+ */
|
||||||
|
+ int s_stack_depth;
|
||||||
|
};
|
||||||
|
|
||||||
|
/* superblock cache pruning functions */
|
||||||
|
--
|
||||||
|
1.8.3.2
|
||||||
|
|
@ -1,2 +1,7 @@
|
|||||||
# kernel
|
# kernel
|
||||||
|
|
||||||
|
The Linux Kernel, the operating system core itself.
|
||||||
|
The kernel package contains the Linux kernel (vmlinuz), the operating system core itself.
|
||||||
|
The kernel handles the basic functions of the operating system: memory allocation, process allocation, device input and output, etc.
|
||||||
|
This is the source package used to build kernel for different architectures and targets.
|
||||||
|
|
||||||
|
12
kernel-2.6.19-hda_snd_intel-null_pointer.patch
Normal file
12
kernel-2.6.19-hda_snd_intel-null_pointer.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -Nru kernel-2.6.19mamba.orig/sound/pci/hda/hda_generic.c kernel-2.6.19mamba/sound/pci/hda/hda_generic.c
|
||||||
|
--- kernel-2.6.19mamba.orig/sound/pci/hda/hda_generic.c 2006-11-29 22:57:37.000000000 +0100
|
||||||
|
+++ kernel-2.6.19mamba/sound/pci/hda/hda_generic.c 2007-01-02 17:32:42.000000000 +0100
|
||||||
|
@@ -485,7 +485,7 @@
|
||||||
|
return "Front Aux";
|
||||||
|
return "Aux";
|
||||||
|
case AC_JACK_MIC_IN:
|
||||||
|
- if (node->pin_caps &
|
||||||
|
+ if (pinctl && node->pin_caps &
|
||||||
|
(AC_PINCAP_VREF_80 << AC_PINCAP_VREF_SHIFT))
|
||||||
|
*pinctl |= AC_PINCTL_VREF_80;
|
||||||
|
if ((location & 0x0f) == AC_JACK_LOC_FRONT)
|
11
kernel-2.6.20-freezer.patch
Normal file
11
kernel-2.6.20-freezer.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
diff -Nru kernel-2.6.19mamba.orig/drivers/video/vesafb-thread.c kernel-2.6.19mamba/drivers/video/vesafb-thread.c
|
||||||
|
--- kernel-2.6.19mamba.orig/drivers/video/vesafb-thread.c 2006-12-05 15:52:43.000000000 +0100
|
||||||
|
+++ kernel-2.6.19mamba/drivers/video/vesafb-thread.c 2006-12-05 15:55:24.000000000 +0100
|
||||||
|
@@ -16,6 +16,7 @@
|
||||||
|
#include <linux/delay.h>
|
||||||
|
#include <linux/signal.h>
|
||||||
|
#include <linux/suspend.h>
|
||||||
|
+#include <linux/freezer.h>
|
||||||
|
#include <linux/unistd.h>
|
||||||
|
#include <video/vesa.h>
|
||||||
|
#include <video/edid.h>
|
22
kernel-2.6.21-VT3351_disable_msi.patch
Normal file
22
kernel-2.6.21-VT3351_disable_msi.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c
|
||||||
|
--- a/drivers/pci/quirks.c
|
||||||
|
+++ b/drivers/pci/quirks.c
|
||||||
|
@@ -1751,6 +1751,7 @@ static void __init quirk_disable_all_msi(struct pci_dev *dev)
|
||||||
|
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_SERVERWORKS, PCI_DEVICE_ID_SERVERWORKS_GCNB_LE, quirk_disable_all_msi);
|
||||||
|
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS400_200, quirk_disable_all_msi);
|
||||||
|
DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_ATI, PCI_DEVICE_ID_ATI_RS480, quirk_disable_all_msi);
|
||||||
|
+DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_VIA, PCI_DEVICE_ID_VIA_VT3351, quirk_disable_all_msi);
|
||||||
|
|
||||||
|
/* Disable MSI on chipsets that are known to not support it */
|
||||||
|
static void __devinit quirk_disable_msi(struct pci_dev *dev)
|
||||||
|
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
|
||||||
|
--- a/include/linux/pci_ids.h
|
||||||
|
+++ b/include/linux/pci_ids.h
|
||||||
|
@@ -1287,6 +1287,7 @@
|
||||||
|
#define PCI_DEVICE_ID_VIA_P4M800CE 0x0314
|
||||||
|
#define PCI_DEVICE_ID_VIA_P4M890 0x0327
|
||||||
|
#define PCI_DEVICE_ID_VIA_VT3336 0x0336
|
||||||
|
+#define PCI_DEVICE_ID_VIA_VT3351 0x0351
|
||||||
|
#define PCI_DEVICE_ID_VIA_8371_0 0x0391
|
||||||
|
#define PCI_DEVICE_ID_VIA_8501_0 0x0501
|
||||||
|
#define PCI_DEVICE_ID_VIA_82C561 0x0561
|
21
kernel-2.6.21-kvm_wbinvd.patch
Normal file
21
kernel-2.6.21-kvm_wbinvd.patch
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
diff -Nru kernel-2.6.21mamba.orig/drivers/kvm/x86_emulate.c kernel-2.6.21mamba/drivers/kvm/x86_emulate.c
|
||||||
|
--- kernel-2.6.21mamba.orig/drivers/kvm/x86_emulate.c 2007-04-26 05:08:32.000000000 +0200
|
||||||
|
+++ kernel-2.6.21mamba/drivers/kvm/x86_emulate.c 2007-06-05 03:40:34.000000000 +0200
|
||||||
|
@@ -152,7 +152,7 @@
|
||||||
|
static u16 twobyte_table[256] = {
|
||||||
|
/* 0x00 - 0x0F */
|
||||||
|
0, SrcMem | ModRM | DstReg, 0, 0, 0, 0, ImplicitOps, 0,
|
||||||
|
- 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0,
|
||||||
|
+ 0, ImplicitOps, 0, 0, 0, ImplicitOps | ModRM, 0, 0,
|
||||||
|
/* 0x10 - 0x1F */
|
||||||
|
0, 0, 0, 0, 0, 0, 0, 0, ImplicitOps | ModRM, 0, 0, 0, 0, 0, 0, 0,
|
||||||
|
/* 0x20 - 0x2F */
|
||||||
|
@@ -1303,6 +1303,8 @@
|
||||||
|
/* Disable writeback. */
|
||||||
|
dst.orig_val = dst.val;
|
||||||
|
switch (b) {
|
||||||
|
+ case 0x09: /* wbinvd */
|
||||||
|
+ break;
|
||||||
|
case 0x0d: /* GrpP (prefetch) */
|
||||||
|
case 0x18: /* Grp16 (prefetch/nop) */
|
||||||
|
break;
|
26
kernel-2.6.22-ppc_PM_NEEDS_RTC_LIB.patch
Normal file
26
kernel-2.6.22-ppc_PM_NEEDS_RTC_LIB.patch
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
--- linux-2.6.orig/arch/powerpc/Kconfig 2007-03-19 11:47:27.422413925 +0100
|
||||||
|
+++ linux-2.6/arch/powerpc/Kconfig 2007-03-19 11:47:37.512413925 +0100
|
||||||
|
@@ -11,6 +11,11 @@ config PPC64
|
||||||
|
This option selects whether a 32-bit or a 64-bit kernel
|
||||||
|
will be built.
|
||||||
|
|
||||||
|
+config PPC_PM_NEEDS_RTC_LIB
|
||||||
|
+ bool
|
||||||
|
+ select RTC_LIB
|
||||||
|
+ default y if PM
|
||||||
|
+
|
||||||
|
config PPC32
|
||||||
|
bool
|
||||||
|
default y if !PPC64
|
||||||
|
--- linux-2.6.orig/arch/powerpc/sysdev/Makefile 2007-03-19 11:47:27.532413925 +0100
|
||||||
|
+++ linux-2.6/arch/powerpc/sysdev/Makefile 2007-03-19 11:47:37.512413925 +0100
|
||||||
|
@@ -14,6 +14,9 @@ obj-$(CONFIG_FSL_SOC) += fsl_soc.o
|
||||||
|
obj-$(CONFIG_TSI108_BRIDGE) += tsi108_pci.o tsi108_dev.o
|
||||||
|
obj-$(CONFIG_QUICC_ENGINE) += qe_lib/
|
||||||
|
|
||||||
|
+# contains only the suspend handler for time
|
||||||
|
+obj-$(CONFIG_PM) += timer.o
|
||||||
|
+
|
||||||
|
ifeq ($(CONFIG_PPC_MERGE),y)
|
||||||
|
obj-$(CONFIG_PPC_I8259) += i8259.o
|
||||||
|
obj-$(CONFIG_PPC_83xx) += ipic.o
|
10
kernel-2.6.22-ppc_export_vgacon_remap_base.patch
Normal file
10
kernel-2.6.22-ppc_export_vgacon_remap_base.patch
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
--- 1.53/arch/ppc/kernel/setup.c Thu Feb 19 05:42:24 2004
|
||||||
|
+++ edited/arch/ppc/kernel/setup.c Wed Apr 28 14:27:12 2004
|
||||||
|
@@ -83,6 +83,7 @@
|
||||||
|
|
||||||
|
#ifdef CONFIG_VGA_CONSOLE
|
||||||
|
unsigned long vgacon_remap_base;
|
||||||
|
+EXPORT_SYMBOL(vgacon_remap_base);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
struct machdep_calls ppc_md;
|
10
kernel-2.6.26-atl1_disable_TSO.patch
Normal file
10
kernel-2.6.26-atl1_disable_TSO.patch
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
--- a/drivers/net/atlx/atl1.c 2008-09-29 04:19:40.000000000 +0200
|
||||||
|
+++ b/drivers/net/atlx/atl1.c 2008-09-29 04:19:47.000000000 +0200
|
||||||
|
@@ -3019,7 +3019,6 @@
|
||||||
|
netdev->features = NETIF_F_HW_CSUM;
|
||||||
|
netdev->features |= NETIF_F_SG;
|
||||||
|
netdev->features |= (NETIF_F_HW_VLAN_TX | NETIF_F_HW_VLAN_RX);
|
||||||
|
- netdev->features |= NETIF_F_TSO;
|
||||||
|
netdev->features |= NETIF_F_LLTX;
|
||||||
|
|
||||||
|
/*
|
21
kernel-2.6.26-fglrx_disable_gpl_check.patch
Normal file
21
kernel-2.6.26-fglrx_disable_gpl_check.patch
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
--- kernel-2.6.26mamba.orig/kernel/rcupreempt.c 2008-07-13 23:51:29.000000000 +0200
|
||||||
|
+++ kernel-2.6.26mamba/kernel/rcupreempt.c 2008-09-15 01:42:19.000000000 +0200
|
||||||
|
@@ -281,7 +281,7 @@
|
||||||
|
local_irq_restore(flags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-EXPORT_SYMBOL_GPL(__rcu_read_lock);
|
||||||
|
+EXPORT_SYMBOL(__rcu_read_lock);
|
||||||
|
|
||||||
|
void __rcu_read_unlock(void)
|
||||||
|
{
|
||||||
|
@@ -351,7 +351,7 @@
|
||||||
|
local_irq_restore(flags);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-EXPORT_SYMBOL_GPL(__rcu_read_unlock);
|
||||||
|
+EXPORT_SYMBOL(__rcu_read_unlock);
|
||||||
|
|
||||||
|
/*
|
||||||
|
* If a global counter flip has occurred since the last time that we
|
||||||
|
|
10
kernel-2.6.26-snd_hda_intel_zepto.patch
Normal file
10
kernel-2.6.26-snd_hda_intel_zepto.patch
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
--- kernel-2.6.26mamba.orig/sound/pci/hda/patch_realtek.c 2008-09-14 18:32:30.000000000 +0200
|
||||||
|
+++ kernel-2.6.26mamba/sound/pci/hda/patch_realtek.c 2008-09-14 18:35:32.000000000 +0200
|
||||||
|
@@ -10516,6 +10516,7 @@
|
||||||
|
SND_PCI_QUIRK(0x14c0, 0x0025, "COMPAL IFL90/JFL-92", ALC268_TOSHIBA),
|
||||||
|
SND_PCI_QUIRK(0x152d, 0x0763, "Diverse (CPR2000)", ALC268_ACER),
|
||||||
|
SND_PCI_QUIRK(0x152d, 0x0771, "Quanta IL1", ALC267_QUANTA_IL1),
|
||||||
|
+ SND_PCI_QUIRK(0x14c0, 0x0026, "Compal (ZEPTO)", ALC268_ZEPTO),
|
||||||
|
SND_PCI_QUIRK(0x1170, 0x0040, "ZEPTO", ALC268_ZEPTO),
|
||||||
|
{}
|
||||||
|
};
|
13
kernel-2.6.28.10-MSG_PEEK_race_msg.patch
Normal file
13
kernel-2.6.28.10-MSG_PEEK_race_msg.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c
|
||||||
|
index 1d7f49c..ccbd69b 100644
|
||||||
|
--- a/net/ipv4/tcp.c
|
||||||
|
+++ b/net/ipv4/tcp.c
|
||||||
|
@@ -1532,7 +1532,7 @@ do_prequeue:
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- if ((flags & MSG_PEEK) && peek_seq != tp->copied_seq) {
|
||||||
|
+ if ((flags & MSG_PEEK) && (peek_seq - copied != tp->copied_seq)) {
|
||||||
|
if (net_ratelimit())
|
||||||
|
printk(KERN_DEBUG "TCP(%s:%d): Application bug, race in MSG_PEEK.\n",
|
||||||
|
current->comm, task_pid_nr(current));
|
11
kernel-2.6.30-fglrx_flush_tlb_page.patch
Normal file
11
kernel-2.6.30-fglrx_flush_tlb_page.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- arch/x86/mm/tlb.c~ 2009-02-21 19:00:33.000000000 +0100
|
||||||
|
+++ arch/x86/mm/tlb.c 2009-02-21 19:01:01.000000000 +0100
|
||||||
|
@@ -268,6 +268,8 @@
|
||||||
|
|
||||||
|
preempt_enable();
|
||||||
|
}
|
||||||
|
+/* Missing flush_tlb_page error fix */
|
||||||
|
+EXPORT_SYMBOL(flush_tlb_page);
|
||||||
|
|
||||||
|
static void do_flush_tlb_all(void *info)
|
||||||
|
{
|
33
kernel-2.6.30-wmi_fix.patch
Normal file
33
kernel-2.6.30-wmi_fix.patch
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
diff --git a/drivers/platform/x86/wmi.c b/drivers/platform/x86/wmi.c
|
||||||
|
index 21aa70a..d03e30a 100644
|
||||||
|
--- a/drivers/platform/x86/wmi.c
|
||||||
|
+++ b/drivers/platform/x86/wmi.c
|
||||||
|
@@ -299,7 +299,7 @@ u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
|
||||||
|
acpi_status status;
|
||||||
|
struct acpi_object_list input;
|
||||||
|
union acpi_object params[3];
|
||||||
|
- char method[4] = "WM";
|
||||||
|
+ char method[5] = "WM";
|
||||||
|
|
||||||
|
if (!find_guid(guid_string, &wblock))
|
||||||
|
return AE_ERROR;
|
||||||
|
@@ -357,8 +357,8 @@ struct acpi_buffer *out)
|
||||||
|
acpi_status status, wc_status = AE_ERROR;
|
||||||
|
struct acpi_object_list input, wc_input;
|
||||||
|
union acpi_object wc_params[1], wq_params[1];
|
||||||
|
- char method[4];
|
||||||
|
- char wc_method[4] = "WC";
|
||||||
|
+ char method[5];
|
||||||
|
+ char wc_method[5] = "WC";
|
||||||
|
|
||||||
|
if (!guid_string || !out)
|
||||||
|
return AE_BAD_PARAMETER;
|
||||||
|
@@ -439,7 +439,7 @@ const struct acpi_buffer *in)
|
||||||
|
acpi_handle handle;
|
||||||
|
struct acpi_object_list input;
|
||||||
|
union acpi_object params[2];
|
||||||
|
- char method[4] = "WS";
|
||||||
|
+ char method[5] = "WS";
|
||||||
|
|
||||||
|
if (!guid_string || !in)
|
||||||
|
return AE_BAD_DATA;
|
11
kernel-2.6.33-dns_resolve_include.patch
Normal file
11
kernel-2.6.33-dns_resolve_include.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- kernel-2.6.33mamba-ppc.orig/fs/cifs/dns_resolve.h 2010-08-16 22:56:17.470128075 +0200
|
||||||
|
+++ kernel-2.6.33mamba-ppc/fs/cifs/dns_resolve.h 2010-08-16 22:52:41.522253342 +0200
|
||||||
|
@@ -23,6 +23,8 @@
|
||||||
|
#ifndef _DNS_RESOLVE_H
|
||||||
|
#define _DNS_RESOLVE_H
|
||||||
|
|
||||||
|
+#include <linux/module.h>
|
||||||
|
+
|
||||||
|
#ifdef __KERNEL__
|
||||||
|
extern int __init cifs_init_dns_resolver(void);
|
||||||
|
extern void cifs_exit_dns_resolver(void);
|
80
kernel-2.6.33-fix_dependence_for_intel_agp_module.patch
Normal file
80
kernel-2.6.33-fix_dependence_for_intel_agp_module.patch
Normal file
@ -0,0 +1,80 @@
|
|||||||
|
From 3d1c7b93431f07c10c22cd09ab6c676841c6c69b Mon Sep 17 00:00:00 2001
|
||||||
|
From: Zhenyu Wang <zhenyuw@linux.intel.com>
|
||||||
|
Date: Tue, 23 Feb 2010 13:58:40 +0800
|
||||||
|
Subject: [PATCH] drm/i915: fix dependence for intel agp module
|
||||||
|
|
||||||
|
See http://bugzilla.kernel.org/show_bug.cgi?id=15021
|
||||||
|
|
||||||
|
This one trys to ensure the module dependence with drm/i915
|
||||||
|
on intel_agp module by using a exported symbol. Because intel_agp
|
||||||
|
is a subdriver for agp, so the required dependence isn't built
|
||||||
|
with i915 subdriver for drm. I hope this is not too strange..
|
||||||
|
|
||||||
|
Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
|
||||||
|
---
|
||||||
|
drivers/char/agp/intel-agp.c | 10 ++++++++--
|
||||||
|
drivers/gpu/drm/i915/i915_drv.c | 6 ++++++
|
||||||
|
2 files changed, 14 insertions(+), 2 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/char/agp/intel-agp.c b/drivers/char/agp/intel-agp.c
|
||||||
|
index e5ffefe..c921ee2 100644
|
||||||
|
--- a/drivers/char/agp/intel-agp.c
|
||||||
|
+++ b/drivers/char/agp/intel-agp.c
|
||||||
|
@@ -10,6 +10,9 @@
|
||||||
|
#include <linux/agp_backend.h>
|
||||||
|
#include "agp.h"
|
||||||
|
|
||||||
|
+int intel_agp_enabled;
|
||||||
|
+EXPORT_SYMBOL(intel_agp_enabled);
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* If we have Intel graphics, we're not going to have anything other than
|
||||||
|
* an Intel IOMMU. So make the correct use of the PCI DMA API contingent
|
||||||
|
@@ -2378,7 +2381,7 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
|
||||||
|
struct agp_bridge_data *bridge;
|
||||||
|
u8 cap_ptr = 0;
|
||||||
|
struct resource *r;
|
||||||
|
- int i;
|
||||||
|
+ int i, err;
|
||||||
|
|
||||||
|
cap_ptr = pci_find_capability(pdev, PCI_CAP_ID_AGP);
|
||||||
|
|
||||||
|
@@ -2470,7 +2473,10 @@ static int __devinit agp_intel_probe(struct pci_dev *pdev,
|
||||||
|
}
|
||||||
|
|
||||||
|
pci_set_drvdata(pdev, bridge);
|
||||||
|
- return agp_add_bridge(bridge);
|
||||||
|
+ err = agp_add_bridge(bridge);
|
||||||
|
+ if (!err)
|
||||||
|
+ intel_agp_enabled = 1;
|
||||||
|
+ return err;
|
||||||
|
}
|
||||||
|
|
||||||
|
static void __devexit agp_intel_remove(struct pci_dev *pdev)
|
||||||
|
diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c
|
||||||
|
index cf4cb3e..48ae2c2 100644
|
||||||
|
--- a/drivers/gpu/drm/i915/i915_drv.c
|
||||||
|
+++ b/drivers/gpu/drm/i915/i915_drv.c
|
||||||
|
@@ -49,6 +49,7 @@ unsigned int i915_lvds_downclock = 0;
|
||||||
|
module_param_named(lvds_downclock, i915_lvds_downclock, int, 0400);
|
||||||
|
|
||||||
|
static struct drm_driver driver;
|
||||||
|
+extern int intel_agp_enabled;
|
||||||
|
|
||||||
|
#define INTEL_VGA_DEVICE(id, info) { \
|
||||||
|
.class = PCI_CLASS_DISPLAY_VGA << 8, \
|
||||||
|
@@ -546,6 +547,11 @@ static struct drm_driver driver = {
|
||||||
|
|
||||||
|
static int __init i915_init(void)
|
||||||
|
{
|
||||||
|
+ if (!intel_agp_enabled) {
|
||||||
|
+ DRM_ERROR("drm/i915 can't work without intel_agp module!\n");
|
||||||
|
+ return -ENODEV;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
driver.num_ioctls = i915_max_ioctl;
|
||||||
|
|
||||||
|
i915_gem_shrinker_init();
|
||||||
|
--
|
||||||
|
1.6.3.3
|
||||||
|
|
11
kernel-2.6.33-lzo_decompressor_fix.patch
Normal file
11
kernel-2.6.33-lzo_decompressor_fix.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- a/usr/Kconfig
|
||||||
|
+++ b/usr/Kconfig
|
||||||
|
@@ -75,7 +75,7 @@ config RD_LZMA
|
||||||
|
config RD_LZO
|
||||||
|
bool "Support initial ramdisks compressed using LZO" if EMBEDDED
|
||||||
|
default !EMBEDDED
|
||||||
|
- depends on BLK_DEV_INITRD
|
||||||
|
+ depends on BLK_DEV_INITRD && HAVE_KERNEL_LZO
|
||||||
|
select DECOMPRESS_LZO
|
||||||
|
help
|
||||||
|
Support loading of a LZO encoded initial ramdisk or cpio buffer
|
21
kernel-2.6.33-tpm_calc_ordinal_duration.patch
Normal file
21
kernel-2.6.33-tpm_calc_ordinal_duration.patch
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
--- kernel-2.6.33mamba/drivers/char/tpm/tpm.c.orig 2010-09-29 22:17:07.000000000 +0200
|
||||||
|
+++ kernel-2.6.33mamba/drivers/char/tpm/tpm.c 2010-09-29 22:22:55.000000000 +0200
|
||||||
|
@@ -353,12 +353,14 @@ unsigned long tpm_calc_ordinal_duration(
|
||||||
|
tpm_protected_ordinal_duration[ordinal &
|
||||||
|
TPM_PROTECTED_ORDINAL_MASK];
|
||||||
|
|
||||||
|
- if (duration_idx != TPM_UNDEFINED)
|
||||||
|
+ if (duration_idx != TPM_UNDEFINED) {
|
||||||
|
duration = chip->vendor.duration[duration_idx];
|
||||||
|
- if (duration <= 0)
|
||||||
|
+ /* if duration is 0, it's because chip->vendor.duration wasn't */
|
||||||
|
+ /* filled yet, so we set the lowest timeout just to give enough */
|
||||||
|
+ /* time to tpm_get_timeouts() succeed */
|
||||||
|
+ return (duration <= 0 ? HZ : duration);
|
||||||
|
+ } else
|
||||||
|
return 2 * 60 * HZ;
|
||||||
|
- else
|
||||||
|
- return duration;
|
||||||
|
}
|
||||||
|
EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration);
|
||||||
|
|
44
kernel-2.6.33.5-squashfs-fixes.patch
Normal file
44
kernel-2.6.33.5-squashfs-fixes.patch
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
diff -Nru kernel-2.6.33mamba.orig//include/linux/decompress/unlzo_mm.h kernel-2.6.33mamba/include/linux/decompress/unlzo_mm.h
|
||||||
|
--- kernel-2.6.33mamba.orig//include/linux/decompress/unlzo_mm.h 1970-01-01 01:00:00.000000000 +0100
|
||||||
|
+++ kernel-2.6.33mamba/include/linux/decompress/unlzo_mm.h 2010-07-03 20:40:21.186641845 +0200
|
||||||
|
@@ -0,0 +1,20 @@
|
||||||
|
+#ifndef UNLZO_MM_H
|
||||||
|
+#define UNLZO_MM_H
|
||||||
|
+
|
||||||
|
+#ifdef STATIC
|
||||||
|
+
|
||||||
|
+/* Code active when included from pre-boot environment: */
|
||||||
|
+#define INIT
|
||||||
|
+
|
||||||
|
+#elif defined(CONFIG_DECOMPRESS_LZO_NEEDED)
|
||||||
|
+
|
||||||
|
+/* Make it available to non initramfs/initrd code */
|
||||||
|
+#define INIT
|
||||||
|
+#include <linux/module.h>
|
||||||
|
+#else
|
||||||
|
+
|
||||||
|
+/* Compile for initramfs/initrd code only */
|
||||||
|
+#define INIT __init
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
diff -Nru kernel-2.6.33mamba.orig//lib/decompress_unlzo.c kernel-2.6.33mamba/lib/decompress_unlzo.c
|
||||||
|
--- kernel-2.6.33mamba.orig//lib/decompress_unlzo.c 2010-02-24 19:52:17.000000000 +0100
|
||||||
|
+++ kernel-2.6.33mamba/lib/decompress_unlzo.c 2010-07-03 20:40:29.169641772 +0200
|
||||||
|
@@ -39,6 +39,7 @@
|
||||||
|
|
||||||
|
#include <linux/types.h>
|
||||||
|
#include <linux/lzo.h>
|
||||||
|
+#include <linux/decompress/unlzo_mm.h>
|
||||||
|
#include <linux/decompress/mm.h>
|
||||||
|
|
||||||
|
#include <linux/compiler.h>
|
||||||
|
@@ -87,7 +88,7 @@
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
-STATIC inline int INIT unlzo(u8 *input, int in_len,
|
||||||
|
+STATIC int INIT unlzo(u8 *input, int in_len,
|
||||||
|
int (*fill) (void *, unsigned int),
|
||||||
|
int (*flush) (void *, unsigned int),
|
||||||
|
u8 *output, int *posp,
|
37
kernel-2.6.33.7-make-3.82.patch
Normal file
37
kernel-2.6.33.7-make-3.82.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
diff --git a/arch/powerpc/Makefile b/arch/powerpc/Makefile
|
||||||
|
index 77cfe7a..ace7a3e 100644
|
||||||
|
--- a/arch/powerpc/Makefile
|
||||||
|
+++ b/arch/powerpc/Makefile
|
||||||
|
@@ -163,9 +163,11 @@ drivers-$(CONFIG_OPROFILE) += arch/powerpc/oprofile/
|
||||||
|
# Default to zImage, override when needed
|
||||||
|
all: zImage
|
||||||
|
|
||||||
|
-BOOT_TARGETS = zImage zImage.initrd uImage zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
|
||||||
|
+# With make 3.82 we cannot mix normal and wildcard targets
|
||||||
|
+BOOT_TARGETS1 := zImage zImage.initrd uImaged
|
||||||
|
+BOOT_TARGETS2 := zImage% dtbImage% treeImage.% cuImage.% simpleImage.%
|
||||||
|
|
||||||
|
-PHONY += $(BOOT_TARGETS)
|
||||||
|
+PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)
|
||||||
|
|
||||||
|
boot := arch/$(ARCH)/boot
|
||||||
|
|
||||||
|
@@ -180,10 +182,16 @@ relocs_check: arch/powerpc/relocs_check.pl vmlinux
|
||||||
|
zImage: relocs_check
|
||||||
|
endif
|
||||||
|
|
||||||
|
-$(BOOT_TARGETS): vmlinux
|
||||||
|
+$(BOOT_TARGETS1): vmlinux
|
||||||
|
+ $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
|
||||||
|
+$(BOOT_TARGETS2): vmlinux
|
||||||
|
+ $(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+bootwrapper_install:
|
||||||
|
$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
|
||||||
|
|
||||||
|
-bootwrapper_install %.dtb:
|
||||||
|
+%.dtb:
|
||||||
|
$(Q)$(MAKE) ARCH=ppc64 $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
|
||||||
|
|
||||||
|
define archhelp
|
219
kernel-2.6.35-006-squashfs_add_lzma.patch
Normal file
219
kernel-2.6.35-006-squashfs_add_lzma.patch
Normal file
@ -0,0 +1,219 @@
|
|||||||
|
From f49e1efdd179d54e814ff2a8e8f469496583062c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Phillip Lougher <phillip@lougher.demon.co.uk>
|
||||||
|
Date: Tue, 20 Oct 2009 10:54:36 +0100
|
||||||
|
Subject: [PATCH] Squashfs: add LZMA compression
|
||||||
|
|
||||||
|
Add support for LZMA compressed filesystems. This is an initial
|
||||||
|
implementation.
|
||||||
|
|
||||||
|
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
|
||||||
|
---
|
||||||
|
fs/squashfs/Kconfig | 5 ++
|
||||||
|
fs/squashfs/Makefile | 1 +
|
||||||
|
fs/squashfs/decompressor.c | 4 +
|
||||||
|
fs/squashfs/lzma_wrapper.c | 151 ++++++++++++++++++++++++++++++++++++++++++++
|
||||||
|
fs/squashfs/squashfs.h | 3 +
|
||||||
|
5 files changed, 164 insertions(+), 0 deletions(-)
|
||||||
|
create mode 100644 fs/squashfs/lzma_wrapper.c
|
||||||
|
|
||||||
|
--- a/fs/squashfs/Kconfig
|
||||||
|
+++ b/fs/squashfs/Kconfig
|
||||||
|
@@ -26,6 +26,11 @@ config SQUASHFS
|
||||||
|
|
||||||
|
If unsure, say N.
|
||||||
|
|
||||||
|
+config SQUASHFS_LZMA
|
||||||
|
+ bool "Include support for LZMA compressed file systems"
|
||||||
|
+ depends on SQUASHFS
|
||||||
|
+ select DECOMPRESS_LZMA
|
||||||
|
+
|
||||||
|
config SQUASHFS_EMBEDDED
|
||||||
|
|
||||||
|
bool "Additional option for memory-constrained systems"
|
||||||
|
--- a/fs/squashfs/Makefile
|
||||||
|
+++ b/fs/squashfs/Makefile
|
||||||
|
@@ -5,5 +5,5 @@
|
||||||
|
obj-$(CONFIG_SQUASHFS) += squashfs.o
|
||||||
|
squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o
|
||||||
|
squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o
|
||||||
|
-squashfs-$(CONFIG_SQUASHFS_XATTRS) += xattr.o xattr_id.o
|
||||||
|
+squashfs-$(CONFIG_SQUASHFS_LZMA) += lzma_wrapper.o
|
||||||
|
|
||||||
|
--- a/fs/squashfs/decompressor.c
|
||||||
|
+++ b/fs/squashfs/decompressor.c
|
||||||
|
@@ -50,7 +50,11 @@ static const struct squashfs_decompresso
|
||||||
|
|
||||||
|
static const struct squashfs_decompressor *decompressor[] = {
|
||||||
|
&squashfs_zlib_comp_ops,
|
||||||
|
+#ifdef CONFIG_SQUASHFS_LZMA
|
||||||
|
+ &squashfs_lzma_comp_ops,
|
||||||
|
+#else
|
||||||
|
&squashfs_lzma_unsupported_comp_ops,
|
||||||
|
+#endif
|
||||||
|
&squashfs_lzo_unsupported_comp_ops,
|
||||||
|
&squashfs_unknown_comp_ops
|
||||||
|
};
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/fs/squashfs/lzma_wrapper.c
|
||||||
|
@@ -0,0 +1,152 @@
|
||||||
|
+/*
|
||||||
|
+ * Squashfs - a compressed read only filesystem for Linux
|
||||||
|
+ *
|
||||||
|
+ * Copyright (c) 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
|
||||||
|
+ * Phillip Lougher <phillip@lougher.demon.co.uk>
|
||||||
|
+ *
|
||||||
|
+ * This program is free software; you can redistribute it and/or
|
||||||
|
+ * modify it under the terms of the GNU General Public License
|
||||||
|
+ * as published by the Free Software Foundation; either version 2,
|
||||||
|
+ * or (at your option) any later version.
|
||||||
|
+ *
|
||||||
|
+ * This program is distributed in the hope that it will be useful,
|
||||||
|
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
+ * GNU General Public License for more details.
|
||||||
|
+ *
|
||||||
|
+ * You should have received a copy of the GNU General Public License
|
||||||
|
+ * along with this program; if not, write to the Free Software
|
||||||
|
+ * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
+ *
|
||||||
|
+ * lzma_wrapper.c
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
+#include <asm/unaligned.h>
|
||||||
|
+#include <linux/buffer_head.h>
|
||||||
|
+#include <linux/mutex.h>
|
||||||
|
+#include <linux/vmalloc.h>
|
||||||
|
+#include <linux/decompress/unlzma.h>
|
||||||
|
+#include <linux/slab.h>
|
||||||
|
+
|
||||||
|
+#include "squashfs_fs.h"
|
||||||
|
+#include "squashfs_fs_sb.h"
|
||||||
|
+#include "squashfs_fs_i.h"
|
||||||
|
+#include "squashfs.h"
|
||||||
|
+#include "decompressor.h"
|
||||||
|
+
|
||||||
|
+struct squashfs_lzma {
|
||||||
|
+ void *input;
|
||||||
|
+ void *output;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+/* decompress_unlzma.c is currently non re-entrant... */
|
||||||
|
+DEFINE_MUTEX(lzma_mutex);
|
||||||
|
+
|
||||||
|
+/* decompress_unlzma.c doesn't provide any context in its callbacks... */
|
||||||
|
+static int lzma_error;
|
||||||
|
+
|
||||||
|
+static void error(char *m)
|
||||||
|
+{
|
||||||
|
+ ERROR("unlzma error: %s\n", m);
|
||||||
|
+ lzma_error = 1;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+static void *lzma_init(struct squashfs_sb_info *msblk)
|
||||||
|
+{
|
||||||
|
+ struct squashfs_lzma *stream = kzalloc(sizeof(*stream), GFP_KERNEL);
|
||||||
|
+ if (stream == NULL)
|
||||||
|
+ goto failed;
|
||||||
|
+ stream->input = vmalloc(msblk->block_size);
|
||||||
|
+ if (stream->input == NULL)
|
||||||
|
+ goto failed;
|
||||||
|
+ stream->output = vmalloc(msblk->block_size);
|
||||||
|
+ if (stream->output == NULL)
|
||||||
|
+ goto failed2;
|
||||||
|
+
|
||||||
|
+ return stream;
|
||||||
|
+
|
||||||
|
+failed2:
|
||||||
|
+ vfree(stream->input);
|
||||||
|
+failed:
|
||||||
|
+ ERROR("failed to allocate lzma workspace\n");
|
||||||
|
+ kfree(stream);
|
||||||
|
+ return NULL;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+static void lzma_free(void *strm)
|
||||||
|
+{
|
||||||
|
+ struct squashfs_lzma *stream = strm;
|
||||||
|
+
|
||||||
|
+ if (stream) {
|
||||||
|
+ vfree(stream->input);
|
||||||
|
+ vfree(stream->output);
|
||||||
|
+ }
|
||||||
|
+ kfree(stream);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+static int lzma_uncompress(struct squashfs_sb_info *msblk, void **buffer,
|
||||||
|
+ struct buffer_head **bh, int b, int offset, int length, int srclength,
|
||||||
|
+ int pages)
|
||||||
|
+{
|
||||||
|
+ struct squashfs_lzma *stream = msblk->stream;
|
||||||
|
+ void *buff = stream->input;
|
||||||
|
+ int avail, i, bytes = length, res;
|
||||||
|
+
|
||||||
|
+ mutex_lock(&lzma_mutex);
|
||||||
|
+
|
||||||
|
+ for (i = 0; i < b; i++) {
|
||||||
|
+ wait_on_buffer(bh[i]);
|
||||||
|
+ if (!buffer_uptodate(bh[i]))
|
||||||
|
+ goto block_release;
|
||||||
|
+
|
||||||
|
+ avail = min(bytes, msblk->devblksize - offset);
|
||||||
|
+ memcpy(buff, bh[i]->b_data + offset, avail);
|
||||||
|
+ buff += avail;
|
||||||
|
+ bytes -= avail;
|
||||||
|
+ offset = 0;
|
||||||
|
+ put_bh(bh[i]);
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ lzma_error = 0;
|
||||||
|
+ res = unlzma(stream->input, length, NULL, NULL, stream->output, NULL,
|
||||||
|
+ error);
|
||||||
|
+ if (res || lzma_error)
|
||||||
|
+ goto failed;
|
||||||
|
+
|
||||||
|
+ /* uncompressed size is stored in the LZMA header (5 byte offset) */
|
||||||
|
+ res = bytes = get_unaligned_le32(stream->input + 5);
|
||||||
|
+ for (i = 0, buff = stream->output; bytes && i < pages; i++) {
|
||||||
|
+ avail = min_t(int, bytes, PAGE_CACHE_SIZE);
|
||||||
|
+ memcpy(buffer[i], buff, avail);
|
||||||
|
+ buff += avail;
|
||||||
|
+ bytes -= avail;
|
||||||
|
+ }
|
||||||
|
+ if (bytes)
|
||||||
|
+ goto failed;
|
||||||
|
+
|
||||||
|
+ mutex_unlock(&lzma_mutex);
|
||||||
|
+ return res;
|
||||||
|
+
|
||||||
|
+block_release:
|
||||||
|
+ for (; i < b; i++)
|
||||||
|
+ put_bh(bh[i]);
|
||||||
|
+
|
||||||
|
+failed:
|
||||||
|
+ mutex_unlock(&lzma_mutex);
|
||||||
|
+
|
||||||
|
+ ERROR("lzma decompression failed, data probably corrupt\n");
|
||||||
|
+ return -EIO;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
+const struct squashfs_decompressor squashfs_lzma_comp_ops = {
|
||||||
|
+ .init = lzma_init,
|
||||||
|
+ .free = lzma_free,
|
||||||
|
+ .decompress = lzma_uncompress,
|
||||||
|
+ .id = LZMA_COMPRESSION,
|
||||||
|
+ .name = "lzma",
|
||||||
|
+ .supported = 1
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
--- a/fs/squashfs/squashfs.h
|
||||||
|
+++ b/fs/squashfs/squashfs.h
|
||||||
|
@@ -94,3 +94,6 @@ extern const struct address_space_operat
|
||||||
|
|
||||||
|
/* zlib_wrapper.c */
|
||||||
|
extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
|
||||||
|
+
|
||||||
|
+/* lzma wrapper.c */
|
||||||
|
+extern const struct squashfs_decompressor squashfs_lzma_comp_ops;
|
165
kernel-2.6.35-007-squashfs_make_lzma_available.patch
Normal file
165
kernel-2.6.35-007-squashfs_make_lzma_available.patch
Normal file
@ -0,0 +1,165 @@
|
|||||||
|
From fdf23ed283bc6ef5c25076ce2065f892120ff556 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Phillip Lougher <phillip@lougher.demon.co.uk>
|
||||||
|
Date: Thu, 22 Oct 2009 04:57:38 +0100
|
||||||
|
Subject: [PATCH] Squashfs: Make unlzma available to non initramfs/initrd code
|
||||||
|
|
||||||
|
Add a config option DECOMPRESS_LZMA_NEEDED which allows subsystems to
|
||||||
|
specify they need the unlzma code. Normally decompress_unlzma.c is
|
||||||
|
compiled with __init and unlzma is not exported to modules.
|
||||||
|
|
||||||
|
Signed-off-by: Phillip Lougher <phillip@lougher.demon.co.uk>
|
||||||
|
---
|
||||||
|
fs/squashfs/Kconfig | 1 +
|
||||||
|
include/linux/decompress/bunzip2_mm.h | 12 ++++++++++++
|
||||||
|
include/linux/decompress/inflate_mm.h | 12 ++++++++++++
|
||||||
|
include/linux/decompress/mm.h | 3 ---
|
||||||
|
include/linux/decompress/unlzma_mm.h | 20 ++++++++++++++++++++
|
||||||
|
lib/Kconfig | 3 +++
|
||||||
|
lib/decompress_bunzip2.c | 1 +
|
||||||
|
lib/decompress_inflate.c | 1 +
|
||||||
|
lib/decompress_unlzma.c | 5 ++++-
|
||||||
|
9 files changed, 54 insertions(+), 4 deletions(-)
|
||||||
|
create mode 100644 include/linux/decompress/bunzip2_mm.h
|
||||||
|
create mode 100644 include/linux/decompress/inflate_mm.h
|
||||||
|
create mode 100644 include/linux/decompress/unlzma_mm.h
|
||||||
|
|
||||||
|
--- a/fs/squashfs/Kconfig
|
||||||
|
+++ b/fs/squashfs/Kconfig
|
||||||
|
@@ -30,6 +30,7 @@ config SQUASHFS_LZMA
|
||||||
|
bool "Include support for LZMA compressed file systems"
|
||||||
|
depends on SQUASHFS
|
||||||
|
select DECOMPRESS_LZMA
|
||||||
|
+ select DECOMPRESS_LZMA_NEEDED
|
||||||
|
|
||||||
|
config SQUASHFS_EMBEDDED
|
||||||
|
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/include/linux/decompress/bunzip2_mm.h
|
||||||
|
@@ -0,0 +1,12 @@
|
||||||
|
+#ifndef BUNZIP2_MM_H
|
||||||
|
+#define BUNZIP2_MM_H
|
||||||
|
+
|
||||||
|
+#ifdef STATIC
|
||||||
|
+/* Code active when included from pre-boot environment: */
|
||||||
|
+#define INIT
|
||||||
|
+#else
|
||||||
|
+/* Compile for initramfs/initrd code only */
|
||||||
|
+#define INIT __init
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/include/linux/decompress/inflate_mm.h
|
||||||
|
@@ -0,0 +1,12 @@
|
||||||
|
+#ifndef INFLATE_MM_H
|
||||||
|
+#define INFLATE_MM_H
|
||||||
|
+
|
||||||
|
+#ifdef STATIC
|
||||||
|
+/* Code active when included from pre-boot environment: */
|
||||||
|
+#define INIT
|
||||||
|
+#else
|
||||||
|
+/* Compile for initramfs/initrd code only */
|
||||||
|
+#define INIT __init
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
--- a/include/linux/decompress/mm.h
|
||||||
|
+++ b/include/linux/decompress/mm.h
|
||||||
|
@@ -63,8 +63,6 @@ static void free(void *where)
|
||||||
|
|
||||||
|
#define set_error_fn(x)
|
||||||
|
|
||||||
|
-#define INIT
|
||||||
|
-
|
||||||
|
#else /* STATIC */
|
||||||
|
|
||||||
|
/* Code active when compiled standalone for use when loading ramdisk: */
|
||||||
|
@@ -87,7 +85,6 @@ static void free(void *where)
|
||||||
|
static void(*error)(char *m);
|
||||||
|
#define set_error_fn(x) error = x;
|
||||||
|
|
||||||
|
-#define INIT __init
|
||||||
|
#define STATIC
|
||||||
|
|
||||||
|
#include <linux/init.h>
|
||||||
|
--- /dev/null
|
||||||
|
+++ b/include/linux/decompress/unlzma_mm.h
|
||||||
|
@@ -0,0 +1,20 @@
|
||||||
|
+#ifndef UNLZMA_MM_H
|
||||||
|
+#define UNLZMA_MM_H
|
||||||
|
+
|
||||||
|
+#ifdef STATIC
|
||||||
|
+
|
||||||
|
+/* Code active when included from pre-boot environment: */
|
||||||
|
+#define INIT
|
||||||
|
+
|
||||||
|
+#elif defined(CONFIG_DECOMPRESS_LZMA_NEEDED)
|
||||||
|
+
|
||||||
|
+/* Make it available to non initramfs/initrd code */
|
||||||
|
+#define INIT
|
||||||
|
+#include <linux/module.h>
|
||||||
|
+#else
|
||||||
|
+
|
||||||
|
+/* Compile for initramfs/initrd code only */
|
||||||
|
+#define INIT __init
|
||||||
|
+#endif
|
||||||
|
+
|
||||||
|
+#endif
|
||||||
|
--- a/lib/Kconfig
|
||||||
|
+++ b/lib/Kconfig
|
||||||
|
@@ -121,6 +121,9 @@ config DECOMPRESS_LZO
|
||||||
|
select LZO_DECOMPRESS
|
||||||
|
tristate
|
||||||
|
|
||||||
|
+config DECOMPRESS_LZMA_NEEDED
|
||||||
|
+ boolean
|
||||||
|
+
|
||||||
|
#
|
||||||
|
# Generic allocator support is selected if needed
|
||||||
|
#
|
||||||
|
--- a/lib/decompress_bunzip2.c
|
||||||
|
+++ b/lib/decompress_bunzip2.c
|
||||||
|
@@ -52,6 +52,7 @@
|
||||||
|
#include <linux/slab.h>
|
||||||
|
#endif /* STATIC */
|
||||||
|
|
||||||
|
+#include <linux/decompress/bunzip2_mm.h>
|
||||||
|
#include <linux/decompress/mm.h>
|
||||||
|
|
||||||
|
#ifndef INT_MAX
|
||||||
|
--- a/lib/decompress_inflate.c
|
||||||
|
+++ b/lib/decompress_inflate.c
|
||||||
|
@@ -23,6 +23,7 @@
|
||||||
|
|
||||||
|
#endif /* STATIC */
|
||||||
|
|
||||||
|
+#include <linux/decompress/inflate_mm.h>
|
||||||
|
#include <linux/decompress/mm.h>
|
||||||
|
|
||||||
|
#define GZIP_IOBUF_SIZE (16*1024)
|
||||||
|
--- a/lib/decompress_unlzma.c
|
||||||
|
+++ b/lib/decompress_unlzma.c
|
||||||
|
@@ -36,6 +36,7 @@
|
||||||
|
#include <linux/slab.h>
|
||||||
|
#endif /* STATIC */
|
||||||
|
|
||||||
|
+#include <linux/decompress/unlzma_mm.h>
|
||||||
|
#include <linux/decompress/mm.h>
|
||||||
|
|
||||||
|
#define MIN(a, b) (((a) < (b)) ? (a) : (b))
|
||||||
|
@@ -531,7 +532,7 @@ static inline void INIT process_bit1(str
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-STATIC inline int INIT unlzma(unsigned char *buf, int in_len,
|
||||||
|
+STATIC int INIT unlzma(unsigned char *buf, int in_len,
|
||||||
|
int(*fill)(void*, unsigned int),
|
||||||
|
int(*flush)(void*, unsigned int),
|
||||||
|
unsigned char *output,
|
||||||
|
@@ -664,4 +665,6 @@ STATIC int INIT decompress(unsigned char
|
||||||
|
{
|
||||||
|
return unlzma(buf, in_len - 4, fill, flush, output, posp, error_fn);
|
||||||
|
}
|
||||||
|
+#elif defined(CONFIG_DECOMPRESS_LZMA_NEEDED)
|
||||||
|
+EXPORT_SYMBOL(unlzma);
|
||||||
|
#endif
|
17
kernel-2.6.35-430-scsi_header_fix.patch
Normal file
17
kernel-2.6.35-430-scsi_header_fix.patch
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
--- a/include/scsi/scsi.h
|
||||||
|
+++ b/include/scsi/scsi.h
|
||||||
|
@@ -149,10 +149,10 @@ struct scsi_cmnd;
|
||||||
|
|
||||||
|
/* defined in T10 SCSI Primary Commands-2 (SPC2) */
|
||||||
|
struct scsi_varlen_cdb_hdr {
|
||||||
|
- u8 opcode; /* opcode always == VARIABLE_LENGTH_CMD */
|
||||||
|
- u8 control;
|
||||||
|
- u8 misc[5];
|
||||||
|
- u8 additional_cdb_length; /* total cdb length - 8 */
|
||||||
|
+ __u8 opcode; /* opcode always == VARIABLE_LENGTH_CMD */
|
||||||
|
+ __u8 control;
|
||||||
|
+ __u8 misc[5];
|
||||||
|
+ __u8 additional_cdb_length; /* total cdb length - 8 */
|
||||||
|
__be16 service_action;
|
||||||
|
/* service specific data follows */
|
||||||
|
};
|
28
kernel-2.6.35-CTI_USB-485-Mini_USB-Nano-485.patch
Normal file
28
kernel-2.6.35-CTI_USB-485-Mini_USB-Nano-485.patch
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
diff -Nru kernel-2.6.33mamba.orig//drivers/usb/serial/ftdi_sio.c kernel-2.6.33mamba/drivers/usb/serial/ftdi_sio.c
|
||||||
|
--- kernel-2.6.33mamba.orig//drivers/usb/serial/ftdi_sio.c 2010-09-29 13:08:53.454057663 +0200
|
||||||
|
+++ kernel-2.6.33mamba/drivers/usb/serial/ftdi_sio.c 2010-09-29 13:18:30.229054171 +0200
|
||||||
|
@@ -150,6 +150,8 @@
|
||||||
|
* /sys/bus/usb/ftdi_sio/new_id, then send patch/report!
|
||||||
|
*/
|
||||||
|
static struct usb_device_id id_table_combined [] = {
|
||||||
|
+ { USB_DEVICE(FTDI_VID, FTDI_CTI_Mini_PID) },
|
||||||
|
+ { USB_DEVICE(FTDI_VID, FTDI_CTI_Nano_PID) },
|
||||||
|
{ USB_DEVICE(FTDI_VID, FTDI_AMC232_PID) },
|
||||||
|
{ USB_DEVICE(FTDI_VID, FTDI_CANUSB_PID) },
|
||||||
|
{ USB_DEVICE(FTDI_VID, FTDI_CANDAPTER_PID) },
|
||||||
|
diff -Nru kernel-2.6.33mamba.orig//drivers/usb/serial/ftdi_sio_ids.h kernel-2.6.33mamba/drivers/usb/serial/ftdi_sio_ids.h
|
||||||
|
--- kernel-2.6.33mamba.orig//drivers/usb/serial/ftdi_sio_ids.h 2010-09-29 13:08:53.457119450 +0200
|
||||||
|
+++ kernel-2.6.33mamba/drivers/usb/serial/ftdi_sio_ids.h 2010-09-29 13:17:28.902429141 +0200
|
||||||
|
@@ -1085,6 +1085,12 @@
|
||||||
|
#define XVERVE_SIGNALYZER_SH4_PID 0xBCA4
|
||||||
|
|
||||||
|
/*
|
||||||
|
+ * CTI GmbH USB to RS485 converters (http://www.cti-lean.com)
|
||||||
|
+ */
|
||||||
|
+#define FTDI_CTI_Mini_PID 0xF608 /* USB-485-Mini der Firma CTI*/
|
||||||
|
+#define FTDI_CTI_Nano_PID 0xF60B /* USB-Nano-485 def Firma CTI*/
|
||||||
|
+
|
||||||
|
+/*
|
||||||
|
* Segway Robotic Mobility Platform USB interface (using VID 0x0403)
|
||||||
|
* Submitted by John G. Rogers
|
||||||
|
*/
|
11
kernel-2.6.35-usbstorage-disable_delay_use.patch
Normal file
11
kernel-2.6.35-usbstorage-disable_delay_use.patch
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
--- kernel-2.6.35mamba/drivers/usb/storage/usb.c.orig 2011-02-28 01:11:31.203872385 +0100
|
||||||
|
+++ kernel-2.6.35mamba/drivers/usb/storage/usb.c 2011-02-28 01:11:44.133071045 +0100
|
||||||
|
@@ -78,7 +78,7 @@
|
||||||
|
MODULE_DESCRIPTION("USB Mass Storage driver for Linux");
|
||||||
|
MODULE_LICENSE("GPL");
|
||||||
|
|
||||||
|
-static unsigned int delay_use = 1;
|
||||||
|
+static unsigned int delay_use = 0;
|
||||||
|
module_param(delay_use, uint, S_IRUGO | S_IWUSR);
|
||||||
|
MODULE_PARM_DESC(delay_use, "seconds to delay before using a new device");
|
||||||
|
|
25
kernel-2.6.35-vga_dont_ask.patch
Normal file
25
kernel-2.6.35-vga_dont_ask.patch
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
diff -Nru kernel-2.6.35mamba.orig//arch/x86/boot/video.c kernel-2.6.35mamba/arch/x86/boot/video.c
|
||||||
|
--- kernel-2.6.35mamba.orig//arch/x86/boot/video.c 2011-02-06 20:04:07.000000000 +0100
|
||||||
|
+++ kernel-2.6.35mamba/arch/x86/boot/video.c 2011-02-26 17:33:57.050038142 +0100
|
||||||
|
@@ -322,16 +322,14 @@
|
||||||
|
save_screen();
|
||||||
|
probe_cards(0);
|
||||||
|
|
||||||
|
- for (;;) {
|
||||||
|
- if (mode == ASK_VGA)
|
||||||
|
- mode = mode_menu();
|
||||||
|
-
|
||||||
|
- if (!set_mode(mode))
|
||||||
|
- break;
|
||||||
|
+ if (mode == ASK_VGA)
|
||||||
|
+ mode = mode_menu();
|
||||||
|
|
||||||
|
+ if (set_mode(mode)) {
|
||||||
|
printf("Undefined video mode number: %x\n", mode);
|
||||||
|
- mode = ASK_VGA;
|
||||||
|
+ mode = VIDEO_CURRENT_MODE;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
boot_params.hdr.vid_mode = mode;
|
||||||
|
vesa_store_edid();
|
||||||
|
store_mode_params();
|
854
kernel-2.6.35.10-drm-radeon-r600-cs-checker-fixes.patch
Normal file
854
kernel-2.6.35.10-drm-radeon-r600-cs-checker-fixes.patch
Normal file
@ -0,0 +1,854 @@
|
|||||||
|
commit 4adf332cc24ee2d46064aaafd8216169d29566d5
|
||||||
|
Author: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Date: Sun Nov 14 20:24:35 2010 -0500
|
||||||
|
|
||||||
|
drm/radeon/kms: fix and unify tiled buffer alignment checking for r6xx/7xx
|
||||||
|
|
||||||
|
Tiled buffers have the same alignment requirements regardless of
|
||||||
|
whether the surface is for db, cb, or textures. Previously, the
|
||||||
|
calculations where inconsistent for each buffer type.
|
||||||
|
|
||||||
|
- Unify the alignment calculations in a common function
|
||||||
|
- Standardize the alignment units (pixels for pitch/height/depth,
|
||||||
|
bytes for base)
|
||||||
|
- properly check the buffer base alignments
|
||||||
|
|
||||||
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
commit c37cb9e61dce7437f63280d9347a9ffdf4ec34e7
|
||||||
|
Author: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Date: Wed Oct 27 01:44:35 2010 -0400
|
||||||
|
|
||||||
|
drm/radeon/kms: fix tiled db height calculation on 6xx/7xx
|
||||||
|
|
||||||
|
Calculate height based on the slice bitfield rather than the size.
|
||||||
|
Same as Dave's CB fix.
|
||||||
|
|
||||||
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
commit b80c8fdc2fadd8182b958e91a10f2fa287f993e4
|
||||||
|
Author: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Date: Tue Oct 26 20:22:42 2010 -0400
|
||||||
|
|
||||||
|
drm/radeon/kms: fix r6xx/7xx 1D tiling CS checker v2
|
||||||
|
|
||||||
|
broken by:
|
||||||
|
drm/radeon/r600: fix tiling issues in CS checker.
|
||||||
|
|
||||||
|
v2: only apply it to 1D tiling case.
|
||||||
|
|
||||||
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
commit 4336ac5c0a4e5dfbb51631ad680d6a5d0b295cd3
|
||||||
|
Author: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Date: Mon Oct 18 23:45:39 2010 -0400
|
||||||
|
|
||||||
|
drm/radeon/kms: fix 2D tile height alignment in the r600 CS checker
|
||||||
|
|
||||||
|
macro tile heights are aligned to num channels, not num banks.
|
||||||
|
|
||||||
|
Noticed by Dave Airlie.
|
||||||
|
|
||||||
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Cc: stable@kernel.org
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
commit 5c76976a1419a633f9f33c6547bae00348b855d2
|
||||||
|
Author: Dave Airlie <airlied@redhat.com>
|
||||||
|
Date: Thu Oct 21 13:55:40 2010 +1000
|
||||||
|
|
||||||
|
drm/radeon/r600: fix tiling issues in CS checker.
|
||||||
|
|
||||||
|
The CS checker had some incorrect alignment requirements for 2D surfaces,
|
||||||
|
this made rendering to mipmap levels that were 2D broken.
|
||||||
|
|
||||||
|
Also the CB height was being worked out from the BO size, this doesn't work
|
||||||
|
at all when rendering mipmap levels, instead we work out what height userspace
|
||||||
|
wanted from slice max and use that to check it fits inside the BO, however
|
||||||
|
the DDX send the wrong slice max for an unaligned buffer so we have to workaround
|
||||||
|
for that even though its a userspace bug.
|
||||||
|
|
||||||
|
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
commit fa479e9df4558af6f091c45be37f713e64b836a1
|
||||||
|
Author: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Date: Tue Sep 14 10:10:47 2010 -0400
|
||||||
|
|
||||||
|
drm/radeon/kms: only warn on mipmap size checks in r600 cs checker (v2)
|
||||||
|
|
||||||
|
The texture base address registers are in units of 256 bytes.
|
||||||
|
The original CS checker treated these offsets as bytes, so the
|
||||||
|
original check was wrong. I fixed the units in a patch during
|
||||||
|
the 2.6.36 cycle, but this ended up breaking some existing
|
||||||
|
userspace (probably due to a bug in either userspace texture allocation
|
||||||
|
or the drm texture mipmap checker). So for now, until we come
|
||||||
|
up with a better fix, just warn if the mipmap size it too large.
|
||||||
|
This will keep existing userspace working and it should be just
|
||||||
|
as safe as before when we were checking the wrong units. These
|
||||||
|
are GPU MC addresses, so if they fall outside of the VRAM or
|
||||||
|
GART apertures, they end up at the GPU default page, so this should
|
||||||
|
be safe from a security perspective.
|
||||||
|
|
||||||
|
v2: Just disable the warning. It just spams the log and there's
|
||||||
|
nothing the user can do about it.
|
||||||
|
|
||||||
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Cc: Jerome Glisse <glisse@freedesktop.org>
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
commit 6e8df81d43d5c95fe37db7f0ef55332de1a4b698
|
||||||
|
Author: Dave Airlie <airlied@redhat.com>
|
||||||
|
Date: Thu Aug 12 09:40:05 2010 +1000
|
||||||
|
|
||||||
|
drm/radeon: drop old and broken mesa warning
|
||||||
|
|
||||||
|
This never really got fixed in mesa, and the kernel deals with the problem
|
||||||
|
just fine, so don't got reporting things that confuse people.
|
||||||
|
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
commit 23f012fb9a0633f2f8901440e314d6276255b1c0
|
||||||
|
Author: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Date: Wed Aug 11 11:54:25 2010 -0400
|
||||||
|
|
||||||
|
drm/radeon/kms: another r6xx/r7xx CS checker fix
|
||||||
|
|
||||||
|
add default case for buffer formats
|
||||||
|
|
||||||
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Cc: Andre Maasikas <amaasikas@gmail.com>
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
commit 2c7e76decda2d437f0ca064fef1a2d5d8892288e
|
||||||
|
Author: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Date: Fri Aug 6 02:54:05 2010 -0400
|
||||||
|
|
||||||
|
drm/radeon/kms: r600 CS parser fixes
|
||||||
|
|
||||||
|
- buffer offsets in the base regs are 256b aligned so
|
||||||
|
shift properly when comparing, fixed by Andre Maasikas
|
||||||
|
- mipmap size was calculated wrong when nlevel=0
|
||||||
|
- texture bo offsets were used after the bo base address was added
|
||||||
|
- vertex resource size register is size - 1, not size
|
||||||
|
|
||||||
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Cc: Andre Maasikas <amaasikas@gmail.com>
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
commit 85d1363c9f15b5d4303b635142cee0ba9d1473fc
|
||||||
|
Author: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Date: Fri Jun 4 18:41:42 2010 -0400
|
||||||
|
|
||||||
|
drm/radeon/kms: fix CS alignment checking for tiling (v2)
|
||||||
|
|
||||||
|
Covers depth, cb, and textures. Hopefully I got this right.
|
||||||
|
|
||||||
|
v2: - fix bugs:
|
||||||
|
https://bugs.freedesktop.org/show_bug.cgi?id=28327
|
||||||
|
https://bugs.freedesktop.org/show_bug.cgi?id=28381
|
||||||
|
- use ALIGNED(), IS_ALIGNED() macros
|
||||||
|
|
||||||
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
commit b956b6e7c7fb207daf32520c0a72c8c06ef1d5f5
|
||||||
|
Author: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Date: Thu May 20 12:43:52 2010 -0400
|
||||||
|
|
||||||
|
drm/radeon/kms: add tiling support to the cs checker for r6xx/r7xx
|
||||||
|
|
||||||
|
Check for relocs for DB_DEPTH_INFO, CB_COLOR*_INFO, and texture
|
||||||
|
resources.
|
||||||
|
|
||||||
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Signed-off-by: Dave Airlie <airlied@redhat.com>
|
||||||
|
|
||||||
|
drivers/gpu/drm/radeon/r600_cs.c | 391 ++++++++++++++++++++++++++++++--------
|
||||||
|
drivers/gpu/drm/radeon/r600d.h | 12 ++
|
||||||
|
2 files changed, 324 insertions(+), 79 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/gpu/drm/radeon/r600_cs.c b/drivers/gpu/drm/radeon/r600_cs.c
|
||||||
|
index 144c32d..0f90fc3 100644
|
||||||
|
--- a/drivers/gpu/drm/radeon/r600_cs.c
|
||||||
|
+++ b/drivers/gpu/drm/radeon/r600_cs.c
|
||||||
|
@@ -25,6 +25,7 @@
|
||||||
|
* Alex Deucher
|
||||||
|
* Jerome Glisse
|
||||||
|
*/
|
||||||
|
+#include <linux/kernel.h>
|
||||||
|
#include "drmP.h"
|
||||||
|
#include "radeon.h"
|
||||||
|
#include "r600d.h"
|
||||||
|
@@ -49,6 +50,7 @@ struct r600_cs_track {
|
||||||
|
u32 nsamples;
|
||||||
|
u32 cb_color_base_last[8];
|
||||||
|
struct radeon_bo *cb_color_bo[8];
|
||||||
|
+ u64 cb_color_bo_mc[8];
|
||||||
|
u32 cb_color_bo_offset[8];
|
||||||
|
struct radeon_bo *cb_color_frag_bo[8];
|
||||||
|
struct radeon_bo *cb_color_tile_bo[8];
|
||||||
|
@@ -66,6 +68,7 @@ struct r600_cs_track {
|
||||||
|
u32 db_depth_size;
|
||||||
|
u32 db_offset;
|
||||||
|
struct radeon_bo *db_bo;
|
||||||
|
+ u64 db_bo_mc;
|
||||||
|
};
|
||||||
|
|
||||||
|
static inline int r600_bpe_from_format(u32 *bpe, u32 format)
|
||||||
|
@@ -132,12 +135,75 @@ static inline int r600_bpe_from_format(u32 *bpe, u32 format)
|
||||||
|
case V_038004_FMT_GB_GR:
|
||||||
|
case V_038004_FMT_BG_RG:
|
||||||
|
case V_038004_COLOR_INVALID:
|
||||||
|
+ default:
|
||||||
|
*bpe = 16;
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
+struct array_mode_checker {
|
||||||
|
+ int array_mode;
|
||||||
|
+ u32 group_size;
|
||||||
|
+ u32 nbanks;
|
||||||
|
+ u32 npipes;
|
||||||
|
+ u32 nsamples;
|
||||||
|
+ u32 bpe;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+/* returns alignment in pixels for pitch/height/depth and bytes for base */
|
||||||
|
+static inline int r600_get_array_mode_alignment(struct array_mode_checker *values,
|
||||||
|
+ u32 *pitch_align,
|
||||||
|
+ u32 *height_align,
|
||||||
|
+ u32 *depth_align,
|
||||||
|
+ u64 *base_align)
|
||||||
|
+{
|
||||||
|
+ u32 tile_width = 8;
|
||||||
|
+ u32 tile_height = 8;
|
||||||
|
+ u32 macro_tile_width = values->nbanks;
|
||||||
|
+ u32 macro_tile_height = values->npipes;
|
||||||
|
+ u32 tile_bytes = tile_width * tile_height * values->bpe * values->nsamples;
|
||||||
|
+ u32 macro_tile_bytes = macro_tile_width * macro_tile_height * tile_bytes;
|
||||||
|
+
|
||||||
|
+ switch (values->array_mode) {
|
||||||
|
+ case ARRAY_LINEAR_GENERAL:
|
||||||
|
+ /* technically tile_width/_height for pitch/height */
|
||||||
|
+ *pitch_align = 1; /* tile_width */
|
||||||
|
+ *height_align = 1; /* tile_height */
|
||||||
|
+ *depth_align = 1;
|
||||||
|
+ *base_align = 1;
|
||||||
|
+ break;
|
||||||
|
+ case ARRAY_LINEAR_ALIGNED:
|
||||||
|
+ *pitch_align = max((u32)64, (u32)(values->group_size / values->bpe));
|
||||||
|
+ *height_align = tile_height;
|
||||||
|
+ *depth_align = 1;
|
||||||
|
+ *base_align = values->group_size;
|
||||||
|
+ break;
|
||||||
|
+ case ARRAY_1D_TILED_THIN1:
|
||||||
|
+ *pitch_align = max((u32)tile_width,
|
||||||
|
+ (u32)(values->group_size /
|
||||||
|
+ (tile_height * values->bpe * values->nsamples)));
|
||||||
|
+ *height_align = tile_height;
|
||||||
|
+ *depth_align = 1;
|
||||||
|
+ *base_align = values->group_size;
|
||||||
|
+ break;
|
||||||
|
+ case ARRAY_2D_TILED_THIN1:
|
||||||
|
+ *pitch_align = max((u32)macro_tile_width,
|
||||||
|
+ (u32)(((values->group_size / tile_height) /
|
||||||
|
+ (values->bpe * values->nsamples)) *
|
||||||
|
+ values->nbanks)) * tile_width;
|
||||||
|
+ *height_align = macro_tile_height * tile_height;
|
||||||
|
+ *depth_align = 1;
|
||||||
|
+ *base_align = max(macro_tile_bytes,
|
||||||
|
+ (*pitch_align) * values->bpe * (*height_align) * values->nsamples);
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ return 0;
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
static void r600_cs_track_init(struct r600_cs_track *track)
|
||||||
|
{
|
||||||
|
int i;
|
||||||
|
@@ -151,10 +217,12 @@ static void r600_cs_track_init(struct r600_cs_track *track)
|
||||||
|
track->cb_color_info[i] = 0;
|
||||||
|
track->cb_color_bo[i] = NULL;
|
||||||
|
track->cb_color_bo_offset[i] = 0xFFFFFFFF;
|
||||||
|
+ track->cb_color_bo_mc[i] = 0xFFFFFFFF;
|
||||||
|
}
|
||||||
|
track->cb_target_mask = 0xFFFFFFFF;
|
||||||
|
track->cb_shader_mask = 0xFFFFFFFF;
|
||||||
|
track->db_bo = NULL;
|
||||||
|
+ track->db_bo_mc = 0xFFFFFFFF;
|
||||||
|
/* assume the biggest format and that htile is enabled */
|
||||||
|
track->db_depth_info = 7 | (1 << 25);
|
||||||
|
track->db_depth_view = 0xFFFFC000;
|
||||||
|
@@ -166,70 +234,58 @@ static void r600_cs_track_init(struct r600_cs_track *track)
|
||||||
|
static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i)
|
||||||
|
{
|
||||||
|
struct r600_cs_track *track = p->track;
|
||||||
|
- u32 bpe = 0, pitch, slice_tile_max, size, tmp, height;
|
||||||
|
+ u32 bpe = 0, slice_tile_max, size, tmp;
|
||||||
|
+ u32 height, height_align, pitch, pitch_align, depth_align;
|
||||||
|
+ u64 base_offset, base_align;
|
||||||
|
+ struct array_mode_checker array_check;
|
||||||
|
volatile u32 *ib = p->ib->ptr;
|
||||||
|
+ unsigned array_mode;
|
||||||
|
|
||||||
|
if (G_0280A0_TILE_MODE(track->cb_color_info[i])) {
|
||||||
|
dev_warn(p->dev, "FMASK or CMASK buffer are not supported by this kernel\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
- size = radeon_bo_size(track->cb_color_bo[i]);
|
||||||
|
+ size = radeon_bo_size(track->cb_color_bo[i]) - track->cb_color_bo_offset[i];
|
||||||
|
if (r600_bpe_from_format(&bpe, G_0280A0_FORMAT(track->cb_color_info[i]))) {
|
||||||
|
dev_warn(p->dev, "%s:%d cb invalid format %d for %d (0x%08X)\n",
|
||||||
|
__func__, __LINE__, G_0280A0_FORMAT(track->cb_color_info[i]),
|
||||||
|
i, track->cb_color_info[i]);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
- pitch = (G_028060_PITCH_TILE_MAX(track->cb_color_size[i]) + 1) << 3;
|
||||||
|
+ /* pitch in pixels */
|
||||||
|
+ pitch = (G_028060_PITCH_TILE_MAX(track->cb_color_size[i]) + 1) * 8;
|
||||||
|
slice_tile_max = G_028060_SLICE_TILE_MAX(track->cb_color_size[i]) + 1;
|
||||||
|
- if (!pitch) {
|
||||||
|
- dev_warn(p->dev, "%s:%d cb pitch (%d) for %d invalid (0x%08X)\n",
|
||||||
|
- __func__, __LINE__, pitch, i, track->cb_color_size[i]);
|
||||||
|
- return -EINVAL;
|
||||||
|
- }
|
||||||
|
- height = size / (pitch * bpe);
|
||||||
|
+ slice_tile_max *= 64;
|
||||||
|
+ height = slice_tile_max / pitch;
|
||||||
|
if (height > 8192)
|
||||||
|
height = 8192;
|
||||||
|
- switch (G_0280A0_ARRAY_MODE(track->cb_color_info[i])) {
|
||||||
|
+ array_mode = G_0280A0_ARRAY_MODE(track->cb_color_info[i]);
|
||||||
|
+
|
||||||
|
+ base_offset = track->cb_color_bo_mc[i] + track->cb_color_bo_offset[i];
|
||||||
|
+ array_check.array_mode = array_mode;
|
||||||
|
+ array_check.group_size = track->group_size;
|
||||||
|
+ array_check.nbanks = track->nbanks;
|
||||||
|
+ array_check.npipes = track->npipes;
|
||||||
|
+ array_check.nsamples = track->nsamples;
|
||||||
|
+ array_check.bpe = bpe;
|
||||||
|
+ if (r600_get_array_mode_alignment(&array_check,
|
||||||
|
+ &pitch_align, &height_align, &depth_align, &base_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s invalid tiling %d for %d (0x%08X)\n", __func__,
|
||||||
|
+ G_0280A0_ARRAY_MODE(track->cb_color_info[i]), i,
|
||||||
|
+ track->cb_color_info[i]);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ switch (array_mode) {
|
||||||
|
case V_0280A0_ARRAY_LINEAR_GENERAL:
|
||||||
|
+ break;
|
||||||
|
case V_0280A0_ARRAY_LINEAR_ALIGNED:
|
||||||
|
- if (pitch & 0x3f) {
|
||||||
|
- dev_warn(p->dev, "%s:%d cb pitch (%d x %d = %d) invalid\n",
|
||||||
|
- __func__, __LINE__, pitch, bpe, pitch * bpe);
|
||||||
|
- return -EINVAL;
|
||||||
|
- }
|
||||||
|
- if ((pitch * bpe) & (track->group_size - 1)) {
|
||||||
|
- dev_warn(p->dev, "%s:%d cb pitch (%d) invalid\n",
|
||||||
|
- __func__, __LINE__, pitch);
|
||||||
|
- return -EINVAL;
|
||||||
|
- }
|
||||||
|
break;
|
||||||
|
case V_0280A0_ARRAY_1D_TILED_THIN1:
|
||||||
|
- if ((pitch * 8 * bpe * track->nsamples) & (track->group_size - 1)) {
|
||||||
|
- dev_warn(p->dev, "%s:%d cb pitch (%d) invalid\n",
|
||||||
|
- __func__, __LINE__, pitch);
|
||||||
|
- return -EINVAL;
|
||||||
|
- }
|
||||||
|
- height &= ~0x7;
|
||||||
|
- if (!height)
|
||||||
|
- height = 8;
|
||||||
|
+ /* avoid breaking userspace */
|
||||||
|
+ if (height > 7)
|
||||||
|
+ height &= ~0x7;
|
||||||
|
break;
|
||||||
|
case V_0280A0_ARRAY_2D_TILED_THIN1:
|
||||||
|
- if (pitch & ((8 * track->nbanks) - 1)) {
|
||||||
|
- dev_warn(p->dev, "%s:%d cb pitch (%d) invalid\n",
|
||||||
|
- __func__, __LINE__, pitch);
|
||||||
|
- return -EINVAL;
|
||||||
|
- }
|
||||||
|
- tmp = pitch * 8 * bpe * track->nsamples;
|
||||||
|
- tmp = tmp / track->nbanks;
|
||||||
|
- if (tmp & (track->group_size - 1)) {
|
||||||
|
- dev_warn(p->dev, "%s:%d cb pitch (%d) invalid\n",
|
||||||
|
- __func__, __LINE__, pitch);
|
||||||
|
- return -EINVAL;
|
||||||
|
- }
|
||||||
|
- height &= ~((16 * track->npipes) - 1);
|
||||||
|
- if (!height)
|
||||||
|
- height = 16 * track->npipes;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
dev_warn(p->dev, "%s invalid tiling %d for %d (0x%08X)\n", __func__,
|
||||||
|
@@ -237,17 +293,43 @@ static inline int r600_cs_track_validate_cb(struct radeon_cs_parser *p, int i)
|
||||||
|
track->cb_color_info[i]);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ if (!IS_ALIGNED(pitch, pitch_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s:%d cb pitch (%d) invalid\n",
|
||||||
|
+ __func__, __LINE__, pitch);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ if (!IS_ALIGNED(height, height_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s:%d cb height (%d) invalid\n",
|
||||||
|
+ __func__, __LINE__, height);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ if (!IS_ALIGNED(base_offset, base_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s offset[%d] 0x%llx not aligned\n", __func__, i, base_offset);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
/* check offset */
|
||||||
|
- tmp = height * pitch;
|
||||||
|
+ tmp = height * pitch * bpe;
|
||||||
|
if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) {
|
||||||
|
- dev_warn(p->dev, "%s offset[%d] %d to big\n", __func__, i, track->cb_color_bo_offset[i]);
|
||||||
|
- return -EINVAL;
|
||||||
|
+ if (array_mode == V_0280A0_ARRAY_LINEAR_GENERAL) {
|
||||||
|
+ /* the initial DDX does bad things with the CB size occasionally */
|
||||||
|
+ /* it rounds up height too far for slice tile max but the BO is smaller */
|
||||||
|
+ tmp = (height - 7) * 8 * bpe;
|
||||||
|
+ if ((tmp + track->cb_color_bo_offset[i]) > radeon_bo_size(track->cb_color_bo[i])) {
|
||||||
|
+ dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i]));
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ dev_warn(p->dev, "%s offset[%d] %d %d %lu too big\n", __func__, i, track->cb_color_bo_offset[i], tmp, radeon_bo_size(track->cb_color_bo[i]));
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
/* limit max tile */
|
||||||
|
tmp = (height * pitch) >> 6;
|
||||||
|
if (tmp < slice_tile_max)
|
||||||
|
slice_tile_max = tmp;
|
||||||
|
- tmp = S_028060_PITCH_TILE_MAX((pitch >> 3) - 1) |
|
||||||
|
+ tmp = S_028060_PITCH_TILE_MAX((pitch / 8) - 1) |
|
||||||
|
S_028060_SLICE_TILE_MAX(slice_tile_max - 1);
|
||||||
|
ib[track->cb_color_size_idx[i]] = tmp;
|
||||||
|
return 0;
|
||||||
|
@@ -289,7 +371,12 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
|
||||||
|
/* Check depth buffer */
|
||||||
|
if (G_028800_STENCIL_ENABLE(track->db_depth_control) ||
|
||||||
|
G_028800_Z_ENABLE(track->db_depth_control)) {
|
||||||
|
- u32 nviews, bpe, ntiles;
|
||||||
|
+ u32 nviews, bpe, ntiles, size, slice_tile_max;
|
||||||
|
+ u32 height, height_align, pitch, pitch_align, depth_align;
|
||||||
|
+ u64 base_offset, base_align;
|
||||||
|
+ struct array_mode_checker array_check;
|
||||||
|
+ int array_mode;
|
||||||
|
+
|
||||||
|
if (track->db_bo == NULL) {
|
||||||
|
dev_warn(p->dev, "z/stencil with no depth buffer\n");
|
||||||
|
return -EINVAL;
|
||||||
|
@@ -321,7 +408,6 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
|
||||||
|
dev_warn(p->dev, "z/stencil buffer size not set\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
- printk_once(KERN_WARNING "You have old & broken userspace please consider updating mesa\n");
|
||||||
|
tmp = radeon_bo_size(track->db_bo) - track->db_offset;
|
||||||
|
tmp = (tmp / bpe) >> 6;
|
||||||
|
if (!tmp) {
|
||||||
|
@@ -332,11 +418,63 @@ static int r600_cs_track_check(struct radeon_cs_parser *p)
|
||||||
|
}
|
||||||
|
ib[track->db_depth_size_idx] = S_028000_SLICE_TILE_MAX(tmp - 1) | (track->db_depth_size & 0x3FF);
|
||||||
|
} else {
|
||||||
|
+ size = radeon_bo_size(track->db_bo);
|
||||||
|
+ /* pitch in pixels */
|
||||||
|
+ pitch = (G_028000_PITCH_TILE_MAX(track->db_depth_size) + 1) * 8;
|
||||||
|
+ slice_tile_max = G_028000_SLICE_TILE_MAX(track->db_depth_size) + 1;
|
||||||
|
+ slice_tile_max *= 64;
|
||||||
|
+ height = slice_tile_max / pitch;
|
||||||
|
+ if (height > 8192)
|
||||||
|
+ height = 8192;
|
||||||
|
+ base_offset = track->db_bo_mc + track->db_offset;
|
||||||
|
+ array_mode = G_028010_ARRAY_MODE(track->db_depth_info);
|
||||||
|
+ array_check.array_mode = array_mode;
|
||||||
|
+ array_check.group_size = track->group_size;
|
||||||
|
+ array_check.nbanks = track->nbanks;
|
||||||
|
+ array_check.npipes = track->npipes;
|
||||||
|
+ array_check.nsamples = track->nsamples;
|
||||||
|
+ array_check.bpe = bpe;
|
||||||
|
+ if (r600_get_array_mode_alignment(&array_check,
|
||||||
|
+ &pitch_align, &height_align, &depth_align, &base_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s invalid tiling %d (0x%08X)\n", __func__,
|
||||||
|
+ G_028010_ARRAY_MODE(track->db_depth_info),
|
||||||
|
+ track->db_depth_info);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ switch (array_mode) {
|
||||||
|
+ case V_028010_ARRAY_1D_TILED_THIN1:
|
||||||
|
+ /* don't break userspace */
|
||||||
|
+ height &= ~0x7;
|
||||||
|
+ break;
|
||||||
|
+ case V_028010_ARRAY_2D_TILED_THIN1:
|
||||||
|
+ break;
|
||||||
|
+ default:
|
||||||
|
+ dev_warn(p->dev, "%s invalid tiling %d (0x%08X)\n", __func__,
|
||||||
|
+ G_028010_ARRAY_MODE(track->db_depth_info),
|
||||||
|
+ track->db_depth_info);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ if (!IS_ALIGNED(pitch, pitch_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s:%d db pitch (%d) invalid\n",
|
||||||
|
+ __func__, __LINE__, pitch);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ if (!IS_ALIGNED(height, height_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s:%d db height (%d) invalid\n",
|
||||||
|
+ __func__, __LINE__, height);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ if (!IS_ALIGNED(base_offset, base_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s offset[%d] 0x%llx not aligned\n", __func__, i, base_offset);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
ntiles = G_028000_SLICE_TILE_MAX(track->db_depth_size) + 1;
|
||||||
|
nviews = G_028004_SLICE_MAX(track->db_depth_view) + 1;
|
||||||
|
tmp = ntiles * bpe * 64 * nviews;
|
||||||
|
if ((tmp + track->db_offset) > radeon_bo_size(track->db_bo)) {
|
||||||
|
- dev_warn(p->dev, "z/stencil buffer too small (0x%08X %d %d %d -> %d have %ld)\n",
|
||||||
|
+ dev_warn(p->dev, "z/stencil buffer too small (0x%08X %d %d %d -> %u have %lu)\n",
|
||||||
|
track->db_depth_size, ntiles, nviews, bpe, tmp + track->db_offset,
|
||||||
|
radeon_bo_size(track->db_bo));
|
||||||
|
return -EINVAL;
|
||||||
|
@@ -724,7 +862,25 @@ static inline int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx
|
||||||
|
track->db_depth_control = radeon_get_ib_value(p, idx);
|
||||||
|
break;
|
||||||
|
case R_028010_DB_DEPTH_INFO:
|
||||||
|
- track->db_depth_info = radeon_get_ib_value(p, idx);
|
||||||
|
+ if (r600_cs_packet_next_is_pkt3_nop(p)) {
|
||||||
|
+ r = r600_cs_packet_next_reloc(p, &reloc);
|
||||||
|
+ if (r) {
|
||||||
|
+ dev_warn(p->dev, "bad SET_CONTEXT_REG "
|
||||||
|
+ "0x%04X\n", reg);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ track->db_depth_info = radeon_get_ib_value(p, idx);
|
||||||
|
+ ib[idx] &= C_028010_ARRAY_MODE;
|
||||||
|
+ track->db_depth_info &= C_028010_ARRAY_MODE;
|
||||||
|
+ if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO) {
|
||||||
|
+ ib[idx] |= S_028010_ARRAY_MODE(V_028010_ARRAY_2D_TILED_THIN1);
|
||||||
|
+ track->db_depth_info |= S_028010_ARRAY_MODE(V_028010_ARRAY_2D_TILED_THIN1);
|
||||||
|
+ } else {
|
||||||
|
+ ib[idx] |= S_028010_ARRAY_MODE(V_028010_ARRAY_1D_TILED_THIN1);
|
||||||
|
+ track->db_depth_info |= S_028010_ARRAY_MODE(V_028010_ARRAY_1D_TILED_THIN1);
|
||||||
|
+ }
|
||||||
|
+ } else
|
||||||
|
+ track->db_depth_info = radeon_get_ib_value(p, idx);
|
||||||
|
break;
|
||||||
|
case R_028004_DB_DEPTH_VIEW:
|
||||||
|
track->db_depth_view = radeon_get_ib_value(p, idx);
|
||||||
|
@@ -757,8 +913,25 @@ static inline int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx
|
||||||
|
case R_0280B4_CB_COLOR5_INFO:
|
||||||
|
case R_0280B8_CB_COLOR6_INFO:
|
||||||
|
case R_0280BC_CB_COLOR7_INFO:
|
||||||
|
- tmp = (reg - R_0280A0_CB_COLOR0_INFO) / 4;
|
||||||
|
- track->cb_color_info[tmp] = radeon_get_ib_value(p, idx);
|
||||||
|
+ if (r600_cs_packet_next_is_pkt3_nop(p)) {
|
||||||
|
+ r = r600_cs_packet_next_reloc(p, &reloc);
|
||||||
|
+ if (r) {
|
||||||
|
+ dev_err(p->dev, "bad SET_CONTEXT_REG 0x%04X\n", reg);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ tmp = (reg - R_0280A0_CB_COLOR0_INFO) / 4;
|
||||||
|
+ track->cb_color_info[tmp] = radeon_get_ib_value(p, idx);
|
||||||
|
+ if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO) {
|
||||||
|
+ ib[idx] |= S_0280A0_ARRAY_MODE(V_0280A0_ARRAY_2D_TILED_THIN1);
|
||||||
|
+ track->cb_color_info[tmp] |= S_0280A0_ARRAY_MODE(V_0280A0_ARRAY_2D_TILED_THIN1);
|
||||||
|
+ } else if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO) {
|
||||||
|
+ ib[idx] |= S_0280A0_ARRAY_MODE(V_0280A0_ARRAY_1D_TILED_THIN1);
|
||||||
|
+ track->cb_color_info[tmp] |= S_0280A0_ARRAY_MODE(V_0280A0_ARRAY_1D_TILED_THIN1);
|
||||||
|
+ }
|
||||||
|
+ } else {
|
||||||
|
+ tmp = (reg - R_0280A0_CB_COLOR0_INFO) / 4;
|
||||||
|
+ track->cb_color_info[tmp] = radeon_get_ib_value(p, idx);
|
||||||
|
+ }
|
||||||
|
break;
|
||||||
|
case R_028060_CB_COLOR0_SIZE:
|
||||||
|
case R_028064_CB_COLOR1_SIZE:
|
||||||
|
@@ -796,8 +969,6 @@ static inline int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
ib[idx] = track->cb_color_base_last[tmp];
|
||||||
|
- printk_once(KERN_WARNING "You have old & broken userspace "
|
||||||
|
- "please consider updating mesa & xf86-video-ati\n");
|
||||||
|
track->cb_color_frag_bo[tmp] = track->cb_color_bo[tmp];
|
||||||
|
} else {
|
||||||
|
r = r600_cs_packet_next_reloc(p, &reloc);
|
||||||
|
@@ -824,8 +995,6 @@ static inline int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
ib[idx] = track->cb_color_base_last[tmp];
|
||||||
|
- printk_once(KERN_WARNING "You have old & broken userspace "
|
||||||
|
- "please consider updating mesa & xf86-video-ati\n");
|
||||||
|
track->cb_color_tile_bo[tmp] = track->cb_color_bo[tmp];
|
||||||
|
} else {
|
||||||
|
r = r600_cs_packet_next_reloc(p, &reloc);
|
||||||
|
@@ -852,10 +1021,11 @@ static inline int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
tmp = (reg - CB_COLOR0_BASE) / 4;
|
||||||
|
- track->cb_color_bo_offset[tmp] = radeon_get_ib_value(p, idx);
|
||||||
|
+ track->cb_color_bo_offset[tmp] = radeon_get_ib_value(p, idx) << 8;
|
||||||
|
ib[idx] += (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
|
||||||
|
track->cb_color_base_last[tmp] = ib[idx];
|
||||||
|
track->cb_color_bo[tmp] = reloc->robj;
|
||||||
|
+ track->cb_color_bo_mc[tmp] = reloc->lobj.gpu_offset;
|
||||||
|
break;
|
||||||
|
case DB_DEPTH_BASE:
|
||||||
|
r = r600_cs_packet_next_reloc(p, &reloc);
|
||||||
|
@@ -864,9 +1034,10 @@ static inline int r600_cs_check_reg(struct radeon_cs_parser *p, u32 reg, u32 idx
|
||||||
|
"0x%04X\n", reg);
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
- track->db_offset = radeon_get_ib_value(p, idx);
|
||||||
|
+ track->db_offset = radeon_get_ib_value(p, idx) << 8;
|
||||||
|
ib[idx] += (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
|
||||||
|
track->db_bo = reloc->robj;
|
||||||
|
+ track->db_bo_mc = reloc->lobj.gpu_offset;
|
||||||
|
break;
|
||||||
|
case DB_HTILE_DATA_BASE:
|
||||||
|
case SQ_PGM_START_FS:
|
||||||
|
@@ -946,8 +1117,9 @@ static inline unsigned minify(unsigned size, unsigned levels)
|
||||||
|
}
|
||||||
|
|
||||||
|
static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned nlevels,
|
||||||
|
- unsigned w0, unsigned h0, unsigned d0, unsigned bpe,
|
||||||
|
- unsigned *l0_size, unsigned *mipmap_size)
|
||||||
|
+ unsigned w0, unsigned h0, unsigned d0, unsigned bpe,
|
||||||
|
+ unsigned pitch_align,
|
||||||
|
+ unsigned *l0_size, unsigned *mipmap_size)
|
||||||
|
{
|
||||||
|
unsigned offset, i, level, face;
|
||||||
|
unsigned width, height, depth, rowstride, size;
|
||||||
|
@@ -960,18 +1132,18 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned nlevels
|
||||||
|
height = minify(h0, i);
|
||||||
|
depth = minify(d0, i);
|
||||||
|
for(face = 0; face < nfaces; face++) {
|
||||||
|
- rowstride = ((width * bpe) + 255) & ~255;
|
||||||
|
+ rowstride = ALIGN((width * bpe), pitch_align);
|
||||||
|
size = height * rowstride * depth;
|
||||||
|
offset += size;
|
||||||
|
offset = (offset + 0x1f) & ~0x1f;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
- *l0_size = (((w0 * bpe) + 255) & ~255) * h0 * d0;
|
||||||
|
+ *l0_size = ALIGN((w0 * bpe), pitch_align) * h0 * d0;
|
||||||
|
*mipmap_size = offset;
|
||||||
|
- if (!blevel)
|
||||||
|
- *mipmap_size -= *l0_size;
|
||||||
|
if (!nlevels)
|
||||||
|
*mipmap_size = *l0_size;
|
||||||
|
+ if (!blevel)
|
||||||
|
+ *mipmap_size -= *l0_size;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
@@ -985,16 +1157,32 @@ static void r600_texture_size(unsigned nfaces, unsigned blevel, unsigned nlevels
|
||||||
|
* the texture and mipmap bo object are big enough to cover this resource.
|
||||||
|
*/
|
||||||
|
static inline int r600_check_texture_resource(struct radeon_cs_parser *p, u32 idx,
|
||||||
|
- struct radeon_bo *texture,
|
||||||
|
- struct radeon_bo *mipmap)
|
||||||
|
+ struct radeon_bo *texture,
|
||||||
|
+ struct radeon_bo *mipmap,
|
||||||
|
+ u64 base_offset,
|
||||||
|
+ u64 mip_offset,
|
||||||
|
+ u32 tiling_flags)
|
||||||
|
{
|
||||||
|
+ struct r600_cs_track *track = p->track;
|
||||||
|
u32 nfaces, nlevels, blevel, w0, h0, d0, bpe = 0;
|
||||||
|
u32 word0, word1, l0_size, mipmap_size;
|
||||||
|
+ u32 height_align, pitch, pitch_align, depth_align;
|
||||||
|
+ u64 base_align;
|
||||||
|
+ struct array_mode_checker array_check;
|
||||||
|
|
||||||
|
/* on legacy kernel we don't perform advanced check */
|
||||||
|
if (p->rdev == NULL)
|
||||||
|
return 0;
|
||||||
|
+
|
||||||
|
+ /* convert to bytes */
|
||||||
|
+ base_offset <<= 8;
|
||||||
|
+ mip_offset <<= 8;
|
||||||
|
+
|
||||||
|
word0 = radeon_get_ib_value(p, idx + 0);
|
||||||
|
+ if (tiling_flags & RADEON_TILING_MACRO)
|
||||||
|
+ word0 |= S_038000_TILE_MODE(V_038000_ARRAY_2D_TILED_THIN1);
|
||||||
|
+ else if (tiling_flags & RADEON_TILING_MICRO)
|
||||||
|
+ word0 |= S_038000_TILE_MODE(V_038000_ARRAY_1D_TILED_THIN1);
|
||||||
|
word1 = radeon_get_ib_value(p, idx + 1);
|
||||||
|
w0 = G_038000_TEX_WIDTH(word0) + 1;
|
||||||
|
h0 = G_038004_TEX_HEIGHT(word1) + 1;
|
||||||
|
@@ -1021,24 +1209,59 @@ static inline int r600_check_texture_resource(struct radeon_cs_parser *p, u32 i
|
||||||
|
__func__, __LINE__, G_038004_DATA_FORMAT(word1));
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ /* pitch in texels */
|
||||||
|
+ pitch = (G_038000_PITCH(word0) + 1) * 8;
|
||||||
|
+ array_check.array_mode = G_038000_TILE_MODE(word0);
|
||||||
|
+ array_check.group_size = track->group_size;
|
||||||
|
+ array_check.nbanks = track->nbanks;
|
||||||
|
+ array_check.npipes = track->npipes;
|
||||||
|
+ array_check.nsamples = 1;
|
||||||
|
+ array_check.bpe = bpe;
|
||||||
|
+ if (r600_get_array_mode_alignment(&array_check,
|
||||||
|
+ &pitch_align, &height_align, &depth_align, &base_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s:%d tex array mode (%d) invalid\n",
|
||||||
|
+ __func__, __LINE__, G_038000_TILE_MODE(word0));
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ /* XXX check height as well... */
|
||||||
|
+
|
||||||
|
+ if (!IS_ALIGNED(pitch, pitch_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s:%d tex pitch (%d) invalid\n",
|
||||||
|
+ __func__, __LINE__, pitch);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ if (!IS_ALIGNED(base_offset, base_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s:%d tex base offset (0x%llx) invalid\n",
|
||||||
|
+ __func__, __LINE__, base_offset);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+ if (!IS_ALIGNED(mip_offset, base_align)) {
|
||||||
|
+ dev_warn(p->dev, "%s:%d tex mip offset (0x%llx) invalid\n",
|
||||||
|
+ __func__, __LINE__, mip_offset);
|
||||||
|
+ return -EINVAL;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
word0 = radeon_get_ib_value(p, idx + 4);
|
||||||
|
word1 = radeon_get_ib_value(p, idx + 5);
|
||||||
|
blevel = G_038010_BASE_LEVEL(word0);
|
||||||
|
nlevels = G_038014_LAST_LEVEL(word1);
|
||||||
|
- r600_texture_size(nfaces, blevel, nlevels, w0, h0, d0, bpe, &l0_size, &mipmap_size);
|
||||||
|
+ r600_texture_size(nfaces, blevel, nlevels, w0, h0, d0, bpe,
|
||||||
|
+ (pitch_align * bpe),
|
||||||
|
+ &l0_size, &mipmap_size);
|
||||||
|
/* using get ib will give us the offset into the texture bo */
|
||||||
|
- word0 = radeon_get_ib_value(p, idx + 2);
|
||||||
|
+ word0 = radeon_get_ib_value(p, idx + 2) << 8;
|
||||||
|
if ((l0_size + word0) > radeon_bo_size(texture)) {
|
||||||
|
dev_warn(p->dev, "texture bo too small (%d %d %d %d -> %d have %ld)\n",
|
||||||
|
w0, h0, bpe, word0, l0_size, radeon_bo_size(texture));
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
/* using get ib will give us the offset into the mipmap bo */
|
||||||
|
- word0 = radeon_get_ib_value(p, idx + 3);
|
||||||
|
+ word0 = radeon_get_ib_value(p, idx + 3) << 8;
|
||||||
|
if ((mipmap_size + word0) > radeon_bo_size(mipmap)) {
|
||||||
|
- dev_warn(p->dev, "mipmap bo too small (%d %d %d %d %d %d -> %d have %ld)\n",
|
||||||
|
- w0, h0, bpe, blevel, nlevels, word0, mipmap_size, radeon_bo_size(texture));
|
||||||
|
- return -EINVAL;
|
||||||
|
+ /*dev_warn(p->dev, "mipmap bo too small (%d %d %d %d %d %d -> %d have %ld)\n",
|
||||||
|
+ w0, h0, bpe, blevel, nlevels, word0, mipmap_size, radeon_bo_size(texture));*/
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
@@ -1228,7 +1451,7 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
|
||||||
|
}
|
||||||
|
for (i = 0; i < (pkt->count / 7); i++) {
|
||||||
|
struct radeon_bo *texture, *mipmap;
|
||||||
|
- u32 size, offset;
|
||||||
|
+ u32 size, offset, base_offset, mip_offset;
|
||||||
|
|
||||||
|
switch (G__SQ_VTX_CONSTANT_TYPE(radeon_get_ib_value(p, idx+(i*7)+6+1))) {
|
||||||
|
case SQ_TEX_VTX_VALID_TEXTURE:
|
||||||
|
@@ -1238,7 +1461,11 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
|
||||||
|
DRM_ERROR("bad SET_RESOURCE\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
- ib[idx+1+(i*7)+2] += (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
|
||||||
|
+ base_offset = (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
|
||||||
|
+ if (reloc->lobj.tiling_flags & RADEON_TILING_MACRO)
|
||||||
|
+ ib[idx+1+(i*7)+0] |= S_038000_TILE_MODE(V_038000_ARRAY_2D_TILED_THIN1);
|
||||||
|
+ else if (reloc->lobj.tiling_flags & RADEON_TILING_MICRO)
|
||||||
|
+ ib[idx+1+(i*7)+0] |= S_038000_TILE_MODE(V_038000_ARRAY_1D_TILED_THIN1);
|
||||||
|
texture = reloc->robj;
|
||||||
|
/* tex mip base */
|
||||||
|
r = r600_cs_packet_next_reloc(p, &reloc);
|
||||||
|
@@ -1246,12 +1473,17 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
|
||||||
|
DRM_ERROR("bad SET_RESOURCE\n");
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
- ib[idx+1+(i*7)+3] += (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
|
||||||
|
+ mip_offset = (u32)((reloc->lobj.gpu_offset >> 8) & 0xffffffff);
|
||||||
|
mipmap = reloc->robj;
|
||||||
|
r = r600_check_texture_resource(p, idx+(i*7)+1,
|
||||||
|
- texture, mipmap);
|
||||||
|
+ texture, mipmap,
|
||||||
|
+ base_offset + radeon_get_ib_value(p, idx+1+(i*7)+2),
|
||||||
|
+ mip_offset + radeon_get_ib_value(p, idx+1+(i*7)+3),
|
||||||
|
+ reloc->lobj.tiling_flags);
|
||||||
|
if (r)
|
||||||
|
return r;
|
||||||
|
+ ib[idx+1+(i*7)+2] += base_offset;
|
||||||
|
+ ib[idx+1+(i*7)+3] += mip_offset;
|
||||||
|
break;
|
||||||
|
case SQ_TEX_VTX_VALID_BUFFER:
|
||||||
|
/* vtx base */
|
||||||
|
@@ -1261,10 +1493,11 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
|
||||||
|
return -EINVAL;
|
||||||
|
}
|
||||||
|
offset = radeon_get_ib_value(p, idx+1+(i*7)+0);
|
||||||
|
- size = radeon_get_ib_value(p, idx+1+(i*7)+1);
|
||||||
|
+ size = radeon_get_ib_value(p, idx+1+(i*7)+1) + 1;
|
||||||
|
if (p->rdev && (size + offset) > radeon_bo_size(reloc->robj)) {
|
||||||
|
/* force size to size of the buffer */
|
||||||
|
- dev_warn(p->dev, "vbo resource seems too big for the bo\n");
|
||||||
|
+ dev_warn(p->dev, "vbo resource seems too big (%d) for the bo (%ld)\n",
|
||||||
|
+ size + offset, radeon_bo_size(reloc->robj));
|
||||||
|
ib[idx+1+(i*7)+1] = radeon_bo_size(reloc->robj);
|
||||||
|
}
|
||||||
|
ib[idx+1+(i*7)+0] += (u32)((reloc->lobj.gpu_offset) & 0xffffffff);
|
||||||
|
diff --git a/drivers/gpu/drm/radeon/r600d.h b/drivers/gpu/drm/radeon/r600d.h
|
||||||
|
index 84bc28e..9577945 100644
|
||||||
|
--- a/drivers/gpu/drm/radeon/r600d.h
|
||||||
|
+++ b/drivers/gpu/drm/radeon/r600d.h
|
||||||
|
@@ -51,6 +51,12 @@
|
||||||
|
#define PTE_READABLE (1 << 5)
|
||||||
|
#define PTE_WRITEABLE (1 << 6)
|
||||||
|
|
||||||
|
+/* tiling bits */
|
||||||
|
+#define ARRAY_LINEAR_GENERAL 0x00000000
|
||||||
|
+#define ARRAY_LINEAR_ALIGNED 0x00000001
|
||||||
|
+#define ARRAY_1D_TILED_THIN1 0x00000002
|
||||||
|
+#define ARRAY_2D_TILED_THIN1 0x00000004
|
||||||
|
+
|
||||||
|
/* Registers */
|
||||||
|
#define ARB_POP 0x2418
|
||||||
|
#define ENABLE_TC128 (1 << 30)
|
||||||
|
@@ -1155,6 +1161,10 @@
|
||||||
|
#define S_038000_TILE_MODE(x) (((x) & 0xF) << 3)
|
||||||
|
#define G_038000_TILE_MODE(x) (((x) >> 3) & 0xF)
|
||||||
|
#define C_038000_TILE_MODE 0xFFFFFF87
|
||||||
|
+#define V_038000_ARRAY_LINEAR_GENERAL 0x00000000
|
||||||
|
+#define V_038000_ARRAY_LINEAR_ALIGNED 0x00000001
|
||||||
|
+#define V_038000_ARRAY_1D_TILED_THIN1 0x00000002
|
||||||
|
+#define V_038000_ARRAY_2D_TILED_THIN1 0x00000004
|
||||||
|
#define S_038000_TILE_TYPE(x) (((x) & 0x1) << 7)
|
||||||
|
#define G_038000_TILE_TYPE(x) (((x) >> 7) & 0x1)
|
||||||
|
#define C_038000_TILE_TYPE 0xFFFFFF7F
|
||||||
|
@@ -1358,6 +1368,8 @@
|
||||||
|
#define S_028010_ARRAY_MODE(x) (((x) & 0xF) << 15)
|
||||||
|
#define G_028010_ARRAY_MODE(x) (((x) >> 15) & 0xF)
|
||||||
|
#define C_028010_ARRAY_MODE 0xFFF87FFF
|
||||||
|
+#define V_028010_ARRAY_1D_TILED_THIN1 0x00000002
|
||||||
|
+#define V_028010_ARRAY_2D_TILED_THIN1 0x00000004
|
||||||
|
#define S_028010_TILE_SURFACE_ENABLE(x) (((x) & 0x1) << 25)
|
||||||
|
#define G_028010_TILE_SURFACE_ENABLE(x) (((x) >> 25) & 0x1)
|
||||||
|
#define C_028010_TILE_SURFACE_ENABLE 0xFDFFFFFF
|
249
kernel-2.6.37-005-squashfs_revert_to_2.6.35.patch
Normal file
249
kernel-2.6.37-005-squashfs_revert_to_2.6.35.patch
Normal file
@ -0,0 +1,249 @@
|
|||||||
|
--- a/fs/squashfs/decompressor.c
|
||||||
|
+++ b/fs/squashfs/decompressor.c
|
||||||
|
@@ -40,11 +40,9 @@ static const struct squashfs_decompresso
|
||||||
|
NULL, NULL, NULL, LZMA_COMPRESSION, "lzma", 0
|
||||||
|
};
|
||||||
|
|
||||||
|
-#ifndef CONFIG_SQUASHFS_LZO
|
||||||
|
static const struct squashfs_decompressor squashfs_lzo_unsupported_comp_ops = {
|
||||||
|
NULL, NULL, NULL, LZO_COMPRESSION, "lzo", 0
|
||||||
|
};
|
||||||
|
-#endif
|
||||||
|
|
||||||
|
static const struct squashfs_decompressor squashfs_unknown_comp_ops = {
|
||||||
|
NULL, NULL, NULL, 0, "unknown", 0
|
||||||
|
@@ -53,11 +51,7 @@ static const struct squashfs_decompresso
|
||||||
|
static const struct squashfs_decompressor *decompressor[] = {
|
||||||
|
&squashfs_zlib_comp_ops,
|
||||||
|
&squashfs_lzma_unsupported_comp_ops,
|
||||||
|
-#ifdef CONFIG_SQUASHFS_LZO
|
||||||
|
- &squashfs_lzo_comp_ops,
|
||||||
|
-#else
|
||||||
|
&squashfs_lzo_unsupported_comp_ops,
|
||||||
|
-#endif
|
||||||
|
&squashfs_unknown_comp_ops
|
||||||
|
};
|
||||||
|
|
||||||
|
--- a/fs/squashfs/Kconfig
|
||||||
|
+++ b/fs/squashfs/Kconfig
|
||||||
|
@@ -5,13 +5,13 @@ config SQUASHFS
|
||||||
|
help
|
||||||
|
Saying Y here includes support for SquashFS 4.0 (a Compressed
|
||||||
|
Read-Only File System). Squashfs is a highly compressed read-only
|
||||||
|
- filesystem for Linux. It uses zlib/lzo compression to compress both
|
||||||
|
+ filesystem for Linux. It uses zlib compression to compress both
|
||||||
|
files, inodes and directories. Inodes in the system are very small
|
||||||
|
and all blocks are packed to minimise data overhead. Block sizes
|
||||||
|
greater than 4K are supported up to a maximum of 1 Mbytes (default
|
||||||
|
block size 128K). SquashFS 4.0 supports 64 bit filesystems and files
|
||||||
|
(larger than 4GB), full uid/gid information, hard links and
|
||||||
|
- timestamps.
|
||||||
|
+ timestamps.
|
||||||
|
|
||||||
|
Squashfs is intended for general read-only filesystem use, for
|
||||||
|
archival use (i.e. in cases where a .tar.gz file may be used), and in
|
||||||
|
@@ -26,7 +26,7 @@ config SQUASHFS
|
||||||
|
|
||||||
|
If unsure, say N.
|
||||||
|
|
||||||
|
-config SQUASHFS_XATTR
|
||||||
|
+config SQUASHFS_XATTRS
|
||||||
|
bool "Squashfs XATTR support"
|
||||||
|
depends on SQUASHFS
|
||||||
|
default n
|
||||||
|
@@ -37,24 +37,9 @@ config SQUASHFS_XATTR
|
||||||
|
|
||||||
|
If unsure, say N.
|
||||||
|
|
||||||
|
-config SQUASHFS_LZO
|
||||||
|
- bool "Include support for LZO compressed file systems"
|
||||||
|
- depends on SQUASHFS
|
||||||
|
- default n
|
||||||
|
- select LZO_DECOMPRESS
|
||||||
|
- help
|
||||||
|
- Saying Y here includes support for reading Squashfs file systems
|
||||||
|
- compressed with LZO compresssion. LZO compression is mainly
|
||||||
|
- aimed at embedded systems with slower CPUs where the overheads
|
||||||
|
- of zlib are too high.
|
||||||
|
-
|
||||||
|
- LZO is not the standard compression used in Squashfs and so most
|
||||||
|
- file systems will be readable without selecting this option.
|
||||||
|
-
|
||||||
|
- If unsure, say N.
|
||||||
|
-
|
||||||
|
config SQUASHFS_EMBEDDED
|
||||||
|
- bool "Additional option for memory-constrained systems"
|
||||||
|
+
|
||||||
|
+ bool "Additional option for memory-constrained systems"
|
||||||
|
depends on SQUASHFS
|
||||||
|
default n
|
||||||
|
help
|
||||||
|
--- a/fs/squashfs/lzo_wrapper.c
|
||||||
|
+++ /dev/null
|
||||||
|
@@ -1,136 +0,0 @@
|
||||||
|
-/*
|
||||||
|
- * Squashfs - a compressed read only filesystem for Linux
|
||||||
|
- *
|
||||||
|
- * Copyright (c) 2010 LG Electronics
|
||||||
|
- * Chan Jeong <chan.jeong@lge.com>
|
||||||
|
- *
|
||||||
|
- * This program is free software; you can redistribute it and/or
|
||||||
|
- * modify it under the terms of the GNU General Public License
|
||||||
|
- * as published by the Free Software Foundation; either version 2,
|
||||||
|
- * or (at your option) any later version.
|
||||||
|
- *
|
||||||
|
- * This program is distributed in the hope that it will be useful,
|
||||||
|
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
- * GNU General Public License for more details.
|
||||||
|
- *
|
||||||
|
- * You should have received a copy of the GNU General Public License
|
||||||
|
- * along with this program; if not, write to the Free Software
|
||||||
|
- * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
||||||
|
- *
|
||||||
|
- * lzo_wrapper.c
|
||||||
|
- */
|
||||||
|
-
|
||||||
|
-#include <linux/mutex.h>
|
||||||
|
-#include <linux/buffer_head.h>
|
||||||
|
-#include <linux/slab.h>
|
||||||
|
-#include <linux/vmalloc.h>
|
||||||
|
-#include <linux/lzo.h>
|
||||||
|
-
|
||||||
|
-#include "squashfs_fs.h"
|
||||||
|
-#include "squashfs_fs_sb.h"
|
||||||
|
-#include "squashfs_fs_i.h"
|
||||||
|
-#include "squashfs.h"
|
||||||
|
-#include "decompressor.h"
|
||||||
|
-
|
||||||
|
-struct squashfs_lzo {
|
||||||
|
- void *input;
|
||||||
|
- void *output;
|
||||||
|
-};
|
||||||
|
-
|
||||||
|
-static void *lzo_init(struct squashfs_sb_info *msblk)
|
||||||
|
-{
|
||||||
|
- int block_size = max_t(int, msblk->block_size, SQUASHFS_METADATA_SIZE);
|
||||||
|
-
|
||||||
|
- struct squashfs_lzo *stream = kzalloc(sizeof(*stream), GFP_KERNEL);
|
||||||
|
- if (stream == NULL)
|
||||||
|
- goto failed;
|
||||||
|
- stream->input = vmalloc(block_size);
|
||||||
|
- if (stream->input == NULL)
|
||||||
|
- goto failed;
|
||||||
|
- stream->output = vmalloc(block_size);
|
||||||
|
- if (stream->output == NULL)
|
||||||
|
- goto failed2;
|
||||||
|
-
|
||||||
|
- return stream;
|
||||||
|
-
|
||||||
|
-failed2:
|
||||||
|
- vfree(stream->input);
|
||||||
|
-failed:
|
||||||
|
- ERROR("Failed to allocate lzo workspace\n");
|
||||||
|
- kfree(stream);
|
||||||
|
- return NULL;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-static void lzo_free(void *strm)
|
||||||
|
-{
|
||||||
|
- struct squashfs_lzo *stream = strm;
|
||||||
|
-
|
||||||
|
- if (stream) {
|
||||||
|
- vfree(stream->input);
|
||||||
|
- vfree(stream->output);
|
||||||
|
- }
|
||||||
|
- kfree(stream);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-
|
||||||
|
-static int lzo_uncompress(struct squashfs_sb_info *msblk, void **buffer,
|
||||||
|
- struct buffer_head **bh, int b, int offset, int length, int srclength,
|
||||||
|
- int pages)
|
||||||
|
-{
|
||||||
|
- struct squashfs_lzo *stream = msblk->stream;
|
||||||
|
- void *buff = stream->input;
|
||||||
|
- int avail, i, bytes = length, res;
|
||||||
|
- size_t out_len = srclength;
|
||||||
|
-
|
||||||
|
- mutex_lock(&msblk->read_data_mutex);
|
||||||
|
-
|
||||||
|
- for (i = 0; i < b; i++) {
|
||||||
|
- wait_on_buffer(bh[i]);
|
||||||
|
- if (!buffer_uptodate(bh[i]))
|
||||||
|
- goto block_release;
|
||||||
|
-
|
||||||
|
- avail = min(bytes, msblk->devblksize - offset);
|
||||||
|
- memcpy(buff, bh[i]->b_data + offset, avail);
|
||||||
|
- buff += avail;
|
||||||
|
- bytes -= avail;
|
||||||
|
- offset = 0;
|
||||||
|
- put_bh(bh[i]);
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- res = lzo1x_decompress_safe(stream->input, (size_t)length,
|
||||||
|
- stream->output, &out_len);
|
||||||
|
- if (res != LZO_E_OK)
|
||||||
|
- goto failed;
|
||||||
|
-
|
||||||
|
- res = bytes = (int)out_len;
|
||||||
|
- for (i = 0, buff = stream->output; bytes && i < pages; i++) {
|
||||||
|
- avail = min_t(int, bytes, PAGE_CACHE_SIZE);
|
||||||
|
- memcpy(buffer[i], buff, avail);
|
||||||
|
- buff += avail;
|
||||||
|
- bytes -= avail;
|
||||||
|
- }
|
||||||
|
-
|
||||||
|
- mutex_unlock(&msblk->read_data_mutex);
|
||||||
|
- return res;
|
||||||
|
-
|
||||||
|
-block_release:
|
||||||
|
- for (; i < b; i++)
|
||||||
|
- put_bh(bh[i]);
|
||||||
|
-
|
||||||
|
-failed:
|
||||||
|
- mutex_unlock(&msblk->read_data_mutex);
|
||||||
|
-
|
||||||
|
- ERROR("lzo decompression failed, data probably corrupt\n");
|
||||||
|
- return -EIO;
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-const struct squashfs_decompressor squashfs_lzo_comp_ops = {
|
||||||
|
- .init = lzo_init,
|
||||||
|
- .free = lzo_free,
|
||||||
|
- .decompress = lzo_uncompress,
|
||||||
|
- .id = LZO_COMPRESSION,
|
||||||
|
- .name = "lzo",
|
||||||
|
- .supported = 1
|
||||||
|
-};
|
||||||
|
--- a/fs/squashfs/Makefile
|
||||||
|
+++ b/fs/squashfs/Makefile
|
||||||
|
@@ -5,5 +5,5 @@
|
||||||
|
obj-$(CONFIG_SQUASHFS) += squashfs.o
|
||||||
|
squashfs-y += block.o cache.o dir.o export.o file.o fragment.o id.o inode.o
|
||||||
|
squashfs-y += namei.o super.o symlink.o zlib_wrapper.o decompressor.o
|
||||||
|
-squashfs-$(CONFIG_SQUASHFS_XATTR) += xattr.o xattr_id.o
|
||||||
|
-squashfs-$(CONFIG_SQUASHFS_LZO) += lzo_wrapper.o
|
||||||
|
+squashfs-$(CONFIG_SQUASHFS_XATTRS) += xattr.o xattr_id.o
|
||||||
|
+
|
||||||
|
--- a/fs/squashfs/squashfs.h
|
||||||
|
+++ b/fs/squashfs/squashfs.h
|
||||||
|
@@ -104,6 +104,3 @@ extern const struct xattr_handler *squas
|
||||||
|
|
||||||
|
/* zlib_wrapper.c */
|
||||||
|
extern const struct squashfs_decompressor squashfs_zlib_comp_ops;
|
||||||
|
-
|
||||||
|
-/* lzo_wrapper.c */
|
||||||
|
-extern const struct squashfs_decompressor squashfs_lzo_comp_ops;
|
||||||
|
--- a/fs/squashfs/xattr.h
|
||||||
|
+++ b/fs/squashfs/xattr.h
|
||||||
|
@@ -21,7 +21,7 @@
|
||||||
|
* xattr.h
|
||||||
|
*/
|
||||||
|
|
||||||
|
-#ifdef CONFIG_SQUASHFS_XATTR
|
||||||
|
+#ifdef CONFIG_SQUASHFS_XATTRS
|
||||||
|
extern __le64 *squashfs_read_xattr_id_table(struct super_block *, u64,
|
||||||
|
u64 *, int *);
|
||||||
|
extern int squashfs_xattr_lookup(struct super_block *, unsigned int, int *,
|
86
kernel-2.6.37.1-radeon_flickering_fix.patch
Normal file
86
kernel-2.6.37.1-radeon_flickering_fix.patch
Normal file
@ -0,0 +1,86 @@
|
|||||||
|
From 32f519d32ca9ca0f84e81953c8d9ddefdb7771d3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Date: Sun, 13 Feb 2011 18:38:23 -0500
|
||||||
|
Subject: [PATCH] drm/radeon/kms: hopefully fix pll issues for real (v3)
|
||||||
|
|
||||||
|
The problematic boards have a recommended reference divider
|
||||||
|
to be used when spread spectrum is enabled on the laptop panel.
|
||||||
|
Enable the use of the recommended reference divider along with
|
||||||
|
the new pll algo.
|
||||||
|
|
||||||
|
v2: testing options
|
||||||
|
|
||||||
|
v3: When using the fixed reference divider with
|
||||||
|
LVDS, prefer min m to max p and use fractional feedback dividers.
|
||||||
|
|
||||||
|
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
|
||||||
|
Cc: stable@kernel.org
|
||||||
|
---
|
||||||
|
drivers/gpu/drm/radeon/atombios_crtc.c | 22 ++++++++--------------
|
||||||
|
1 files changed, 8 insertions(+), 14 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/gpu/drm/radeon/atombios_crtc.c b/drivers/gpu/drm/radeon/atombios_crtc.c
|
||||||
|
index 1bf6122..3127a28 100644
|
||||||
|
--- a/drivers/gpu/drm/radeon/atombios_crtc.c
|
||||||
|
+++ b/drivers/gpu/drm/radeon/atombios_crtc.c
|
||||||
|
@@ -538,7 +538,6 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
|
||||||
|
pll->flags |= RADEON_PLL_PREFER_HIGH_FB_DIV;
|
||||||
|
else
|
||||||
|
pll->flags |= RADEON_PLL_PREFER_LOW_REF_DIV;
|
||||||
|
-
|
||||||
|
}
|
||||||
|
|
||||||
|
list_for_each_entry(encoder, &dev->mode_config.encoder_list, head) {
|
||||||
|
@@ -555,29 +554,28 @@ static u32 atombios_adjust_pll(struct drm_crtc *crtc,
|
||||||
|
dp_clock = dig_connector->dp_clock;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-/* this might work properly with the new pll algo */
|
||||||
|
-#if 0 /* doesn't work properly on some laptops */
|
||||||
|
+
|
||||||
|
/* use recommended ref_div for ss */
|
||||||
|
if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT)) {
|
||||||
|
+ pll->flags |= RADEON_PLL_PREFER_MINM_OVER_MAXP;
|
||||||
|
if (ss_enabled) {
|
||||||
|
if (ss->refdiv) {
|
||||||
|
pll->flags |= RADEON_PLL_USE_REF_DIV;
|
||||||
|
pll->reference_div = ss->refdiv;
|
||||||
|
+ if (ASIC_IS_AVIVO(rdev))
|
||||||
|
+ pll->flags |= RADEON_PLL_USE_FRAC_FB_DIV;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
-#endif
|
||||||
|
+
|
||||||
|
if (ASIC_IS_AVIVO(rdev)) {
|
||||||
|
/* DVO wants 2x pixel clock if the DVO chip is in 12 bit mode */
|
||||||
|
if (radeon_encoder->encoder_id == ENCODER_OBJECT_ID_INTERNAL_KLDSCP_DVO1)
|
||||||
|
adjusted_clock = mode->clock * 2;
|
||||||
|
if (radeon_encoder->active_device & (ATOM_DEVICE_TV_SUPPORT))
|
||||||
|
pll->flags |= RADEON_PLL_PREFER_CLOSEST_LOWER;
|
||||||
|
- /* rv515 needs more testing with this option */
|
||||||
|
- if (rdev->family != CHIP_RV515) {
|
||||||
|
- if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
|
||||||
|
- pll->flags |= RADEON_PLL_IS_LCD;
|
||||||
|
- }
|
||||||
|
+ if (radeon_encoder->devices & (ATOM_DEVICE_LCD_SUPPORT))
|
||||||
|
+ pll->flags |= RADEON_PLL_IS_LCD;
|
||||||
|
} else {
|
||||||
|
if (encoder->encoder_type != DRM_MODE_ENCODER_DAC)
|
||||||
|
pll->flags |= RADEON_PLL_NO_ODD_POST_DIV;
|
||||||
|
@@ -957,11 +955,7 @@ static void atombios_crtc_set_pll(struct drm_crtc *crtc, struct drm_display_mode
|
||||||
|
/* adjust pixel clock as needed */
|
||||||
|
adjusted_clock = atombios_adjust_pll(crtc, mode, pll, ss_enabled, &ss);
|
||||||
|
|
||||||
|
- /* rv515 seems happier with the old algo */
|
||||||
|
- if (rdev->family == CHIP_RV515)
|
||||||
|
- radeon_compute_pll_legacy(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
|
||||||
|
- &ref_div, &post_div);
|
||||||
|
- else if (ASIC_IS_AVIVO(rdev))
|
||||||
|
+ if (ASIC_IS_AVIVO(rdev))
|
||||||
|
radeon_compute_pll_avivo(pll, adjusted_clock, &pll_clock, &fb_div, &frac_fb_div,
|
||||||
|
&ref_div, &post_div);
|
||||||
|
else
|
||||||
|
--
|
||||||
|
1.7.1.1
|
||||||
|
|
60
kernel-2.6.38.6-arm-rtlwifi-eliminate_udelay.patch
Normal file
60
kernel-2.6.38.6-arm-rtlwifi-eliminate_udelay.patch
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
From 8c6113cd03c7e927f5ee5f6ad98e155ef2d27177 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Willy Tarreau <w@1wt.eu>
|
||||||
|
Date: Sun, 20 Feb 2011 11:43:36 +0100
|
||||||
|
Subject: [PATCH] rtlwifi: Eliminate udelay calls with too large values
|
||||||
|
|
||||||
|
On ARM, compilation of rtlwifi/efuse.c fails with the message:
|
||||||
|
ERROR: "__bad_udelay" [drivers/net/wireless/rtlwifi/rtlwifi.ko] undefined!
|
||||||
|
On inspection, the faulty calls are in routine efuse_reset_loader(), a
|
||||||
|
routine that is never used, and the faulty routine is deleted.
|
||||||
|
|
||||||
|
Signed-off-by: Willy Tarreau <w@1wt.eu>
|
||||||
|
Signed-off-by: Larry Finger <Larry.Finger@lwfinger.net>
|
||||||
|
Signed-off-by: John W. Linville <linville@tuxdriver.com>
|
||||||
|
---
|
||||||
|
drivers/net/wireless/rtlwifi/efuse.c | 18 ------------------
|
||||||
|
drivers/net/wireless/rtlwifi/efuse.h | 3 ---
|
||||||
|
2 files changed, 0 insertions(+), 21 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/net/wireless/rtlwifi/efuse.c b/drivers/net/wireless/rtlwifi/efuse.c
|
||||||
|
index 62876cd..4f92cba 100644
|
||||||
|
--- a/drivers/net/wireless/rtlwifi/efuse.c
|
||||||
|
+++ b/drivers/net/wireless/rtlwifi/efuse.c
|
||||||
|
@@ -1169,21 +1169,3 @@ static u8 efuse_calculate_word_cnts(u8 word_en)
|
||||||
|
return word_cnts;
|
||||||
|
}
|
||||||
|
|
||||||
|
-void efuse_reset_loader(struct ieee80211_hw *hw)
|
||||||
|
-{
|
||||||
|
- struct rtl_priv *rtlpriv = rtl_priv(hw);
|
||||||
|
- u16 tmp_u2b;
|
||||||
|
-
|
||||||
|
- tmp_u2b = rtl_read_word(rtlpriv, rtlpriv->cfg->maps[SYS_FUNC_EN]);
|
||||||
|
- rtl_write_word(rtlpriv, rtlpriv->cfg->maps[SYS_FUNC_EN],
|
||||||
|
- (tmp_u2b & ~(BIT(12))));
|
||||||
|
- udelay(10000);
|
||||||
|
- rtl_write_word(rtlpriv, rtlpriv->cfg->maps[SYS_FUNC_EN],
|
||||||
|
- (tmp_u2b | BIT(12)));
|
||||||
|
- udelay(10000);
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
-bool efuse_program_map(struct ieee80211_hw *hw, char *p_filename, u8 tabletype)
|
||||||
|
-{
|
||||||
|
- return true;
|
||||||
|
-}
|
||||||
|
diff --git a/drivers/net/wireless/rtlwifi/efuse.h b/drivers/net/wireless/rtlwifi/efuse.h
|
||||||
|
index 2d39a4d..47774dd 100644
|
||||||
|
--- a/drivers/net/wireless/rtlwifi/efuse.h
|
||||||
|
+++ b/drivers/net/wireless/rtlwifi/efuse.h
|
||||||
|
@@ -117,8 +117,5 @@ extern bool efuse_shadow_update_chk(struct ieee80211_hw *hw);
|
||||||
|
extern void rtl_efuse_shadow_map_update(struct ieee80211_hw *hw);
|
||||||
|
extern void efuse_force_write_vendor_Id(struct ieee80211_hw *hw);
|
||||||
|
extern void efuse_re_pg_section(struct ieee80211_hw *hw, u8 section_idx);
|
||||||
|
-extern bool efuse_program_map(struct ieee80211_hw *hw,
|
||||||
|
- char *p_filename, u8 tabletype);
|
||||||
|
-extern void efuse_reset_loader(struct ieee80211_hw *hw);
|
||||||
|
|
||||||
|
#endif
|
||||||
|
--
|
||||||
|
1.7.5.1
|
||||||
|
|
@ -0,0 +1,22 @@
|
|||||||
|
diff --git a/mm/vmscan.c b/mm/vmscan.c
|
||||||
|
index b55699c..3817fa9 100644
|
||||||
|
--- a/mm/vmscan.c
|
||||||
|
+++ b/mm/vmscan.c
|
||||||
|
@@ -2066,6 +2066,16 @@ static void shrink_zones(int priority, struct zonelist *zonelist,
|
||||||
|
continue;
|
||||||
|
if (zone->all_unreclaimable && priority != DEF_PRIORITY)
|
||||||
|
continue; /* Let kswapd poll it */
|
||||||
|
+ if (COMPACTION_BUILD) {
|
||||||
|
+ /*
|
||||||
|
+ * If we already have plenty of memory free
|
||||||
|
+ * for compaction, don't free any more.
|
||||||
|
+ */
|
||||||
|
+ if (sc->order > PAGE_ALLOC_COSTLY_ORDER &&
|
||||||
|
+ (compaction_suitable(zone, sc->order) ||
|
||||||
|
+ compaction_deferred(zone)))
|
||||||
|
+ continue;
|
||||||
|
+ }
|
||||||
|
/*
|
||||||
|
* This steals pages from memory cgroups over softlimit
|
||||||
|
* and returns the number of reclaimed pages and
|
||||||
|
|
@ -0,0 +1,63 @@
|
|||||||
|
diff --git a/mm/vmscan.c b/mm/vmscan.c
|
||||||
|
index 3817fa9..522f205 100644
|
||||||
|
--- a/mm/vmscan.c
|
||||||
|
+++ b/mm/vmscan.c
|
||||||
|
@@ -2044,14 +2044,19 @@ restart:
|
||||||
|
*
|
||||||
|
* If a zone is deemed to be full of pinned pages then just give it a light
|
||||||
|
* scan then give up on it.
|
||||||
|
+ *
|
||||||
|
+ * This function returns true if a zone is being reclaimed for a costly
|
||||||
|
+ * high-order allocation and compaction is either ready to begin or deferred.
|
||||||
|
+ * This indicates to the caller that it should retry the allocation or fail.
|
||||||
|
*/
|
||||||
|
-static void shrink_zones(int priority, struct zonelist *zonelist,
|
||||||
|
+static bool shrink_zones(int priority, struct zonelist *zonelist,
|
||||||
|
struct scan_control *sc)
|
||||||
|
{
|
||||||
|
struct zoneref *z;
|
||||||
|
struct zone *zone;
|
||||||
|
unsigned long nr_soft_reclaimed;
|
||||||
|
unsigned long nr_soft_scanned;
|
||||||
|
+ bool should_abort_reclaim = false;
|
||||||
|
|
||||||
|
for_each_zone_zonelist_nodemask(zone, z, zonelist,
|
||||||
|
gfp_zone(sc->gfp_mask), sc->nodemask) {
|
||||||
|
@@ -2069,12 +2074,15 @@ static void shrink_zones(int priority, struct zonelist *zonelist,
|
||||||
|
if (COMPACTION_BUILD) {
|
||||||
|
/*
|
||||||
|
* If we already have plenty of memory free
|
||||||
|
- * for compaction, don't free any more.
|
||||||
|
+ * for compaction in this zone , don't free any
|
||||||
|
+ * more.
|
||||||
|
*/
|
||||||
|
if (sc->order > PAGE_ALLOC_COSTLY_ORDER &&
|
||||||
|
(compaction_suitable(zone, sc->order) ||
|
||||||
|
- compaction_deferred(zone)))
|
||||||
|
+ compaction_deferred(zone))) {
|
||||||
|
+ should_abort_reclaim = true;
|
||||||
|
continue;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* This steals pages from memory cgroups over softlimit
|
||||||
|
@@ -2093,6 +2101,8 @@ static void shrink_zones(int priority, struct zonelist *zonelist,
|
||||||
|
|
||||||
|
shrink_zone(priority, zone, sc);
|
||||||
|
}
|
||||||
|
+
|
||||||
|
+ return should_abort_reclaim;
|
||||||
|
}
|
||||||
|
|
||||||
|
static bool zone_reclaimable(struct zone *zone)
|
||||||
|
@@ -2157,7 +2167,9 @@ static unsigned long do_try_to_free_pages(struct zonelist *zonelist,
|
||||||
|
sc->nr_scanned = 0;
|
||||||
|
if (!priority)
|
||||||
|
disable_swap_token(sc->mem_cgroup);
|
||||||
|
- shrink_zones(priority, zonelist, sc);
|
||||||
|
+ if (shrink_zones(priority, zonelist, sc))
|
||||||
|
+ break;
|
||||||
|
+
|
||||||
|
/*
|
||||||
|
* Don't shrink slabs when reclaiming memory from
|
||||||
|
* over limit cgroups
|
@ -0,0 +1,21 @@
|
|||||||
|
diff --git a/arch/x86/kernel/microcode_core.c b/arch/x86/kernel/microcode_core.c
|
||||||
|
index f924280..cd7ef2f 100644
|
||||||
|
--- a/arch/x86/kernel/microcode_core.c
|
||||||
|
+++ b/arch/x86/kernel/microcode_core.c
|
||||||
|
@@ -483,7 +483,15 @@ mc_cpu_callback(struct notifier_block *nb, unsigned long action, void *hcpu)
|
||||||
|
sysfs_remove_group(&sys_dev->kobj, &mc_attr_group);
|
||||||
|
pr_debug("CPU%d removed\n", cpu);
|
||||||
|
break;
|
||||||
|
- case CPU_DEAD:
|
||||||
|
+
|
||||||
|
+ /*
|
||||||
|
+ * Do not invalidate the microcode if a CPU goes offline,
|
||||||
|
+ * because it would be impossible to get the microcode again
|
||||||
|
+ * from userspace when the CPU comes back up, if the userspace
|
||||||
|
+ * happens to be frozen at that moment by the freezer subsystem,
|
||||||
|
+ * for example, due to a suspend operation in progress.
|
||||||
|
+ */
|
||||||
|
+
|
||||||
|
case CPU_UP_CANCELED_FROZEN:
|
||||||
|
/* The CPU refused to come up during a system resume */
|
||||||
|
microcode_fini_cpu(cpu);
|
22
kernel-3.1-arm_missing_includes.patch
Normal file
22
kernel-3.1-arm_missing_includes.patch
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
diff -ru kernel-2.6.38mamba-arm.orig//drivers/dma/pch_dma.c kernel-2.6.38mamba-arm/drivers/dma/pch_dma.c
|
||||||
|
--- kernel-2.6.38mamba-arm.orig//drivers/dma/pch_dma.c 2011-05-14 16:12:25.650768202 +0200
|
||||||
|
+++ kernel-2.6.38mamba-arm/drivers/dma/pch_dma.c 2011-05-14 16:08:03.266987477 +0200
|
||||||
|
@@ -24,6 +24,7 @@
|
||||||
|
#include <linux/interrupt.h>
|
||||||
|
#include <linux/module.h>
|
||||||
|
#include <linux/pch_dma.h>
|
||||||
|
+#include <linux/slab.h>
|
||||||
|
|
||||||
|
#define DRV_NAME "pch-dma"
|
||||||
|
|
||||||
|
diff -ru kernel-2.6.38mamba-arm.orig//drivers/gpio/gpio-ml-ioh.c kernel-2.6.38mamba-arm/drivers/gpio/ml_ioh_gpio.c
|
||||||
|
--- kernel-2.6.38mamba-arm.orig//drivers/gpio/gpio-ml-ioh.c 2011-05-14 16:12:49.406381203 +0200
|
||||||
|
+++ kernel-2.6.38mamba-arm/drivers/gpio/gpio-ml-ioh.c 2011-05-14 16:07:17.392970223 +0200
|
||||||
|
@@ -17,6 +17,7 @@
|
||||||
|
#include <linux/kernel.h>
|
||||||
|
#include <linux/pci.h>
|
||||||
|
#include <linux/gpio.h>
|
||||||
|
+#include <linux/slab.h>
|
||||||
|
|
||||||
|
#define PCI_VENDOR_ID_ROHM 0x10DB
|
||||||
|
|
7277
kernel-3.10-mamba-64GB-i586-config
Normal file
7277
kernel-3.10-mamba-64GB-i586-config
Normal file
File diff suppressed because it is too large
Load Diff
6121
kernel-3.10-mamba-arm-kirkwood-config
Normal file
6121
kernel-3.10-mamba-arm-kirkwood-config
Normal file
File diff suppressed because it is too large
Load Diff
7284
kernel-3.10-mamba-i586-config
Normal file
7284
kernel-3.10-mamba-i586-config
Normal file
File diff suppressed because it is too large
Load Diff
4589
kernel-3.10-mamba-ppc-config
Normal file
4589
kernel-3.10-mamba-ppc-config
Normal file
File diff suppressed because it is too large
Load Diff
7025
kernel-3.10-mamba-x86_64-config
Normal file
7025
kernel-3.10-mamba-x86_64-config
Normal file
File diff suppressed because it is too large
Load Diff
6813
kernel-3.10-mamba-x86_64-rt-config
Normal file
6813
kernel-3.10-mamba-x86_64-rt-config
Normal file
File diff suppressed because it is too large
Load Diff
4819
kernel-3.10-mamba-xen-x86_64-config
Normal file
4819
kernel-3.10-mamba-xen-x86_64-config
Normal file
File diff suppressed because it is too large
Load Diff
12
kernel-3.10.2-arm-mtd_omap2_allow_building_as_a_module.patch
Normal file
12
kernel-3.10.2-arm-mtd_omap2_allow_building_as_a_module.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
--- kernel-3.10mamba-arm/drivers/mtd/nand/Kconfig.orig 2013-07-01 00:13:29.000000000 +0200
|
||||||
|
+++ kernel-3.10mamba-arm/drivers/mtd/nand/Kconfig 2013-07-23 12:33:22.442708624 +0200
|
||||||
|
@@ -95,8 +95,7 @@
|
||||||
|
|
||||||
|
config MTD_NAND_OMAP_BCH
|
||||||
|
depends on MTD_NAND && MTD_NAND_OMAP2 && ARCH_OMAP3
|
||||||
|
- bool "Enable support for hardware BCH error correction"
|
||||||
|
- default n
|
||||||
|
+ tristate "Enable support for hardware BCH error correction"
|
||||||
|
select BCH
|
||||||
|
select BCH_CONST_PARAMS
|
||||||
|
help
|
7269
kernel-3.10.5-mamba-64GB-rt-i586-config
Normal file
7269
kernel-3.10.5-mamba-64GB-rt-i586-config
Normal file
File diff suppressed because it is too large
Load Diff
7276
kernel-3.10.5-mamba-rt-i586-config
Normal file
7276
kernel-3.10.5-mamba-rt-i586-config
Normal file
File diff suppressed because it is too large
Load Diff
6623
kernel-3.10.6-mamba-arm-config
Normal file
6623
kernel-3.10.6-mamba-arm-config
Normal file
File diff suppressed because it is too large
Load Diff
12
kernel-3.2-arm_remove_BUILD_BUG_ON_from_bug_h.patch
Normal file
12
kernel-3.2-arm_remove_BUILD_BUG_ON_from_bug_h.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/arch/arm/include/asm/bug.h b/arch/arm/include/asm/bug.h
|
||||||
|
index 9abe7a0..fac79dc 100644
|
||||||
|
--- a/arch/arm/include/asm/bug.h
|
||||||
|
+++ b/arch/arm/include/asm/bug.h
|
||||||
|
@@ -32,7 +32,6 @@
|
||||||
|
|
||||||
|
#define __BUG(__file, __line, __value) \
|
||||||
|
do { \
|
||||||
|
- BUILD_BUG_ON(sizeof(struct bug_entry) != 12); \
|
||||||
|
asm volatile("1:\t" BUG_INSTR_TYPE #__value "\n" \
|
||||||
|
".pushsection .rodata.str, \"aMS\", %progbits, 1\n" \
|
||||||
|
"2:\t.asciz " #__file "\n" \
|
2116
kernel-3.2-elantech.patch
Normal file
2116
kernel-3.2-elantech.patch
Normal file
File diff suppressed because it is too large
Load Diff
18
kernel-3.2-option_add_Huawey-E352.patch
Normal file
18
kernel-3.2-option_add_Huawey-E352.patch
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
--- kernel-3.2mamba/drivers/usb/serial/option.c.orig 2012-08-23 15:56:44.365815308 +0200
|
||||||
|
+++ kernel-3.2mamba/drivers/usb/serial/option.c 2012-08-23 16:03:43.626467553 +0200
|
||||||
|
@@ -156,6 +156,7 @@
|
||||||
|
#define HUAWEI_PRODUCT_K4510 0x14CB
|
||||||
|
#define HUAWEI_PRODUCT_K4511 0x14CC
|
||||||
|
#define HUAWEI_PRODUCT_ETS1220 0x1803
|
||||||
|
+#define HUAWEI_PRODUCT_E352 0x1444
|
||||||
|
#define HUAWEI_PRODUCT_E353 0x1506
|
||||||
|
#define HUAWEI_PRODUCT_E173S 0x1C05
|
||||||
|
|
||||||
|
@@ -700,6 +701,7 @@
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4510, 0xff, 0x01, 0x32) },
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4511, 0xff, 0x01, 0x31) },
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_K4511, 0xff, 0x01, 0x32) },
|
||||||
|
+ { USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E352, 0xff, 0xff, 0xff) },
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x01) },
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x02) },
|
||||||
|
{ USB_DEVICE_AND_INTERFACE_INFO(HUAWEI_VENDOR_ID, HUAWEI_PRODUCT_E353, 0xff, 0x01, 0x03) },
|
10
kernel-3.2.1-8139cp.patch
Normal file
10
kernel-3.2.1-8139cp.patch
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
--- kernel-2.6.19mamba/drivers/net/ethernet/realtek/8139cp.orig 2006-11-30 19:33:18.000000000 +0100
|
||||||
|
+++ kernel-2.6.19mamba/drivers/net/ethernet/realtek/8139cp.c 2006-11-30 19:33:26.000000000 +0100
|
||||||
|
@@ -401,7 +401,6 @@
|
||||||
|
struct ethtool_eeprom *eeprom, u8 *data);
|
||||||
|
|
||||||
|
static DEFINE_PCI_DEVICE_TABLE(cp_pci_tbl) = {
|
||||||
|
- { PCI_DEVICE(PCI_VENDOR_ID_REALTEK, PCI_DEVICE_ID_REALTEK_8139), },
|
||||||
|
{ PCI_DEVICE(PCI_VENDOR_ID_TTTECH, PCI_DEVICE_ID_TTTECH_MC322), },
|
||||||
|
{ },
|
||||||
|
};
|
16
kernel-3.2.1-rtl8139too.patch
Normal file
16
kernel-3.2.1-rtl8139too.patch
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
diff -Nru kernel-2.6.28mamba.orig/drivers/net/8139too.c kernel-2.6.28mamba/drivers/net/8139too.c
|
||||||
|
--- kernel-2.6.28mamba.orig/drivers/net/ethernet/realtek/8139too.c 2008-12-25 00:26:37.000000000 +0100
|
||||||
|
+++ kernel-2.6.28mamba/drivers/net/ethernet/realtek/8139too.c 2009-10-14 15:09:02.000000000 +0200
|
||||||
|
@@ -946,9 +946,10 @@
|
||||||
|
if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
|
||||||
|
pdev->device == PCI_DEVICE_ID_REALTEK_8139 && pdev->revision >= 0x20) {
|
||||||
|
dev_info(&pdev->dev,
|
||||||
|
- "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip, use 8139cp\n",
|
||||||
|
+ "This (id %04x:%04x rev %02x) is an enhanced 8139C+ chip\n",
|
||||||
|
pdev->vendor, pdev->device, pdev->revision);
|
||||||
|
- return -ENODEV;
|
||||||
|
+ dev_info(&pdev->dev,
|
||||||
|
+ "Use the \"8139cp\" driver for improved performance and stability.\n");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (pdev->vendor == PCI_VENDOR_ID_REALTEK &&
|
36
kernel-3.2.16-ipw2200_fix.patch
Normal file
36
kernel-3.2.16-ipw2200_fix.patch
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
|
||||||
|
index 4130802..8cbafa5 100644
|
||||||
|
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
|
||||||
|
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
|
||||||
|
@@ -2192,6 +2192,7 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
|
||||||
|
{
|
||||||
|
int rc = 0;
|
||||||
|
unsigned long flags;
|
||||||
|
+ unsigned long now, end;
|
||||||
|
|
||||||
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
|
if (priv->status & STATUS_HCMD_ACTIVE) {
|
||||||
|
@@ -2233,10 +2234,20 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
|
||||||
|
}
|
||||||
|
spin_unlock_irqrestore(&priv->lock, flags);
|
||||||
|
|
||||||
|
+ now = jiffies;
|
||||||
|
+ end = now + HOST_COMPLETE_TIMEOUT;
|
||||||
|
+again:
|
||||||
|
rc = wait_event_interruptible_timeout(priv->wait_command_queue,
|
||||||
|
!(priv->
|
||||||
|
status & STATUS_HCMD_ACTIVE),
|
||||||
|
- HOST_COMPLETE_TIMEOUT);
|
||||||
|
+ end - now);
|
||||||
|
+ if (rc < 0) {
|
||||||
|
+ now = jiffies;
|
||||||
|
+ if (time_before(now, end))
|
||||||
|
+ goto again;
|
||||||
|
+ rc = 0;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
if (rc == 0) {
|
||||||
|
spin_lock_irqsave(&priv->lock, flags);
|
||||||
|
if (priv->status & STATUS_HCMD_ACTIVE) {
|
||||||
|
--
|
||||||
|
1.7.2.5
|
13
kernel-3.2.9-asix_sitecom_ln_031.patch
Normal file
13
kernel-3.2.9-asix_sitecom_ln_031.patch
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
--- kernel-3.2mamba/drivers/net/usb/asix.c.orig 2012-03-11 17:40:47.570425305 +0100
|
||||||
|
+++ kernel-3.2mamba/drivers/net/usb/asix.c 2012-03-11 18:02:23.178248012 +0100
|
||||||
|
@@ -1580,6 +1580,10 @@
|
||||||
|
USB_DEVICE (0x6189, 0x182d),
|
||||||
|
.driver_info = (unsigned long) &ax8817x_info,
|
||||||
|
}, {
|
||||||
|
+ // Sitecom LN-031 "USB 2.0 10/100/1000 Ethernet adapter"
|
||||||
|
+ USB_DEVICE (0x0df6, 0x0056),
|
||||||
|
+ .driver_info = (unsigned long) &ax88178_info,
|
||||||
|
+}, {
|
||||||
|
// corega FEther USB2-TX
|
||||||
|
USB_DEVICE (0x07aa, 0x0017),
|
||||||
|
.driver_info = (unsigned long) &ax8817x_info,
|
@ -0,0 +1,42 @@
|
|||||||
|
From 64e16e442b7d33801b5c1a41cf5c87d4d8ff1e10 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Zhang Rui <rui.zhang@intel.com>
|
||||||
|
Date: Fri, 30 Nov 2012 14:35:43 +0800
|
||||||
|
Subject: [PATCH 1/2] ACPI : do not use Lid and Sleep button for S5 wakeup
|
||||||
|
|
||||||
|
We should not use Lid and Sleep button for S5 wakeup
|
||||||
|
https://bugzilla.kernel.org/show_bug.cgi?id=35262
|
||||||
|
|
||||||
|
Signed-off-by: Zhang Rui <rui.zhang@intel.com>
|
||||||
|
---
|
||||||
|
drivers/acpi/scan.c | 7 ++++++-
|
||||||
|
1 file changed, 6 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c
|
||||||
|
index d1ecca2..35674c2 100644
|
||||||
|
--- a/drivers/acpi/scan.c
|
||||||
|
+++ b/drivers/acpi/scan.c
|
||||||
|
@@ -807,8 +807,8 @@ acpi_bus_extract_wakeup_device_power_package(acpi_handle handle,
|
||||||
|
static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
|
||||||
|
{
|
||||||
|
struct acpi_device_id button_device_ids[] = {
|
||||||
|
- {"PNP0C0D", 0},
|
||||||
|
{"PNP0C0C", 0},
|
||||||
|
+ {"PNP0C0D", 0},
|
||||||
|
{"PNP0C0E", 0},
|
||||||
|
{"", 0},
|
||||||
|
};
|
||||||
|
@@ -820,6 +820,11 @@ static void acpi_bus_set_run_wake_flags(struct acpi_device *device)
|
||||||
|
/* Power button, Lid switch always enable wakeup */
|
||||||
|
if (!acpi_match_device_ids(device, button_device_ids)) {
|
||||||
|
device->wakeup.flags.run_wake = 1;
|
||||||
|
+ if (!acpi_match_device_ids(device, &button_device_ids[1])) {
|
||||||
|
+ /* Do not use Lid/sleep button for S5 wakeup */
|
||||||
|
+ if (device->wakeup.sleep_state == ACPI_STATE_S5)
|
||||||
|
+ device->wakeup.sleep_state = ACPI_STATE_S4;
|
||||||
|
+ }
|
||||||
|
device_set_wakeup_capable(&device->dev, true);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
--
|
||||||
|
1.7.9.5
|
||||||
|
|
68
kernel-3.7.1-libata_restore_acpi_disable_functionality.patch
Normal file
68
kernel-3.7.1-libata_restore_acpi_disable_functionality.patch
Normal file
@ -0,0 +1,68 @@
|
|||||||
|
From 0d0cdb028f9d9771e2b346038707734121f906e3 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Aaron Lu <aaron.lu@intel.com>
|
||||||
|
Date: Mon, 26 Nov 2012 13:55:25 +0800
|
||||||
|
Subject: [PATCH] libata: restore acpi disable functionality
|
||||||
|
|
||||||
|
Commit 66fa7f215 "libata-acpi: improve ACPI disabling" introdcued the
|
||||||
|
behaviour of disabling ATA ACPI if ata_acpi_on_devcfg failed the 2nd
|
||||||
|
time, but commit 30dcf76ac dropped this behaviour and this caused
|
||||||
|
problem for Dimitris Damigos, where his laptop can not resume correctly.
|
||||||
|
|
||||||
|
The bugzilla page for it is:
|
||||||
|
https://bugzilla.kernel.org/show_bug.cgi?id=49331
|
||||||
|
|
||||||
|
The problem is, ata_dev_push_id will fail the 2nd time it is invoked,
|
||||||
|
and due to disabling ACPI code is dropped, ata_acpi_on_devcfg which
|
||||||
|
calls ata_dev_push_id will keep failing and eventually made the device
|
||||||
|
disabled.
|
||||||
|
|
||||||
|
This patch restores the original behaviour, if acpi failed the 2nd time,
|
||||||
|
disable acpi functionality for the device(and we do not event need to
|
||||||
|
add a debug message for this as it is still there ;-).
|
||||||
|
|
||||||
|
Reported-by: Dimitris Damigos <damigos@freemail.gr>
|
||||||
|
Signed-off-by: Aaron Lu <aaron.lu@intel.com>
|
||||||
|
Cc: <stable@vger.kernel.org>
|
||||||
|
Signed-off-by: Jeff Garzik <jgarzik@redhat.com>
|
||||||
|
---
|
||||||
|
drivers/ata/libata-acpi.c | 4 ++++
|
||||||
|
include/linux/libata.h | 1 +
|
||||||
|
2 files changed, 5 insertions(+), 0 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/drivers/ata/libata-acpi.c b/drivers/ata/libata-acpi.c
|
||||||
|
index 5b0ba3f..ef01ac0 100644
|
||||||
|
--- a/drivers/ata/libata-acpi.c
|
||||||
|
+++ b/drivers/ata/libata-acpi.c
|
||||||
|
@@ -76,6 +76,9 @@ acpi_handle ata_dev_acpi_handle(struct ata_device *dev)
|
||||||
|
acpi_integer adr;
|
||||||
|
struct ata_port *ap = dev->link->ap;
|
||||||
|
|
||||||
|
+ if (dev->flags & ATA_DFLAG_ACPI_DISABLED)
|
||||||
|
+ return NULL;
|
||||||
|
+
|
||||||
|
if (ap->flags & ATA_FLAG_ACPI_SATA) {
|
||||||
|
if (!sata_pmp_attached(ap))
|
||||||
|
adr = SATA_ADR(ap->port_no, NO_PORT_MULT);
|
||||||
|
@@ -945,6 +948,7 @@ int ata_acpi_on_devcfg(struct ata_device *dev)
|
||||||
|
return rc;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ dev->flags |= ATA_DFLAG_ACPI_DISABLED;
|
||||||
|
ata_dev_warn(dev, "ACPI: failed the second time, disabled\n");
|
||||||
|
|
||||||
|
/* We can safely continue if no _GTF command has been executed
|
||||||
|
diff --git a/include/linux/libata.h b/include/linux/libata.h
|
||||||
|
index 77eeeda..e931c9a 100644
|
||||||
|
--- a/include/linux/libata.h
|
||||||
|
+++ b/include/linux/libata.h
|
||||||
|
@@ -163,6 +163,7 @@ enum {
|
||||||
|
|
||||||
|
ATA_DFLAG_DA = (1 << 26), /* device supports Device Attention */
|
||||||
|
ATA_DFLAG_DEVSLP = (1 << 27), /* device supports Device Sleep */
|
||||||
|
+ ATA_DFLAG_ACPI_DISABLED = (1 << 28), /* ACPI for the device is disabled */
|
||||||
|
|
||||||
|
ATA_DEV_UNKNOWN = 0, /* unknown device */
|
||||||
|
ATA_DEV_ATA = 1, /* ATA device */
|
||||||
|
--
|
||||||
|
1.7.6.5
|
||||||
|
|
10
kernel-3.8.3-arm-exynosdrm-buildfix.patch
Normal file
10
kernel-3.8.3-arm-exynosdrm-buildfix.patch
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
--- a/drivers/gpu/drm/drm_vm.c
|
||||||
|
+++ b/drivers/gpu/drm/drm_vm.c
|
||||||
|
@@ -422,6 +422,7 @@ void drm_vm_open_locked(struct drm_device *dev,
|
||||||
|
list_add(&vma_entry->head, &dev->vmalist);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
+EXPORT_SYMBOL_GPL(drm_vm_open_locked);
|
||||||
|
|
||||||
|
static void drm_vm_open(struct vm_area_struct *vma)
|
||||||
|
{
|
17
kernel-3.8.3-arm-imx-drm-buildfix.patch
Normal file
17
kernel-3.8.3-arm-imx-drm-buildfix.patch
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
|
||||||
|
index 251e45d..fbe0f3a 100644
|
||||||
|
--- a/drivers/clk/clk.c
|
||||||
|
+++ b/drivers/clk/clk.c
|
||||||
|
@@ -259,10 +259,11 @@ late_initcall(clk_disable_unused);
|
||||||
|
|
||||||
|
/*** helper functions ***/
|
||||||
|
|
||||||
|
-inline const char *__clk_get_name(struct clk *clk)
|
||||||
|
+const char *__clk_get_name(struct clk *clk)
|
||||||
|
{
|
||||||
|
return !clk ? NULL : clk->name;
|
||||||
|
}
|
||||||
|
+EXPORT_SYMBOL_GPL(__clk_get_name);
|
||||||
|
|
||||||
|
inline struct clk_hw *__clk_get_hw(struct clk *clk)
|
||||||
|
{
|
3509
kernel-custom-i586-config
Normal file
3509
kernel-custom-i586-config
Normal file
File diff suppressed because it is too large
Load Diff
3509
kernel-rt-i586-config
Normal file
3509
kernel-rt-i586-config
Normal file
File diff suppressed because it is too large
Load Diff
2160
kernel.spec
Normal file
2160
kernel.spec
Normal file
File diff suppressed because it is too large
Load Diff
12
kernel26-2.6.18-bt8xx.patch
Normal file
12
kernel26-2.6.18-bt8xx.patch
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
diff -Nru kernel26-2.6.18mamba.orig/drivers/media/video/bt8xx/bttvp.h kernel26-2.6.18mamba/drivers/media/video/bt8xx/bttvp.h
|
||||||
|
--- kernel26-2.6.18mamba.orig/drivers/media/video/bt8xx/bttvp.h 2006-09-20 05:42:06.000000000 +0200
|
||||||
|
+++ kernel26-2.6.18mamba/drivers/media/video/bt8xx/bttvp.h 2006-09-22 13:48:19.000000000 +0200
|
||||||
|
@@ -49,7 +49,7 @@
|
||||||
|
|
||||||
|
#include "bt848.h"
|
||||||
|
#include "bttv.h"
|
||||||
|
-#include "btcx-risc.h"
|
||||||
|
+#include "../btcx-risc.h"
|
||||||
|
|
||||||
|
#ifdef __KERNEL__
|
||||||
|
|
BIN
patch-3.10.38.xz
Normal file
BIN
patch-3.10.38.xz
Normal file
Binary file not shown.
BIN
patch-3.10.6-rt3.patch.xz
Normal file
BIN
patch-3.10.6-rt3.patch.xz
Normal file
Binary file not shown.
78676
reiser4-for-2.6.38.patch
Normal file
78676
reiser4-for-2.6.38.patch
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue
Block a user