Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2423865pxu; Fri, 18 Dec 2020 12:56:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJzcUAjEfI9fJQbkGbj7GTmlgE9mAeFARMKEz899+cZz9CPQmlqTVhTnObkCRwdI2vjXPyot X-Received: by 2002:a17:906:30c4:: with SMTP id b4mr5830443ejb.456.1608325014712; Fri, 18 Dec 2020 12:56:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608325014; cv=none; d=google.com; s=arc-20160816; b=L8tg0mOq4A0gAk05ZJY6aSOkN0v+RAaPCWqI6+9s1CsyIU5of28OppAIB/s6zOSkly FDXdNzPwdpeCpeA+UhDQ5UE3lQAnXK7sA0yjTtIPtxRCRFtGmp7v3ArPytCLsPH7etzB NlC3TfTUAB2zMVYws6pIdkZthRlZaL4iCvkJ3R4y8MXocg21NN0JI2gNf0OhKX6/bgVw TqRcye4nMOjIsTqjWheyoHItK4nYzmfNJltguUntcuDCTFsQEO4vEOEXXvPmRGTq6L1L ymbA5RfmgS4CLObb7yeA2ihIVfxrCYOe/qgGVVE3H87fxgIjH8qECtwYpYnn8ZmWVNHW hhcA== 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=No+yGM8+mG4hI934OIIFraDkbFc4I5bXzP+O8ElL+5w=; b=kUcS8vYMZiLEyzq/vWsG06sUvP5HGP4Sd72NrL3kJiq+f6WVTKVKeOh3Mf4ORs5hvo vf2guZ+TOVLKe30xYf0p66SDTq5BSgNdOSaPD9jn8sm7EGiw8ZQ19S2+21xeAXKYx6tm 3a5YkTnoABhDooj6GynqLcHWF+cUBIUqFrDZ8WXb+fHLhIOMvoMZB8mVecDMWvy7y9qM PgqRccJ7vg0muUEACU8LcPS5R1UqoPDBE8ssXAKywtbVwoEe+GG16lEGEXjBsNq+tvRW 41vXCpJecFOdyHVySwot96hFT0jB+oqv9A8WhjRZMCsaQ3CEubA3UC9K7L4aPiWMLKvE XImQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b="JnY/LA8J"; 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 v13si6994767edr.464.2020.12.18.12.56.32; Fri, 18 Dec 2020 12:56:54 -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="JnY/LA8J"; 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 S2387745AbgLRUp3 (ORCPT + 99 others); Fri, 18 Dec 2020 15:45:29 -0500 Received: from Galois.linutronix.de ([193.142.43.55]:54828 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387722AbgLRUp1 (ORCPT ); Fri, 18 Dec 2020 15:45:27 -0500 From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1608324285; 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=No+yGM8+mG4hI934OIIFraDkbFc4I5bXzP+O8ElL+5w=; b=JnY/LA8Jt6uxqTq2Ddhr59x4oAGZ62fPcimY3JUFItCsi4J0/nmhwf7xOh08wxCm8JWITC QuZ9CY77jkvnBJS2W454bVdRECoZShchX3kTWbeCcfrVQ6oArK5VotGpSewJTIK60Dx5Of 80oAZ2jpqpNh8Mz8MnV3tB1nyYDAcmmIIdFbCG4LZdQbdEDvzZdXYqj/4Z2TONQhftACgw juhOrj31QsBPgnq/qcax6KHX/whZ0L33maf70LUORsrRttdfyWqOaA2Nw2gGt8yJQxrLuB jGUSWzwHpXIKazYMjeI3B1VjEcs9DxwvldzHTjgV1Ld6yGqQgrblf2SFmZDYIQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1608324285; 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=No+yGM8+mG4hI934OIIFraDkbFc4I5bXzP+O8ElL+5w=; b=HjMxu4Ezfp2rheRHZq0kxms+TeKy65RQMOyaOCTR5c9+EjVUmvsSybYr5Sca2NRZovqukk aypZcfRs0hf+IvAw== To: "James E.J. Bottomley" , "Martin K. Petersen" , Daniel Wagner , Jason Yan , John Garry , Artur Paszkiewicz , Jack Wang Cc: linux-scsi@vger.kernel.org, LKML , Thomas Gleixner , "Sebastian A. Siewior" , "Ahmed S. Darwish" Subject: [PATCH 09/11] scsi: aic94xx: Pass gfp_t flags to libsas event notifiers Date: Fri, 18 Dec 2020 21:43:52 +0100 Message-Id: <20201218204354.586951-10-a.darwish@linutronix.de> In-Reply-To: <20201218204354.586951-1-a.darwish@linutronix.de> References: <20201218204354.586951-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 --- drivers/scsi/aic94xx/aic94xx_scb.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/scsi/aic94xx/aic94xx_scb.c b/drivers/scsi/aic94xx/aic94xx_scb.c index e2d880a5f391..9ca60da59865 100644 --- a/drivers/scsi/aic94xx/aic94xx_scb.c +++ b/drivers/scsi/aic94xx/aic94xx_scb.c @@ -81,7 +81,7 @@ 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_ha->notify_phy_event(&phy->sas_phy, PHYE_LOSS_OF_SIGNAL); + sas_ha->notify_phy_event_gfp(&phy->sas_phy, PHYE_LOSS_OF_SIGNAL, GFP_ATOMIC); break; case CURRENT_OOB_DONE: /* hot plugged device */ @@ -89,12 +89,12 @@ 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_ha->notify_phy_event(&phy->sas_phy, PHYE_OOB_DONE); + sas_ha->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_ha->notify_phy_event(&phy->sas_phy, PHYE_SPINUP_HOLD); + sas_ha->notify_phy_event_gfp(&phy->sas_phy, PHYE_SPINUP_HOLD, GFP_ATOMIC); break; case CURRENT_GTO_TIMEOUT: case CURRENT_OOB_ERROR: @@ -102,7 +102,7 @@ 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_ha->notify_phy_event(&phy->sas_phy, PHYE_OOB_ERROR); + sas_ha->notify_phy_event_gfp(&phy->sas_phy, PHYE_OOB_ERROR, GFP_ATOMIC); break; } } @@ -234,7 +234,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_ha->notify_port_event(&phy->sas_phy, PORTE_BYTES_DMAED); + sas_ha->notify_port_event_gfp(&phy->sas_phy, PORTE_BYTES_DMAED, GFP_ATOMIC); } static void asd_link_reset_err_tasklet(struct asd_ascb *ascb, @@ -270,7 +270,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_ha->notify_port_event(sas_phy, PORTE_LINK_RESET_ERR); + sas_ha->notify_port_event_gfp(sas_phy, PORTE_LINK_RESET_ERR, GFP_ATOMIC); if (retries_left == 0) { int num = 1; @@ -315,7 +315,7 @@ 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_ha->notify_port_event(sas_phy,PORTE_BROADCAST_RCVD); + sas_ha->notify_port_event_gfp(sas_phy,PORTE_BROADCAST_RCVD, GFP_ATOMIC); break; case LmUNKNOWNP: @@ -336,7 +336,7 @@ 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_ha->notify_port_event(sas_phy, PORTE_HARD_RESET); + sas_ha->notify_port_event_gfp(sas_phy, PORTE_HARD_RESET, GFP_ATOMIC); break; default: @@ -567,7 +567,7 @@ 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_ha->notify_port_event(sas_phy, PORTE_TIMER_EVENT); + sas_ha->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.29.2