4ed084e489fd ("Move CONFIG_AIO to android-base.")
CONFIG_AIO has legitimate use for the functionfs
driver, which is used with adb and mtp. It is now
required to be enabled for better performance
with those services.
Change-Id: I52d05c734a25b35e012666b010b2ee5426915094
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
4ed084e489fd ("Move CONFIG_AIO to android-base.")
CONFIG_AIO has legitimate use for the functionfs
driver, which is used with adb and mtp. It is now
required to be enabled for better performance
with those services.
Change-Id: I631fac8e56ea16711f0cc05297140dc59c9fb581
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
6e30a9a158bd ("remove CONFIG_PM_AUTOSLEEP from android-base.cfg")
Autosleep is no longer used by Android.
Change-Id: Ia024dbb6343abd8e1016febc08251dc5dc7badc1
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
6e30a9a158bd ("remove CONFIG_PM_AUTOSLEEP from android-base.cfg")
Autosleep is no longer used by Android.
Change-Id: I7ff5c40a8cdfbe9e67019bc859eb940fae2b6c4f
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
Reading rk1000's register to see whether uboot logo was on.
Change-Id: Iee6d15213f16ccd59136a5cf4f4017f5cd40ab62
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
Removing ports so that uboot display subsystem can get
rk1000 as panel.
Change-Id: If12c30bb7d1bd382ed969534687234aa79b8dd04
Signed-off-by: Algea Cao <algea.cao@rock-chips.com>
cc756e682c ("ANDROID: android-base.cfg: remove USB_OTG_WAKELOCK")
CONFIG_USB_OTG_WAKELOCK is currently somewhat outdated
and as such is not applicable to all Android devices. Until
it is brought up to date, remove it from the base Android
kernel configuration.
Change-Id: I4d6a2ba78ddc9210bc949ee2ecc5182a4814715d
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
cc756e682c ("ANDROID: android-base.cfg: remove USB_OTG_WAKELOCK")
CONFIG_USB_OTG_WAKELOCK is currently somewhat outdated
and as such is not applicable to all Android devices. Until
it is brought up to date, remove it from the base Android
kernel configuration.
Change-Id: Id112f1e692fce021b8ab5437ae7811c216c8d272
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
bc86c1de1d ("ANDROID: android-base.cfg: remove NETFILTER_XT_MATCH_QUOTA2_LOG")
There are currently a couple different implementations for this
functionality. Until things are unified, remove the requirement
for this kernel config.
Change-Id: Ia3f515452871118dab4b8688ff9fd16e87beb9b6
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
bc86c1de1d ("ANDROID: android-base.cfg: remove NETFILTER_XT_MATCH_QUOTA2_LOG")
There are currently a couple different implementations for this
functionality. Until things are unified, remove the requirement
for this kernel config.
Change-Id: Ibbe93ae71d4b7512be397e689abc36ba51011b30
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
97841e574a ("ANDROID: android-base.cfg: remove CONFIG_CGROUP_DEBUG")
This config option is not required by Android.
Change-Id: I2c57f98f94465d56aac60fe12b9b4d0a42d42242
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
97841e574a ("ANDROID: android-base.cfg: remove CONFIG_CGROUP_DEBUG")
This config option is not required by Android.
Change-Id: Ica7ed956e2340d5fd8756a400d13725799857423
Signed-off-by: Tao Huang <huangtao@rock-chips.com>
When a disabled iommu node is referenced by a master which cause the previous iommu nodes
removed from the iommu group, finally cause kernel crash, return -ENODEV instead -EPROBE_DEFER
if iommu node disabled can fix this issue
Change-Id: I3adf3f4119ff6fff0a2068301338813f5aca8969
Signed-off-by: Simon Xue <xxm@rock-chips.com>
RK322x is a 32-bit SoC, the length of register is 32-bit.
Change-Id: I3fe506b0f9c7f8ec70a56863f95decdc12e61e85
Signed-off-by: Liang Chen <cl@rock-chips.com>
We put memory of ramoops on 46M from now on for arm32, beacause some
board only have 128M memory.
Change-Id: Ie94a7619bfe006e196d3269711a499acbd7c87b9
Signed-off-by: Liang Chen <cl@rock-chips.com>
If hdmi phy had been set in uboot, it's need to set power_count
to 1 to match actutal phy status.
This patch use regc8 bit[7:6] to detect phy is set in uboot or not.
After phy power up, value will be zero which is different to its
default value(2'b11).
Change-Id: I6e5deea1d5a0973788c39a200d5c5a0f6a14bdd2
Signed-off-by: Zheng Yang <zhengyang@rock-chips.com>
The HCLK_HOST_ARB is enabled with CLK_IGNORE_UNUSED flag,
so we don't need to control this clk in usb host EHCI and
OHCI controller driver.
Change-Id: I25201170977b30f904611bbcfdcb1eb6230195fe
Signed-off-by: William Wu <william.wu@rock-chips.com>
In commit 94dfd7edfd ("USB: HCD: support giveback of URB in tasklet
context") support was added to give back the URB in tasklet context.
Let's take advantage of this in dwc_otg_310.
This speeds up the dwc_otg_310 interrupt handler considerably, it means
we've got a better chance of not missing SOF interrupts.
TEST=Unable to preview yuyv format usb camera on rk3288 board when use
dwc usb controller because of missing SOF interrupts.
Change-Id: I52194d7fbddaf684c601d328e2a3c0f28fcb83b8
Signed-off-by: Feng Mingli <fml@rock-chips.com>
In commit 2bfa0719ac ("usb: gadget: function: f_fs: pass
companion descriptor along") there is a pointer arithmetic
bug where the comp_desc is obtained as follows:
comp_desc = (struct usb_ss_ep_comp_descriptor *)(ds +
USB_DT_ENDPOINT_SIZE);
Since ds is a pointer to usb_endpoint_descriptor, adding
7 to it ends up going out of bounds (7 * sizeof(struct
usb_endpoint_descriptor), which is actually 7*9 bytes) past
the SS descriptor. As a result the maxburst value will be
read incorrectly, and the UDC driver will also get a garbage
comp_desc (assuming it uses it).
Since Felipe wrote, "Eventually, f_fs.c should be converted
to use config_ep_by_speed() like all other functions, though",
let's finally do it. This allows the other usb_ep fields to
be properly populated, such as maxpacket and mult. It also
eliminates the awkward speed-based descriptor lookup since
config_ep_by_speed() does that already using the ones found
in struct usb_function.
Fixes: 2bfa0719ac ("usb: gadget: function: f_fs: pass
companion descriptor along")
Change-Id: Ic3f6297781571268a0b6b1b3f0a04b70d7fa7a68
Signed-off-by: Jack Pham <jackp@codeaurora.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(am from https://www.spinics.net/lists/linux-usb/msg165149.html)
The specification says that the Reserved1 field in OS_DESC_EXT_COMPAT
must have the value "1", but when this feature was first implemented we
rejected any non-zero values.
This was adjusted to accept all non-zero values (while now rejecting
zero) in commit 53642399aa ("usb: gadget: f_fs: Fix wrong check on
reserved1 of OS_DESC_EXT_COMPAT"), but that breaks any userspace
programs that worked previously by returning EINVAL when Reserved1 == 0
which was previously the only value that succeeded!
If we just set the field to "1" ourselves, both old and new userspace
programs continue to work correctly and, as a bonus, old programs are
now compliant with the specification without having to fix anything
themselves.
Change-Id: I7fe3d54ce649049ad0a1db4564319af03488ad48
Fixes: 53642399aa ("usb: gadget: f_fs: Fix wrong check on reserved1 of OS_DESC_EXT_COMPAT")
Cc: <stable@vger.kernel.org>
Signed-off-by: John Keeping <john@metanate.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit a3acc69608)
KASAN enabled configuration reports an error
BUG: KASAN: use-after-free in ffs_free_inst+... [usb_f_fs] at addr ...
Write of size 8 by task ...
This is observed after "ffs-test" is run and interrupted. If after that
functionfs is unmounted and g_ffs module is unloaded, that use-after-free
occurs during g_ffs module removal.
Although the report indicates ffs_free_inst() function, the actual
use-after-free condition occurs in _ffs_free_dev() function, which
is probably inlined into ffs_free_inst().
This happens due to keeping the ffs_data reference in device structure
during functionfs unmounting, while ffs_data itself is freed as no longer
needed. The fix is to clear that reference in ffs_closed() function,
which is a counterpart of ffs_ready(), where the reference is stored.
Change-Id: Ia7d30dfe643ef5de184620b483ef3ad16a76d309
Fixes: 3262ad8243 ("usb: gadget: f_fs: Stop ffs_closed NULL pointer dereference")
Cc: stable@vger.kernel.org
Signed-off-by: Andrew Gabbasov <andrew_gabbasov@mentor.com>
Acked-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit cdafb6d8b8)
The struct ffs_data::private_data has a pointer to
ffs_dev stored in it during the ffs_fs_mount() function
however it is not cleared when the ffs_dev is freed
later which causes the ffs_closed function to crash
with "Unable to handle kernel NULL pointer dereference"
error when using the data in ffs_data::private_data.
This clears this pointer during the ffs_free_dev clean
up function.
Change-Id: I1fde26421cb44084d73e8c2a1786ea3f09f952fc
Signed-off-by: Jim Baxter <jim_baxter@mentor.com>
Signed-off-by: Jiada Wang <jiada_wang@mentor.com>
Signed-off-by: Harish Jenny K N <harish_kandiga@mentor.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 3262ad8243)
When zero endpoints are declared for a function, there is no endpoint
to disable, enable or free, so replace do...while loops with while loops.
Change pre-decrement to post-decrement to iterate the same number of times
when there are endpoints to process.
Change-Id: Ia6cb1324ce5acdab00677181475b34ab5731f578
Signed-off-by: Vincent Pelletier <plr.vincent@gmail.com>
Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Signed-off-by: William Wu <william.wu@rock-chips.com>
(cherry picked from commit 08f37148b6)
This reverts commit 548b453dcc which
is replaced with the upstream commit 53642399aa ("usb: gadget: f_fs:
Fix wrong check on reserved1 of OS_DESC_EXT_COMPAT").
Change-Id: I34e0f68d1e54a1852d021ee3ef78e3944fea675f
Signed-off-by: William Wu <william.wu@rock-chips.com>