All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar
@ 2019-03-24 16:41 Aditya Pakki
  2019-03-24 18:47 ` Andy Shevchenko
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Aditya Pakki @ 2019-03-24 16:41 UTC (permalink / raw)
  To: pakki001
  Cc: kjlu, Greg Kroah-Hartman, Jiri Slaby, Andy Shevchenko,
	Vinod Koul, linux-serial, linux-kernel

pci_ioremap_bar could fail. The patch returns in case of failure to
acquire IOMEM. It also releases the acquired resource in the exit path.

Signed-off-by: Aditya Pakki <pakki001@umn.edu>

---
v3: Change the order of pci_iounmap and dw_dma_remove
v2: Failed to release resource in exit path and incorrect code in non
DMA case, suggested by Andy Shevchenko
v1: Missed return by default in CONFIG_SERIAL_8250_DMA, suggested by
Jiri Slaby
---
 drivers/tty/serial/8250/8250_lpss.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c
index 53ca9ba6ab4b..69d6e32da713 100644
--- a/drivers/tty/serial/8250/8250_lpss.c
+++ b/drivers/tty/serial/8250/8250_lpss.c
@@ -170,9 +170,11 @@ static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port)
 	int ret;
 
 	chip->dev = &pdev->dev;
+	chip->pdata = &qrk_serial_dma_pdata;
 	chip->irq = pci_irq_vector(pdev, 0);
 	chip->regs = pci_ioremap_bar(pdev, 1);
-	chip->pdata = &qrk_serial_dma_pdata;
+	if (!chip->regs)
+		return;
 
 	/* Falling back to PIO mode if DMA probing fails */
 	ret = dw_dma_probe(chip);
@@ -199,7 +201,10 @@ static void qrk_serial_exit_dma(struct lpss8250 *lpss)
 
 	if (!param->dma_dev)
 		return;
+
 	dw_dma_remove(&lpss->dma_chip);
+
+	pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
 }
 #else	/* CONFIG_SERIAL_8250_DMA */
 static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) {}
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar
  2019-03-24 16:41 [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar Aditya Pakki
@ 2019-03-24 18:47 ` Andy Shevchenko
  2019-03-25  7:50   ` kbuild test robot
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: Andy Shevchenko @ 2019-03-24 18:47 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: Kangjie Lu, Greg Kroah-Hartman, Jiri Slaby, Andy Shevchenko,
	Vinod Koul, open list:SERIAL DRIVERS, Linux Kernel Mailing List

On Sun, Mar 24, 2019 at 6:43 PM Aditya Pakki <pakki001@umn.edu> wrote:
>
> pci_ioremap_bar could fail. The patch returns in case of failure to
> acquire IOMEM. It also releases the acquired resource in the exit path.

This is good per se, but I'm so sorry I found another missed place.
When DMA ->probe() fails, we have to unmap as well.

>
> Signed-off-by: Aditya Pakki <pakki001@umn.edu>
>
> ---
> v3: Change the order of pci_iounmap and dw_dma_remove
> v2: Failed to release resource in exit path and incorrect code in non
> DMA case, suggested by Andy Shevchenko
> v1: Missed return by default in CONFIG_SERIAL_8250_DMA, suggested by
> Jiri Slaby
> ---
>  drivers/tty/serial/8250/8250_lpss.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/tty/serial/8250/8250_lpss.c b/drivers/tty/serial/8250/8250_lpss.c
> index 53ca9ba6ab4b..69d6e32da713 100644
> --- a/drivers/tty/serial/8250/8250_lpss.c
> +++ b/drivers/tty/serial/8250/8250_lpss.c
> @@ -170,9 +170,11 @@ static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port)
>         int ret;
>
>         chip->dev = &pdev->dev;
> +       chip->pdata = &qrk_serial_dma_pdata;
>         chip->irq = pci_irq_vector(pdev, 0);
>         chip->regs = pci_ioremap_bar(pdev, 1);
> -       chip->pdata = &qrk_serial_dma_pdata;
> +       if (!chip->regs)
> +               return;
>
>         /* Falling back to PIO mode if DMA probing fails */
>         ret = dw_dma_probe(chip);
> @@ -199,7 +201,10 @@ static void qrk_serial_exit_dma(struct lpss8250 *lpss)
>
>         if (!param->dma_dev)
>                 return;
> +
>         dw_dma_remove(&lpss->dma_chip);
> +
> +       pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
>  }
>  #else  /* CONFIG_SERIAL_8250_DMA */
>  static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) {}
> --
> 2.17.1
>


-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar
  2019-03-24 16:41 [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar Aditya Pakki
@ 2019-03-25  7:50   ` kbuild test robot
  2019-03-25  7:50   ` kbuild test robot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2019-03-25  7:50 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: kbuild-all, pakki001, kjlu, Greg Kroah-Hartman, Jiri Slaby,
	Andy Shevchenko, Vinod Koul, linux-serial, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2967 bytes --]

Hi Aditya,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tty/tty-testing]
[also build test ERROR on v5.1-rc2 next-20190325]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Aditya-Pakki/tty-8250-fix-a-missing-check-for-pci_ioremap_bar/20190325-151723
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: i386-randconfig-x013-201912 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/tty/serial/8250/8250_lpss.c: In function 'qrk_serial_exit_dma':
>> drivers/tty/serial/8250/8250_lpss.c:207:45: error: invalid type argument of '->' (have 'struct dw_dma_chip')
     pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
                                                ^~
>> drivers/tty/serial/8250/8250_lpss.c:207:14: error: passing argument 1 of 'pci_iounmap' from incompatible pointer type [-Werror=incompatible-pointer-types]
     pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
                 ^~~~~
   In file included from arch/x86/include/asm/io.h:232:0,
                    from arch/x86/include/asm/realmode.h:15,
                    from arch/x86/include/asm/acpi.h:33,
                    from arch/x86/include/asm/fixmap.h:29,
                    from arch/x86/include/asm/apic.h:10,
                    from arch/x86/include/asm/smp.h:13,
                    from include/linux/smp.h:68,
                    from include/linux/topology.h:33,
                    from include/linux/gfp.h:9,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:22,
                    from include/linux/module.h:13,
                    from drivers/tty/serial/8250/8250_lpss.c:10:
   include/asm-generic/iomap.h:107:13: note: expected 'struct pci_dev *' but argument is of type 'struct device *'
    extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
                ^~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +207 drivers/tty/serial/8250/8250_lpss.c

   197	
   198	static void qrk_serial_exit_dma(struct lpss8250 *lpss)
   199	{
   200		struct dw_dma_slave *param = &lpss->dma_param;
   201	
   202		if (!param->dma_dev)
   203			return;
   204	
   205		dw_dma_remove(&lpss->dma_chip);
   206	
 > 207		pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
   208	}
   209	#else	/* CONFIG_SERIAL_8250_DMA */
   210	static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) {}
   211	static void qrk_serial_exit_dma(struct lpss8250 *lpss) {}
   212	#endif	/* !CONFIG_SERIAL_8250_DMA */
   213	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30377 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar
@ 2019-03-25  7:50   ` kbuild test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2019-03-25  7:50 UTC (permalink / raw)
  Cc: kbuild-all, pakki001, kjlu, Greg Kroah-Hartman, Jiri Slaby,
	Andy Shevchenko, Vinod Koul, linux-serial, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2967 bytes --]

Hi Aditya,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on tty/tty-testing]
[also build test ERROR on v5.1-rc2 next-20190325]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Aditya-Pakki/tty-8250-fix-a-missing-check-for-pci_ioremap_bar/20190325-151723
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: i386-randconfig-x013-201912 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All errors (new ones prefixed by >>):

   drivers/tty/serial/8250/8250_lpss.c: In function 'qrk_serial_exit_dma':
>> drivers/tty/serial/8250/8250_lpss.c:207:45: error: invalid type argument of '->' (have 'struct dw_dma_chip')
     pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
                                                ^~
>> drivers/tty/serial/8250/8250_lpss.c:207:14: error: passing argument 1 of 'pci_iounmap' from incompatible pointer type [-Werror=incompatible-pointer-types]
     pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
                 ^~~~~
   In file included from arch/x86/include/asm/io.h:232:0,
                    from arch/x86/include/asm/realmode.h:15,
                    from arch/x86/include/asm/acpi.h:33,
                    from arch/x86/include/asm/fixmap.h:29,
                    from arch/x86/include/asm/apic.h:10,
                    from arch/x86/include/asm/smp.h:13,
                    from include/linux/smp.h:68,
                    from include/linux/topology.h:33,
                    from include/linux/gfp.h:9,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:22,
                    from include/linux/module.h:13,
                    from drivers/tty/serial/8250/8250_lpss.c:10:
   include/asm-generic/iomap.h:107:13: note: expected 'struct pci_dev *' but argument is of type 'struct device *'
    extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
                ^~~~~~~~~~~
   cc1: some warnings being treated as errors

vim +207 drivers/tty/serial/8250/8250_lpss.c

   197	
   198	static void qrk_serial_exit_dma(struct lpss8250 *lpss)
   199	{
   200		struct dw_dma_slave *param = &lpss->dma_param;
   201	
   202		if (!param->dma_dev)
   203			return;
   204	
   205		dw_dma_remove(&lpss->dma_chip);
   206	
 > 207		pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
   208	}
   209	#else	/* CONFIG_SERIAL_8250_DMA */
   210	static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) {}
   211	static void qrk_serial_exit_dma(struct lpss8250 *lpss) {}
   212	#endif	/* !CONFIG_SERIAL_8250_DMA */
   213	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 30377 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar
  2019-03-24 16:41 [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar Aditya Pakki
@ 2019-03-25  8:42   ` kbuild test robot
  2019-03-25  7:50   ` kbuild test robot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2019-03-25  8:42 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: kbuild-all, pakki001, kjlu, Greg Kroah-Hartman, Jiri Slaby,
	Andy Shevchenko, Vinod Koul, linux-serial, linux-kernel

Hi Aditya,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on v5.1-rc2 next-20190325]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Aditya-Pakki/tty-8250-fix-a-missing-check-for-pci_ioremap_bar/20190325-151723
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'


sparse warnings: (new ones prefixed by >>)

>> drivers/tty/serial/8250/8250_lpss.c:207:26: sparse: incorrect type in argument 1 (different base types) @@    expected struct pci_dev *dev @@    got truct pci_dev *dev @@
   drivers/tty/serial/8250/8250_lpss.c:207:26:    expected struct pci_dev *dev
   drivers/tty/serial/8250/8250_lpss.c:207:26:    got struct device *dma_dev
>> drivers/tty/serial/8250/8250_lpss.c:207:52: sparse: cannot dereference this type
>> drivers/tty/serial/8250/8250_lpss.c:207:20: sparse: call with no type!

vim +207 drivers/tty/serial/8250/8250_lpss.c

   197	
   198	static void qrk_serial_exit_dma(struct lpss8250 *lpss)
   199	{
   200		struct dw_dma_slave *param = &lpss->dma_param;
   201	
   202		if (!param->dma_dev)
   203			return;
   204	
   205		dw_dma_remove(&lpss->dma_chip);
   206	
 > 207		pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
   208	}
   209	#else	/* CONFIG_SERIAL_8250_DMA */
   210	static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) {}
   211	static void qrk_serial_exit_dma(struct lpss8250 *lpss) {}
   212	#endif	/* !CONFIG_SERIAL_8250_DMA */
   213	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar
@ 2019-03-25  8:42   ` kbuild test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2019-03-25  8:42 UTC (permalink / raw)
  Cc: kbuild-all, pakki001, kjlu, Greg Kroah-Hartman, Jiri Slaby,
	Andy Shevchenko, Vinod Koul, linux-serial, linux-kernel

Hi Aditya,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on v5.1-rc2 next-20190325]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Aditya-Pakki/tty-8250-fix-a-missing-check-for-pci_ioremap_bar/20190325-151723
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
reproduce:
        # apt-get install sparse
        make ARCH=x86_64 allmodconfig
        make C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__'


sparse warnings: (new ones prefixed by >>)

>> drivers/tty/serial/8250/8250_lpss.c:207:26: sparse: incorrect type in argument 1 (different base types) @@    expected struct pci_dev *dev @@    got truct pci_dev *dev @@
   drivers/tty/serial/8250/8250_lpss.c:207:26:    expected struct pci_dev *dev
   drivers/tty/serial/8250/8250_lpss.c:207:26:    got struct device *dma_dev
>> drivers/tty/serial/8250/8250_lpss.c:207:52: sparse: cannot dereference this type
>> drivers/tty/serial/8250/8250_lpss.c:207:20: sparse: call with no type!

vim +207 drivers/tty/serial/8250/8250_lpss.c

   197	
   198	static void qrk_serial_exit_dma(struct lpss8250 *lpss)
   199	{
   200		struct dw_dma_slave *param = &lpss->dma_param;
   201	
   202		if (!param->dma_dev)
   203			return;
   204	
   205		dw_dma_remove(&lpss->dma_chip);
   206	
 > 207		pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
   208	}
   209	#else	/* CONFIG_SERIAL_8250_DMA */
   210	static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) {}
   211	static void qrk_serial_exit_dma(struct lpss8250 *lpss) {}
   212	#endif	/* !CONFIG_SERIAL_8250_DMA */
   213	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar
  2019-03-24 16:41 [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar Aditya Pakki
@ 2019-03-25  9:13   ` kbuild test robot
  2019-03-25  7:50   ` kbuild test robot
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2019-03-25  9:13 UTC (permalink / raw)
  To: Aditya Pakki
  Cc: kbuild-all, pakki001, kjlu, Greg Kroah-Hartman, Jiri Slaby,
	Andy Shevchenko, Vinod Koul, linux-serial, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2895 bytes --]

Hi Aditya,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on v5.1-rc2 next-20190325]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Aditya-Pakki/tty-8250-fix-a-missing-check-for-pci_ioremap_bar/20190325-151723
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: i386-randconfig-a2-201912 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/tty/serial/8250/8250_lpss.c: In function 'qrk_serial_exit_dma':
   drivers/tty/serial/8250/8250_lpss.c:207:45: error: invalid type argument of '->' (have 'struct dw_dma_chip')
     pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
                                                ^
>> drivers/tty/serial/8250/8250_lpss.c:207:14: warning: passing argument 1 of 'pci_iounmap' from incompatible pointer type
     pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
                 ^
   In file included from arch/x86/include/asm/io.h:232:0,
                    from arch/x86/include/asm/realmode.h:15,
                    from arch/x86/include/asm/acpi.h:33,
                    from arch/x86/include/asm/fixmap.h:29,
                    from arch/x86/include/asm/apic.h:10,
                    from arch/x86/include/asm/smp.h:13,
                    from include/linux/smp.h:68,
                    from include/linux/topology.h:33,
                    from include/linux/gfp.h:9,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:22,
                    from include/linux/module.h:13,
                    from drivers/tty/serial/8250/8250_lpss.c:10:
   include/asm-generic/iomap.h:107:13: note: expected 'struct pci_dev *' but argument is of type 'struct device *'
    extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
                ^

vim +/pci_iounmap +207 drivers/tty/serial/8250/8250_lpss.c

   197	
   198	static void qrk_serial_exit_dma(struct lpss8250 *lpss)
   199	{
   200		struct dw_dma_slave *param = &lpss->dma_param;
   201	
   202		if (!param->dma_dev)
   203			return;
   204	
   205		dw_dma_remove(&lpss->dma_chip);
   206	
 > 207		pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
   208	}
   209	#else	/* CONFIG_SERIAL_8250_DMA */
   210	static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) {}
   211	static void qrk_serial_exit_dma(struct lpss8250 *lpss) {}
   212	#endif	/* !CONFIG_SERIAL_8250_DMA */
   213	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29486 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar
@ 2019-03-25  9:13   ` kbuild test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kbuild test robot @ 2019-03-25  9:13 UTC (permalink / raw)
  Cc: kbuild-all, pakki001, kjlu, Greg Kroah-Hartman, Jiri Slaby,
	Andy Shevchenko, Vinod Koul, linux-serial, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2895 bytes --]

Hi Aditya,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on tty/tty-testing]
[also build test WARNING on v5.1-rc2 next-20190325]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Aditya-Pakki/tty-8250-fix-a-missing-check-for-pci_ioremap_bar/20190325-151723
base:   https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty.git tty-testing
config: i386-randconfig-a2-201912 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
        # save the attached .config to linux build tree
        make ARCH=i386 

All warnings (new ones prefixed by >>):

   drivers/tty/serial/8250/8250_lpss.c: In function 'qrk_serial_exit_dma':
   drivers/tty/serial/8250/8250_lpss.c:207:45: error: invalid type argument of '->' (have 'struct dw_dma_chip')
     pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
                                                ^
>> drivers/tty/serial/8250/8250_lpss.c:207:14: warning: passing argument 1 of 'pci_iounmap' from incompatible pointer type
     pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
                 ^
   In file included from arch/x86/include/asm/io.h:232:0,
                    from arch/x86/include/asm/realmode.h:15,
                    from arch/x86/include/asm/acpi.h:33,
                    from arch/x86/include/asm/fixmap.h:29,
                    from arch/x86/include/asm/apic.h:10,
                    from arch/x86/include/asm/smp.h:13,
                    from include/linux/smp.h:68,
                    from include/linux/topology.h:33,
                    from include/linux/gfp.h:9,
                    from include/linux/umh.h:4,
                    from include/linux/kmod.h:22,
                    from include/linux/module.h:13,
                    from drivers/tty/serial/8250/8250_lpss.c:10:
   include/asm-generic/iomap.h:107:13: note: expected 'struct pci_dev *' but argument is of type 'struct device *'
    extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
                ^

vim +/pci_iounmap +207 drivers/tty/serial/8250/8250_lpss.c

   197	
   198	static void qrk_serial_exit_dma(struct lpss8250 *lpss)
   199	{
   200		struct dw_dma_slave *param = &lpss->dma_param;
   201	
   202		if (!param->dma_dev)
   203			return;
   204	
   205		dw_dma_remove(&lpss->dma_chip);
   206	
 > 207		pci_iounmap(param->dma_dev, &lpss->dma_chip->regs);
   208	}
   209	#else	/* CONFIG_SERIAL_8250_DMA */
   210	static void qrk_serial_setup_dma(struct lpss8250 *lpss, struct uart_port *port) {}
   211	static void qrk_serial_exit_dma(struct lpss8250 *lpss) {}
   212	#endif	/* !CONFIG_SERIAL_8250_DMA */
   213	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 29486 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2019-03-25  9:15 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-24 16:41 [PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar Aditya Pakki
2019-03-24 18:47 ` Andy Shevchenko
2019-03-25  7:50 ` kbuild test robot
2019-03-25  7:50   ` kbuild test robot
2019-03-25  8:42 ` kbuild test robot
2019-03-25  8:42   ` kbuild test robot
2019-03-25  9:13 ` kbuild test robot
2019-03-25  9:13   ` kbuild test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.