Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp2279923pxb; Mon, 18 Jan 2021 13:17:42 -0800 (PST) X-Google-Smtp-Source: ABdhPJxSzKvvFRqrYMJ0BhcJDTT3Z/ESFQtV6/KZFSw+/T2BaWI7GnaWxLvYitHsDAD/rmxw58vs X-Received: by 2002:aa7:dd16:: with SMTP id i22mr973057edv.215.1611004662123; Mon, 18 Jan 2021 13:17:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1611004662; cv=none; d=google.com; s=arc-20160816; b=GnrAJW+EybCtpykhhSeB9LIr5z3XUxS/rp2daXihRmFE9ajMTXZ5CwgBnk/3WFIhPJ Do2LHcFar/wODSvn0xPuZ/ypARfQwtljFKe81wDNBlJT8R1AMo/0wwG+LD7A0vxGUuB4 sHom7RvFvSHXNZpw9UxHvPlscx3Bw3+7mLyNrol/RngGzQ+4ytaqC2y4yRASs7zmFp+b EAaNc5Nm1bK1gL57k4JpovIVyEMyIRsSF9KPVgKsM/n8BQOiQjHozABseZ6OqUpFY3ju WEr2ArxWKfsR/3lQ2SVnnLcj99q4tRrkwpY363GahdjbN6cYe9lhwPKSPbXU6zeCpX99 YMRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:dkim-signature :dkim-signature:from; bh=iM+RgOikwGYn7inLq65ouZEt13gCzx3kP4vu3Puyl6c=; b=qOjHi6hbQ5UKoCpYKqxJzi4TTxmeGQ3aSK5hMyU/GFi0XKmFbRltCA+8h+qR+JLfBS 8Cxvv85+VX4ESLW88a7Ld+VgAGq4ceUMeR+DRd9H9S8+In+/bXho3D2xiOT52qClEakb fdnPLR+DXGZ1Q4HLnyj4ew1aPcAxUCJlZD6PIFqKtPDV1Gh/OpkS6qCD7I/4RjAjG9dy LqOD453hvPrXTxGXng+lxytbG0afoRxIKtrctijcGhZIC9I79MORL2cJGqO2HNhKnNb8 ztGliVl+m6rnltYP4WHyMXDGe+hbzrvDNY6c2cU7WokDVdhYgGuAE4ODO68+n0ym9s7a 8eyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Lz9lt2eX; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id gs8si7154036ejc.79.2021.01.18.13.17.17; Mon, 18 Jan 2021 13:17:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Lz9lt2eX; dkim=neutral (no key) header.i=@linutronix.de; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394544AbhARVPC (ORCPT + 99 others); Mon, 18 Jan 2021 16:15:02 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:55208 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389246AbhARKN2 (ORCPT ); Mon, 18 Jan 2021 05:13:28 -0500 From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1610964655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iM+RgOikwGYn7inLq65ouZEt13gCzx3kP4vu3Puyl6c=; b=Lz9lt2eXy+VIElxgJszHBwNiQlaShSREtKo1+DNn42TXJcYa79ySOgG0e0fOU8hWmwKrs+ GcVsc57skKuUlCWAeHDs9YBWJqwv91OrQ3F/NypCa/a0Fo8cl/NAQgo9ps4P1elcFwPmQn rW7L1dNaze/qI+9H9/y9/OEX9JPf3Sf8ghwKPMA3Ujaw7vE15/aRilMXCqMIiR+p8t4Vwc lmcESjGkWSaziiiz8bTURxH/OGm2P1TxBuQCPAiNwkRgtGHp0iS5sNMD5dv94gb2QUXoRk W4meF+qWjuA3mhuhJ9hdQ5W7GmucaIjoxXHYRpfHhLwOWufW3To/f6GGx5IosQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1610964655; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iM+RgOikwGYn7inLq65ouZEt13gCzx3kP4vu3Puyl6c=; b=4lTLgNF5kRzS+J50a3eLGP25dLR9u1cFMsT/ErpL01JYtfgFsKSmKQHFmlvC9IgJ2l3FoA 1i3ee4HA0/UsjiCg== To: "James E.J. Bottomley" , "Martin K. Petersen" , Christoph Hellwig , John Garry , Jason Yan , Daniel Wagner , Artur Paszkiewicz , Jack Wang Cc: linux-scsi@vger.kernel.org, LKML , Thomas Gleixner , "Sebastian A. Siewior" , "Ahmed S. Darwish" Subject: [PATCH v3 10/19] scsi: aic94xx: Pass gfp_t flags to libsas event notifiers Date: Mon, 18 Jan 2021 11:09:46 +0100 Message-Id: <20210118100955.1761652-11-a.darwish@linutronix.de> In-Reply-To: <20210118100955.1761652-1-a.darwish@linutronix.de> References: <20210118100955.1761652-1-a.darwish@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Ahmed S. Darwish Reviewed-by: John Garry --- drivers/scsi/aic94xx/aic94xx_scb.c | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c b/drivers/scsi/aic94xx/aic94xx_scb.c index 770546177ca4..76a4c21144d8 100644 --- a/drivers/scsi/aic94xx/aic94xx_scb.c +++ b/drivers/scsi/aic94xx/aic94xx_scb.c @@ -80,7 +80,8 @@ static void asd_phy_event_tasklet(struct asd_ascb *ascb, ASD_DPRINTK("phy%d: device unplugged\n", phy_id); asd_turn_led(asd_ha, phy_id, 0); 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; case CURRENT_OOB_DONE: /* hot plugged device */ @@ -88,12 +89,14 @@ static void asd_phy_event_tasklet(struct asd_ascb *ascb, get_lrate_mode(phy, oob_mode); ASD_DPRINTK("phy%d device plugged: lrate:0x%x, proto:0x%x\n", 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; case CURRENT_SPINUP_HOLD: /* hot plug SATA, no COMWAKE sent */ 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; case CURRENT_GTO_TIMEOUT: case CURRENT_OOB_ERROR: @@ -101,7 +104,8 @@ static void asd_phy_event_tasklet(struct asd_ascb *ascb, dl->status_block[1]); asd_turn_led(asd_ha, phy_id, 0); 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; } } @@ -232,7 +236,7 @@ static void asd_bytes_dmaed_tasklet(struct asd_ascb *ascb, spin_unlock_irqrestore(&phy->sas_phy.frame_rcvd_lock, flags); asd_dump_frame_rcvd(phy, dl); 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, @@ -268,7 +272,7 @@ static void asd_link_reset_err_tasklet(struct asd_ascb *ascb, asd_turn_led(asd_ha, phy_id, 0); sas_phy_disconnected(sas_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) { int num = 1; @@ -313,7 +317,8 @@ static void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb, spin_lock_irqsave(&sas_phy->sas_prim_lock, flags); sas_phy->sas_prim = ffs(cont); 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; case LmUNKNOWNP: @@ -334,7 +339,8 @@ static void asd_primitive_rcvd_tasklet(struct asd_ascb *ascb, /* The sequencer disables all phys on that port. * We have to re-enable the phys ourselves. */ 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; default: @@ -565,7 +571,8 @@ static void escb_tasklet_complete(struct asd_ascb *ascb, /* the device is gone */ sas_phy_disconnected(sas_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; default: ASD_DPRINTK("%s: phy%d: unknown event:0x%x\n", __func__, -- 2.30.0