Skip to contentSkip to conversation

scsi: ppa: Fix compilation with PPA_DEBUG=1

PATCH Applied Alex Henrie 2 participants 5 messages Aug 7, 2023 – Aug 31, 2023 SCSI

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 scsi: ppa: Fix compilation with PPA_DEBUG=1

Fix a regression introduced in February 2003 in Linux 2.5.61 by a patch from Alan Cox titled "fix ppa for new scsi".[1]

---
 drivers/scsi/ppa.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ppa.c +1 -1
index 909c49541984..d1f6aa256eba 100644
@@ -637,7 +637,7 @@ static void ppa_interrupt(struct work_struct *work)
 	case DID_OK:
 		break;
 	case DID_NO_CONNECT:
-		printk(KERN_DEBUG "ppa: no device at SCSI ID %i\n", cmd->device->target);
+		printk(KERN_DEBUG "ppa: no device at SCSI ID %i\n", scmd_id(cmd));
 		break;
 	case DID_BUS_BUSY:
 		printk(KERN_DEBUG "ppa: BUS BUSY - EPP timeout detected\n");
Signature · 1 line
2.41.0
#1 lore raw

PATCH 2/2 scsi: ppa: Add a module parameter for the transfer mode

I have an Iomega Z100P2 zip drive, but it does not work with my StarTech PEX1P2 AX99100 PCIe parallel port, which evidently does not support 16-bit or 32-bit EPP. Currently the only way to tell the PPA driver to use 8-bit EPP is to write 'mode=3' to /proc/scsi/ppa/*, but the driver doesn't actually distinguish between the three EPP modes and still tries to use 16-bit or 32-bit EPP. And even if writing to that file did make the driver use 8-bit EPP, it still wouldn't do me any good because by the time that file exists, the drive has already failed to initialize.

Add a new parameter /sys/module/ppa/mode to set the transfer mode before initializing the drive. This parameter replaces the use of CONFIG_SCSI_IZIP_EPP16 in the PPA driver.

At the same time, default to 8-bit EPP. 16-bit and 32-bit EPP are not necessary for the drive to function, nor are they part of the IEEE 1284 standard, so the driver should not assume that they are available.

---
 drivers/scsi/Kconfig |  2 +-
 drivers/scsi/ppa.c   | 82 +++++++++++++++++++++++---------------------
 drivers/scsi/ppa.h   |  4 ---
 3 files changed, 43 insertions(+), 45 deletions(-)
drivers/scsi/Kconfig +1 -1
index 4962ce989113..695a57d894cd 100644
@@ -836,7 +836,7 @@ config SCSI_IMM
 
 config SCSI_IZIP_EPP16
 	bool "ppa/imm option - Use slow (but safe) EPP-16"
-	depends on SCSI_PPA || SCSI_IMM
+	depends on SCSI_IMM
 	help
 	  EPP (Enhanced Parallel Port) is a standard for parallel ports which
 	  allows them to act as expansion buses that can handle up to 64
drivers/scsi/ppa.c +42 -40

162 lines not on this page · raw message

drivers/scsi/ppa.h +0 -4
index 6a1f8a2d70eb..098bcf7b9eb4 100644
@@ -107,11 +107,7 @@ static char *PPA_MODE_STRING[] =
     "PS/2",
     "EPP 8 bit",
     "EPP 16 bit",
-#ifdef CONFIG_SCSI_IZIP_EPP16
-    "EPP 16 bit",
-#else
     "EPP 32 bit",
-#endif
     "Unknown"};
 
 /* other options */
Signature · 1 line
2.41.0
#2 lore raw

Re: [PATCH 2/2] scsi: ppa: Add a module parameter for the transfer mode

Quoted 2 lines · Alex Henrie

Add a new parameter /sys/module/ppa/mode to set the transfer mode before initializing the drive.

Just noticed another typo: The file is /sys/module/ppa/parameters/mode (I left out the parameters directory). Hopefully that doesn't confuse anyone too much.

-Alex

#3 lore raw
In reply to Alex Henrie

Alex,

Quoted 2 lines

Fix a regression introduced in February 2003 in Linux 2.5.61 by a patch from Alan Cox titled "fix ppa for new scsi".[1]

Applied patches 1+2 to 6.6/scsi-staging, thanks!

Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering
#4 lore raw
In reply to Alex Henrie
Quoted 4 lines · Alex Henrie

Fix a regression introduced in February 2003 in Linux 2.5.61 by a patch from Alan Cox titled "fix ppa for new scsi".[1]

Applied to 6.6/scsi-queue, thanks!

[1/2] scsi: ppa: Fix compilation with PPA_DEBUG=1

      https://git.kernel.org/mkp/scsi/c/b68442ebda9c
[2/2] scsi: ppa: Add a module parameter for the transfer mode
      https://git.kernel.org/mkp/scsi/c/68a4f84a17c1
Signature · 1 line
Martin K. Petersen	Oracle Linux Engineering