From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.9 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18580C67839 for ; Thu, 13 Dec 2018 10:07:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D0BFD20873 for ; Thu, 13 Dec 2018 10:07:23 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D0BFD20873 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=pengutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728135AbeLMKHX (ORCPT ); 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