Re: iwm: fix handling of large firmware commands

2015-10-15 Thread Stefan Sperling
Any objections to putting this in soon? Any OKs? I'd like to move forward with iwm(4) (less fixing bugs, more adding new features...) On Sun, Oct 11, 2015 at 04:55:29PM +0200, Stefan Sperling wrote: > The iwm(4) driver pre-allocates fw command payload buffers of 320 bytes. > > For some firmware

Re: iwm: fix handling of large firmware commands

2015-10-12 Thread Mark Kettenis
> Date: Mon, 12 Oct 2015 11:16:27 +0200 > From: Stefan Sperling > > On Sun, Oct 11, 2015 at 09:02:27PM +0200, Mark Kettenis wrote: > > Using dma_alloc() here would be wrong. Drivers should use > > bus_dmamem_alloc(). > > Thanks, noted. > > Do you think iwm should use a buffer allocated with bu

Re: iwm: fix handling of large firmware commands

2015-10-12 Thread Stefan Sperling
On Sun, Oct 11, 2015 at 09:02:27PM +0200, Mark Kettenis wrote: > Using dma_alloc() here would be wrong. Drivers should use bus_dmamem_alloc(). Thanks, noted. Do you think iwm should use a buffer allocated with bus_dmamem_alloc() here, or stick with the mbuf?

Re: iwm: fix handling of large firmware commands

2015-10-11 Thread Mark Kettenis
> Date: Sun, 11 Oct 2015 17:45:47 +0200 > From: Stefan Sperling > > On Sun, Oct 11, 2015 at 11:31:35AM -0400, Ted Unangst wrote: > > huh? Why an mbuf? Is dma_alloc not a better choice? > > The mbuf pointer already exists to keep track of packets on the > otheor Tx queues. I guess that's why iwn

Re: iwm: fix handling of large firmware commands

2015-10-11 Thread Stefan Sperling
On Sun, Oct 11, 2015 at 12:11:22PM -0400, Ted Unangst wrote: > oh, ok. it look like the short command path wasn't using an mbuf, but i got > that impression only from looking at the diff. maybe wrong. No, it's as bad as you think it is. Short commands stick payload data into the Tx descriptor, whi

Re: iwm: fix handling of large firmware commands

2015-10-11 Thread Ted Unangst
Stefan Sperling wrote: > On Sun, Oct 11, 2015 at 11:31:35AM -0400, Ted Unangst wrote: > > huh? Why an mbuf? Is dma_alloc not a better choice? > > The mbuf pointer already exists to keep track of packets on the > otheor Tx queues. I guess that's why iwn (where this came from) > does it this way. >

Re: iwm: fix handling of large firmware commands

2015-10-11 Thread Stefan Sperling
On Sun, Oct 11, 2015 at 11:31:35AM -0400, Ted Unangst wrote: > huh? Why an mbuf? Is dma_alloc not a better choice? The mbuf pointer already exists to keep track of packets on the otheor Tx queues. I guess that's why iwn (where this came from) does it this way. I don't mind changing to dma_alloc.

Re: iwm: fix handling of large firmware commands

2015-10-11 Thread Ted Unangst
Stefan Sperling wrote: > The iwm(4) driver pre-allocates fw command payload buffers of 320 bytes. > > For some firmware commands, particularly those used when configuring > the PHY (iwm_send_phy_db_cmd) and running scans (iwm_mvm_scan_request), > the payload exceeds 320 bytes. I've seen somewhere

iwm: fix handling of large firmware commands

2015-10-11 Thread Stefan Sperling
The iwm(4) driver pre-allocates fw command payload buffers of 320 bytes. For some firmware commands, particularly those used when configuring the PHY (iwm_send_phy_db_cmd) and running scans (iwm_mvm_scan_request), the payload exceeds 320 bytes. I've seen somewhere between 2k and 3.5k being used. P