From patchwork Thu Jul 16 21:28:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergei Shtylyov X-Patchwork-Id: 6811451 Return-Path: X-Original-To: patchwork-linux-sh@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 98C82C05AC for ; Thu, 16 Jul 2015 21:28:46 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BA0452058E for ; Thu, 16 Jul 2015 21:28:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B85AA2056D for ; Thu, 16 Jul 2015 21:28:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756036AbbGPV2o (ORCPT ); Thu, 16 Jul 2015 17:28:44 -0400 Received: from mail-lb0-f171.google.com ([209.85.217.171]:33421 "EHLO mail-lb0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755926AbbGPV2n (ORCPT ); Thu, 16 Jul 2015 17:28:43 -0400 Received: by lbbyj8 with SMTP id yj8so51254467lbb.0 for ; Thu, 16 Jul 2015 14:28:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:organization :user-agent:mime-version:content-transfer-encoding:content-type; bh=l2DyhXf3BvKI0MmtlvXSZv23UG47o7D3QrV4fwgx3Do=; b=gMtcFwDFNfNWEluaUH0/7gPGVodcFdad6gNbOZVtMfIGptL01O+C1458D6lelntzum tPb3YgxbjAxnq6DMiQzT6O45I30cizXniYe6/djHZDrjOXHtZa/Sw4Fb/ZLVUh5OB0kd UVoZbs5z8/Y8jL/nWfgb1WIh2tBFewMM4upT4OTKXt0Ydh7y74tI7UO3Y39w8LhqaHJ8 gXFAE5AUDzpCsFl/f5c6nH2mOgZv51ODnmS43d1Cqzy6pOmX29zPUEGAfWgx0kDLpJOb pcMO0u+fj6BUZ9X7pN+yMnSnb+WJjMzZb6TfwiQB/AfdfKdnoNcLbwAVi8THb1h9tv1X XEIg== X-Gm-Message-State: ALoCoQkGj5kWmVUrAI+CCxzq7zglUcIgB/cZyaHCkcv6f2ZB/8KC81TI71qG2eKa8l7nU8pBf4kw X-Received: by 10.152.43.134 with SMTP id w6mr10217096lal.120.1437082122001; Thu, 16 Jul 2015 14:28:42 -0700 (PDT) Received: from wasted.cogentembedded.com (ppp83-237-250-88.pppoe.mtu-net.ru. [83.237.250.88]) by smtp.gmail.com with ESMTPSA id c5sm2309180lbd.49.2015.07.16.14.28.39 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 16 Jul 2015 14:28:40 -0700 (PDT) From: Sergei Shtylyov To: netdev@vger.kernel.org Cc: linux-sh@vger.kernel.org Subject: [PATCH] ravb: fix race updating TCCR Date: Fri, 17 Jul 2015 00:28:38 +0300 Message-ID: <6587398.M5V25fvqHl@wasted.cogentembedded.com> Organization: Cogent Embedded Inc. User-Agent: KMail/4.14.9 (Linux/4.0.7-200.fc21.x86_64; KDE/4.14.9; x86_64; ; ) MIME-Version: 1.0 Sender: linux-sh-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-sh@vger.kernel.org X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 The TCCR.TSRQn bit may get clearead after TCCR gets read, so that TCCR write would get skipped. We don't need to check this bit before setting. Signed-off-by: Sergei Shtylyov --- The patch is against Dave Miller's 'net.git' repo plus the patch I sent on Tuesday. drivers/net/ethernet/renesas/ravb_main.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) -- To unsubscribe from this list: send the line "unsubscribe linux-sh" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Index: net/drivers/net/ethernet/renesas/ravb_main.c =================================================================== --- net.orig/drivers/net/ethernet/renesas/ravb_main.c +++ net/drivers/net/ethernet/renesas/ravb_main.c @@ -1275,7 +1275,6 @@ static netdev_tx_t ravb_start_xmit(struc u32 dma_addr; void *buffer; u32 entry; - u32 tccr; spin_lock_irqsave(&priv->lock, flags); if (priv->cur_tx[q] - priv->dirty_tx[q] >= priv->num_tx_ring[q]) { @@ -1324,9 +1323,7 @@ static netdev_tx_t ravb_start_xmit(struc dma_wmb(); desc->die_dt = DT_FSINGLE; - tccr = ravb_read(ndev, TCCR); - if (!(tccr & (TCCR_TSRQ0 << q))) - ravb_write(ndev, tccr | (TCCR_TSRQ0 << q), TCCR); + ravb_write(ndev, ravb_read(ndev, TCCR) | (TCCR_TSRQ0 << q), TCCR); priv->cur_tx[q]++; if (priv->cur_tx[q] - priv->dirty_tx[q] >= priv->num_tx_ring[q] &&