Received: by 10.223.176.5 with SMTP id f5csp1549964wra; Wed, 7 Feb 2018 22:49:29 -0800 (PST) X-Google-Smtp-Source: AH8x224TE2zxQ/G36rpPB6aH7oI0YzcAzJo1WGdo8EPJLz8s/gp6Fbg98Q1gs0TYu6pBJrQ5Zqu7 X-Received: by 10.98.137.213 with SMTP id n82mr8457453pfk.175.1518072569659; Wed, 07 Feb 2018 22:49:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518072569; cv=none; d=google.com; s=arc-20160816; b=p2CC3yXAljkMWOfJ61+PkX12LGwmLyTn/57Tsk/rCjbB1KiYw9+dwRV4SiNQ71uiUl AAZGeYdCOcPtFsfPsAtwYJeiIGwQIpSYRf2pu3vCP1bvrFO8heFkkEqPlf7Y9jVasdeH IYEmScyu7jEojMTu1g5eyj7XAipy3FeTty/ubn5FY6Y3ejK3bAXd+/q0+ml8MNoV6MI1 3xSL3FNmVCeLrs109dt2ha5fnHSy/XWBqppyr6MY3m0g22H3r1JxRcZCLHxcENLFgfpb zHIyqKGT1MJNB3sf9WusR5iHvym6nrBErrEyrITVqmQggqF0XvBRGipw4dTh50S9hgDY JDWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=droCj0KEs9hvPCYHejR4ojipdkVndgiAU/w2hYCJNok=; b=JcAXUpR9UfFcnoafOULbdq0Gk1QHk4bd5urUh1BeNv83CUoJrYU4cdQKefLreFRE6O QPGv+FfIrJK9dERRfKoAZ58Is0TytCsoQjeNEE8YcdLQPQLvSvPhPcOUQX1pI7trqmrv YFJq8dP4ia+fxDYK7fcmgU7rYP63FrVeUWJkXcg4/P4JWeZTFLdGKC+XQS/UxBMKX19y G/u9gr3TB6DQd/ljX9iZMDNAKE6UgjQ36Gjk0Ahj8aO1HgXvxv3CF+xCV/XnlV7HHK72 VxQhd7E1VvuYlDlphiwzwAwkQcoTUNEcCkXCx4PT86XoPsw4thvvhO5FWKsBcl0PcWKB JVjQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q75si822704pfq.220.2018.02.07.22.49.15; Wed, 07 Feb 2018 22:49:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752181AbeBHGsK (ORCPT + 99 others); Thu, 8 Feb 2018 01:48:10 -0500 Received: from mail-out.m-online.net ([212.18.0.10]:59682 "EHLO mail-out.m-online.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750941AbeBHGsJ (ORCPT ); Thu, 8 Feb 2018 01:48:09 -0500 Received: from frontend01.mail.m-online.net (unknown [192.168.8.182]) by mail-out.m-online.net (Postfix) with ESMTP id 3zcTKg5zrMz1qtYF; Thu, 8 Feb 2018 07:48:07 +0100 (CET) Received: from localhost (dynscan1.mnet-online.de [192.168.6.70]) by mail.m-online.net (Postfix) with ESMTP id 3zcTKg5ntJz1t8pj; Thu, 8 Feb 2018 07:48:07 +0100 (CET) X-Virus-Scanned: amavisd-new at mnet-online.de Received: from mail.mnet-online.de ([192.168.8.182]) by localhost (dynscan1.mail.m-online.net [192.168.6.70]) (amavisd-new, port 10024) with ESMTP id 0NtSCFvA7Ig2; Thu, 8 Feb 2018 07:48:07 +0100 (CET) X-Auth-Info: kyGc2O/dNY1VKNhwPYpnmgUPd1VZm6tCuGYjxQjBM9E= Received: from mail-internal.denx.de (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.mnet-online.de (Postfix) with ESMTPSA; Thu, 8 Feb 2018 07:48:07 +0100 (CET) Received: from pollux.denx.de (pollux [192.168.1.1]) by mail-internal.denx.de (Postfix) with ESMTP id 5ABAC180712; Thu, 8 Feb 2018 07:48:00 +0100 (CET) Received: by pollux.denx.de (Postfix, from userid 515) id 30C97CC18; Thu, 8 Feb 2018 07:48:00 +0100 (CET) From: Heiko Schocher To: linux-can@vger.kernel.org Cc: Heiko Schocher , Markus Marb , netdev@vger.kernel.org, Marc Kleine-Budde , linux-kernel@vger.kernel.org, Marek Vasut , Wolfgang Grandegger Subject: [PATCH v2 1/2] net, can, ifi: fix "write buffer full" error Date: Thu, 8 Feb 2018 07:47:47 +0100 Message-Id: <20180208064748.17985-1-hs@denx.de> X-Mailer: git-send-email 2.14.3 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org the driver reads in the ISR first the IRQpending register, and clears after that in a write *all* bits in it. It could happen that the isr register raise bits between this 2 register accesses, which leads in lost bits ... In case it clears "TX message sent successfully", the driver never sends any Tx data, and buffers to userspace run over. Fixed this: clear only the bits in the IRQpending register, the driver had read. Signed-off-by: Heiko Schocher Reviewed-by: Marek Vasut --- Changes in v2: - add Reviewed-by from Marek drivers/net/can/ifi_canfd/ifi_canfd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/ifi_canfd/ifi_canfd.c b/drivers/net/can/ifi_canfd/ifi_canfd.c index 2772d05ff11c..05feb8177936 100644 --- a/drivers/net/can/ifi_canfd/ifi_canfd.c +++ b/drivers/net/can/ifi_canfd/ifi_canfd.c @@ -607,7 +607,7 @@ static irqreturn_t ifi_canfd_isr(int irq, void *dev_id) return IRQ_NONE; /* Clear all pending interrupts but ErrWarn */ - writel(clr_irq_mask, priv->base + IFI_CANFD_INTERRUPT); + writel(isr & clr_irq_mask, priv->base + IFI_CANFD_INTERRUPT); /* RX IRQ or bus warning, start NAPI */ if (isr & rx_irq_mask) { -- 2.14.3