drm/exynos: fix unnecessary resource cleanup

This patch removes unnecessary drm_mode_config_cleanup call.

Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
drm/exynos: delay fbdev initialization until an output is connected

In case fbdev is initialized before any output is connected,
fb resolution defaults to 1024x768. After that any output with
bigger resolution is ignored and fbdev is not displayed.
The patch postpones fbdev initialization to avoid such situation.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drm/exynos: init kms poll after creation of connectors

KMS poll init helper should be run when connectors are created,
otherwise it will not schedule connection detector.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drm/exynos: correct timing porch conversion

The patch corrects porch calculation. It should
be calculated as a difference between adjacent
respective fields of drm_display_mode.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Daniel Kurtz <djkurtz@chromium.org>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
exynos/fimd: add parallel output related bindings

The patch adds bindings required to add support
for parallel output.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drm/exynos: restore parallel output interface support

The patch adds parallel output interface to FIMD device driver.
It also restores support for panels initialized by boot loader,
but without proper kernel driver.
Driver uses video interface bindings to find connected panel.
It uses drm_panel interface to interact with the panel.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
ARM: dts: exynos4210-universal: add exynos/fimd node

The patch adds fimd node with display timings for exynos4210-universal device.
It also makes LCD regulators always on. This allow to re-use panel initialized
by boot loader.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drm/exynos: fimd: remove unused variable

The patch removes unused vidcon0 field from fimd_context structure.

Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
drm/i915: add locking to fixed panel edid probing

With the recent addition of locking checks in

commit 62ff94a5492175759546f8bc61383189d6b49122
Author:     Daniel Vetter <daniel.vetter@ffwll.ch>
AuthorDate: Thu Jan 23 22:18:47 2014 +0100

    drm/crtc-helper: remove LOCKING from kerneldoc

drm_add_edid_modes started to WARN about the mode_config.mutex not
being held in the lvds and dp initialization code.

Now since this is init code locking is fairly redudant if it wouldn't
be for the drm core registering sysfs files a bit early. And the
locking WARNINGs nicely enforce that indeed all access to the mode
lists are properly protected. And a full audit shows that only i915
and gma500 touch the modes lists at init time.

Hence I've opted to wrap up this entire mode detection sequence for
fixed panels with the mode_config mutex for both lvds and edp outputs.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drm/gma500: add locking to fixed panel edid probing

With the recent addition of locking checks in

commit 62ff94a5492175759546f8bc61383189d6b49122
Author:     Daniel Vetter <daniel.vetter@ffwll.ch>
AuthorDate: Thu Jan 23 22:18:47 2014 +0100

    drm/crtc-helper: remove LOCKING from kerneldoc

drm_add_edid_modes started to WARN about the mode_config.mutex not
being held in the lvds and dp initialization code.

Now since this is init code locking is fairly redudant if it wouldn't
be for the drm core registering sysfs files a bit early. And the
locking WARNINGs nicely enforce that indeed all access to the mode
lists are properly protected. And a full audit shows that only i915
and gma500 touch the modes lists at init time.

Hence I've opted to wrap up this entire mode detection sequence for
fixed panels with the mode_config mutex for both lvds and edp outputs.

Cc: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Patrik Jakobsson <patrik.r.jakobsson@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Merge branch 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos into drm-next

Highlights
----------

Re-factoring works over the exynos drm framework.
  - drm_crtc, drm_encoder/drm_connector are implemented by sub drivers
    directly.
  - Removing pm interfaces from each sub driver, and implementing them
    at top level of exynos drm.
Add DisplayPort Transmitter driver.
  - Just moving existing driver from drivers/vides/exynos into
    drivers/gpu/drm/exynos.
Add new LVDS bridge driver, PTN3460.
  - Placed in drivers/gpu/drm/bridge, and this device is used to transfer
    image signal from DP(DisplayPort) to LVDS Panel.
    So this driver will be used with DP driver moved into exynos drm.
Add parallel panel support
  - With the re-factoring patch series, existing parallel panel support was
    broken by moving exynos_drm_display ops into each real connector driver,
    DP. So this patch series adds a new parallel panel module,
    exynos_drm_dpi, for supporting parallel panel, and also adds relevant
    bindings.
Some fixups and cleanups.

* 'exynos-drm-next' of git://git.kernel.org/pub/scm/linux/kernel/git/daeinki/drm-exynos: (45 commits)
  drm/exynos: fimd: remove unused variable
  ARM: dts: exynos4210-universal: add exynos/fimd node
  drm/exynos: restore parallel output interface support
  exynos/fimd: add parallel output related bindings
  drm/exynos: correct timing porch conversion
  drm/exynos: init kms poll after creation of connectors
  drm/exynos: delay fbdev initialization until an output is connected
  drm/exynos: fix unnecessary resource cleanup
  drm/exynos: hdmi: use i2c_adapter instead of i2c_client
  drm/exynos: hdmi: consider APB PHY
  drm/exynos: Remove the exynos_drm_connector shim
  drm/exynos: Implement lvds bridge discovery to DP driver
  drm/bridge: Add PTN3460 bridge driver
  drm/exynos: Implement drm_connector directly in vidi driver
  drm/exynos: Implement drm_connector directly in dp driver
  drm/exynos: Implement drm_connector in hdmi directly
  drm/exynos: Add create_connector callback
  drm/exynos: Consolidate suspend/resume in drm_drv
  drm/exynos: Clean up FIMD power on/off routines
  drm/exynos: Implement dpms display callback in DP
  ...
drm/bridge/ptn3460: fix modular build

This failed to build =m, quick fix.

Signed-off-by: Dave Airlie <airlied@redhat.com>
NVMe: Add CONFIG_PM_SLEEP to suspend/resume functions

Add CONFIG_PM_SLEEP to suspend/resume functions to fix the following
build warning when CONFIG_PM_SLEEP is not selected. This is because
sleep PM callbacks defined by SIMPLE_DEV_PM_OPS are only used when
the CONFIG_PM_SLEEP is enabled.

drivers/block/nvme-core.c:2541:12: warning: 'nvme_suspend' defined but not used [-Wunused-function]
drivers/block/nvme-core.c:2550:12: warning: 'nvme_resume' defined but not used [-Wunused-function]

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
NVMe: Initialize device reference count earlier

If an NVMe device becomes ready but fails to create IO queues, the driver
creates a character device handle so the device can be managed. The
device reference count needs to be initialized before creating the
character device.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
NVMe: RCU protected access to io queues

This adds rcu protected access to nvme_queue to fix a race between a
surprise removal freeing the queue and a thread with open reference on
a NVMe block device using that queue.

The queues do not need to be rcu protected during the initialization or
shutdown parts, so I've added a helper function for raw deferencing
to get around the sparse errors.

There is still a hole in the IOCTL path for the same problem, which is
fixed in a subsequent patch.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
NVMe: IOCTL path RCU protect queue access

This adds rcu protected access to a queue in the nvme IOCTL path
to fix potential races between a surprise removal and queue usage in
nvme_submit_sync_cmd. The fix holds the rcu_read_lock() here to prevent
the nvme_queue from freeing while this path is executing so it can't
sleep, and so this path will no longer wait for a available command
id should they all be in use at the time a passthrough IOCTL request
is received.

Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
mmc: rename ARCH_BCM to ARCH_BCM_MOBILE

Currently ARCH_BCM has been used for Broadcom Mobile V7 based SoCs.
In order to allow other Broadcom SoCs to also use mach-bcm directory and
files, this patch renames the original ARCH_BCM to ARCH_BCM_MOBILE, and
uses ARCH_BCM to define any Broadcom chip residing in mach-bcm directory.

Signed-off-by: Christian Daudt <bcm@fixthebug.org>
Acked-by: Olof Johansson <olof@lixom.net>
Signed-off-by: Chris Ball <chris@printf.net>
NVMe: Fix divide-by-zero in nvme_trans_io_get_num_cmds

dev->max_hw_sectors may be zero to indicate the device has no limit on
the number of sectors.  nvme_trans_do_nvme_io() should use the software
limit, since this is guaranteed to be non-zero.

Reported-by: Mundu <mundu2510@gmail.com>
Signed-off-by: Keith Busch <keith.busch@intel.com>
Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
NVMe: Replace DEFINE_PCI_DEVICE_TABLE

Checkpatch has started warning against using DEFINE_PCI_DEVICE_TABLE,
so replace it.  Also update the copyright date and bump the module
version number to 0.9.

Signed-off-by: Matthew Wilcox <matthew.r.wilcox@intel.com>
kernel: Use RCU_INIT_POINTER(x, NULL) in audit.c

This patch replaces rcu_assign_pointer(x, NULL) with RCU_INIT_POINTER(x, NULL)

The rcu_assign_pointer() ensures that the initialization of a structure
is carried out before storing a pointer to that structure.
And in the case of the NULL pointer, there is no structure to initialize.
So, rcu_assign_pointer(p, NULL) can be safely converted to RCU_INIT_POINTER(p, NULL)

Signed-off-by: Monam Agarwal <monamagarwal123@gmail.com>
Signed-off-by: Eric Paris <eparis@redhat.com>