Skip to content

Commit 85eb043

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Three small driver fixes and one larger unused function set removal in the raid class (so no external impact)" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: snic: Fix double free in snic_tgt_create() scsi: core: raid_class: Remove raid_component_add() scsi: ufs: ufs-qcom: Clear qunipro_g4_sel for HW major version > 5 scsi: ufs: mcq: Fix the search/wrap around logic
2 parents 28f20a1 + 1bd3a76 commit 85eb043

File tree

5 files changed

+6
-57
lines changed

5 files changed

+6
-57
lines changed

drivers/scsi/raid_class.c

Lines changed: 0 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -209,54 +209,6 @@ raid_attr_ro_state(level);
209209
raid_attr_ro_fn(resync);
210210
raid_attr_ro_state_fn(state);
211211

212-
static void raid_component_release(struct device *dev)
213-
{
214-
struct raid_component *rc =
215-
container_of(dev, struct raid_component, dev);
216-
dev_printk(KERN_ERR, rc->dev.parent, "COMPONENT RELEASE\n");
217-
put_device(rc->dev.parent);
218-
kfree(rc);
219-
}
220-
221-
int raid_component_add(struct raid_template *r,struct device *raid_dev,
222-
struct device *component_dev)
223-
{
224-
struct device *cdev =
225-
attribute_container_find_class_device(&r->raid_attrs.ac,
226-
raid_dev);
227-
struct raid_component *rc;
228-
struct raid_data *rd = dev_get_drvdata(cdev);
229-
int err;
230-
231-
rc = kzalloc(sizeof(*rc), GFP_KERNEL);
232-
if (!rc)
233-
return -ENOMEM;
234-
235-
INIT_LIST_HEAD(&rc->node);
236-
device_initialize(&rc->dev);
237-
rc->dev.release = raid_component_release;
238-
rc->dev.parent = get_device(component_dev);
239-
rc->num = rd->component_count++;
240-
241-
dev_set_name(&rc->dev, "component-%d", rc->num);
242-
list_add_tail(&rc->node, &rd->component_list);
243-
rc->dev.class = &raid_class.class;
244-
err = device_add(&rc->dev);
245-
if (err)
246-
goto err_out;
247-
248-
return 0;
249-
250-
err_out:
251-
put_device(&rc->dev);
252-
list_del(&rc->node);
253-
rd->component_count--;
254-
put_device(component_dev);
255-
kfree(rc);
256-
return err;
257-
}
258-
EXPORT_SYMBOL(raid_component_add);
259-
260212
struct raid_template *
261213
raid_class_attach(struct raid_function_template *ft)
262214
{

drivers/scsi/snic/snic_disc.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,12 +303,11 @@ snic_tgt_create(struct snic *snic, struct snic_tgt_id *tgtid)
303303
"Snic Tgt: device_add, with err = %d\n",
304304
ret);
305305

306-
put_device(&tgt->dev);
307306
put_device(&snic->shost->shost_gendev);
308307
spin_lock_irqsave(snic->shost->host_lock, flags);
309308
list_del(&tgt->list);
310309
spin_unlock_irqrestore(snic->shost->host_lock, flags);
311-
kfree(tgt);
310+
put_device(&tgt->dev);
312311
tgt = NULL;
313312

314313
return tgt;

drivers/ufs/core/ufs-mcq.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -580,7 +580,6 @@ static bool ufshcd_mcq_sqe_search(struct ufs_hba *hba,
580580
{
581581
struct ufshcd_lrb *lrbp = &hba->lrb[task_tag];
582582
struct utp_transfer_req_desc *utrd;
583-
u32 mask = hwq->max_entries - 1;
584583
__le64 cmd_desc_base_addr;
585584
bool ret = false;
586585
u64 addr, match;
@@ -608,7 +607,10 @@ static bool ufshcd_mcq_sqe_search(struct ufs_hba *hba,
608607
ret = true;
609608
goto out;
610609
}
611-
sq_head_slot = (sq_head_slot + 1) & mask;
610+
611+
sq_head_slot++;
612+
if (sq_head_slot == hwq->max_entries)
613+
sq_head_slot = 0;
612614
}
613615

614616
out:

drivers/ufs/host/ufs-qcom.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -321,7 +321,7 @@ static void ufs_qcom_select_unipro_mode(struct ufs_qcom_host *host)
321321
ufs_qcom_cap_qunipro(host) ? QUNIPRO_SEL : 0,
322322
REG_UFS_CFG1);
323323

324-
if (host->hw_ver.major == 0x05)
324+
if (host->hw_ver.major >= 0x05)
325325
ufshcd_rmwl(host->hba, QUNIPRO_G4_SEL, 0, REG_UFS_CFG0);
326326

327327
/* make sure above configuration is applied before we return */

include/linux/raid_class.h

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,3 @@ DEFINE_RAID_ATTRIBUTE(enum raid_state, state)
7777

7878
struct raid_template *raid_class_attach(struct raid_function_template *);
7979
void raid_class_release(struct raid_template *);
80-
81-
int __must_check raid_component_add(struct raid_template *, struct device *,
82-
struct device *);
83-

0 commit comments

Comments
 (0)