SCSI fixes for 6.3-rc2
Subsystems (4)
James Bottomley
maintainerTen patches, eight in drivers and two in the core, which correct a regression from directory removal and add a no VPD size quirk also to fix a regression. All pretty small as you can see from the diffstat.
The patch is available here:
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes
The short changelog is:
Asutosh Das (1):
scsi: ufs: mcq: Use active_reqs to check busy in clock scaling
Bart Van Assche (1):
scsi: core: Fix a procfs host directory removal regression
Lee Duncan (1):
scsi: core: Add BLIST_NO_VPD_SIZE for some VDASD
Tomas Henzl (6):
scsi: mpi3mr: Fix expander node leak in mpi3mr_remove()
scsi: mpi3mr: Fix memory leaks in mpi3mr_init_ioc()
scsi: mpi3mr: Fix sas_hba.phy memory leak in mpi3mr_remove()
scsi: mpi3mr: Fix mpi3mr_hba_port memory leak in mpi3mr_remove()
scsi: mpi3mr: Fix config page DMA memory leak
scsi: mpi3mr: Fix throttle_groups memory leak
Wenchao Hao (1):
scsi: mpt3sas: Fix NULL pointer access in mpt3sas_transport_port_add()
And the diffstat:
drivers/scsi/hosts.c | 3 -- drivers/scsi/mpi3mr/mpi3mr.h | 2 ++ drivers/scsi/mpi3mr/mpi3mr_fw.c | 50 ++++++++++++++++++++------------ drivers/scsi/mpi3mr/mpi3mr_os.c | 24 +++++++++++++++ drivers/scsi/mpi3mr/mpi3mr_transport.c | 5 +--- drivers/scsi/mpt3sas/mpt3sas_transport.c | 14 +++++++-- drivers/scsi/scsi.c | 3 ++ drivers/scsi/scsi_devinfo.c | 3 +- drivers/scsi/scsi_scan.c | 3 ++ drivers/ufs/core/ufshcd.c | 4 +-- include/scsi/scsi_device.h | 2 ++ include/scsi/scsi_devinfo.h | 6 ++-- 12 files changed, 85 insertions(+), 34 deletions(-)
With full diff below.
James
---
drivers/scsi/hosts.c +0 -3
@@ -341,9 +341,6 @@ static void scsi_host_dev_release(struct device *dev)struct Scsi_Host *shost =dev_to_shost (dev);struct device *parent = dev->parent; -/* In case scsi_remove_host() has not been called. */ -scsi_proc_hostdir_rm (shost->hostt); -/* Wait for functions invoked through call_rcu(&scmd->rcu, ...) */ rcu_barrier ();
drivers/scsi/mpi3mr/mpi3mr.h +2 -0
@@ -1393,4 +1393,6 @@ void mpi3mr_flush_drv_cmds(struct mpi3mr_ioc *mrioc);void mpi3mr_flush_cmds_for_unrecovered_controller (struct mpi3mr_ioc *mrioc);void mpi3mr_free_enclosure_list (struct mpi3mr_ioc *mrioc);int mpi3mr_process_admin_reply_q (struct mpi3mr_ioc *mrioc); +void mpi3mr_expander_node_remove (struct mpi3mr_ioc *mrioc, +struct mpi3mr_sas_node *sas_expander);#endif /*MPI3MR_H_INCLUDED*/
drivers/scsi/mpi3mr/mpi3mr_fw.c +31 -19
73 lines not on this page · raw message
drivers/scsi/mpi3mr/mpi3mr_os.c +24 -0
@@ -5078,6 +5078,8 @@ static void mpi3mr_remove(struct pci_dev *pdev)struct workqueue_struct *wq;unsigned long flags;struct mpi3mr_tgt_dev *tgtdev, *tgtdev_next; +struct mpi3mr_hba_port *port, *hba_port_next; +struct mpi3mr_sas_node *sas_expander, *sas_expander_next;if (!shost)return ;
@@ -5117,6 +5119,28 @@ static void mpi3mr_remove(struct pci_dev *pdev)mpi3mr_free_mem (mrioc);mpi3mr_cleanup_resources (mrioc); +spin_lock_irqsave (&mrioc->sas_node_lock, flags); +list_for_each_entry_safe_reverse (sas_expander, sas_expander_next, + &mrioc->sas_expander_list, list) { +spin_unlock_irqrestore (&mrioc->sas_node_lock, flags); +mpi3mr_expander_node_remove (mrioc, sas_expander); +spin_lock_irqsave (&mrioc->sas_node_lock, flags); + } +list_for_each_entry_safe (port, hba_port_next, &mrioc->hba_port_table_list, list) { +ioc_info (mrioc, +"removing hba_port entry: %p port: %d from hba_port list\n" , + port, port->port_id); +list_del (&port->list); +kfree (port); + } +spin_unlock_irqrestore (&mrioc->sas_node_lock, flags); + +if (mrioc->sas_hba.num_phys) { +kfree (mrioc->sas_hba.phy); + mrioc->sas_hba.phy =NULL ; + mrioc->sas_hba.num_phys =0 ; + } +spin_lock (&mrioc_list_lock);list_del (&mrioc->list);spin_unlock (&mrioc_list_lock);
drivers/scsi/mpi3mr/mpi3mr_transport.c +1 -4
@@ -9,9 +9,6 @@#include "mpi3mr.h" -static void mpi3mr_expander_node_remove (struct mpi3mr_ioc *mrioc, -struct mpi3mr_sas_node *sas_expander); -/** * mpi3mr_post_transport_req - Issue transport requests and wait * @mrioc: Adapter instance reference
@@ -2164,7 +2161,7 @@ int mpi3mr_expander_add(struct mpi3mr_ioc *mrioc, u16 handle)* * Return nothing. */ -static void mpi3mr_expander_node_remove (struct mpi3mr_ioc *mrioc, +void mpi3mr_expander_node_remove (struct mpi3mr_ioc *mrioc,struct mpi3mr_sas_node *sas_expander) {struct mpi3mr_sas_port *mr_sas_port, *next;
drivers/scsi/mpt3sas/mpt3sas_transport.c +12 -2
@@ -785,7 +785,7 @@ mpt3sas_transport_port_add(struct MPT3SAS_ADAPTER *ioc, u16 handle, goto out_fail; } port =sas_port_alloc_num (sas_node->parent_dev); -if ((sas_port_add (port))) { +if (!port || (sas_port_add (port))) {ioc_err (ioc,"failure at %s:%d/%s()!\n" , __FILE__, __LINE__, __func__); goto out_fail;
@@ -824,6 +824,12 @@ mpt3sas_transport_port_add(struct MPT3SAS_ADAPTER *ioc, u16 handle, mpt3sas_port->remote_identify.sas_address; } +if (!rphy) { +ioc_err (ioc,"failure at %s:%d/%s()!\n" , + __FILE__, __LINE__, __func__); + goto out_delete_port; + } + rphy->identify = mpt3sas_port->remote_identify;if ((sas_rphy_add (rphy))) {
@@ -831,6 +837,7 @@ mpt3sas_transport_port_add(struct MPT3SAS_ADAPTER *ioc, u16 handle, __FILE__, __LINE__, __func__);sas_rphy_free (rphy); rphy =NULL ; + goto out_delete_port; }if (mpt3sas_port->remote_identify.device_type ==SAS_END_DEVICE ) {
@@ -857,7 +864,10 @@ mpt3sas_transport_port_add(struct MPT3SAS_ADAPTER *ioc, u16 handle, rphy_to_expander_device(rphy), hba_port->port_id);return mpt3sas_port; - out_fail: +out_delete_port: +sas_port_delete (port); + +out_fail:list_for_each_entry_safe (mpt3sas_phy, next, &mpt3sas_port->phy_list, port_siblings)list_del (&mpt3sas_phy->port_siblings);
drivers/scsi/scsi.c +3 -0
@@ -326,6 +326,9 @@ static int scsi_get_vpd_size(struct scsi_device *sdev, u8 page)unsigned char vpd_header[SCSI_VPD_HEADER_SIZE ]__aligned(4) ;int result; +if (sdev->no_vpd_size) +return SCSI_DEFAULT_VPD_LEN ; +/* * Fetch the VPD page header to find out how big the page * is. This is done to prevent problems on legacy devices
drivers/scsi/scsi_devinfo.c +2 -1
@@ -134,7 +134,7 @@ static struct { {"3PARdata", "VV", NULL, BLIST_REPORTLUN2}, {"ADAPTEC", "AACRAID", NULL, BLIST_FORCELUN}, {"ADAPTEC", "Adaptec 5400S", NULL, BLIST_FORCELUN}, - {"AIX", "VDASD", NULL, BLIST_TRY_VPD_PAGES}, + {"AIX", "VDASD", NULL, BLIST_TRY_VPD_PAGES | BLIST_NO_VPD_SIZE}, {"AFT PRO", "-IX CF", "0.0>", BLIST_FORCELUN}, {"BELKIN", "USB 2 HS-CF", "1.95", BLIST_FORCELUN | BLIST_INQUIRY_36}, {"BROWNIE", "1200U3P", NULL, BLIST_NOREPORTLUN},
@@ -188,6 +188,7 @@ static struct { {"HPE", "OPEN-", "*", BLIST_REPORTLUN2 | BLIST_TRY_VPD_PAGES}, {"IBM", "AuSaV1S2", NULL, BLIST_FORCELUN}, {"IBM", "ProFibre 4000R", "*", BLIST_SPARSELUN | BLIST_LARGELUN}, + {"IBM", "2076", NULL, BLIST_NO_VPD_SIZE}, {"IBM", "2105", NULL, BLIST_RETRY_HWERROR}, {"iomega", "jaz 1GB", "J.86", BLIST_NOTQ | BLIST_NOLUN}, {"IOMEGA", "ZIP", NULL, BLIST_NOTQ | BLIST_NOLUN},
drivers/scsi/scsi_scan.c +3 -0
@@ -1057,6 +1057,9 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,else if (*bflags &BLIST_SKIP_VPD_PAGES ) sdev->skip_vpd_pages =1 ; +if (*bflags &BLIST_NO_VPD_SIZE ) + sdev->no_vpd_size =1 ; +transport_configure_device (&sdev->sdev_gendev);if (sdev->host->hostt->slave_configure) {
drivers/ufs/core/ufshcd.c +2 -2
@@ -1500,7 +1500,7 @@ static int ufshcd_devfreq_get_dev_status(struct device *dev, scaling->window_start_t = curr_t; scaling->tot_busy_t =0 ; -if (hba->outstanding_reqs) { +if (scaling->active_reqs) { scaling->busy_start_t = curr_t; scaling->is_busy_started = true; }else {
@@ -2118,7 +2118,7 @@ static void ufshcd_clk_scaling_update_busy(struct ufs_hba *hba)spin_lock_irqsave (hba->host->host_lock, flags); hba->clk_scaling.active_reqs--; -if (!hba->outstanding_reqs && scaling->is_busy_started) { +if (!scaling->active_reqs && scaling->is_busy_started) { scaling->tot_busy_t +=ktime_to_us (ktime_sub (ktime_get (), scaling->busy_start_t)); scaling->busy_start_t =0 ;
include/scsi/scsi_device.h +2 -0
@@ -145,6 +145,7 @@ struct scsi_device {const char * model;/* ... after scan; point to static string */ const char * rev;/* ... "nullnullnullnull" before scan */ +#define SCSI_DEFAULT_VPD_LEN 255/* default SCSI VPD page size (max) */ struct scsi_vpd __rcu *vpd_pg0;struct scsi_vpd __rcu *vpd_pg83;struct scsi_vpd __rcu *vpd_pg80;
@@ -215,6 +216,7 @@ struct scsi_device {* creation time */ unsigned ignore_media_change:1; /* Ignore MEDIA CHANGE on resume */ unsigned silence_suspend:1; /* Do not print runtime PM related messages */ + unsigned no_vpd_size:1; /* No VPD size reported in header */unsigned int queue_stopped;/* request queue is quiesced */ bool offline_already;/* Device offline message logged */
include/scsi/scsi_devinfo.h +3 -3
@@ -32,7 +32,8 @@#define BLIST_IGN_MEDIA_CHANGE ((__force blist_flags_t)(1ULL << 11))/* do not do automatic start on add */ #define BLIST_NOSTARTONADD ((__force blist_flags_t)(1ULL << 12)) -#define __BLIST_UNUSED_13 ((__force blist_flags_t)(1ULL << 13)) +/* do not ask for VPD page size first on some broken targets */ +#define BLIST_NO_VPD_SIZE ((__force blist_flags_t)(1ULL << 13))#define __BLIST_UNUSED_14 ((__force blist_flags_t)(1ULL << 14))#define __BLIST_UNUSED_15 ((__force blist_flags_t)(1ULL << 15))#define __BLIST_UNUSED_16 ((__force blist_flags_t)(1ULL << 16))
@@ -74,8 +75,7 @@#define __BLIST_HIGH_UNUSED (~(__BLIST_LAST_USED | \ (__force blist_flags_t) \ ((__force __u64)__BLIST_LAST_USED - 1ULL))) -#define __BLIST_UNUSED_MASK (__BLIST_UNUSED_13 | \ - __BLIST_UNUSED_14 | \ +#define __BLIST_UNUSED_MASK (__BLIST_UNUSED_14 | \ __BLIST_UNUSED_15 | \ __BLIST_UNUSED_16 | \ __BLIST_UNUSED_24 | \
The pull request you sent on Thu, 16 Mar 2023 22:58:46 -0400:
The pull request you sent on Thu, 16 Mar 2023 22:58:46 -0400:
Quoted 1 line
git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.gitscsi-fixes
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/7622976c8f4f233fac251263e08adee27969abcd
Thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/prtracker.html