Skip to contentSkip to conversation

scsi: advansys: Don't call asc_prt_scsi_host() -> scsi_host_busy()

PATCH Applied John Garry 3 participants 4 messages Oct 23, 2025 – Oct 30, 2025

Subsystems (2)
lore
Share & tools
lore

John Garry

author
#0 lore raw

PATCH 1/1 scsi: advansys: Don't call asc_prt_scsi_host() -> scsi_host_busy()

The driver calls asc_prt_scsi_host() -> scsi_host_busy() prior to calling scsi_add_host(). This should not be done, and has raised issues for other drivers, like [0].

Function asc_prt_scsi_host() only has a single callsite, as above, where the shost busy count would always be 0.

Avoid printing the shost busy count to avoid this problem.

[0] https://lore.kernel.org/linux-scsi/[email protected]/

drivers/scsi/advansys.c +1 -2
index 063e1b5818d34..06223b5ee6dae 100644
@@ -2401,8 +2401,7 @@ static void asc_prt_scsi_host(struct Scsi_Host *s)
 	struct asc_board *boardp = shost_priv(s);
 
 	printk("Scsi_Host at addr 0x%p, device %s\n", s, dev_name(boardp->dev));
-	printk(" host_busy %d, host_no %d,\n",
-	       scsi_host_busy(s), s->host_no);
+	printk(" host_no %d,\n", s->host_no);
 
 	printk(" base 0x%lx, io_port 0x%lx, irq %d,\n",
 	       (ulong)s->base, (ulong)s->io_port, boardp->irq);
Signature · 1 line
2.43.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 19 lines · John Garry

The driver calls asc_prt_scsi_host() -> scsi_host_busy() prior to calling scsi_add_host(). This should not be done, and has raised issues for other drivers, like [0].

Function asc_prt_scsi_host() only has a single callsite, as above, where the shost busy count would always be 0.

Avoid printing the shost busy count to avoid this problem.

[0] https://lore.kernel.org/linux-scsi/[email protected]/

drivers/scsi/advansys.c +0 -0
index 063e1b5818d34..06223b5ee6dae 100644

drivers/scsi/advansys.c static void asc_prt_scsi_host(struct Scsi_Host *s) · line 2403

Quoted 3 lines
drivers/scsi/advansys.c +0 -0
@@ -2401,8 +2401,7 @@ static void asc_prt_scsi_host(struct Scsi_Host *s)
  	struct asc_board *boardp = shost_priv(s);
 
  	printk("Scsi_Host at addr 0x%p, device %s\n", s, dev_name(boardp->dev));

Printing the SCSI host address is not useful because pointer mangling is enabled by default.

drivers/scsi/advansys.c static void asc_prt_scsi_host(struct Scsi_Host *s) · line 2407

Quoted 6 lines
drivers/scsi/advansys.c +1 -2
-	printk(" host_busy %d, host_no %d,\n",
-	       scsi_host_busy(s), s->host_no);
+	printk(" host_no %d,\n", s->host_no);
 
  	printk(" base 0x%lx, io_port 0x%lx, irq %d,\n",
  	       (ulong)s->base, (ulong)s->io_port, boardp->irq);

Anyway:

#2 lore raw
In reply to John Garry

John,

Quoted 8 lines

The driver calls asc_prt_scsi_host() -> scsi_host_busy() prior to calling scsi_add_host(). This should not be done, and has raised issues for other drivers, like [0].

Function asc_prt_scsi_host() only has a single callsite, as above, where the shost busy count would always be 0.

Avoid printing the shost busy count to avoid this problem.

Signature · 1 line
Martin K. Petersen
#3 lore raw
In reply to John Garry
Quoted 8 lines · John Garry

The driver calls asc_prt_scsi_host() -> scsi_host_busy() prior to calling scsi_add_host(). This should not be done, and has raised issues for other drivers, like [0].

Function asc_prt_scsi_host() only has a single callsite, as above, where the shost busy count would always be 0.

[...]

Applied to 6.19/scsi-queue, thanks!

[1/1] scsi: advansys: Don't call asc_prt_scsi_host() -> scsi_host_busy()

      https://git.kernel.org/mkp/scsi/c/bb798c1f43c0
Signature · 1 line
Martin K. Petersen