sunxi-usb: Fix stack corruption in sw_hcd0.c

Enlarge aInfo array to fit all text added to it.
Fixes stack corruption, and solves ERR: request_irq 38 failed! error.
sunxi_usb-sw_hcd0: Fix overwriting struct sw_hcd memory

When running the latest sunxi-3.0 on my gooseberry, sw_hcd0 would fail
to init and on plugging in a otg-host cable to enable, because of request_irq
failing. The reason for this failure is that sw_hcd->isr was set to NULL,
as it had been overwritten from ep_config_from_table().

The sw_hcd endpoints array has SW_HCD_C_NUM_EPS entries, and before this
patch that equaled USBC_MAX_EP_NUM. But USBC_MAX_EP_NUM gives the maximum
ep address, and per ep address we've 2 sw_hcd.endpoints entries!

This patch both adds a check for not going out of bounds wrt sw_hcd.endpoints
to ep_config_from_table(), and it fixes SW_HCD_C_NUM_EPS to be
2 * USBC_MAX_EP_NUM. Thus fixing the sw_hcd0 registration / enable and making
the otg port usable in host mode again.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
sunxi_usb: sw_hcd_core_init: Fix a buffer overflow

While looking for the bufferoverflow which was setting sw_hcd->isr to NULL,
I found that if all features are enabled, the aInfo string in sw_hcd_core_init
will overflow. This patch fixes this, and while at it also:
- removes some other unused local variables
- actually prints the carefully build aInfo string
- fixes some glaring coding style issues

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Revert "sunxi_usb-sw_hcd0: Fix overwriting struct sw_hcd memory"

This reverts commit a051008352a0eab3ef24594783de0fe74c0d5759 by
request of the author.

Thanks for merging, your comment made me double check and I'm afraid
my patch titled: "sun4i_usb-sw_hcd0: Fix overwriting struct sw_hcd memory"
is based on me misreading the code. There are n entries in the
mode_4_cfg array, but sw_hcd->endpoints is not addressed by the
i which is iterating over the mode_4_cfg, but instead by
mode_4_cfg[i].hw_ep_num.

This means that fifo_setup and through it USBC_ConfigFifo gets called twice for
each endpoint. But if you trace things further down the call stack, then
USBC_ConfigFifo is a multiplexer function calling USBC_ConfigFifoTx and
USBC_ConfigFifoRx which each set a different set of registers for each function.
so although it seems each ep gets configured twice, it only gets configured once
in a bi-directional manner.

I thought this meant there were separate in/out endpoints per ep address, as that
is how the rest of the world deals with USB endpoints... Anyways.

Conclusion:
1) Floris was completely right, and the stack corruption he found was
   also indirectly corrupting the sw_hcd struct.
2) sw_hcd->endpoints was fine as is.
3) The old ep_config_from_table code was fine wrt its out of bounds checking
   for sw_hcd->endpoints, the only wrong thing in there is this very confusing
   debug print:
     DMSG_DBG_HCD("ep_config_from_table: %s: %d/%d max ep, %d/%d memory\n",
                 sw_hcd_driver_name,
                 n + 1, sw_hcd->config->num_eps * 2 - 1,
                 offset, sw_hcd->config->ram_size);

Which talks about n + 1 versus sw_hcd->config->num_eps * 2 - 1 as endpoint array
usage versus size, which seems wrong to me.

Alejandro, can you please revert my patch titled:
"sun4i_usb-sw_hcd0: Fix overwriting struct sw_hcd memory"

On both 3.0 and 3.4, feel free to use the above as commit message, and to add:

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
ata:sw_achi_platform: fix memory corruption when "sata_used" is 0 in script.bin
sun4i_csi: Fixes kernel bug during camera init, v4l field must be set from camera driver response

Just a one line patch that fixes the camera initialization on the
tablets.  I realize the rest of the driver code from allwinner is ugly
as sin, I'll try and submit a style patch later.

Signed-off-by: Neal Peacock <neal@nic-stix.com>
usb: sunxi: register OTG port as 2.0 instead of 1.1
net sun4i_wmac: Drop obsolete poll_controller assignment.

Failed to compile with netconsole enabled. poll_controller is now
only set in the netdeviceops, not in the netdevice itself.