From patchwork Mon Dec 21 19:31:31 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Christoph Lameter (Ampere)" X-Patchwork-Id: 7897571 Return-Path: X-Original-To: patchwork-linux-rdma@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 816989F318 for ; Mon, 21 Dec 2015 19:31:36 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B40520611 for ; Mon, 21 Dec 2015 19:31:35 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A51D12060F for ; Mon, 21 Dec 2015 19:31:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751291AbbLUTbd (ORCPT ); Mon, 21 Dec 2015 14:31:33 -0500 Received: from resqmta-ch2-08v.sys.comcast.net ([69.252.207.40]:52566 "EHLO resqmta-ch2-08v.sys.comcast.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750870AbbLUTbc (ORCPT ); Mon, 21 Dec 2015 14:31:32 -0500 Received: from resomta-ch2-07v.sys.comcast.net ([69.252.207.103]) by resqmta-ch2-08v.sys.comcast.net with comcast id wKXY1r0012EPM3101KXYug; Mon, 21 Dec 2015 19:31:32 +0000 Received: from gentwo.org ([98.222.162.64]) by resomta-ch2-07v.sys.comcast.net with comcast id wKXX1r0081PgSZ601KXXei; Mon, 21 Dec 2015 19:31:32 +0000 Received: by gentwo.org (Postfix, from userid 1001) id 2709A2284; Mon, 21 Dec 2015 13:31:31 -0600 (CST) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 24B95EB9; Mon, 21 Dec 2015 13:31:31 -0600 (CST) Date: Mon, 21 Dec 2015 13:31:31 -0600 (CST) From: Christoph Lameter X-X-Sender: cl@east.gentwo.org To: Hal Rosenstock cc: "ira.weiny" , Hal Rosenstock , dledford@redhat.com, linux-rdma@vger.kernel.org, Jason Gunthorpe Subject: Re: [PATCH 3/3] Display extended counter set if available In-Reply-To: <56783D89.4060704@dev.mellanox.co.il> Message-ID: References: <20151221142026.238104419@linux.com> <20151221142039.386488696@linux.com> <20151221175311.GI3860@phlsvsds.ph.intel.com> <56783D89.4060704@dev.mellanox.co.il> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=comcast.net; s=q20140121; t=1450726292; bh=KGu9W/u53LLmib8hSiyFP6iSK2/lCmLZnTmmGKKbmtU=; h=Received:Received:Received:Received:Date:From:To:Subject: Message-ID:Content-Type; b=f9udv1sfmsrA+Pva/hx6YyxUs9shuvnJQWvQtjz3ivh+j4xu92dUkXRznyoTNF+gu vJ30NMGjK91Vk614NODlwM2zMPFdu58rFhD2E5JQCNhDQGa78mNfhzvNy5de/pdKnj YxZw/YNGHKRuC0sqIxMoGikym2TCA3ZTeT3yg2Pk1FklQFY2/Em+pHC1qjmUcB5Szp bdBp/b6ldOYD3lfp+7NVk3O0RqIUxTu+yI18bB4edx8gd7xzJw4c6x7KzC866gq63T wcCec9xhKMhu/F5U+nmUqN2IbTlWKMk8fYSvhDqUp/eT2ZcQVSqSX8cZi2ld6fLVQA LE2Wd2vUtlDyQ== Sender: linux-rdma-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-rdma@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,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 Mon, 21 Dec 2015, Hal Rosenstock wrote: > > Don't we need to change all the sysfs_remove_groups to use get_counter_table as > > well? > > Looks like it to me too. Good catch. Fix follows: From: Christoph Lameter Subject: Fix sysfs entry removal by storing the table format in pma_table Store the table being used in the ib_port structure and use it when sysfs entries have to be removed. Signed-off-by: Christoph Lameter Reviewed-by: Ira Weiny Reviewed-by: Hal Rosenstock --- To unsubscribe from this list: send the line "unsubscribe linux-rdma" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: linux/drivers/infiniband/core/sysfs.c =================================================================== --- linux.orig/drivers/infiniband/core/sysfs.c +++ linux/drivers/infiniband/core/sysfs.c @@ -47,6 +47,7 @@ struct ib_port { struct attribute_group gid_group; struct attribute_group pkey_group; u8 port_num; + struct attribute_group *pma_table; }; struct port_attribute { @@ -651,7 +652,8 @@ static int add_port(struct ib_device *de return ret; } - ret = sysfs_create_group(&p->kobj, get_counter_table(device)); + p->pma_table = get_counter_table(device); + ret = sysfs_create_group(&p->kobj, p->pma_table); if (ret) goto err_put; @@ -710,7 +712,7 @@ err_free_gid: p->gid_group.attrs = NULL; err_remove_pma: - sysfs_remove_group(&p->kobj, &pma_group); + sysfs_remove_group(&p->kobj, p->pma_table); err_put: kobject_put(&p->kobj); @@ -923,7 +925,7 @@ static void free_port_list_attributes(st list_for_each_entry_safe(p, t, &device->port_list, entry) { struct ib_port *port = container_of(p, struct ib_port, kobj); list_del(&p->entry); - sysfs_remove_group(p, &pma_group); + sysfs_remove_group(p, port->pma_table); sysfs_remove_group(p, &port->pkey_group); sysfs_remove_group(p, &port->gid_group); kobject_put(p);