From: Xiang Chen chenxiang66@hisilicon.com
There are some small fixes related to scsi and libsas: - Use void for sas_discover_event() return code; - Remove duplicated setting fro task->task_state_flags; - Remove unused parameter for function sas_ata_eh(); - Use spin_{lock, unlock} instead of spin_{lock, unlock}_irq or spin_lock_irqsave/spin_unlock_irqrestore for asd_sas_port->dev_list_lock and sas_ha->phy_port_lock; - Remove unused member cmd_pool for structure scsi_host_template;
Change Log: v1 -> v2: - Fix some spelling issues; - Remove patch 7 of v1;
Xiang Chen (6): {topost} scsi: libsas: Use void for sas_discover_event() return code {topost} scsi: libsas: Remove duplicated setting for task->task_state_flags {topost} scsi: libsas: Remove unused parameter for function sas_ata_eh() {topost} scsi: libsas: Use spin_{lock, unlock}() for asd_sas_port->dev_list_lock {topost} scsi: libsas: Use spin_{lock, unlock}() for sas_ha->phy_port_lock {topost} scsi: Remove unused member cmd_pool for structure scsi_host_template
drivers/scsi/libsas/sas_ata.c | 8 +++----- drivers/scsi/libsas/sas_discover.c | 26 ++++++++++++-------------- drivers/scsi/libsas/sas_expander.c | 12 ++++++------ drivers/scsi/libsas/sas_port.c | 12 +++++------- drivers/scsi/libsas/sas_scsi_host.c | 12 +++++------- include/scsi/libsas.h | 2 +- include/scsi/sas_ata.h | 6 ++---- include/scsi/scsi_host.h | 3 --- 8 files changed, 34 insertions(+), 47 deletions(-)
From: Xiang Chen chenxiang66@hisilicon.com
The callers of function sas_discover_event() don't check its return value, and also it only returns 0, so use void for its return code.
Signed-off-by: Xiang Chen chenxiang66@hisilicon.com Reviewed-by: John Garry john.garry@huawei.com --- drivers/scsi/libsas/sas_discover.c | 6 ++---- include/scsi/libsas.h | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index 2faa7a372284..eef270a70754 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -556,19 +556,17 @@ static void sas_chain_event(int event, unsigned long *pending, } }
-int sas_discover_event(struct asd_sas_port *port, enum discover_event ev) +void sas_discover_event(struct asd_sas_port *port, enum discover_event ev) { struct sas_discovery *disc;
if (!port) - return 0; + return; disc = &port->disc;
BUG_ON(ev >= DISC_NUM_EVENTS);
sas_chain_event(ev, &disc->pending, &disc->disc_work[ev].work, port->ha); - - return 0; }
/** diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index e2a219a2f748..2105ea0b2633 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -686,7 +686,7 @@ void sas_ex_revalidate_domain(struct domain_device *port_dev, bool *retry);
void sas_unregister_domain_devices(struct asd_sas_port *port, int gone); void sas_init_disc(struct sas_discovery *disc, struct asd_sas_port *); -int sas_discover_event(struct asd_sas_port *, enum discover_event ev); +void sas_discover_event(struct asd_sas_port *, enum discover_event ev);
int sas_discover_sata(struct domain_device *); int sas_discover_end_dev(struct domain_device *);
From: Xiang Chen chenxiang66@hisilicon.com
Task->task_state_flags is already set in function sas_alloc_task(), so remove duplicated setting.
Signed-off-by: Xiang Chen chenxiang66@hisilicon.com Reviewed-by: John Garry john.garry@huawei.com --- drivers/scsi/libsas/sas_ata.c | 1 - 1 file changed, 1 deletion(-)
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 6bd00f3809c0..de18dd988b49 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -209,7 +209,6 @@ static unsigned int sas_ata_qc_issue(struct ata_queued_cmd *qc) } task->scatter = qc->sg; task->ata_task.retry_count = 1; - task->task_state_flags = SAS_TASK_STATE_PENDING; qc->lldd_task = task;
task->ata_task.use_ncq = ata_is_ncq(qc->tf.protocol);
From: Xiang Chen chenxiang66@hisilicon.com
Input parameter work_q is not unused in sas_ata_eh(), so remove it.
Signed-off-by: Xiang Chen chenxiang66@hisilicon.com --- drivers/scsi/libsas/sas_ata.c | 3 +-- drivers/scsi/libsas/sas_scsi_host.c | 2 +- include/scsi/sas_ata.h | 6 ++---- 3 files changed, 4 insertions(+), 7 deletions(-)
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index de18dd988b49..19827a23784e 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -800,8 +800,7 @@ void sas_ata_strategy_handler(struct Scsi_Host *shost) sas_enable_revalidation(sas_ha); }
-void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q, - struct list_head *done_q) +void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q) { struct scsi_cmnd *cmd, *n; struct domain_device *eh_dev; diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 1a2944b4e6cf..99f4e70e9683 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -757,7 +757,7 @@ void sas_scsi_recover_host(struct Scsi_Host *shost) * scsi_unjam_host does, but we skip scsi_eh_abort_cmds because any * command we see here has no sas_task and is thus unknown to the HA. */ - sas_ata_eh(shost, &eh_work_q, &ha->eh_done_q); + sas_ata_eh(shost, &eh_work_q); if (!scsi_eh_get_sense(&eh_work_q, &ha->eh_done_q)) scsi_eh_ready_devs(shost, &eh_work_q, &ha->eh_done_q);
diff --git a/include/scsi/sas_ata.h b/include/scsi/sas_ata.h index 416c9c47d0e7..21e7c10c6295 100644 --- a/include/scsi/sas_ata.h +++ b/include/scsi/sas_ata.h @@ -25,8 +25,7 @@ int sas_get_ata_info(struct domain_device *dev, struct ex_phy *phy); int sas_ata_init(struct domain_device *dev); void sas_ata_task_abort(struct sas_task *task); void sas_ata_strategy_handler(struct Scsi_Host *shost); -void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q, - struct list_head *done_q); +void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q); void sas_ata_schedule_reset(struct domain_device *dev); void sas_ata_wait_eh(struct domain_device *dev); void sas_probe_sata(struct asd_sas_port *port); @@ -52,8 +51,7 @@ static inline void sas_ata_strategy_handler(struct Scsi_Host *shost) { }
-static inline void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q, - struct list_head *done_q) +static inline void sas_ata_eh(struct Scsi_Host *shost, struct list_head *work_q) { }
On 12/01/2022 03:28, chenxiang wrote:
From: Xiang Chenchenxiang66@hisilicon.com
Input parameter work_q is not unused in sas_ata_eh(), so remove it.
Signed-off-by: Xiang Chenchenxiang66@hisilicon.com
Reviewed-by: John Garry john.garry@huawei.com
From: Xiang Chen chenxiang66@hisilicon.com
Spinlock asd_sas_port->dev_list_lock is used when domain_dev is added or removed. But some places use spin_{lock, unlock}() while other places use spin_{lock, unlock}_irq(). Actually all those places are called in process context (workqueue) now, so use spin_{lock, unlock}() instead of spin_{lock, unlock}_irq().
Signed-off-by: Xiang Chen chenxiang66@hisilicon.com --- drivers/scsi/libsas/sas_discover.c | 16 ++++++++-------- drivers/scsi/libsas/sas_expander.c | 12 ++++++------ 2 files changed, 14 insertions(+), 14 deletions(-)
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index eef270a70754..e7d328ec609b 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -152,9 +152,9 @@ static int sas_get_port_device(struct asd_sas_port *port) if (dev_is_sata(dev) || dev->dev_type == SAS_END_DEVICE) list_add_tail(&dev->disco_list_node, &port->disco_list); else { - spin_lock_irq(&port->dev_list_lock); + spin_lock(&port->dev_list_lock); list_add_tail(&dev->dev_list_node, &port->dev_list); - spin_unlock_irq(&port->dev_list_lock); + spin_unlock(&port->dev_list_lock); }
spin_lock(&port->phy_list_lock); @@ -211,9 +211,9 @@ static void sas_probe_devices(struct asd_sas_port *port)
/* devices must be domain members before link recovery and probe */ list_for_each_entry(dev, &port->disco_list, disco_list_node) { - spin_lock_irq(&port->dev_list_lock); + spin_lock(&port->dev_list_lock); list_add_tail(&dev->dev_list_node, &port->dev_list); - spin_unlock_irq(&port->dev_list_lock); + spin_unlock(&port->dev_list_lock); }
sas_probe_sata(port); @@ -321,11 +321,11 @@ static void sas_unregister_common_dev(struct asd_sas_port *port, struct domain_d else list_del_init(&dev->siblings);
- spin_lock_irq(&port->dev_list_lock); + spin_lock(&port->dev_list_lock); list_del_init(&dev->dev_list_node); if (dev_is_sata(dev)) sas_ata_end_eh(dev->sata_dev.ap); - spin_unlock_irq(&port->dev_list_lock); + spin_unlock(&port->dev_list_lock);
spin_lock_irq(&ha->lock); if (dev->dev_type == SAS_END_DEVICE && @@ -473,9 +473,9 @@ static void sas_discover_domain(struct work_struct *work) if (error) { sas_rphy_free(dev->rphy); list_del_init(&dev->disco_list_node); - spin_lock_irq(&port->dev_list_lock); + spin_lock(&port->dev_list_lock); list_del_init(&dev->dev_list_node); - spin_unlock_irq(&port->dev_list_lock); + spin_unlock(&port->dev_list_lock);
sas_put_device(dev); port->port_dev = NULL; diff --git a/drivers/scsi/libsas/sas_expander.c b/drivers/scsi/libsas/sas_expander.c index 6425b9fd99ee..cfc4c6db7593 100644 --- a/drivers/scsi/libsas/sas_expander.c +++ b/drivers/scsi/libsas/sas_expander.c @@ -902,9 +902,9 @@ static struct domain_device *sas_ex_discover_end_dev( out_list_del: sas_rphy_free(child->rphy); list_del(&child->disco_list_node); - spin_lock_irq(&parent->port->dev_list_lock); + spin_lock(&parent->port->dev_list_lock); list_del(&child->dev_list_node); - spin_unlock_irq(&parent->port->dev_list_lock); + spin_unlock(&parent->port->dev_list_lock); out_free: sas_port_delete(phy->port); out_err: @@ -997,16 +997,16 @@ static struct domain_device *sas_ex_discover_expander( sas_fill_in_rphy(child, rphy); sas_rphy_add(rphy);
- spin_lock_irq(&parent->port->dev_list_lock); + spin_lock(&parent->port->dev_list_lock); list_add_tail(&child->dev_list_node, &parent->port->dev_list); - spin_unlock_irq(&parent->port->dev_list_lock); + spin_unlock(&parent->port->dev_list_lock);
res = sas_discover_expander(child); if (res) { sas_rphy_delete(rphy); - spin_lock_irq(&parent->port->dev_list_lock); + spin_lock(&parent->port->dev_list_lock); list_del(&child->dev_list_node); - spin_unlock_irq(&parent->port->dev_list_lock); + spin_unlock(&parent->port->dev_list_lock); sas_put_device(child); sas_port_delete(phy->port); phy->port = NULL;
From: Xiang Chen chenxiang66@hisilicon.com
For spinlock sas_ha->phy_port_lock, some places use spin_{lock,_unlock}_irq() and other places use spin_lock_irqsave() / spin_unlock_irqrestore(). Actually all those places are called in process context (workqueue), so use spin_{lock, unlock}() instead.
Signed-off-by: Xiang Chen chenxiang66@hisilicon.com --- drivers/scsi/libsas/sas_ata.c | 4 ++-- drivers/scsi/libsas/sas_discover.c | 4 ++-- drivers/scsi/libsas/sas_port.c | 12 +++++------- drivers/scsi/libsas/sas_scsi_host.c | 10 ++++------ 4 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/drivers/scsi/libsas/sas_ata.c b/drivers/scsi/libsas/sas_ata.c index 19827a23784e..85d75fd30b63 100644 --- a/drivers/scsi/libsas/sas_ata.c +++ b/drivers/scsi/libsas/sas_ata.c @@ -773,7 +773,7 @@ void sas_ata_strategy_handler(struct Scsi_Host *shost) */ sas_disable_revalidation(sas_ha);
- spin_lock_irq(&sas_ha->phy_port_lock); + spin_lock(&sas_ha->phy_port_lock); for (i = 0; i < sas_ha->num_phys; i++) { struct asd_sas_port *port = sas_ha->sas_port[i]; struct domain_device *dev; @@ -793,7 +793,7 @@ void sas_ata_strategy_handler(struct Scsi_Host *shost) } spin_unlock(&port->dev_list_lock); } - spin_unlock_irq(&sas_ha->phy_port_lock); + spin_unlock(&sas_ha->phy_port_lock);
async_synchronize_full_domain(&async);
diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index e7d328ec609b..b0ae431f766a 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -407,12 +407,12 @@ void sas_device_set_phy(struct domain_device *dev, struct sas_port *port) new_phy = sas_port_get_phy(port);
/* pin and record last seen phy */ - spin_lock_irq(&ha->phy_port_lock); + spin_lock(&ha->phy_port_lock); if (new_phy) { sas_port_put_phy(dev->phy); dev->phy = new_phy; } - spin_unlock_irq(&ha->phy_port_lock); + spin_unlock(&ha->phy_port_lock); }
/* ---------- Discovery and Revalidation ---------- */ diff --git a/drivers/scsi/libsas/sas_port.c b/drivers/scsi/libsas/sas_port.c index 67b429dcf1ff..dc17674034a3 100644 --- a/drivers/scsi/libsas/sas_port.c +++ b/drivers/scsi/libsas/sas_port.c @@ -82,7 +82,6 @@ static void sas_form_port(struct asd_sas_phy *phy) struct domain_device *port_dev; struct sas_internal *si = to_sas_internal(sas_ha->core.shost->transportt); - unsigned long flags;
if (port) { if (!phy_is_wideport_member(port, phy)) @@ -103,7 +102,7 @@ static void sas_form_port(struct asd_sas_phy *phy) }
/* see if the phy should be part of a wide port */ - spin_lock_irqsave(&sas_ha->phy_port_lock, flags); + spin_lock(&sas_ha->phy_port_lock); for (i = 0; i < sas_ha->num_phys; i++) { port = sas_ha->sas_port[i]; spin_lock(&port->phy_list_lock); @@ -133,7 +132,7 @@ static void sas_form_port(struct asd_sas_phy *phy)
if (i >= sas_ha->num_phys) { pr_err("%s: couldn't find a free port, bug?\n", __func__); - spin_unlock_irqrestore(&sas_ha->phy_port_lock, flags); + spin_unlock(&sas_ha->phy_port_lock); return; }
@@ -156,7 +155,7 @@ static void sas_form_port(struct asd_sas_phy *phy) } else port->linkrate = max(port->linkrate, phy->linkrate); spin_unlock(&port->phy_list_lock); - spin_unlock_irqrestore(&sas_ha->phy_port_lock, flags); + spin_unlock(&sas_ha->phy_port_lock);
if (!port->port) { port->port = sas_port_alloc(phy->phy->dev.parent, port->id); @@ -203,7 +202,6 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone) struct sas_internal *si = to_sas_internal(sas_ha->core.shost->transportt); struct domain_device *dev; - unsigned long flags;
if (!port) return; /* done by a phy event */ @@ -225,7 +223,7 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone) if (si->dft->lldd_port_deformed) si->dft->lldd_port_deformed(phy);
- spin_lock_irqsave(&sas_ha->phy_port_lock, flags); + spin_lock(&sas_ha->phy_port_lock); spin_lock(&port->phy_list_lock);
list_del_init(&phy->port_phy_el); @@ -245,7 +243,7 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone) port->phy_mask = 0; } spin_unlock(&port->phy_list_lock); - spin_unlock_irqrestore(&sas_ha->phy_port_lock, flags); + spin_unlock(&sas_ha->phy_port_lock);
/* Only insert revalidate event if the port still has members */ if (port->port && dev && dev_is_expander(dev->dev_type)) { diff --git a/drivers/scsi/libsas/sas_scsi_host.c b/drivers/scsi/libsas/sas_scsi_host.c index 99f4e70e9683..dd9311948dff 100644 --- a/drivers/scsi/libsas/sas_scsi_host.c +++ b/drivers/scsi/libsas/sas_scsi_host.c @@ -372,17 +372,16 @@ struct sas_phy *sas_get_local_phy(struct domain_device *dev) { struct sas_ha_struct *ha = dev->port->ha; struct sas_phy *phy; - unsigned long flags;
/* a published domain device always has a valid phy, it may be * stale, but it is never NULL */ BUG_ON(!dev->phy);
- spin_lock_irqsave(&ha->phy_port_lock, flags); + spin_lock(&ha->phy_port_lock); phy = dev->phy; get_device(&phy->dev); - spin_unlock_irqrestore(&ha->phy_port_lock, flags); + spin_unlock(&ha->phy_port_lock);
return phy; } @@ -802,9 +801,8 @@ struct domain_device *sas_find_dev_by_rphy(struct sas_rphy *rphy) struct sas_ha_struct *ha = SHOST_TO_SAS_HA(shost); struct domain_device *found_dev = NULL; int i; - unsigned long flags;
- spin_lock_irqsave(&ha->phy_port_lock, flags); + spin_lock(&ha->phy_port_lock); for (i = 0; i < ha->num_phys; i++) { struct asd_sas_port *port = ha->sas_port[i]; struct domain_device *dev; @@ -820,7 +818,7 @@ struct domain_device *sas_find_dev_by_rphy(struct sas_rphy *rphy) spin_unlock(&port->dev_list_lock); } found: - spin_unlock_irqrestore(&ha->phy_port_lock, flags); + spin_unlock(&ha->phy_port_lock);
return found_dev; }
From: Xiang Chen chenxiang66@hisilicon.com
The member cmd_pool in structure scsi_host_template is not used, so remove it.
Signed-off-by: Xiang Chen chenxiang66@hisilicon.com --- include/scsi/scsi_host.h | 3 --- 1 file changed, 3 deletions(-)
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index ebe059badba0..21eae43701c0 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -16,7 +16,6 @@ struct completion; struct module; struct scsi_cmnd; struct scsi_device; -struct scsi_host_cmd_pool; struct scsi_target; struct Scsi_Host; struct scsi_transport_template; @@ -493,8 +492,6 @@ struct scsi_host_template { */ u64 vendor_id;
- struct scsi_host_cmd_pool *cmd_pool; - /* Delay for runtime autosuspend */ int rpm_autosuspend_delay; };
On 12/01/2022 03:28, chenxiang wrote:
"... member scsi_host_template.cmd_pool"
is more concise
From: Xiang Chen chenxiang66@hisilicon.com
The member cmd_pool in structure scsi_host_template is not used, so remove it.
As before, it's useful to mention when it was last used, if ever.
Thanks, John
Signed-off-by: Xiang Chen chenxiang66@hisilicon.com
include/scsi/scsi_host.h | 3 --- 1 file changed, 3 deletions(-)
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index ebe059badba0..21eae43701c0 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -16,7 +16,6 @@ struct completion; struct module; struct scsi_cmnd; struct scsi_device; -struct scsi_host_cmd_pool; struct scsi_target; struct Scsi_Host; struct scsi_transport_template; @@ -493,8 +492,6 @@ struct scsi_host_template { */ u64 vendor_id;
- struct scsi_host_cmd_pool *cmd_pool;
- /* Delay for runtime autosuspend */ int rpm_autosuspend_delay; };
在 2022/1/14 1:12, John Garry 写道:
On 12/01/2022 03:28, chenxiang wrote:
"... member scsi_host_template.cmd_pool"
is more concise
ok
From: Xiang Chen chenxiang66@hisilicon.com
The member cmd_pool in structure scsi_host_template is not used, so remove it.
As before, it's useful to mention when it was last used, if ever.
I tried to find when it was last used, but not find. The struct scsi_host_cmd_pool is brought by the commit 89d9a567952b ("[SCSI] add support for per-host cmd pools"), and also add some API of scsi_host_cmd_pool (such as function scsi_{alloc, free, get, put, find}_host_cmd_pool()), but don't find where they are removed.
Thanks, John
Signed-off-by: Xiang Chen chenxiang66@hisilicon.com
include/scsi/scsi_host.h | 3 --- 1 file changed, 3 deletions(-)
diff --git a/include/scsi/scsi_host.h b/include/scsi/scsi_host.h index ebe059badba0..21eae43701c0 100644 --- a/include/scsi/scsi_host.h +++ b/include/scsi/scsi_host.h @@ -16,7 +16,6 @@ struct completion; struct module; struct scsi_cmnd; struct scsi_device; -struct scsi_host_cmd_pool; struct scsi_target; struct Scsi_Host; struct scsi_transport_template; @@ -493,8 +492,6 @@ struct scsi_host_template { */ u64 vendor_id;
- struct scsi_host_cmd_pool *cmd_pool;
};/* Delay for runtime autosuspend */ int rpm_autosuspend_delay;
.
On 14/01/2022 01:07, chenxiang (M) wrote:
As before, it's useful to mention when it was last used, if ever.
I tried to find when it was last used, but not find. The struct scsi_host_cmd_pool is brought by the commit 89d9a567952b ("[SCSI] add support for per-host cmd pools"), and also add some API of scsi_host_cmd_pool (such as function scsi_{alloc, free, get, put, find}_host_cmd_pool()), but don't find where they are removed.
Is it this commit:
commit e9c787e65c0c36529745be47d490d998b4b6e589 (refs/bisect/bad) Author: Christoph Hellwig hch@lst.de Date: Mon Jan 2 21:55:26 2017 +0300
scsi: allocate scsi_cmnd structures as part of struct request
Rely on the new block layer functionality to allocate additional driver specific data behind struct request instead of implementing it in SCSI itѕelf.
Signed-off-by: Christoph Hellwig hch@lst.de Acked-by: Martin K. Petersen martin.petersen@oracle.com Reviewed-by: Hannes Reinecke hare@suse.com Signed-off-by: Jens Axboe axboe@fb.com
Here's my bisect log, based purely on the grep of scsi_host_cmd_pool:
git bisect start # good: [89d9a567952baec13e26ada3e438f1b642d66b6e] [SCSI] add support for per-host cmd pools git bisect good 89d9a567952baec13e26ada3e438f1b642d66b6e # bad: [df0cc57e057f18e44dac8e6c18aba47ab53202f9] Linux 5.16 git bisect bad df0cc57e057f18e44dac8e6c18aba47ab53202f9 # bad: [5bb053bef82523a8fd78d650bca81c9f114fa276] Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next git bisect bad 5bb053bef82523a8fd78d650bca81c9f114fa276 # good: [2c856e14dad8cb1b085ae1f30c5e125c6d46019b] Merge tag 'arm64-perf' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux git bisect good 2c856e14dad8cb1b085ae1f30c5e125c6d46019b # bad: [bd6aaf5535a6782b04e84ea575d65e95d2e7acbc] net: mvpp2: Improve a size determination in two functions git bisect bad bd6aaf5535a6782b04e84ea575d65e95d2e7acbc # good: [41844e36206be90cd4d962ea49b0abc3612a99d0] Merge tag 'staging-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging git bisect good 41844e36206be90cd4d962ea49b0abc3612a99d0 # good: [991688bfc63550b8c7ab9fb1de2feb44e3071d29] Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc git bisect good 991688bfc63550b8c7ab9fb1de2feb44e3071d29 # bad: [b2064617c74f301dab1448f1f9c8dbb3c8021058] Merge tag 'driver-core-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core git bisect bad b2064617c74f301dab1448f1f9c8dbb3c8021058 # good: [828cad8ea05d194d8a9452e0793261c2024c23a2] Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip git bisect good 828cad8ea05d194d8a9452e0793261c2024c23a2 # good: [005c3490e9db23738d91e02788606c0fe4734723] Revert "ath10k: Search SMBIOS for OEM board file extension" git bisect good 005c3490e9db23738d91e02788606c0fe4734723 # bad: [252b95c0edead46fb188042584d3dcd6d6ede062] Merge tag 'for-linus-4.11-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip git bisect bad 252b95c0edead46fb188042584d3dcd6d6ede062 # good: [fd4a61e08aa79f2b7835b25c6f94f27bd2d65990] sched/core: Fix build paravirt build on arm and arm64 git bisect good fd4a61e08aa79f2b7835b25c6f94f27bd2d65990 # bad: [cdc194705d26fdd7fc5446b5d830f2bbe2b22c30] Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi git bisect bad cdc194705d26fdd7fc5446b5d830f2bbe2b22c30 # good: [21c34006dce99949a83e9c46c543af28651db5db] scsi: megaraid_sas: megasas_return_cmd does not memset IO frame to zero git bisect good 21c34006dce99949a83e9c46c543af28651db5db # bad: [a1ae0f74a73fbd113647321c49032a561b3f3781] blk-mq-debug: Avoid that sparse complains about req_flags_t usage git bisect bad a1ae0f74a73fbd113647321c49032a561b3f3781 # good: [99cf1dc580f0766825395aae4f60ec1d8438f011] blk-mq: release driver tag on a requeue event git bisect good 99cf1dc580f0766825395aae4f60ec1d8438f011 # bad: [e9c787e65c0c36529745be47d490d998b4b6e589] scsi: allocate scsi_cmnd structures as part of struct request git bisect bad e9c787e65c0c36529745be47d490d998b4b6e589 # good: [6d247d7f71d1fa4b66a5f4da7b1daa21510d529b] block: allow specifying size for extra command data git bisect good 6d247d7f71d1fa4b66a5f4da7b1daa21510d529b # good: [b78205c93297b821974deaf607bc2efd89842621] scsi_dh_emc: switch to scsi_execute_req_flags() git bisect good b78205c93297b821974deaf607bc2efd89842621 # good: [0a6ac4ee7c21098cb0e41cc4053b9d9ddc9e70a1] scsi: respect unchecked_isa_dma for blk-mq git bisect good 0a6ac4ee7c21098cb0e41cc4053b9d9ddc9e70a1 # good: [d48777a633d6fa7ccde0f0e6509f0c01fbfc5299] scsi: remove __scsi_alloc_queue git bisect good d48777a633d6fa7ccde0f0e6509f0c01fbfc5299 # first bad commit: [e9c787e65c0c36529745be47d490d998b4b6e589] scsi: allocate scsi_cmnd structures as part of struct request
在 2022/1/14 19:38, John Garry 写道:
On 14/01/2022 01:07, chenxiang (M) wrote:
As before, it's useful to mention when it was last used, if ever.
I tried to find when it was last used, but not find. The struct scsi_host_cmd_pool is brought by the commit 89d9a567952b ("[SCSI] add support for per-host cmd pools"), and also add some API of scsi_host_cmd_pool (such as function scsi_{alloc, free, get, put, find}_host_cmd_pool()), but don't find where they are removed.
Is it this commit:
commit e9c787e65c0c36529745be47d490d998b4b6e589 (refs/bisect/bad) Author: Christoph Hellwig hch@lst.de Date: Mon Jan 2 21:55:26 2017 +0300
scsi: allocate scsi_cmnd structures as part of struct request Rely on the new block layer functionality to allocate additional
driver specific data behind struct request instead of implementing it in SCSI itѕelf.
Signed-off-by: Christoph Hellwig <hch@lst.de> Acked-by: Martin K. Petersen <martin.petersen@oracle.com> Reviewed-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Here's my bisect log, based purely on the grep of scsi_host_cmd_pool:
Yes, it seems the patch we need to mention. I also noticed this commit before, but in this patch I found that it removes scsi_host_cmd_pool from the structure Scsi_Host not from structure scsi_host_template while it adds scsi_host_cmd_pool to structure scsi_host_template in commit 89d9a567952b ("[SCSI] add support for per-host cmd pools").
git bisect start # good: [89d9a567952baec13e26ada3e438f1b642d66b6e] [SCSI] add support for per-host cmd pools git bisect good 89d9a567952baec13e26ada3e438f1b642d66b6e # bad: [df0cc57e057f18e44dac8e6c18aba47ab53202f9] Linux 5.16 git bisect bad df0cc57e057f18e44dac8e6c18aba47ab53202f9 # bad: [5bb053bef82523a8fd78d650bca81c9f114fa276] Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-next git bisect bad 5bb053bef82523a8fd78d650bca81c9f114fa276 # good: [2c856e14dad8cb1b085ae1f30c5e125c6d46019b] Merge tag 'arm64-perf' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux git bisect good 2c856e14dad8cb1b085ae1f30c5e125c6d46019b # bad: [bd6aaf5535a6782b04e84ea575d65e95d2e7acbc] net: mvpp2: Improve a size determination in two functions git bisect bad bd6aaf5535a6782b04e84ea575d65e95d2e7acbc # good: [41844e36206be90cd4d962ea49b0abc3612a99d0] Merge tag 'staging-4.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging git bisect good 41844e36206be90cd4d962ea49b0abc3612a99d0 # good: [991688bfc63550b8c7ab9fb1de2feb44e3071d29] Merge tag 'armsoc-drivers' of git://git.kernel.org/pub/scm/linux/kernel/git/arm/arm-soc git bisect good 991688bfc63550b8c7ab9fb1de2feb44e3071d29 # bad: [b2064617c74f301dab1448f1f9c8dbb3c8021058] Merge tag 'driver-core-4.11-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core git bisect bad b2064617c74f301dab1448f1f9c8dbb3c8021058 # good: [828cad8ea05d194d8a9452e0793261c2024c23a2] Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip git bisect good 828cad8ea05d194d8a9452e0793261c2024c23a2 # good: [005c3490e9db23738d91e02788606c0fe4734723] Revert "ath10k: Search SMBIOS for OEM board file extension" git bisect good 005c3490e9db23738d91e02788606c0fe4734723 # bad: [252b95c0edead46fb188042584d3dcd6d6ede062] Merge tag 'for-linus-4.11-rc0-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip git bisect bad 252b95c0edead46fb188042584d3dcd6d6ede062 # good: [fd4a61e08aa79f2b7835b25c6f94f27bd2d65990] sched/core: Fix build paravirt build on arm and arm64 git bisect good fd4a61e08aa79f2b7835b25c6f94f27bd2d65990 # bad: [cdc194705d26fdd7fc5446b5d830f2bbe2b22c30] Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi git bisect bad cdc194705d26fdd7fc5446b5d830f2bbe2b22c30 # good: [21c34006dce99949a83e9c46c543af28651db5db] scsi: megaraid_sas: megasas_return_cmd does not memset IO frame to zero git bisect good 21c34006dce99949a83e9c46c543af28651db5db # bad: [a1ae0f74a73fbd113647321c49032a561b3f3781] blk-mq-debug: Avoid that sparse complains about req_flags_t usage git bisect bad a1ae0f74a73fbd113647321c49032a561b3f3781 # good: [99cf1dc580f0766825395aae4f60ec1d8438f011] blk-mq: release driver tag on a requeue event git bisect good 99cf1dc580f0766825395aae4f60ec1d8438f011 # bad: [e9c787e65c0c36529745be47d490d998b4b6e589] scsi: allocate scsi_cmnd structures as part of struct request git bisect bad e9c787e65c0c36529745be47d490d998b4b6e589 # good: [6d247d7f71d1fa4b66a5f4da7b1daa21510d529b] block: allow specifying size for extra command data git bisect good 6d247d7f71d1fa4b66a5f4da7b1daa21510d529b # good: [b78205c93297b821974deaf607bc2efd89842621] scsi_dh_emc: switch to scsi_execute_req_flags() git bisect good b78205c93297b821974deaf607bc2efd89842621 # good: [0a6ac4ee7c21098cb0e41cc4053b9d9ddc9e70a1] scsi: respect unchecked_isa_dma for blk-mq git bisect good 0a6ac4ee7c21098cb0e41cc4053b9d9ddc9e70a1 # good: [d48777a633d6fa7ccde0f0e6509f0c01fbfc5299] scsi: remove __scsi_alloc_queue git bisect good d48777a633d6fa7ccde0f0e6509f0c01fbfc5299 # first bad commit: [e9c787e65c0c36529745be47d490d998b4b6e589] scsi: allocate scsi_cmnd structures as part of struct request .
On 12/01/2022 03:28, chenxiang wrote:
From: Xiang Chenchenxiang66@hisilicon.com
There are some small fixes related to scsi and libsas:
- Use void for sas_discover_event() return code;
- Remove duplicated setting fro task->task_state_flags;
- Remove unused parameter for function sas_ata_eh();
- Use spin_{lock, unlock} instead of spin_{lock, unlock}_irq or
spin_lock_irqsave/spin_unlock_irqrestore for asd_sas_port->dev_list_lock and sas_ha->phy_port_lock;
- Remove unused member cmd_pool for structure scsi_host_template;
None of these seems like fixes, just saying.
Thanks, John
在 2022/1/14 1:21, John Garry 写道:
On 12/01/2022 03:28, chenxiang wrote:
From: Xiang Chenchenxiang66@hisilicon.com
There are some small fixes related to scsi and libsas:
- Use void for sas_discover_event() return code;
- Remove duplicated setting fro task->task_state_flags;
- Remove unused parameter for function sas_ata_eh();
- Use spin_{lock, unlock} instead of spin_{lock, unlock}_irq or
spin_lock_irqsave/spin_unlock_irqrestore for asd_sas_port->dev_list_lock and sas_ha->phy_port_lock;
- Remove unused member cmd_pool for structure scsi_host_template;
None of these seems like fixes, just saying.
Ok, maybe cleanup is more concise.
Thanks, John .