lkml.org 
[lkml]   [2019]   [Jan]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH rdma-rc 1/3] RDMA/hns: Fix the Oops during rmmod or insmod ko when reset occurs
On Thu, Jan 10, 2019 at 09:57:41PM +0800, Wei Hu (Xavier) wrote:
> + /* Check the status of the current software reset process, if in
> + * software reset process, wait until software reset process finished,
> + * in order to ensure that reset process and this function will not call
> + * __hns_roce_hw_v2_uninit_instance at the same time.
> + * If a timeout occurs, it indicates that the network subsystem has
> + * encountered a serious error and cannot be recovered from the reset
> + * processing.
> + */
> + if (ops->ae_dev_resetting(handle)) {
> + dev_warn(dev, "Device is busy in resetting state. waiting.\n");
> + end = msecs_to_jiffies(HNS_ROCE_V2_RST_PRC_MAX_TIME) + jiffies;
> + while (ops->ae_dev_resetting(handle) &&
> + time_before(jiffies, end))
> + msleep(20);

Really? Does this have to be so ugly? Why isn't there just a simple
lock someplace that is held during reset?

I'm skeptical that all this strange looking stuff is properly locked
and concurrency safe.

Also, this series seems a bit big for -rc

Jason

\
 
 \ /
  Last update: 2019-01-11 22:35    [W:0.190 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site