lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Mon, 22 Sep 2014 02:11:05 +0000
From:	Peter Chen <Peter.Chen@...escale.com>
To:	nick <yocto6@...il.com>,
	"gregkh@...uxfoundation.org" <gregkh@...uxfoundation.org>
CC:	"julia.lawall@...6.fr" <julia.lawall@...6.fr>,
	"oneukum@...e.de" <oneukum@...e.de>,
	"himangi774@...il.com" <himangi774@...il.com>,
	"stern@...land.harvard.edu" <stern@...land.harvard.edu>,
	"paul.gortmaker@...driver.com" <paul.gortmaker@...driver.com>,
	"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: FIX ME in  oxu210p-hcd.c


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ