- 01 Jul, 2020 40 commits
-
-
Nicolas Saenz Julienne authored
vchiq consumer drivers may need to use this function in order to get the benefits of vchiq's per service message queueing mechanism. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-28-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
This is for service's callbacks to get their private data. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-27-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
This will make further changes easier. The struct will ultimately disappear. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-26-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
The header file only provides other includes. Move the relevant includes to their respective C files and delete it for good. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-25-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
This has historically been handled by vchi, but there is no reason why this couldn't be handled directly in vchiq. The patch tries to avoid altering any behavior, with the exception of the msg_queue size, which is now fixed to VCHIQ_MAX_SLOTS (it was set to VCHIQ_MAX_SLOTS / 2). This is done to match vchiq's user_service message queue, which could be merged with this one in the future. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-24-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
When adding a new service validate the configuration parameters provided, and remove unnecessary checks in vchi, now that we have validated service's config. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-23-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
It was probably there to trick compilers into ignoring unused variables, which isn't needed in Linux. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-22-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
enum vchi_callback_reason maps 1:1 to enum vchiq_reason, in an effort to simplify things, let's use the later, and get rid of the extra indirection. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-21-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
vchi has a set of transfer flags which almost map 1:1 to vchiq's own transfer modes. For the sake of simplicity let's use the later and delete vchi's. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-20-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
All users are ignoring the flags argument. So for the sake of simplicity delete it. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-19-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
Nothing in it is being used. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-18-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
Those defines aren't used by anyone. Get rid of them. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-17-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
There is a series of structures and enums defined but never used. Get rid of them. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-16-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
Nobody uses it. Get rid of it. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-15-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
vchi_msg_dequeue() provides the same functionality as vchi_msg_hold() except it copies the message data as opposed to the later which provides the data in place. The copying is done on a local variable, so there is no need to keep the message out the function's bounds, so use vchi_msg_hold() instead. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-14-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
The idea behind struct vchi_service_handle is to create an opaque handle to struct shim_service. This can be achieved by doing a forward declaration of struct shim_service, which will avoid unwarranted casts and pointer play. Ultimately as a rename is due all over the vchi user space, rename struct shim_service into struvt vchi_service, which is more consistent with the rest of the exposed API. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-13-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
The idea behind this was to create an opaque handle to struct vchiq_instance. This can be achieved without creating a new type by means of a forward declaration of struct vchiq_instance. This saves us from a lot of useless casting and overall simplifies code. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-12-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
There already is a function that covers most of the functionality vchi_msg_peek() provides: vchi_msg_hold(). The main difference being that the later removes the message from vchu's queue while the other does it later on, while releasing the message. There are no users of this function that can't be trivially converted to vchi_msg_hold(). So, for the sake of removing duplicate code, get rid of vchi_msg_peek(). Note that the opposite change could be performed as well. But vchi_msg_peek()'s implementation was deemed less robust as messages have to be released in order. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-11-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Nicolas Saenz Julienne authored
They are neither produced nor expected, so just delete them. Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-10-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Phil Elwell authored
All the registered children of vchiq have a corresponding call to platform_device_unregister except bcm2835_audio. Fix that. Fixes: 25c7597a ("staging: vchiq_arm: Register a platform device for audio") Signed-off-by: Phil Elwell <phil@raspberrypi.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-9-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Naushir Patuck authored
No functional changes in this commit. - Remove erroneous whitespace. - Remove _t postfix label on structs and enums. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-8-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dave Stevenson authored
There is an enum for the errors that the VPU can return. port_parameter_get was negating that value, but also using -EINVAL from the Linux error codes. Pass the VPU error code as positive values. Should the function need to pass a Linux failure, then return that as negative. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-7-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dave Stevenson authored
mmal-vchiq is a reimplementation of the userland library for MMAL. When getting a parameter, the client provides the storage and the size of the storage. The VPU then returns the size of the parameter that it wished to return, and as much as possible of that parameter is returned to the client. The implementation previously only returned the size provided by the VPU should it exceed the buffer size. So for parameters such as the supported encodings list the client had no idea how much of the provided storage had been populated. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-6-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dave Stevenson authored
The MMAL client_component field is used with the event mechanism to allow the client to identify the component for which the event is generated. The field is only 32bits in size, therefore we can't use a pointer to the component in a 64 bit kernel. Component handles are already held in an array per VCHI instance, so use the array index as the client_component handle to avoid having to create a new IDR for this purpose. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-5-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dave Stevenson authored
There were dependencies on including the headers in the correct order. Fix up the headers so that they include the other headers that they depend on themselves. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-4-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dave Stevenson authored
The callback from vchi_mmal to the client was growing lots of extra parameters. Consolidate them into a single struct instead of growing the list further. The struct is associated with the client buffer, therefore there are various changes to setup various containers for the struct, and pass the appropriate members. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-3-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Dave Stevenson authored
The timeout period for VPU communications is a useful thing to extend when debugging. Set it via a define, rather than a magic number buried in the code. Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org> Signed-off-by: Jacopo Mondi <jacopo@jmondi.org> Signed-off-by: Nicolas Saenz Julienne <nsaenzjulienne@suse.de> Link: https://lore.kernel.org/r/20200629150945.10720-2-nsaenzjulienne@suse.deSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Souptick Joarder authored
As 3 goto level referring to same common code, those can be accomodated with a single goto level and renameing it to unpin_pages. Set the -ERRNO when returning partial mapped pages in more appropriate place. When dma_map_sg() failed, the previously allocated memory was not freed properly. This is corrected now. Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Bharath Vedartham <linux.bhar@gmail.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/1593584264-16982-5-git-send-email-jrdr.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Souptick Joarder authored
In 2019, we introduced pin_user_pages*() and now we are converting get_user_pages*() to the new API as appropriate. [1] & [2] could be referred for more information. This is case 2 as per document [1]. [1] Documentation/core-api/pin_user_pages.rst [2] "Explicit pinning of user-space pages": https://lwn.net/Articles/807108/Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Bharath Vedartham <linux.bhar@gmail.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/1593584264-16982-4-git-send-email-jrdr.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Souptick Joarder authored
First, convert set_page_dirty() to set_page_dirty_lock() Second, there is an interval in there after set_page_dirty() and before put_page(), in which the device could be running and setting pages dirty. Moving set_page_dirty_lock() after dma_unmap_sg(). Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Suggested-by: John Hubbard <jhubbard@nvidia.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Bharath Vedartham <linux.bhar@gmail.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Link: https://lore.kernel.org/r/1593584264-16982-3-git-send-email-jrdr.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Souptick Joarder authored
There is a bug, when get_user_pages() failed but partially pinned pages are not unpinned and positive numbers are returned instead of -ERRNO. Fixed it. Also, int is more appropriate type for rv. Changed it. Signed-off-by: Souptick Joarder <jrdr.linux@gmail.com> Cc: John Hubbard <jhubbard@nvidia.com> Cc: Dan Carpenter <dan.carpenter@oracle.com> Cc: Bharath Vedartham <linux.bhar@gmail.com> Link: https://lore.kernel.org/r/1593584264-16982-2-git-send-email-jrdr.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Diego Bienz authored
Spaces aren't necessary before function pointer arguments. Signed-off-by: Diego Bienz <diego.bienz@gmail.com> Link: https://lore.kernel.org/r/20200630113324.GA10534@diegob-nbSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
David Gow authored
The Xilinx Clocking Wizard driver uses the devm_ioremap_resource function, but does not specify a dependency on IOMEM in Kconfig. This causes a build failure on architectures without IOMEM, for example, UML (notably with make allyesconfig). Fix this by making CONFIG_COMMON_CLK_XLNX_CLKWZRD depend on CONFIG_IOMEM. Signed-off-by: David Gow <davidgow@google.com> Link: https://lore.kernel.org/r/20200630044518.1084468-1-davidgow@google.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Brooke Basile authored
Fix the following checkpatch warning: WARNING: Prefer using '"%s...", __func__' to using 'rtw_get_bcn_info', this function's name, in a string Signed-off-by: Brooke Basile <brookebasile@gmail.com> Link: https://lore.kernel.org/r/20200629173711.5158-1-brookebasile@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
The constants IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL and IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA are not used in the driver code and, if ever needed, available from 'include/linux/ieee80211.h'. Remove them from wifi.h. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20200629171405.7711-3-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
The constants IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL and IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA are not used in the driver code and, if ever needed, available from 'include/linux/ieee80211.h'. Remove them from wifi.h. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20200629171405.7711-2-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
The constants IEEE80211_BAR_CTRL_ACK_POLICY_NORMAL and IEEE80211_BAR_CTRL_CBMTID_COMPRESSED_BA are not used in the driver code and, if ever needed, available from 'include/linux/ieee80211.h'. Remove them from wifi.h. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20200629171405.7711-1-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
Add spaces around operators to improve readability and clear checkpatch issues. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20200629161255.28371-2-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Michael Straube authored
Use compound assignment operators to simplify the code and clear missing spaces around operators checkpatch issues. Signed-off-by: Michael Straube <straube.linux@gmail.com> Link: https://lore.kernel.org/r/20200629161255.28371-1-straube.linux@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-
Vaibhav Gupta authored
Drivers should not use legacy power management as they have to manage power states and related operations, for the device, themselves. This driver was handling them with the help of PCI helper functions like pci_save/restore_state(), pci_enable/disable_device(), etc. With generic PM, all essentials will be handled by the PCI core. Driver needs to do only device-specific operations. The driver was also using pci_enable_wake(...,..., 0) to disable wake. Use device_wakeup_disable() instead. Compile-tested only. Signed-off-by: Vaibhav Gupta <vaibhavgupta40@gmail.com> Link: https://lore.kernel.org/r/20200629173459.262075-2-vaibhavgupta40@gmail.comSigned-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-