mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] SPARC: Fix parport_pc support for 32-bit platforms
@ 2023-06-18 23:00 Maciej W. Rozycki
  2023-06-18 23:19 ` Randy Dunlap
  0 siblings, 1 reply; 3+ messages in thread
From: Maciej W. Rozycki @ 2023-06-18 23:00 UTC (permalink / raw)
  To: David S. Miller
  Cc: Randy Dunlap, Sudip Mukherjee, Sam Ravnborg, sparclinux,
	linux-parport, linux-kernel

For 32-bit SPARC platforms PC-style parallel ports are only available as 
PCI options.  Adjust <asm/parport.h> accordingly, fixing build errors:

sparc-linux-gnu-ld: drivers/parport/parport_pc.o: in function `ecpp_remove':
parport_pc.c:(.text+0x8f0): undefined reference to `ebus_dma_irq_enable'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x8f8): undefined reference to `ebus_dma_unregister'
sparc-linux-gnu-ld: drivers/parport/parport_pc.o: in function `parport_pc_fifo_write_block_dma':
parport_pc.c:(.text+0x1430): undefined reference to `ebus_dma_enable'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x1444): undefined reference to `ebus_dma_prepare'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x14e4): undefined reference to `ebus_dma_enable'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x14f4): undefined reference to `ebus_dma_request'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x1584): undefined reference to `ebus_dma_enable'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x1594): undefined reference to `ebus_dma_residue'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x1608): undefined reference to `ebus_dma_enable'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x1618): undefined reference to `ebus_dma_residue'
sparc-linux-gnu-ld: drivers/parport/parport_pc.o: in function `ecpp_probe':
parport_pc.c:(.text+0x33a0): undefined reference to `ebus_dma_register'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x33b8): undefined reference to `ebus_dma_irq_enable'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x34b0): undefined reference to `ebus_dma_irq_enable'
sparc-linux-gnu-ld: parport_pc.c:(.text+0x34bc): undefined reference to `ebus_dma_unregister'

Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
Fixes: 66bcd06099bb ("parport_pc: Also enable driver for PCI systems")
Cc: stable@vger.kernel.org # v5.18+
---
 arch/sparc/include/asm/parport.h |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

linux-sparc32-parport-pc.diff
Index: linux-macro/arch/sparc/include/asm/parport.h
===================================================================
--- linux-macro.orig/arch/sparc/include/asm/parport.h
+++ linux-macro/arch/sparc/include/asm/parport.h
@@ -19,7 +19,9 @@
  * While sparc64 doesn't have an ISA DMA API, we provide something that looks
  * close enough to make parport_pc happy
  */
+#ifdef CONFIG_SPARC64
 #define HAS_DMA
+#endif
 
 #ifdef CONFIG_PARPORT_PC_FIFO
 static DEFINE_SPINLOCK(dma_spin_lock);
@@ -249,7 +251,8 @@ static struct platform_driver ecpp_drive
 
 static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
 {
-	return platform_driver_register(&ecpp_driver);
+	return (IS_ENABLED(CONFIG_SPARC64) &&
+		platform_driver_register(&ecpp_driver));
 }
 
 #endif /* !(_ASM_SPARC64_PARPORT_H */

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

* Re: [PATCH] SPARC: Fix parport_pc support for 32-bit platforms
  2023-06-18 23:00 [PATCH] SPARC: Fix parport_pc support for 32-bit platforms Maciej W. Rozycki
@ 2023-06-18 23:19 ` Randy Dunlap
  2023-06-18 23:45   ` Maciej W. Rozycki
  0 siblings, 1 reply; 3+ messages in thread
From: Randy Dunlap @ 2023-06-18 23:19 UTC (permalink / raw)
  To: Maciej W. Rozycki, David S. Miller
  Cc: Sudip Mukherjee, Sam Ravnborg, sparclinux, linux-parport, linux-kernel

Hi--

On 6/18/23 16:00, Maciej W. Rozycki wrote:
> For 32-bit SPARC platforms PC-style parallel ports are only available as 
> PCI options.  Adjust <asm/parport.h> accordingly, fixing build errors:
> 
> sparc-linux-gnu-ld: drivers/parport/parport_pc.o: in function `ecpp_remove':
> parport_pc.c:(.text+0x8f0): undefined reference to `ebus_dma_irq_enable'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x8f8): undefined reference to `ebus_dma_unregister'
> sparc-linux-gnu-ld: drivers/parport/parport_pc.o: in function `parport_pc_fifo_write_block_dma':
> parport_pc.c:(.text+0x1430): undefined reference to `ebus_dma_enable'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x1444): undefined reference to `ebus_dma_prepare'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x14e4): undefined reference to `ebus_dma_enable'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x14f4): undefined reference to `ebus_dma_request'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x1584): undefined reference to `ebus_dma_enable'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x1594): undefined reference to `ebus_dma_residue'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x1608): undefined reference to `ebus_dma_enable'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x1618): undefined reference to `ebus_dma_residue'
> sparc-linux-gnu-ld: drivers/parport/parport_pc.o: in function `ecpp_probe':
> parport_pc.c:(.text+0x33a0): undefined reference to `ebus_dma_register'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x33b8): undefined reference to `ebus_dma_irq_enable'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x34b0): undefined reference to `ebus_dma_irq_enable'
> sparc-linux-gnu-ld: parport_pc.c:(.text+0x34bc): undefined reference to `ebus_dma_unregister'
> 
> Signed-off-by: Maciej W. Rozycki <macro@orcam.me.uk>
> Fixes: 66bcd06099bb ("parport_pc: Also enable driver for PCI systems")
> Cc: stable@vger.kernel.org # v5.18+

Yes, this fixes the build errors. Thanks for the patch.

There is one new warning that should be fixed as well:

<stdin>:1519:2: warning: #warning syscall clone3 not implemented [-Wcpp]
In file included from ../include/linux/spinlock.h:88,
                 from ../include/linux/kref.h:16,
                 from ../include/linux/mm_types.h:8,
                 from ../include/linux/buildid.h:5,
                 from ../include/linux/module.h:14,
                 from ../drivers/parport/parport_pc.c:46:
../arch/sparc/include/asm/parport.h:27:24: warning: 'dma_spin_lock' defined but not used [-Wunused-variable]
   27 | static DEFINE_SPINLOCK(dma_spin_lock);
      |                        ^~~~~~~~~~~~~
../include/linux/spinlock_types.h:43:44: note: in definition of macro 'DEFINE_SPINLOCK'
   43 | #define DEFINE_SPINLOCK(x)      spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
      |                                            ^


> ---
>  arch/sparc/include/asm/parport.h |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> linux-sparc32-parport-pc.diff
> Index: linux-macro/arch/sparc/include/asm/parport.h
> ===================================================================
> --- linux-macro.orig/arch/sparc/include/asm/parport.h
> +++ linux-macro/arch/sparc/include/asm/parport.h
> @@ -19,7 +19,9 @@
>   * While sparc64 doesn't have an ISA DMA API, we provide something that looks
>   * close enough to make parport_pc happy
>   */
> +#ifdef CONFIG_SPARC64
>  #define HAS_DMA
> +#endif
>  
>  #ifdef CONFIG_PARPORT_PC_FIFO
>  static DEFINE_SPINLOCK(dma_spin_lock);
> @@ -249,7 +251,8 @@ static struct platform_driver ecpp_drive
>  
>  static int parport_pc_find_nonpci_ports(int autoirq, int autodma)
>  {
> -	return platform_driver_register(&ecpp_driver);
> +	return (IS_ENABLED(CONFIG_SPARC64) &&
> +		platform_driver_register(&ecpp_driver));
>  }
>  
>  #endif /* !(_ASM_SPARC64_PARPORT_H */

-- 
~Randy

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

* Re: [PATCH] SPARC: Fix parport_pc support for 32-bit platforms
  2023-06-18 23:19 ` Randy Dunlap
@ 2023-06-18 23:45   ` Maciej W. Rozycki
  0 siblings, 0 replies; 3+ messages in thread
From: Maciej W. Rozycki @ 2023-06-18 23:45 UTC (permalink / raw)
  To: Randy Dunlap
  Cc: David S. Miller, Sudip Mukherjee, Sam Ravnborg, sparclinux,
	linux-parport, linux-kernel

On Sun, 18 Jun 2023, Randy Dunlap wrote:

> There is one new warning that should be fixed as well:
> 
> <stdin>:1519:2: warning: #warning syscall clone3 not implemented [-Wcpp]
> In file included from ../include/linux/spinlock.h:88,
>                  from ../include/linux/kref.h:16,
>                  from ../include/linux/mm_types.h:8,
>                  from ../include/linux/buildid.h:5,
>                  from ../include/linux/module.h:14,
>                  from ../drivers/parport/parport_pc.c:46:
> ../arch/sparc/include/asm/parport.h:27:24: warning: 'dma_spin_lock' defined but not used [-Wunused-variable]
>    27 | static DEFINE_SPINLOCK(dma_spin_lock);
>       |                        ^~~~~~~~~~~~~
> ../include/linux/spinlock_types.h:43:44: note: in definition of macro 'DEFINE_SPINLOCK'
>    43 | #define DEFINE_SPINLOCK(x)      spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
>       |                                            ^

 Ah, that's because `sparc32_defconfig' doesn't have CONFIG_WERROR enabled 
and I didn't double-check.  Thanks for your input.  I'll send v2 shortly.

  Maciej

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

end of thread, other threads:[~2023-06-18 23:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-18 23:00 [PATCH] SPARC: Fix parport_pc support for 32-bit platforms Maciej W. Rozycki
2023-06-18 23:19 ` Randy Dunlap
2023-06-18 23:45   ` Maciej W. Rozycki

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®