Re: [PATCH v2 10/14] drm/dp-mst: Fill branch->num_ports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 2019-08-20 at 15:11 -0400, David Francis wrote:
> This field on drm_dp_mst_branch was never filled
> 
> Initialize it to zero when the list of ports is created.
> When a port is added to the list, increment num_ports
> 
> Signed-off-by: David Francis <David.Francis@xxxxxxx>
> ---
>  drivers/gpu/drm/drm_dp_mst_topology.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> b/drivers/gpu/drm/drm_dp_mst_topology.c
> index 5d5bd42da17c..0c580d5279c1 100644
> --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> @@ -918,6 +918,7 @@ static struct drm_dp_mst_branch
> *drm_dp_add_mst_branch_device(u8 lct, u8 *rad)
>  	INIT_LIST_HEAD(&mstb->ports);
>  	kref_init(&mstb->topology_kref);
>  	kref_init(&mstb->malloc_kref);
> +	mstb->num_ports = 0;
>  	return mstb;
>  }
>  
> @@ -1672,6 +1673,7 @@ static void drm_dp_add_port(struct drm_dp_mst_branch
> *mstb,
>  		mutex_lock(&mstb->mgr->lock);
>  		drm_dp_mst_topology_get_port(port);
>  		list_add(&port->next, &mstb->ports);
> +		mstb->num_ports++;

You're forgot to add mstb->num_ports--; lower down in the function:

		if (!port->connector) {
			/* remove it from the port list */
			mutex_lock(&mstb->mgr->lock);
			list_del(&port->next);
/* Right here --------> */
			mutex_unlock(&mstb->mgr->lock);
			/* drop port list reference */
			drm_dp_mst_topology_put_port(port);
			goto out;
		}

With that fixed:

Reviewed-by: Lyude Paul <lyude@xxxxxxxxxx>

>  		mutex_unlock(&mstb->mgr->lock);
>  	}
>  
-- 
Cheers,
	Lyude Paul

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux