19 Oct, 2016

1 commit

  • 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
    Acked-by: Christian König
    Acked-by: Jesper Nilsson
    Acked-by: Michal Hocko
    Reviewed-by: Jan Kara
    Signed-off-by: Linus Torvalds

    Lorenzo Stoakes
     

03 Apr, 2016

1 commit

  • 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

    Linus Torvalds
     

18 Mar, 2016

1 commit

  • 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
    ...

    Linus Torvalds
     

06 Mar, 2016

1 commit

  • 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
    Reviewed-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Krzysztof Kozlowski
     

23 Feb, 2016

1 commit


15 Feb, 2016

1 commit


08 Feb, 2016

1 commit

  • We recently messed up the error handling here. We can return with the
    pipe->lock held or sometimes we unlock twice by mistake.

    Fixes: 2f3be88237a3 ('goldfish_pipe: Pin pages to memory while copying and other cleanups')
    Signed-off-by: Dan Carpenter
    Reviewed-by: Christoffer Dall
    Signed-off-by: Greg Kroah-Hartman

    Dan Carpenter
     

29 Jan, 2016

8 commits

  • Add ACPI binding to the android pipe driver

    Signed-off-by: Jason Hu
    Signed-off-by: Jin Qian
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Jason Hu
     
  • For reading and writing guest user space buffers, currently the kernel
    sends the guest virtual address of the buffer to the pipe device. This
    virtual address has to be first converted to a guest physical address.
    Doing this translation on the QEMU side is inefficient and requires
    additional handling when KVM is enabled, whose implementation would
    either incur intrusive changes to QEMU's KVM support code or suffer
    from poor performance, see commit 08c7228c50f8 ("x86-kvm: only sync
    SREGS when doing address translation") of $AOSP/external/qemu for
    details, and thus should be avoided if possible.

    There is a TODO comment in hw/misc/android_pipe.c in the new Android
    emulator source tree ($AOSP/external/qemu-android) which requests that
    the translation be done on the kernel side and that physical addresses
    be passed to the device instead of virtual ones. Once the QEMU-side
    implementation is done, the kernel will need to support both the new
    paddr-based pipe device and the old vaddr-based one (which will
    continue to be used by the classic emulator). This patch achieves that
    by leveraging the device version register available in the new device.

    See https://android-review.googlesource.com/128280 for the QEMU-side
    patch.

    In addition, use the mmap semaphore (in read mode) to safeguard the
    call to get_user_pages().

    Signed-off-by: Yu Ning
    Signed-off-by: Jin Qian
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Yu Ning
     
  • Enable CONFIG_GOLDFISH for MIPS platforms.

    Signed-off-by: Miodrag Dinic
    Signed-off-by: Jin Qian
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Miodrag Dinic
     
  • On PIPE_ERROR_AGAIN, just stopping in the middle of a transfer and
    returning the number of bytes actually handled is the right behavior.

    Other errors should be returned on the next read() or write() call.
    Continue logging those until we confirm nothing actually relies on the
    existing (wrong) behavior of dropping errors on the floor.

    Signed-off-by: Greg Hackmann
    Signed-off-by: Jin Qian
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Greg Hackmann
     
  • Add bindings so we don't need to rely on goldfish virtual bus for
    probing any more, which means we don't need ARM and MIPS goldfish
    board code for instantiating the bus.

    In the long term we would like to move towards replacing the Android
    pipe with virtio-vsock that is currently under development.

    Signed-off-by: Greg Hackmann
    Signed-off-by: Jin Qian
    Acked-by: Rob Herring
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Greg Hackmann
     
  • The existing code had a troubling TODO statement concerning the fact
    that it just did a check if the page that the QEMU backend was going to
    read from / write to was there before the call to the QEMU backend and
    then relying on the fact that the page stayed around, even in a
    preemptible SMP kernel. Obviously the page could go away or be
    reassigned, and strange things may happen.

    Further, writes were not tracked, so any use of COW or KSM-like
    features would break completely. Probably that was never used by adbd
    (the only current active user of the pipe), but could prove much more
    dangerous for the GPU passthrough mechanism.

    Instead, use get_user_pages() as the comment suggested and cleanup the
    error path and add the set_page_dirt() call on a successful read
    operation.

    Also clarify the count used to return from successful read/write calls
    and use Linux style commentary in various places of the file.

    Note: The "just ignore error and return whatever we read so far" error
    handling is really quite horrific. I cannot change it without a more
    careful study of all user space ABIs reliance on this 'feature'.

    Signed-off-by: Christoffer Dall
    Signed-off-by: Jin Qian
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Christoffer Dall
     
  • It just makes it harder to figure out which commands are being used.

    Signed-off-by: Alex Bennée
    Signed-off-by: Jin Qian
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alex Bennée
     
  • On new virtual devices, the goldfish virtual bus can be replaced with
    autoprobing infrastructure like Device Tree. Refactor the goldfish
    kernel configs to better accommodate this.

    Move the goldfish platform into a menuconfig in the style of the chrome
    platform, and separate the goldfish bus into its own config option.

    Signed-off-by: Greg Hackmann
    Signed-off-by: Jin Qian
    [Corrected a tristate to bool]
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Greg Hackmann
     

03 Jul, 2015

1 commit

  • …/kernel/git/paulg/linux

    Pull module_platform_driver replacement from Paul Gortmaker:
    "Replace module_platform_driver with builtin_platform driver in non
    modules.

    We see an increasing number of non-modular drivers using
    modular_driver() type register functions. There are several downsides
    to letting this continue unchecked:

    - The code can appear modular to a reader of the code, and they won't
    know if the code really is modular without checking the Makefile
    and Kconfig to see if compilation is governed by a bool or
    tristate.

    - Coders of drivers may be tempted to code up an __exit function that
    is never used, just in order to satisfy the required three args of
    the modular registration function.

    - Non-modular code ends up including the <module.h> which increases
    CPP overhead that they don't need.

    - It hinders us from performing better separation of the module init
    code and the generic init code.

    So here we introduce similar macros for builtin drivers. Then we
    convert builtin drivers (controlled by a bool Kconfig) by making the
    following type of mapping:

    module_platform_driver() ---> builtin_platform_driver()
    module_platform_driver_probe() ---> builtin_platform_driver_probe().

    The set of drivers that are converted here are just the ones that
    showed up as relying on an implicit include of <module.h> during a
    pending header cleanup. So we convert them here vs adding an include
    of <module.h> to non-modular code to avoid compile fails. Additonal
    conversions can be done asynchronously at any time.

    Once again, an unused module_exit function that is removed here
    appears in the diffstat as an outlier wrt all the other changes"

    * tag 'module-builtin_driver-v4.1-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux:
    drivers/clk: convert sunxi/clk-mod0.c to use builtin_platform_driver
    drivers/power: Convert non-modular syscon-reboot to use builtin_platform_driver
    drivers/soc: Convert non-modular soc-realview to use builtin_platform_driver
    drivers/soc: Convert non-modular tegra/pmc to use builtin_platform_driver
    drivers/cpufreq: Convert non-modular s5pv210-cpufreq.c to use builtin_platform_driver
    drivers/cpuidle: Convert non-modular drivers to use builtin_platform_driver
    drivers/platform: Convert non-modular pdev_bus to use builtin_platform_driver
    platform_device: better support builtin boilerplate avoidance

    Linus Torvalds
     

27 Jun, 2015

1 commit

  • Pull staging driver updates from Greg KH:
    "Here's the big, really big, staging tree patches for 4.2-rc1.

    Loads of stuff in here, almost all just coding style fixes / churn,
    and a few new drivers as well, one of which I just disabled from the
    build a few minutes ago due to way too many build warnings.

    Other than the one "disable this driver" patch, all of these have been
    in linux-next for quite a while with no reported issues"

    * tag 'staging-4.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging: (1163 commits)
    staging: wilc1000: disable driver due to build warnings
    Staging: rts5208: fix CHANGE_LINK_STATE value
    Staging: sm750fb: ddk750_swi2c.c: Insert spaces before parenthesis
    Staging: sm750fb: ddk750_swi2c.c: Place braces on correct lines
    Staging: sm750fb: ddk750_swi2c.c: Insert spaces around operators
    Staging: sm750fb: ddk750_swi2c.c: Replace spaces with tabs
    Staging: sm750fb: ddk750_swi2c.h: Shorten lines to under 80 characters
    Staging: sm750fb: ddk750_swi2c.h: Replace spaces with tabs
    Staging: sm750fb: modedb.h: Shorten lines to under 80 characters
    Staging: sm750fb: modedb.h: Replace spaces with tabs
    staging: comedi: addi_apci_3120: rename 'this_board' variables
    staging: comedi: addi_apci_1516: rename 'this_board' variables
    staging: comedi: ni_atmio: cleanup ni_getboardtype()
    staging: comedi: vmk80xx: sanity check context used to get the boardinfo
    staging: comedi: vmk80xx: rename 'boardinfo' variables
    staging: comedi: dt3000: rename 'this_board' variables
    staging: comedi: adv_pci_dio: rename 'this_board' variables
    staging: comedi: cb_pcidas64: rename 'thisboard' variables
    staging: comedi: cb_pcidas: rename 'thisboard' variables
    staging: comedi: me4000: rename 'thisboard' variables
    ...

    Linus Torvalds
     

17 Jun, 2015

1 commit

  • This driver is configured with a Kconfig option that is
    declared as a bool. Hence it is not possible for the code
    to be built as modular. However the code is currently using
    the module_platform_driver() macro for driver registration.

    While this currently works, we really don't want to be including
    the module.h header in non-modular code, which we'll be forced
    to do, pending some upcoming code relocation from init.h into
    module.h. So we fix it now by using the non-modular equivalent.
    And since we've already established that the code is non-modular,
    we can completely drop any code relating to module_exit.

    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

31 May, 2015

1 commit

  • As the first argument of gf_write64() was of type unsigned long, and as
    some calls to gf_write64() were casting the first argument from void *
    to u64 the compiler and/or sparse were printing warnings for casts of
    wrong sizes when compiling for i386.

    This patch changes the type of the first argument of gf_write64() to
    const void *, and update calls to the function. This change fixed the
    warnings and allowed to remove casts from 3 calls to gf_write64().

    In addition gf_write64() was renamed to gf_write_ptr() as the name was
    misleading because it only writes 32 bits on 32 bit systems.

    gf_write_dma_addr() was added to handle dma_addr_t values which is
    used at drivers/staging/goldfish/goldfish_audio.c.

    Signed-off-by: Dan Carpenter
    Signed-off-by: Peter Senna Tschudin
    Signed-off-by: Greg Kroah-Hartman

    Peter Senna Tschudin
     

25 May, 2015

1 commit


17 May, 2014

2 commits

  • drivers/platform/goldfish/goldfish_pipe.c: In function 'goldfish_cmd_status':
    drivers/platform/goldfish/goldfish_pipe.c:164:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    writel((u32)(u64)pipe, dev->base + PIPE_REG_CHANNEL);
    ^
    drivers/platform/goldfish/goldfish_pipe.c: In function 'goldfish_cmd':
    drivers/platform/goldfish/goldfish_pipe.c:180:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    writel((u32)(u64)pipe, dev->base + PIPE_REG_CHANNEL);
    ^
    drivers/platform/goldfish/goldfish_pipe.c: In function 'goldfish_pipe_read_write':
    drivers/platform/goldfish/goldfish_pipe.c:337:16: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    writel((u32)(u64)pipe, dev->base + PIPE_REG_CHANNEL);

    Reported-by: Fengguang Wu
    Cc: Jun Tian
    Acked-by: Alan Cox
    Signed-off-by: Octavian Purdila
    Signed-off-by: Greg Kroah-Hartman

    Octavian Purdila
     
  • drivers/platform/goldfish/pdev_bus.c: In function 'goldfish_new_pdev':
    drivers/platform/goldfish/pdev_bus.c:136:14: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
    writel((u32)(u64)name, pdev_bus_base + PDEV_BUS_GET_NAME);

    Reported-by: Fengguang Wu
    Cc: Jun Tian
    Acked-by: Alan Cox
    Signed-off-by: Octavian Purdila
    Signed-off-by: Greg Kroah-Hartman

    Octavian Purdila
     

16 May, 2014

4 commits


04 May, 2014

1 commit

  • This is a bug fix that has been lurking in the Google tree but not pushed
    upstream.

    From: Octavian Purdila

    The memory region is already reserved in goldfish_init() during
    platform init.

    Signed-off-by: Octavian Purdila
    Signed-off-by: Jun Tian
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     

25 Jan, 2013

3 commits

  • Note a point in the pipe driver that wants future attention

    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Alan Cox
     
  • A QEMU pipe is a very fast communication channel between the
    guest system and the emulator. Usage from the guest is simply
    something like;

    // connect to special device
    fd = open("/dev/qemu_pipe", O_RDWR);

    // tell which service we want to talk to (must be zero-terminated)
    write(fd, "pipeName", strlen("pipeName")+1);

    // do read()/write() through fd now
    ...

    // close channel
    close(fd);

    Signed-off-by: David 'Digit' Turner
    [Added support for parameter buffers for speed]
    igned-off-by: Xin, Xiaohui
    Signed-off-by: Jiang, Yunhong
    Signed-off-by: Nakajima, Jun
    [Ported to 3.6]
    Signed-off-by: Tom Keel
    [Ported to 3.7, moved to platform/goldfish]
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    David 'Digit' Turner
     
  • This imports the current Google code and cleans it up slightly to use pr_ and
    to properly request its resources.

    Goldfish is an emulator used for Android development. It has a virtual bus where
    the emulator passes platform device information to the guest which then creates
    the appropriate devices.

    This part of the emulation is not architecture specific so should not be hiding
    in architecture trees as it does in the Google Android tree. The constants it
    uses do depend on the platform and the platform creates the bus device which then
    talks to the emulator to ascertain the actual devices present.

    Signed-off-by: Sheng Yang
    Signed-off-by: Yunhong Jiang
    Signed-off-by: Xiaohui Xin
    Signed-off-by: Jun Nakajima
    Signed-off-by: Bruce Beare
    [Moved out of x86, cleaned up headers]
    Signed-off-by: Alan Cox
    Signed-off-by: Greg Kroah-Hartman

    Jun Nakajima