Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4151254pxb; Mon, 27 Sep 2021 10:25:51 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxBws1aqJabY7p39ZlAEY4wLavcXwQhsHkArSaKbTxyfi0/ZzBZkEqQ4LAe78QVbioh0e6E X-Received: by 2002:a17:906:6d0:: with SMTP id v16mr1364517ejb.258.1632763551483; Mon, 27 Sep 2021 10:25:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632763551; cv=none; d=google.com; s=arc-20160816; b=NKg/ILW1/Hf7RbU4n66o2d+59ZYuaQOSUvvpaH2vhscVrINNr3aFC64dmRbDo9R/Kk Hn9lTnfPX2fCQMCY1w+zsa0yiv682wEpvD/Yduvx8V9D/6gq1eFxkUfXX2s8TLacT/tJ f/g4CuSitBTZhGhL6ZymbXjuxHYRIHD/5IozwFvH0ooTfNYqvrUATsHsJlWnUM2PVu5k nG7vw9ZLljeQJ2G/lNuGP5BuYIw3eCGef/z4X22SGnkYzOa2mNFpOCJvVf6qztWgQHwM XhOTDnFHaxtt84mfynez1Dbh90hW9KAa2u5rkphcWt2gPilMRHH+J1MTQqDpwi+SL8TZ EC9A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YWcpdVZEpbJPI67XUWmuETFlDxggZ2zt6pJWh6VEYY4=; b=jRGIhQ5u/VQEmIkw6uuxd9l8bYTED3OW9i1ZxVnDYbwIKK7GoVCiqDTbXVkqKc0Wzn H9HRBaGLddZzUDmXxgCg+7rT8wUj6aiDMg3QtfZjqYrUmd5wyMi1zDIYkMvBQmVGfVsR 9tQ2HStSNKJL0XtPljYWcTjWdeFuqNyDJQXlNyE40x+BuonrgVMIcLZpm+Oo6VJ+qDJM 1DtH9Cau11Qd82kX2Eg/XubZQWDRBCWkZqGzEbURQBk1U0LsurSO1PJPVoxEOWDXu7KR 78nAI4NCuGe/dC1Q8y/u6Z4R9g6OlIZg60NW/JTlzHiNwLpjI4DmupRgKcJ+40/Ftq2p Fk3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Bnj1Kq3M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l15si4900335ejo.264.2021.09.27.10.25.25; Mon, 27 Sep 2021 10:25:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=Bnj1Kq3M; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237333AbhI0RXH (ORCPT + 99 others); Mon, 27 Sep 2021 13:23:07 -0400 Received: from mail.kernel.org ([198.145.29.99]:34432 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236997AbhI0RTr (ORCPT ); Mon, 27 Sep 2021 13:19:47 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 4711F6120C; Mon, 27 Sep 2021 17:12:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1632762779; bh=9LRoE2px25O4HcnNQgzWjeuyz5NTiCYmeax5E52GbXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Bnj1Kq3M9T5sqEQwl/8t9OiFEpz2qrnTTxBwFSLj2D4gaFNj9KFmrESYJ4/1nK0ps GGFt3cQYZoDK8Y9FL2HZuVFYw9C12qyRFAXNLmF8WeXg1YuVsF8jJJdtVH7V9Im5S9 bVJ42Q9OIBkeX32U3vHpob3I1HwR1xbI4sCdY7zM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Rui Miguel Silva Subject: [PATCH 5.14 021/162] usb: isp1760: do not sleep in field register poll Date: Mon, 27 Sep 2021 19:01:07 +0200 Message-Id: <20210927170234.192519990@linuxfoundation.org> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20210927170233.453060397@linuxfoundation.org> References: <20210927170233.453060397@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Rui Miguel Silva commit 41f673183862a183d4ea0522c045fabfbd1b28c8 upstream. When polling for a setup or clear of a register field we were sleeping in atomic context but using a very tight sleep interval. Since the use cases for this poll mechanism are only in setup and stop paths, and in practice this poll is not used most of the times but needs to be there to comply to hardware setup times, remove the sleep time and make the poll loop tighter. Reported-by: Dan Carpenter Signed-off-by: Rui Miguel Silva Link: https://lore.kernel.org/r/20210727100516.4190681-3-rui.silva@linaro.org Signed-off-by: Greg Kroah-Hartman --- drivers/usb/isp1760/isp1760-hcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -251,7 +251,7 @@ static int isp1760_hcd_set_and_wait(stru isp1760_hcd_set(hcd, field); return regmap_field_read_poll_timeout(priv->fields[field], val, - val, 10, timeout_us); + val, 0, timeout_us); } static int isp1760_hcd_set_and_wait_swap(struct usb_hcd *hcd, u32 field, @@ -263,7 +263,7 @@ static int isp1760_hcd_set_and_wait_swap isp1760_hcd_set(hcd, field); return regmap_field_read_poll_timeout(priv->fields[field], val, - !val, 10, timeout_us); + !val, 0, timeout_us); } static int isp1760_hcd_clear_and_wait(struct usb_hcd *hcd, u32 field, @@ -275,7 +275,7 @@ static int isp1760_hcd_clear_and_wait(st isp1760_hcd_clear(hcd, field); return regmap_field_read_poll_timeout(priv->fields[field], val, - !val, 10, timeout_us); + !val, 0, timeout_us); } static bool isp1760_hcd_is_set(struct usb_hcd *hcd, u32 field)