Skip to content

Commit

Permalink
Linux Kernel 3.10 (3.10.0) compiles and runs - BASE KERNEL VERSION FO…
Browse files Browse the repository at this point in the history
…R UPDATE (.rej cleaned up)

Applied:
/LineageOS/android/kernel/sony/msm8994$ patch -p1 -R <
/home/dj/Downloads/linuxkernelpatches/patch-3.10.1

Change-Id: Ib0a8079d892d7b26df2df4b8122c87d07aed2a71
  • Loading branch information
djStolen committed Jan 15, 2024
1 parent b510ff9 commit 65ab493
Show file tree
Hide file tree
Showing 24 changed files with 57 additions and 107 deletions.
1 change: 0 additions & 1 deletion MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -7674,7 +7674,6 @@ STABLE BRANCH
M: Greg Kroah-Hartman <[email protected]>
L: [email protected]
S: Supported
F: Documentation/stable_kernel_rules.txt

STAGING SUBSYSTEM
M: Greg Kroah-Hartman <[email protected]>
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
VERSION = 3
PATCHLEVEL = 10
SUBLEVEL = 1
SUBLEVEL = 0
EXTRAVERSION =
NAME = Unicycling Gorilla

Expand Down
11 changes: 2 additions & 9 deletions arch/x86/kvm/vmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -3399,22 +3399,15 @@ static void vmx_get_segment(struct kvm_vcpu *vcpu,
var->limit = vmx_read_guest_seg_limit(vmx, seg);
var->selector = vmx_read_guest_seg_selector(vmx, seg);
ar = vmx_read_guest_seg_ar(vmx, seg);
var->unusable = (ar >> 16) & 1;
var->type = ar & 15;
var->s = (ar >> 4) & 1;
var->dpl = (ar >> 5) & 3;
/*
* Some userspaces do not preserve unusable property. Since usable
* segment has to be present according to VMX spec we can use present
* property to amend userspace bug by making unusable segment always
* nonpresent. vmx_segment_access_rights() already marks nonpresent
* segment as unusable.
*/
var->present = !var->unusable;
var->present = (ar >> 7) & 1;
var->avl = (ar >> 12) & 1;
var->l = (ar >> 13) & 1;
var->db = (ar >> 14) & 1;
var->g = (ar >> 15) & 1;
var->unusable = (ar >> 16) & 1;
}

static u64 vmx_get_segment_base(struct kvm_vcpu *vcpu, int seg)
Expand Down
2 changes: 1 addition & 1 deletion block/genhd.c
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ static void register_disk(struct gendisk *disk)

ddev->parent = disk->driverfs_dev;

dev_set_name(ddev, "%s", disk->disk_name);
dev_set_name(ddev, disk->disk_name);

/* delay uevents, until we scanned partition table */
dev_set_uevent_suppress(ddev, 1);
Expand Down
3 changes: 1 addition & 2 deletions crypto/algapi.c
Original file line number Diff line number Diff line change
Expand Up @@ -495,8 +495,7 @@ static struct crypto_template *__crypto_lookup_template(const char *name)

struct crypto_template *crypto_lookup_template(const char *name)
{
return try_then_request_module(__crypto_lookup_template(name), "%s",
name);
return try_then_request_module(__crypto_lookup_template(name), name);
}
EXPORT_SYMBOL_GPL(crypto_lookup_template);

Expand Down
3 changes: 1 addition & 2 deletions drivers/block/nbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -714,8 +714,7 @@ static int __nbd_ioctl(struct block_device *bdev, struct nbd_device *nbd,
else
blk_queue_flush(nbd->disk->queue, 0);

thread = kthread_create(nbd_thread, nbd, "%s",
nbd->disk->disk_name);
thread = kthread_create(nbd_thread, nbd, nbd->disk->disk_name);
if (IS_ERR(thread)) {
mutex_lock(&nbd->tx_lock);
return PTR_ERR(thread);
Expand Down
2 changes: 1 addition & 1 deletion drivers/cdrom/cdrom.c
Original file line number Diff line number Diff line change
Expand Up @@ -2882,7 +2882,7 @@ static noinline int mmc_ioctl_cdrom_read_data(struct cdrom_device_info *cdi,
if (lba < 0)
return -EINVAL;

cgc->buffer = kzalloc(blocksize, GFP_KERNEL);
cgc->buffer = kmalloc(blocksize, GFP_KERNEL);
if (cgc->buffer == NULL)
return -ENOMEM;

Expand Down
2 changes: 1 addition & 1 deletion drivers/power/charger-manager.c
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ static void uevent_notify(struct charger_manager *cm, const char *event)
strncpy(env_str, event, UEVENT_BUF_SIZE);
kobject_uevent(&cm->dev->kobj, KOBJ_CHANGE);

dev_info(cm->dev, "%s", event);
dev_info(cm->dev, event);
}

/**
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/osd/osd_uld.c
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@ static int osd_probe(struct device *dev)
oud->class_dev.class = &osd_uld_class;
oud->class_dev.parent = dev;
oud->class_dev.release = __remove;
error = dev_set_name(&oud->class_dev, "%s", disk->disk_name);
error = dev_set_name(&oud->class_dev, disk->disk_name);
if (error) {
OSD_ERR("dev_set_name failed => %d\n", error);
goto err_put_cdev;
Expand Down
2 changes: 1 addition & 1 deletion drivers/scsi/sd.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ sd_store_cache_type(struct device *dev, struct device_attribute *attr,
char *buffer_data;
struct scsi_mode_data data;
struct scsi_sense_hdr sshdr;
static const char temp[] = "temporary ";
const char *temp = "temporary ";
int len;

if (sdp->type != TYPE_DISK)
Expand Down
4 changes: 4 additions & 0 deletions drivers/tty/serial/8250/8250_pci.c
Original file line number Diff line number Diff line change
Expand Up @@ -4797,6 +4797,10 @@ static struct pci_device_id serial_pci_tbl[] = {
PCI_VENDOR_ID_IBM, 0x0299,
0, 0, pbn_b0_bt_2_115200 },

{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9835,
0x1000, 0x0012,
0, 0, pbn_b0_bt_2_115200 },

{ PCI_VENDOR_ID_NETMOS, PCI_DEVICE_ID_NETMOS_9901,
0xA000, 0x1000,
0, 0, pbn_b0_1_115200 },
Expand Down
2 changes: 0 additions & 2 deletions drivers/tty/tty_io.c
Original file line number Diff line number Diff line change
Expand Up @@ -1617,8 +1617,6 @@ static void release_tty(struct tty_struct *tty, int idx)
tty_free_termios(tty);
tty_driver_remove_tty(tty->driver, tty);
tty->port->itty = NULL;
if (tty->link)
tty->link->port->itty = NULL;
cancel_work_sync(&tty->port->buf.work);

if (tty->link)
Expand Down
9 changes: 4 additions & 5 deletions fs/ceph/xattr.c
Original file line number Diff line number Diff line change
Expand Up @@ -675,18 +675,17 @@ ssize_t ceph_getxattr(struct dentry *dentry, const char *name, void *value,
if (!ceph_is_valid_xattr(name))
return -ENODATA;

spin_lock(&ci->i_ceph_lock);
dout("getxattr %p ver=%lld index_ver=%lld\n", inode,
ci->i_xattrs.version, ci->i_xattrs.index_version);

/* let's see if a virtual xattr was requested */
vxattr = ceph_match_vxattr(inode, name);
if (vxattr && !(vxattr->exists_cb && !vxattr->exists_cb(ci))) {
err = vxattr->getxattr_cb(ci, value, size);
return err;
goto out;
}

spin_lock(&ci->i_ceph_lock);
dout("getxattr %p ver=%lld index_ver=%lld\n", inode,
ci->i_xattrs.version, ci->i_xattrs.index_version);

if (__ceph_caps_issued_mask(ci, CEPH_CAP_XATTR_SHARED, 1) &&
(ci->i_xattrs.index_version >= ci->i_xattrs.version)) {
goto get_xattr;
Expand Down
3 changes: 1 addition & 2 deletions fs/hpfs/map.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ __le32 *hpfs_map_bitmap(struct super_block *s, unsigned bmp_block,
struct quad_buffer_head *qbh, char *id)
{
secno sec;
unsigned n_bands = (hpfs_sb(s)->sb_fs_size + 0x3fff) >> 14;
if (hpfs_sb(s)->sb_chk) if (bmp_block >= n_bands) {
if (hpfs_sb(s)->sb_chk) if (bmp_block * 16384 > hpfs_sb(s)->sb_fs_size) {
hpfs_error(s, "hpfs_map_bitmap called with bad parameter: %08x at %s", bmp_block, id);
return NULL;
}
Expand Down
8 changes: 1 addition & 7 deletions fs/hpfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,13 +560,7 @@ static int hpfs_fill_super(struct super_block *s, void *options, int silent)
sbi->sb_cp_table = NULL;
sbi->sb_c_bitmap = -1;
sbi->sb_max_fwd_alloc = 0xffffff;

if (sbi->sb_fs_size >= 0x80000000) {
hpfs_error(s, "invalid size in superblock: %08x",
(unsigned)sbi->sb_fs_size);
goto bail4;
}


/* Load bitmap directory */
if (!(sbi->sb_bmp_dir = hpfs_load_bitmap_directory(s, le32_to_cpu(superblock->bitmaps))))
goto bail4;
Expand Down
23 changes: 12 additions & 11 deletions fs/nfs/nfs4state.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,25 +228,26 @@ static int nfs41_setup_state_renewal(struct nfs_client *clp)
return status;
}

static void nfs4_end_drain_slot_table(struct nfs4_slot_table *tbl)
/*
* Back channel returns NFS4ERR_DELAY for new requests when
* NFS4_SESSION_DRAINING is set so there is no work to be done when draining
* is ended.
*/
static void nfs4_end_drain_session(struct nfs_client *clp)
{
struct nfs4_session *ses = clp->cl_session;
struct nfs4_slot_table *tbl;

if (ses == NULL)
return;
tbl = &ses->fc_slot_table;
if (test_and_clear_bit(NFS4_SLOT_TBL_DRAINING, &tbl->slot_tbl_state)) {
spin_lock(&tbl->slot_tbl_lock);
nfs41_wake_slot_table(tbl);
spin_unlock(&tbl->slot_tbl_lock);
}
}

static void nfs4_end_drain_session(struct nfs_client *clp)
{
struct nfs4_session *ses = clp->cl_session;

if (ses != NULL) {
nfs4_end_drain_slot_table(&ses->bc_slot_table);
nfs4_end_drain_slot_table(&ses->fc_slot_table);
}
}

/*
* Signal state manager thread if session fore channel is drained
*/
Expand Down
2 changes: 1 addition & 1 deletion fs/nfsd/nfs4xdr.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,8 +162,8 @@ static __be32 *read_buf(struct nfsd4_compoundargs *argp, u32 nbytes)
*/
memcpy(p, argp->p, avail);
/* step to next page */
argp->pagelist++;
argp->p = page_address(argp->pagelist[0]);
argp->pagelist++;
if (argp->pagelen < PAGE_SIZE) {
argp->end = argp->p + (argp->pagelen>>2);
argp->pagelen = 0;
Expand Down
5 changes: 5 additions & 0 deletions include/linux/ceph/decode.h
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,11 @@ static inline void ceph_decode_timespec(struct timespec *ts,
static inline void ceph_encode_timespec(struct ceph_timespec *tv,
const struct timespec *ts)
{
BUG_ON(ts->tv_sec < 0);
BUG_ON(ts->tv_sec > (__kernel_time_t)U32_MAX);
BUG_ON(ts->tv_nsec < 0);
BUG_ON(ts->tv_nsec > (long)U32_MAX);

tv->tv_sec = cpu_to_le32((u32)ts->tv_sec);
tv->tv_nsec = cpu_to_le32((u32)ts->tv_nsec);
}
Expand Down
16 changes: 0 additions & 16 deletions include/linux/hugetlb.h
Original file line number Diff line number Diff line change
Expand Up @@ -369,17 +369,6 @@ static inline int hugepage_migration_support(struct hstate *h)
return pmd_huge_support() && (huge_page_shift(h) == PMD_SHIFT);
}

pgoff_t __basepage_index(struct page *page);

/* Return page->index in PAGE_SIZE units */
static inline pgoff_t basepage_index(struct page *page)
{
if (!PageCompound(page))
return page->index;

return __basepage_index(page);
}

#else /* CONFIG_HUGETLB_PAGE */
struct hstate {};
#define alloc_huge_page_node(h, nid) NULL
Expand All @@ -403,11 +392,6 @@ static inline unsigned int pages_per_huge_page(struct hstate *h)
#define pmd_huge_support() 0
#define hugepage_migration_support(h) 0

static inline pgoff_t basepage_index(struct page *page)
{
return page->index;
}

#endif /* CONFIG_HUGETLB_PAGE */

#endif /* _LINUX_HUGETLB_H */
3 changes: 1 addition & 2 deletions kernel/futex.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@
#include <linux/ptrace.h>
#include <linux/sched/rt.h>
#include <linux/freezer.h>
#include <linux/hugetlb.h>
#include <linux/bootmem.h>

#include <asm/futex.h>
Expand Down Expand Up @@ -454,7 +453,7 @@ get_futex_key(u32 __user *uaddr, int fshared, union futex_key *key, int rw)

key->both.offset |= FUT_OFF_INODE; /* inode-based key */
key->shared.inode = inode;
key->shared.pgoff = basepage_index(page);
key->shared.pgoff = page_head->index;
rcu_read_unlock();
}

Expand Down
34 changes: 16 additions & 18 deletions kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -2927,6 +2927,7 @@ static struct module *layout_and_allocate(struct load_info *info, int flags)
{
/* Module within temporary copy. */
struct module *mod;
Elf_Shdr *pcpusec;
int err;

mod = setup_load_info(info, flags);
Expand All @@ -2941,10 +2942,17 @@ static struct module *layout_and_allocate(struct load_info *info, int flags)
err = module_frob_arch_sections(info->hdr, info->sechdrs,
info->secstrings, mod);
if (err < 0)
return ERR_PTR(err);
goto out;

/* We will do a special allocation for per-cpu sections later. */
info->sechdrs[info->index.pcpu].sh_flags &= ~(unsigned long)SHF_ALLOC;
pcpusec = &info->sechdrs[info->index.pcpu];
if (pcpusec->sh_size) {
/* We have a special allocation for this section. */
err = percpu_modalloc(mod,
pcpusec->sh_size, pcpusec->sh_addralign);
if (err)
goto out;
pcpusec->sh_flags &= ~(unsigned long)SHF_ALLOC;
}

/* Determine total sizes, and put offsets in sh_entsize. For now
this is done generically; there doesn't appear to be any
Expand All @@ -2955,22 +2963,17 @@ static struct module *layout_and_allocate(struct load_info *info, int flags)
/* Allocate and move to the final place */
err = move_module(mod, info);
if (err)
return ERR_PTR(err);
goto free_percpu;

/* Module has been copied to its final place now: return it. */
mod = (void *)info->sechdrs[info->index.mod].sh_addr;
kmemleak_load_module(mod, info);
return mod;
}

static int alloc_module_percpu(struct module *mod, struct load_info *info)
{
Elf_Shdr *pcpusec = &info->sechdrs[info->index.pcpu];
if (!pcpusec->sh_size)
return 0;

/* We have a special allocation for this section. */
return percpu_modalloc(mod, pcpusec->sh_size, pcpusec->sh_addralign);
free_percpu:
percpu_modfree(mod);
out:
return ERR_PTR(err);
}

/* mod is no longer valid after this! */
Expand Down Expand Up @@ -3264,11 +3267,6 @@ static int load_module(struct load_info *info, const char __user *uargs,
}
#endif

/* To avoid stressing percpu allocator, do this once we're unique. */
err = alloc_module_percpu(mod, info);
if (err)
goto unlink_mod;

/* Now module is in final location, initialize linked lists, etc. */
err = module_unload_init(mod);
if (err)
Expand Down
17 changes: 0 additions & 17 deletions mm/hugetlb.c
Original file line number Diff line number Diff line change
Expand Up @@ -691,23 +691,6 @@ int PageHuge(struct page *page)
}
EXPORT_SYMBOL_GPL(PageHuge);

pgoff_t __basepage_index(struct page *page)
{
struct page *page_head = compound_head(page);
pgoff_t index = page_index(page_head);
unsigned long compound_idx;

if (!PageHuge(page_head))
return page_index(page);

if (compound_order(page_head) >= MAX_ORDER)
compound_idx = page_to_pfn(page) - page_to_pfn(page_head);
else
compound_idx = page - page_head;

return (index << compound_order(page_head)) + compound_idx;
}

static struct page *alloc_fresh_huge_page_node(struct hstate *h, int nid)
{
struct page *page;
Expand Down
2 changes: 2 additions & 0 deletions mm/memcontrol.c
Original file line number Diff line number Diff line change
Expand Up @@ -6308,6 +6308,8 @@ mem_cgroup_css_online(struct cgroup *cont)
* call __mem_cgroup_free, so return directly
*/
mem_cgroup_put(memcg);
if (parent->use_hierarchy)
mem_cgroup_put(parent);
}
return error;
}
Expand Down
Loading

0 comments on commit 65ab493

Please sign in to comment.