Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1613135imu; Tue, 6 Nov 2018 01:14:40 -0800 (PST) X-Google-Smtp-Source: AJdET5fSwjYpazGDyCWbx5AE4geqD61CC9RJj+t4D09lxfm+LaZYK3axuxCBwrwyatVMqiygdRix X-Received: by 2002:a63:e302:: with SMTP id f2mr23281599pgh.320.1541495680130; Tue, 06 Nov 2018 01:14:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541495680; cv=none; d=google.com; s=arc-20160816; b=xMLR10M9RLgGdxbcNRkkdJAbFaqBjHf08F60VJ0klfL7pp/2NyxX5M4jBwk8ge87S5 xx36WsiYAmAYf5wOhg/2keapOjXBIivnywMD3h8YD27jclJnVxdwScTlIG4/tYbdMmFN Q/ugMFyDCn3NGQIt5COZzMZkIkFtTQzKVeWZSlPGhAn4Al98Ie1HhXAinJ414oqXVPyp 0SPp87er27Gj2EejHiA3UUOWIOWfYgdZGcHphkPuLscV1kzn1Hql+SrpHOwzJZqbG04q k7BrfCnrsqtAD10m7F6lNXERfpWjv6jFE1rFdWEHCg6lBYA7yu1jL2I2uxlBCs6NXk8O extw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from; bh=7QMYw6qa4cw+6nBz279zdoAAD9VZGrlFG2IdMHwcUVA=; b=dQn2q+7fGowzWW0nIUBj3cWwibknYWmibXx55ks9jHr5M1xodg1U59MVFuIyL+oc8P p9kkFuQBOk5wuqbtu/jHmxzTXYct4cSn49Qjli+qJcwuCtvAezqOunaklvHFy37AkpXS JkLWX44STMEHjLJd028fTm8LvBVUVK4Io22SKjyzuq4eAFm33n4Q0rq9Hv+C09XOhmyD mAjEy0qnLr2/oUvlRTjp2s2EVxQ6yjgPfe2hwspFIj1qOL0bbccgVIJbF7Ft5Qoui4z1 SRL0WWo1VWpZ+nL/ZKoitbC3iQ6hTVRIeRGf6PzxhSQzaeGeu+hvcxszPwH5Oe2sBSr1 okmw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a144-v6si34092398pfd.138.2018.11.06.01.14.24; Tue, 06 Nov 2018 01:14:40 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730364AbeKFShA (ORCPT + 99 others); Tue, 6 Nov 2018 13:37:00 -0500 Received: from mga05.intel.com ([192.55.52.43]:26399 "EHLO mga05.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729160AbeKFShA (ORCPT ); Tue, 6 Nov 2018 13:37:00 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 06 Nov 2018 01:12:45 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,471,1534834800"; d="scan'208";a="83674063" Received: from twinkler-lnx.jer.intel.com ([10.12.91.48]) by fmsmga007.fm.intel.com with ESMTP; 06 Nov 2018 01:12:43 -0800 From: Tomas Winkler To: Greg Kroah-Hartman Cc: Alexander Usyskin , linux-kernel@vger.kernel.org, Tomas Winkler Subject: [char-misc-next 3/3] mei: expedite ioctl return on the notify set operation error Date: Tue, 6 Nov 2018 12:04:40 +0200 Message-Id: <20181106100440.2140-3-tomas.winkler@intel.com> X-Mailer: git-send-email 2.14.5 In-Reply-To: <20181106100440.2140-1-tomas.winkler@intel.com> References: <20181106100440.2140-1-tomas.winkler@intel.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Usyskin The notify set operation ioctl will wait till timeout is expired even in case when the FW returned an error. Check the status field of the client object in wait_event_timeout() to determine if the caller can return earlier. Signed-off-by: Alexander Usyskin Signed-off-by: Tomas Winkler --- drivers/misc/mei/client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/misc/mei/client.c b/drivers/misc/mei/client.c index ee58561ceb08..1fe9426ce48b 100644 --- a/drivers/misc/mei/client.c +++ b/drivers/misc/mei/client.c @@ -1357,7 +1357,9 @@ int mei_cl_notify_request(struct mei_cl *cl, mutex_unlock(&dev->device_lock); wait_event_timeout(cl->wait, - cl->notify_en == request || !mei_cl_is_connected(cl), + cl->notify_en == request || + cl->status || + !mei_cl_is_connected(cl), mei_secs_to_jiffies(MEI_CL_CONNECT_TIMEOUT)); mutex_lock(&dev->device_lock); -- 2.14.5