Hi Arnd,
After merging the asm-generic tree, today's linux-next build (arm
multi_v7_defconfig) failed like this:
drivers/usb/musb/musb_host.c: In function 'musb_rx_reinit':
drivers/usb/musb/musb_host.c:577:10: error: 'struct musb' has no member named 'double_buffer_not_ok'
if (musb->double_buffer_not_ok)
^~
drivers/usb/musb/musb_host.c: In function 'musb_ep_program':
drivers/usb/musb/musb_host.c:807:12: error: 'struct musb' has no member named 'double_buffer_not_ok'
if (musb->double_buffer_not_ok) {
^~
Caused by commit
8312c0cad792 ("usb: musb: remove blackfin port")
I have applied the following patch for today:
From: Stephen Rothwell <[email protected]>
Date: Fri, 16 Mar 2018 08:58:41 +1100
Subject: [PATCH] usb: musb: more blackfin removal
Signed-off-by: Stephen Rothwell <[email protected]>
---
drivers/usb/musb/musb_gadget.c | 21 +++++++--------------
drivers/usb/musb/musb_host.c | 12 +++---------
2 files changed, 10 insertions(+), 23 deletions(-)
diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
index 58a41b54763b..e564695c6c8d 100644
--- a/drivers/usb/musb/musb_gadget.c
+++ b/drivers/usb/musb/musb_gadget.c
@@ -995,15 +995,11 @@ static int musb_gadget_enable(struct usb_ep *ep,
/* Set TXMAXP with the FIFO size of the endpoint
* to disable double buffering mode.
*/
- if (musb->double_buffer_not_ok) {
- musb_writew(regs, MUSB_TXMAXP, hw_ep->max_packet_sz_tx);
- } else {
- if (can_bulk_split(musb, musb_ep->type))
- musb_ep->hb_mult = (hw_ep->max_packet_sz_tx /
- musb_ep->packet_sz) - 1;
- musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz
- | (musb_ep->hb_mult << 11));
- }
+ if (can_bulk_split(musb, musb_ep->type))
+ musb_ep->hb_mult = (hw_ep->max_packet_sz_tx /
+ musb_ep->packet_sz) - 1;
+ musb_writew(regs, MUSB_TXMAXP, musb_ep->packet_sz
+ | (musb_ep->hb_mult << 11));
csr = MUSB_TXCSR_MODE | MUSB_TXCSR_CLRDATATOG;
if (musb_readw(regs, MUSB_TXCSR)
@@ -1038,11 +1034,8 @@ static int musb_gadget_enable(struct usb_ep *ep,
/* Set RXMAXP with the FIFO size of the endpoint
* to disable double buffering mode.
*/
- if (musb->double_buffer_not_ok)
- musb_writew(regs, MUSB_RXMAXP, hw_ep->max_packet_sz_tx);
- else
- musb_writew(regs, MUSB_RXMAXP, musb_ep->packet_sz
- | (musb_ep->hb_mult << 11));
+ musb_writew(regs, MUSB_RXMAXP, musb_ep->packet_sz
+ | (musb_ep->hb_mult << 11));
/* force shared fifo to OUT-only mode */
if (hw_ep->is_shared_fifo) {
diff --git a/drivers/usb/musb/musb_host.c b/drivers/usb/musb/musb_host.c
index 45ed32c2cba9..3a8451a15f7f 100644
--- a/drivers/usb/musb/musb_host.c
+++ b/drivers/usb/musb/musb_host.c
@@ -574,11 +574,8 @@ musb_rx_reinit(struct musb *musb, struct musb_qh *qh, u8 epnum)
/* Set RXMAXP with the FIFO size of the endpoint
* to disable double buffer mode.
*/
- if (musb->double_buffer_not_ok)
- musb_writew(ep->regs, MUSB_RXMAXP, ep->max_packet_sz_rx);
- else
- musb_writew(ep->regs, MUSB_RXMAXP,
- qh->maxpacket | ((qh->hb_mult - 1) << 11));
+ musb_writew(ep->regs, MUSB_RXMAXP,
+ qh->maxpacket | ((qh->hb_mult - 1) << 11));
ep->rx_reinit = 0;
}
@@ -804,10 +801,7 @@ static void musb_ep_program(struct musb *musb, u8 epnum,
/* protocol/endpoint/interval/NAKlimit */
if (epnum) {
musb_writeb(epio, MUSB_TXTYPE, qh->type_reg);
- if (musb->double_buffer_not_ok) {
- musb_writew(epio, MUSB_TXMAXP,
- hw_ep->max_packet_sz_tx);
- } else if (can_bulk_split(musb, qh->type)) {
+ if (can_bulk_split(musb, qh->type)) {
qh->hb_mult = hw_ep->max_packet_sz_tx
/ packet_sz;
musb_writew(epio, MUSB_TXMAXP, packet_sz
--
2.16.1
--
Cheers,
Stephen Rothwell
Hi,
On Fri, Mar 16, 2018 at 09:13:55AM +1100, Stephen Rothwell wrote:
> Hi Arnd,
>
> After merging the asm-generic tree, today's linux-next build (arm
> multi_v7_defconfig) failed like this:
>
> drivers/usb/musb/musb_host.c: In function 'musb_rx_reinit':
> drivers/usb/musb/musb_host.c:577:10: error: 'struct musb' has no member named 'double_buffer_not_ok'
> if (musb->double_buffer_not_ok)
> ^~
> drivers/usb/musb/musb_host.c: In function 'musb_ep_program':
> drivers/usb/musb/musb_host.c:807:12: error: 'struct musb' has no member named 'double_buffer_not_ok'
> if (musb->double_buffer_not_ok) {
> ^~
>
> Caused by commit
>
> 8312c0cad792 ("usb: musb: remove blackfin port")
I don't have a clone of the asm-generic tree to check, but this patch
Arnd sent yesterday for review doesn't remove double_buffer_not_ok from
struct musb. Is it removed when Arnd you were revising it based on my
review comments? Anyway, it is better to remove it too since this flag
is Blackfin specific, but...
>
> I have applied the following patch for today:
>
> From: Stephen Rothwell <[email protected]>
> Date: Fri, 16 Mar 2018 08:58:41 +1100
> Subject: [PATCH] usb: musb: more blackfin removal
>
> Signed-off-by: Stephen Rothwell <[email protected]>
...is it possible to combine this fixup patch with the original patch to
avoid bisect headache in the future?
Regards,
-Bin.
On Thu, Mar 15, 2018 at 11:47 PM, Bin Liu <[email protected]> wrote:
> Hi,
>
> On Fri, Mar 16, 2018 at 09:13:55AM +1100, Stephen Rothwell wrote:
>> Hi Arnd,
>>
>> After merging the asm-generic tree, today's linux-next build (arm
>> multi_v7_defconfig) failed like this:
>>
>> drivers/usb/musb/musb_host.c: In function 'musb_rx_reinit':
>> drivers/usb/musb/musb_host.c:577:10: error: 'struct musb' has no member named 'double_buffer_not_ok'
>> if (musb->double_buffer_not_ok)
>> ^~
>> drivers/usb/musb/musb_host.c: In function 'musb_ep_program':
>> drivers/usb/musb/musb_host.c:807:12: error: 'struct musb' has no member named 'double_buffer_not_ok'
>> if (musb->double_buffer_not_ok) {
>> ^~
>>
>> Caused by commit
>>
>> 8312c0cad792 ("usb: musb: remove blackfin port")
Sorry about that, I should have done more testing after updating the patch.
Aaron sent a second version of the blackfin removal, and after comparing
his version with mine, I picked up a couple of extra hunks that I folded
into my patch series, including the two musb bits below.
> I don't have a clone of the asm-generic tree to check, but this patch
> Arnd sent yesterday for review doesn't remove double_buffer_not_ok from
> struct musb. Is it removed when Arnd you were revising it based on my
> review comments? Anyway, it is better to remove it too since this flag
> is Blackfin specific, but is it possible to combine this fixup patch with the
> original patch to avoid bisect headache in the future?
Sure, doing that now.
Arnd
8<---
diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c
index 011c8ca7de42..13486588e561 100644
--- a/drivers/usb/musb/musb_core.c
+++ b/drivers/usb/musb/musb_core.c
@@ -2166,7 +2166,7 @@ musb_init_controller(struct device *dev, int
nIrq, void __iomem *ctrl)
* - initializes musb->xceiv, usually by otg_get_phy()
* - stops powering VBUS
*
- * There are various transceiver configurations. Blackfin,
+ * There are various transceiver configurations.
* DaVinci, TUSB60x0, and others integrate them. OMAP3 uses
* external/discrete ones in various flavors (twl4030 family,
* isp1504, non-OTG, etc) mostly hooking up through ULPI.
diff --git a/drivers/usb/musb/musb_core.h b/drivers/usb/musb/musb_core.h
index ac675b1a34c4..8a74cb2907f8 100644
--- a/drivers/usb/musb/musb_core.h
+++ b/drivers/usb/musb/musb_core.h
@@ -414,19 +414,6 @@ struct musb {
struct usb_gadget_driver *gadget_driver; /* its driver */
struct usb_hcd *hcd; /* the usb hcd */
- /*
- * FIXME: Remove this flag.
- *
- * This is only added to allow Blackfin to work
- * with current driver. For some unknown reason
- * Blackfin doesn't work with double buffering
- * and that's enabled by default.
- *
- * We added this flag to forcefully disable double
- * buffering until we get it working.
- */
- unsigned double_buffer_not_ok:1;
-
const struct musb_hdrc_config *config;
int xceiv_old_state;