[PATCH 2/7] RapidIO: Add switch locking during discovery

Micha Nelissen micha at neli.hopto.org
Thu Feb 25 06:15:13 EST 2010


Alexandre Bounine wrote:
> +				/* Attempt to acquire device lock */
> +				rio_mport_write_config_32(port, destid,
> +							  hopcount,
> +							  RIO_HOST_DID_LOCK_CSR,
> +							  port->host_deviceid);
> +				rio_mport_read_config_32(port, destid, hopcount,
> +					RIO_HOST_DID_LOCK_CSR, &result);
> +				while (result != port->host_deviceid) {

It's better to abstract the locking of a device into a new function,
rio_lock_device / rio_unlock_device.

Then you can use those in rio_get_route_entry and rio_add_route_entry.

> @@ -1027,6 +1090,13 @@ int __devinit rio_disc_mport(struct rio_
> +
> +		/* Read DestID assigned by enumerator */
> +		rio_local_read_config_32(mport, RIO_DID_CSR,
> +					 &mport->host_deviceid);
> +		mport->host_deviceid = RIO_GET_DID(mport->sys_size,
> +						   mport->host_deviceid);
> +

This fixes something else, should be a separate patch.

Regards, Micha



More information about the Linuxppc-dev mailing list