scsi: NCR5380: Prepare for enabling lock context analysis

Pass the struct NCR5380_hostdata pointer directly to NCR5380_select()
and NCR5380_information_transfer() instead of the struct Scsi_Host
pointer. This ensures that the lock context annotations
(__releases(&hostdata->lock) and __acquires(&hostdata->lock)) refer to
a function argument. Update callers and function prototypes accordingly.

Cc: Finn Thain <fthain@linux-m68k.org>
Cc: Michael Schmitz <schmitzmic@gmail.com>
Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Acked-by: Finn Thain <fthain@linux-m68k.org>
Link: https://patch.msgid.link/a9d1b960868ac4dae9c5a9b98aea5dcf6713fb97.1790360262.git.bvanassche@acm.org
Signed-off-by: Martin K. Petersen (Oracle) <mkp@kernel.org>
This commit is contained in:
Bart Van Assche 2026-09-25 11:25:44 -07:00 committed by Martin K. Petersen (Oracle)
parent d69fcaa34b
commit a51e9948d1
2 changed files with 13 additions and 11 deletions

View File

@ -718,7 +718,7 @@ static void NCR5380_main(struct work_struct *work)
* entire unit.
*/
if (!NCR5380_select(instance, cmd)) {
if (!NCR5380_select(hostdata, cmd)) {
dsprintk(NDEBUG_MAIN, instance, "main: select complete\n");
} else {
dsprintk(NDEBUG_MAIN | NDEBUG_QUEUES, instance,
@ -728,7 +728,7 @@ static void NCR5380_main(struct work_struct *work)
}
if (hostdata->connected && !hostdata->dma_len) {
dsprintk(NDEBUG_MAIN, instance, "main: performing information transfer\n");
NCR5380_information_transfer(instance);
NCR5380_information_transfer(hostdata);
done = 0;
}
if (!hostdata->connected) {
@ -937,7 +937,7 @@ static irqreturn_t __maybe_unused NCR5380_intr(int irq, void *dev_id)
/**
* NCR5380_select - attempt arbitration and selection for a given command
* @instance: the Scsi_Host instance
* @hostdata: host private data
* @cmd: the scsi_cmnd to execute
*
* This routine establishes an I_T_L nexus for a SCSI command. This involves
@ -960,10 +960,11 @@ static irqreturn_t __maybe_unused NCR5380_intr(int irq, void *dev_id)
* cmd->result host byte set to DID_BAD_TARGET.
*/
static bool NCR5380_select(struct Scsi_Host *instance, struct scsi_cmnd *cmd)
static bool NCR5380_select(struct NCR5380_hostdata *hostdata,
struct scsi_cmnd *cmd)
__releases(&hostdata->lock) __acquires(&hostdata->lock)
{
struct NCR5380_hostdata *hostdata = shost_priv(instance);
struct Scsi_Host *instance = hostdata->host;
unsigned char tmp[3], phase;
unsigned char *data;
int len;
@ -1643,23 +1644,23 @@ static int NCR5380_transfer_dma(struct Scsi_Host *instance,
}
/*
* Function : NCR5380_information_transfer (struct Scsi_Host *instance)
* Function : NCR5380_information_transfer(struct NCR5380_hostdata *hostdata)
*
* Purpose : run through the various SCSI phases and do as the target
* directs us to. Operates on the currently connected command,
* instance->connected.
*
* Inputs : instance, instance for which we are doing commands
* Inputs : hostdata, the private host data
*
* Side effects : SCSI things happen, the disconnected queue will be
* modified if a command disconnects, *instance->connected will
* change.
*/
static void NCR5380_information_transfer(struct Scsi_Host *instance)
static void NCR5380_information_transfer(struct NCR5380_hostdata *hostdata)
__releases(&hostdata->lock) __acquires(&hostdata->lock)
{
struct NCR5380_hostdata *hostdata = shost_priv(instance);
struct Scsi_Host *instance = hostdata->host;
unsigned char msgout = NOP;
int sink = 0;
int len;

View File

@ -278,12 +278,13 @@ static void NCR5380_print(struct Scsi_Host *instance);
static int NCR5380_init(struct Scsi_Host *instance, int flags);
static int NCR5380_maybe_reset_bus(struct Scsi_Host *);
static void NCR5380_exit(struct Scsi_Host *instance);
static void NCR5380_information_transfer(struct Scsi_Host *instance);
static void NCR5380_information_transfer(struct NCR5380_hostdata *hostdata);
static irqreturn_t NCR5380_intr(int irq, void *dev_id);
static void NCR5380_main(struct work_struct *work);
static const char *NCR5380_info(struct Scsi_Host *instance);
static void NCR5380_reselect(struct Scsi_Host *instance);
static bool NCR5380_select(struct Scsi_Host *, struct scsi_cmnd *);
static bool NCR5380_select(struct NCR5380_hostdata *hostdata,
struct scsi_cmnd *);
static int NCR5380_transfer_dma(struct Scsi_Host *instance, unsigned char *phase, int *count, unsigned char **data);
static void NCR5380_transfer_pio(struct Scsi_Host *instance,
unsigned char *phase, int *count,