linux-samsung-klte: tidy up patches and add new: (!321)

* fix patch file names and reorder them properly
* add patch to fix framebuffer memory allocation
* add patch to fix compile warning for iptables plugin xt_connbytes
* add patch to properly assign MAC address for USB RNDIS
* add backport patch from upstream about O_PATH file descriptors

[ci:skip-build]: already went through successfully in CI
This commit is contained in:
Alexey Min 2019-04-17 10:48:54 +03:00 committed by Oliver Smith
parent e4623227ef
commit 28ab7dc9f3
No known key found for this signature in database
GPG key ID: 5AE7F5513E0885CB
9 changed files with 198 additions and 9 deletions

View file

@ -0,0 +1,65 @@
From 2f6f8f51a3f6667f531e5dd4685c9703249bb919 Mon Sep 17 00:00:00 2001
From: Alexey Min <alexey.min@gmail.com>
Date: Wed, 21 Nov 2018 00:10:31 +0300
Subject: [PATCH 4/6] mdss_fb: Always allow to allocate/map framebuffer memory
Like in recovery mode
Add debug output about mapping framebuffer mem
---
drivers/video/msm/mdss/mdss_fb.c | 22 +++++++++++++++++-----
1 file changed, 17 insertions(+), 5 deletions(-)
diff --git a/drivers/video/msm/mdss/mdss_fb.c b/drivers/video/msm/mdss/mdss_fb.c
index 435b0e19ad4..1c77048fe05 100644
--- a/drivers/video/msm/mdss/mdss_fb.c
+++ b/drivers/video/msm/mdss/mdss_fb.c
@@ -1619,13 +1619,22 @@ static int mdss_fb_mmap(struct fb_info *info, struct vm_area_struct *vma)
struct msm_fb_data_type *mfd = (struct msm_fb_data_type *)info->par;
int rc = 0;
- if (!info->fix.smem_start && !mfd->fb_ion_handle)
+ pr_debug("mdss_fb_mmap: start; smem_start = %08X, fb_ion_handle = %p",
+ (unsigned int)info->fix.smem_start, mfd->fb_ion_handle);
+
+ if (!info->fix.smem_start && !mfd->fb_ion_handle) {
+ pr_debug("mdss_fb_mmap: using mdss_fb_fbmem_ion_mmap()...");
rc = mdss_fb_fbmem_ion_mmap(info, vma);
- else
+ } else {
+ pr_debug("mdss_fb_mmap: using mdss_fb_physical_mmap()...");
rc = mdss_fb_physical_mmap(info, vma);
+ }
- if (rc < 0)
+ if (rc < 0) {
pr_err("fb mmap failed with rc = %d", rc);
+ } else {
+ pr_info("mdss_fb_mmap: Mapped OK");
+ }
return rc;
}
@@ -1665,15 +1674,18 @@ static int mdss_fb_alloc_fbmem_iommu(struct msm_fb_data_type *mfd, int dom)
pr_info("boot_mode_lpm = %d, boot_mode_recovery = %d\n",
boot_mode_lpm, boot_mode_recovery);
+ /* mdss_fb_alloc_fbmem_iommu: boot_mode_lpm = 0, boot_mode_recovery = 0 */
+ pr_info("qcom,memory-reservation-size = %u", size);
/* Incase of Normal Booting, Do not reserve FB memory */
- if ((!boot_mode_lpm) && (!boot_mode_recovery)){
- /* Normal Booting */
+ /* if ((!boot_mode_lpm) && (!boot_mode_recovery)) { */ /* Normal Booting */
+ if (0) { /* Never go this way */
mfd->fbi->screen_base = NULL;
mfd->fbi->fix.smem_start = 0;
mfd->fbi->fix.smem_len = size;
return 0;
} else {
+ pr_info("Always allocating framebuffer memory like in recovery mode!");
of_property_read_u32(pdev->dev.of_node,
"qcom,memory-alt-reservation-size", &size);
}
--
2.21.0

View file

@ -0,0 +1,29 @@
From da446f42d69d35139b8caddb74677c7399a92139 Mon Sep 17 00:00:00 2001
From: Alexey Min <alexey.min@gmail.com>
Date: Fri, 26 Oct 2018 19:31:15 +0300
Subject: [PATCH 3/6] Fix xt_connbytes compile warning
this netfilter option is needed for ubports
---
net/netfilter/xt_connbytes.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/net/netfilter/xt_connbytes.c b/net/netfilter/xt_connbytes.c
index e595e07a759..cf58b1977e0 100644
--- a/net/netfilter/xt_connbytes.c
+++ b/net/netfilter/xt_connbytes.c
@@ -26,7 +26,10 @@ connbytes_mt(const struct sk_buff *skb, struct xt_action_param *par)
u_int64_t what = 0; /* initialize to make gcc happy */
u_int64_t bytes = 0;
u_int64_t pkts = 0;
- const struct nf_conn_counter *counters;
+ /* const struct nf_conn_counter *counters; */
+ /* warning: passing argument 1 of 'atomic64_read' discards 'const' qualifier from pointer target type */
+ /* warnings are treated as errors - remove constness */
+ struct nf_conn_counter *counters;
ct = nf_ct_get(skb, &ctinfo);
if (!ct)
--
2.21.0

View file

@ -0,0 +1,43 @@
From 2e32a401ea5df22ab899f4da3e5e1b448b2df51a Mon Sep 17 00:00:00 2001
From: Alexey Min <alexey.min@gmail.com>
Date: Thu, 7 Mar 2019 17:25:48 +0300
Subject: [PATCH 5/6] usb_gadget: set random rndis host MAC address to prevent
zero address
This fixes zero host MAC:
rndis0: MAC f6:45:91:9b:4e:43
rndis0: HOST MAC 00:00:00:00:00:00
and allows devive to automatically obtain IP addrest on PC host side
zero MAC address prevented interface from autoconfiguring
---
drivers/usb/gadget/u_ether.c | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/usb/gadget/u_ether.c b/drivers/usb/gadget/u_ether.c
index 72c4a992594..c0fc0698697 100644
--- a/drivers/usb/gadget/u_ether.c
+++ b/drivers/usb/gadget/u_ether.c
@@ -1075,8 +1075,16 @@ int gether_setup_name(struct usb_gadget *g, u8 ethaddr[ETH_ALEN],
"using random %s ethernet address\n", "self");
#ifdef CONFIG_USB_ANDROID_SAMSUNG_COMPOSITE
- memcpy(dev->host_mac, ethaddr, ETH_ALEN);
- printk(KERN_DEBUG "usb: set unique host mac\n");
+ if ((ethaddr[0] == 0x00) && (ethaddr[1] == 0x00) &&
+ (ethaddr[2] == 0x00) && (ethaddr[3] == 0x00) &&
+ (ethaddr[4] == 0x00) && (ethaddr[5] == 0x00)) {
+ printk(KERN_DEBUG "%s: no unique host MAC was set, generate random\n", __func__);
+ /* we can use random_ether_addr() from include/linux/etherdevice.h */
+ random_ether_addr(ethaddr);
+ } else {
+ printk(KERN_DEBUG "%s: set unique host mac\n", __func__);
+ }
+ memcpy(dev->host_mac, ethaddr, ETH_ALEN);
#else
if (get_ether_addr(host_addr, dev->host_mac))
dev_warn(&g->dev,
--
2.21.0

View file

@ -0,0 +1,44 @@
From 091953048fe830be1fe4d0c8fb0a825e73edd1df Mon Sep 17 00:00:00 2001
From: Alexey Min <alexey.min@gmail.com>
Date: Tue, 12 Mar 2019 15:05:27 +0300
Subject: [PATCH 6/6] Backport: vfs: make O_PATH file descriptors usable for
'fstat()'
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
We already use them for openat() and friends, but fstat() also wants to
be able to use O_PATH file descriptors. This should make it more
directly comparable to the O_SEARCH of Solaris.
Note that you could already do the same thing with "fstatat()" and an
empty path, but just doing "fstat()" directly is simpler and faster, so
there is no reason not to just allow it directly.
See also commit 332a2e1, which did the same thing for fchdir, for
the same reasons.
Reported-by: ольга крыжановская <olga.kryzhanovska@gmail.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: stable@kernel.org # O_PATH introduced in 3.0+
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
---
fs/stat.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/fs/stat.c b/fs/stat.c
index 88b36c77076..17b7a1b8771 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -58,7 +58,7 @@ EXPORT_SYMBOL(vfs_getattr);
int vfs_fstat(unsigned int fd, struct kstat *stat)
{
int fput_needed;
- struct file *f = fget_light(fd, &fput_needed);
+ struct file *f = fget_raw_light(fd, &fput_needed);
int error = -EBADF;
if (f) {
--
2.21.0

View file

@ -29,10 +29,14 @@ _config="config-${_flavor}.${arch}"
source="
$pkgname-$_commit.tar.gz::https://github.com/LineageOS/${_repository}/archive/${_commit}.tar.gz
$_config
00_fix_return_address.patch
01_gpu-msm-fix-gcc5-compile.patch
02-Reduce-battery-and-touchscreen-log-spam.patch
0001-fix-video-argb-setting.patch
0001_fix_return_address.patch
0002_gpu-msm-fix-gcc5-compile.patch
0003-Reduce-battery-and-touchscreen-log-spam.patch
0004-fix-video-argb-setting.patch
0005-mdss_fb-Always-allow-to-allocate-map-framebuffer-mem.patch
0006-Fix-xt_connbytes-compile-warning.patch
0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
0008-Backport-vfs-make-O_PATH-file-descriptors-usable-for.patch
"
builddir="$srcdir/${_repository}-${_commit}"
@ -80,9 +84,13 @@ package() {
INSTALL_MOD_PATH="$pkgdir" modules_install
}
sha512sums="a0ed01d4beb4fd1b304ea1409e4e3d7ff60662de34999dcdb2901cb10eef217a6679d5cc42dfcc9c3e2b9fb96bc38a8adc431444092310e22af29c7d581f60af linux-samsung-klte-7a3b6080ee8d411acc2bb4a08de479aa8cc9c77a.tar.gz
sha512sums="fb511bc90cbdef59b98547c644a8e85282eb8b8aaad08cb94e46fad4657e3c9d62e86ae7840152a8a21cf9f2b1e26c854ef1d3321c3269aa304093cb490d960e linux-samsung-klte-fcdaf427a423de521f75831b1a49002b9d2a3fa5.tar.gz
2e660d0ac4ffdd5f1a63660a8b61cf83e94122f15126b134a27f58b84fc5424ce4935ef43ca5bff1ec956047b77f7fb7f67e5c1ec976c67712444b370ae6373e config-samsung-klte.armv7
3b4913415bcfe0ff222969f993890c656c7e12b6ee06532bded485d5201c9855b2c87996c5b63423702b89b6b0ca214b5aceeb402571d9c5af084093c157ccb4 00_fix_return_address.patch
0fc4b1782dfd3bd94fa9ae8ab74b19713f25e9f4a48dcf830072634f247aa3dd8847f001a3e87e9728e057657efd4ae751510e7c408d9b960c907665ca64e61f 01_gpu-msm-fix-gcc5-compile.patch
b55fc9ab3e21bc85d66ee08d7e1cd7fdc3b236249212fbcd0055e60ed3e6cef3e4d2b8058a4b7d70c78b2bbc7a11111b55d4d82490b4e3579b8e61657806ac09 02-Reduce-battery-and-touchscreen-log-spam.patch
a48336bbfead6ad0c84d2fce0c40a3f5530aebdff356a6835cceaf59a50a6f860d2f8027703a92927955fbb18857ba78788e010d017bf67730f069b36e96fe87 0001-fix-video-argb-setting.patch"
3b4913415bcfe0ff222969f993890c656c7e12b6ee06532bded485d5201c9855b2c87996c5b63423702b89b6b0ca214b5aceeb402571d9c5af084093c157ccb4 0001_fix_return_address.patch
0fc4b1782dfd3bd94fa9ae8ab74b19713f25e9f4a48dcf830072634f247aa3dd8847f001a3e87e9728e057657efd4ae751510e7c408d9b960c907665ca64e61f 0002_gpu-msm-fix-gcc5-compile.patch
b55fc9ab3e21bc85d66ee08d7e1cd7fdc3b236249212fbcd0055e60ed3e6cef3e4d2b8058a4b7d70c78b2bbc7a11111b55d4d82490b4e3579b8e61657806ac09 0003-Reduce-battery-and-touchscreen-log-spam.patch
a48336bbfead6ad0c84d2fce0c40a3f5530aebdff356a6835cceaf59a50a6f860d2f8027703a92927955fbb18857ba78788e010d017bf67730f069b36e96fe87 0004-fix-video-argb-setting.patch
e3a9b75de461313ee6ba0e547d7fb97d77a749a11416c44b28110673d3a6f7b01305e74f67c06c8cfea97bde5d3d0cd98a457a03a63560125f5bb84f82f116e1 0005-mdss_fb-Always-allow-to-allocate-map-framebuffer-mem.patch
6bdb3acd4a2d10d59ea16a2147735b94f17070aecebfe55fff724c03335bf1a02cc7539c9fe0a59cb944b6835135fe64956617c8b29847397b2f4df68b602063 0006-Fix-xt_connbytes-compile-warning.patch
27f890cf82027649ba742b606a87ce6a82f9685b075bb7b50bffec77221e70434ee78d118d39048350537c5ecdad208658967e492eeeb997e7f6884fa78ac696 0007-usb_gadget-set-random-rndis-host-MAC-address-to-prev.patch
a2bd1b925ba0e1ba0a68dcb134604abbaddf456426a468662d77bc02f0d09d4d07c0c89001c0973e690e1f7eb9c1cfdd37c2d99ed4cc62f3398582d6b51a7013 0008-Backport-vfs-make-O_PATH-file-descriptors-usable-for.patch"