Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp228830pxa; Fri, 14 Aug 2020 02:29:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeL8yYjTu7WTsMDQRoxCnXAcrORUkzTcvQmX0QQ4/F7cFkR2OXeaSqKKWBnvtg/FD9hSAr X-Received: by 2002:a05:6402:206d:: with SMTP id bd13mr1371122edb.57.1597397346179; Fri, 14 Aug 2020 02:29:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597397346; cv=none; d=google.com; s=arc-20160816; b=SQ3ZEYVehitMoHx34TVfiRjXmyr3KdqLQtA9o1vB2WCaahDpoSoe2JNfvtcrJ5N4pe 8uvNxb5jU9Lgc7A1Lc252+4MrUgJ1k/qTgjj1C5+oBkQ7PQ13eo+QXGXRcArxmGlv8dz uje9pngwq0waOXLI9FYh1gajHx9w307JzAQ5UOEUe7t334UfSzEgJmn8zoDBPdi10SqE njlG1+iOCYM+UhrxwC6C2n46KfZvHFiKfys/idX9O5+EHmtNdcnyT3+frU4kWctLxM6N v6BtWsFgzxZvP84l0WMHJ6W9KZkp8vkDyBw2z8wxZIjCSLlDjw8oHQJbyrWag9acjIBF T+CA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=qIG0ju+6yMHkZ/F2a4npjW/tyBW4yjGF2U0BzUiG92o=; b=qZhELgNVrwXoI0BwBek9V7ZC1KdF6rG4pmhoc4vmesFrzM8cgjP9SqpxqIfmqLKtPl l4+SeWHvYbpleyphRNZ/BwBfWYOL1TqJoxvVjpHGjbc2mIeK0GfyXaYnLxbJTAKUHpX0 c0HpSLOIaK3ri3/ME5dgMZBpPku3hHqiobWZbQ3WRbbHC/6QsRfplmovE1WdEHRx4Flp YsmzP9P6g00fDR+QEaILfxLBzoMgNr73XaW7+lwiKIAmfL1OurDUgyQ1tpBh71pZ1JVX H3yOKni4y08MZyFMuchzNrM5g9Ohh0BoZfvBPUHbTKxvs9HLPmQadyRk9/drKEsGGEat I3Gg== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z9si5056808edr.282.2020.08.14.02.28.41; Fri, 14 Aug 2020 02:29:06 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=nxp.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727075AbgHNIPd (ORCPT + 99 others); Fri, 14 Aug 2020 04:15:33 -0400 Received: from inva020.nxp.com ([92.121.34.13]:46076 "EHLO inva020.nxp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726050AbgHNIPc (ORCPT ); Fri, 14 Aug 2020 04:15:32 -0400 Received: from inva020.nxp.com (localhost [127.0.0.1]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 0631B1A0372; Fri, 14 Aug 2020 10:15:31 +0200 (CEST) Received: from invc005.ap-rdc01.nxp.com (invc005.ap-rdc01.nxp.com [165.114.16.14]) by inva020.eu-rdc02.nxp.com (Postfix) with ESMTP id 384A61A0366; Fri, 14 Aug 2020 10:15:27 +0200 (CEST) Received: from localhost.localdomain (mega.ap.freescale.net [10.192.208.232]) by invc005.ap-rdc01.nxp.com (Postfix) with ESMTP id 36E9B402A8; Fri, 14 Aug 2020 10:15:22 +0200 (CEST) From: Zhiqiang Hou To: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org, lorenzo.pieralisi@arm.com, robh@kernel.org, bhelgaas@google.com, amurray@thegoodpenguin.co.uk, jingoohan1@gmail.com, gustavo.pimentel@synopsys.com Cc: Hou Zhiqiang Subject: [PATCH] PCI: designware-ep: Fix the Header Type check Date: Fri, 14 Aug 2020 16:08:13 +0800 Message-Id: <20200814080813.8070-1-Zhiqiang.Hou@nxp.com> X-Mailer: git-send-email 2.17.1 X-Virus-Scanned: ClamAV using ClamSMTP Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hou Zhiqiang The current check will result in the multiple function device fails to initialize. So fix the check by masking out the multiple function bit. Fixes: 0b24134f7888 ("PCI: dwc: Add validation that PCIe core is set to correct mode") Signed-off-by: Hou Zhiqiang --- drivers/pci/controller/dwc/pcie-designware-ep.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/controller/dwc/pcie-designware-ep.c b/drivers/pci/controller/dwc/pcie-designware-ep.c index 4680a51c49c0..4b7abfb1e669 100644 --- a/drivers/pci/controller/dwc/pcie-designware-ep.c +++ b/drivers/pci/controller/dwc/pcie-designware-ep.c @@ -654,7 +654,7 @@ int dw_pcie_ep_init_complete(struct dw_pcie_ep *ep) int i; hdr_type = dw_pcie_readb_dbi(pci, PCI_HEADER_TYPE); - if (hdr_type != PCI_HEADER_TYPE_NORMAL) { + if (hdr_type & 0x7f != PCI_HEADER_TYPE_NORMAL) { dev_err(pci->dev, "PCIe controller is not set to EP mode (hdr_type:0x%x)!\n", hdr_type); -- 2.17.1