From patchwork Thu Jun 13 16:32:28 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 2717751 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 2C192C0AB1 for ; Thu, 13 Jun 2013 16:36:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 124AF20403 for ; Thu, 13 Jun 2013 16:36:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id AEE0120461 for ; Thu, 13 Jun 2013 16:36:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758658Ab3FMQfm (ORCPT ); Thu, 13 Jun 2013 12:35:42 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:54007 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758736Ab3FMQfk (ORCPT ); Thu, 13 Jun 2013 12:35:40 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb1so8188606pad.9 for ; Thu, 13 Jun 2013 09:35:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=XsCj9t9DjoHRMtp+KFUjNg2asKJ3D80b1MbzHNW2iHc=; b=HEIOoysNk4hM1O9qS92pAY6QCPgxga4N82X6aOOCcBiNB16eium5LUJRTsytU+9R0T kLvm0MXSwzpoytp1gqwzElTW0mfoHTPk4Yvu87xVsDpVaMnqdRpzoDAyJCdsScQueIso F27xN1+NMEGcGJLvEvZRJQct0VffIrRFTX8kYdk3/GJwWaq6mjNIyu2azRrqmhB8Q8rv O0hU0BobWUYKEW9gBQ3vvj7bPMPE4LMTl5daxh0JqA/gMeA1Qs0vnd5jj1hypAlcZ7yG 9YC7Jn5fT0J4c/nhbG1aces6U+/bFM4vKstzflTY+z/VBxoGBKImoCQpW4BanwVTfMAR 3dww== X-Received: by 10.66.163.5 with SMTP id ye5mr3589820pab.60.1371141340246; Thu, 13 Jun 2013 09:35:40 -0700 (PDT) Received: from localhost.localdomain ([114.250.95.159]) by mx.google.com with ESMTPSA id ty8sm176964pac.8.2013.06.13.09.35.35 for (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 13 Jun 2013 09:35:39 -0700 (PDT) From: Jiang Liu To: "Rafael J . Wysocki" , Bjorn Helgaas , Yinghai Lu , "Alexander E . Patrakov" Cc: Jiang Liu , Greg Kroah-Hartman , Yijing Wang , Jiang Liu , linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org, Shaohua Li , Len Brown , linux-acpi@vger.kernel.org Subject: [BUGFIX 5/9] ACPI, DOCK: kill redundant spin lock in dock device object Date: Fri, 14 Jun 2013 00:32:28 +0800 Message-Id: <1371141152-9468-6-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.8.1.2 In-Reply-To: <1371141152-9468-1-git-send-email-jiang.liu@huawei.com> References: <1371141152-9468-1-git-send-email-jiang.liu@huawei.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org X-Spam-Status: No, score=-7.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable 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 All dock device related data structures are created during driver initialization, so kill the redundant spin lock in dock device object. Signed-off-by: Jiang Liu Cc: Shaohua Li Cc: Len Brown Cc: "Rafael J. Wysocki" Cc: linux-acpi@vger.kernel.org Cc: linux-kernel@vger.kernel.org --- drivers/acpi/dock.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/drivers/acpi/dock.c b/drivers/acpi/dock.c index 8e578aa..cd2d5df 100644 --- a/drivers/acpi/dock.c +++ b/drivers/acpi/dock.c @@ -57,7 +57,6 @@ struct dock_station { acpi_handle handle; unsigned long last_dock_time; u32 flags; - spinlock_t dd_lock; struct mutex hp_lock; struct task_struct *owner; struct list_head dependent_devices; @@ -107,10 +106,7 @@ add_dock_dependent_device(struct dock_station *ds, acpi_handle handle) dd->handle = handle; INIT_LIST_HEAD(&dd->list); INIT_LIST_HEAD(&dd->hotplug_list); - - spin_lock(&ds->dd_lock); list_add_tail(&dd->list, &ds->dependent_devices); - spin_unlock(&ds->dd_lock); return 0; } @@ -168,14 +164,10 @@ find_dock_dependent_device(struct dock_station *ds, acpi_handle handle) { struct dock_dependent_device *dd; - spin_lock(&ds->dd_lock); - list_for_each_entry(dd, &ds->dependent_devices, list) { - if (handle == dd->handle) { - spin_unlock(&ds->dd_lock); + list_for_each_entry(dd, &ds->dependent_devices, list) + if (handle == dd->handle) return dd; - } - } - spin_unlock(&ds->dd_lock); + return NULL; } @@ -964,7 +956,6 @@ static int __init dock_add(acpi_handle handle) dock_station->last_dock_time = jiffies - HZ; mutex_init(&dock_station->hp_lock); - spin_lock_init(&dock_station->dd_lock); INIT_LIST_HEAD(&dock_station->sibling); INIT_LIST_HEAD(&dock_station->hotplug_devices); INIT_LIST_HEAD(&dock_station->dependent_devices);