RE: Drivers: scsi: FLUSH timeout

2013-09-20 Thread KY Srinivasan
> -Original Message- > From: Greg KH [mailto:gre...@linuxfoundation.org] > Sent: Friday, September 20, 2013 1:32 PM > To: KY Srinivasan > Cc: linux-ker...@vger.kernel.org; de...@linuxdriverproject.org; > oher...@suse.com; jbottom...@parallels.com; h...@infradead.org; linux- > s...@vger.ke

[PATCH 29/31] staging: comedi: pcl711: tidy up multi line comments

2013-09-20 Thread H Hartley Sweeten
Tidy up the multi line comments to follow the CodingStyle. Remove the multi line comment about an alternate driver for the PCL-711. The http address does not work and the driver history in the comment is unnecessary. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- d

[PATCH 08/31] staging: comedi: pcl711: tidy up the subdevice init

2013-09-20 Thread H Hartley Sweeten
For aesthetic reasons, add some whitespace to the subdevice init. The 's->len_chanlist' is only used with asynchronous command support. Remove the unnecessary initialization of this member in the subdevices that do not support commands. For the analog input subdevice, move the initialization so it

[PATCH 05/31] staging: comedi: pcl711: tidy up the comedi_lrange tables

2013-09-20 Thread H Hartley Sweeten
For aesthetic reasons, cleanup the whitespace in the comedi_lrange tables. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 67 + 1 file changed, 35 insertions(+), 32 deletions(-) diff --git a/

[PATCH 23/31] staging: comedi: pcl711: remove 'is_pcl711b' from boardinfo

2013-09-20 Thread H Hartley Sweeten
This member in the board info is used to indicate if the board is a PCL711B. This board uses bits in the mode register to select the IRQ used for interrupts. These bits do nothing on the other boards supported by this driver. Remove the 'is_pcl711b' variable from the boardinfo. Also, remove the 'm

[PATCH 18/31] staging: comedi: pcl711: define the mode register magic numbers

2013-09-20 Thread H Hartley Sweeten
Define the magic numbers used with the mode register. For the PCL711B board, the mode register also contains the irq number that is being used. Introduce a helper function to write to the mode register so that this irq number is always included when needed. Signed-off-by: H Hartley Sweeten Cc: I

[PATCH 10/31] staging: comedi: pcl711: tidy up the register map defines

2013-09-20 Thread H Hartley Sweeten
Add some whitespace to the register map defines to make the code easier to read. For aesthetics, convert all the values to hex. This is more common in comedi drivers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 41 ++

[PATCH 06/31] staging: comedi: pcl711: don't fail attach if irq is unavailable

2013-09-20 Thread H Hartley Sweeten
Interrupts are only needed to support asynchronous commands with the analog input subdevice. Since the interrupt is optional during the attach of the board, don't fail the attach if it's not available. Also, remove the printk() noise about the irq. The user will know if the interrupt is available

[PATCH 30/31] staging: comedi: pcl711: reorder includes

2013-09-20 Thread H Hartley Sweeten
For aesthetics, reorder the includes a bit. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcl711.c b/drivers/staging/come

[PATCH 31/31] staging: comedi: pcl711: change MODULE_DESCRIPTION

2013-09-20 Thread H Hartley Sweeten
Change the MODULE_DESCRIPTION to something useful instead of the generic "Comedi low-level driver". Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/sta

[PATCH 28/31] staging: comedi: pcl711: rename some of the register map defines

2013-09-20 Thread H Hartley Sweeten
Rename some of the register map defines so they all have the same format. Add a couple new defines to tidy up some of the magic numbers used with the registers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 37 +

[PATCH 27/31] staging: comedi: pcl711: no need to calc the timer values twice

2013-09-20 Thread H Hartley Sweeten
The comedi core always calls the (*do_cmdtest) function to validate a command before it calls the (*do_cmd) function. Since the (*do_cmdtest) has already calculated the timer values in order to validate the cmd->scan_begin_arg there is no reason to recalc the values in the (*do_cmd). This also fi

[PATCH 26/31] staging: comedi: pcl711: remove 'i8253_osc_base'

2013-09-20 Thread H Hartley Sweeten
This static const int variable is only used one place in the code. Remove it and just open code the value. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a

[PATCH 25/31] staging: comedi: pcl711: use 8253.h helper to set the timers

2013-09-20 Thread H Hartley Sweeten
To better document the code, use the i8254_load() helper to set the timers instead of doing the outb() instructions. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 25 + 1 file changed, 5 insertions(+

[PATCH 24/31] staging: comedi: pcl711: remove unused private data members

2013-09-20 Thread H Hartley Sweeten
Remove all the private data variables that are not used by the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 4 1 file changed, 4 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcl711.c b/drivers/st

[PATCH 21/31] staging: comedi: pcl711: tidy up pcl711_ai_insn()

2013-09-20 Thread H Hartley Sweeten
For aesthetic reasons, rename this function to help with greps. Tidy up the function a bit to follow the comedi driver norm. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 16 +--- 1 file changed, 9 insertions(+

[PATCH 22/31] staging: comedi: pcl711: remove 'is_8112' from boardinfo

2013-09-20 Thread H Hartley Sweeten
This member in the boardinfo is redundant. All the 8112 style boards have > 8 analog input channels (16 actually). We can use that information instead and remove the extra boardinfo. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl71

[PATCH 20/31] staging: comedi: pcl711: fix software trigger for board->is_8112

2013-09-20 Thread H Hartley Sweeten
The acl-8112 boards also need to write a value to the software trigger register in order to start an A/D conversion. Remove the if (!board->is_8112) test so that the write is always done. Also, the analog input mode does not need to be set each time for multiple samples. Move the pcl711_ai_set_mod

[PATCH 19/31] staging: comedi: pcl711: remove unnecessary test of 'board->is_8112'

2013-09-20 Thread H Hartley Sweeten
At the end of an asynchronous command, the analog input is returned to software triggered mode. For the non-8112 style boards the mode PCL711_MODE_DEFAULT and PCL711_MODE_SOFTTRIG are identical. Just set the mode to PCL711_MODE_SOFTTRIG and remove the test. Signed-off-by: H Hartley Sweeten Cc: Ia

[PATCH 17/31] staging: comedi: pcl711: add differential input support for 8112 boards

2013-09-20 Thread H Hartley Sweeten
The ACL-8112 boards can do differential analog inputs. Add support for this mode. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 17 + 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/drivers/st

[PATCH 16/31] staging: comedi: pcl711: fix pcl711_set_changain()

2013-09-20 Thread H Hartley Sweeten
Currently the board->is_8112 handling in this function does not write the value to the mux register. Also, the value for channels >= 8 is calculated incorrectly. Define the magic numbers used with the mux register and fix the function so 8112 boards work correctly. Signed-off-by: H Hartley Sweete

[PATCH 13/31] staging: comedi: pcl711: introduce pcl711_ai_get_sample()

2013-09-20 Thread H Hartley Sweeten
Introduce a helper function to read the analog input data from the hardware. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 32 +++- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a

[PATCH 15/31] staging: comedi: pcl711: factor out the ai end-of-conversion wait

2013-09-20 Thread H Hartley Sweeten
Factor out the analog input end-of-conversion wait to clarify the pcl711_ai_insn() function a bit. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 39 + 1 file changed, 20 insertions(+), 19 del

[PATCH 14/31] staging: comedi: pcl711: use dev->read_subdev in interrupt handler

2013-09-20 Thread H Hartley Sweeten
The comedi_subdevice used in the interrupt handler is the dev->read_subdev that was initialized during the attach of the board. Use that instead of accessing the dev->subdevices array directly. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/dr

[PATCH 11/31] staging: comedi: pcl711: tidy up pcl711_ao_insn()

2013-09-20 Thread H Hartley Sweeten
For aesthetics, rename this function to help with greps. Introduce a helper function to write the values to the analog output channel registers. Modify the defines for the D/A registers to avoid the ? : tests based on the chan number. Only the final value written needs to be saved for read back.

[PATCH 12/31] staging: comedi: pcl711: tidy up pcl711_ao_insn_read()

2013-09-20 Thread H Hartley Sweeten
Tidy up this function to follow the normal form in comedi drivers. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 14 +++--- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/staging/comedi/driver

[PATCH 09/31] staging: comedi: pcl711: save the irq for the pcl711b only when used

2013-09-20 Thread H Hartley Sweeten
Move the storing of the irq in the mode register for the pcl711b board so it's only done when the irq is actually used by the driver. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 27 ++- 1 file chan

[PATCH 07/31] staging: comedi: pcl711: remove PCL711_SIZE

2013-09-20 Thread H Hartley Sweeten
This define is only used in the comedi_request_region() call. It doesn't really add any clarity to the code so remove it and just open code the value. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 4 +--- 1 file changed, 1

[PATCH 04/31] staging: comedi: pcl711: convert boardinfo flags to bit-fields

2013-09-20 Thread H Hartley Sweeten
To save a bit of space, convert the 'is_pcl711b' and 'is_8112' flags in the boardinfo to bit-fields. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/driver

[PATCH 03/31] staging: comedi: pcl711: remove unused boardinfo

2013-09-20 Thread H Hartley Sweeten
The 'is_dg' and 'n_ranges' members in the boardinfo are not used by the driver. Remove them. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 7 --- 1 file changed, 7 deletions(-) diff --git a/drivers/staging/comedi/drive

[PATCH 02/31] staging: comedi: pcl711: remove all '= 0' boardinfo

2013-09-20 Thread H Hartley Sweeten
Remove all the '= 0' entries in the boardinfo. They will default to 0. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 9 - 1 file changed, 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/pcl711.c b/drive

[PATCH 01/31] staging: comedi: pcl711: convert boardinfo declaration to C99 format

2013-09-20 Thread H Hartley Sweeten
Convert the boardinfo declaration to C99 format to make it less error prone and easier to maintain. For aesthetics, move the declaration closer to the struct definition. Signed-off-by: H Hartley Sweeten Cc: Ian Abbott Cc: Greg Kroah-Hartman --- drivers/staging/comedi/drivers/pcl711.c | 52 +++

[PATCH 00/31] staging: comedi: pcl711: cleanup driver

2013-09-20 Thread H Hartley Sweeten
Tidy up this driver a bit. Unfortunately not a great reduction in the lines of code but it did uncover a couple bugs in the 8112 board and async command support. The async command support still needs to be looked over. 1) The analog input sample read in the interrupt routine is not returne

Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Tejun Heo
Hey, On Fri, Sep 20, 2013 at 03:00:18PM +0100, Russell King - ARM Linux wrote: > Another would be if subsystem maintainers are happy that I carry them, > I can add the acks, and then later on towards the end of the cycle, > provide a branch subsystem maintainers could pull. > > Or... if you can t

Re: Drivers: scsi: FLUSH timeout

2013-09-20 Thread Laurence Oberman
I am thinking Srini meant in the sd_mod driver module. #define SD_FLUSH_TIMEOUT (60 * HZ) Laurence On Fri, Sep 20, 2013 at 4:32 PM, Greg KH wrote: > On Fri, Sep 20, 2013 at 12:32:27PM -0700, K. Y. Srinivasan wrote: >> The SD_FLUSH_TIMEOUT value is currently hardcoded. > > Hardcoded where? Plea

Re: [PATCH 08/51] DMA-API: net: intel/ixgbevf: fix 32-bit DMA mask handling

2013-09-20 Thread Jeff Kirsher
On Thu, 2013-09-19 at 22:32 +0100, Russell King wrote: > The fallback to 32-bit DMA mask is rather odd: > if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) && > !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) { > pci_using_dac = 1; > } else { >

Re: Drivers: scsi: FLUSH timeout

2013-09-20 Thread Greg KH
On Fri, Sep 20, 2013 at 12:32:27PM -0700, K. Y. Srinivasan wrote: > The SD_FLUSH_TIMEOUT value is currently hardcoded. Hardcoded where? Please, more context. > On our cloud, we sometimes hit this timeout. I was wondering if we > could make this a module parameter. If this is acceptable, I can se

Re: [PATCH 12/51] DMA-API: net: intel/e1000: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Jeff Kirsher
On Thu, 2013-09-19 at 22:37 +0100, Russell King wrote: > Replace the following sequence: > > dma_set_mask(dev, mask); > dma_set_coherent_mask(dev, mask); > > with a call to the new helper dma_set_mask_and_coherent(). > > Signed-off-by: Russell King > --- > drivers/net/ethernet/

Re: [PATCH 07/51] DMA-API: net: intel/ixgbe: fix 32-bit DMA mask handling

2013-09-20 Thread Jeff Kirsher
On Thu, 2013-09-19 at 22:31 +0100, Russell King wrote: > The fallback to 32-bit DMA mask is rather odd: > if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) && > !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) { > pci_using_dac = 1; > } else { >

Re: [PATCH 06/51] DMA-API: net: intel/ixgb: fix 32-bit DMA mask handling

2013-09-20 Thread Jeff Kirsher
On Thu, 2013-09-19 at 22:30 +0100, Russell King wrote: > The fallback to 32-bit DMA mask is rather odd: > err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); > if (!err) { > err = dma_set_coherent_mask(&pdev->dev, > DMA_BIT_MASK(64)); > if (!err) >

Re: [PATCH 04/51] DMA-API: net: intel/igb: fix 32-bit DMA mask handling

2013-09-20 Thread Jeff Kirsher
On Thu, 2013-09-19 at 22:28 +0100, Russell King wrote: > The fallback to 32-bit DMA mask is rather odd: > err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); > if (!err) { > err = dma_set_coherent_mask(&pdev->dev, > DMA_BIT_MASK(64)); > if (!err) >

Re: [PATCH 05/51] DMA-API: net: intel/igbvf: fix 32-bit DMA mask handling

2013-09-20 Thread Jeff Kirsher
On Thu, 2013-09-19 at 22:29 +0100, Russell King wrote: > The fallback to 32-bit DMA mask is rather odd: > err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); > if (!err) { > err = dma_set_coherent_mask(&pdev->dev, > DMA_BIT_MASK(64)); > if (!err) >

Re: [PATCH 03/51] DMA-API: net: intel/e1000e: fix 32-bit DMA mask handling

2013-09-20 Thread Jeff Kirsher
On Thu, 2013-09-19 at 22:27 +0100, Russell King wrote: > The fallback to 32-bit DMA mask is rather odd: > err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); > if (!err) { > err = dma_set_coherent_mask(&pdev->dev, > DMA_BIT_MASK(64)); > if (!err) >

Drivers: scsi: FLUSH timeout

2013-09-20 Thread K. Y. Srinivasan
The SD_FLUSH_TIMEOUT value is currently hardcoded. On our cloud, we sometimes hit this timeout. I was wondering if we could make this a module parameter. If this is acceptable, I can send you a patch for this. Regards, K. Y ___ devel mailing list de...@

Re: [PATCH 24/51] DMA-API: dma: pl330: add dma_set_mask_and_coherent() call

2013-09-20 Thread Heiko Stübner
Am Donnerstag, 19. September 2013, 23:49:01 schrieb Russell King: > The DMA API requires drivers to call the appropriate dma_set_mask() > functions before doing any DMA mapping. Add this required call to > the AMBA PL08x driver. ^--- copy and paste error - should of course

Re: [PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers

2013-09-20 Thread Mark Brown
On Thu, Sep 19, 2013 at 10:53:02PM +0100, Russell King wrote: > This code sequence is unsafe in modules: > > static u64 mask = DMA_BIT_MASK(something); > ... > if (!dev->dma_mask) > dev->dma_mask = &mask; Acked-by: Mark Brown signature.asc Description: Digital signature ___

[PATCH] Staging: rtl8192u: r819xU_cmdpkt: checking NULL value after doing dev_alloc_skb

2013-09-20 Thread Iker Pedrosa
Checking the return of dev_alloc_skb as stated in the following bug: https://bugzilla.kernel.org/show_bug.cgi?id=60411 Signed-off-by: Iker Pedrosa Reported-by: RUC_Soft_Sec rucsoft...@gmail.com --- drivers/staging/rtl8192u/r819xU_cmdpkt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/dr

Re: [PATCH 18/51] DMA-API: staging: et131x: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Ben Hutchings
[Trimmed cc's] On Thu, 2013-09-19 at 22:43 +0100, Russell King wrote: > Replace the following sequence: > > dma_set_mask(dev, mask); > dma_set_coherent_mask(dev, mask); > > with a call to the new helper dma_set_mask_and_coherent(). > > Signed-off-by: Russell King > --- > drivers/s

Re: [PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks

2013-09-20 Thread Felipe Balbi
Hi, On Fri, Sep 20, 2013 at 02:49:38PM +0100, Russell King - ARM Linux wrote: > On Fri, Sep 20, 2013 at 08:11:25AM -0500, Felipe Balbi wrote: > > Hi, > > > > On Fri, Sep 20, 2013 at 12:14:38AM +0100, Russell King wrote: > > > Use platform_device_register_full() for those drivers which can, to > >

[PATCH 40/51] DMA-API: crypto: fix ixp4xx crypto platform device support

2013-09-20 Thread Russell King
Don't statically allocate struct device's in modules, and shut the warning up with an empty release() function. There's a reason that warning is there and that's not for people to hide in this way. It's there to persuade people to use the correct APIs to allocate platform devices. Signed-off-by:

[PATCH 16/51] DMA-API: ppc: vio.c: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- arch/powerpc/kernel/vio.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --g

[PATCH 23/51] DMA-API: dma: pl08x: add dma_set_mask_and_coherent() call

2013-09-20 Thread Russell King
The DMA API requires drivers to call the appropriate dma_set_mask() functions before doing any DMA mapping. Add this required call to the AMBA PL08x driver. Signed-off-by: Russell King --- drivers/dma/amba-pl08x.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/driv

Re: [PATCH v2 15/24] Staging: winbond: reg: seventh of the patches that fixes lines over 80 characters

2013-09-20 Thread Iker Pedrosa
On Tue, 17 Sep 2013 12:43:26 +0300 Dan Carpenter wrote: > On Tue, Sep 17, 2013 at 02:29:22PM +0530, Adil Mujeeb wrote: > > Hi, > > > > > > >- PowerData = (1 << 31) | (0 << 30) | (24 << 24) | > > BitReverse(w89rf242_txvga_data[i][0], 24); > > >+ PowerData = (1 << 31) | (0 << 30) | (2

Re: [PATCH 01/51] DMA-API: provide a helper to set both DMA and coherent DMA masks

2013-09-20 Thread Russell King - ARM Linux
On Fri, Sep 20, 2013 at 02:21:37AM +0100, Ben Hutchings wrote: > On Thu, 2013-09-19 at 22:25 +0100, Russell King wrote: > [...] > > -dma_set_coherent_mask() will always be able to set the same or a > > -smaller mask as dma_set_mask(). However for the rare case that a > > +The coherent coherent mask

Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Russell King - ARM Linux
On Fri, Sep 20, 2013 at 07:16:52AM -0500, Tejun Heo wrote: > On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote: > > The correct way for a driver to specify the coherent DMA mask is > > not to directly access the field in the struct device, but to use > > dma_set_coherent_mask(). Only ar

Re: [PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks

2013-09-20 Thread Russell King - ARM Linux
On Fri, Sep 20, 2013 at 08:11:25AM -0500, Felipe Balbi wrote: > Hi, > > On Fri, Sep 20, 2013 at 12:14:38AM +0100, Russell King wrote: > > Use platform_device_register_full() for those drivers which can, to > > avoid messing directly with DMA masks. This can only be done when > > the driver does n

Re: [PATCH 42/51] DMA-API: usb: musb: use platform_device_register_full() to avoid directly messing with dma masks

2013-09-20 Thread Felipe Balbi
Hi, On Fri, Sep 20, 2013 at 12:14:38AM +0100, Russell King wrote: > Use platform_device_register_full() for those drivers which can, to > avoid messing directly with DMA masks. This can only be done when > the driver does not need to access the allocated musb platform device > from within its cal

Re: [PATCH 36/51] DMA-API: usb: use dma_set_coherent_mask()

2013-09-20 Thread Felipe Balbi
Hi, On Thu, Sep 19, 2013 at 11:01:03PM +0100, Russell King wrote: > diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c > index 2f2e88a..c10b324 100644 > --- a/drivers/usb/dwc3/dwc3-exynos.c > +++ b/drivers/usb/dwc3/dwc3-exynos.c > @@ -121,8 +121,9 @@ static int dwc3_exyno

Re: [PATCH 37/51] DMA-API: usb: use new dma_coerce_mask_and_coherent()

2013-09-20 Thread Felipe Balbi
Hi, On Thu, Sep 19, 2013 at 11:02:03PM +0100, Russell King wrote: > diff --git a/drivers/usb/dwc3/dwc3-exynos.c b/drivers/usb/dwc3/dwc3-exynos.c > index c10b324..8b20c70 100644 > --- a/drivers/usb/dwc3/dwc3-exynos.c > +++ b/drivers/usb/dwc3/dwc3-exynos.c > @@ -119,9 +119,7 @@ static int dwc3_exyno

[PATCH 02/51] DMA-API: net: brocade/bna/bnad.c: fix 32-bit DMA mask handling

2013-09-20 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: if (!dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)) && !dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64))) { *using_dac = true; } else { err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(32));

[PATCH 03/51] DMA-API: net: intel/e1000e: fix 32-bit DMA mask handling

2013-09-20 Thread Russell King
The fallback to 32-bit DMA mask is rather odd: err = dma_set_mask(&pdev->dev, DMA_BIT_MASK(64)); if (!err) { err = dma_set_coherent_mask(&pdev->dev, DMA_BIT_MASK(64)); if (!err) pci_using_dac = 1; } else {

[PATCH 09/51] DMA-API: net: broadcom/b44: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/net/ethernet/broadcom/b44.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-)

[PATCH 38/51] DMA-API: staging: use dma_set_coherent_mask()

2013-09-20 Thread Russell King
The correct way for a driver to specify the coherent DMA mask is not to directly access the field in the struct device, but to use dma_set_coherent_mask(). Only arch and bus code should access this member directly. Convert all direct write accesses to using the correct API. Signed-off-by: Russel

[PATCH 37/51] DMA-API: usb: use new dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
Signed-off-by: Russell King --- drivers/usb/chipidea/ci_hdrc_imx.c |4 +--- drivers/usb/dwc3/dwc3-exynos.c |4 +--- drivers/usb/host/ehci-atmel.c |4 +--- drivers/usb/host/ehci-omap.c |4 +--- drivers/usb/host/ehci-orion.c |4 +--- drivers/usb/host/ehci-pla

[PATCH 34/51] DMA-API: net: octeon: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
The code sequence: pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64); pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; bypasses the architectures check on the DMA mask. It can be replaced with dma_coerce_mask_and_coherent(), avoiding the direct initialization of this mask. Signed-o

[PATCH 36/51] DMA-API: usb: use dma_set_coherent_mask()

2013-09-20 Thread Russell King
The correct way for a driver to specify the coherent DMA mask is not to directly access the field in the struct device, but to use dma_set_coherent_mask(). Only arch and bus code should access this member directly. Convert all direct write accesses to using the correct API. Signed-off-by: Russel

[PATCH 32/51] DMA-API: mmc: sdhci-acpi: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
The code sequence: dev->dma_mask = &dev->coherent_dma_mask; dev->coherent_dma_mask = dma_mask; bypasses the architectures check on the DMA mask. It can be replaced with dma_coerce_mask_and_coherent(), avoiding the direct initialization of this mask. Signed-off-by: Russell King --

[PATCH 14/51] DMA-API: net: b43: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/net/wireless/b43/dma.c |9 +++-- 1 files changed, 3 insertions(+), 6 deletions(-

[PATCH 33/51] DMA-API: net: nxp/lpc_eth: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
The code sequence: pldat->pdev->dev.coherent_dma_mask = 0x; pldat->pdev->dev.dma_mask = &pldat->pdev->dev.coherent_dma_mask; bypasses the architectures check on the DMA mask. It can be replaced with dma_coerce_mask_and_coherent(), avoiding the direct initialization of this

Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Tejun Heo
On Fri, Sep 20, 2013 at 07:16:52AM -0500, Tejun Heo wrote: > On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote: > > The correct way for a driver to specify the coherent DMA mask is > > not to directly access the field in the struct device, but to use > > dma_set_coherent_mask(). Only ar

Re: [PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Tejun Heo
On Fri, Sep 20, 2013 at 12:11:38AM +0100, Russell King wrote: > The correct way for a driver to specify the coherent DMA mask is > not to directly access the field in the struct device, but to use > dma_set_coherent_mask(). Only arch and bus code should access this > member directly. > > Convert

[PATCH 31/51] DMA-API: media: omap3isp: use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
The code sequence: isp->raw_dmamask = DMA_BIT_MASK(32); isp->dev->dma_mask = &isp->raw_dmamask; isp->dev->coherent_dma_mask = DMA_BIT_MASK(32); bypasses the architectures check on the DMA mask. It can be replaced with dma_coerce_mask_and_coherent(), avoiding the direct init

[PATCH 30/51] DMA-API: dma: dw_dmac.c: convert to use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
This code sequence: if (!pdev->dev.dma_mask) { pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); } bypasses the architectures check on the DMA mask. It can be replaced with dma_coerce_mask_and_coherent

[PATCH 29/51] DMA-API: ata: pata_octeon_cf: convert to use dma_coerce_mask_and_coherent()

2013-09-20 Thread Russell King
Convert this code sequence: pdev->dev.coherent_dma_mask = DMA_BIT_MASK(64); pdev->dev.dma_mask = &pdev->dev.coherent_dma_mask; to use dma_coerce_mask_and_coherent() to avoid bypassing the architecture check on the DMA mask. Signed-off-by: Russell King --- drivers/ata/pata_octeon_

[PATCH 28/51] DMA-API: sound: fix dma mask handling in a lot of drivers

2013-09-20 Thread Russell King
This code sequence is unsafe in modules: static u64 mask = DMA_BIT_MASK(something); ... if (!dev->dma_mask) dev->dma_mask = &mask; as if a module is reloaded, the mask will be pointing at the original module's mask address, and this can lead to oopses. Moreover, they all

[PATCH 27/51] DMA-API: provide a helper to setup DMA masks

2013-09-20 Thread Russell King
Many drivers contain code such as: dev->dma_mask = &dev->coherent_dma_mask; dev->coherent_dma_mask = MASK; Let's move this pattern out of drivers and have the DMA API provide a helper for it. This helper uses dma_set_mask_and_coherent() to allow platform issues to be properly dea

[PATCH 26/51] DMA-API: usb: ohci-sa1111: add a note about DMA masks

2013-09-20 Thread Russell King
Add a comment to explain why this driver doesn't call any of the DMA API dma_set_mask() functions. Signed-off-by: Russell King --- drivers/usb/host/ohci-sa.c |6 ++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/usb/host/ohci-sa.c b/drivers/usb/host/ohci-s

[PATCH 21/51] DMA-API: usb: ssb-hcd: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/usb/host/ssb-hcd.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff --

[PATCH 25/51] DMA-API: video: clcd: add dma_set_mask_and_coherent() call

2013-09-20 Thread Russell King
The DMA API requires drivers to call the appropriate dma_set_mask() functions before doing any DMA mapping. Add this required call to the AMBA PL08x driver. Signed-off-by: Russell King --- drivers/video/amba-clcd.c |5 + 1 files changed, 5 insertions(+), 0 deletions(-) diff --git a/dri

[PATCH 20/51] DMA-API: usb: bcma: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/usb/host/bcma-hcd.c |3 +-- 1 files changed, 1 insertions(+), 2 deletions(-) diff -

[PATCH 15/51] DMA-API: net: b43legacy: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/net/wireless/b43legacy/dma.c |9 +++-- 1 files changed, 3 insertions(+), 6 delet

[PATCH 10/51] DMA-API: net: broadcom/bnx2x: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/net/ethernet/broadcom/bnx2x/bnx2x_main.c |8 ++-- 1 files changed, 2 insertions(

[PATCH 19/51] DMA-API: media: dt3155v4l: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/staging/media/dt3155v4l/dt3155v4l.c |5 + 1 files changed, 1 insertions(+), 4 de

[PATCH 12/51] DMA-API: net: intel/e1000: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/net/ethernet/intel/e1000/e1000_main.c |9 ++--- 1 files changed, 2 insertions(+)

[PATCH 18/51] DMA-API: staging: et131x: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/staging/et131x/et131x.c | 17 ++--- 1 files changed, 2 insertions(+), 15 d

[PATCH 13/51] DMA-API: net: sfc/efx.c: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/net/ethernet/sfc/efx.c | 12 +--- 1 files changed, 1 insertions(+), 11 deletio

[PATCH 11/51] DMA-API: net: emulex/benet: replace dma_set_mask()+dma_set_coherent_mask() with new helper

2013-09-20 Thread Russell King
Replace the following sequence: dma_set_mask(dev, mask); dma_set_coherent_mask(dev, mask); with a call to the new helper dma_set_mask_and_coherent(). Signed-off-by: Russell King --- drivers/net/ethernet/emulex/benet/be_main.c | 12 ++-- 1 files changed, 2 insertions(+

[PATCH 24/51] DMA-API: dma: pl330: add dma_set_mask_and_coherent() call

2013-09-20 Thread Russell King
The DMA API requires drivers to call the appropriate dma_set_mask() functions before doing any DMA mapping. Add this required call to the AMBA PL08x driver. Signed-off-by: Russell King --- drivers/dma/pl330.c |4 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/drivers/dm

[PATCH 22/51] DMA-API: amba: get rid of separate dma_mask

2013-09-20 Thread Russell King
AMBA Primecell devices always treat streaming and coherent DMA exactly the same, so there's no point in having the masks separated. Signed-off-by: Russell King --- drivers/amba/bus.c |6 +- drivers/of/platform.c|3 --- include/linux/amba/bus.h |2 -- 3 files changed, 1

[PATCH 39/51] DMA-API: others: use dma_set_coherent_mask()

2013-09-20 Thread Russell King
The correct way for a driver to specify the coherent DMA mask is not to directly access the field in the struct device, but to use dma_set_coherent_mask(). Only arch and bus code should access this member directly. Convert all direct write accesses to using the correct API. Signed-off-by: Russel

[PATCH 41/51] DMA-API: crypto: remove last references to 'static struct device *dev'

2013-09-20 Thread Russell King
Signed-off-by: Russell King --- drivers/crypto/ixp4xx_crypto.c | 13 - 1 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/crypto/ixp4xx_crypto.c b/drivers/crypto/ixp4xx_crypto.c index 8306185..214357e 100644 --- a/drivers/crypto/ixp4xx_crypto.c +++ b/drivers/cryp

[PATCH 43/51] DMA-API: dma: edma.c: no need to explicitly initialize DMA masks

2013-09-20 Thread Russell King
register_platform_device_full() can setup the DMA mask provided the appropriate member is set in struct platform_device_info. So lets make that be the case. This avoids a direct reference to the DMA masks by this driver. Signed-off-by: Russell King --- drivers/dma/edma.c |6 ++ 1 files

[PATCH 46/51] ARM: DMA-API: better handing of DMA masks for coherent allocations

2013-09-20 Thread Russell King
We need to start treating DMA masks as something which is specific to the bus that the device resides on, otherwise we're going to hit all sorts of nasty issues with LPAE and 32-bit DMA controllers in >32-bit systems, where memory is offset from PFN 0. In order to start doing this, we convert the

[PATCH 44/51] DMA-API: dcdbas: update DMA mask handing

2013-09-20 Thread Russell King
dcdbas was explicitly initializing DMA masks thusly: dcdbas_pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); dcdbas_pdev->dev.dma_mask = &dcdbas_pdev->dev.coherent_dma_mask; which bypasses the architecture check. Moreover, it is creating the dcdbas_pdev device itself, and using the

[PATCH 47/51] ARM: 7794/1: block: Rename parameter dma_mask to max_addr for blk_queue_bounce_limit()

2013-09-20 Thread Russell King
From: Santosh Shilimkar The blk_queue_bounce_limit() API parameter 'dma_mask' is actually the maximum address the device can handle rather than a dma_mask. Rename it accordingly to avoid it being interpreted as dma_mask. No functional change. The idea is to fix the bad assumptions about dma_mas

[PATCH 45/51] DMA-API: firmware/google/gsmi.c: avoid direct access to DMA masks

2013-09-20 Thread Russell King
This driver doesn't need to directly access DMA masks if it uses the platform_device_register_full() API rather than platform_device_register_simple() - the former function can initialize the DMA mask appropriately. Signed-off-by: Russell King --- drivers/firmware/google/gsmi.c | 13 --

[PATCH 48/51] ARM: 7795/1: mm: dma-mapping: Add dma_max_pfn(dev) helper function

2013-09-20 Thread Russell King
From: Santosh Shilimkar Most of the kernel assumes that PFN0 is the start of the physical memory (RAM). This assumptions is not true on most of the ARM SOCs and hence and if one try to update the ARM port to follow the assumptions, we end of breaking the dma bounce limit for few block layer drive

[PATCH 49/51] ARM: 7796/1: scsi: Use dma_max_pfn(dev) helper for bounce_limit calculations

2013-09-20 Thread Russell King
From: Santosh Shilimkar DMA bounce limit is the maximum direct DMA'able memory beyond which bounce buffers has to be used to perform dma operations. SCSI driver relies on dma_mask but its calculation is based on max_*pfn which don't have uniform meaning across architectures. So make use of dma_ma

[PATCH 50/51] ARM: 7797/1: mmc: Use dma_max_pfn(dev) helper for bounce_limit calculations

2013-09-20 Thread Russell King
From: Santosh Shilimkar DMA bounce limit is the maximum direct DMA'able memory beyond which bounce buffers has to be used to perform dma operations. MMC queue layr relies on dma_mask but its calculation is based on max_*pfn which don't have uniform meaning across architectures. So make use of dma

[PATCH 51/51] ARM: 7805/1: mm: change max*pfn to include the physical offset of memory

2013-09-20 Thread Russell King
From: Santosh Shilimkar Most of the kernel code assumes that max*pfn is maximum pfns because the physical start of memory is expected to be PFN0. Since this assumption is not true on ARM architectures, the meaning of max*pfn is number of memory pages. This is done to keep drivers happy which are

  1   2   >