Skip to contentSkip to conversation

FIX ME in oxu210p-hcd.c

DISCUSSION nick 3 participants 10 messages Sep 20, 2014 – Sep 22, 2014 1 message not in the archive USB

lore
Share & tools
lore

nick

author
#1 lore raw
In reply to a message not in the archive

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

#2 lore raw
Quoted 9 lines

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 ���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

author
#3 lore raw
Quoted 10 lines · Peter Chen
Quoted 9 lines

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

Quoted 5 lines

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;
}

#4 lore raw
Quoted 13 lines
Quoted 13 lines
Quoted 9 lines

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.

Quoted 7 lines
Quoted 2 lines

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

Review

Quoted 12 lines

Nick
static int oxu_reset(struct usb_hcd *hcd) {

(quoted diff) +0 -0
 	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;
(quoted diff) +1 -1
-	/* 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:

drivers/usb/host/oxu210hp-hcd.c +7 -0
index da5fb0e..5549851 100644
@@ -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

Quoted 22 lines
 	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;
(quoted diff) +0 -0
 		oxu->regs = hcd->regs + OXU_SPH_CAP_OFFSET + \
 			HC_LENGTH(readl(&oxu->caps->hc_capbase));
 
 		oxu->mem = hcd->regs + OXU_OTG_MEM;
	}
(quoted diff) +0 -0
 	oxu->hcs_params = readl(&oxu->caps->hcs_params);
 	oxu->sbrn = 0x20;
	ret = oxu_hcd_init(hcd);
	if (ret)
(quoted diff) +0 -0
 		return ret;
 
 	return 0;
Quoted 1 line

}

���{.n�+�������+%�����ݶ��w��{.n�+����{��G�����{ay�ʇڙ�,j��f���h��������z_�(�階�ݢj"���m������G������?����&���~��iO��z��v�^�m���� ������?�I�

#6 lore raw
In reply to nick
Quoted 16 lines · nick
Quoted 13 lines · Peter Chen
Quoted 9 lines

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.

Quoted 6 lines
Quoted 2 lines

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.

author
#7 lore raw
Quoted 19 lines · On 14-09-21 10:11 PM, [email protected] wrote:
Quoted 18 lines · nick
Quoted 15 lines · Peter Chen
Quoted 9 lines

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

Quoted 9 lines
Quoted 4 lines

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

#8 lore raw
Quoted 31 lines · nick
Quoted 19 lines · On 14-09-21 10:11 PM, [email protected] wrote:
Quoted 18 lines · nick
Quoted 15 lines · Peter Chen
Quoted 9 lines

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

Quoted 9 lines
Quoted 4 lines

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.

Quoted 5 lines

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

author
#5 lore raw
In reply to Peter Chen
Quoted 66 lines · Peter Chen
Quoted 13 lines
Quoted 13 lines
Quoted 9 lines

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.

Quoted 7 lines
Quoted 2 lines

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

Review

Quoted 12 lines

Nick
static int oxu_reset(struct usb_hcd *hcd) {

(quoted diff) +0 -0
 	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;
(quoted diff) +1 -1
-	/* 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:

drivers/usb/host/oxu210hp-hcd.c +7 -0
index da5fb0e..5549851 100644
@@ -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
         */
Quoted 26 lines

Peter

Quoted 23 lines
 	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;
(quoted diff) +0 -0
 		oxu->regs = hcd->regs + OXU_SPH_CAP_OFFSET + \
 			HC_LENGTH(readl(&oxu->caps->hc_capbase));
 
 		oxu->mem = hcd->regs + OXU_OTG_MEM;
	}
(quoted diff) +0 -0
 	oxu->hcs_params = readl(&oxu->caps->hcs_params);
 	oxu->sbrn = 0x20;
	ret = oxu_hcd_init(hcd);
	if (ret)
(quoted diff) +0 -0
 		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

drivers/usb/host/oxu210hp-hcd.c +7 -0
index da5fb0e..5549851 100644
@@ -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
         */
author
#9 lore raw
In reply to [email protected]
Quoted 38 lines · On 14-09-21 10:24 PM, [email protected] wrote:
Quoted 31 lines · nick
Quoted 19 lines · On 14-09-21 10:11 PM, [email protected] wrote:
Quoted 18 lines · nick
Quoted 15 lines · Peter Chen
Quoted 9 lines

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

Quoted 9 lines
Quoted 4 lines

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.

Quoted 5 lines

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.

Quoted 6 lines

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

#10 lore raw

Damm, didn't configure my kill-file correctly, and this snuck in, so might as well respond...

Quoted 7 lines · nick
Quoted 6 lines · On 14-09-21 10:24 PM, [email protected] wrote:
Quoted 5 lines

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.

Quoted 8 lines
Quoted 4 lines

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