Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp2423683pxu; Fri, 18 Dec 2020 12:56:38 -0800 (PST) X-Google-Smtp-Source: ABdhPJyj/FBb65lWPbSrcLgmLAIPH63NgkReJH3Y3sxTsJr1lXDrzYIkXisQkAcRHr6YaC9RODDE X-Received: by 2002:aa7:c388:: with SMTP id k8mr6312880edq.36.1608324998718; Fri, 18 Dec 2020 12:56:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608324998; cv=none; d=google.com; s=arc-20160816; b=CUdhkWAIrlTqCG2LvAMExYu2Ry9oOGxSZJ85A1ahrv2qlqvztKz6OLdzA9GTR/GBvX fdeV9UYDDhs1khhI/27TKKGSSh8gPFF16bmd+K0jbHUxZhrEV0kS2TKrf3mbpDV9wM6H bssuHrmdmZ/ulER8xFO2gQcRK3DBlkWneU+qDmfmnTgD8ut6Hiw5esD1uy5ZmSYJZ+s9 QOu4CDJjKW+l6eMZVENhzNrSYQMDLOBfPnZ5ZSsKwxqnM39JlBVZH/umVTbgvjSZoTGs /V7DHtXz4sQKK7++tvJOWSh7Hi+j06BrnSi+9tdlxu12cWARVjJk1dFjU/pBYDORMmU0 25DQ== 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=iVAD+aDlMv+qFojj+svoaj4JfsRPU0GOUX34CODHS0g=; b=hnkeesol3a/lve3zzFghc1wn04xf9AanOy2i454irqU7MYS6/0+z46/gBZzeak3pnQ y/JSHOFFIpx9SSoHUAuyRJIPWgVHriNLPq0ykGcMsrOrmWoKUHiaI1XcA91X489SdATY V2q8cBhUp4hK618UTtFw+vbhUj4Qtpm2xCDlgdig3HxoNieiRcRItymJsbN9F6XwXxvw aG8Ue3SnLBmWhJdK5FAEch5JjAhtq9rLr9ZNSDa5vtAC5opnqSWHTDWFg5DsPQucnP6K 3N6mbmv9raE8vQuKc5Fy2GQ5t7SRMLNeZ7wRDPwClx/hzofYlsScnQP9u3BWEdK6payN iXQw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=UJlvRPf9; 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 eb11si7176039edb.446.2020.12.18.12.56.16; Fri, 18 Dec 2020 12:56:38 -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=UJlvRPf9; 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 S2388262AbgLRUpi (ORCPT + 99 others); Fri, 18 Dec 2020 15:45:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33084 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731972AbgLRUpg (ORCPT ); Fri, 18 Dec 2020 15:45:36 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5DADEC06138C; Fri, 18 Dec 2020 12:44:56 -0800 (PST) From: "Ahmed S. Darwish" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1608324294; 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=iVAD+aDlMv+qFojj+svoaj4JfsRPU0GOUX34CODHS0g=; b=UJlvRPf9v3+QhaZMLh+anR8EF464ohqGZqW5XZJwujVhCMqqFF7590vNerLtlQnbd3eiam aTdc+dugtQdqewEqXPx3RTOjWoG8Dr6EKjLXUrjJGT8jUd61i2llU/7eEq20oU/EGS1xZf WrjJQ3rd7PWDraNHaOHp0FEqUb3CvhdGIL8/IlnJD8x6fl2GCtcIKlP0nm1xVHNQZ8rAX8 H0bPaV/AwYl+9RQHO0k2CRWHklWeacbLn8nstQABBNu3quUgy2RGDzlY1OVo7dwiYs6CVX V7la8M7YZNnOiIS84Ql0XIGxqAk2QNSq6hhxtDP1FR6pqoZvHRe0UlS9HWBS3w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1608324294; 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=iVAD+aDlMv+qFojj+svoaj4JfsRPU0GOUX34CODHS0g=; b=6Obq+kpjZ+QC+Z9f73u5+K3n2thYYnxvlTVpaHY6IympfJC/ed0eOXh99hOlOUZyCohqpc pDH4oGkyTyOdfKBA== 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 11/11] scsi: libsas: event notifiers: Remove non _gfp() variants Date: Fri, 18 Dec 2020 21:43:54 +0100 Message-Id: <20201218204354.586951-12-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 All call-sites of below libsas APIs: - sas_alloc_event() - sas_ha_struct::notify_port_event() - sas_ha_struct::notify_phy_event() have been converted to use the new _gfp()-suffixed version. Remove the old APIs from libsas code, headers, and documentation. Signed-off-by: Ahmed S. Darwish Cc: John Garry Cc: Jason Yan --- Documentation/scsi/libsas.rst | 2 - drivers/scsi/libsas/sas_event.c | 72 +++++++----------------------- drivers/scsi/libsas/sas_init.c | 15 +------ drivers/scsi/libsas/sas_internal.h | 2 - include/scsi/libsas.h | 2 - 5 files changed, 18 insertions(+), 75 deletions(-) diff --git a/Documentation/scsi/libsas.rst b/Documentation/scsi/libsas.rst index dc85d0e4c107..7e1bf710760b 100644 --- a/Documentation/scsi/libsas.rst +++ b/Documentation/scsi/libsas.rst @@ -189,8 +189,6 @@ num_phys The event interface:: /* LLDD calls these to notify the class of an event. */ - void (*notify_port_event)(struct sas_phy *, enum port_event); - void (*notify_phy_event)(struct sas_phy *, enum phy_event); void (*notify_port_event_gfp)(struct sas_phy *, enum port_event, gfp_t); void (*notify_phy_event_gfp)(struct sas_phy *, enum phy_event, gfp_t); diff --git a/drivers/scsi/libsas/sas_event.c b/drivers/scsi/libsas/sas_event.c index 31b733eeabf6..23aeb67f6381 100644 --- a/drivers/scsi/libsas/sas_event.c +++ b/drivers/scsi/libsas/sas_event.c @@ -131,57 +131,21 @@ static void sas_phy_event_worker(struct work_struct *work) sas_free_event(ev); } -static int __sas_notify_port_event(struct asd_sas_phy *phy, enum port_event event, - struct asd_sas_event *ev) -{ - struct sas_ha_struct *ha = phy->ha; - int ret; - - BUG_ON(event >= PORT_NUM_EVENTS); - - INIT_SAS_EVENT(ev, sas_port_event_worker, phy, event); - - ret = sas_queue_event(event, &ev->work, ha); - if (ret != 1) - sas_free_event(ev); - - return ret; -} - static int sas_notify_port_event_gfp(struct asd_sas_phy *phy, enum port_event event, gfp_t gfp_flags) -{ - struct asd_sas_event *ev; - - ev = sas_alloc_event_gfp(phy, gfp_flags); - if (!ev) - return -ENOMEM; - - return __sas_notify_port_event(phy, event, ev); -} - -static int sas_notify_port_event(struct asd_sas_phy *phy, enum port_event event) -{ - struct asd_sas_event *ev; - - ev = sas_alloc_event(phy); - if (!ev) - return -ENOMEM; - - return __sas_notify_port_event(phy, event, ev); -} - -static inline int __sas_notify_phy_event(struct asd_sas_phy *phy, - enum phy_event event, - struct asd_sas_event *ev) { struct sas_ha_struct *ha = phy->ha; + struct asd_sas_event *ev; int ret; - BUG_ON(event >= PHY_NUM_EVENTS); + BUG_ON(event >= PORT_NUM_EVENTS); - INIT_SAS_EVENT(ev, sas_phy_event_worker, phy, event); + ev = sas_alloc_event_gfp(phy, gfp_flags); + if (!ev) + return -ENOMEM; + + INIT_SAS_EVENT(ev, sas_port_event_worker, phy, event); ret = sas_queue_event(event, &ev->work, ha); if (ret != 1) @@ -193,31 +157,27 @@ static inline int __sas_notify_phy_event(struct asd_sas_phy *phy, int sas_notify_phy_event_gfp(struct asd_sas_phy *phy, enum phy_event event, gfp_t gfp_flags) { + struct sas_ha_struct *ha = phy->ha; struct asd_sas_event *ev; + int ret; + + BUG_ON(event >= PHY_NUM_EVENTS); ev = sas_alloc_event_gfp(phy, gfp_flags); if (!ev) return -ENOMEM; - return __sas_notify_phy_event(phy, event, ev); -} + INIT_SAS_EVENT(ev, sas_phy_event_worker, phy, event); -int sas_notify_phy_event(struct asd_sas_phy *phy, enum phy_event event) -{ - struct asd_sas_event *ev; + ret = sas_queue_event(event, &ev->work, ha); + if (ret != 1) + sas_free_event(ev); - ev = sas_alloc_event(phy); - if (!ev) - return -ENOMEM; - - return __sas_notify_phy_event(phy, event, ev); + return ret; } int sas_init_events(struct sas_ha_struct *sas_ha) { - sas_ha->notify_port_event = sas_notify_port_event; - sas_ha->notify_phy_event = sas_notify_phy_event; - sas_ha->notify_port_event_gfp = sas_notify_port_event_gfp; sas_ha->notify_phy_event_gfp = sas_notify_phy_event_gfp; diff --git a/drivers/scsi/libsas/sas_init.c b/drivers/scsi/libsas/sas_init.c index 2d2116f827c6..e08351f909fb 100644 --- a/drivers/scsi/libsas/sas_init.c +++ b/drivers/scsi/libsas/sas_init.c @@ -590,8 +590,8 @@ sas_domain_attach_transport(struct sas_domain_function_template *dft) } EXPORT_SYMBOL_GPL(sas_domain_attach_transport); -static struct asd_sas_event * __sas_alloc_event(struct asd_sas_phy *phy, - gfp_t gfp_flags) +struct asd_sas_event *sas_alloc_event_gfp(struct asd_sas_phy *phy, + gfp_t gfp_flags) { struct asd_sas_event *event; struct sas_ha_struct *sas_ha = phy->ha; @@ -623,17 +623,6 @@ static struct asd_sas_event * __sas_alloc_event(struct asd_sas_phy *phy, return event; } -struct asd_sas_event *sas_alloc_event(struct asd_sas_phy *phy) -{ - return __sas_alloc_event(phy, in_interrupt() ? GFP_ATOMIC : GFP_KERNEL); -} - -struct asd_sas_event *sas_alloc_event_gfp(struct asd_sas_phy *phy, - gfp_t gfp_flags) -{ - return __sas_alloc_event(phy, gfp_flags); -} - void sas_free_event(struct asd_sas_event *event) { struct asd_sas_phy *phy = event->phy; diff --git a/drivers/scsi/libsas/sas_internal.h b/drivers/scsi/libsas/sas_internal.h index 437a697b6f73..b0422d47675b 100644 --- a/drivers/scsi/libsas/sas_internal.h +++ b/drivers/scsi/libsas/sas_internal.h @@ -48,7 +48,6 @@ int sas_show_oob_mode(enum sas_oob_mode oob_mode, char *buf); int sas_register_phys(struct sas_ha_struct *sas_ha); void sas_unregister_phys(struct sas_ha_struct *sas_ha); -struct asd_sas_event *sas_alloc_event(struct asd_sas_phy *phy); struct asd_sas_event *sas_alloc_event_gfp(struct asd_sas_phy *phy, gfp_t gfp_flags); void sas_free_event(struct asd_sas_event *event); @@ -78,7 +77,6 @@ int sas_smp_phy_control(struct domain_device *dev, int phy_id, enum phy_func phy_func, struct sas_phy_linkrates *); int sas_smp_get_phy_events(struct sas_phy *phy); -int sas_notify_phy_event(struct asd_sas_phy *phy, enum phy_event event); int sas_notify_phy_event_gfp(struct asd_sas_phy *phy, enum phy_event event, gfp_t flags); void sas_device_set_phy(struct domain_device *dev, struct sas_port *port); struct domain_device *sas_find_dev_by_rphy(struct sas_rphy *rphy); diff --git a/include/scsi/libsas.h b/include/scsi/libsas.h index f7c2530bbd9d..fdd338fa65c9 100644 --- a/include/scsi/libsas.h +++ b/include/scsi/libsas.h @@ -392,8 +392,6 @@ struct sas_ha_struct { * their siblings when forming wide ports */ /* LLDD calls these to notify the class of an event. */ - int (*notify_port_event)(struct asd_sas_phy *, enum port_event); - int (*notify_phy_event)(struct asd_sas_phy *, enum phy_event); int (*notify_port_event_gfp)(struct asd_sas_phy *, enum port_event, gfp_t); int (*notify_phy_event_gfp)(struct asd_sas_phy *, enum phy_event, gfp_t); -- 2.29.2