Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1448050

[PATCH 09/13] rapidio/idt_gen2: fix locking warning

From Alexandre Bounine <alexandre.bounine@idt.com>
Newsgroups linux.kernel
Subject [PATCH 09/13] rapidio/idt_gen2: fix locking warning
Date 2016-07-21 20:30 +0200
Message-ID <rXqTo-2Jr-15@gated-at.bofh.it> (permalink)
References <rXqJI-2G4-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Fix lockdep warning during device probing: move sysfs initialization out
of code protected by a spin lock. 

Signed-off-by: Alexandre Bounine <alexandre.bounine@idt.com>
Cc: Matt Porter <mporter@kernel.crashing.org>
Cc: Andre van Herk <andre.van.herk@prodrive-technologies.com>
Cc: Barry Wood <barry.wood@idt.com>
Cc: linux-kernel@vger.kernel.org
---
 drivers/rapidio/switches/idt_gen2.c |    7 +++----
 1 files changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/rapidio/switches/idt_gen2.c b/drivers/rapidio/switches/idt_gen2.c
index 9f7fe21..e67b923 100644
--- a/drivers/rapidio/switches/idt_gen2.c
+++ b/drivers/rapidio/switches/idt_gen2.c
@@ -436,10 +436,11 @@ static int idtg2_probe(struct rio_dev *rdev, const struct rio_device_id *id)
 				    RIO_STD_RTE_DEFAULT_PORT, IDT_NO_ROUTE);
 	}
 
+	spin_unlock(&rdev->rswitch->lock);
+
 	/* Create device-specific sysfs attributes */
 	idtg2_sysfs(rdev, true);
 
-	spin_unlock(&rdev->rswitch->lock);
 	return 0;
 }
 
@@ -452,11 +453,9 @@ static void idtg2_remove(struct rio_dev *rdev)
 		return;
 	}
 	rdev->rswitch->ops = NULL;
-
+	spin_unlock(&rdev->rswitch->lock);
 	/* Remove device-specific sysfs attributes */
 	idtg2_sysfs(rdev, false);
-
-	spin_unlock(&rdev->rswitch->lock);
 }
 
 static struct rio_device_id idtg2_id_table[] = {
-- 
1.7.8.4

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH 00/13] RapidIO subsystem updates Alexandre Bounine <alexandre.bounine@idt.com> - 2016-07-21 20:20 +0200
  [PATCH 08/13] rapidio: fix error handling in mbox request/release functions Alexandre Bounine <alexandre.bounine@idt.com> - 2016-07-21 20:30 +0200
  [PATCH 09/13] rapidio/idt_gen2: fix locking warning Alexandre Bounine <alexandre.bounine@idt.com> - 2016-07-21 20:30 +0200
  [PATCH 11/13] rapidio: modify for rev.3 specification changes Alexandre Bounine <alexandre.bounine@idt.com> - 2016-07-21 20:30 +0200
  [PATCH 12/13] powerpc/fsl_rio: apply changes for RIO spec rev 3 Alexandre Bounine <alexandre.bounine@idt.com> - 2016-07-21 20:30 +0200
  [PATCH 05/13] rapidio/tsi721: add PCIe MRRS override parameter Alexandre Bounine <alexandre.bounine@idt.com> - 2016-07-21 20:30 +0200
  [PATCH 06/13] rapidio/tsi721: add messaging mbox selector parameter Alexandre Bounine <alexandre.bounine@idt.com> - 2016-07-21 20:30 +0200
  [PATCH 01/13] rapidio: Remove unnecessary 0x prefixes before %pa extension uses Alexandre Bounine <alexandre.bounine@idt.com> - 2016-07-21 20:30 +0200
  Re: [PATCH 13/13] rapidio/switches: add driver for IDT gen3  switches Andrew Morton <akpm@linux-foundation.org> - 2016-07-21 20:40 +0200
    RE: [PATCH 13/13] rapidio/switches: add driver for IDT gen3 switches "Bounine, Alexandre" <Alexandre.Bounine@idt.com> - 2016-07-21 21:10 +0200
      Re: [PATCH 13/13] rapidio/switches: add driver for IDT gen3  switches Andrew Morton <akpm@linux-foundation.org> - 2016-07-21 21:10 +0200
  [PATCH 13/13] rapidio/switches: add driver for IDT gen3 switches Alexandre Bounine <alexandre.bounine@idt.com> - 2016-07-21 20:40 +0200
  [PATCH 10/13] rapidio: change inbound window size type to u64 Alexandre Bounine <alexandre.bounine@idt.com> - 2016-07-21 20:40 +0200

csiph-web