linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Gustavo Romero <gromero@linux.vnet.ibm.com>
To: "Oliver O'Halloran" <oohall@gmail.com>,
	Gustavo Romero <gromero@linux.ibm.com>
Cc: linuxppc-dev <linuxppc-dev@lists.ozlabs.org>
Subject: Re: [PATCH] powerpc/powernv/pci: Fix build of pci-ioda.o
Date: Wed, 29 Jul 2020 09:31:32 -0300	[thread overview]
Message-ID: <8ad01023-3941-b0c5-245e-ce575cfef2c3@linux.vnet.ibm.com> (raw)
In-Reply-To: <CAOSf1CG4b_G_dzb2f2pRo-P=Ku4f7QB8VJpRmGjejHi+R2qQGg@mail.gmail.com>

Hi Oliver,

On 7/28/20 7:50 PM, Oliver O'Halloran wrote:
> On Wed, Jul 29, 2020 at 8:35 AM Gustavo Romero <gromero@linux.ibm.com> wrote:
>>
>> Currently pnv_ioda_setup_bus_dma() is outside of a CONFIG_IOMMU_API guard
>> and if CONFIG_IOMMU_API=n the build can fail if the compiler sets
>> -Werror=unused-function, because pnv_ioda_setup_bus_dma() is only used in
>> functions guarded by a CONFIG_IOMMU_API guard.
>>
>> That issue can be easily reproduced using the skiroot_defconfig. For other
>> configs, like powernv_defconfig, that issue is hidden by the fact that
>> if CONFIG_IOMMU_SUPPORT is enabled plus other common IOMMU options, like
>> CONFIG_OF_IOMMU, by default CONFIG_IOMMU_API is enabled as well. Hence, for
>> powernv_defconfig, it's necessary to set CONFIG_IOMMU_SUPPORT=n to make the
>> build fail, because CONFIG_PCI=y and pci-ioda.c is included in the build,
>> but since CONFIG_IOMMU_SUPPORT=n the CONFIG_IOMMU_API is disabled, breaking
>> the build.
>>
>> This commit fixes that build issue by moving the pnv_ioda_setup_bus_dma()
>> inside a CONFIG_IOMMU_API guard, so when CONFIG_IOMMU_API is disabled that
>> function is not defined.
> 
> I think a fix for this is already in -next.

Indeed.

For the records, it's fixed in -next by:

commit e3417faec526cbf97773dca691dcd743f5bfeb64
Author: Oliver O'Halloran <oohall@gmail.com>
Date:   Sun Jul 5 23:35:57 2020 +1000

     powerpc/powernv: Move pnv_ioda_setup_bus_dma under CONFIG_IOMMU_API
     
     pnv_ioda_setup_bus_dma() is only used when a passed through PE is
     returned to the host. If the kernel is built without IOMMU support
     this is dead code. Move it under the #ifdef with the rest of the
     IOMMU API support.
     
     Reported-by: kernel test robot <lkp@intel.com>
     Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
     Reviewed-by: Alexey Kardashevskiy <aik@ozlabs.ru>
     Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
     Link: https://lore.kernel.org/r/20200705133557.443607-2-oohall@gmail.com


Thanks.


Cheers,
Gustavo

      reply	other threads:[~2020-07-29 12:37 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-28 22:33 [PATCH] powerpc/powernv/pci: Fix build of pci-ioda.o Gustavo Romero
2020-07-28 22:50 ` Oliver O'Halloran
2020-07-29 12:31   ` Gustavo Romero [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=8ad01023-3941-b0c5-245e-ce575cfef2c3@linux.vnet.ibm.com \
    --to=gromero@linux.vnet.ibm.com \
    --cc=gromero@linux.ibm.com \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=oohall@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).