linux/include/drm
Sam Ravnborg 4bba72b72c drm/drm_fb_helper: fix fbdev with sparc64
[ Upstream commit 2a1658bf92 ]

Recent kernels have been reported to panic using the bochs_drm
framebuffer under qemu-system-sparc64 which was bisected to
commit 7a0483ac4f ("drm/bochs: switch to generic drm fbdev emulation").

The backtrace indicates that the shadow framebuffer copy in
drm_fb_helper_dirty_blit_real() is trying to access the real
framebuffer using a virtual address rather than use an IO access
typically implemented using a physical (ASI_PHYS) access on SPARC.

The fix is to replace the memcpy with memcpy_toio() from io.h.

memcpy_toio() uses writeb() where the original fbdev code
used sbus_memcpy_toio(). The latter uses sbus_writeb().

The difference between writeb() and sbus_memcpy_toio() is
that writeb() writes bytes in little-endian, where sbus_writeb() writes
bytes in big-endian. As endian does not matter for byte writes they are
the same. So we can safely use memcpy_toio() here.

Note that this only fixes bochs, in general fbdev helpers still have
issues with mixing up system memory and __iomem space. Fixing that will
require a lot more work.

v3:
  - Improved changelog (Daniel)
  - Added FIXME to fbdev_use_iomem (Daniel)

v2:
  - Added missing __iomem cast (kernel test robot)
  - Made changelog readable and fix typos (Mark)
  - Add flag to select iomem - and set it in the bochs driver

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reported-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reported-by: kernel test robot <lkp@intel.com>
Tested-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200709193016.291267-1-sam@ravnborg.org
Link: https://patchwork.freedesktop.org/patch/msgid/20200725191012.GA434957@ravnborg.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-08-11 15:33:37 +02:00
..
bridge
i2c
ttm
amd_asic_type.h
ati_pcigart.h
drm_agpsupport.h
drm_atomic_helper.h
drm_atomic_state_helper.h
drm_atomic_uapi.h
drm_atomic.h
drm_audio_component.h
drm_auth.h
drm_blend.h
drm_bridge.h
drm_cache.h
drm_client.h
drm_color_mgmt.h
drm_connector.h
drm_crtc_helper.h
drm_crtc.h
drm_damage_helper.h
drm_debugfs_crc.h
drm_debugfs.h
drm_device.h
drm_displayid.h
drm_dp_dual_mode_helper.h
drm_dp_helper.h
drm_dp_mst_helper.h
drm_drv.h
drm_dsc.h
drm_edid.h
drm_encoder_slave.h
drm_encoder.h
drm_fb_cma_helper.h
drm_fb_helper.h
drm_file.h
drm_fixed.h
drm_flip_work.h
drm_format_helper.h
drm_fourcc.h
drm_framebuffer.h
drm_gem_cma_helper.h
drm_gem_framebuffer_helper.h
drm_gem_shmem_helper.h
drm_gem_vram_helper.h
drm_gem.h
drm_hashtab.h
drm_hdcp.h
drm_ioctl.h
drm_irq.h
drm_lease.h
drm_legacy.h
drm_mipi_dbi.h
drm_mipi_dsi.h
drm_mm.h
drm_mode_config.h
drm_mode_object.h
drm_modes.h
drm_modeset_helper_vtables.h
drm_modeset_helper.h
drm_modeset_lock.h
drm_of.h
drm_os_linux.h
drm_panel.h
drm_pci.h
drm_pciids.h
drm_plane_helper.h
drm_plane.h
drm_prime.h
drm_print.h
drm_probe_helper.h
drm_property.h
drm_rect.h
drm_scdc_helper.h
drm_self_refresh_helper.h
drm_simple_kms_helper.h
drm_syncobj.h
drm_sysfs.h
drm_util.h
drm_utils.h
drm_vblank.h
drm_vma_manager.h
drm_vram_mm_helper.h
drm_writeback.h
drmP.h
gma_drm.h
gpu_scheduler.h
i915_component.h
i915_drm.h
i915_mei_hdcp_interface.h
i915_pciids.h
intel_lpe_audio.h
intel-gtt.h
spsc_queue.h