From patchwork Sat Feb 17 13:37:22 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Wahren X-Patchwork-Id: 13561373 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE236C48BC4 for ; Sat, 17 Feb 2024 13:38:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:Cc :To:From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=gQz/wQhvejnWq2JUYvkIxxNIZZ0X9xk49xjPnmgri9I=; b=TFM6p8tzUXe87o w4Djq8o/LCSOKOl5Kz/Wh1Lys9CRMjZ4WzaVrmy9Rqx90x1nmnojkLC6RHYZdx3v6yWQy0I3zE8BL wu7EtMy6O3xXpiEuMs9ivKG/lVx8SqZBxbOeH5ioqNxqMziVtvi/jF3rKCs0zZkKg/9b05YWoqFtV 7WG9FELDBobD95zk2FSQl4ivAAS4HcQhzN3CHIA2BxrpXm/KkyyRFBhVwpbg+MPhAfITFf48H5YyH fJsnmnqJevOt8IbLj+Hig6wxYZoYT0hgjpZYH7l1ERl6MhQgjSvC/YjT2rNZxCVY0J+Q/S4WD+F7w TUv2JEfKgH23Isvslttg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbKtV-00000005kqL-36In; Sat, 17 Feb 2024 13:38:17 +0000 Received: from mout.gmx.net ([212.227.15.18]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1rbKtT-00000005kpv-111S for linux-arm-kernel@lists.infradead.org; Sat, 17 Feb 2024 13:38:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1708177080; x=1708781880; i=wahrenst@gmx.net; bh=w0ROUewTInuPq2j3gG9LCyrZgq9TO2ZUFdX4bS+6Okw=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date; b=EX95BqER6kYpS4iS4P9ZvtTUxzyp8oWAwmQLr1UE2fGFe49xGtJQUIxH3CZGzWUK GqjuJsamwrVFtdFIwNdolU6XQbCche6VuFSmMCGo+4QA9EaLSh1TCWyn34chXHUvI JiHXiNSK7ew+U19dx8VAbE1pMk55IaOsB77+O7Q/VA1B3moy6z6XuRBnMbcOKCPP7 Pc2g7PxzlVz/9zZ0D+1A55R3scVNabM8wfv3GC+U/U/1zskESsXtui+zDg7yz18SS V+OTLOUlfG8mK5YHUEo9w4nJYH7Wdxt4WNa2mq+r7LE/lXaCNm6Oe4qkuP7QQgOKc zUIKDfZQsBhLglcQUA== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from stefanw-SCHENKER ([37.4.248.43]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MuUnA-1ql1BV3Lpi-00rZvT; Sat, 17 Feb 2024 14:37:59 +0100 From: Stefan Wahren To: Jim Quinlan , Nicolas Saenz Julienne , Florian Fainelli , Lorenzo Pieralisi , =?utf-8?q?Krzysztof_Wilczy=C5=84?= =?utf-8?q?ski?= , Rob Herring , Bjorn Helgaas , Cyril Brulebois Cc: bcm-kernel-feedback-list@broadcom.com, linux-pci@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Jonathan Bell , Stefan Wahren Subject: [PATCH] PCI: brcmstb: fix broken brcm_pcie_mdio_write() polling Date: Sat, 17 Feb 2024 14:37:22 +0100 Message-Id: <20240217133722.14391-1-wahrenst@gmx.net> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Provags-ID: V03:K1:EHf/q8SnQPVn+fd4Vo8CKB7ejhFUeksvGPbL6tmaNjskgaLD70v xoVF1iHwLO4+es3jQ6GZZGmPrSlHsPbeFg/6Xyo/j0jVCweERcJDOF4YkfbfjBandh5DBY8 R+urFL+w8pIZNjMrjXAp98eRfHYQBlcn1swXhqiSRz3qLAqMURrYhcJbkCuA0qouucWrVW0 F0K0cPbBAW3BI77Jl+FXw== UI-OutboundReport: notjunk:1;M01:P0:coubLfRrff8=;PSWUJ83oT5Ld+OKGgZWHcUZ3mFw VuEKJGw2KnExuGoWenHmNpOk1UZFactZERT+ythp25wtNeET6AMB34aK8Lq4wFPzfVKoEWVsx fNoDbQsG8DZTRYXWiGBXMB69YP5HjJCx7naT5LOzxiLnY0WU5fgWZUrhKr7NL200EkLJulmb9 /ReFI8LfbBtQw5vzcgELKXAn69AyJqKsTbqCmvtVZ1hOoug3MbgQFagsdcg59kFsHZubGR0h4 4WpuQoS+ywCdLUPQXi3M0ihcWM1Rim38msBV8qBjVtwb52O2cYnX4xQXz1qqZEdS68B1ROHQK EXMjjl9KWD91Kvla6aCsbDLbLMkJrtHnDLt/lvGnEDFNIHbj+xwEDciN0nmcNBfq202iJjmkQ DnBA0OIzSSuTK9wLssG9zXtPQOeJbdjnLwbIV7JO1g13mB5KXB2F7n/TLdUowc0UJC7HtNccE gVZcZ/uiRUOTohioKnz0fRTebShw4R/sJ8Nmu3cMPk6BHz3eyfT+40jiUgwSEiv7gn00qZkpD TADBLQPa2wSq3WiOmcU/aDPR3dPx0ZddwnRY3sVMEYuGsH800obUArgN58CAwl3AuHBBhxVbv k74jelzxteEknu+JLucguuzVoeuhm2ERm6Z1l6mvQ45Xhyxt4wcK7Q83enlCP+xJElxtPEvUv zjNUCAooijWHhj3cNbmjd4gkhEAjbunbiNflRvVSZWlo9GkOwcJ1I6fmdghnPTd2ust/ncp9W Yv1tp/yAdD8087cIPY+fi41uPkHfJ+d0KhH2xWPIvpKMZk6XHXM4wm4/DtYvU+pH3ItQ+0aT6 y5jfDB8+jtaCDkrZhDrgVIvyFgZ1t3wF2PL0AZNHesBK4= X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240217_053815_672885_8CA9BDD4 X-CRM114-Status: UNSURE ( 9.53 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Jonathan Bell MDIO_WR_DONE() tests bit 31, which is always 0 (==done) as readw_poll_timeout_atomic does a 16-bit read. Replace with the readl variant. Fixes: ca5dcc76314d ("PCI: brcmstb: Replace status loops with read_poll_timeout_atomic()") Signed-off-by: Jonathan Bell Signed-off-by: Stefan Wahren Acked-by: Florian Fainelli --- drivers/pci/controller/pcie-brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/pcie-brcmstb.c b/drivers/pci/controller/pcie-brcmstb.c index 618e84402eb50..a7f05e0c4ac51 100644 --- a/drivers/pci/controller/pcie-brcmstb.c +++ b/drivers/pci/controller/pcie-brcmstb.c @@ -420,7 +420,7 @@ static int brcm_pcie_mdio_write(void __iomem *base, u8 port, readl(base + PCIE_RC_DL_MDIO_ADDR); writel(MDIO_DATA_DONE_MASK | wrdata, base + PCIE_RC_DL_MDIO_WR_DATA); - err = readw_poll_timeout_atomic(base + PCIE_RC_DL_MDIO_WR_DATA, data, + err = readl_poll_timeout_atomic(base + PCIE_RC_DL_MDIO_WR_DATA, data, MDIO_WT_DONE(data), 10, 100); return err; }