Skip to content

Commit

Permalink
Merge tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/ke…
Browse files Browse the repository at this point in the history
…rnel/git/ieee1394/linux1394

Pull firewire updates from Stefan Richter

  - make JMicron JMB38x controllers work with IOMMU-equipped systems

  - IP-over-1394: allow user-configured MTU of up to 4096 bytes

* tag 'firewire-updates' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394/linux1394:
  firewire-ohci: work around oversized DMA reads on JMicron controllers
  firewire: net: max MTU off by one
  • Loading branch information
torvalds committed Feb 2, 2018
2 parents ef99179 + 1887751 commit d3581c8
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
7 changes: 6 additions & 1 deletion drivers/firewire/net.c
Original file line number Diff line number Diff line change
Expand Up @@ -1480,9 +1480,14 @@ static int fwnet_probe(struct fw_unit *unit,
goto out;
dev->local_fifo = dev->handler.offset;

/*
* default MTU: RFC 2734 cl. 4, RFC 3146 cl. 4
* maximum MTU: RFC 2734 cl. 4.2, fragment encapsulation header's
* maximum possible datagram_size + 1 = 0xfff + 1
*/
net->mtu = 1500U;
net->min_mtu = ETH_MIN_MTU;
net->max_mtu = 0xfff;
net->max_mtu = 4096U;

/* Set our hardware address while we're at it */
ha = (union fwnet_hwaddr *)net->dev_addr;
Expand Down
8 changes: 7 additions & 1 deletion drivers/firewire/ohci.c
Original file line number Diff line number Diff line change
Expand Up @@ -1128,7 +1128,13 @@ static int context_add_buffer(struct context *ctx)
return -ENOMEM;

offset = (void *)&desc->buffer - (void *)desc;
desc->buffer_size = PAGE_SIZE - offset;
/*
* Some controllers, like JMicron ones, always issue 0x20-byte DMA reads
* for descriptors, even 0x10-byte ones. This can cause page faults when
* an IOMMU is in use and the oversized read crosses a page boundary.
* Work around this by always leaving at least 0x10 bytes of padding.
*/
desc->buffer_size = PAGE_SIZE - offset - 0x10;
desc->buffer_bus = bus_addr + offset;
desc->used = 0;

Expand Down

0 comments on commit d3581c8

Please sign in to comment.