From patchwork Mon May 11 22:44:22 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 6384591 Return-Path: X-Original-To: patchwork-linux-scsi@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 6DB72BEEE1 for ; Mon, 11 May 2015 22:44:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5A13E20458 for ; Mon, 11 May 2015 22:44:27 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id E143E20457 for ; Mon, 11 May 2015 22:44:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751435AbbEKWoZ (ORCPT ); Mon, 11 May 2015 18:44:25 -0400 Received: from mail-wi0-f179.google.com ([209.85.212.179]:37319 "EHLO mail-wi0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751414AbbEKWoY (ORCPT ); Mon, 11 May 2015 18:44:24 -0400 Received: by widdi4 with SMTP id di4so115735564wid.0 for ; Mon, 11 May 2015 15:44:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=yr+r28yUCAWukVUePEdONxeiFY+u9sSCn0vRJraVPKc=; b=TBA8vQZR8pkY3laPbnLoe2fzJtw1NdLzpBDC9dd17Xn+KoaN33o75t+PvEZwnbfOhj +hmvopvcoK+4z1xugMps1eJhRVJ/W7alWx9oNaC3bhafNw5VKQewGzr111dW2cKpPweq F3KO23qXf6W09/L/p6Dy0hGO+jToF4sqDKm5/4ZO8rlhhOgZaMW+TGv/zZ9bN36RT4sc QmorXyWgaoTbENuddyCCfS71ak3Zi/G5FiiYYH9TxI/Qz1ecIJMPzBJuE2en8V+1zP66 KHg83c+3BKpknsJixdw4YjJ3Rh4v1tUGwwvpZEd3B5j0sYevw14UUqrQkY7F+BpS+iRy MDsQ== X-Gm-Message-State: ALoCoQlsEix5SLzDbiiBPIFWA7e/FcKcvN36RgQygp7Ri6s13g7xjHR5WRhFMa4H8ymSB2g2MWl1 MIME-Version: 1.0 X-Received: by 10.194.62.132 with SMTP id y4mr24541880wjr.91.1431384263030; Mon, 11 May 2015 15:44:23 -0700 (PDT) Received: by 10.27.139.136 with HTTP; Mon, 11 May 2015 15:44:22 -0700 (PDT) In-Reply-To: References: <16adc53b67b247f49bc46ff20a9d55d4@EX01.lg.local> Date: Mon, 11 May 2015 15:44:22 -0700 Message-ID: Subject: Re: sysfs group not found for kobject on mvsas drive removal From: Dan Williams To: Praveen Murali Cc: "James Bottomley (James.Bottomley@HansenPartnership.com)" , "linux-scsi@vger.kernel.org" Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP On Thu, May 7, 2015 at 11:25 AM, Dan Williams wrote: > On Thu, May 7, 2015 at 11:08 AM, Praveen Murali wrote: >> Hey Guys, >> Am I on the right track? Or am I missing something? > > I'm still paging in my libsas knowledge from slow backing media :). > > I wonder if the Intel-isci driver triggers a different ordering on > remove that avoids this... let me take a look. So I wonder if this is a new warning, because as far as I can tell we've always been double deleting the devices below sas_port. It seems we should delete all the devices from rphy down before deleting the parent port. Something like this (excuse the whitespace mangling). Only compile tested as I don't have a SAS setup handy. --- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index 60de66252fa2..a4db770fe8b0 100644 --- a/drivers/scsi/libsas/sas_discover.c +++ b/drivers/scsi/libsas/sas_discover.c @@ -362,11 +362,14 @@ static void sas_destruct_devices(struct work_struct *work) clear_bit(DISCE_DESTRUCT, &port->disc.pending); list_for_each_entry_safe(dev, n, &port->destroy_list, disco_list_node) { + struct sas_port *sas_port = dev_to_sas_port(dev->rphy->dev.parent); + list_del_init(&dev->disco_list_node); sas_remove_children(&dev->rphy->dev); sas_rphy_delete(dev->rphy); sas_unregister_common_dev(port, dev); + sas_port_delete(sas_port); } } @@ -400,9 +403,6 @@ void sas_unregister_domain_devices(struct asd_sas_port *port, int gone) list_for_each_entry_safe(dev, n, &port->disco_list, disco_list_node) sas_unregister_dev(port, dev); - - port->port->rphy = NULL; - } void sas_device_set_phy(struct domain_device *dev, struct sas_port *port) diff --git a/drivers/scsi/libsas/sas_port.c b/drivers/scsi/libsas/sas_port.c index d3c5297c6c89..9a25ae3a52a4 100644 --- a/drivers/scsi/libsas/sas_port.c +++ b/drivers/scsi/libsas/sas_port.c @@ -219,7 +219,6 @@ void sas_deform_port(struct asd_sas_phy *phy, int gone) if (port->num_phys == 1) { sas_unregister_domain_devices(port, gone); - sas_port_delete(port->port); port->port = NULL; } else { sas_port_delete_phy(port->port, phy->phy);