{"id":970,"url":"http://patchwork.ozlabs.org/api/1.0/patches/970/?format=json","project":{"id":7,"url":"http://patchwork.ozlabs.org/api/1.0/projects/7/?format=json","name":"Linux network development","link_name":"netdev","list_id":"netdev.vger.kernel.org","list_email":"netdev@vger.kernel.org","web_url":null,"scm_url":null,"webscm_url":null},"msgid":"<200809222150.m8MLog27031875@imap1.linux-foundation.org>","date":"2008-09-22T21:50:42","name":"[7/8] hci_usb: replace mb with smp_mb","commit_ref":null,"pull_url":null,"state":"accepted","archived":true,"hash":"db0a0e7d23b866eceda044f0231142e2fd2de02a","submitter":{"id":107,"url":"http://patchwork.ozlabs.org/api/1.0/people/107/?format=json","name":"Andrew Morton","email":"akpm@linux-foundation.org"},"delegate":{"id":34,"url":"http://patchwork.ozlabs.org/api/1.0/users/34/?format=json","username":"davem","first_name":"David","last_name":"Miller","email":"davem@davemloft.net"},"mbox":"http://patchwork.ozlabs.org/project/netdev/patch/200809222150.m8MLog27031875@imap1.linux-foundation.org/mbox/","series":[],"check":"pending","checks":"http://patchwork.ozlabs.org/api/patches/970/checks/","tags":{},"headers":{"Return-Path":"<netdev-owner@vger.kernel.org>","X-Original-To":"patchwork-incoming@ozlabs.org","Delivered-To":"patchwork-incoming@ozlabs.org","Received":["from vger.kernel.org (vger.kernel.org [209.132.176.167])\n\tby ozlabs.org (Postfix) with ESMTP id EE81BDDE08\n\tfor <patchwork-incoming@ozlabs.org>;\n\tTue, 23 Sep 2008 07:57:50 +1000 (EST)","(majordomo@vger.kernel.org) by vger.kernel.org via listexpand\n\tid S1753924AbYIVV5m (ORCPT <rfc822;patchwork-incoming@ozlabs.org>);\n\tMon, 22 Sep 2008 17:57:42 -0400","(majordomo@vger.kernel.org) by vger.kernel.org id S1753800AbYIVV5l\n\t(ORCPT <rfc822; netdev-outgoing>); Mon, 22 Sep 2008 17:57:41 -0400","from smtp1.linux-foundation.org ([140.211.169.13]:58971 \"EHLO\n\tsmtp1.linux-foundation.org\" rhost-flags-OK-OK-OK-OK)\n\tby vger.kernel.org with ESMTP id S1753919AbYIVV5j (ORCPT\n\t<rfc822;netdev@vger.kernel.org>); Mon, 22 Sep 2008 17:57:39 -0400","from imap1.linux-foundation.org (imap1.linux-foundation.org\n\t[140.211.169.55])\n\tby smtp1.linux-foundation.org (8.14.2/8.13.5/Debian-3ubuntu1.1) with\n\tESMTP id m8MLrDOF018507\n\t(version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO);\n\tMon, 22 Sep 2008 14:57:34 -0700","from localhost.localdomain (localhost [127.0.0.1])\n\tby imap1.linux-foundation.org\n\t(8.13.5.20060308/8.13.5/Debian-3ubuntu1.1) with ESMTP id\n\tm8MLog27031875; Mon, 22 Sep 2008 14:50:43 -0700"],"Message-Id":"<200809222150.m8MLog27031875@imap1.linux-foundation.org>","Subject":"[patch 7/8] hci_usb: replace mb with smp_mb","To":"davem@davemloft.net","Cc":"netdev@vger.kernel.org, akpm@linux-foundation.org,\n\ttom.leiming@gmail.com, hidave.darkstar@gmail.com, marcel@holtmann.org","From":"akpm@linux-foundation.org","Date":"Mon, 22 Sep 2008 14:50:42 -0700","X-Spam-Status":"No, hits=-3.359 required=5 tests=AWL, BAYES_00,\n\tOSDL_HEADER_SUBJECT_BRACKETED","X-Spam-Checker-Version":"SpamAssassin 3.2.4-osdl_revision__1.47__","X-MIMEDefang-Filter":"lf$Revision: 1.188 $","X-Scanned-By":"MIMEDefang 2.63 on 140.211.169.13","Sender":"netdev-owner@vger.kernel.org","Precedence":"bulk","List-ID":"<netdev.vger.kernel.org>","X-Mailing-List":"netdev@vger.kernel.org"},"content":"From: Ming Lei <tom.leiming@gmail.com>\n\nsmp_mb is enough for ordering memory operations among processors,and mb is\nmore expensive than smp_mb for UP machine, so replace it with smp_mb().\n\nSigned-off-by: Ming Lei <tom.leiming@gmail.com>\nAcked-by: Marcel Holtmann <marcel@holtmann.org>\nCc: Dave Young <hidave.darkstar@gmail.com>\nSigned-off-by: Andrew Morton <akpm@linux-foundation.org>\n---\n\n drivers/bluetooth/hci_usb.h |   10 +++++-----\n 1 file changed, 5 insertions(+), 5 deletions(-)","diff":"diff -puN drivers/bluetooth/hci_usb.h~hci_usb-replace-mb-with-smp_mb drivers/bluetooth/hci_usb.h\n--- a/drivers/bluetooth/hci_usb.h~hci_usb-replace-mb-with-smp_mb\n+++ a/drivers/bluetooth/hci_usb.h\n@@ -70,8 +70,8 @@ static inline void _urb_queue_head(struc\n {\n \tunsigned long flags;\n \tspin_lock_irqsave(&q->lock, flags);\n-\t/* _urb_unlink needs to know which spinlock to use, thus mb(). */\n-\t_urb->queue = q; mb(); list_add(&_urb->list, &q->head);\n+\t/* _urb_unlink needs to know which spinlock to use, thus smp_mb(). */\n+\t_urb->queue = q; smp_mb(); list_add(&_urb->list, &q->head);\n \tspin_unlock_irqrestore(&q->lock, flags);\n }\n \n@@ -79,8 +79,8 @@ static inline void _urb_queue_tail(struc\n {\n \tunsigned long flags;\n \tspin_lock_irqsave(&q->lock, flags);\n-\t/* _urb_unlink needs to know which spinlock to use, thus mb(). */\n-\t_urb->queue = q; mb(); list_add_tail(&_urb->list, &q->head);\n+\t/* _urb_unlink needs to know which spinlock to use, thus smp_mb(). */\n+\t_urb->queue = q; smp_mb(); list_add_tail(&_urb->list, &q->head);\n \tspin_unlock_irqrestore(&q->lock, flags);\n }\n \n@@ -89,7 +89,7 @@ static inline void _urb_unlink(struct _u\n \tstruct _urb_queue *q;\n \tunsigned long flags;\n \n-\tmb();\n+\tsmp_mb();\n \tq = _urb->queue;\n \t/* If q is NULL, it will die at easy-to-debug NULL pointer dereference.\n \t   No need to BUG(). */\n","prefixes":["7/8"]}