Re: [PATCH v5] cxlflash: Base support for IBM CXL Flash Adapter

2015-06-09 Thread Brian King
On 06/08/2015 06:24 PM, Manoj Kumar wrote: On 6/8/2015 5:56 PM, Brian King wrote: +retry: +newval = atomic64_dec_if_positive(afu-room); +if (!newval) { +do { +room = readq_be(afu-host_map-cmd_room); +atomic64_set(afu-room, room); +if

Re: [PATCH v5] cxlflash: Base support for IBM CXL Flash Adapter

2015-06-09 Thread Manoj Kumar
On 6/9/2015 6:29 AM, Brian King wrote: Pulled out going to sleep in the queuecommand path. udelay doesn't sleep, its a busy wait, so you can still use it in queuecommand, just don't spend too much time, and its probably better to udelay then to just re-read in a tight loop. Thanks for the

Re: [PATCH v5] cxlflash: Base support for IBM CXL Flash Adapter

2015-06-09 Thread Matthew R. Ochs
Brian/Manoj, See my alternate proposal below. -matt On Jun 9, 2015, at 9:37 AM, Manoj Kumar wrote: On 6/9/2015 6:29 AM, Brian King wrote: This was the optimization to avoid the MMIO for both threads. The other thread that raced should do the atomic set of afu-room to a positive value.

Re: [PATCH v5] cxlflash: Base support for IBM CXL Flash Adapter

2015-06-09 Thread Matthew R. Ochs
On Jun 9, 2015, at 1:30 PM, Brian King wrote: On 06/09/2015 11:01 AM, Matthew R. Ochs wrote: On Jun 9, 2015, at 9:37 AM, Manoj Kumar wrote: On 6/9/2015 6:29 AM, Brian King wrote: This was the optimization to avoid the MMIO for both threads. The other thread that raced should do the

Re: [PATCH v5] cxlflash: Base support for IBM CXL Flash Adapter

2015-06-09 Thread Brian King
On 06/09/2015 11:01 AM, Matthew R. Ochs wrote: Brian/Manoj, See my alternate proposal below. -matt On Jun 9, 2015, at 9:37 AM, Manoj Kumar wrote: On 6/9/2015 6:29 AM, Brian King wrote: This was the optimization to avoid the MMIO for both threads. The other thread that raced should

Re: [PATCH v5] cxlflash: Base support for IBM CXL Flash Adapter

2015-06-08 Thread Brian King
On 06/08/2015 05:30 PM, Matthew R. Ochs wrote: + +/** + * cxlflash_send_cmd() - sends an AFU command + * @afu: AFU associated with the host. + * @cmd: AFU command to send. + * + * Return: + * 0 on success + * -1 on failure + */ +int cxlflash_send_cmd(struct afu *afu, struct

Re: [PATCH v5] cxlflash: Base support for IBM CXL Flash Adapter

2015-06-08 Thread Manoj Kumar
Brian: Thanks for the quick review. Comments below. - Manoj On 6/8/2015 5:56 PM, Brian King wrote: +retry: + newval = atomic64_dec_if_positive(afu-room); + if (!newval) { + do { + room = readq_be(afu-host_map-cmd_room); +