Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp658536imu; Thu, 13 Dec 2018 02:08:41 -0800 (PST) X-Google-Smtp-Source: AFSGD/UJz805N2B4euaX08JzC+8FjaDeYe5kuGEyZbH5ZcjmQ8u1BW39xSj2zASN0RVv4tOO5ec+ X-Received: by 2002:a17:902:2904:: with SMTP id g4mr22947373plb.39.1544695721186; Thu, 13 Dec 2018 02:08:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544695721; cv=none; d=google.com; s=arc-20160816; b=MGnOPVe21NSptq/O+JdhMvDljZ0NOv/wid5Na1t3/HcVfL8qsfiUfY2nqgtNchmO4b h01jAanDJlx1rjo6tMMhdbpSIVFTqBBhOQdkprGtyqSxqEKHuNYmwyJznaa1zuRCB1vf +Vfb6ebvPDg8aF9eylGLRV3ACMiDO0AbytAgpdWp8ikry0X9Gz4QB1+v/f3L9zxjjMPD zo3JruRDOn/dcSQ0oieLuJru2EuoVCVoM+oaQ0dPfvrlCZG8ac77dPvKufFrLAmKODYP QWBCwJNoHN7paIkbicjdCNwMIKpU46ew/tbJV902kNAotyhSwlctwlkYidDP50LCib6g fXSQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=QXEvog/c3DQEUNwzh4qmH+YyC8pS8XmMsr78ZNwPcSE=; b=rJDAVItxmpFCjEp47nWfcRAeBRMfix/k/GhEkSZoyHn/kJvnlvsQbt1eQ4xiGERa+a APxpIqoGzrZH29dUzLtC5FnY6vkfC5+agCiyy8XrkjyOuZXzvnno31o2Cdmg+4sFKhZC qfqRm5CXStcyzCPMZKYFwsKKQ+8hckllMU2D02gTcqwi0QwDG8DIT5g4eoJIfZjeiRC9 GgCk25fFf2UK2+045ddCv/9+eF2wGbcOTu/AF7f/vnX4P6Vns82I/5m7SxmI+F4yP0ds /O+44o2Cbx/COEv/IW2OzOXboUD4mFvZMeAL16o5DngCtPN8mfcS+HlBjslvnepXRlh4 z3xw== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e22si1162991pge.479.2018.12.13.02.08.26; Thu, 13 Dec 2018 02:08:41 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728064AbeLMKHX (ORCPT + 99 others); Thu, 13 Dec 2018 05:07:23 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:45655 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727489AbeLMKHW (ORCPT ); Thu, 13 Dec 2018 05:07:22 -0500 Received: from kresse.hi.pengutronix.de ([2001:67c:670:100:1d::2a]) by metis.ext.pengutronix.de with esmtp (Exim 4.89) (envelope-from ) id 1gXNtl-00047C-Pu; Thu, 13 Dec 2018 11:07:17 +0100 Message-ID: <1544695636.3137.27.camel@pengutronix.de> Subject: Re: [v2] PCI: imx: make msi work without pcieportbus From: Lucas Stach To: Richard Zhu , "bhelgaas@google.com" , "lorenzo.pieralisi@arm.com" , "andrew.smirnov@gmail.com" Cc: "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Date: Thu, 13 Dec 2018 11:07:16 +0100 In-Reply-To: References: <1544687042-16595-1-git-send-email-hongxing.zhu@nxp.com> <1544692768.3137.25.camel@pengutronix.de> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1+deb9u1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2001:67c:670:100:1d::2a X-SA-Exim-Mail-From: l.stach@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am Donnerstag, den 13.12.2018, 09:57 +0000 schrieb Richard Zhu: > Hi Lucas: > > > -----Original Message----- > > > > From: Lucas Stach [mailto:l.stach@pengutronix.de] > > Sent: 2018年12月13日 17:19 > > > > > > To: Richard Zhu ; bhelgaas@google.com; > > lorenzo.pieralisi@arm.com; andrew.smirnov@gmail.com > > > > > > Cc: linux-pci@vger.kernel.org; linux-arm-kernel@lists.infradead.org; > > linux-kernel@vger.kernel.org > > Subject: Re: [v2] PCI: imx: make msi work without pcieportbus > > > > Hi Richard, > > > > Am Donnerstag, den 13.12.2018, 08:02 +0000 schrieb Richard Zhu: > > > MSI_EN of iMX PCIe RC would be asserted when PCIEPORTBUS driver is > > > selected. > > > Thus, the MSI works fine on iMX PCIe before. > > > Assert it unconditionally when MSI is supported. > > > Otherwise, the MSI wouldn't be triggered although the EP is present > > > and the MSIs are assigned. > > > > Thanks for digging into this issue. This seems like the right way forward. > > However, did you test this with devices using legacy IRQs? > > I.e. booting with "nomsi" on the kernel command line to see if legacy IRQs still > > work if this bit is set, or if we need to avoid setting this when the user > > explicitly requests to disable MSIs? > > > > Regards, > > Lucas > > > > [Richard Zhu] Thanks for your review. > The Legacy INTx is broken. > The MSI_EN bit shouldn't be asserted when the user explicitly requests to disable MSIs. Okay, so this patch should be extended with a check for pci_msi_enabled() to see if the user explicitly want legacy IRQs. > BTW, regarding to Baruch's comments, it seems that all the (IS_ENABLED(CONFIG_PCI_MSI) check in >  the dwc host drivers are not required anymore, since the depends on PCI_MSI_IRQ_DOMAIN, right? That's correct. This is mostly a historical artifact from the time when we were able to build without MSI support. Those checks could be cleaned up now that we depend on the MSI options. Regards, Lucas