I know the issue is originated in either RTL8150 set_registers or
get_registers. We get some unaligned address from the stack to the
ISP1760 priv_read/wite_copy.
The RTL8150 driver does something like this:
u8 data[3], tmp;
data[0] = phy;
data[1] = data[2] = 0;
tmp = indx | PHY_READ | PHY_GO;
i = 0;
set_registers(dev, PHYADD, sizeof(data), data);
Okay. A packed struct with a u8 followed by u16 which is required by the spec can't be fixed. unaligned helper is the only solution. I agree here. Allocating memory on the stack for a dma transfer is wrong.I wonder if it's only us (NOMMU) seeing these odd aligned buffers?Not sure. The only problem I have with this patch is that you might
cover bugs in drivers and you don't notice it anymore since you choose
"voluntary" the slow path.
Well here I disagree, but I agree with the fact that there are buggy
drivers.
Since most processors running Linux do have unaligned access handling,
this issue goes unnoticed for all of them. Believe me the penalty taken
by any Processor doing this automatically and unnoticed is typically
much higher than using get/put_unaligned.
I'm tiered fixing all unaligned issues in drivers. It's a hassle getting
them merged, since most people don't care. Having a workaround in a
single place, the hcd driver is much easier.
-Michael