linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: nick <yocto6@gmail.com>
To: Peter Chen <Peter.Chen@freescale.com>,
	"gregkh@linuxfoundation.org" <gregkh@linuxfoundation.org>
Cc: "julia.lawall@lip6.fr" <julia.lawall@lip6.fr>,
	"oneukum@suse.de" <oneukum@suse.de>,
	"himangi774@gmail.com" <himangi774@gmail.com>,
	"stern@rowland.harvard.edu" <stern@rowland.harvard.edu>,
	"paul.gortmaker@windriver.com" <paul.gortmaker@windriver.com>,
	"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: FIX ME in  oxu210p-hcd.c
Date: Sun, 21 Sep 2014 22:33:40 -0400	[thread overview]
Message-ID: <541F8A84.6070408@gmail.com> (raw)
In-Reply-To: <684d0564efd840b7a45164546425f849@BN1PR0301MB0772.namprd03.prod.outlook.com>

[-- Attachment #1: Type: text/plain, Size: 3063 bytes --]



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 

[-- Attachment #2: oxu210hp-hcd.patch --]
[-- Type: text/x-patch, Size: 797 bytes --]

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
         */

  reply	other threads:[~2014-09-22  2:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <541DB6BF.7090909@gmail.com>
2014-09-20 17:26 ` FIX ME in oxu210p-hcd.c nick
2014-09-21 23:53   ` Peter Chen
2014-09-22  2:03     ` nick
2014-09-22  2:11       ` Peter Chen
2014-09-22  2:33         ` nick [this message]
2014-09-22  2:11       ` gregkh
2014-09-22  2:17         ` nick
2014-09-22  2:24           ` gregkh
2014-09-22  2:36             ` nick
2014-09-22  3:05               ` gregkh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=541F8A84.6070408@gmail.com \
    --to=yocto6@gmail.com \
    --cc=Peter.Chen@freescale.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=himangi774@gmail.com \
    --cc=julia.lawall@lip6.fr \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=oneukum@suse.de \
    --cc=paul.gortmaker@windriver.com \
    --cc=stern@rowland.harvard.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).