While accessing a scsi_device, the use count of the underlying LLDD module
is incremented.  The module reference is retrieved through .module field of
struct scsi_host_template.

This mapping between scsi_device and underlying LLDD module works well
except some scsi drivers (ufs and unusual usb storage drivers).  These
drivers consist with core driver and actual LLDDs, and scsi_host_template
is defined in the core driver.  So the actual LLDDs can be unloaded even if
the scsi_device is being accessed.

This patch series first adds ability to adjust module reference for
scsi host by LLDDs and then fixes ufs and unusual usb storage drivers
by adjusting module reference after scsi host allocation.

Akinobu Mita (3):
  scsi: add ability to adjust module reference for scsi host
  scsi: ufs: adjust module reference for scsi host
  usb: storage: adjust module reference for scsi host

 drivers/scsi/hosts.c                | 1 +
 drivers/scsi/scsi.c                 | 4 ++--
 drivers/scsi/ufs/ufshcd-pci.c       | 1 +
 drivers/scsi/ufs/ufshcd-pltfrm.c    | 1 +
 drivers/scsi/ufs/ufshcd.c           | 1 -
 drivers/usb/storage/alauda.c        | 1 +
 drivers/usb/storage/cypress_atacb.c | 2 ++
 drivers/usb/storage/datafab.c       | 1 +
 drivers/usb/storage/ene_ub6250.c    | 1 +
 drivers/usb/storage/freecom.c       | 1 +
 drivers/usb/storage/isd200.c        | 1 +
 drivers/usb/storage/jumpshot.c      | 1 +
 drivers/usb/storage/karma.c         | 1 +
 drivers/usb/storage/onetouch.c      | 2 ++
 drivers/usb/storage/realtek_cr.c    | 2 ++
 drivers/usb/storage/sddr09.c        | 2 ++
 drivers/usb/storage/sddr55.c        | 1 +
 drivers/usb/storage/shuttle_usbat.c | 1 +
 include/scsi/scsi_host.h            | 1 +
 19 files changed, 23 insertions(+), 3 deletions(-)

Cc: Vinayak Holikatti <vinholika...@gmail.com>
Cc: Dolev Raviv <dra...@codeaurora.org>
Cc: Sujit Reddy Thumma <sthu...@codeaurora.org>
Cc: Subhash Jadavani <subha...@codeaurora.org>
Cc: Christoph Hellwig <h...@lst.de>
Cc: "James E.J. Bottomley" <jbottom...@parallels.com>
Cc: Matthew Dharm <mdharm-...@one-eyed-alien.net>
Cc: Greg Kroah-Hartman <gre...@linuxfoundation.org>
Cc: linux-...@vger.kernel.org
Cc: usb-stor...@lists.one-eyed-alien.net
Cc: linux-scsi@vger.kernel.org
-- 
1.9.1

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to