RE: FIX ME in oxu210p-hcd.c

2014-09-21 Thread Peter Chen

 
 Subject: Re: FIX ME in oxu210p-hcd.c
 
 
 I found a unfixed FIX ME in the file stated in my above message. I am
 wondering what to set hcd-self.comtroller-dma_mask to as it's now been
 defined to NULL and clearly even as a newbie this seem incorrect.
 Regards Nick

Usually, it is set at its controller driver or pass through through device tree 
or
platform data.

Peter


Re: FIX ME in oxu210p-hcd.c

2014-09-21 Thread nick


On 14-09-21 07:53 PM, Peter Chen wrote:
 
  
 Subject: Re: FIX ME in oxu210p-hcd.c


 I found a unfixed FIX ME in the file stated in my above message. I am
 wondering what to set hcd-self.comtroller-dma_mask to as it's now been
 defined to NULL and clearly even as a newbie this seem incorrect.
 Regards Nick
 
 Usually, it is set at its controller driver or pass through through device 
 tree or
 platform data.
 
 Peter
 
Sorry Peter,
I apologize for asking for more help here but I will paste the function below 
and with my changes.
Please let me known if I am wrong and how to fix it as I new here.
Sorry for Wasting Your Time,
Nick 
static int oxu_reset(struct usb_hcd *hcd)
{
struct oxu_hcd *oxu = hcd_to_oxu(hcd);
int ret;

spin_lock_init(oxu-mem_lock);
INIT_LIST_HEAD(oxu-urb_list);
oxu-urb_len = 0;

-   /* FIMXE */
+   hcd-self.controller-dma_mask = hcd-regs;

if (oxu-is_otg) {
oxu-caps = hcd-regs + OXU_OTG_CAP_OFFSET;
oxu-regs = hcd-regs + OXU_OTG_CAP_OFFSET + \
HC_LENGTH(readl(oxu-caps-hc_capbase));
 
oxu-mem = hcd-regs + OXU_SPH_MEM;
} else {
oxu-caps = hcd-regs + OXU_SPH_CAP_OFFSET;
oxu-regs = hcd-regs + OXU_SPH_CAP_OFFSET + \
HC_LENGTH(readl(oxu-caps-hc_capbase));

oxu-mem = hcd-regs + OXU_OTG_MEM;
}

oxu-hcs_params = readl(oxu-caps-hcs_params);
oxu-sbrn = 0x20;

ret = oxu_hcd_init(hcd);
if (ret)
return ret;
 
return 0;
}
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


RE: FIX ME in oxu210p-hcd.c

2014-09-21 Thread Peter Chen

 
  Subject: Re: FIX ME in oxu210p-hcd.c
 
 
  I found a unfixed FIX ME in the file stated in my above message. I am
  wondering what to set hcd-self.comtroller-dma_mask to as it's now
  been defined to NULL and clearly even as a newbie this seem incorrect.
  Regards Nick
 
  Usually, it is set at its controller driver or pass through through
  device tree or platform data.
 
  Peter
 
 Sorry Peter,
 I apologize for asking for more help here but I will paste the function below 
 and
 with my changes.
 Please let me known if I am wrong and how to fix it as I new here.
 Sorry for Wasting Your Time,

You are welcome

 Nick
 static int oxu_reset(struct usb_hcd *hcd) {
   struct oxu_hcd *oxu = hcd_to_oxu(hcd);
   int ret;
 
   spin_lock_init(oxu-mem_lock);
   INIT_LIST_HEAD(oxu-urb_list);
   oxu-urb_len = 0;
 
 - /* FIMXE */
 + hcd-self.controller-dma_mask = hcd-regs;
 

It is the dma mask, not the register.

Try below patch to see if it works for you:

diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index da5fb0e..5549851 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -37,6 +37,7 @@
 #include linux/moduleparam.h
 #include linux/dma-mapping.h
 #include linux/io.h
+#include linux/dma-mapping.h
 
 #include asm/irq.h
 #include asm/unaligned.h
@@ -3841,6 +3842,12 @@ static int oxu_drv_probe(struct platform_device *pdev)
goto error;
}
 
+   ret = dma_coerce_mask_and_coherent(pdev-dev, DMA_BIT_MASK(32));
+   if (ret) {
+   dev_err(pdev-dev, set dma mask error\n);
+   goto error;
+   }
+
/* Allocate a driver data struct to hold useful info for both
 * SPH  OTG devices
 */

Peter


   if (oxu-is_otg) {
   oxu-caps = hcd-regs + OXU_OTG_CAP_OFFSET;
   oxu-regs = hcd-regs + OXU_OTG_CAP_OFFSET + \
   HC_LENGTH(readl(oxu-caps-hc_capbase));
 
   oxu-mem = hcd-regs + OXU_SPH_MEM;
   } else {
   oxu-caps = hcd-regs + OXU_SPH_CAP_OFFSET;
   oxu-regs = hcd-regs + OXU_SPH_CAP_OFFSET + \
   HC_LENGTH(readl(oxu-caps-hc_capbase));
 
   oxu-mem = hcd-regs + OXU_OTG_MEM;
   }
 
   oxu-hcs_params = readl(oxu-caps-hcs_params);
   oxu-sbrn = 0x20;
 
   ret = oxu_hcd_init(hcd);
   if (ret)
   return ret;
 
   return 0;
 }


Re: FIX ME in oxu210p-hcd.c

2014-09-21 Thread gre...@linuxfoundation.org
On Sun, Sep 21, 2014 at 10:03:28PM -0400, nick wrote:
 
 
 On 14-09-21 07:53 PM, Peter Chen wrote:
  
   
  Subject: Re: FIX ME in oxu210p-hcd.c
 
 
  I found a unfixed FIX ME in the file stated in my above message. I am
  wondering what to set hcd-self.comtroller-dma_mask to as it's now been
  defined to NULL and clearly even as a newbie this seem incorrect.
  Regards Nick
  
  Usually, it is set at its controller driver or pass through through device 
  tree or
  platform data.
  
  Peter
  
 Sorry Peter,
 I apologize for asking for more help here but I will paste the function below 
 and with my changes.
 Please let me known if I am wrong and how to fix it as I new here.
 Sorry for Wasting Your Time,

Then please do not.  Just because your other email addresses were banned
from lkml, don't keep popping up and bothering people, it's rude, and
will cause this address to be banned as well.

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


Re: FIX ME in oxu210p-hcd.c

2014-09-21 Thread nick


On 14-09-21 10:11 PM, gre...@linuxfoundation.org wrote:
 On Sun, Sep 21, 2014 at 10:03:28PM -0400, nick wrote:


 On 14-09-21 07:53 PM, Peter Chen wrote:

  
 Subject: Re: FIX ME in oxu210p-hcd.c


 I found a unfixed FIX ME in the file stated in my above message. I am
 wondering what to set hcd-self.comtroller-dma_mask to as it's now been
 defined to NULL and clearly even as a newbie this seem incorrect.
 Regards Nick

 Usually, it is set at its controller driver or pass through through device 
 tree or
 platform data.

 Peter

 Sorry Peter,
 I apologize for asking for more help here but I will paste the function 
 below and with my changes.
 Please let me known if I am wrong and how to fix it as I new here.
 Sorry for Wasting Your Time,
 
 Then please do not.  Just because your other email addresses were banned
 from lkml, don't keep popping up and bothering people, it's rude, and
 will cause this address to be banned as well.
 
Sorry Greg,
I don't want to get banned again. I was trying to help out and learn, I was 
apologizing not
for wasting time as much as for making sure I wasn't wasting maintainer time 
again. I also 
am coming to the conclusion that my terrible patches were a waste of time and I 
am trying 
to get back into helping out.
Cheers,
Nick  
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: FIX ME in oxu210p-hcd.c

2014-09-21 Thread gre...@linuxfoundation.org
On Sun, Sep 21, 2014 at 10:17:38PM -0400, nick wrote:
 
 
 On 14-09-21 10:11 PM, gre...@linuxfoundation.org wrote:
  On Sun, Sep 21, 2014 at 10:03:28PM -0400, nick wrote:
 
 
  On 14-09-21 07:53 PM, Peter Chen wrote:
 
   
  Subject: Re: FIX ME in oxu210p-hcd.c
 
 
  I found a unfixed FIX ME in the file stated in my above message. I am
  wondering what to set hcd-self.comtroller-dma_mask to as it's now been
  defined to NULL and clearly even as a newbie this seem incorrect.
  Regards Nick
 
  Usually, it is set at its controller driver or pass through through 
  device tree or
  platform data.
 
  Peter
 
  Sorry Peter,
  I apologize for asking for more help here but I will paste the function 
  below and with my changes.
  Please let me known if I am wrong and how to fix it as I new here.
  Sorry for Wasting Your Time,
  
  Then please do not.  Just because your other email addresses were banned
  from lkml, don't keep popping up and bothering people, it's rude, and
  will cause this address to be banned as well.
  
 Sorry Greg,
 I don't want to get banned again. I was trying to help out and learn, I was 
 apologizing not
 for wasting time as much as for making sure I wasn't wasting maintainer time 
 again. I also 
 am coming to the conclusion that my terrible patches were a waste of time and 
 I am trying 
 to get back into helping out.

You were asked to finish the Eudyptula challenge before bothering any
other kernel developers with questions / patches.  Until that happens,
you are in my killfile, now with yet-another-email-address.

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


Re: FIX ME in oxu210p-hcd.c

2014-09-21 Thread nick


On 14-09-21 10:11 PM, Peter Chen wrote:
 
  
 Subject: Re: FIX ME in oxu210p-hcd.c


 I found a unfixed FIX ME in the file stated in my above message. I am
 wondering what to set hcd-self.comtroller-dma_mask to as it's now
 been defined to NULL and clearly even as a newbie this seem incorrect.
 Regards Nick

 Usually, it is set at its controller driver or pass through through
 device tree or platform data.

 Peter

 Sorry Peter,
 I apologize for asking for more help here but I will paste the function 
 below and
 with my changes.
 Please let me known if I am wrong and how to fix it as I new here.
 Sorry for Wasting Your Time,
 
 You are welcome
 
 Nick
 static int oxu_reset(struct usb_hcd *hcd) {
  struct oxu_hcd *oxu = hcd_to_oxu(hcd);
  int ret;

  spin_lock_init(oxu-mem_lock);
  INIT_LIST_HEAD(oxu-urb_list);
  oxu-urb_len = 0;

 -/* FIMXE */
 +hcd-self.controller-dma_mask = hcd-regs;

 
 It is the dma mask, not the register.
 
 Try below patch to see if it works for you:
 
 diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
 index da5fb0e..5549851 100644
 --- a/drivers/usb/host/oxu210hp-hcd.c
 +++ b/drivers/usb/host/oxu210hp-hcd.c
 @@ -37,6 +37,7 @@
  #include linux/moduleparam.h
  #include linux/dma-mapping.h
  #include linux/io.h
 +#include linux/dma-mapping.h
  
  #include asm/irq.h
  #include asm/unaligned.h
 @@ -3841,6 +3842,12 @@ static int oxu_drv_probe(struct platform_device *pdev)
 goto error;
 }
  
 +   ret = dma_coerce_mask_and_coherent(pdev-dev, DMA_BIT_MASK(32));
 +   if (ret) {
 +   dev_err(pdev-dev, set dma mask error\n);
 +   goto error;
 +   }
 +
 /* Allocate a driver data struct to hold useful info for both
  * SPH  OTG devices
  */
 
 Peter
 
 
  if (oxu-is_otg) {
  oxu-caps = hcd-regs + OXU_OTG_CAP_OFFSET;
  oxu-regs = hcd-regs + OXU_OTG_CAP_OFFSET + \
  HC_LENGTH(readl(oxu-caps-hc_capbase));

  oxu-mem = hcd-regs + OXU_SPH_MEM;
  } else {
  oxu-caps = hcd-regs + OXU_SPH_CAP_OFFSET;
  oxu-regs = hcd-regs + OXU_SPH_CAP_OFFSET + \
  HC_LENGTH(readl(oxu-caps-hc_capbase));

  oxu-mem = hcd-regs + OXU_OTG_MEM;
  }

  oxu-hcs_params = readl(oxu-caps-hcs_params);
  oxu-sbrn = 0x20;

  ret = oxu_hcd_init(hcd);
  if (ret)
  return ret;

  return 0;
 }
Unfortunately I can't get it to apply with git apply and get the following 
message,
 Checking patch drivers/usb/host/oxu210hp-hcd.c...
error: while searching for:
   goto error;
   }

   /* Allocate a driver data struct to hold useful info for both
* SPH  OTG devices
*/

error: patch failed: drivers/usb/host/oxu210hp-hcd.c:3841
error: drivers/usb/host/oxu210hp-hcd.c: patch does not apply
I will paste the version of my patch file for your troubles.
Regards Nick 
diff --git a/drivers/usb/host/oxu210hp-hcd.c b/drivers/usb/host/oxu210hp-hcd.c
index da5fb0e..5549851 100644
--- a/drivers/usb/host/oxu210hp-hcd.c
+++ b/drivers/usb/host/oxu210hp-hcd.c
@@ -37,6 +37,7 @@
 #include linux/moduleparam.h
 #include linux/dma-mapping.h
 #include linux/io.h
+#include linux/dma-mapping.h
 
 #include asm/irq.h
 #include asm/unaligned.h
@@ -3841,6 +3842,12 @@ static int oxu_drv_probe(struct platform_device *pdev)
goto error;
}
 
+   ret = dma_coerce_mask_and_coherent(pdev-dev, DMA_BIT_MASK(32));
+   if (ret) {
+   dev_err(pdev-dev, set dma mask error\n);
+   goto error;
+   }
+
/* Allocate a driver data struct to hold useful info for both
 * SPH  OTG devices
 */


Re: FIX ME in oxu210p-hcd.c

2014-09-21 Thread nick


On 14-09-21 10:24 PM, gre...@linuxfoundation.org wrote:
 On Sun, Sep 21, 2014 at 10:17:38PM -0400, nick wrote:


 On 14-09-21 10:11 PM, gre...@linuxfoundation.org wrote:
 On Sun, Sep 21, 2014 at 10:03:28PM -0400, nick wrote:


 On 14-09-21 07:53 PM, Peter Chen wrote:

  
 Subject: Re: FIX ME in oxu210p-hcd.c


 I found a unfixed FIX ME in the file stated in my above message. I am
 wondering what to set hcd-self.comtroller-dma_mask to as it's now been
 defined to NULL and clearly even as a newbie this seem incorrect.
 Regards Nick

 Usually, it is set at its controller driver or pass through through 
 device tree or
 platform data.

 Peter

 Sorry Peter,
 I apologize for asking for more help here but I will paste the function 
 below and with my changes.
 Please let me known if I am wrong and how to fix it as I new here.
 Sorry for Wasting Your Time,

 Then please do not.  Just because your other email addresses were banned
 from lkml, don't keep popping up and bothering people, it's rude, and
 will cause this address to be banned as well.

 Sorry Greg,
 I don't want to get banned again. I was trying to help out and learn, I was 
 apologizing not
 for wasting time as much as for making sure I wasn't wasting maintainer time 
 again. I also 
 am coming to the conclusion that my terrible patches were a waste of time 
 and I am trying 
 to get back into helping out.
 
 You were asked to finish the Eudyptula challenge before bothering any
 other kernel developers with questions / patches.  Until that happens,
 you are in my killfile, now with yet-another-email-address.
 
 greg k-h
 
Greg K-H,
I really don't want you to get any more upset with me then you already are. The 
reason I gave up on the
challenge was it was mostly driver based and I wanted to learn more in other 
areas. If you would like to
discuss with me your concerns about my work on this list and how I can aid more 
please let me known.
Sorry ,
Nick 
--
To unsubscribe from this list: send the line unsubscribe linux-usb in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: FIX ME in oxu210p-hcd.c

2014-09-21 Thread gre...@linuxfoundation.org
Damm, didn't configure my kill-file correctly, and this snuck in, so
might as well respond...

On Sun, Sep 21, 2014 at 10:36:18PM -0400, nick wrote:
 On 14-09-21 10:24 PM, gre...@linuxfoundation.org wrote:
  Sorry Greg,
  I don't want to get banned again. I was trying to help out and learn, I 
  was apologizing not
  for wasting time as much as for making sure I wasn't wasting maintainer 
  time again. I also 
  am coming to the conclusion that my terrible patches were a waste of time 
  and I am trying 
  to get back into helping out.
  
  You were asked to finish the Eudyptula challenge before bothering any
  other kernel developers with questions / patches.  Until that happens,
  you are in my killfile, now with yet-another-email-address.
  
 Greg K-H,
 I really don't want you to get any more upset with me then you already are. 
 The reason I gave up on the
 challenge was it was mostly driver based and I wanted to learn more in other 
 areas. If you would like to
 discuss with me your concerns about my work on this list and how I can aid 
 more please let me known.

You stopped so early in the challenge, you really have no idea what it
is mostly about, so don't make rash statements like that.

Again, unless you finish it, you will be ignored by me, and probably by
everyone else as well.

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