diff mbox

[pci:pci/host-mediatek,11/11] drivers/pci/host/pcie-mediatek.c:541:43: error: 'node' undeclared

Message ID 1503544447.19072.7.camel@mhfsdcap03 (mailing list archive)
State New, archived
Delegated to: Bjorn Helgaas
Headers show

Commit Message

Honghui Zhang Aug. 24, 2017, 3:14 a.m. UTC
On Wed, 2017-08-23 at 17:52 -0500, Bjorn Helgaas wrote:
> On Wed, Aug 23, 2017 at 10:53:07PM +0800, kbuild test robot wrote:
> > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/host-mediatek
> > head:   8e8ed61600e99258ff59bf36b85b671eed25a462
> > commit: 8e8ed61600e99258ff59bf36b85b671eed25a462 [11/11] PCI: mediatek: Add MSI support for MT2712 and MT7622
> > config: arm-allmodconfig (attached as .config)
> > compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
> > reproduce:
> >         wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> >         chmod +x ~/bin/make.cross
> >         git checkout 8e8ed61600e99258ff59bf36b85b671eed25a462
> >         # save the attached .config to linux build tree
> >         make.cross ARCH=arm 
> 
> The "node" and "dev" undeclared errors are my fault, and I fixed them.  But
> I don't think I introduced the casting warnings.  These warnings are on a
> 32-bit build.
> 
> I pushed the update to fix the node/dev errors.  Please take a look at the
> remaining casting warnings.
> 
> > All error/warnings (new ones prefixed by >>):
> > 
> >    In file included from include/linux/clk.h:16:0,
> >                     from drivers/pci/host/pcie-mediatek.c:18:
> >    drivers/pci/host/pcie-mediatek.c: In function 'mtk_pcie_msi_setup_irq':
> > >> drivers/pci/host/pcie-mediatek.c:488:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> >      msg.address_lo = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
> >                                     ^
> >    include/linux/kernel.h:178:33: note: in definition of macro 'lower_32_bits'
> >     #define lower_32_bits(n) ((u32)(n))
> >                                     ^
> >    drivers/pci/host/pcie-mediatek.c: In function 'mtk_pcie_enable_msi':
> > >> drivers/pci/host/pcie-mediatek.c:541:43: error: 'node' undeclared (first use in this function)
> >      port->msi_domain = irq_domain_add_linear(node, MTK_MSI_IRQS_NUM,
> >                                               ^~~~
> >    drivers/pci/host/pcie-mediatek.c:541:43: note: each undeclared identifier is reported only once for each function it appears in
> > >> drivers/pci/host/pcie-mediatek.c:545:11: error: 'dev' undeclared (first use in this function)
> >       dev_err(dev, "failed to create MSI IRQ domain\n");
> >               ^~~
> >    In file included from include/linux/clk.h:16:0,
> >                     from drivers/pci/host/pcie-mediatek.c:18:
> >    drivers/pci/host/pcie-mediatek.c:549:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> >      val = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
> >                          ^
> >    include/linux/kernel.h:178:33: note: in definition of macro 'lower_32_bits'
> >     #define lower_32_bits(n) ((u32)(n))
> >                                     ^
> > 

hi, Bjorn,
I fixed the build warning at arm by the following diff:
        if (!port)
@@ -475,9 +476,10 @@ static int mtk_pcie_msi_setup_irq(struct
msi_controller *chip,

        irq_set_msi_desc(irq, desc);

+       msg_addr = virt_to_phys(port->base + PCIE_MSI_VECTOR);
        /* MT2712/MT7622 only support 32 bit MSI address */
        msg.address_hi = 0;
-       msg.address_lo = lower_32_bits((u64)(port->base +
PCIE_MSI_VECTOR));
+       msg.address_lo = lower_32_bits(msg_addr);
        msg.data = hwirq;

        pci_write_msi_msg(irq, &msg);
@@ -531,8 +533,10 @@ static const struct irq_domain_ops msi_domain_ops =
{
 static void mtk_pcie_enable_msi(struct mtk_pcie_port *port)
 {
        u32 val;
+       phys_addr_t msg_addr;

-       val = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
+       msg_addr = virt_to_phys(port->base + PCIE_MSI_VECTOR);
+       val = lower_32_bits(msg_addr);
        writel(val, port->base + PCIE_IMSI_ADDR);

        val = readl(port->base + PCIE_INT_MASK);


I pull the your host-mediatek branch and seems the build error is still
there.
Should I send a new patch base on your pci/host-mediatek to fix the
build warnings, or should I wait for your push for build error and then
send the patch?

thanks.

> > vim +/node +541 drivers/pci/host/pcie-mediatek.c
> > 
> >    459	
> >    460	static int mtk_pcie_msi_setup_irq(struct msi_controller *chip,
> >    461					  struct pci_dev *pdev, struct msi_desc *desc)
> >    462	{
> >    463		struct mtk_pcie_port *port;
> >    464		struct msi_msg msg;
> >    465		unsigned int irq;
> >    466		int hwirq;
> >    467	
> >    468		port = mtk_pcie_find_port(pdev->bus, pdev->devfn);
> >    469		if (!port)
> >    470			return -EINVAL;
> >    471	
> >    472		hwirq = mtk_pcie_msi_alloc(port);
> >    473		if (hwirq < 0)
> >    474			return hwirq;
> >    475	
> >    476		irq = irq_create_mapping(port->msi_domain, hwirq);
> >    477		if (!irq) {
> >    478			mtk_pcie_msi_free(port, hwirq);
> >    479			return -EINVAL;
> >    480		}
> >    481	
> >    482		chip->dev = &pdev->dev;
> >    483	
> >    484		irq_set_msi_desc(irq, desc);
> >    485	
> >    486		/* MT2712/MT7622 only support 32-bit MSI addresses */
> >    487		msg.address_hi = 0;
> >  > 488		msg.address_lo = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
> >    489		msg.data = hwirq;
> >    490	
> >    491		pci_write_msi_msg(irq, &msg);
> >    492	
> >    493		return 0;
> >    494	}
> >    495	
> >    496	static void mtk_msi_teardown_irq(struct msi_controller *chip, unsigned int irq)
> >    497	{
> >    498		struct pci_dev *pdev = to_pci_dev(chip->dev);
> >    499		struct irq_data *d = irq_get_irq_data(irq);
> >    500		irq_hw_number_t hwirq = irqd_to_hwirq(d);
> >    501		struct mtk_pcie_port *port;
> >    502	
> >    503		port = mtk_pcie_find_port(pdev->bus, pdev->devfn);
> >    504		if (!port)
> >    505			return;
> >    506	
> >    507		irq_dispose_mapping(irq);
> >    508		mtk_pcie_msi_free(port, hwirq);
> >    509	}
> >    510	
> >    511	static struct msi_controller mtk_pcie_msi_chip = {
> >    512		.setup_irq = mtk_pcie_msi_setup_irq,
> >    513		.teardown_irq = mtk_msi_teardown_irq,
> >    514	};
> >    515	
> >    516	static struct irq_chip mtk_msi_irq_chip = {
> >    517		.name = "MTK PCIe MSI",
> >    518		.irq_enable = pci_msi_unmask_irq,
> >    519		.irq_disable = pci_msi_mask_irq,
> >    520		.irq_mask = pci_msi_mask_irq,
> >    521		.irq_unmask = pci_msi_unmask_irq,
> >    522	};
> >    523	
> >    524	static int mtk_pcie_msi_map(struct irq_domain *domain, unsigned int irq,
> >    525				    irq_hw_number_t hwirq)
> >    526	{
> >    527		irq_set_chip_and_handler(irq, &mtk_msi_irq_chip, handle_simple_irq);
> >    528		irq_set_chip_data(irq, domain->host_data);
> >    529	
> >    530		return 0;
> >    531	}
> >    532	
> >    533	static const struct irq_domain_ops msi_domain_ops = {
> >    534		.map = mtk_pcie_msi_map,
> >    535	};
> >    536	
> >    537	static int mtk_pcie_enable_msi(struct mtk_pcie_port *port)
> >    538	{
> >    539		u32 val;
> >    540	
> >  > 541		port->msi_domain = irq_domain_add_linear(node, MTK_MSI_IRQS_NUM,
> >    542							 &msi_domain_ops,
> >    543							 &mtk_pcie_msi_chip);
> >    544		if (!port->msi_domain) {
> >  > 545			dev_err(dev, "failed to create MSI IRQ domain\n");
> >    546			return -ENOMEM;
> >    547		}
> >    548	
> >    549		val = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
> >    550		writel(val, port->base + PCIE_IMSI_ADDR);
> >    551	
> >    552		val = readl(port->base + PCIE_INT_MASK);
> >    553		val &= ~MSI_MASK;
> >    554		writel(val, port->base + PCIE_INT_MASK);
> >    555	
> >    556		return 0;
> >    557	}
> >    558	
> > 
> > ---
> > 0-DAY kernel test infrastructure                Open Source Technology Center
> > https://lists.01.org/pipermail/kbuild-all                   Intel Corporation
> 
>

Comments

Bjorn Helgaas Aug. 24, 2017, 1:44 p.m. UTC | #1
On Thu, Aug 24, 2017 at 11:14:07AM +0800, mtk11102 wrote:
> On Wed, 2017-08-23 at 17:52 -0500, Bjorn Helgaas wrote:
> > On Wed, Aug 23, 2017 at 10:53:07PM +0800, kbuild test robot wrote:
> > > tree:   https://git.kernel.org/pub/scm/linux/kernel/git/helgaas/pci.git pci/host-mediatek
> > > head:   8e8ed61600e99258ff59bf36b85b671eed25a462
> > > commit: 8e8ed61600e99258ff59bf36b85b671eed25a462 [11/11] PCI: mediatek: Add MSI support for MT2712 and MT7622
> > > config: arm-allmodconfig (attached as .config)
> > > compiler: arm-linux-gnueabi-gcc (Debian 6.1.1-9) 6.1.1 20160705
> > > reproduce:
> > >         wget https://raw.githubusercontent.com/01org/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
> > >         chmod +x ~/bin/make.cross
> > >         git checkout 8e8ed61600e99258ff59bf36b85b671eed25a462
> > >         # save the attached .config to linux build tree
> > >         make.cross ARCH=arm 
> > 
> > The "node" and "dev" undeclared errors are my fault, and I fixed them.  But
> > I don't think I introduced the casting warnings.  These warnings are on a
> > 32-bit build.
> > 
> > I pushed the update to fix the node/dev errors.  Please take a look at the
> > remaining casting warnings.
> > 
> > > All error/warnings (new ones prefixed by >>):
> > > 
> > >    In file included from include/linux/clk.h:16:0,
> > >                     from drivers/pci/host/pcie-mediatek.c:18:
> > >    drivers/pci/host/pcie-mediatek.c: In function 'mtk_pcie_msi_setup_irq':
> > > >> drivers/pci/host/pcie-mediatek.c:488:33: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > >      msg.address_lo = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
> > >                                     ^
> > >    include/linux/kernel.h:178:33: note: in definition of macro 'lower_32_bits'
> > >     #define lower_32_bits(n) ((u32)(n))
> > >                                     ^
> > >    drivers/pci/host/pcie-mediatek.c: In function 'mtk_pcie_enable_msi':
> > > >> drivers/pci/host/pcie-mediatek.c:541:43: error: 'node' undeclared (first use in this function)
> > >      port->msi_domain = irq_domain_add_linear(node, MTK_MSI_IRQS_NUM,
> > >                                               ^~~~
> > >    drivers/pci/host/pcie-mediatek.c:541:43: note: each undeclared identifier is reported only once for each function it appears in
> > > >> drivers/pci/host/pcie-mediatek.c:545:11: error: 'dev' undeclared (first use in this function)
> > >       dev_err(dev, "failed to create MSI IRQ domain\n");
> > >               ^~~
> > >    In file included from include/linux/clk.h:16:0,
> > >                     from drivers/pci/host/pcie-mediatek.c:18:
> > >    drivers/pci/host/pcie-mediatek.c:549:22: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
> > >      val = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
> > >                          ^
> > >    include/linux/kernel.h:178:33: note: in definition of macro 'lower_32_bits'
> > >     #define lower_32_bits(n) ((u32)(n))
> > >                                     ^
> > > 
> 
> hi, Bjorn,
> I fixed the build warning at arm by the following diff:
> diff --git a/drivers/pci/host/pcie-mediatek.c
> b/drivers/pci/host/pcie-mediatek.c
> index 707e669..b8d6ed8 100644
> --- a/drivers/pci/host/pcie-mediatek.c
> +++ b/drivers/pci/host/pcie-mediatek.c
> @@ -459,6 +459,7 @@ static int mtk_pcie_msi_setup_irq(struct
> msi_controller *chip,
>         struct msi_msg msg;
>         int hwirq;
>         u32 irq;
> +       phys_addr_t msg_addr;
> 
>         port = mtk_pcie_find_port(pdev->bus, pdev->devfn);
>         if (!port)
> @@ -475,9 +476,10 @@ static int mtk_pcie_msi_setup_irq(struct
> msi_controller *chip,
> 
>         irq_set_msi_desc(irq, desc);
> 
> +       msg_addr = virt_to_phys(port->base + PCIE_MSI_VECTOR);
>         /* MT2712/MT7622 only support 32 bit MSI address */
>         msg.address_hi = 0;
> -       msg.address_lo = lower_32_bits((u64)(port->base +
> PCIE_MSI_VECTOR));
> +       msg.address_lo = lower_32_bits(msg_addr);
>         msg.data = hwirq;
> 
>         pci_write_msi_msg(irq, &msg);
> @@ -531,8 +533,10 @@ static const struct irq_domain_ops msi_domain_ops =
> {
>  static void mtk_pcie_enable_msi(struct mtk_pcie_port *port)
>  {
>         u32 val;
> +       phys_addr_t msg_addr;
> 
> -       val = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
> +       msg_addr = virt_to_phys(port->base + PCIE_MSI_VECTOR);
> +       val = lower_32_bits(msg_addr);
>         writel(val, port->base + PCIE_IMSI_ADDR);
> 
>         val = readl(port->base + PCIE_INT_MASK);

I don't think this is quite right: virt_to_phys() converts a CPU
virtual address to a CPU physical address, but the msg_addr is a PCI
bus address.  In many cases, PCI bus addresses are identical to CPU
physical addresses, but not always.

But I see other drivers doing the same thing:

  dw_pcie_msi_init()
  dw_msi_setup_msg()
  advk_msi_irq_compose_msi_msg()
  advk_pcie_init_msi_irq_domain()
  rcar_pcie_enable_msi()
  xilinx_pcie_msi_setup_irq()
  xilinx_pcie_enable_msi()

and I don't know the right way to fix this.  MSI is basically a
special case of DMA.  For most DMA, we allocate a buffer and use
something like dma_map_single() to map it via an IOMMU (if present)
and return the corresponding bus address.  For MSIs, the target isn't
usually a memory buffer, and I don't know that dma_map_single() would
do the right thing.

But I guess we should use your fix for now since I don't have a better
idea.

> I pull the your host-mediatek branch and seems the build error is still
> there.
> Should I send a new patch base on your pci/host-mediatek to fix the
> build warnings, or should I wait for your push for build error and then
> send the patch?

Sorry, I must have forgotten to push it.  Should be there now:
9f3ec1e47377 ("PCI: mediatek: Add MSI support for MT2712 and MT7622")

Hopefully that has everything we need (I included your fix above).

Bjorn
Mason Aug. 25, 2017, 10:01 a.m. UTC | #2
On 24/08/2017 15:44, Bjorn Helgaas wrote:

> On Thu, Aug 24, 2017 at 11:14:07AM +0800, mtk11102 wrote:
>
>> @@ -531,8 +533,10 @@ static const struct irq_domain_ops msi_domain_ops =
>> {
>>  static void mtk_pcie_enable_msi(struct mtk_pcie_port *port)
>>  {
>>         u32 val;
>> +       phys_addr_t msg_addr;
>>
>> -       val = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
>> +       msg_addr = virt_to_phys(port->base + PCIE_MSI_VECTOR);
>> +       val = lower_32_bits(msg_addr);
>>         writel(val, port->base + PCIE_IMSI_ADDR);
>>
>>         val = readl(port->base + PCIE_INT_MASK);
> 
> I don't think this is quite right: virt_to_phys() converts a CPU
> virtual address to a CPU physical address, but the msg_addr is a PCI
> bus address.  In many cases, PCI bus addresses are identical to CPU
> physical addresses, but not always.

Is the virt_to_bus() function not appropriate?

Regards.
Bjorn Helgaas Aug. 25, 2017, 1:39 p.m. UTC | #3
On Fri, Aug 25, 2017 at 12:01:21PM +0200, Mason wrote:
> On 24/08/2017 15:44, Bjorn Helgaas wrote:
> 
> > On Thu, Aug 24, 2017 at 11:14:07AM +0800, mtk11102 wrote:
> >
> >> @@ -531,8 +533,10 @@ static const struct irq_domain_ops msi_domain_ops =
> >> {
> >>  static void mtk_pcie_enable_msi(struct mtk_pcie_port *port)
> >>  {
> >>         u32 val;
> >> +       phys_addr_t msg_addr;
> >>
> >> -       val = lower_32_bits((u64)(port->base + PCIE_MSI_VECTOR));
> >> +       msg_addr = virt_to_phys(port->base + PCIE_MSI_VECTOR);
> >> +       val = lower_32_bits(msg_addr);
> >>         writel(val, port->base + PCIE_IMSI_ADDR);
> >>
> >>         val = readl(port->base + PCIE_INT_MASK);
> > 
> > I don't think this is quite right: virt_to_phys() converts a CPU
> > virtual address to a CPU physical address, but the msg_addr is a PCI
> > bus address.  In many cases, PCI bus addresses are identical to CPU
> > physical addresses, but not always.
> 
> Is the virt_to_bus() function not appropriate?

virt_to_bus() is deprecated because there's no way for the caller to
specify which bus.  I don't have a better suggestion than
virt_to_phys(), so I shouldn't have said anything :)

Bjorn
Ryder Lee Aug. 26, 2017, 12:56 a.m. UTC | #4
Hi,

On Fri, 2017-08-25 at 08:53 +0800, Honghui Zhang wrote:
> On Thu, 2017-08-24 at 08:44 -0500, Bjorn Helgaas wrote:
> > On Thu, Aug 24, 2017 at 11:14:07AM +0800, mtk11102 wrote:
> > > On Wed, 2017-08-23 at 17:52 -0500, Bjorn Helgaas wrote:
> > > > On Wed, Aug 23, 2017 at 10:53:07PM +0800, kbuild test robot wrote:

....
> > > I pull the your host-mediatek branch and seems the build error is still
> > > there.
> > > Should I send a new patch base on your pci/host-mediatek to fix the
> > > build warnings, or should I wait for your push for build error and then
> > > send the patch?
> > 
> > Sorry, I must have forgotten to push it.  Should be there now:
> > 9f3ec1e47377 ("PCI: mediatek: Add MSI support for MT2712 and MT7622")
> > 
> > Hopefully that has everything we need (I included your fix above).
> > 
> 
> Thanks very much for your help.
> 
> > Bjorn
> 
> 

I just noticed that 9f3ec1e47377 could not be built pass.

In function 'mtk_pcie_enable_msi':
 error: 'return' with a value, in function returning void [-Werror]
  return 0;

In function 'mtk_pcie_init_irq_domain': error: unused variable
'err' [-Werror=unused-variable]
  int err;

Ryder
Bjorn Helgaas Aug. 26, 2017, 11:55 a.m. UTC | #5
On Sat, Aug 26, 2017 at 08:56:27AM +0800, Ryder Lee wrote:
> Hi,
> 
> On Fri, 2017-08-25 at 08:53 +0800, Honghui Zhang wrote:
> > On Thu, 2017-08-24 at 08:44 -0500, Bjorn Helgaas wrote:
> > > On Thu, Aug 24, 2017 at 11:14:07AM +0800, mtk11102 wrote:
> > > > On Wed, 2017-08-23 at 17:52 -0500, Bjorn Helgaas wrote:
> > > > > On Wed, Aug 23, 2017 at 10:53:07PM +0800, kbuild test robot wrote:
> 
> ....
> > > > I pull the your host-mediatek branch and seems the build error is still
> > > > there.
> > > > Should I send a new patch base on your pci/host-mediatek to fix the
> > > > build warnings, or should I wait for your push for build error and then
> > > > send the patch?
> > > 
> > > Sorry, I must have forgotten to push it.  Should be there now:
> > > 9f3ec1e47377 ("PCI: mediatek: Add MSI support for MT2712 and MT7622")
> > > 
> > > Hopefully that has everything we need (I included your fix above).
> > > 
> > 
> > Thanks very much for your help.
> > 
> > > Bjorn
> > 
> > 
> 
> I just noticed that 9f3ec1e47377 could not be built pass.
> 
> In function 'mtk_pcie_enable_msi':
>  error: 'return' with a value, in function returning void [-Werror]
>   return 0;
> 
> In function 'mtk_pcie_init_irq_domain': error: unused variable
> 'err' [-Werror=unused-variable]
>   int err;

Fixed in 0eb463c096c4 ("PCI: mediatek: Add MSI support for MT2712 and
MT7622").

I wonder why I didn't get a kbuild test report for this?
Fengguang Wu Aug. 26, 2017, 12:28 p.m. UTC | #6
On Sat, Aug 26, 2017 at 06:55:08AM -0500, Bjorn Helgaas wrote:
>On Sat, Aug 26, 2017 at 08:56:27AM +0800, Ryder Lee wrote:
>> Hi,
>>
>> On Fri, 2017-08-25 at 08:53 +0800, Honghui Zhang wrote:
>> > On Thu, 2017-08-24 at 08:44 -0500, Bjorn Helgaas wrote:
>> > > On Thu, Aug 24, 2017 at 11:14:07AM +0800, mtk11102 wrote:
>> > > > On Wed, 2017-08-23 at 17:52 -0500, Bjorn Helgaas wrote:
>> > > > > On Wed, Aug 23, 2017 at 10:53:07PM +0800, kbuild test robot wrote:
>>
>> ....
>> > > > I pull the your host-mediatek branch and seems the build error is still
>> > > > there.
>> > > > Should I send a new patch base on your pci/host-mediatek to fix the
>> > > > build warnings, or should I wait for your push for build error and then
>> > > > send the patch?
>> > >
>> > > Sorry, I must have forgotten to push it.  Should be there now:
>> > > 9f3ec1e47377 ("PCI: mediatek: Add MSI support for MT2712 and MT7622")
>> > >
>> > > Hopefully that has everything we need (I included your fix above).
>> > >
>> >
>> > Thanks very much for your help.
>> >
>> > > Bjorn
>> >
>> >
>>
>> I just noticed that 9f3ec1e47377 could not be built pass.
>>
>> In function 'mtk_pcie_enable_msi':
>>  error: 'return' with a value, in function returning void [-Werror]
>>   return 0;
>>
>> In function 'mtk_pcie_init_irq_domain': error: unused variable
>> 'err' [-Werror=unused-variable]
>>   int err;
>
>Fixed in 0eb463c096c4 ("PCI: mediatek: Add MSI support for MT2712 and
>MT7622").
>
>I wonder why I didn't get a kbuild test report for this?

CC Philip. AFAIK 0day's master server went broken for several days..

Thanks,
Fengguang
Philip Li Aug. 26, 2017, 2:20 p.m. UTC | #7
> On Sat, Aug 26, 2017 at 06:55:08AM -0500, Bjorn Helgaas wrote:
> >On Sat, Aug 26, 2017 at 08:56:27AM +0800, Ryder Lee wrote:
> >> Hi,
> >>
> >> On Fri, 2017-08-25 at 08:53 +0800, Honghui Zhang wrote:
> >> > On Thu, 2017-08-24 at 08:44 -0500, Bjorn Helgaas wrote:
> >> > > On Thu, Aug 24, 2017 at 11:14:07AM +0800, mtk11102 wrote:
> >> > > > On Wed, 2017-08-23 at 17:52 -0500, Bjorn Helgaas wrote:
> >> > > > > On Wed, Aug 23, 2017 at 10:53:07PM +0800, kbuild test robot wrote:
> >>
> >> ....
> >> > > > I pull the your host-mediatek branch and seems the build error is still
> >> > > > there.
> >> > > > Should I send a new patch base on your pci/host-mediatek to fix the
> >> > > > build warnings, or should I wait for your push for build error and then
> >> > > > send the patch?
> >> > >
> >> > > Sorry, I must have forgotten to push it.  Should be there now:
> >> > > 9f3ec1e47377 ("PCI: mediatek: Add MSI support for MT2712 and MT7622")
> >> > >
> >> > > Hopefully that has everything we need (I included your fix above).
> >> > >
> >> >
> >> > Thanks very much for your help.
> >> >
> >> > > Bjorn
> >> >
> >> >
> >>
> >> I just noticed that 9f3ec1e47377 could not be built pass.
> >>
> >> In function 'mtk_pcie_enable_msi':
> >>  error: 'return' with a value, in function returning void [-Werror]
> >>   return 0;
> >>
> >> In function 'mtk_pcie_init_irq_domain': error: unused variable
> >> 'err' [-Werror=unused-variable]
> >>   int err;
> >
> >Fixed in 0eb463c096c4 ("PCI: mediatek: Add MSI support for MT2712 and
> >MT7622").
> >
> >I wonder why I didn't get a kbuild test report for this?
> 
> CC Philip. AFAIK 0day's master server went broken for several days..
hi Bjorn, we got server broken this week, and kbuild service is not running smoothly.
It starts to recover gradually and should be back to normal early next week.

> 
> Thanks,
> Fengguang
Honghui Zhang Aug. 28, 2017, 3:33 a.m. UTC | #8
On Sat, 2017-08-26 at 14:20 +0000, Li, Philip wrote:
> > On Sat, Aug 26, 2017 at 06:55:08AM -0500, Bjorn Helgaas wrote:
> > >On Sat, Aug 26, 2017 at 08:56:27AM +0800, Ryder Lee wrote:
> > >> Hi,
> > >>
> > >> On Fri, 2017-08-25 at 08:53 +0800, Honghui Zhang wrote:
> > >> > On Thu, 2017-08-24 at 08:44 -0500, Bjorn Helgaas wrote:
> > >> > > On Thu, Aug 24, 2017 at 11:14:07AM +0800, mtk11102 wrote:
> > >> > > > On Wed, 2017-08-23 at 17:52 -0500, Bjorn Helgaas wrote:
> > >> > > > > On Wed, Aug 23, 2017 at 10:53:07PM +0800, kbuild test robot wrote:
> > >>
> > >> ....
> > >> > > > I pull the your host-mediatek branch and seems the build error is still
> > >> > > > there.
> > >> > > > Should I send a new patch base on your pci/host-mediatek to fix the
> > >> > > > build warnings, or should I wait for your push for build error and then
> > >> > > > send the patch?
> > >> > >
> > >> > > Sorry, I must have forgotten to push it.  Should be there now:
> > >> > > 9f3ec1e47377 ("PCI: mediatek: Add MSI support for MT2712 and MT7622")
> > >> > >
> > >> > > Hopefully that has everything we need (I included your fix above).
> > >> > >
> > >> >
> > >> > Thanks very much for your help.
> > >> >
> > >> > > Bjorn
> > >> >
> > >> >
> > >>
> > >> I just noticed that 9f3ec1e47377 could not be built pass.
> > >>
> > >> In function 'mtk_pcie_enable_msi':
> > >>  error: 'return' with a value, in function returning void [-Werror]
> > >>   return 0;
> > >>
> > >> In function 'mtk_pcie_init_irq_domain': error: unused variable
> > >> 'err' [-Werror=unused-variable]
> > >>   int err;
> > >
> > >Fixed in 0eb463c096c4 ("PCI: mediatek: Add MSI support for MT2712 and
> > >MT7622").
> > >

Hi, Bjorn,
   Seems you forget to remove the following define in 0eb463c096c4 :

> >> In function 'mtk_pcie_init_irq_domain': error: unused variable
> > >> 'err' [-Werror=unused-variable]
> > >>   int err;


> > >I wonder why I didn't get a kbuild test report for this?
> > 
> > CC Philip. AFAIK 0day's master server went broken for several days..
> hi Bjorn, we got server broken this week, and kbuild service is not running smoothly.
> It starts to recover gradually and should be back to normal early next week.
> 
> > 
> > Thanks,
> > Fengguang
Bjorn Helgaas Aug. 28, 2017, 6:14 p.m. UTC | #9
On Mon, Aug 28, 2017 at 11:33:53AM +0800, Honghui Zhang wrote:
> On Sat, 2017-08-26 at 14:20 +0000, Li, Philip wrote:
> > > On Sat, Aug 26, 2017 at 06:55:08AM -0500, Bjorn Helgaas wrote:
> > > >On Sat, Aug 26, 2017 at 08:56:27AM +0800, Ryder Lee wrote:
> > > >> Hi,
> > > >>
> > > >> On Fri, 2017-08-25 at 08:53 +0800, Honghui Zhang wrote:
> > > >> > On Thu, 2017-08-24 at 08:44 -0500, Bjorn Helgaas wrote:
> > > >> > > On Thu, Aug 24, 2017 at 11:14:07AM +0800, mtk11102 wrote:
> > > >> > > > On Wed, 2017-08-23 at 17:52 -0500, Bjorn Helgaas wrote:
> > > >> > > > > On Wed, Aug 23, 2017 at 10:53:07PM +0800, kbuild test robot wrote:
> > > >>
> > > >> ....
> > > >> > > > I pull the your host-mediatek branch and seems the build error is still
> > > >> > > > there.
> > > >> > > > Should I send a new patch base on your pci/host-mediatek to fix the
> > > >> > > > build warnings, or should I wait for your push for build error and then
> > > >> > > > send the patch?
> > > >> > >
> > > >> > > Sorry, I must have forgotten to push it.  Should be there now:
> > > >> > > 9f3ec1e47377 ("PCI: mediatek: Add MSI support for MT2712 and MT7622")
> > > >> > >
> > > >> > > Hopefully that has everything we need (I included your fix above).
> > > >> > >
> > > >> >
> > > >> > Thanks very much for your help.
> > > >> >
> > > >> > > Bjorn
> > > >> >
> > > >> >
> > > >>
> > > >> I just noticed that 9f3ec1e47377 could not be built pass.
> > > >>
> > > >> In function 'mtk_pcie_enable_msi':
> > > >>  error: 'return' with a value, in function returning void [-Werror]
> > > >>   return 0;
> > > >>
> > > >> In function 'mtk_pcie_init_irq_domain': error: unused variable
> > > >> 'err' [-Werror=unused-variable]
> > > >>   int err;
> > > >
> > > >Fixed in 0eb463c096c4 ("PCI: mediatek: Add MSI support for MT2712 and
> > > >MT7622").
> > > >
> 
> Hi, Bjorn,
>    Seems you forget to remove the following define in 0eb463c096c4 :
> 
> > >> In function 'mtk_pcie_init_irq_domain': error: unused variable
> > > >> 'err' [-Werror=unused-variable]
> > > >>   int err;

Removed, thanks.
diff mbox

Patch

diff --git a/drivers/pci/host/pcie-mediatek.c
b/drivers/pci/host/pcie-mediatek.c
index 707e669..b8d6ed8 100644
--- a/drivers/pci/host/pcie-mediatek.c
+++ b/drivers/pci/host/pcie-mediatek.c
@@ -459,6 +459,7 @@  static int mtk_pcie_msi_setup_irq(struct
msi_controller *chip,
        struct msi_msg msg;
        int hwirq;
        u32 irq;
+       phys_addr_t msg_addr;

        port = mtk_pcie_find_port(pdev->bus, pdev->devfn);