Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp89782imj; Thu, 7 Feb 2019 00:46:36 -0800 (PST) X-Google-Smtp-Source: AHgI3IaNGYJuiMrhN+2x5tSpWC38WkXWAuhS8bU1Y8GLMLkCNPhRYT1L3GNJocvcRx3OSbbDJ8zn X-Received: by 2002:a17:902:27e6:: with SMTP id i35mr15139649plg.222.1549529196346; Thu, 07 Feb 2019 00:46:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1549529196; cv=none; d=google.com; s=arc-20160816; b=cTiYjH6cQwzQZJS0oZeB5PX51oJlZKeUg//o+5uCMr5m3XQMNSmsCIxscnq08uSbTo Y8303NMAM8B0GzyymBfjhSsi2h/hUOB41kfC64E4fupLENqxxNq+qc+Ie9snmHnMxowd 7zeiLDF4cpKVJEdBjX+zF4NAVxmfxiw/ZV9Aq1UZ/6xtKb2g7yElllXH0ZXF7a5N0lDO o8+i57VA3TzwFwQzzswXy+9ik90cskN598rS10RItr3lEJv/oG3gzmZFRLpW7xcgf0w5 CgO7iMtIicC7I6WVDt6s/cO1oH6Ns8lNe4RyBree6JmNuDWfbW49oQdgXTGwD3nb4w/e 0OIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=3/ozj/MyjiZnW7ZRzbqiwZKAkj8JErDR02fje24iAPQ=; b=H+OKEUmBP0qgFdQWiSCvozUlyc/lgrYWMrsXpIgUx0g5h2Uyh8bHRzsTCbknGO4CJg wd2LKbzj0pKjQTD4ZSeANwfa2+YGHwQJAPb6uyYPDm6XjTQ5cKAqe7NnEluP0OIiFdji IcZQijXT8TIQj7Anq/ZbZKTHSIFZlFAZ/wnt4Xp1E/+NR7DlAvMHmcwxicCWmx0pbKkC mAMjb22bi3AaRXlmhZhYA9V8oYzC+iXlnMR0Ez3JujRqrDPoIDzV8SqyOgI5BtHepC3S AnWMf/q02CfNCzXOCcbF6HDVW7BLMPUgn5cvl2YUKyXXeLA3gT4ZzSALxzI38oo2GISo gnfw== 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 19si8371718pgq.215.2019.02.07.00.46.20; Thu, 07 Feb 2019 00:46:36 -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 S1727076AbfBGIps (ORCPT + 99 others); Thu, 7 Feb 2019 03:45:48 -0500 Received: from mga17.intel.com ([192.55.52.151]:7501 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726294AbfBGIpr (ORCPT ); Thu, 7 Feb 2019 03:45:47 -0500 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Feb 2019 00:45:47 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.58,342,1544515200"; d="asc'?scan'208";a="317029373" Received: from pipin.fi.intel.com (HELO localhost) ([10.237.72.175]) by fmsmga006.fm.intel.com with ESMTP; 07 Feb 2019 00:45:46 -0800 From: Felipe Balbi To: Mathias Nyman , Andrey Smirnov , linux-usb@vger.kernel.org Cc: Mathias Nyman , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH] xhci: Convert xhci_handshake() to use readl_poll_timeout() In-Reply-To: <63866354-48b8-5787-39de-5c23e7471f6f@linux.intel.com> References: <20190207000308.7051-1-andrew.smirnov@gmail.com> <63866354-48b8-5787-39de-5c23e7471f6f@linux.intel.com> Date: Thu, 07 Feb 2019 10:45:34 +0200 Message-ID: <87sgx0kmvl.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha256; protocol="application/pgp-signature" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable Hi, Mathias Nyman writes: > On 07.02.2019 02:03, Andrey Smirnov wrote: >> Xhci_handshake() implements the algorithm already captured by >> readl_poll_timeout(). Convert the former to use the latter to avoid >> repetition. > > readl_poll_timeout() doesn't really work here as it might sleep. > > iopoll.h: > > /** > * readx_poll_timeout - Periodically poll an address until a condition i= s met or a timeout occurs > * > ...=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20= =20=20=20=20=20=20=20=20=20=20=20=20 > * Returns 0 on success and -ETIMEDOUT upon a timeout. In either > * case, the last read value at @addr is stored in @val. Must not > * be called from atomic context if sleep_us or timeout_us are used. readl_poll_timeout_atomic()? =2D-=20 balbi --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEElLzh7wn96CXwjh2IzL64meEamQYFAlxb8DAACgkQzL64meEa mQZ7Fw/8CGyZy9l31N4Ge7FJOLRFuGJhz+ZM17ypQ2CY8Sg/lP57/z3AykM7v24r 5TNBqjb3N7j0c3z3zDpCMGbZ8yKWkh3+/yWChu0sxyk7ROvd62mW786MmEmvu8+H K01Y/BlMZFkjMCnPkvsXSlkB7R4mn2ZM9x8l1iyFy/x9cpHSSZGeJk7GSAP1/h4w qAPHzXuWWBoxzOvF+1VabgSHU7MFrFexKHddiOXTdm7Q7xdOMurSk+v0vQRR/Nrq 45/epu0y4p1Cprea5NoTQS21ZvueIXVasQgBx4PddQdL9uFhftsvvqLRD90i2mM0 3HZssBG0WO31nE5aQ01VTCqxszRJjgbQQJJuK4nd55/buyOwiYkmClfNIhvSdwLR J1XT2fgRolT1fXqs0fe13iUGVGKMYX0EYZXXt88TzpXVCCq+YA5nBQALhS/Kuq0n vTmccZybF8RrpLRFQoRJ99d2y1GnTyuzyCNNxg2bDFslqETkBkxYbUV9ISPGkDNE PDP2OJwHRs/sS/ZcQ79sM/19qVB1fIJfOC3vofnYY6ESDbfC3b0q+k00XO5yjiBJ +qTFAxu+NE+ilvfixQDQnqUZM44wwShaew/ZqyaTR4BdR9X+It7tPPDs6AwIUQ/G yYkYqXIxMsydphXu8z6i08kBMfjyvmHStF0kxWhP+NP5HdJ5w84= =+8rt -----END PGP SIGNATURE----- --=-=-=--