Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751374AbdGQJ1u (ORCPT ); Mon, 17 Jul 2017 05:27:50 -0400 Received: from smtprelay.synopsys.com ([198.182.60.111]:56091 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751178AbdGQJ1s (ORCPT ); Mon, 17 Jul 2017 05:27:48 -0400 Subject: Re: [PATCH] PCI: dwc: designware: test PCIE_ATU_ENABLE bit to check enabled or not To: Jisheng Zhang , , , CC: , , References: <20170713103527.1642-1-jszhang@marvell.com> From: Joao Pinto Message-ID: <1df044ef-1daf-0b60-da30-a6a45215f275@synopsys.com> Date: Mon, 17 Jul 2017 10:27:44 +0100 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.1.1 MIME-Version: 1.0 In-Reply-To: <20170713103527.1642-1-jszhang@marvell.com> Content-Type: text/plain; charset="utf-8" Content-Language: pt-PT Content-Transfer-Encoding: 8bit X-Originating-IP: [10.107.19.59] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1048 Lines: 29 Hi, Às 11:35 AM de 7/13/2017, Jisheng Zhang escreveu: > The ATU CTRL2 register is 32 bit, besides the enable bit, other bits > may also be set. To check whether the ATU is enabled or not, we should > test the enable it. > > Signed-off-by: Jisheng Zhang > --- > drivers/pci/dwc/pcie-designware.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/pci/dwc/pcie-designware.c b/drivers/pci/dwc/pcie-designware.c > index 0e03af279259..6bf0b409050a 100644 > --- a/drivers/pci/dwc/pcie-designware.c > +++ b/drivers/pci/dwc/pcie-designware.c > @@ -177,7 +177,7 @@ void dw_pcie_prog_outbound_atu(struct dw_pcie *pci, int index, int type, > */ > for (retries = 0; retries < LINK_WAIT_MAX_IATU_RETRIES; retries++) { > val = dw_pcie_readl_dbi(pci, PCIE_ATU_CR2); > - if (val == PCIE_ATU_ENABLE) > + if (val & PCIE_ATU_ENABLE) > return; > > usleep_range(LINK_WAIT_IATU_MIN, LINK_WAIT_IATU_MAX); > Make sense, turn it more accurate. Thanks! Acked-by: Joao Pinto