From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756791AbbFQNpe (ORCPT ); Wed, 17 Jun 2015 09:45:34 -0400 Received: from mail-by2on0076.outbound.protection.outlook.com ([207.46.100.76]:36592 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754695AbbFQNpY (ORCPT ); Wed, 17 Jun 2015 09:45:24 -0400 X-Greylist: delayed 906 seconds by postgrey-1.27 at vger.kernel.org; Wed, 17 Jun 2015 09:45:24 EDT Authentication-Results: kernel.org; dkim=none (message not signed) header.d=none; Date: Wed, 17 Jun 2015 15:30:02 +0200 From: Robert Richter To: Tejun Heo , Jiang Liu CC: Robert Richter , Sunil Goutham , , , , kbuild test robot , Subject: [PATCH v2] ahci, msix: Fix build error for !PCI_MSI Message-ID: <20150617133002.GW10428@rric.localhost> References: <1433526566-21136-1-git-send-email-rric@kernel.org> <20150616132434.GO10428@rric.localhost> <20150616201341.GD22637@mtj.duckdns.org> <20150617084852.GL4914@rric.localhost> <5581379C.3090607@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <5581379C.3090607@linux.intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Originating-IP: [78.53.81.95] X-ClientProxiedBy: VI1PR05CA0040.eurprd05.prod.outlook.com (25.162.33.178) To BLUPR0701MB1603.namprd07.prod.outlook.com (25.163.84.152) X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1603;2:wiqTuDBdaPtEsdEPyn0JfBRgEOr/QwIcDFN8TQd8+ETYbzVgqIuA/StHcURvfncR;2:FJNqV0K0Wg8fbK+p1J/90mopfnCkVhRhvbIDMafikDtCm5HLPEKV6Xj/0kjetRjYofIRnRCLy0yf6CvExJ2y7coZ0SyaVqLqpNhP9+3of1r1zyGkR5RJTmKeSbEAqAEJCDqGiZ71AFzQWASSLK3Bfw==;6:y0Lc1tH7HB6/THNUvDphGeggjkLFTQL2gd4oRz20v79rf10ZhryBJ5lJn4ku6mVR0vjgquYIN5QFdY4RGv5dIiFq92TMXWM0G7NZzvJkRP68/bpbpcYTvQghk6nzapP2gmX/G8QaWK29DDxgmhl296YEeAVrgq3DVNJ/TFKmDDB/g603G8u5loRV1Gz43k5qNQDOKY1VNGKo8LbAGLWrwvhSPawy3nEIBSjUkwE/G9IduTjJuZTZDdZVTtDO8FvXB6d0V8k5lf0Z60CgBLXPxZywDVFjgtN+iz2iyVhVsNJi9ePpJMGiD7wN+wD7YVKnGvO9+ITo976zv7c/oDd4s6j9lonViWuzI0Y9Xzr1BHRaUZkNxzsVsnf/BBNKu0he8Objj4ayX3pPnj/g4m2ijgMtjYFOlJSWdgpyIlaV6U1wgMK6F926xEBElPMyeT3VkWId9W4Pdo67Hg+n1I2SE0+kgp7ogLuyYTLuHAEJrTgC81kC4/TIgPRxX/xSUXZFbx4QuJ5g5J02MNGUGDUc9q2AAItSrQWHCaq8rADL9R4/yCuWXOWXi9ObSOynkA2p3AqnRgMTPTuI/lAghGN5piqQKmFXNkiDFfSDCH7Ejcc= X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1603; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(520003)(3002001);SRVR:BLUPR0701MB1603;BCL:0;PCL:0;RULEID:;SRVR:BLUPR0701MB1603; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1603;3:oVN6f98Ptyv0t+Bq5c0V9hzGcANXWRUtPjgt3U85BWL8ZY3KsREuJ9QzqVvvz62o1/VUTrOSQSCToKyR8AA92QqrKFPxsGDsNauLqhroFtcl8Wh4AithJAR7Jz/4yio2fBVTBtf/onMY6biNAEuGtnCPbwBcsJr8FR180gZej0vJuTaF+DnXmvaHTTs8ozmSHKh5JEtqmsDucYD2nHWu5q3ImhnPZ54S1ihGnfHu8aMFunGM6kqA8CL7uZyyPQFqnbIc37eeUMgDWYAVDK/eJ47Oa1v7Zb0xmLG7yJ4W0cwXTHNjkp6vAbfkNB9PZGzN X-Forefront-PRVS: 0610D16BBE X-Forefront-Antispam-Report: SFV:NSPM;SFS:(10009020)(6009001)(51704005)(24454002)(479174004)(33656002)(76176999)(62966003)(77156002)(50986999)(5001770100001)(189998001)(54356999)(122386002)(23676002)(5001960100002)(229853001)(83506001)(92566002)(4001350100001)(40100003)(47776003)(2950100001)(66066001)(86362001)(575784001)(76506005)(42186005)(50466002)(77096005)(93886004)(46102003)(87976001)(19580405001)(19580395003);DIR:OUT;SFP:1101;SCL:1;SRVR:BLUPR0701MB1603;H:rric.localhost;FPR:;SPF:None;MLV:sfv;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1603;9:PuY2Em03sYfItvxoU2tQzzVxNUG+R0yrLMtXE6xvE3HY7pOA5dStNhTRUnKDAzIzCTZdSqkz0wd3DPWf6exAO0WFMR38qbwciH6Cw3vZ+QBe4TzYJ4z3PPZj6IQkbd6PfQkb2xrR5If1YasUUaBn4EVhbwB0Tdg4F9xZsRdYhY1+Tu9lCTCyj6jRyO1SvNfMoSSlcw6wHFPapi05m9RmNdlfSq1kGnBDS3MD3VjzAQALEUs84YxKV38i+8LzmP4viKVubbrh8ed7icqj0vFULGTPRai8TPlIELBT/IfSP12IbRdgCuqVxR72KjRbHBwMxNKNbaRAIwhCyZpy53dctlVFe4hXlt5xhY1bNvVVhz8WABxkw5O575sDqHOex3gwDEmlRMsoRafC5fPo590J7bUf/h8uesR4kkZHYh2kCRMDWcH0dwfqX6WdzFMybVcTIKKjncejriZioWfycskjTLCd4UJpLnuj7xgM9rRWwTCeMpMWWCL+6bofRjgxHkKWTiWdRr0QxaRiTdDrdRh80R04nsd6x4z+m5uuNhBAowTzs+erYD5d4C6dLWWOZxFHLUOv7rqIXJVC/5gNy7pufF3PHgD06n7OFu9BenBtAoKtNq+81DMnXs3XNBvzJGMgldMaJk/8ZWQj1LqeCtTbPKO1GvGaJ8SCRdWlQfqCfjelwRa4LRK8hrw6YJJsQt+mOr/5PTbFkkDObbI2l79a2kWYYIP9l7lHLoyZxmxXIjQ6iKPWkcxIZrb5x3wG6ndXl0lvKVIriWjpe2GpW5lp9b+8forxh8m7Io9f6gEgA8o504bx721k2GASFHwvMYfQdw9uKJZZhXYdBMzTFxsamZtHPTsSWtJEvhtK/TES091l0P/Htla3yJjYtK11Bm4IEouS3lm4Oa0FajNsI62TssdHWVxfjALjd1j4UYldwBo= X-Microsoft-Exchange-Diagnostics: 1;BLUPR0701MB1603;3:8DLUU0+J8mSccUOQYkPD00an8gnNhLVgH0BuE6WSGGqmtt1wVK82XYPOsN97lPCiJahgK3fVbvKZMnWdg4bdkvo6upZLRpvKPv9MfrNftCBXqvHxmq1RZ5VYv4x7JMVtAkxGs6lN9dEzkPtM7yPI8w==;10:NeCItvwaBs8ta+dUDcoAOy5JKno9EfX2CRvDW9e+VlRcnxwKtocXu1gPKXvigdq2XI5/prcM5szQT52VOR6LkSP1rozrJ6Lg1rw73i4z6Og=;6:WnJWbUswj9MHEIZYPMawjMu0kwtO/rUvOdEZb/8Sic3+/e5nnbaRlDc6yQHkg0Pg X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Jun 2015 13:30:14.4108 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLUPR0701MB1603 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tejun, Gerry, On 17.06.15 17:02:20, Jiang Liu wrote: > On 2015/6/17 16:48, Robert Richter wrote: > > static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) > > { > > +#ifdef CONFIG_PCI_MSI > > struct msi_desc *desc; > > > > list_for_each_entry(desc, &dev->msi_list, list) { > > if (desc->msi_attrib.entry_nr == entry) > > return desc; > > } > > - > > +#endif > Hi Robert, > While at it, could you please help to use for_each_pci_msi_entry() > from include/linux/msi.h instead of hard-coding? We are trying to refine > the msi_list related code, > so we don't need to touch this code again later. While looking into this I realized the code can be much more simplified so that the desc lookup function can be removed at all. See below. Sorry for the patch noise. -Robert >>From e43b79f0afd794d3e37ec0922c75e44b1c3f2e22 Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Wed, 17 Jun 2015 10:33:22 +0200 Subject: [PATCH v2] ahci, msix: Fix build error for !PCI_MSI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It turned out the irq vector of the msix can be obtained from struct msix_entry. This makes the lookup function for msi_desc obsolete. This fixes a build error if PCI_MSI is unset: drivers/ata/ahci.c: In function ‘msix_get_desc’: drivers/ata/ahci.c:1210:2: error: ‘struct pci_dev’ has no member named ‘msi_list’ Catched by Fengguang's build bot. Reported-by: kbuild test robot Signed-off-by: Robert Richter --- drivers/ata/ahci.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index bdedaa4f9d7b..c478a40e32c6 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1203,18 +1203,6 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host) {} #endif -static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) -{ - struct msi_desc *desc; - - list_for_each_entry(desc, &dev->msi_list, list) { - if (desc->msi_attrib.entry_nr == entry) - return desc; - } - - return NULL; -} - /* * ahci_init_msix() only implements single MSI-X support, not multiple * MSI-X per-port interrupts. This is needed for host controllers that only @@ -1223,7 +1211,6 @@ static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports, struct ahci_host_priv *hpriv) { - struct msi_desc *desc; int rc, nvec; struct msix_entry entry = {}; @@ -1248,13 +1235,7 @@ static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports, if (rc < 0) goto fail; - desc = msix_get_desc(pdev, 0); /* first entry */ - if (!desc) { - rc = -EINVAL; - goto fail; - } - - hpriv->irq = desc->irq; + hpriv->irq = entry.vector; return 1; fail: -- 2.1.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: robert.richter@caviumnetworks.com (Robert Richter) Date: Wed, 17 Jun 2015 15:30:02 +0200 Subject: [PATCH v2] ahci, msix: Fix build error for !PCI_MSI In-Reply-To: <5581379C.3090607@linux.intel.com> References: <1433526566-21136-1-git-send-email-rric@kernel.org> <20150616132434.GO10428@rric.localhost> <20150616201341.GD22637@mtj.duckdns.org> <20150617084852.GL4914@rric.localhost> <5581379C.3090607@linux.intel.com> Message-ID: <20150617133002.GW10428@rric.localhost> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org Tejun, Gerry, On 17.06.15 17:02:20, Jiang Liu wrote: > On 2015/6/17 16:48, Robert Richter wrote: > > static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) > > { > > +#ifdef CONFIG_PCI_MSI > > struct msi_desc *desc; > > > > list_for_each_entry(desc, &dev->msi_list, list) { > > if (desc->msi_attrib.entry_nr == entry) > > return desc; > > } > > - > > +#endif > Hi Robert, > While at it, could you please help to use for_each_pci_msi_entry() > from include/linux/msi.h instead of hard-coding? We are trying to refine > the msi_list related code, > so we don't need to touch this code again later. While looking into this I realized the code can be much more simplified so that the desc lookup function can be removed at all. See below. Sorry for the patch noise. -Robert >>From e43b79f0afd794d3e37ec0922c75e44b1c3f2e22 Mon Sep 17 00:00:00 2001 From: Robert Richter Date: Wed, 17 Jun 2015 10:33:22 +0200 Subject: [PATCH v2] ahci, msix: Fix build error for !PCI_MSI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It turned out the irq vector of the msix can be obtained from struct msix_entry. This makes the lookup function for msi_desc obsolete. This fixes a build error if PCI_MSI is unset: drivers/ata/ahci.c: In function ?msix_get_desc?: drivers/ata/ahci.c:1210:2: error: ?struct pci_dev? has no member named ?msi_list? Catched by Fengguang's build bot. Reported-by: kbuild test robot Signed-off-by: Robert Richter --- drivers/ata/ahci.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index bdedaa4f9d7b..c478a40e32c6 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1203,18 +1203,6 @@ static inline void ahci_gtf_filter_workaround(struct ata_host *host) {} #endif -static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) -{ - struct msi_desc *desc; - - list_for_each_entry(desc, &dev->msi_list, list) { - if (desc->msi_attrib.entry_nr == entry) - return desc; - } - - return NULL; -} - /* * ahci_init_msix() only implements single MSI-X support, not multiple * MSI-X per-port interrupts. This is needed for host controllers that only @@ -1223,7 +1211,6 @@ static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports, struct ahci_host_priv *hpriv) { - struct msi_desc *desc; int rc, nvec; struct msix_entry entry = {}; @@ -1248,13 +1235,7 @@ static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports, if (rc < 0) goto fail; - desc = msix_get_desc(pdev, 0); /* first entry */ - if (!desc) { - rc = -EINVAL; - goto fail; - } - - hpriv->irq = desc->irq; + hpriv->irq = entry.vector; return 1; fail: -- 2.1.1 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Robert Richter Subject: [PATCH v2] ahci, msix: Fix build error for !PCI_MSI Date: Wed, 17 Jun 2015 15:30:02 +0200 Message-ID: <20150617133002.GW10428@rric.localhost> References: <1433526566-21136-1-git-send-email-rric@kernel.org> <20150616132434.GO10428@rric.localhost> <20150616201341.GD22637@mtj.duckdns.org> <20150617084852.GL4914@rric.localhost> <5581379C.3090607@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: QUOTED-PRINTABLE Return-path: Received: from mail-by2on0068.outbound.protection.outlook.com ([207.46.100.68]:31184 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753081AbbFQNaS (ORCPT ); Wed, 17 Jun 2015 09:30:18 -0400 Content-Disposition: inline In-Reply-To: <5581379C.3090607@linux.intel.com> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Tejun Heo , Jiang Liu Cc: Robert Richter , Sunil Goutham , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, kbuild test robot , kbuild-all@01.org Tejun, Gerry, On 17.06.15 17:02:20, Jiang Liu wrote: > On 2015/6/17 16:48, Robert Richter wrote: > > static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 ent= ry) > > { > > +#ifdef CONFIG_PCI_MSI > > struct msi_desc *desc; > > =20 > > list_for_each_entry(desc, &dev->msi_list, list) { > > if (desc->msi_attrib.entry_nr =3D=3D entry) > > return desc; > > } > > - > > +#endif > Hi Robert, > While at it, could you please help to use for_each_pci_msi_entry() > from include/linux/msi.h instead of hard-coding? We are trying to ref= ine > the msi_list related code, > so we don't need to touch this code again later. While looking into this I realized the code can be much more simplified so that the desc lookup function can be removed at all. See below. Sorry for the patch noise. -Robert =46rom e43b79f0afd794d3e37ec0922c75e44b1c3f2e22 Mon Sep 17 00:00:00 200= 1 =46rom: Robert Richter Date: Wed, 17 Jun 2015 10:33:22 +0200 Subject: [PATCH v2] ahci, msix: Fix build error for !PCI_MSI MIME-Version: 1.0 Content-Type: text/plain; charset=3DUTF-8 Content-Transfer-Encoding: 8bit It turned out the irq vector of the msix can be obtained from struct msix_entry. This makes the lookup function for msi_desc obsolete. This fixes a build error if PCI_MSI is unset: drivers/ata/ahci.c: In function =E2=80=98msix_get_desc=E2=80=99: drivers/ata/ahci.c:1210:2: error: =E2=80=98struct pci_dev=E2=80=99 has= no member named =E2=80=98msi_list=E2=80=99 Catched by Fengguang's build bot. Reported-by: kbuild test robot Signed-off-by: Robert Richter --- drivers/ata/ahci.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/drivers/ata/ahci.c b/drivers/ata/ahci.c index bdedaa4f9d7b..c478a40e32c6 100644 --- a/drivers/ata/ahci.c +++ b/drivers/ata/ahci.c @@ -1203,18 +1203,6 @@ static inline void ahci_gtf_filter_workaround(st= ruct ata_host *host) {} #endif =20 -static struct msi_desc *msix_get_desc(struct pci_dev *dev, u16 entry) -{ - struct msi_desc *desc; - - list_for_each_entry(desc, &dev->msi_list, list) { - if (desc->msi_attrib.entry_nr =3D=3D entry) - return desc; - } - - return NULL; -} - /* * ahci_init_msix() only implements single MSI-X support, not multiple * MSI-X per-port interrupts. This is needed for host controllers that= only @@ -1223,7 +1211,6 @@ static struct msi_desc *msix_get_desc(struct pci_= dev *dev, u16 entry) static int ahci_init_msix(struct pci_dev *pdev, unsigned int n_ports, struct ahci_host_priv *hpriv) { - struct msi_desc *desc; int rc, nvec; struct msix_entry entry =3D {}; =20 @@ -1248,13 +1235,7 @@ static int ahci_init_msix(struct pci_dev *pdev, = unsigned int n_ports, if (rc < 0) goto fail; =20 - desc =3D msix_get_desc(pdev, 0); /* first entry */ - if (!desc) { - rc =3D -EINVAL; - goto fail; - } - - hpriv->irq =3D desc->irq; + hpriv->irq =3D entry.vector; =20 return 1; fail: --=20 2.1.1