aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/platform/goldfish (follow)
AgeCommit message (Collapse)AuthorFilesLines
2019-01-03Remove 'type' argument from access_ok() functionLinus Torvalds1-2/+1
Nobody has actually used the type (VERIFY_READ vs VERIFY_WRITE) argument of the user address range verification function since we got rid of the old racy i386-only code to walk page tables by hand. It existed because the original 80386 would not honor the write protect bit when in kernel mode, so you had to do COW by hand before doing any user access. But we haven't supported that in a long time, and these days the 'type' argument is a purely historical artifact. A discussion about extending 'user_access_begin()' to do the range checking resulted this patch, because there is no way we're going to move the old VERIFY_xyz interface to that model. And it's best done at the end of the merge window when I've done most of my merges, so let's just get this done once and for all. This patch was mostly done with a sed-script, with manual fix-ups for the cases that weren't of the trivial 'access_ok(VERIFY_xyz' form. There were a couple of notable cases: - csky still had the old "verify_area()" name as an alias. - the iter_iov code had magical hardcoded knowledge of the actual values of VERIFY_{READ,WRITE} (not that they mattered, since nothing really used it) - microblaze used the type argument for a debug printout but other than those oddities this should be a total no-op patch. I tried to fix up all architectures, did fairly extensive grepping for access_ok() uses, and the changes are trivial, but I may have missed something. Any missed conversion should be trivially fixable, though. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2018-10-15platform: goldfish: pipe: Add a blank line to separate varibles and codeRoman Kiryanov1-0/+1
checkpacth: Missing a blank line after declarations Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-15platform: goldfish: pipe: Remove redundant castingRoman Kiryanov1-1/+1
This casting is not required. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-15platform: goldfish: pipe: Call misc_deregister if init failsRoman Kiryanov1-1/+4
Undo effects of misc_register if driver's init fails after misc_register. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-15platform: goldfish: pipe: Move the file-scope goldfish_pipe_dev variable into the driver stateRoman Kiryanov1-29/+37
This is the last patch in the series of patches to move file-scope variables into the driver state. This change will help to introduce another version of the pipe driver (with different state) for the older host interface or having several instances of this device. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-15platform: goldfish: pipe: Move the file-scope goldfish_pipe_miscdev variable into the driver stateRoman Kiryanov1-7/+13
This is a series of patches to move mutable file-scope variables into the driver state. This change will help to introduce another version of the pipe driver (with different state) for the older host interface or having several instances of this device. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-10-15platform: goldfish: pipe: Move the file-scope goldfish_interrupt_tasklet variable into the driver stateRoman Kiryanov1-8/+16
This is a series of patches to move mutable file-scope variables into the driver state. This change will help to introduce another version of the pipe driver (with different state) for the older host interface or having several instances of this device. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25platform: goldfish: pipe: Make symbol 'goldfish_pipe_dev' staticWei Yongjun1-1/+1
Fixes the following sparse warning: drivers/platform/goldfish/goldfish_pipe.c:214:26: warning: symbol 'goldfish_pipe_dev' was not declared. Should it be static? Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25platform: goldfish: pipe: Remove redundant header includeRoman Kiryanov1-1/+0
No symbols were used from this header. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25platform: goldfish: pipe: Remove redundant struct declarationsRoman Kiryanov1-2/+0
goldfish_pipe_command is defines just after declaration and nothing refers to goldfish_pipe before it is defined. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25platform: goldfish: pipe: Remove a redundant blank lineRoman Kiryanov1-1/+0
The blank line is not required there. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25platform: goldfish: pipe: Prevent memory corruption from several threads writing to the same variableRoman Kiryanov1-10/+14
Move the "pages" buffer into "struct goldfish_pipe". Since we are locking the mutex on the pipe in transfer_max_buffers, other threads willnot be able to write into it, but other pipe instances could be served because they have its own buffer. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-25platform: goldfish: pipe: Remove license boilerplateRoman Kiryanov1-14/+0
The boilerplate license is not necessary when the SPDX line is present. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Replace "x==NULL" to "!x"Roman Kiryanov1-5/+5
checkpatch: Comparison to NULL could be written "!x" Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Move logical ops to the end of the prev lineRoman Kiryanov1-2/+2
checkpatch: Logical continuations should be on the previous line Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Fix alignment to match parenthesisRoman Kiryanov1-35/+48
checkpatch: Alignment should match open parenthesis. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Fix lines to not end an opening bracketRoman Kiryanov1-4/+3
checkpatch: Lines should not end with a '(' or '[' Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Rename goldfish_x to goldfish_pipe_xRoman Kiryanov1-8/+9
Add "pipe" to the pipe related function names. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Remove reduntant casting to (void)Roman Kiryanov1-2/+2
Casting to (void) is no-op. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Rename 'wakeBit' to 'wake_bit'Roman Kiryanov1-4/+4
checkpatch: Avoid CamelCase Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Remove a blank line before '}'Roman Kiryanov1-1/+1
checkpatch: Blank lines aren't necessary before a close brace '}' Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Remove reduntant castingRoman Kiryanov1-1/+1
Casting to u32 is not required here. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Replace two code blocks with a function callRoman Kiryanov1-16/+19
Two function calls look cleaner because the function introduces takes case of all bit shifting and casting. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Remove a redundant variableRoman Kiryanov1-4/+3
The variable was not very useful. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Add blank lines to separate struct membersRoman Kiryanov1-0/+3
To improve readability and to be consistent with other struct members. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Replace pr_ with dev_ for loggingRoman Kiryanov1-1/+6
dev_ is preferred if struct device is available. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Replace an array of 1 with a variableRoman Kiryanov1-15/+13
There is no reason to have an array of 1. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Fail compilation if structs are too largeRoman Kiryanov1-6/+3
Since the driver provides no workaround prevent in cases if structs do no fit into a memory page, it is better to fail complation to find about the issue earlt instead of returning errors at runtime. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Update the comment for GFP_ATOMICRoman Kiryanov1-1/+4
Provide an explanation why GFP_ATOMIC is needed to prevent changing it to other values. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Separate the host interface to a separate headerRoman Kiryanov2-68/+113
These are several enums that must kept in sync with the host side. This change explicitly separates them into a dedicated header file. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Move an opening brace to the next lineRoman Kiryanov1-1/+2
checkpatch: Function's opening brace has to be at the beginning of the next line. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Update licenseRoman Kiryanov1-1/+2
goldfish_pipe is distributed under GPL v2. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-09-14platform: goldfish: pipe: Fix comments to fit 80 columnsRoman Kiryanov1-4/+7
Some comment lines are longer than 80 symbols. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-08-02platform: goldfish: Retire pdev_busRoman Kiryanov3-238/+0
Not used by goldfish. Signed-off-by: Roman Kiryanov <rkir@google.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-07headers: separate linux/mod_devicetable.h from linux/platform_device.hRandy Dunlap1-0/+1
At over 4000 #includes, <linux/platform_device.h> is the 9th most #included header file in the Linux kernel. It does not need <linux/mod_devicetable.h>, so drop that header and explicitly add <linux/mod_devicetable.h> to source files that need it. 4146 #include <linux/platform_device.h> After this patch, there are 225 files that use <linux/mod_devicetable.h>, for a reduction of around 3900 times that <linux/mod_devicetable.h> does not have to be read & parsed. 225 #include <linux/mod_devicetable.h> This patch was build-tested on 20 different arch-es. It also makes these drivers SubmitChecklist#1 compliant. Signed-off-by: Randy Dunlap <rdunlap@infradead.org> Reported-by: kbuild test robot <lkp@intel.com> # drivers/media/platform/vimc/ Reported-by: kbuild test robot <lkp@intel.com> # drivers/pinctrl/pinctrl-u300.c Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-07-03goldfish_pipe: make tasklet goldfish_interrupt_tasklet staticColin Ian King1-1/+1
Tasklet goldfish_interrupt_tasklet is local to the source and does not need to be in global scope, so make it static. Cleans up sparse warning: symbol 'goldfish_interrupt_tasklet' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-02-11vfs: do bulk POLL* -> EPOLL* replacementLinus Torvalds1-4/+4
This is the mindless scripted replacement of kernel use of POLL* variables as described by Al, done by this script: for V in IN OUT PRI ERR RDNORM RDBAND WRNORM WRBAND HUP RDHUP NVAL MSG; do L=`git grep -l -w POLL$V | grep -v '^t' | grep -v /um/ | grep -v '^sa' | grep -v '/poll.h$'|grep -v '^D'` for f in $L; do sed -i "-es/^\([^\"]*\)\(\<POLL$V\>\)/\\1E\\2/" $f; done done with de-mangling cleanups yet to come. NOTE! On almost all architectures, the EPOLL* constants have the same values as the POLL* constants do. But they keyword here is "almost". For various bad reasons they aren't the same, and epoll() doesn't actually work quite correctly in some cases due to this on Sparc et al. The next patch from Al will sort out the final differences, and we should be all done. Scripted-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2017-11-28the rest of drivers/*: annotate ->poll() instancesAl Viro1-2/+2
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
2017-06-12Merge 4.12-rc5 into char-misc-nextGreg Kroah-Hartman1-1/+1
We want the char/misc driver fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25goldfish_pipe: use GFP_ATOMIC under spin lockWei Yongjun1-1/+1
The function get_free_pipe_id_locked() is called from goldfish_pipe_open() with a lock is held, so we should use GFP_ATOMIC instead of GFP_KERNEL. Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25goldfish_pipe: make pipe_dev staticColin Ian King1-1/+1
Make this static as it's only referenced in this source and it does not need global scope. Cleans up a sparse warning: drivers/platform/goldfish/goldfish_pipe.c: warning: symbol 'pipe_dev' was not declared. Should it be static? Signed-off-by: Colin Ian King <colin.king@canonical.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-26goldfish_pipe: fix build warning about using too much stack.Greg Kroah-Hartman1-3/+3
The new goldfish_pipe code used too much stack space in the transfer_max_buffers() call. As the function is serialized with a lock, let's make the buffer static to not use the stack for the large buffer. Reported-by: kbuild test robot <fengguang.wu@intel.com> Cc: Yurii Zubrytskyi <zyy@google.com> Cc: Jin Qian <jinqian@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-26goldfish_pipe: An implementation of more parallel pipeJin Qian1-329/+641
This is a driver code for a redesigned android pipe. Currently it works for x86 and x64 emulators with the following performance results: ADB push to /dev/null, Ubuntu, 400 MB file, times are for (1 / 10 / 100) parallel adb commands x86 adb push: (4.4s / 11.5s / 2m10s) -> (2.8s / 6s / 51s) x64 adb push: (7s / 15s / (too long, 6m+) -> (2.7s / 6.2s / 52s) ADB pull and push to /data/ have the same %% of speedup More importantly, I don't see any signs of slowdowns when run in parallel with Antutu benchmark, so it is definitely making much better job at multithreading. Signed-off-by: Yurii Zubrytskyi <zyy@google.com> Signed-off-by: Jin Qian <jinqian@android.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-02-15goldfish: Sanitize the broken interrupt handlerThomas Gleixner1-5/+8
This interrupt handler is broken in several ways: - It loops forever when the op code is not decodeable - It never returns IRQ_HANDLED because the only way to exit the loop returns IRQ_NONE unconditionally. The whole concept of this is broken. Creating devices in an interrupt handler is beyond any point of sanity. Make it at least behave halfways sane so accidental users do not have to deal with a hard to debug lockup. Fixes: e809c22b8fb028 ("goldfish: add the goldfish virtual bus") Reported-by: Gabriel C <nix.or.die@gmail.com> Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Acked-by: Linus Torvalds <torvalds@linux-foundation.org> Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-11-10platform: goldfish: pipe: use get_user_pages_unlocked()Lorenzo Stoakes1-4/+2
Moving from get_user_pages() to get_user_pages_unlocked() simplifies the code and takes advantage of VM_FAULT_RETRY functionality when faulting in pages. Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-10-19mm: replace get_user_pages() write/force parameters with gup_flagsLorenzo Stoakes1-1/+2
This removes the 'write' and 'force' from get_user_pages() and replaces them with 'gup_flags' to make the use of FOLL_FORCE explicit in callers as use of this flag can result in surprising behaviour (and hence bugs) within the mm subsystem. Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com> Acked-by: Christian König <christian.koenig@amd.com> Acked-by: Jesper Nilsson <jesper.nilsson@axis.com> Acked-by: Michal Hocko <mhocko@suse.com> Reviewed-by: Jan Kara <jack@suse.cz> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-04-02Convert straggling drivers to new six-argument get_user_pages()Linus Torvalds1-2/+1
Commit d4edcf0d5695 ("mm/gup: Switch all callers of get_user_pages() to not pass tsk/mm") switched get_user_pages() callers to the simpler model where they no longer pass in the thread and mm pointer. But since then we've merged changes to a few drivers that re-introduce use of the old interface. Let's fix them up. They continued to work fine (thanks to the truly disgusting macros introduced in commit cde70140fed8: "mm/gup: Overload get_user_pages() functions"), but cause unnecessary build noise. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2016-03-17Merge tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/stagingLinus Torvalds1-7/+7
Pull staging driver updates from Greg KH: "Here is the big staging driver pull request for 4.6-rc1. Lots of little things here, over 1600 patches or so. Notable is all of the good Lustre work happening, those developers have finally woken up and are cleaning up their code greatly. The Outreachy intern application process is also happening, which brought in another 400 or so patches. Full details are in the very long shortlog. All of these have been in linux-next with no reported issues" * tag 'staging-4.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1673 commits) staging: lustre: fix aligments in lnet selftest staging: lustre: report minimum of two buffers for LNet selftest load test staging: lustre: test for proper errno code in lstcon_rpc_trans_abort staging: lustre: filter remaining extra spacing for lnet selftest staging: lustre: remove extra spacing when setting variable for lnet selftest staging: lustre: remove extra spacing of variable declartions for lnet selftest staging: lustre: fix spacing issues checkpatch reported in lnet selftest staging: lustre: remove returns in void function for lnet selftest staging: lustre: fix bogus lst errors for lnet selftest staging: netlogic: Replacing pr_err with dev_err after the call to devm_kzalloc staging: mt29f_spinand: Replacing pr_info with dev_info after the call to devm_kzalloc staging: android: ion: fix up file mode staging: ion: debugfs invalid gfp mask staging: rts5208: Replace pci_enable_device with pcim_enable_device Staging: ieee80211: Place constant on right side of the test. staging: speakup: Replace del_timer with del_timer_sync staging: lowmemorykiller: fix 2 checks that checkpatch complained staging: mt29f_spinand: Drop void pointer cast staging: rdma: hfi1: file_ops: Replace ALIGN with PAGE_ALIGN staging: rdma: hfi1: driver: Replace IS_ALIGNED with PAGE_ALIGNED ...
2016-03-05goldfish: Fix build error of missing ioremap on UMKrzysztof Kozlowski1-0/+1
Add missing HAS_IOMEM dependency to fix the allyesconfig build error on ARCH=um (for x86_64): drivers/platform/goldfish/pdev_bus.c: In function ‘goldfish_pdev_bus_probe’: drivers/platform/goldfish/pdev_bus.c:191:18: error: implicit declaration of function ‘ioremap’ [-Werror=implicit-function-declaration] pdev_bus_base = ioremap(pdev_bus_addr, pdev_bus_len); Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Reviewed-by: Alan Cox <alan@linux.intel.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-22Merge char-misc-next into staging-nextGreg Kroah-Hartman3-63/+126
This resolves the merge issues and confusions people were having with the goldfish drivers due to changes for them showing up in two different trees. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>