提交 8ad9a301 编写于 作者: A Ahmed S. Darwish 提交者: Zheng Zengkai

scsi: aic94xx: Pass gfp_t flags to libsas event notifiers

mainline inclusion
from mainline-master
commit 111d06ab
category: bugfix
bugzilla: 175270
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=111d06ab77c9f45fc4b8fc8be918b45154dafd44

------------------------------------------------------------------------

Use the new libsas event notifiers API, which requires callers to
explicitly pass the gfp_t memory allocation flags.

Context analysis:

  aic94xx_hwi.c: asd_dl_tasklet_handler()
    -> asd_ascb::tasklet_complete()
    == escb_tasklet_complete()
      -> aic94xx_scb.c: asd_phy_event_tasklet()
      -> aic94xx_scb.c: asd_bytes_dmaed_tasklet()
      -> aic94xx_scb.c: asd_link_reset_err_tasklet()
      -> aic94xx_scb.c: asd_primitive_rcvd_tasklet()

All functions are invoked by escb_tasklet_complete(), which is invoked by
the tasklet handler. Pass GFP_ATOMIC.

Link: https://lore.kernel.org/r/20210118100955.1761652-11-a.darwish@linutronix.deReviewed-by: NJohn Garry <john.garry@huawei.com>
Signed-off-by: NAhmed S. Darwish <a.darwish@linutronix.de>
Signed-off-by: NMartin K. Petersen <martin.petersen@oracle.com>
Reviewed-by: NOuyangdelong <ouyangdelong@huawei.com>
Signed-off-by: NNifujia <nifujia1@hisilicon.com>
Signed-off-by: NZheng Zengkai <zhengzengkai@huawei.com>
上级 2e1f175b
...@@ -80,7 +80,8 @@ static void asd_phy_event_tasklet(struct asd_ascb *ascb, ...@@ -80,7 +80,8 @@ static void asd_phy_event_tasklet(struct asd_ascb *ascb,
ASD_DPRINTK("phy%d: device unplugged\n", phy_id); ASD_DPRINTK("phy%d: device unplugged\n", phy_id);
asd_turn_led(asd_ha, phy_id, 0); asd_turn_led(asd_ha, phy_id, 0);
sas_phy_disconnected(&phy->sas_phy); sas_phy_disconnected(&phy->sas_phy);
sas_notify_phy_event(&phy->sas_phy, PHYE_LOSS_OF_SIGNAL); sas_notify_phy_event_gfp(&phy->sas_phy, PHYE_LOSS_OF_SIGNAL,
GFP_ATOMIC);
break; break;
case CURRENT_OOB_DONE: case CURRENT_OOB_DONE:
/* hot plugged device */ /* hot plugged device */
...@@ -88,12 +89,14 @@ static void asd_phy_event_tasklet(struct asd_ascb *ascb, ...@@ -88,12 +89,14 @@ static void asd_phy_event_tasklet(struct asd_ascb *ascb,
get_lrate_mode(phy, oob_mode); get_lrate_mode(phy, oob_mode);
ASD_DPRINTK("phy%d device plugged: lrate:0x%x, proto:0x%x\n", ASD_DPRINTK("phy%d device plugged: lrate:0x%x, proto:0x%x\n",
phy_id, phy->sas_phy.linkrate, phy->sas_phy.iproto); phy_id, phy->sas_phy.linkrate, phy->sas_phy.iproto);
sas_notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE); sas_notify_phy_event_gfp(&phy->sas_phy, PHYE_OOB_DONE,
GFP_ATOMIC);
break; break;
case CURRENT_SPINUP_HOLD: case CURRENT_SPINUP_HOLD:
/* hot plug SATA, no COMWAKE sent */ /* hot plug SATA, no COMWAKE sent */
asd_turn_led(asd_ha, phy_id, 1); asd_turn_led(asd_ha, phy_id, 1);
sas_notify_phy_event(&phy->sas_phy, PHYE_SPINUP_HOLD); sas_notify_phy_event_gfp(&phy->sas_phy, PHYE_SPINUP_HOLD,
GFP_ATOMIC);
break; break;
case CURRENT_GTO_TIMEOUT: case CURRENT_GTO_TIMEOUT:
case CURRENT_OOB_ERROR: case CURRENT_OOB_ERROR:
...@@ -101,7 +104,8 @@ static void asd_phy_event_tasklet(struct asd_ascb *ascb, ...@@ -101,7 +104,8 @@ static void asd_phy_event_tasklet(struct asd_ascb *ascb,
dl->status_block[1]); dl->status_block[1]);
asd_turn_led(asd_ha, phy_id, 0); asd_turn_led(asd_ha, phy_id, 0);
sas_phy_disconnected(&phy->sas_phy); sas_phy_disconnected(&phy->sas_phy);
sas_notify_phy_event(&phy->sas_phy, PHYE_OOB_ERROR); sas_notify_phy_event_gfp(&phy->sas_phy, PHYE_OOB_ERROR,
GFP_ATOMIC);
break; break;
} }
} }
...@@ -232,7 +236,7 @@ static void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb, ...@@ -232,7 +236,7 @@ static void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb,
spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags); spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags);
asd_dump_frame_rcvd(phy, dl); asd_dump_frame_rcvd(phy, dl);
asd_form_port(ascb->ha, phy); asd_form_port(ascb->ha, phy);
sas_notify_port_event(&phy->sas_phy, PORTE_BYTES_DMAED); sas_notify_port_event_gfp(&phy->sas_phy, PORTE_BYTES_DMAED, GFP_ATOMIC);
} }
static void asd_link_reset_err_tasklet(struct asd_ascb *ascb, static void asd_link_reset_err_tasklet(struct asd_ascb *ascb,
...@@ -268,7 +272,7 @@ static void asd_link_reset_err_tasklet(struct asd_ascb *ascb, ...@@ -268,7 +272,7 @@ static void asd_link_reset_err_tasklet(struct asd_ascb *ascb,
asd_turn_led(asd_ha, phy_id, 0); asd_turn_led(asd_ha, phy_id, 0);
sas_phy_disconnected(sas_phy); sas_phy_disconnected(sas_phy);
asd_deform_port(asd_ha, phy); asd_deform_port(asd_ha, phy);
sas_notify_port_event(sas_phy, PORTE_LINK_RESET_ERR); sas_notify_port_event_gfp(sas_phy, PORTE_LINK_RESET_ERR, GFP_ATOMIC);
if (retries_left == 0) { if (retries_left == 0) {
int num = 1; int num = 1;
...@@ -313,7 +317,8 @@ static void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb, ...@@ -313,7 +317,8 @@ static void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb,
spin_lock_irqsave(&sas_phy->sas_prim_lock, flags); spin_lock_irqsave(&sas_phy->sas_prim_lock, flags);
sas_phy->sas_prim = ffs(cont); sas_phy->sas_prim = ffs(cont);
spin_unlock_irqrestore(&sas_phy->sas_prim_lock, flags); spin_unlock_irqrestore(&sas_phy->sas_prim_lock, flags);
sas_notify_port_event(sas_phy, PORTE_BROADCAST_RCVD); sas_notify_port_event_gfp(sas_phy, PORTE_BROADCAST_RCVD,
GFP_ATOMIC);
break; break;
case LmUNKNOWNP: case LmUNKNOWNP:
...@@ -334,7 +339,8 @@ static void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb, ...@@ -334,7 +339,8 @@ static void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb,
/* The sequencer disables all phys on that port. /* The sequencer disables all phys on that port.
* We have to re-enable the phys ourselves. */ * We have to re-enable the phys ourselves. */
asd_deform_port(asd_ha, phy); asd_deform_port(asd_ha, phy);
sas_notify_port_event(sas_phy, PORTE_HARD_RESET); sas_notify_port_event_gfp(sas_phy, PORTE_HARD_RESET,
GFP_ATOMIC);
break; break;
default: default:
...@@ -565,7 +571,8 @@ static void escb_tasklet_complete(struct asd_ascb *ascb, ...@@ -565,7 +571,8 @@ static void escb_tasklet_complete(struct asd_ascb *ascb,
/* the device is gone */ /* the device is gone */
sas_phy_disconnected(sas_phy); sas_phy_disconnected(sas_phy);
asd_deform_port(asd_ha, phy); asd_deform_port(asd_ha, phy);
sas_notify_port_event(sas_phy, PORTE_TIMER_EVENT); sas_notify_port_event_gfp(sas_phy, PORTE_TIMER_EVENT,
GFP_ATOMIC);
break; break;
default: default:
ASD_DPRINTK("%s: phy%d: unknown event:0x%x\n", __func__, ASD_DPRINTK("%s: phy%d: unknown event:0x%x\n", __func__,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册