From patchwork Mon Sep 27 17:01:07 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kroah-Hartman X-Patchwork-Id: 514727 Delivered-To: patch@linaro.org Received: by 2002:a17:906:f46:0:0:0:0 with SMTP id h6csp4149535ejj; Mon, 27 Sep 2021 10:20:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOax3SBpaf2+zw29uEcXLFumG2SV8x0JhnpANHtaYn4Rp3EOvp8PjokJWk2zvaCLWYEajW X-Received: by 2002:a05:6402:1598:: with SMTP id c24mr1260116edv.253.1632763217004; Mon, 27 Sep 2021 10:20:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632763216; cv=none; d=google.com; s=arc-20160816; b=EyBUpKkfIgcxkaizbZLMGhxVSJRfO8/fj2hWCSx/QxkAPinxyDiYzmn2cq0J562X0E QXHsKXpu3wLYcUPzugokOxYgszaigzP0KfD62fGTkMxCigZ6xUqHGHfKEKvSVzp/KBPh agq+5Qms9Mny74I0QtQfHzXYgUGmn7nptRqLkOeHpo+RTOBk2uAZR7dj1T4CDrYi41r7 iSCgCLRj2HiqNfCgSZjRiOxu8lqynHrA73JF6sk7OdKgzcpjcPt42ei6Yqr7Xa23nypv B3wNv1wb0WAs4ogNRxDmq9cl5pSonpwX2Q2ZG2i7vOTs5/YmMFRnaLlMo8ZSi6ImDivf mRTg== 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=lL/siudxVnSbnpPO5XQFJIK+8vFVVIP0oygBL+VX2NCPestKZ9sOA5mxeyW8Z40GHy GcZfvD/Lr3ywWPLxaYb5UW6uf9lD/wahVmTtfiuQ/ROl73xNpd450/jeOSpuw8Wg43Kg Xp+bI8fqPFRmovDM9lwxwIVvZXvwdlZgpQbgfqi4JvZeoyWm+Llx+ydKNEGes4te6ERE 4zBsw9HCLVzsB9sajWDjduwGhf97WS8QnG8bemnNU2UFsewiIhvMRcaBhEgC5MWFTeKN LGRat549zplHim870cqd9WFEqF3J4+8PJnLMuXwwrSOxjyyUvpvqPgkgkJFAV2/EJL8+ zRug== 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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 8si17671612eje.191.2021.09.27.10.20.16; Mon, 27 Sep 2021 10:20:16 -0700 (PDT) Received-SPF: pass (google.com: domain of stable-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 stable-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=stable-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 S237036AbhI0RVt (ORCPT + 11 others); Mon, 27 Sep 2021 13:21:49 -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 Precedence: bulk List-ID: X-Mailing-List: stable@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)