Hannes Reinecke wrote:Argl. You are correct. New patch attached.If a driver sets blk_queue_prep_rq() it should clean up itself
and not rely on the bus callbacks to handle this. This removes
the need to hook into bus->remove() as these should not be used
at the same time as driver->remove().
Signed-off-by: Hannes Reinecke <hare@xxxxxxx>
Signed-off-by: Kay Sievers <kay.sievers@xxxxxxxx>
I spoke too soon please see below
---
drivers/scsi/scsi_lib.c | 6 ++++++
drivers/scsi/scsi_sysfs.c | 17 -----------------
drivers/scsi/sd.c | 2 ++
drivers/scsi/sr.c | 1 +
include/scsi/scsi_driver.h | 1 +
5 files changed, 10 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/scsi_lib.c b/drivers/scsi/scsi_lib.c
index 4b13e36..73df41b 100644
--- a/drivers/scsi/scsi_lib.c
+++ b/drivers/scsi/scsi_lib.c
@@ -1222,6 +1222,12 @@ int scsi_prep_fn(struct request_queue *q, struct request *req)
return scsi_prep_return(q, req, ret);
}
+void scsi_reset_prep_fn(struct request_queue *q)
Here it is declared void
but
diff --git a/include/scsi/scsi_driver.h b/include/scsi/scsi_driver.h
index 1f5ca7f..2e22929 100644
--- a/include/scsi/scsi_driver.h
+++ b/include/scsi/scsi_driver.h
@@ -32,5 +32,6 @@ int scsi_setup_blk_pc_cmnd(struct scsi_device *sdev, struct request *req);
int scsi_setup_fs_cmnd(struct scsi_device *sdev, struct request *req);
int scsi_prep_state_check(struct scsi_device *sdev, struct request *req);
int scsi_prep_return(struct request_queue *q, struct request *req, int ret);
+int scsi_reset_prep_fn(struct request_queue *);
Here it is returning int.
My FC10 compiler does not like that:
drivers/scsi/scsi_lib.c:1415: error: conflicting types for 'scsi_reset_prep_fn'
include/scsi/scsi_driver.h:35: error: previous declaration of 'scsi_reset_prep_fn' was here
#endif /* _SCSI_SCSI_DRIVER_H */
I fixed it to be void, will test later