linux-4.9.git
8 years agovcsm: Fix spaces around operators.
Dave Stevenson [Fri, 1 Sep 2017 16:24:48 +0000 (17:24 +0100)]
vcsm: Fix spaces around operators.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: Fix indentation of switch/case statement.
Dave Stevenson [Fri, 1 Sep 2017 16:29:37 +0000 (17:29 +0100)]
vcsm: Fix indentation of switch/case statement.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: Fix lots of block quote formatting issues
Dave Stevenson [Fri, 1 Sep 2017 16:21:09 +0000 (17:21 +0100)]
vcsm: Fix lots of block quote formatting issues

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: Fix erroneous space in 'if' statement.
Dave Stevenson [Fri, 1 Sep 2017 16:01:11 +0000 (17:01 +0100)]
vcsm: Fix erroneous space in 'if' statement.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: Fix blank lines after declarations.
Dave Stevenson [Fri, 1 Sep 2017 15:59:49 +0000 (16:59 +0100)]
vcsm: Fix blank lines after declarations.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: "unsigned int" preferred over "unsigned" fixed.
Dave Stevenson [Fri, 1 Sep 2017 15:55:08 +0000 (16:55 +0100)]
vcsm: "unsigned int" preferred over "unsigned" fixed.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: Remove typedef of VC_VCHI_SM_HANDLE_T
Dave Stevenson [Fri, 1 Sep 2017 15:50:29 +0000 (16:50 +0100)]
vcsm: Remove typedef of VC_VCHI_SM_HANDLE_T

Replaced with struct sm_instance *.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: Fix block comment formatting
Dave Stevenson [Fri, 1 Sep 2017 15:34:13 +0000 (16:34 +0100)]
vcsm: Fix block comment formatting

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: Correct block comment style on licence headers.
Dave Stevenson [Fri, 1 Sep 2017 15:29:53 +0000 (16:29 +0100)]
vcsm: Correct block comment style on licence headers.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: Remove all typedefs from vc_sm_defs.h and calling code
Dave Stevenson [Fri, 1 Sep 2017 15:26:12 +0000 (16:26 +0100)]
vcsm: Remove all typedefs from vc_sm_defs.h and calling code

Remove typedefs on the structures that make up the IPC
to the firmware for VCSM. Update all calling code appropriately.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agoVCSM: New option to import a DMABUF for VPU use
Dave Stevenson [Wed, 15 Feb 2017 11:17:44 +0000 (11:17 +0000)]
VCSM: New option to import a DMABUF for VPU use

Takes a dmabuf, and then calls over to the VPU to wrap
it into a suitable handle.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: Convert to loading via device tree.
Dave Stevenson [Fri, 25 Aug 2017 14:58:57 +0000 (15:58 +0100)]
vcsm: Convert to loading via device tree.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: code-style: Fix comment indentation
Dave Stevenson [Fri, 19 May 2017 13:29:12 +0000 (14:29 +0100)]
vcsm: code-style: Fix comment indentation

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agoVCSM: Specify pointers in IPC msgs as uint32_t
Dave Stevenson [Wed, 15 Feb 2017 11:16:05 +0000 (11:16 +0000)]
VCSM: Specify pointers in IPC msgs as uint32_t

Pointers were specified as void* which will fail
rather badly if the kernel is switched to 64 bit.
GPU wants 32 bit addresses, so use uint32_t and
cast whereever necessary.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
8 years agovcsm: Allow both clean and invalidate to be requested
popcornmix [Mon, 4 Sep 2017 19:48:02 +0000 (20:48 +0100)]
vcsm: Allow both clean and invalidate to be requested

8 years agobrcmfmac: Disable ARP offloading when promiscuous
Phil Elwell [Thu, 24 Aug 2017 15:16:16 +0000 (16:16 +0100)]
brcmfmac: Disable ARP offloading when promiscuous

This is a test patch for brcmfmac from Franky Lin at Broadcom to disable
ARP offloading when in promiscuous mode, re-enabling the ability to
sniff ARP packets over WiFi.

See: https://github.com/raspberrypi/linux/issues/2171

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agomm: Remove the PFN busy warning
Eric Anholt [Fri, 19 Dec 2014 00:07:15 +0000 (16:07 -0800)]
mm: Remove the PFN busy warning

See commit dae803e165a11bc88ca8dbc07a11077caf97bbcb -- the warning is
expected sometimes when using CMA.  However, that commit still spams
my kernel log with these warnings.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agovcsm: Allow build with multi-platform v6-v7
popcornmix [Fri, 25 Aug 2017 16:09:38 +0000 (17:09 +0100)]
vcsm: Allow build with multi-platform v6-v7

8 years agodrm/vc4: Fix refcounting of runtime PM get if it errors out.
Eric Anholt [Mon, 17 Apr 2017 16:26:03 +0000 (09:26 -0700)]
drm/vc4: Fix refcounting of runtime PM get if it errors out.

We were returning without decrementing if the error happened, meaning
that at the next submit we wouldn't try to bring up the power domain.

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170417162603.12726-1-eric@anholt.net
Reviewed-by: Sean Paul <seanpaul@chromium.org>
(cherry picked from commit 925d05e1f825db9490da33afe35bd5383d301e97)

8 years agodrm/vc4: Demote user-accessible DRM_ERROR paths to DRM_DEBUG.
Eric Anholt [Mon, 24 Jul 2017 21:34:55 +0000 (14:34 -0700)]
drm/vc4: Demote user-accessible DRM_ERROR paths to DRM_DEBUG.

Userspace shouldn't be able to spam dmesg by passing bad arguments.
This has particularly become an issues since we started using a bad
argument to set_tiling to detect if set_tiling was supported.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: 83753117f1de ("drm/vc4: Add get/set tiling ioctls.")
8 years agodrm/vc4: Fix pitch setup for T-format scanout.
Eric Anholt [Sat, 15 Jul 2017 00:33:08 +0000 (17:33 -0700)]
drm/vc4: Fix pitch setup for T-format scanout.

The documentation said to use src_w here, and I didn't consider that
we actually needed to be using pitch somewhere in our setup.  Fixes
scanout on my DSI panel when X11 does initial setup with 1920x1080
HDMI and 800x480 DSI both at 0,0 of the same framebuffer.

Signed-off-by: Eric Anholt <eric@anholt.net>
Fixes: 98830d91da08 ("drm/vc4: Add T-format scanout support.")
8 years agodrm/vc4: prepare for CEC support
Hans Verkuil [Sun, 16 Jul 2017 10:48:03 +0000 (12:48 +0200)]
drm/vc4: prepare for CEC support

In order to support CEC the hsm clock needs to be enabled in
vc4_hdmi_bind(), not in vc4_hdmi_encoder_enable(). Otherwise you wouldn't
be able to support CEC when there is no hotplug detect signal, which is
required by some monitors that turn off the HPD when in standby, but keep
the CEC bus alive so they can be woken up.

The HDMI core also has to be enabled in vc4_hdmi_bind() for the same
reason.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20170716104804.48308-3-hverkuil@xs4all.nl
(cherry picked from commit 10ee275cb12f884ce09bed69ea387eae73d7fece)

8 years agodrm/vc4: Add runtime PM support to the HDMI encoder driver
Boris Brezillon [Tue, 11 Apr 2017 16:39:25 +0000 (18:39 +0200)]
drm/vc4: Add runtime PM support to the HDMI encoder driver

The HDMI driver is currently enabling all clocks at probe time and
keeps the power-domain connected to the HDMI encoder enabled.

Move all activation code to vc4_hdmi_encoder_enable() and make sure
the clks and power domain are released when the HDMI encoder is not used
by adding deactivation steps in vc4_hdmi_encoder_disable().

Note that the sequencing imposed by the IP requires that we move
vc4_hdmi_encoder_mode_set() code into vc4_hdmi_encoder_enable().

Signed-off-by: Boris Brezillon <boris.brezillon@free-electrons.com>
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 4f6e3d66ac522dec9733d433ad00e8e77747c372)

8 years agodrm/vc4: Fix misleading name of the continuous flag.
Eric Anholt [Tue, 27 Jun 2017 19:58:33 +0000 (12:58 -0700)]
drm/vc4: Fix misleading name of the continuous flag.

The logic was all right in the end, the name was just backwards.

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170627195839.3338-3-eric@anholt.net
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
(cherry picked from commit ec878c0756a0c202e86256dca1de307ab1189ab8)

8 years agodrm/vc4: Fix DSI T_INIT timing.
Eric Anholt [Tue, 27 Jun 2017 19:58:32 +0000 (12:58 -0700)]
drm/vc4: Fix DSI T_INIT timing.

The DPHY spec requires a much larger T_INIT than I was specifying
before.  In the absence of clear specs from the slave of what their
timing is, just use the value that the firmware was using.

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: http://patchwork.freedesktop.org/patch/msgid/20170627195839.3338-2-eric@anholt.net
Reviewed-by: Andrzej Hajda <a.hajda@samsung.com>
(cherry picked from commit e65d51126f89a0d67ee6c5df58363730b1410ab5)

8 years agodrm/vc4: Convert more lock requirement comments to lockdep assertions.
Eric Anholt [Tue, 25 Jul 2017 18:27:18 +0000 (11:27 -0700)]
drm/vc4: Convert more lock requirement comments to lockdep assertions.

Since I do my development with lockdep on, this will help make sure I
don't introduce bugs here.

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20170725182718.31468-3-eric@anholt.net
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 4e6b1e91253ebf701b4ec3586cba5596527a4d0a)

8 years agodrm/vc4: Add an ioctl for labeling GEM BOs for summary stats
Eric Anholt [Tue, 25 Jul 2017 18:27:17 +0000 (11:27 -0700)]
drm/vc4: Add an ioctl for labeling GEM BOs for summary stats

This has proven immensely useful for debugging memory leaks and
overallocation (which is a rather serious concern on the platform,
given that we typically run at about 256MB of CMA out of up to 1GB
total memory, with framebuffers that are about 8MB ecah).

The state of the art without this is to dump debug logs from every GL
application, guess as to kernel allocations based on bo_stats, and try
to merge that all together into a global picture of memory allocation
state.  With this, you can add a couple of calls to the debug build of
the 3D driver and get a pretty detailed view of GPU memory usage from
/debug/dri/0/bo_stats (or when we debug print to dmesg on allocation
failure).

The Mesa side currently labels at the gallium resource level (so you
see that a 1920x20 pixmap has been created, presumably for the window
system panel), but we could extend that to be even more useful with
glObjectLabel() names being sent all the way down to the kernel.

(partial) example of sorted debugfs output with Mesa labeling all
resources:

               kernel BO cache:  16392kb BOs (3)
       tiling shadow 1920x1080:   8160kb BOs (1)
       resource 1920x1080@32/0:   8160kb BOs (1)
scanout resource 1920x1080@32/0:   8100kb BOs (1)
                        kernel:   8100kb BOs (1)

v2: Use strndup_user(), use lockdep assertion instead of just a
    comment, fix an array[-1] reference, extend comment about name
    freeing.

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20170725182718.31468-2-eric@anholt.net
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
(cherry picked from commit f30994622b2bf8e4fa224237ac65304b27a9cb6a)

8 years agodrm/vc4: Start using u64_to_user_ptr.
Eric Anholt [Tue, 25 Jul 2017 18:27:16 +0000 (11:27 -0700)]
drm/vc4: Start using u64_to_user_ptr.

Chris Wilson pointed out this little cleanup in a review of new code,
so let's fix up the code I was copying from.

Signed-off-by: Eric Anholt <eric@anholt.net>
Link: https://patchwork.freedesktop.org/patch/msgid/20170725182718.31468-1-eric@anholt.net
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
(cherry picked from commit 95d7cbcb6fbe3885d7a968cc86b98a08466742af)

8 years agodrm/vc4: Don't disable DSI clocks on component unload.
Eric Anholt [Wed, 2 Aug 2017 18:46:51 +0000 (11:46 -0700)]
drm/vc4: Don't disable DSI clocks on component unload.

The clocks are enabled/disabled at encoder enable/disable time, not at
component load.  Fixes a WARN_ON at boot if V3D fails to probe.

Fixes: 4078f5757144 ("drm/vc4: Add DSI driver")
Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Fix double destroy of the BO cache on teardown.
Eric Anholt [Wed, 2 Aug 2017 19:48:04 +0000 (12:48 -0700)]
drm/vc4: Fix double destroy of the BO cache on teardown.

It's also destroyed from the top level vc4_drv.c initialization, which
is where the cache was actually initialized from.

This used to just involve duplicate del_timer() and cancel_work_sync()
being called, but it started causing kmalloc issues once we
double-freed the new BO label array.

Fixes: 1908a876f909 ("drm/vc4: Add an ioctl for labeling GEM BOs for summary stats")
Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agocache: Fix up previous commit for v6
popcornmix [Tue, 22 Aug 2017 12:48:22 +0000 (13:48 +0100)]
cache: Fix up previous commit for v6

8 years agovcsm: Provide new ioctl to clean/invalidate a 2D block
popcornmix [Fri, 18 Aug 2017 17:46:20 +0000 (18:46 +0100)]
vcsm: Provide new ioctl to clean/invalidate a 2D block

8 years agovcsm: Provide flag to map pages up front
popcornmix [Fri, 18 Aug 2017 17:45:36 +0000 (18:45 +0100)]
vcsm: Provide flag to map pages up front

8 years agocache: export clean and invalidate
popcornmix [Fri, 18 Aug 2017 16:27:36 +0000 (17:27 +0100)]
cache: export clean and invalidate

8 years agoconfig: Enable CONFIG_BRCMDBG temporarily for debugging on pi0
popcornmix [Wed, 16 Aug 2017 21:01:33 +0000 (22:01 +0100)]
config: Enable CONFIG_BRCMDBG temporarily for debugging on pi0

8 years agoBCM270X_DT: Set spidev spi-max-frequency to 125MHz
Phil Elwell [Wed, 16 Aug 2017 15:52:50 +0000 (16:52 +0100)]
BCM270X_DT: Set spidev spi-max-frequency to 125MHz

The BCM2835 SPI controllers have a maximum bus clock of half the system
clock speed, so with the 250MHz system clock found on Raspberry Pis
you get a theoretical maximum bus speed of 125MHz. Note that this
speed is unlikely to be reliable, and the maximum usable bus spee will
depend on both the attached device and the wiring.

See: https://github.com/raspberrypi/linux/issues/2165
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agoconfig: Enable CONFIG_BRCMDBG temporarily for debugging
popcornmix [Tue, 15 Aug 2017 15:48:46 +0000 (16:48 +0100)]
config: Enable CONFIG_BRCMDBG temporarily for debugging

8 years agoallo-digione: 192kHz clicking sound fix
allocom [Sat, 5 Aug 2017 05:57:07 +0000 (11:27 +0530)]
allo-digione: 192kHz clicking sound fix

See: https://github.com/raspberrypi/linux/pull/2149

8 years agoallo-piano-dac-plus: Master volume added
allocom [Sat, 5 Aug 2017 05:56:47 +0000 (11:26 +0530)]
allo-piano-dac-plus: Master volume added

Master volume added, which controls both DACs volumes.

See: https://github.com/raspberrypi/linux/pull/2149

8 years agooverlays: i2c-rtc: add m41t62
Eric Cooper [Sat, 29 Jul 2017 19:52:58 +0000 (15:52 -0400)]
overlays: i2c-rtc: add m41t62

Add support for the ST M41T62 real-time clock chip.

8 years agoBug fix: unmuted
allocom [Thu, 27 Jul 2017 18:19:36 +0000 (23:49 +0530)]
Bug fix: unmuted

8 years agoASoC: bcm2835: Enforce full symmetry
Matthias Reichl [Sun, 7 May 2017 14:24:57 +0000 (16:24 +0200)]
ASoC: bcm2835: Enforce full symmetry

bcm2835's configuration registers can't be changed when a stream
is running, which means asymmetric configurations aren't supported.

Channel and rate symmetry are already enforced by constraints
but samplebits had been missed.

As hw_params doesn't check for symmetry constraints by itself
and just returns success if a stream is running this led to
situations where asymmetric configurations were seeming to
succeed but of course didn't work because the hardware wasn't
configured at all.

Fix this by adding the missing samplerate symmetry constraint.

Signed-off-by: Matthias Reichl <hias@horus.com>
8 years agoASoC: bcm2835: Support additional samplerates up to 384kHz
Matthias Reichl [Sun, 7 May 2017 14:19:54 +0000 (16:19 +0200)]
ASoC: bcm2835: Support additional samplerates up to 384kHz

Sample rates are only restricted by the capabilities of the
clock driver, so use SNDRV_PCM_RATE_CONTINUOUS instead of
SNDRV_PCM_RATE_8000_192000.

Tests (eg with pcm5122) have shown that bcm2835 works fine
in 384kHz/32bit stereo mode, so change the maximum allowed
rate from 192kHz to 384kHz.

Signed-off-by: Matthias Reichl <hias@horus.com>
8 years agoASoC: bcm2835: Support left/right justified and DSP modes
Matthias Reichl [Sun, 7 May 2017 13:30:50 +0000 (15:30 +0200)]
ASoC: bcm2835: Support left/right justified and DSP modes

DSP modes and left/right justified modes can be supported
on bcm2835 by configuring the frame sync polarity and
frame sync length registers and by adjusting the
channel data position registers.

Clock and frame sync polarity handling in hw_params has
been refactored to make the interaction between logical
rising/falling edge frame start and physical configuration
(changed by normal/inverted polarity modes) clearer.

Modes where the first active data bit is transmitted immediately
after frame start (eg DSP mode B with slot 0 active)
only work reliable if bcm2835 is configured as frame master.
In frame slave mode channel swap (or shift, this isn't quite
clear yet) can occur.

Currently the driver only warns if an unstable configuration
is detected but doensn't prevent using them.

Signed-off-by: Matthias Reichl <hias@horus.com>
8 years agoASoC: bcm2835: Add support for TDM modes
Matthias Reichl [Sun, 7 May 2017 09:34:26 +0000 (11:34 +0200)]
ASoC: bcm2835: Add support for TDM modes

bcm2835 supports arbitrary positioning of channel data within
a frame and thus is capable of supporting TDM modes. Since
the driver is limited to 2-channel operations only TDM setups
with exactly 2 active slots are supported.

Logical TDM slot numbering follows the usual convention:

For I2S-like modes, with a 50% duty-cycle frame clock,
slots 0, 2, ... are transmitted in the first half of a frame,
slots 1, 3, ... are transmitted in the second half.

For DSP modes slot numbering is ascending: 0, 1, 2, 3, ...

Channel position calculation has been refactored to use
TDM info and moved out of hw_params.

set_tdm_slot, set_bclk_ratio and hw_params now check more
strictly if the configuration is valid. Illegal configurations
like odd number of slots in I2S mode, data lengths exceeding
slot width or frame sizes larger than the hardware limit of
1024 are rejected. Also hw_params now properly checks for
errors from clk_set_rate.

Allowed PCM formats are already guarded by stream constraints,
thus the formats check in hw_params has been removed and
data_length is now retrieved via params_width().

Also standard functions like snd_soc_params_to_bclk are now
being used instead of manual calculations to make the code
more readable.

Special care has been taken to ensure that set_bclk_ratio works
as before. The bclk ratio is mapped to a 2-channel TDM config
with a slot width of half the ratio. In order to support odd ratios,
which can't be expressed via a TDM config, the ratio (frame length)
is stored and used by hw_params.

Signed-off-by: Matthias Reichl <hias@horus.com>
8 years agoSets the BCDC priority to constant 0
James Hughes [Fri, 21 Jul 2017 08:55:12 +0000 (09:55 +0100)]
Sets the BCDC priority to constant 0

This is to workaround for a possible issue in the
wireless chip firmware where some packets with
higher priorities seem to go missing.

See https://github.com/raspberrypi/linux/issues/1342 for
details.

8 years agoBCM270X_DT: Add PaPiRus overlay
Noralf Trønnes [Sat, 15 Jul 2017 22:13:36 +0000 (00:13 +0200)]
BCM270X_DT: Add PaPiRus overlay

Add Device Tree overlay for the PaPiRus ePaper Screens by Pi Supply.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
8 years agoconfig: Enable TINYDRM and drivers
Noralf Trønnes [Sat, 15 Jul 2017 19:24:18 +0000 (21:24 +0200)]
config: Enable TINYDRM and drivers

Enable tinydrm library, mi0283qt and repaper drivers.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
8 years agodrm/tinydrm: Add RePaper e-ink driver
Noralf Trønnes [Wed, 31 May 2017 20:27:40 +0000 (22:27 +0200)]
drm/tinydrm: Add RePaper e-ink driver

This adds support for the Pervasive Displays RePaper branded displays.
The controller code is taken from the userspace driver available
through repaper.org. Only the V231 film is supported since the others
are EOL.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
[rebase on 4.9]
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
8 years agodrm/tinydrm: Add tinydrm_xrgb8888_to_gray8() helper
Noralf Trønnes [Wed, 31 May 2017 20:26:53 +0000 (22:26 +0200)]
drm/tinydrm: Add tinydrm_xrgb8888_to_gray8() helper

Drm has no monochrome or greyscale support so add a conversion
from the common format XR24.

Also reorder includes into the common order.

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
[rebase on 4.9]
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
8 years agodrm/tinydrm: Fix drm_driver.fops.owner
Noralf Trønnes [Sun, 26 Mar 2017 14:25:29 +0000 (16:25 +0200)]
drm/tinydrm: Fix drm_driver.fops.owner

drm_driver.fops can't be shared since the owner then becomes tinydrm.ko.
Move the fops declaration to the driver.

v2: Use DEFINE_DRM_GEM_CMA_FOPS

Reported-by: Daniel Vetter <daniel.vetter@intel.com>
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170326142529.16938-1-noralf@tronnes.org
8 years agodrm: Create DEFINE_DRM_GEM_CMA_FOPS and roll it out to drivers
Daniel Vetter [Wed, 8 Mar 2017 14:12:56 +0000 (15:12 +0100)]
drm: Create DEFINE_DRM_GEM_CMA_FOPS and roll it out to drivers

Less code ftw.

This converts all drivers except the tinydrm helper module. That one
needs more work, since it gets the THIS_MODULE reference from
tinydrm.ko instead of the actual driver module like it should.
Probably needs a similar trick like I used here with generating the
entire struct with a macro.

Cc: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Acked-by: Liviu Dudau <Liviu.Dudau@arm.com>
Reviewed-by: Liviu Dudau <Liviu.Dudau@arm.com>
Reviewed-by: Sean Paul <seanpaul@chromium.org>
[rebased on 4.9, only macro no driver changes]
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
8 years agodrm/tinydrm: helpers: Properly fix backlight dependency
Noralf Trønnes [Thu, 23 Feb 2017 13:29:57 +0000 (14:29 +0100)]
drm/tinydrm: helpers: Properly fix backlight dependency

BACKLIGHT_CLASS_DEVICE was selected in the last version of the
tinydrm patchset to fix the backlight dependency, but the
ifdef CONFIG_BACKLIGHT_CLASS_DEVICE was forgotten. Fix that.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agodrm/tinydrm: mipi-dbi: Fix field width specifier warning
Noralf Trønnes [Thu, 23 Feb 2017 13:29:56 +0000 (14:29 +0100)]
drm/tinydrm: mipi-dbi: Fix field width specifier warning

This warning is seen on 64-bit builds in functions:
   'mipi_dbi_typec1_command':
   'mipi_dbi_typec3_command_read':
   'mipi_dbi_typec3_command':

>> drivers/gpu/drm/tinydrm/mipi-dbi.c:65:20: warning: field width specifier '*' expects argument of type 'int', but argument 5 has type 'size_t {aka long unsigned int}' [-Wformat=]
      DRM_DEBUG_DRIVER("cmd=%02x, par=%*ph\n", cmd, len, data); \
                       ^
   include/drm/drmP.h:228:40: note: in definition of macro 'DRM_DEBUG_DRIVER'
     drm_printk(KERN_DEBUG, DRM_UT_DRIVER, fmt, ##__VA_ARGS__)
                                           ^~~
>> drivers/gpu/drm/tinydrm/mipi-dbi.c:671:2: note: in expansion of macro 'MIPI_DBI_DEBUG_COMMAND'
     MIPI_DBI_DEBUG_COMMAND(cmd, parameters, num);
     ^~~~~~~~~~~~~~~~~~~~~~

Fix by casting 'len' to int in the macro MIPI_DBI_DEBUG_COMMAND().
There is no chance of overflow.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agodrm/tinydrm: mipi-dbi: Silence: ‘cmd’ may be used uninitialized
Noralf Trønnes [Thu, 23 Feb 2017 13:29:55 +0000 (14:29 +0100)]
drm/tinydrm: mipi-dbi: Silence: â€˜cmd’ may be used uninitialized

Fix this warning:
drivers/gpu/drm/tinydrm/mipi-dbi.c: In function â€˜mipi_dbi_debugfs_command_write’:
drivers/gpu/drm/tinydrm/mipi-dbi.c:905:8: warning: â€˜cmd’ may be used uninitialized in this function [-Wmaybe-uninitialized]
  ret = mipi_dbi_command_buf(mipi, cmd, parameters, i);
        ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

cmd can't be used uninitialized, but to satisfy the compiler,
initialize it to zero.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agodrm/tinydrm: Add support for Multi-Inno MI0283QT display
Noralf Trønnes [Sun, 22 Jan 2017 14:23:48 +0000 (15:23 +0100)]
drm/tinydrm: Add support for Multi-Inno MI0283QT display

Add driver to support the Multi-Inno MI0283QT display panel.
It has an ILI9341 MIPI DBI compatible display controller.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Thierry Reding <treding@nvidia.com>
8 years agodrm/tinydrm: Add MIPI DBI support
Noralf Trønnes [Sat, 21 Jan 2017 23:30:47 +0000 (00:30 +0100)]
drm/tinydrm: Add MIPI DBI support

Add support for MIPI DBI compatible controllers.
Interface type C option 1 and 3 are supported (SPI).

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Thierry Reding <treding@nvidia.com>
[rebased on 4.9]
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
8 years agodrm/tinydrm: Add helper functions
Noralf Trønnes [Sat, 21 Jan 2017 23:19:51 +0000 (00:19 +0100)]
drm/tinydrm: Add helper functions

Add common functionality needed by many tinydrm drivers.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Thierry Reding <treding@nvidia.com>
[rebased on 4.9]
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
8 years agodrm: Add DRM support for tiny LCD displays
Noralf Trønnes [Sat, 21 Jan 2017 23:15:00 +0000 (00:15 +0100)]
drm: Add DRM support for tiny LCD displays

tinydrm provides helpers for very simple displays that can use
CMA backed framebuffers and need flushing on changes.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Thierry Reding <treding@nvidia.com>
[rebased on 4.9]
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
8 years agodrm: debugfs: Remove all files automatically on cleanup
Noralf Trønnes [Thu, 26 Jan 2017 22:56:03 +0000 (23:56 +0100)]
drm: debugfs: Remove all files automatically on cleanup

Instead of having the drivers call drm_debugfs_remove_files() in
their drm_driver->debugfs_cleanup hook, do it automatically by
traversing minor->debugfs_list.
Also use debugfs_remove_recursive() so drivers who add their own
debugfs files don't have to keep track of them for removal.

Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20170126225621.12314-2-noralf@tronnes.org
[rebased on 4.9]
Signed-off-by: Noralf Trønnes <noralf@tronnes.org>
8 years agooverlays: i2c1-bcm2708: Don't overwrite i2c1 pins node
Phil Elwell [Wed, 19 Jul 2017 14:20:50 +0000 (15:20 +0100)]
overlays: i2c1-bcm2708: Don't overwrite i2c1 pins node

It is bad practise to overwrite an entire node in an overlay. Instead,
target the node and overwrite any properties that need changing.

See: https://github.com/raspberrypi/linux/pull/2118

Suggested-by: soodvarun78 <soodvarun78@gmail.com>
Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agobcm2835-mmc: Prevent DMA race condition
Phil Elwell [Tue, 18 Jul 2017 14:30:48 +0000 (15:30 +0100)]
bcm2835-mmc: Prevent DMA race condition

The end of a read operation is triggered by the completion of the DMA
transfer, but writes are complete when the data IRQ is raised. The
bcm2835-mmc driver contains a race between the handling of the DMA
completion interrupt and the submission of the next request. Fix the
race by deferring the completion of the request until the DMA
transfer finishes.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agoconfig: enhance DualShock3 controller support
Conn [Mon, 17 Jul 2017 02:25:43 +0000 (03:25 +0100)]
config: enhance DualShock3 controller support

Enable rumble support in Sony HID & HID battery strength.

8 years agobcm2835-mmc: Fix DMA usage
Phil Elwell [Fri, 14 Jul 2017 11:59:55 +0000 (12:59 +0100)]
bcm2835-mmc: Fix DMA usage

The previous change ("bcm2835-mmc: Only claim one DMA channel")
used an incorrect variable, the effect of which was to prevent
DMA from being used at all. Fix that bug by using the right
variable.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agoconfig: enable generic S/PDIF codec drivers (#2104)
Matthias Reichl [Mon, 10 Jul 2017 09:05:17 +0000 (11:05 +0200)]
config: enable generic S/PDIF codec drivers (#2104)

These drivers can be used as dummy ADC/DAC drivers for
attaching general codecs that don't need to be configured.

This option will build 2 additional drivers, spdif_receiver
and spdif_transmitter.

Since these drivers have DT bindings they are handy for quick
testing of I2S peripherals with simple-audio-card.

eg:

fragment@0 {
    target-path = "/";
    __overlay__ {
        dummy_receiver: spdif-receiver {
            #address-cells = <0>;
            #size-cells = <0>;
            #sound-dai-cells = <0>;
            compatible = "linux,spdif-dir";
            status = "okay";
        };
    };
};

Signed-off-by: Matthias Reichl <hias@horus.com>
8 years agooverlays: Add gpio-shutdown overlay (#2103)
Matthijs Kooijman [Sun, 9 Jul 2017 13:15:22 +0000 (15:15 +0200)]
overlays: Add gpio-shutdown overlay (#2103)

This overlay facilitates the addition of a powerbutton by converting
GPIO edges into KEY_POWER keypresses, which can be handled by
systemd-logind to shut down the system.

Signed-off-by: Matthijs Kooijman <matthijs@stdin.nl>
8 years agodrm/vc4: Add support for setting DPMS in firmwarekms.
Eric Anholt [Thu, 6 Jul 2017 18:45:48 +0000 (11:45 -0700)]
drm/vc4: Add support for setting DPMS in firmwarekms.

This ensures that the screen goes blank during DPMS (screensaver),
including the cursor.  Planes don't necessarily get disabled during
CRTC disable, so we need to be careful to not leave them on or turn
them back on early.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm: allow changing DPMS mode
Marta Lofstedt [Mon, 5 Dec 2016 12:04:08 +0000 (14:04 +0200)]
drm: allow changing DPMS mode

The drm_atomic_helper_connector_dpms
will set the connector back the old DPMS state
before returning. This makes it impossible to change
DPMS state of the connector.

Fixes: 0853695c3ba46f97dfc0b5885f7b7e640ca212dd
v2: edit of commit message
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Engestrom <eric.engestrom@imgtec.com>
Cc: Sean Paul <seanpaul@chromium.org>
Cc: dri-devel@lists.freedesktop.org
Cc: <drm-intel-fixes@lists.freedesktop.org>
Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161205120408.13056-1-marta.lofstedt@intel.com
(cherry picked from commit 8f5040e421ca4bbd8cd5216dec509da188eb74bc)

8 years agoPianoPlus: Dual Mono & Dual Stereo features added (#2069)
Allo [Mon, 3 Jul 2017 10:15:20 +0000 (15:45 +0530)]
PianoPlus: Dual Mono & Dual Stereo features added (#2069)

8 years agoNew i2c-rtc-gpio device overlay (#2092)
Steve Conner [Thu, 29 Jun 2017 14:56:19 +0000 (15:56 +0100)]
New i2c-rtc-gpio device overlay (#2092)

Created new i2c-rtc-gpio device overlay by combining i2c-rtc and i2c-gpio. Tested with PCF2127 on CM3.

8 years agommc: Apply ERASE_BROKEN quirks correctly
Phil Elwell [Thu, 23 Jun 2016 15:37:46 +0000 (16:37 +0100)]
mmc: Apply ERASE_BROKEN quirks correctly

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agoserial: 8250: Fix THRE flag usage for CAP_MINI
Phil Elwell [Wed, 21 Jun 2017 16:19:04 +0000 (17:19 +0100)]
serial: 8250: Fix THRE flag usage for CAP_MINI

The BCM2835 MINI UART has non-standard THRE semantics. Conventionally
the bit means that the FIFO is empty (although there may still be a
byte in the transmit register), but on 2835 it indicates that the FIFO
is not empty. This causes interrupts after every byte is transmitted,
with the FIFO providing some interrupt latency tolerance.

A consequence of this difference is that the usual strategy of writing
multiple bytes into the TX FIFO after checking THRE once is unsafe.
In the worst case of 7 bytes in the FIFO, writing 8 bytes loses all
but the first since by then the FIFO is full.

There is an HFIFO ("Hidden FIFO") bit which is almost what is needed,
but it only adds more bytes while both THRE and TEMT are set, i.e.
when the TX side is completely idle. This is unnecessarily pessimistic.

Add a new special case, predicated on CAP_MINI, that loops until THRE
is no longer set. With this change, the FIFO fills quickly but
subsequent writes are paced by the transmission rate.

See: https://github.com/raspberrypi/linux/issues/1855

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agobcm2708: Drop CMA alignment from FKMS mode as well.
Eric Anholt [Wed, 21 Jun 2017 16:03:51 +0000 (09:03 -0700)]
bcm2708: Drop CMA alignment from FKMS mode as well.

I dropped it from KMS mode in d88274d88ed81de1ade8e18e4c0ed91792ec82ea
and should have done both of them at that time.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agobcm2835-cpufreq: Change licence to GPLv2
popcornmix [Tue, 20 Jun 2017 16:51:47 +0000 (17:51 +0100)]
bcm2835-cpufreq: Change licence to GPLv2

Signed-off-by: Eben Upton <eben.upton@broadcom.com>
Signed-off-by: Dom Cobley <dom@raspberrypi.com>
8 years agodwc_otg: fiq_fsm: Add non-periodic TT exclusivity constraints
P33M [Tue, 20 Jun 2017 12:44:01 +0000 (13:44 +0100)]
dwc_otg: fiq_fsm: Add non-periodic TT exclusivity constraints

Certain hub types do not discriminate between pipe direction (IN or OUT)
when considering non-periodic transfers. Therefore these hubs get confused
if multiple transfers are issued in different directions with the same
device address and endpoint number.

Constrain queuing non-periodic split transactions so they are performed
serially in such cases.

Related: https://github.com/raspberrypi/linux/issues/2024

8 years agoUSB: serial: ch341: change initial line-control settings
Johan Hovold [Fri, 6 Jan 2017 18:15:23 +0000 (19:15 +0100)]
USB: serial: ch341: change initial line-control settings

commit 7c61b0d5e82bfe29b8dda55745afbf65b6ccc901 upstream.

Some CH340 devices appear unable to change the initial LCR settings, so
set a sane 8N1 default during probe to enable basic support for such
devices.

Also drop a redundant LCR read during device initialisation.

Signed-off-by: Johan Hovold <johan@kernel.org>
8 years agodrm/vc4: Add FB modifier support to firmwarekms.
Eric Anholt [Wed, 7 Jun 2017 21:39:49 +0000 (14:39 -0700)]
drm/vc4: Add FB modifier support to firmwarekms.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add get/set tiling ioctls.
Eric Anholt [Mon, 5 Jun 2017 21:00:45 +0000 (14:00 -0700)]
drm/vc4: Add get/set tiling ioctls.

This allows mesa to set the tiling format for a BO and have that
tiling format be respected by mesa on the other side of an
import/export (and by vc4 scanout in the kernel), without defining a
protocol to pass the tiling through userspace.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add T-format scanout support.
Eric Anholt [Mon, 5 Jun 2017 19:16:10 +0000 (12:16 -0700)]
drm/vc4: Add T-format scanout support.

The T tiling format is what V3D uses for textures, with no raster
support at all until later revisions of the hardware (and always at a
large 3D performance penalty).  If we can't scan out V3D's format,
then we often need to do a relayout at some stage of the pipeline,
either right before texturing from the scanout buffer (common in X11
without a compositor) or between a tiled screen buffer right before
scanout (an option I've considered in trying to resolve this
inconsistency, but which means needing to use the dirty fb ioctl and
having some update policy).

T-format scanout lets us avoid either of those shadow copies, for a
massive, obvious performance improvement to X11 window dragging
without a compositor.  Unfortunately, enabling a compositor to work
around the discrepancy has turned out to be too costly in memory
consumption for the Raspbian distribution.

Because the HVS operates a scanline at a time, compositing from T does
increase the memory bandwidth cost of scanout.  On my 1920x1080@32bpp
display on a RPi3, we go from about 15% of system memory bandwidth
with linear to about 20% with tiled.  However, for X11 this still ends
up being a huge performance win in active usage.

This patch doesn't yet handle src_x/src_y offsetting within the tiled
buffer.  However, we fail to do so for untiled buffers already.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agoRevert "drm/vc4: Add T-format scanout support."
popcornmix [Tue, 13 Jun 2017 14:06:25 +0000 (15:06 +0100)]
Revert "drm/vc4: Add T-format scanout support."

This reverts commit 85e9ae254717d2e4a313945a465230a3102cad42.

8 years agoRevert "drm/vc4: Add get/set tiling ioctls."
popcornmix [Tue, 13 Jun 2017 14:06:24 +0000 (15:06 +0100)]
Revert "drm/vc4: Add get/set tiling ioctls."

This reverts commit 3ea95503a626b7e4157afa0745d11908546654b1.

8 years agoRevert "drm/vc4: Add FB modifier support to firmwarekms."
popcornmix [Tue, 13 Jun 2017 14:06:22 +0000 (15:06 +0100)]
Revert "drm/vc4: Add FB modifier support to firmwarekms."

This reverts commit 9183dfdbf2cb3ec8e981204847b345f7ab95662d.

8 years agodwc_otg: add module parameter int_ep_interval_min
P33M [Mon, 12 Jun 2017 15:10:03 +0000 (16:10 +0100)]
dwc_otg: add module parameter int_ep_interval_min

Add a module parameter (defaulting to ignored) that clamps the polling rate
of high-speed Interrupt endpoints to a minimum microframe interval.

The parameter is modifiable at runtime as it is used when activating new
endpoints (such as on device connect).

8 years agoconfig: Add CONFIG_CAN_GS_USB
popcornmix [Mon, 12 Jun 2017 12:05:43 +0000 (13:05 +0100)]
config: Add CONFIG_CAN_GS_USB

8 years agodrm/vc4: Add FB modifier support to firmwarekms.
Eric Anholt [Wed, 7 Jun 2017 21:39:49 +0000 (14:39 -0700)]
drm/vc4: Add FB modifier support to firmwarekms.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add get/set tiling ioctls.
Eric Anholt [Mon, 5 Jun 2017 21:00:45 +0000 (14:00 -0700)]
drm/vc4: Add get/set tiling ioctls.

This allows mesa to set the tiling format for a BO and have that
tiling format be respected by mesa on the other side of an
import/export (and by vc4 scanout in the kernel), without defining a
protocol to pass the tiling through userspace.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agodrm/vc4: Add T-format scanout support.
Eric Anholt [Mon, 5 Jun 2017 19:16:10 +0000 (12:16 -0700)]
drm/vc4: Add T-format scanout support.

The T tiling format is what V3D uses for textures, with no raster
support at all until later revisions of the hardware (and always at a
large 3D performance penalty).  If we can't scan out V3D's format,
then we often need to do a relayout at some stage of the pipeline,
either right before texturing from the scanout buffer (common in X11
without a compositor) or between a tiled screen buffer right before
scanout (an option I've considered in trying to resolve this
inconsistency, but which means needing to use the dirty fb ioctl and
having some update policy).

T-format scanout lets us avoid either of those shadow copies, for a
massive, obvious performance improvement to X11 window dragging
without a compositor.  Unfortunately, enabling a compositor to work
around the discrepancy has turned out to be too costly in memory
consumption for the Raspbian distribution.

Because the HVS operates a scanline at a time, compositing from T does
increase the memory bandwidth cost of scanout.  On my 1920x1080@32bpp
display on a RPi3, we go from about 15% of system memory bandwidth
with linear to about 20% with tiled.  However, for X11 this still ends
up being a huge performance win in active usage.

This patch doesn't yet handle src_x/src_y offsetting within the tiled
buffer.  However, we fail to do so for untiled buffers already.

Signed-off-by: Eric Anholt <eric@anholt.net>
8 years agooverlays: Fix i2c-rtc order and fragment numbering
Phil Elwell [Wed, 7 Jun 2017 07:53:36 +0000 (08:53 +0100)]
overlays: Fix i2c-rtc order and fragment numbering

See: https://github.com/raspberrypi/linux/issues/2059

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agodma-bcm2708: Fix module compilation of CONFIG_DMA_BCM2708
Andrei Gherzan [Mon, 5 Jun 2017 15:40:38 +0000 (16:40 +0100)]
dma-bcm2708: Fix module compilation of CONFIG_DMA_BCM2708

bcm2708-dmaengine.c defines functions like bcm_dma_start which are
defined as well in dma-bcm2708.h as inline versions when
CONFIG_DMA_BCM2708 is not defined. This works fine when
CONFIG_DMA_BCM2708 is built in, but when it is selected as module build
fails with redefinition errors because in the build system when
CONFIG_DMA_BCM2708 is selected as module, the macro becomes
CONFIG_DMA_BCM2708_MODULE.

This patch makes the header use CONFIG_DMA_BCM2708_MODULE too when
available.

Fixes https://github.com/raspberrypi/linux/issues/2056

Signed-off-by: Andrei Gherzan <andrei@gherzan.com>
8 years agoBCM270X_DT: Add midi-uart1 overlay
Phil Elwell [Fri, 26 May 2017 12:03:41 +0000 (13:03 +0100)]
BCM270X_DT: Add midi-uart1 overlay

Add a scaler to the ttyS0 clock so that requesting 38400 baud results
in an approximately 31250 baud signal. This is analagous to
midi-uart0, except for ttyS0, which may be useful on Pi3 and also
may avoid an issue with ttyAMA0 failing to synchronise to an active
data stream.

See: https://www.raspberrypi.org/forums/viewtopic.php?f=107&t=183860

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agocgroup_get() expected to be called only on live cgroups and triggers
Tejun Heo [Fri, 28 Apr 2017 19:14:55 +0000 (15:14 -0400)]
cgroup_get() expected to be called only on live cgroups and triggers
warning on a dead cgroup; however, cgroup_sk_alloc() may be called
while cloning a socket which is left in an empty and removed cgroup
and thus may legitimately duplicate its reference on a dead cgroup.
This currently triggers the following warning spuriously.

 WARNING: CPU: 14 PID: 0 at kernel/cgroup.c:490 cgroup_get+0x55/0x60
 ...
  [<ffffffff8107e123>] __warn+0xd3/0xf0
  [<ffffffff8107e20e>] warn_slowpath_null+0x1e/0x20
  [<ffffffff810ff465>] cgroup_get+0x55/0x60
  [<ffffffff81106061>] cgroup_sk_alloc+0x51/0xe0
  [<ffffffff81761beb>] sk_clone_lock+0x2db/0x390
  [<ffffffff817cce06>] inet_csk_clone_lock+0x16/0xc0
  [<ffffffff817e8173>] tcp_create_openreq_child+0x23/0x4b0
  [<ffffffff818601a1>] tcp_v6_syn_recv_sock+0x91/0x670
  [<ffffffff817e8b16>] tcp_check_req+0x3a6/0x4e0
  [<ffffffff81861ba3>] tcp_v6_rcv+0x693/0xa00
  [<ffffffff81837429>] ip6_input_finish+0x59/0x3e0
  [<ffffffff81837cb2>] ip6_input+0x32/0xb0
  [<ffffffff81837387>] ip6_rcv_finish+0x57/0xa0
  [<ffffffff81837ac8>] ipv6_rcv+0x318/0x4d0
  [<ffffffff817778c7>] __netif_receive_skb_core+0x2d7/0x9a0
  [<ffffffff81777fa6>] __netif_receive_skb+0x16/0x70
  [<ffffffff81778023>] netif_receive_skb_internal+0x23/0x80
  [<ffffffff817787d8>] napi_gro_frags+0x208/0x270
  [<ffffffff8168a9ec>] mlx4_en_process_rx_cq+0x74c/0xf40
  [<ffffffff8168b270>] mlx4_en_poll_rx_cq+0x30/0x90
  [<ffffffff81778b30>] net_rx_action+0x210/0x350
  [<ffffffff8188c426>] __do_softirq+0x106/0x2c7
  [<ffffffff81082bad>] irq_exit+0x9d/0xa0 [<ffffffff8188c0e4>] do_IRQ+0x54/0xd0
  [<ffffffff8188a63f>] common_interrupt+0x7f/0x7f <EOI>
  [<ffffffff8173d7e7>] cpuidle_enter+0x17/0x20
  [<ffffffff810bdfd9>] cpu_startup_entry+0x2a9/0x2f0
  [<ffffffff8103edd1>] start_secondary+0xf1/0x100

This patch renames the existing cgroup_get() with the dead cgroup
warning to cgroup_get_live() after cgroup_kn_lock_live() and
introduces the new cgroup_get() which doesn't check whether the cgroup
is live or dead.

All existing cgroup_get() users except for cgroup_sk_alloc() are
converted to use cgroup_get_live().

Fixes: d979a39d7242 ("cgroup: duplicate cgroup reference when cloning sockets")
Cc: stable@vger.kernel.org # v4.5+
Cc: Johannes Weiner <hannes@cmpxchg.org>
Reported-by: Chris Mason <clm@fb.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
8 years agoAllo Digione Driver (#2048)
sandeepal [Fri, 2 Jun 2017 13:29:46 +0000 (18:59 +0530)]
Allo Digione Driver (#2048)

Driver for the Allo Digione soundcard

8 years agodwc_otg: fiq_fsm: Make isochronous compatibility checks work properly
P33M [Fri, 26 May 2017 11:50:31 +0000 (12:50 +0100)]
dwc_otg: fiq_fsm: Make isochronous compatibility checks work properly

Get rid of the spammy printk and local pointer mangling.
Also, there is a nominal benefit for using fiq_fsm for isochronous
transfers in FS mode (~1.1k IRQs per second vs 2.1k IRQs per second)
so remove the root port speed check.

8 years agoAdd device tree config for htu21
Stefan Tatschner [Mon, 29 May 2017 19:46:16 +0000 (21:46 +0200)]
Add device tree config for htu21

See: https://github.com/raspberrypi/linux/pull/2041

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agoBCM270X_DT: Improve i2c-sensor and i2c-rtc overlay
Phil Elwell [Wed, 31 May 2017 14:27:39 +0000 (15:27 +0100)]
BCM270X_DT: Improve i2c-sensor and i2c-rtc overlay

Use the "__dormant__" feature to permit multiple instances of each
overlay, which is more useful now that changing the "reg" property
also changes the node address. Although the overlay grows slightly,
when applied only the requested node is included.

Usage does not change, except that the "lm75addr" parameter of the
i2c-sensor overlay has been deprecated in favour of the generic
"addr" parameter.

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agoconfig: Adding SENSOR_JC42
Phil Elwell [Wed, 31 May 2017 08:33:55 +0000 (09:33 +0100)]
config: Adding SENSOR_JC42

The jc42 module supports a number of I2C-based temperature
sensor modules.

[ DM_RAID0 config lost because now selected by DM_RAID ]

See: https://github.com/raspberrypi/linux/issues/2046

Signed-off-by: Phil Elwell <phil@raspberrypi.org>
8 years agodwc_otg: make periodic scheduling behave properly for FS buses
P33M [Thu, 25 May 2017 15:04:53 +0000 (16:04 +0100)]
dwc_otg: make periodic scheduling behave properly for FS buses

If the root port is in full-speed mode, transfer times at 12mbit/s
would be calculated but matched against high-speed quotas.

Reinitialise hcd->frame_usecs[i] on each port enable event so that
full-speed bandwidth can be tracked sensibly.

Also, don't bother using the FIQ for transfers when in full-speed
mode - at the slower bus speed, interrupt frequency is reduced by
an order of magnitude.

Related issue: https://github.com/raspberrypi/linux/issues/2020

8 years agohid: Reduce default mouse polling interval to 60Hz
popcornmix [Mon, 14 Jul 2014 21:02:09 +0000 (22:02 +0100)]
hid: Reduce default mouse polling interval to 60Hz

Reduces overhead when using X

8 years agoHID: usbhid: extend polling interval configuration to joysticks
Tobias Jakobi [Sat, 25 Feb 2017 19:27:27 +0000 (20:27 +0100)]
HID: usbhid: extend polling interval configuration to joysticks

For mouse devices we can currently change the polling interval
via usbhid.mousepoll. Implement the same thing for joysticks, so
users can reduce input latency this way.

This has been tested with a Logitech RumblePad 2 with jspoll=2,
resulting in a polling rate of 500Hz (verified with evhz).

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
8 years agoRevert "hid: Reduce default mouse polling interval to 60Hz"
popcornmix [Wed, 24 May 2017 17:06:02 +0000 (18:06 +0100)]
Revert "hid: Reduce default mouse polling interval to 60Hz"

This reverts commit b45c0448b60d691508251cdccf242ea43bbabb14.