Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp801912imu; Thu, 13 Dec 2018 04:51:58 -0800 (PST) X-Google-Smtp-Source: AFSGD/X2nc7QGvSYngmVf7QvY+JgR5uRiE9Mx/Cg61OxiZVpJgZjoQb7JyyDIBXqSZs7Kn/c1Nhm X-Received: by 2002:a63:160d:: with SMTP id w13mr22276859pgl.43.1544705518092; Thu, 13 Dec 2018 04:51:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544705518; cv=none; d=google.com; s=arc-20160816; b=t4Vu+tcWj5yegV1Zq0gKGpck/XxUsn2SDxefCV3XDt/hOD40iWmbdxGqwdPIZ6uekE zFXmZKzSjySyUUEHGKQ+sO6lmYUix39EXgOPReA6+2wgHcMMgRJVeXxe8BMVlXwfEOWg eUtawtGpPtUsYCs3uJayO19aH0MWjWIO+da4lqBbRboxUbz6Ypj4HlSsqDfdi1jEPHtS hZJB4vlCpA/fHX53U0zCAISN07IEQB1Q2vSBUQ/5iS2XVF0xoP/y4sl0AIQNx4fxhVzo MFtAnIMuSv46Y1eEyK9fIRstd7fTt0smN7RwgWgF9ZrRUQ2sUAqIMCuIaiu/YZEmbsqB HXZQ== 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=7QjucV4BxsnJ1/zXhFhxPebheQTEq0DAnGzqLi8xceE=; b=zbg1w4E0wbw775b7UEooYH5xk/mnPAI8rd58R4AX8pKMXyxSWwMSMfKwiO01sGCEcD ciXJ2kGC3iCduQ+g7+3EUcL2OrJIUGXRBnkTAFrUu9hZuB331wEqdYuF6FXoWQQwDWEQ Jkimo44UKahckIs1IiG5ecZWnckuklZPRe7DlOoUp/J6vT8uaIBIX75cI9Io0NXq/KFn WML5ZX56hhYDxQyyy/LCSY/GhkPpwUq46lOK8HlPXnSrBSpUSL9Oy1fi90dWxQJ8F48P PGuh2gDzFibMG4UmT3zowjG5UTn9TfVGBOdYYx7teHNO/BYGbMVm7JKFvzcmO+I48fq1 5I9Q== 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 v25si1533559pfg.135.2018.12.13.04.51.43; Thu, 13 Dec 2018 04:51:58 -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 S1729472AbeLMMu1 (ORCPT + 99 others); Thu, 13 Dec 2018 07:50:27 -0500 Received: from metis.ext.pengutronix.de ([85.220.165.71]:41365 "EHLO metis.ext.pengutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729207AbeLMMuZ (ORCPT ); Thu, 13 Dec 2018 07:50:25 -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 1gXQRZ-0007n2-3n; Thu, 13 Dec 2018 13:50:21 +0100 Message-ID: <1544705420.3137.30.camel@pengutronix.de> Subject: Re: [v2] PCI: imx: make msi work without pcieportbus From: Lucas Stach To: Lorenzo Pieralisi Cc: Richard Zhu , "bhelgaas@google.com" , "andrew.smirnov@gmail.com" , "linux-pci@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-kernel@vger.kernel.org" Date: Thu, 13 Dec 2018 13:50:20 +0100 In-Reply-To: <20181213123401.GA26763@red-moon> References: <1544687042-16595-1-git-send-email-hongxing.zhu@nxp.com> <1544692768.3137.25.camel@pengutronix.de> <1544695636.3137.27.camel@pengutronix.de> <20181213123401.GA26763@red-moon> 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, 12:34 +0000 schrieb Lorenzo Pieralisi: > On Thu, Dec 13, 2018 at 11:07:16AM +0100, Lucas Stach wrote: > > 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. > > The question is whether we should really depend on PCI_MSI_IRQ_DOMAIN > option, should we ? It certainly cuts down on the combinatorial space when testing those changes. IMHO this is a good thing, so as long as there is no compelling reason for making this dependency configurable I'm totally fine with keeping it the way it is now. Regards, Lucas