stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ben Hutchings <ben@decadent.org.uk>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: akpm@linux-foundation.org,
	"Marc Kleine-Budde" <mkl@pengutronix.de>,
	"David Jander" <david@protonic.nl>
Subject: [PATCH 3.2 062/102] can: flexcan: correctly initialize mailboxes
Date: Sat, 01 Nov 2014 22:28:03 +0000	[thread overview]
Message-ID: <lsq.1414880883.264069867@decadent.org.uk> (raw)
In-Reply-To: <lsq.1414880882.522510247@decadent.org.uk>

3.2.64-rc1 review patch.  If anyone has any objections, please let me know.

------------------

From: David Jander <david@protonic.nl>

commit fc05b884a31dbf259cc73cc856e634ec3acbebb6 upstream.

Apparently mailboxes may contain random data at startup, causing some of them
being prepared for message reception. This causes overruns being missed or even
confusing the IRQ check for trasmitted messages, increasing the transmit
counter instead of the error counter.

This patch initializes all mailboxes after the FIFO as RX_INACTIVE.

Signed-off-by: David Jander <david@protonic.nl>
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
---
 drivers/net/can/flexcan.c | 7 +++++++
 1 file changed, 7 insertions(+)

--- a/drivers/net/can/flexcan.c
+++ b/drivers/net/can/flexcan.c
@@ -679,6 +679,7 @@ static int flexcan_chip_start(struct net
 	struct flexcan_regs __iomem *regs = priv->base;
 	int err;
 	u32 reg_mcr, reg_ctrl;
+	int i;
 
 	/* enable module */
 	flexcan_chip_enable(priv);
@@ -744,6 +745,12 @@ static int flexcan_chip_start(struct net
 	dev_dbg(dev->dev.parent, "%s: writing ctrl=0x%08x", __func__, reg_ctrl);
 	flexcan_write(reg_ctrl, &regs->ctrl);
 
+	/* clear and invalidate all mailboxes first */
+	for (i = FLEXCAN_TX_BUF_ID; i < ARRAY_SIZE(regs->cantxfg); i++) {
+		flexcan_write(FLEXCAN_MB_CODE_RX_INACTIVE,
+			      &regs->cantxfg[i].can_ctrl);
+	}
+
 	/* mark TX mailbox as INACTIVE */
 	flexcan_write(FLEXCAN_MB_CODE_TX_INACTIVE,
 		      &regs->cantxfg[FLEXCAN_TX_BUF_ID].can_ctrl);


  parent reply	other threads:[~2014-11-01 22:28 UTC|newest]

Thread overview: 120+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-01 22:28 [PATCH 3.2 000/102] 3.2.64-rc1 review Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 066/102] ALSA: pcm: fix fifo_size frame calculation Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 080/102] ipv4: avoid parallel route cache gc executions Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 019/102] xfs: don't dirty buffers beyond EOF Ben Hutchings
2014-11-04  7:09   ` Dave Chinner
2014-11-05 19:58     ` Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 065/102] can: at91_can: add missing prepare and unprepare of the clock Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 027/102] ahci: add pcid for Marvel 0x9182 controller Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 090/102] KVM: x86: Fix wrong masking on relative jump/call Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 028/102] drm/radeon: add connector quirk for fujitsu board Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 091/102] KVM: x86: Emulator fixes for eip canonical checks on near branches Ben Hutchings
2014-11-02  8:44   ` Nadav Amit
2014-11-03 13:51     ` Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 018/102] drm/vmwgfx: Fix a potential infinite spin waiting for fifo idle Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 097/102] x86,kvm,vmx: Preserve CR4 across VM entry Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 068/102] parisc: Only use -mfast-indirect-calls option for 32-bit kernel builds Ben Hutchings
2014-11-01 22:28 ` Ben Hutchings [this message]
2014-11-01 22:28 ` [PATCH 3.2 082/102] ipv6: reallocate addrconf router for ipv6 address when lo device up Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 032/102] uwb: init beacon cache entry before registering uwb device Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 053/102] iscsi-target: Fix memory corruption in iscsit_logout_post_handler_diffcid Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 102/102] ring-buffer: Fix infinite spin in reading buffer Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 059/102] USB: storage: Add quirks for Entrega/Xircom USB to SCSI converters Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 031/102] USB: ftdi_sio: Add support for GE Healthcare Nemo Tracker device Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 020/102] ALSA: hda - Fix COEF setups for ALC1150 codec Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 092/102] KVM: x86: use new CS.RPL as CPL during task switch Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 064/102] can: flexcan: put TX mailbox into TX_INACTIVE mode after tx-complete Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 029/102] usb: host: xhci: fix compliance mode workaround Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 044/102] Input: i8042 - add nomux quirk for Avatar AVIU-145A6 Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 055/102] NFSv4: Fix another bug in the close/open_downgrade code Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 039/102] Input: serport - add compat handling for SPIOCSTYPE ioctl Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 056/102] [SCSI] libiscsi: fix potential buffer overrun in __iscsi_conn_send_pdu Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 014/102] Revert "iwlwifi: dvm: don't enable CTS to self" Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 034/102] Input: synaptics - add support for ForcePads Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 060/102] nl80211: clear skb cb before passing to netlink Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 021/102] xen/manage: Always freeze/thaw processes when suspend/resuming Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 081/102] ipv4: disable bh while doing route gc Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 075/102] mm: migrate: Close race between migration completion and mprotect Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 023/102] block: Fix dev_t minor allocation lifetime Ben Hutchings
2014-11-01 23:18   ` Jens Axboe
2014-11-01 23:48     ` Ben Hutchings
2014-11-03  1:24       ` Jens Axboe
2014-11-01 22:28 ` [PATCH 3.2 033/102] perf: Fix a race condition in perf_remove_from_context() Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 010/102] regmap: Fix handling of volatile registers for format_write() chips Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 057/102] USB: storage: Add quirk for Adaptec USBConnect 2000 USB-to-SCSI Adapter Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 052/102] be careful with nd->inode in path_init() and follow_dotdot_rcu() Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 047/102] alarmtimer: Return relative times in timer_gettime Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 096/102] net: sctp: fix remote memory pressure from excessive queueing Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 030/102] Input: elantech - fix detection of touchpad on ASUS s301l Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 074/102] shmem: fix nlink for rename overwrite directory Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 087/102] nEPT: Nested INVEPT Ben Hutchings
2014-11-02  9:03   ` Paolo Bonzini
2014-11-03 13:44     ` Ben Hutchings
2014-11-03 15:29       ` Paolo Bonzini
2014-11-05 20:21         ` Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 073/102] ocfs2/dlm: do not get resource spinlock if lockres is new Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 079/102] ipv4: move route garbage collector to work queue Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 017/102] USB: sierra: add 1199:68AA device ID Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 043/102] Input: i8042 - add Fujitsu U574 to no_timeout dmi table Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 011/102] drm/i915: Remove bogus __init annotation from DMI callbacks Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 001/102] regulatory: add NUL to alpha2 Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 002/102] percpu: fix pcpu_alloc_pages() failure path Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 006/102] KVM: s390: Fix user triggerable bug in dead code Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 048/102] alarmtimer: Do not signal SIGEV_NONE timers Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 071/102] MIPS: mcount: Adjust stack pointer for static trace in MIPS32 Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 041/102] storage: Add single-LUN quirk for Jaz USB Adapter Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 098/102] dm crypt: fix access beyond the end of allocated space Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 093/102] KVM: x86: Handle errors when RIP is set during far jumps Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 099/102] ext2: Fix fs corruption in ext2_get_xip_mem() Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 051/102] vfs: Fold follow_mount_rcu() into follow_dotdot_rcu() Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 013/102] ata_piix: Add Device IDs for Intel 9 Series PCH Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 058/102] USB: storage: Add quirk for Ariston Technologies iConnect USB to SCSI adapter Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 085/102] KVM: x86: Check non-canonical addresses upon WRMSR Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 040/102] usb: hub: take hub->hdev reference when processing from eventlist Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 004/102] percpu: free percpu allocation info for uniprocessor system Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 084/102] ipv6: reuse ip6_frag_id from ip6_ufo_append_data Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 063/102] can: flexcan: implement workaround for errata ERR005829 Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 094/102] net: sctp: fix skb_over_panic when receiving malformed ASCONF chunks Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 101/102] ipvs: avoid netns exit crash on ip_vs_conn_drop_conntrack Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 049/102] alarmtimer: Lock k_itimer during timer callback Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 100/102] nfsd: Fix ACL null pointer deref Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 022/102] aio: add missing smp_rmb() in read_events_ring Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 007/102] rtlwifi: rtl8192cu: Add new ID Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 045/102] futex: Unlock hb->lock in futex_wait_requeue_pi() error path Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 072/102] nilfs2: fix data loss with mmap() Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 088/102] kvm: vmx: handle invvpid vm exit gracefully Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 095/102] net: sctp: fix panic on duplicate ASCONF chunks Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 076/102] perf: fix perf bug in fork() Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 008/102] MIPS: ZBOOT: add missing <linux/string.h> include Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 083/102] ext4: fix BUG_ON in mb_free_blocks() Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 070/102] ARM: 8165/1: alignment: don't break misaligned NEON load/store Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 036/102] libceph: gracefully handle large reply messages from the mon Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 086/102] KVM: x86: Improve thread safety in pit Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 005/102] cgroup: reject cgroup names with '\n' Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 067/102] Fix nasty 32-bit overflow bug in buffer i/o code Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 078/102] MIPS: Fix forgotten preempt_enable() when CPU has inclusive pcaches Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 038/102] libceph: do not hard code max auth ticket len Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 012/102] ahci: Add Device IDs for Intel 9 Series PCH Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 050/102] don't bugger nd->seq on set_root_rcu() from follow_dotdot_rcu() Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 015/102] USB: ftdi_sio: add support for NOVITUS Bono E thermal printer Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 035/102] libceph: rename ceph_msg::front_max to front_alloc_len Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 024/102] ACPI / cpuidle: fix deadlock between cpuidle_lock and cpu_hotplug.lock Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 089/102] KVM: x86 emulator: Use opcode::execute for CALL Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 077/102] init/Kconfig: Hide printk log config if CONFIG_PRINTK=n Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 054/102] iscsi-target: avoid NULL pointer in iscsi_copy_param_list failure Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 037/102] libceph: add process_one_ticket() helper Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 061/102] can: flexcan: mark TX mailbox as TX_INACTIVE Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 042/102] xhci: Fix null pointer dereference if xhci initialization fails Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 026/102] usb: dwc3: core: fix order of PM runtime calls Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 069/102] sched: Fix unreleased llc_shared_mask bit during CPU hotplug Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 003/102] percpu: perform tlb flush after pcpu_map_pages() failure Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 009/102] regmap: if format_write is used, declare all registers as "unreadable" Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 046/102] jiffies: Fix timeval conversion to jiffies Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 016/102] USB: sierra: avoid CDC class functions on "68A3" devices Ben Hutchings
2014-11-01 22:28 ` [PATCH 3.2 025/102] usb: dwc3: core: use pm_runtime_put_sync() on remove Ben Hutchings
2014-11-01 23:12 ` [PATCH 3.2 000/102] 3.2.64-rc1 review Ben Hutchings
2014-11-01 23:46   ` Ben Hutchings
2014-11-01 23:29 ` Guenter Roeck
2014-11-01 23:43   ` Ben Hutchings
2014-11-03 10:32 ` Guillaume Nault
2014-11-03 13:54   ` Ben Hutchings

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=lsq.1414880883.264069867@decadent.org.uk \
    --to=ben@decadent.org.uk \
    --cc=akpm@linux-foundation.org \
    --cc=david@protonic.nl \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkl@pengutronix.de \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).