Re: [PATCH] usb: musb: Fix fifo reads for dm816x with musb_dsps

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, 18 Mar 2015 15:48:02 -0700 Tony Lindgren <tony@xxxxxxxxxxx> wrote:

> Looks like dm81xx can only do 32-bit fifo reads like am35x. Let's set
> up musb-dsps with a custom read_fifo function based on the compatible
> flag.
> 
> Otherwise we can get the following errors when starting dhclient on a
> asix USB Ethernet adapter:
> 
> asix 2-1:1.0 eth2: asix_rx_fixup() Bad Header Length 0xffff003c, offset 4
> 
> While at it, let's also remove pointless cast of the driver data.

This breaks my i386 allmodconfig build.

> +/* Similar to am35x, dm81xx support only 32-bit read operation */
> +static void dsps_read_fifo32(struct musb_hw_ep *hw_ep, u16 len, u8 *dst)
> +{
> +	void __iomem *fifo = hw_ep->fifo;
> +	u32		val;
> +	int		i;
> +
> +	/* Read for 32bit-aligned destination address */
> +	if (likely((0x03 & (unsigned long)dst) == 0) && len >= 4) {
> +		readsl(fifo, dst, len >> 2);

akpm3:/usr/src/linux-4.0-rc6> grep -r readsl arch/x86 
akpm3:/usr/src/linux-4.0-rc6> 

> +		dst += len & ~0x03;
> +		len &= 0x03;
> +	}
> +	/*
> +	 * Now read the remaining 1 to 3 byte or complete length if
> +	 * unaligned address.
> +	 */
> +	if (len > 4) {
> +		for (i = 0; i < (len >> 2); i++) {
> +			*(u32 *)dst = musb_readl(fifo, 0);
> +			dst += 4;
> +		}
> +		len &= 0x03;
> +	}
> +	if (len > 0) {
> +		val = musb_readl(fifo, 0);
> +		memcpy(dst, &val, len);
> +	}
> +}

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux