Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Signed-off-by: Sudhir Yadav <[email protected]>
  • Loading branch information
TheSanty committed Aug 31, 2021
2 parents 69391ce + e11bc2c commit 02d664a
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 18 deletions.
33 changes: 29 additions & 4 deletions drivers/gpu/drm/msm/msm_drv.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
#define MSM_VERSION_MINOR 2
#define MSM_VERSION_PATCHLEVEL 0

static DEFINE_MUTEX(msm_release_lock);

static void msm_fb_output_poll_changed(struct drm_device *dev)
{
struct msm_drm_private *priv = NULL;
Expand Down Expand Up @@ -1420,13 +1422,25 @@ void msm_mode_object_event_notify(struct drm_mode_object *obj,
static int msm_release(struct inode *inode, struct file *filp)
{
struct drm_file *file_priv = filp->private_data;
struct drm_minor *minor = file_priv->minor;
struct drm_device *dev = minor->dev;
struct msm_drm_private *priv = dev->dev_private;
struct drm_minor *minor;
struct drm_device *dev;
struct msm_drm_private *priv;
struct msm_drm_event *node, *temp, *tmp_node;
u32 count;
unsigned long flags;
LIST_HEAD(tmp_head);
int ret = 0;

mutex_lock(&msm_release_lock);

if (!file_priv) {
ret = -EINVAL;
goto end;
}

minor = file_priv->minor;
dev = minor->dev;
priv = dev->dev_private;

spin_lock_irqsave(&dev->event_lock, flags);
list_for_each_entry_safe(node, temp, &priv->client_event_list,
Expand Down Expand Up @@ -1454,7 +1468,18 @@ static int msm_release(struct inode *inode, struct file *filp)
kfree(node);
}

return drm_release(inode, filp);
msm_preclose(dev, file_priv);

/**
* Handle preclose operation here for removing fb's whose
* refcount > 1. This operation is not triggered from upstream
* drm as msm_driver does not support DRIVER_LEGACY feature.
*/
ret = drm_release(inode, filp);
filp->private_data = NULL;
end:
mutex_unlock(&msm_release_lock);
return ret;
}

/**
Expand Down
14 changes: 1 addition & 13 deletions drivers/of/fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -1184,20 +1184,8 @@ void __init __weak early_init_dt_add_memory_arch(u64 base, u64 size)
int __init __weak early_init_dt_reserve_memory_arch(phys_addr_t base,
phys_addr_t size, bool nomap)
{
if (nomap) {
/*
* If the memory is already reserved (by another region), we
* should not allow it to be marked nomap.
*/
if (memblock_is_region_reserved(base, size))
return -EBUSY;

#if defined(CONFIG_ARCH_SDM670) || defined(CONFIG_ARCH_SDM845)
if (nomap)
return memblock_remove(base, size);
#else
return memblock_mark_nomap(base, size);
#endif
}
return memblock_reserve(base, size);
}

Expand Down
2 changes: 1 addition & 1 deletion drivers/usb/core/hub.c
Original file line number Diff line number Diff line change
Expand Up @@ -3515,7 +3515,7 @@ int usb_port_resume(struct usb_device *udev, pm_message_t msg)
}

/* TRSMRCY = 10 msec */
msleep(10);
usleep_range(10000, 10500);
}

if (udev->persist_enabled)
Expand Down

0 comments on commit 02d664a

Please sign in to comment.