Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp763018ybl; Wed, 4 Dec 2019 10:26:16 -0800 (PST) X-Google-Smtp-Source: APXvYqz8rL0gpIsf9aaXsH/RDzJ5bUSTLGvFgUWjoixhJNDgohe+22xF8Z9MoRdumuSvR0bt5JNM X-Received: by 2002:aca:de03:: with SMTP id v3mr3914644oig.162.1575483976192; Wed, 04 Dec 2019 10:26:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1575483976; cv=none; d=google.com; s=arc-20160816; b=rb5xb/B2C4d0moFsaIA+JaFL9LgQ+gNCgYEh6mYZMXQldZhR8Kpneto5vT+pJJJDt9 VKn4vovlpVMgdyKT4a7TZ6TTZVpKB/byz+pAyqUdzxX4dl4TNyVMW0G2zCVN4nuaM/rq zh9VGjLOiC+kf5Y1LJmSbSn9ABg+PIfu0DEOsJgx3a3kB9wKoDyeoc5lr4EAvh9GQpV8 OdHCiG7WoTq5tSWXCLNm1wYGzHeE6NGjm0xInaU2lLI/UoHdEw5088oFF/8zr+NgGG5H 2Bz+bzdvP7iWIrZYvtDUywqeCfBaa4G8qjiRAB2kvY8l/KrY5BkHWixdHOXpUmtcjwfx Dn6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=woT6cynZE9Ha9jGp1kyt/4f4RxT0vytqo7DVCSyIg/M=; b=ZhxQlFurf+1AQ4d80zupjmhPkTGz83uPGdqJJ8aYdcj6Mxqrij5A/t3X7HaN3Xg1jt DnQmvPnK7fvs7fDcVIRe5JRQ0f5IjK66yrgWVrwgsrgZKySk9hh+kGQ8PJb3jOcE5DO+ Jydle5kZqM3XfgoVECx380JIWb+/cbxzKbLtBn9vRb/veuPATH7mMPqaZKPOGKKj22cl Ct7oRYcvDqN2IQ07M39PU02Nh1vZ+VBkdgBrQHngcJWguzXdZBUrz2SshuPyZSvWO+H0 HYWkfhBEoTyRUZvLMw6pkIf9hnZD4tCuGoM5G17FhguUzcnO4VCjmVj5WPhHtc05EBsl RR3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=hyT9FL4n; 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 f187si3655697oia.218.2019.12.04.10.26.00; Wed, 04 Dec 2019 10:26:16 -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; dkim=pass header.i=@kernel.org header.s=default header.b=hyT9FL4n; 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 S1729656AbfLDSBr (ORCPT + 99 others); Wed, 4 Dec 2019 13:01:47 -0500 Received: from mail.kernel.org ([198.145.29.99]:42572 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729644AbfLDSBl (ORCPT ); Wed, 4 Dec 2019 13:01:41 -0500 Received: from localhost (unknown [217.68.49.72]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 8C2CA20675; Wed, 4 Dec 2019 18:01:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575482501; bh=Q1BI4t7VuryP7jp7IngtWsjMIyxCI9X1WHqqjjPUh1s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=hyT9FL4n4xUAxPyk5j+aLZx3JQcImKFF/Yd8PsfLlvoIJXntC7qPYQp1jEMUd5HM3 xi0oAtRXP/QVSUVpScJxqGzC1H0ITLEGij5PyozXRW8pvgR12NkiepaSQ48j3Fx55f q3dzFRI/MhkcsTG65eHUsdo75qxcyY8KW9yVKhI4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jeroen Hofstee , Marc Kleine-Budde , Sasha Levin Subject: [PATCH 4.14 021/209] can: rx-offload: can_rx_offload_irq_offload_timestamp(): continue on error Date: Wed, 4 Dec 2019 18:53:53 +0100 Message-Id: <20191204175322.977400077@linuxfoundation.org> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20191204175321.609072813@linuxfoundation.org> References: <20191204175321.609072813@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jeroen Hofstee [ Upstream commit c2a9f74c9d18acfdcabd3361adc7eac82c537a66 ] In case of a resource shortage, i.e. the rx_offload queue will overflow or a skb fails to be allocated (due to OOM), can_rx_offload_offload_one() will call mailbox_read() to discard the mailbox and return an ERR_PTR. However can_rx_offload_irq_offload_timestamp() bails out in the error case. In case of a resource shortage all mailboxes should be discarded, to avoid an IRQ storm and give the system some time to recover. Since can_rx_offload_irq_offload_timestamp() is typically called from a while loop, all message will eventually be discarded. So let's continue on error instead to discard them directly. Signed-off-by: Jeroen Hofstee Signed-off-by: Marc Kleine-Budde Signed-off-by: Sasha Levin --- drivers/net/can/rx-offload.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/can/rx-offload.c b/drivers/net/can/rx-offload.c index 840aef094f208..fef6534f163b7 100644 --- a/drivers/net/can/rx-offload.c +++ b/drivers/net/can/rx-offload.c @@ -225,7 +225,7 @@ int can_rx_offload_irq_offload_timestamp(struct can_rx_offload *offload, u64 pen skb = can_rx_offload_offload_one(offload, i); if (IS_ERR_OR_NULL(skb)) - break; + continue; __skb_queue_add_sort(&skb_queue, skb, can_rx_offload_compare); } -- 2.20.1