Re: [PATCH] eHCA: Add "Modify Port" verb

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

 



 > +	if (hipz_h_query_port(shca->ipz_hca_handle, port, rblock) != H_SUCCESS) {
 > +		ehca_err(&shca->ib_device, "Can't query port properties");
 > +		ret = -EINVAL;
 > +		goto modify_port1;
 > +	}
 > +
 > +	cap = (rblock->capability_mask | props->set_port_cap_mask)
 > +		& ~props->clr_port_cap_mask;
 > +
 > +	hret = hipz_h_modify_port(shca->ipz_hca_handle, port,
 > +				  cap, props->init_type, port_modify_mask);

Is this thread-safe?  What if two different bits are set at the same
time from two different threads?  It seems that both calls could get
the same result from hipz_h_query_port(), and then the second call to
hipz_h_modify_port() would overwrite the first call.

You could look at the implementation in mthca to see the locking I
used there.

 - R.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux