[PATCH 3/3] staging: comedi: ni_mio_comon: add finite regeneration to dio output
This patch continues the implementation of reinterpreting stop_arg when stop_src == TRIG_NONE for national instruments cdio output on e/m-series devices. This is part of a series of patches that allow a user to have a specific buffer repeated as-is indefinitely. The contents of the DMA buffer can be left static or changed by the user via mmap access to the DMA buffer. If the contents are changed by the user, additional munging is not performed by the driver and only a single call to comedi_mark_buffer_written should be done. The original behavior is preserved when stop_arg == 0, as would be the prior use case. As opposed to analog output, this patch is relatively simple. First, the digital output capabilities are much more limited/simple as compared to the analog output device on NI e/m-series hardware, and second, this patch relies on changes made with the earlier patch to accomplish limiting the DMA buffer transfer. Signed-off-by: Spencer E. Olson --- drivers/staging/comedi/drivers/ni_mio_common.c | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 8941351..2f79c14 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -3605,7 +3605,9 @@ static int ni_cdio_cmdtest(struct comedi_device *dev, err |= comedi_check_trigger_arg_is(&cmd->convert_arg, 0); err |= comedi_check_trigger_arg_is(&cmd->scan_end_arg, cmd->chanlist_len); - err |= comedi_check_trigger_arg_is(&cmd->stop_arg, 0); + err |= comedi_check_trigger_arg_max(&cmd->stop_arg, + s->async->prealloc_bufsz / + comedi_bytes_per_scan(s)); if (err) return 3; @@ -3682,6 +3684,7 @@ static int ni_cdo_inttrig(struct comedi_device *dev, static int ni_cdio_cmd(struct comedi_device *dev, struct comedi_subdevice *s) { + struct ni_private *devpriv = dev->private; const struct comedi_cmd *cmd = &s->async->cmd; unsigned cdo_mode_bits; int retval; @@ -3706,6 +3709,10 @@ static int ni_cdio_cmd(struct comedi_device *dev, struct comedi_subdevice *s) if (retval < 0) return retval; + ni_cmd_set_mite_transfer(devpriv->cdo_mite_ring, s, cmd, +s->async->prealloc_bufsz / +comedi_bytes_per_scan(s)); + s->async->inttrig = ni_cdo_inttrig; return 0; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/3] staging: comedi: mite: enable continuous regeneration of finite samples
This change enables the mite DMA controller to only transfer the amount of data needed by a command. By default, the old behavior of transferring the entire comedi DMA data buffer is still in effect. These changes allow a command to only transmit a limited portion of that data buffer as needed. This patch begins to reinterprets stop_arg when stop_src == TRIG_NONE to allow the user to specify the length of the buffer that should be repeated. The intent is to allow a user to have a specific buffer repeated as-is indefinitely. The contents of the DMA buffer can be left static or changed by the user via mmap access to the DMA buffer. If the contents are changed by the user, additional munging is not performed by the driver and only a single call to comedi_mark_buffer_written should be done. Signed-off-by: Spencer E. Olson --- drivers/staging/comedi/drivers/mite.c | 72 ++- drivers/staging/comedi/drivers/mite.h | 3 ++ 2 files changed, 66 insertions(+), 9 deletions(-) diff --git a/drivers/staging/comedi/drivers/mite.c b/drivers/staging/comedi/drivers/mite.c index fa7ae2c..8f24702 100644 --- a/drivers/staging/comedi/drivers/mite.c +++ b/drivers/staging/comedi/drivers/mite.c @@ -297,7 +297,6 @@ int mite_buf_change(struct mite_dma_descriptor_ring *ring, { struct comedi_async *async = s->async; unsigned int n_links; - int i; if (ring->descriptors) { dma_free_coherent(ring->hw_dev, @@ -326,17 +325,58 @@ int mite_buf_change(struct mite_dma_descriptor_ring *ring, } ring->n_links = n_links; - for (i = 0; i < n_links; i++) { + return mite_init_ring_descriptors(ring, s, n_links << PAGE_SHIFT); +} +EXPORT_SYMBOL_GPL(mite_buf_change); + +/* + * initializes the ring buffer descriptors to provide correct DMA transfer links + * to the exact amount of memory required. When the ring buffer is allocated in + * mite_buf_change, the default is to initialize the ring to refer to the entire + * DMA data buffer. A command may call this function later to re-initialize and + * shorten the amount of memory that will be transferred. + */ +int mite_init_ring_descriptors(struct mite_dma_descriptor_ring *ring, + struct comedi_subdevice *s, + unsigned int nbytes) +{ + struct comedi_async *async = s->async; + unsigned int n_full_links = nbytes >> PAGE_SHIFT; + unsigned int remainder = nbytes % PAGE_SIZE; + int i; + + dev_dbg(s->device->class_dev, + "mite: init ring buffer to %u bytes\n", nbytes); + + if ((n_full_links + (remainder > 0 ? 1 : 0)) > ring->n_links) { + dev_err(s->device->class_dev, + "mite: ring buffer too small for requested init\n"); + return -ENOMEM; + } + + /* We set the descriptors for all full links. */ + for (i = 0; i < n_full_links; ++i) { ring->descriptors[i].count = cpu_to_le32(PAGE_SIZE); ring->descriptors[i].addr = cpu_to_le32(async->buf_map->page_list[i].dma_addr); ring->descriptors[i].next = - cpu_to_le32(ring->descriptors_dma_addr + (i + - 1) * - sizeof(struct mite_dma_descriptor)); + cpu_to_le32(ring->descriptors_dma_addr + + (i + 1) * sizeof(struct mite_dma_descriptor)); } - ring->descriptors[n_links - 1].next = - cpu_to_le32(ring->descriptors_dma_addr); + + /* the last link is either a remainder or was a full link. */ + if (remainder > 0) { + /* set the lesser count for the remainder link */ + ring->descriptors[i].count = cpu_to_le32(remainder); + ring->descriptors[i].addr = + cpu_to_le32(async->buf_map->page_list[i].dma_addr); + /* increment i so that assignment below refs last link */ + ++i; + } + + /* Assign the last link->next to point back to the head of the list. */ + ring->descriptors[i - 1].next = cpu_to_le32(ring->descriptors_dma_addr); + /* * barrier is meant to insure that all the writes to the dma descriptors * have completed before the dma controller is commanded to read them @@ -344,7 +384,7 @@ int mite_buf_change(struct mite_dma_descriptor_ring *ring, smp_wmb(); return 0; } -EXPORT_SYMBOL_GPL(mite_buf_change); +EXPORT_SYMBOL_GPL(mite_init_ring_descriptors); void mite_prep_dma(struct mite_channel *mite_chan, unsigned int num_device_bits, unsigned int num_memory_bits) @@ -552,6 +592,7 @@ int mite_sync_output_dma(struct mite_channel *mite_chan, unsigned int old_alloc_count = async->buf_read_alloc_count; u32 nbytes_ub, nbytes_lb; int count; + bool fin
[PATCH 2/3] staging: comedi: ni_mio_comon: adds finite regeneration to AO output
This patch implements for analog output the reinterpretation of stop_arg when stop_src == TRIG_NONE to allow the user to specify the length of the buffer that should be repeated. The intent is to allow a user to have a specific buffer repeated as-is indefinitely. The contents of the DMA buffer can be left static or changed by the user via mmap access to the DMA buffer. If the contents are changed by the user, additional munging is not performed by the driver and only a single call to comedi_mark_buffer_written should be done. This patch implements ni_ao_cmd much more closely organized like NI MHDDK examples and DAQ-STC pseudo-code. Adds comments with some more specific references to the DAQ-STC. ni_ao_reset similarly cleaned up and made to appear more comparable to DAC-STC. Signed-off-by: Spencer E. Olson --- drivers/staging/comedi/drivers/ni_mio_common.c | 564 ++--- 1 file changed, 405 insertions(+), 159 deletions(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 6cc304a..8941351 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -1484,7 +1484,8 @@ static void handle_b_interrupt(struct comedi_device *dev, s->async->events |= COMEDI_CB_OVERFLOW; } - if (b_status & NISTC_AO_STATUS1_BC_TC) + if (s->async->cmd.stop_src != TRIG_NONE && + b_status & NISTC_AO_STATUS1_BC_TC) s->async->events |= COMEDI_CB_EOA; #ifndef PCIDMA @@ -2053,6 +2054,37 @@ static unsigned ni_timer_to_ns(const struct comedi_device *dev, int timer) return devpriv->clock_ns * (timer + 1); } +static void ni_cmd_set_mite_transfer(struct mite_dma_descriptor_ring *ring, +struct comedi_subdevice *sdev, +const struct comedi_cmd *cmd, +unsigned int max_count) { +#ifdef PCIDMA + unsigned int nbytes = max_count; + + if (cmd->stop_arg > 0 && cmd->stop_arg < max_count) + nbytes = cmd->stop_arg; + nbytes *= comedi_bytes_per_scan(sdev); + + if (nbytes > sdev->async->prealloc_bufsz) { + if (cmd->stop_arg > 0) + dev_err(sdev->device->class_dev, + "ni_cmd_set_mite_transfer: tried exact data transfer limits greater than buffer size\n"); + + /* +* we can only transfer up to the size of the buffer. In this +* case, the user is expected to continue to write into the +* comedi buffer (already implemented as a ring buffer). +*/ + nbytes = sdev->async->prealloc_bufsz; + } + + mite_init_ring_descriptors(ring, sdev, nbytes); +#else + dev_err(sdev->device->class_dev, + "ni_cmd_set_mite_transfer: exact data transfer limits not implemented yet without DMA\n"); +#endif +} + static unsigned ni_min_ai_scan_period_ns(struct comedi_device *dev, unsigned num_channels) { @@ -2878,8 +2910,6 @@ static int ni_ao_inttrig(struct comedi_device *dev, ni_stc_writew(dev, NISTC_AO_CMD1_UI_ARM | NISTC_AO_CMD1_UC_ARM | NISTC_AO_CMD1_BC_ARM | - NISTC_AO_CMD1_DAC1_UPDATE_MODE | - NISTC_AO_CMD1_DAC0_UPDATE_MODE | devpriv->ao_cmd1, NISTC_AO_CMD1_REG); @@ -2889,42 +2919,68 @@ static int ni_ao_inttrig(struct comedi_device *dev, return 0; } -static int ni_ao_cmd(struct comedi_device *dev, struct comedi_subdevice *s) +/* + * begin ni_ao_cmd. + * Organized similar to NI-STC and MHDDK examples. + * ni_ao_cmd is broken out into configuration sub-routines for clarity. + */ + +static void ni_ao_cmd_personalize(struct comedi_device *dev, + const struct comedi_cmd *cmd) { const struct ni_board_struct *board = dev->board_ptr; - struct ni_private *devpriv = dev->private; - const struct comedi_cmd *cmd = &s->async->cmd; - int bits; - int i; - unsigned trigvar; - unsigned val; - - if (dev->irq == 0) { - dev_err(dev->class_dev, "cannot run command without an irq\n"); - return -EIO; - } + unsigned bits; ni_stc_writew(dev, NISTC_RESET_AO_CFG_START, NISTC_RESET_REG); - ni_stc_writew(dev, NISTC_AO_CMD1_DISARM, NISTC_AO_CMD1_REG); + bits = + /* fast CPU interface--only eseries */ + /* ((slow CPU interface) ? 0 : AO_Fast_CPU) | */ + NISTC_AO_PERSONAL_BC_SRC_SEL | + 0 /* (use_original_pulse ? 0 : NISTC_AO_PERSONAL_UPDATE_TIMEBASE) */ | + /* + * FIXME: start setting following bit when appropriate. Need to + * determine whether
[PATCH 0/3] continuous regeneration of finite samples
These patches implement a proposal to very slightly extend the interpretation of cmd->stop_arg when cmd->stop_src == TRIG_NONE. Normally, for output subdevices, when the user specifies cmd->stop_src == TRIG_NONE, the device should continuously output data that must also be continually fed by the user via either a mmap/comedi_mark_buffer_written or an write(...) operation. The intent of this proposal is to also allow a user to have a specific buffer repeated as-is indefinitely. This is accomplished by the user specifying the length of the fixed buffer via cmd->stop_arg > 0. It should be noted that cmd->stop_arg in this case must also be <= the size of the available dma buffer. The prior behavior is maintained when cmd->stop_arg == 0, which is also enforced by the *_cmdtest functions for many, if not all output devices. All devices which do not implement this new behavior should simply continue to enforce cmd->stop_arg == 0 in *_cmdtest functions. These patches implement the extended interpretation of cmd->stop_arg >0 for when cmd->stop_src==TRIG_NONE for National Instruments m/e-series devices only that are based on the ni_mio_common driver. Currently, these changes only apply to analog output and cdio output devices. This patches also implement suggestions made by Ian Abbot, namely: (1) all patches were run through checkpatch.pl and fixed accordingly to comply with coding standards, (2) all block comments were changed to comply with comments beginning on the line after the /* delimiter, (3) dev_warn use in drivers/mite.c as used during debugging was changed to dev_dbg, and (4) mite.c logic statements were made simpler and more robust following Ian's suggestions. Spencer E. Olson (3): staging: comedi: mite: enable continuous regeneration of finite samples staging: comedi: ni_mio_comon: adds finite regeneration to AO output staging: comedi: ni_mio_comon: add finite regeneration to dio output drivers/staging/comedi/drivers/mite.c | 72 +++- drivers/staging/comedi/drivers/mite.h | 3 + drivers/staging/comedi/drivers/ni_mio_common.c | 573 ++--- 3 files changed, 479 insertions(+), 169 deletions(-) -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
SHORT TERM INVESTMENT IN YOUR COUNTRY!!
My Dear Friend, I am contacting you to partner with you and this is real ok, itโs my desire to strategically collaborate with your firm regarding investment arrangement in your country. Basically, I was forced out of my country due to political reasons and presently ran to another ountry for a political assylum. I have decided and agreed to expand investment overseas. Consequently, I ask for your cooperation in this business proposal of mutual trust and benefit. I am considering a short-term investment of 35 million U.S dollars, this fund is not an illicit fund but originated from my hard work during my political career and my desire is to invest in the operational exigency of the emerging market in your country or in your company and I will want to leverage on your expertise, you will therefore be the head of the new established and integrated structure of the investment in your country. if you don't wish for any investment cooperation however, you can help me move the fund on a fair percentage or agreement. I will welcome your advice in the area of investment you may consider better since you are on ground; Joint Venture Project maybe ideal. I am counting on your ability and your good-will. Indeed i will appreciate your understanding as regards this development. Please, do not fail to enclose your direct telephone number so as to speak with you directly. Regards, Mr Jeffrey Carney --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2 1/7] staging/wilc1000: Introduce linux_spi_msg_init
On Mon, Jan 11, 2016 at 09:13:31PM +0100, Janosch Frank wrote: > Since all spi read and write functions were basically preparing the > same data, moving the preparation into a function decreased line count > a lot. > > This also resolves the following problems: > Zeroing the message ourselves is not needed, as spi_message_init() > already does that for us. > > The comment on struct spi_transfer states that setting rx or tx to > NULL will result in sending zeroes or discarding read data. Therefore > we don't have to allocate an empty buffer if we only do one way > transfer. > > Returning -ENOMEM on failed allocation would not have resulted in > error catching but success in the callee. Thats because of the > strange expected return values. > > Signed-off-by: Janosch Frank > --- > drivers/staging/wilc1000/linux_wlan_spi.c | 183 > -- linux_wlan_spi.c has been deleted by: 523fc23f1179 ("staging: wilc1000: remove unused files") regards sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 1/6] staging: wlan-ng: Fixed block comment coding style
Weird... It applies with patch but not with git am. Read the first paragraph of Documentation/email-clients.txt `cat raw_email.txt | git am` regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: ion : Donnot wakeup kswapd in ion system alloc
Since ion alloc can be called by userspace,eg gralloc. When it is called frequently, the efficiency of kswapd is to low. And the reclaimed memory is too lower. In this way, the kswapd can use to much cpu resources. With 3.5GB DMA Zone and 0.5 Normal Zone. pgsteal_kswapd_dma 9364140 pgsteal_kswapd_normal 7071043 pgscan_kswapd_dma 10428250 pgscan_kswapd_normal 37840094 With this change the reclaim ratio has greatly improved 18.9% -> 72.5% Signed-off-by: Chen Feng Signed-off-by: Lu bing --- drivers/staging/android/ion/ion_system_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index d4c3e55..b69dfc7 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -27,7 +27,7 @@ #include "ion_priv.h" static gfp_t high_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN | -__GFP_NORETRY) & ~__GFP_DIRECT_RECLAIM; +__GFP_NORETRY) & ~__GFP_RECLAIM; static gfp_t low_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN); static const unsigned int orders[] = {8, 4, 0}; static const int num_orders = ARRAY_SIZE(orders); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 0/7] staging/wilc1000: Refactor spi read and write functions
Best to work against staging-next. This doesn't apply any more. Glen, can you guys test/review these patches, please? They're a bit tricky for me. I have low confidence in "the comments say it's fine to set ->rx to NULL." regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: ni_mio_common: use CR_CHAN more consistently
None of these have a change description. How does using CR_CHAN() help? Does it fix a bug? What are the user visible effects of the bug? (I could figure this out myself, but you'd still have to resend with the information so I haven't). regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 21/28] staging: most: fix retrieval of buffer availability
On Thu, 24 Dec 2015 22:27:13 +0530 Sudip Mukherjee wrote: > On Tue, Dec 22, 2015 at 10:53:02AM +0100, Christian Gromm wrote: > > This patch fixes the function channel_has_mbo that delivers the false > > information in case two AIMs are using the same tx channel. > > > > Signed-off-by: Christian Gromm > > --- > > > > > diff --git a/drivers/staging/most/mostcore/core.c > > b/drivers/staging/most/mostcore/core.c > > index b085f0a..ff0e0dc 100644 > > --- a/drivers/staging/most/mostcore/core.c > > +++ b/drivers/staging/most/mostcore/core.c > > @@ -1352,7 +1352,7 @@ most_c_obj *get_channel_by_iface(struct > > most_interface *iface, int id) > > return i->channel[id]; > > } > > > > -int channel_has_mbo(struct most_interface *iface, int id) > > +int channel_has_mbo(struct most_interface *iface, int id, struct most_aim > > *aim) > > { > > struct most_c_obj *c = get_channel_by_iface(iface, id); > > unsigned long flags; > > @@ -1361,6 +1361,11 @@ int channel_has_mbo(struct most_interface *iface, > > int id) > > if (unlikely(!c)) > > return -EINVAL; > > > > + if (c->aim0.refs && c->aim1.refs && > > + ((aim == c->aim0.ptr && c->aim0.num_buffers <= 0) || > > +(aim == c->aim1.ptr && c->aim1.num_buffers <= 0))) > > + return false; > > channel_has_mbo() return int. maybe return 0 instead of return false.. Right. I'll go ahead and post an update of this. Thanks, Chris > > regards > sudip ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2 21/28] staging: most: fix retrieval of buffer availability
This patch fixes the function channel_has_mbo that delivers the false information in case two AIMs are using the same tx channel. Signed-off-by: Christian Gromm --- v2: make function channel_has_mbo return 0 instead of false. Reported-by: Sudip Mukherjee drivers/staging/most/aim-cdev/cdev.c | 12 ++-- drivers/staging/most/mostcore/core.c |7 ++- drivers/staging/most/mostcore/mostcore.h |3 ++- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c index 533e290..c4bbf7d 100644 --- a/drivers/staging/most/aim-cdev/cdev.c +++ b/drivers/staging/most/aim-cdev/cdev.c @@ -50,6 +50,11 @@ struct aim_channel { static struct list_head channel_list; static spinlock_t ch_list_lock; +static inline bool ch_has_mbo(struct aim_channel *c) +{ + return channel_has_mbo(c->iface, c->channel_id, &cdev_aim) > 0; +} + static struct aim_channel *get_channel(struct most_interface *iface, int id) { struct aim_channel *channel, *tmp; @@ -279,11 +284,6 @@ start_copy: return copied; } -static inline bool __must_check IS_ERR_OR_FALSE(int x) -{ - return x <= 0; -} - static unsigned int aim_poll(struct file *filp, poll_table *wait) { struct aim_channel *c = filp->private_data; @@ -295,7 +295,7 @@ static unsigned int aim_poll(struct file *filp, poll_table *wait) if (!kfifo_is_empty(&c->fifo)) mask |= POLLIN | POLLRDNORM; } else { - if (!IS_ERR_OR_FALSE(channel_has_mbo(c->iface, c->channel_id))) + if (ch_has_mbo(c)) mask |= POLLOUT | POLLWRNORM; } return mask; diff --git a/drivers/staging/most/mostcore/core.c b/drivers/staging/most/mostcore/core.c index b085f0a..ff0e0dc 100644 --- a/drivers/staging/most/mostcore/core.c +++ b/drivers/staging/most/mostcore/core.c @@ -1352,7 +1352,7 @@ most_c_obj *get_channel_by_iface(struct most_interface *iface, int id) return i->channel[id]; } -int channel_has_mbo(struct most_interface *iface, int id) +int channel_has_mbo(struct most_interface *iface, int id, struct most_aim *aim) { struct most_c_obj *c = get_channel_by_iface(iface, id); unsigned long flags; @@ -1361,6 +1361,11 @@ int channel_has_mbo(struct most_interface *iface, int id) if (unlikely(!c)) return -EINVAL; + if (c->aim0.refs && c->aim1.refs && + ((aim == c->aim0.ptr && c->aim0.num_buffers <= 0) || +(aim == c->aim1.ptr && c->aim1.num_buffers <= 0))) + return 0; + spin_lock_irqsave(&c->fifo_lock, flags); empty = list_empty(&c->fifo); spin_unlock_irqrestore(&c->fifo_lock, flags); diff --git a/drivers/staging/most/mostcore/mostcore.h b/drivers/staging/most/mostcore/mostcore.h index bda3850..60e018e 100644 --- a/drivers/staging/most/mostcore/mostcore.h +++ b/drivers/staging/most/mostcore/mostcore.h @@ -310,7 +310,8 @@ int most_deregister_aim(struct most_aim *aim); struct mbo *most_get_mbo(struct most_interface *iface, int channel_idx, struct most_aim *); void most_put_mbo(struct mbo *mbo); -int channel_has_mbo(struct most_interface *iface, int channel_idx); +int channel_has_mbo(struct most_interface *iface, int channel_idx, + struct most_aim *aim); int most_start_channel(struct most_interface *iface, int channel_idx, struct most_aim *); int most_stop_channel(struct most_interface *iface, int channel_idx, -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: ni_pcimio: Adds PXI-6251 to supported boards
On 12/01/16 06:29, Spencer E. Olson wrote: Signed-off-by: Spencer E. Olson --- To: de...@driverdev.osuosl.org Cc: Ian Abbott Cc: H Hartley Sweeten Cc: Greg Kroah-Hartman drivers/staging/comedi/drivers/ni_pcimio.c | 20 +++- 1 file changed, 19 insertions(+), 1 deletion(-) Thanks! Reviewed-by: Ian Abbott -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: comedi: ni_mio_common: use CR_CHAN more consistently
On 12/01/16 12:07, Dan Carpenter wrote: None of these have a change description. How does using CR_CHAN() help? Does it fix a bug? What are the user visible effects of the bug? (I could figure this out myself, but you'd still have to resend with the information so I haven't). regards, dan carpenter Yes, it could do with a change description. It doesn't fix a bug as NISTC_AI_MODE1_CONVERT_SRC() already masks the value sufficiently, but using CR_CHAN() here makes the code clearer as it avoids passing some irrelevant bits to NISTC_AI_MODE1_CONVERT_SRC() in the first place. -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [patch] staging: unisys: remove some dead code
On 01/07/2016 04:34 AM, Dan Carpenter wrote: queue_delayed_work() returns bool, not negative error codes. It returns false if the work has already been queued or true otherwise. Since we don't care about that, we can just remove the test. Signed-off-by: Dan Carpenter Tested with s-Par, works fine (of course). :) Signed-off-by: Benjamin Romer ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: ion : Donnot wakeup kswapd in ion system alloc
On 01/12/2016 03:14 AM, Chen Feng wrote: Since ion alloc can be called by userspace,eg gralloc. When it is called frequently, the efficiency of kswapd is to low. And the reclaimed memory is too lower. In this way, the kswapd can use to much cpu resources. With 3.5GB DMA Zone and 0.5 Normal Zone. pgsteal_kswapd_dma 9364140 pgsteal_kswapd_normal 7071043 pgscan_kswapd_dma 10428250 pgscan_kswapd_normal 37840094 With this change the reclaim ratio has greatly improved 18.9% -> 72.5% Signed-off-by: Chen Feng Signed-off-by: Lu bing --- drivers/staging/android/ion/ion_system_heap.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/android/ion/ion_system_heap.c b/drivers/staging/android/ion/ion_system_heap.c index d4c3e55..b69dfc7 100644 --- a/drivers/staging/android/ion/ion_system_heap.c +++ b/drivers/staging/android/ion/ion_system_heap.c @@ -27,7 +27,7 @@ #include "ion_priv.h" static gfp_t high_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN | -__GFP_NORETRY) & ~__GFP_DIRECT_RECLAIM; +__GFP_NORETRY) & ~__GFP_RECLAIM; static gfp_t low_order_gfp_flags = (GFP_HIGHUSER | __GFP_ZERO | __GFP_NOWARN); static const unsigned int orders[] = {8, 4, 0}; static const int num_orders = ARRAY_SIZE(orders); Makes sense given what the code is actually trying to do and the data presented here. Reviewed-by: Laura Abbott ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: comedi: ni_tiocmd: change mistaken use of start_src for start_arg
This fixes a bug in function ni_tio_input_inttrig(). The trigger number should be compared to cmd->start_arg, not cmd->start_src. Fixes: 6a760394d7eb ("staging: comedi: ni_tiocmd: clarify the cmd->start_arg validation and use") Cc: # 3.17+ Signed-off-by: Spencer E. Olson --- Added description suggested by Ian and Dan. Added Fixes:, CC: tags as suggested by Ian. drivers/staging/comedi/drivers/ni_tiocmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/ni_tiocmd.c b/drivers/staging/comedi/drivers/ni_tiocmd.c index 437f723..823e479 100644 --- a/drivers/staging/comedi/drivers/ni_tiocmd.c +++ b/drivers/staging/comedi/drivers/ni_tiocmd.c @@ -92,7 +92,7 @@ static int ni_tio_input_inttrig(struct comedi_device *dev, unsigned long flags; int ret = 0; - if (trig_num != cmd->start_src) + if (trig_num != cmd->start_arg) return -EINVAL; spin_lock_irqsave(&counter->lock, flags); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: comedi: ni_tiocmd: change mistaken use of start_src for start_arg
On 12/01/16 17:33, Spencer E. Olson wrote: This fixes a bug in function ni_tio_input_inttrig(). The trigger number should be compared to cmd->start_arg, not cmd->start_src. Fixes: 6a760394d7eb ("staging: comedi: ni_tiocmd: clarify the cmd->start_arg validation and use") Cc: # 3.17+ Signed-off-by: Spencer E. Olson --- Added description suggested by Ian and Dan. Added Fixes:, CC: tags as suggested by Ian. drivers/staging/comedi/drivers/ni_tiocmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) It's okay, except that I don't think you can split the Fixes: line like that. (Maybe you can split it by prefixing the continuation lines with whitespace, but it's easier to grep if it's all on one line, and this is a valid exemption to checkpatch warnings about line lengths in the description.) -- -=( Ian Abbott @ MEV Ltd.E-mail: )=- -=( Web: http://www.mev.co.uk/ )=- ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[RESEND][PATCH] Staging: unisys: fix potential format string leak
Since "name" is always used directly, force "%s" for the kthread format string to avoid any potential format string leaks. Signed-off-by: Kees Cook --- drivers/staging/unisys/visorhba/visorhba_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c b/drivers/staging/unisys/visorhba/visorhba_main.c index c119f20dfd44..89712144f804 100644 --- a/drivers/staging/unisys/visorhba/visorhba_main.c +++ b/drivers/staging/unisys/visorhba/visorhba_main.c @@ -167,7 +167,7 @@ static int visor_thread_start(struct visor_thread_info *thrinfo, { /* used to stop the thread */ init_completion(&thrinfo->has_stopped); - thrinfo->task = kthread_run(threadfn, thrcontext, name); + thrinfo->task = kthread_run(threadfn, thrcontext, "%s", name); if (IS_ERR(thrinfo->task)) { thrinfo->id = 0; return PTR_ERR(thrinfo->task); -- 2.6.3 -- Kees Cook Chrome OS & Brillo Security ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: comedi: ni_mio_common: use CR_CHAN more consistently
Generally, the CR_CHAN macro is/should be used to access the relevant bits for channel identification in cmd->*_arg when the corresponding cmd->*_src==TRIG_EXT, including cmd->convert_arg in this case. This patch does not fix a bug per se, as NISTC_AI_MODE1_CONVERT_SRC() already masks the value sufficiently, but using CR_CHAN() here makes the code clearer as it avoids passing some irrelevant bits to NISTC_AI_MODE1_CONVERT_SRC() in the first place. Signed-off-by: Spencer E. Olson --- drivers/staging/comedi/drivers/ni_mio_common.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/staging/comedi/drivers/ni_mio_common.c b/drivers/staging/comedi/drivers/ni_mio_common.c index 6cc304a..fc4d6b0 100644 --- a/drivers/staging/comedi/drivers/ni_mio_common.c +++ b/drivers/staging/comedi/drivers/ni_mio_common.c @@ -2408,7 +2408,8 @@ static int ni_ai_cmd(struct comedi_device *dev, struct comedi_subdevice *s) ni_stc_writew(dev, mode2, NISTC_AI_MODE2_REG); break; case TRIG_EXT: - mode1 |= NISTC_AI_MODE1_CONVERT_SRC(1 + cmd->convert_arg); + mode1 |= NISTC_AI_MODE1_CONVERT_SRC(1 + + CR_CHAN(cmd->convert_arg)); if ((cmd->convert_arg & CR_INVERT) == 0) mode1 |= NISTC_AI_MODE1_CONVERT_POLARITY; ni_stc_writew(dev, mode1, NISTC_AI_MODE1_REG); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH v2] staging: comedi: ni_tiocmd: change mistaken use of start_src for start_arg
Thanks! regards, dan carpenter ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 2/5] staging: wilc1000: remove typedef from struct wilc_cfg_byte_t
Thank you for your comment. I'll resend again this patch after considering your suggestion. regards Chaehyun Lim On Tue, Jan 12, 2016 at 10:00 AM, Joe Perches wrote: > On Tue, 2016-01-12 at 09:32 +0900, Chaehyun Lim wrote: >> This patch removes typedef from struct wilc_cfg_byte_t and renames it to >> wilc_cfg_byte. > > Is this really a good name? > >> diff --git a/drivers/staging/wilc1000/wilc_wlan_cfg.h >> b/drivers/staging/wilc1000/wilc_wlan_cfg.h > [] >> @@ -10,10 +10,10 @@ >> #ifndef WILC_WLAN_CFG_H >> #define WILC_WLAN_CFG_H >> >> -typedef struct { >> +struct wilc_cfg_byte { >> u16 id; >> u16 val; >> -} wilc_cfg_byte_t; >> +}; > > val is a u16, calling it cfg_byte seems misleading. > > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/26] staging: wilc1000: use unified firmware
Hi Glen, On Tue, Jan 12, 2016 at 6:39 PM, Glen Lee wrote: > Use a unified firmware for all mode of operations which are station, ap and > p2p. Two firmware are introduced for 1002 and 1003 chipset. > > Signed-off-by: Glen Lee > --- > drivers/staging/wilc1000/Makefile | 5 ++--- > drivers/staging/wilc1000/linux_wlan.c | 18 +- > 2 files changed, 11 insertions(+), 12 deletions(-) > > diff --git a/drivers/staging/wilc1000/Makefile > b/drivers/staging/wilc1000/Makefile > index 20a5cb9..90c3760 100644 > --- a/drivers/staging/wilc1000/Makefile > +++ b/drivers/staging/wilc1000/Makefile > @@ -1,8 +1,7 @@ > obj-$(CONFIG_WILC1000) += wilc1000.o > > -ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \ > - -DAP_FIRMWARE=\"atmel/wilc1000_ap_fw.bin\" \ > - -DP2P_CONCURRENCY_FIRMWARE=\"atmel/wilc1000_p2p_fw.bin\" > +ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \ > + -DFIRMWARE_1003=\"atmel/wilc1003_firmware.bin\" You can probably put these defines in a header somewhere instead of here. Also, are these firmwares publicly available and have they been submitted to linux-firmware? Thanks, -- Julian Calaby Email: julian.cal...@gmail.com Profile: http://www.google.com/profiles/julian.calaby/ ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 09/26] staging: wilc1000: use unified firmware
On 2016๋ 01์ 13์ผ 08:18, Julian Calaby wrote: Hi Glen, On Tue, Jan 12, 2016 at 6:39 PM, Glen Lee wrote: Use a unified firmware for all mode of operations which are station, ap and p2p. Two firmware are introduced for 1002 and 1003 chipset. Signed-off-by: Glen Lee --- drivers/staging/wilc1000/Makefile | 5 ++--- drivers/staging/wilc1000/linux_wlan.c | 18 +- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/staging/wilc1000/Makefile b/drivers/staging/wilc1000/Makefile index 20a5cb9..90c3760 100644 --- a/drivers/staging/wilc1000/Makefile +++ b/drivers/staging/wilc1000/Makefile @@ -1,8 +1,7 @@ obj-$(CONFIG_WILC1000) += wilc1000.o -ccflags-y += -DSTA_FIRMWARE=\"atmel/wilc1000_fw.bin\" \ - -DAP_FIRMWARE=\"atmel/wilc1000_ap_fw.bin\" \ - -DP2P_CONCURRENCY_FIRMWARE=\"atmel/wilc1000_p2p_fw.bin\" +ccflags-y += -DFIRMWARE_1002=\"atmel/wilc1002_firmware.bin\" \ + -DFIRMWARE_1003=\"atmel/wilc1003_firmware.bin\" You can probably put these defines in a header somewhere instead of here. Hi Julian, It's better to define in header as you say. I'll do this later. Also, are these firmwares publicly available and have they been submitted to linux-firmware? Not yet. We will patch new firmware as soon as possible. Thanks, Glen lee. Thanks, ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[GIT PULL] Staging driver patches for 4.5-rc1
The following changes since commit 9f9499ae8e6415cefc4fe0a96ad0e27864353c89: Linux 4.4-rc5 (2015-12-13 17:42:58 -0800) are available in the git repository at: git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git/ tags/staging-4.5-rc1 for you to fetch changes up to 841e3ed977e0284e3680d6345d880a64e8072573: Revert "arm64: dts: Add dts files to enable ION on Hi6220 SoC." (2016-01-08 21:00:08 -0800) Staging patches for 4.5-rc1 Here is the big staging driver pull request for 4.5-rc1. Lots of cleanups and fixes here, not as many as some releases, but 800+ isn't that bad. Full details in the shortlog. All of these have been in linux-next for a while. Signed-off-by: Greg Kroah-Hartman Abdul Hussain (1): Staging: rtl8188eu: fix space prohibited before that ',' Adriana Reus (9): iio: light: pa12203001: Poweroff chip if register fails iio: Reconcile operation order between iio_register/unregister and pm functions iio: light: us5182d: Add property for choosing default power mode Documentation: devicetree: Add property for controlling power saving mode for the us5182 als sensor iio: light: us5182d: Add functions for selectively enabling als and proximity iio: light: us8152d: Add power management support iio: light: us5182d: Fix enable status inconcistency iio: light: us5182d: Add interrupt support and events iio: light: us5182d: Refactor read_raw function Amarjargal Gundjalam (5): staging: media: bcm2048: match alignments with open parenthesis staging: media: bcm2048: add space around operators staging: media: bcm2048: remove unnecessary blank lines staging: media: bcm2048: remove unnecessary space after a cast staging: media: bcm2048: fix mispelling Amitoj Kaur Chawla (22): staging: rtl8192u: Remove unnecessary function staging: gdm72xx: Remove wrapper function staging: rtl8188eu: core: rtw_ap : Remove unnecessary functions staging: rtl8188eu: Remove unused function staging: rtl8188eu: core: Remove wrapper function staging: rtl8188eu: core: Change function parameter to bool staging: rdma: amso1100: Remove unnecessary variable staging: rdma: hfi1: Remove unnecessary variable staging: rdma: amso1100: Remove extern from function declarations staging: rdma: hfi1: Remove hfi1_nomsix() wrapper function staging: rdma: hfi1: sdma: Remove wrapper functions staging: rdma: hfi1: chip: Remove wrapper function staging: gdm724x: Remove wrapper function staging: wlan-ng: Remove wrapper function staging: wlan-ng: hfa384x_usb: Remove wrapper function staging: wlan-ng: prism2mib: Remove unnecessary variable staging: rtl8712: rtl871x_mlme: Remove wrapper function staging: rtl8192e: Remove unnecessary variable staging: wilc1000: Remove inclusion of version.h staging: rdma: amso1100: c2: Remove wrapper function staging: lustre: lnet: klnds: socklnd: Move extern declarations to header staging: rdma: amso1100: Remove unnecessary variables Andrea Lowe (1): staging/rdma/hfi1: Adding counter resolutions for DataPortCounters Andreas Dilger (1): staging: lustre: update Intel copyright messages 2015 Andrew F. Davis (1): iio: Make IIO value formating function globally available. Andrzej Pietrasiewicz (1): staging: comedi: ni_mio_common: add "no_channel" versions of some functions Anjali Menon (3): staging: rdma: ehca: Added a blank line staging: unisys: visornic: Removed the blank line staging: lustre: lustre: fld: Removed a blank line Anshul Garg (1): iio/inkern.c Use list_for_each_entry_safe Arnd Bergmann (22): staging: iio: select IRQ_WORK for IIO_DUMMY_EVGEN staging/wilc1000: remove unused functions staging/wilc1000: make symbols static if possible staging/wilc1000: use proper naming for global symbols staging/wilc1000: move extern declarations to headers staging/wilc1000: use NO_SECURITY instead of NO_ENCRYPT staging/wilc1000: avoid static definitions in header staging/wilc1000: remove linux_wlan_{device_power,device_detection} staging/wilc1000: move wilc_wlan_inp_t into struct wilc staging/wilc1000: move init/exit functions to driver files staging/wilc1000: unify device pointer staging/wilc1000: pass io_type to wilc_netdev_init staging/wilc1000: use device pointer for phy creation staging/wilc1000: get rid of WILC_SDIO_IRQ_GPIO staging/wilc1000: pass hif operations through initialization staging/wilc1000: turn enable_irq/disable_irq into callbacks staging/wilc1000: remove WILC_SDIO/WILC_SPI macros staging/wilc1000: split out bus specific modules staging/wilc1000: use more regular probing
[PATCH] Staging: vt6656: Fixed multiple commenting codig style issues.
Fixed multiple comment blocks that didn't comply with the kernels coding style. Signed-off-by: maomao xu --- drivers/staging/vt6656/main_usb.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index ee8d1e1..a2f23ae 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -74,10 +74,10 @@ MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers"); #define LONG_RETRY_DEF 4 /* BasebandType[] baseband type selected - 0: indicate 802.11a type - 1: indicate 802.11b type - 2: indicate 802.11g type -*/ + * 0: indicate 802.11a type + * 1: indicate 802.11b type + * 2: indicate 802.11g type + */ #define BBP_TYPE_DEF 2 @@ -284,7 +284,8 @@ static int vnt_init_registers(struct vnt_private *priv) calib_rx_iq = priv->eeprom[EEP_OFS_CALIB_RX_IQ]; if (calib_tx_iq || calib_tx_dc || calib_rx_iq) { /* CR255, enable TX/RX IQ and - DC compensation mode */ +* DC compensation mode +*/ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xff, @@ -306,7 +307,8 @@ static int vnt_init_registers(struct vnt_private *priv) calib_rx_iq); } else { /* CR255, turn off - BB Calibration compensation */ +* BB Calibration compensation +*/ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xff, -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: vt6656: Fixed multiple commenting codig style issues.
Fixed multiple comment blocks that didn't comply with the kernels coding style. Signed-off-by: maomao xu --- drivers/staging/vt6656/main_usb.c | 14 -- 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/drivers/staging/vt6656/main_usb.c b/drivers/staging/vt6656/main_usb.c index ee8d1e1..a2f23ae 100644 --- a/drivers/staging/vt6656/main_usb.c +++ b/drivers/staging/vt6656/main_usb.c @@ -74,10 +74,10 @@ MODULE_PARM_DESC(tx_buffers, "Number of receive usb tx buffers"); #define LONG_RETRY_DEF 4 /* BasebandType[] baseband type selected - 0: indicate 802.11a type - 1: indicate 802.11b type - 2: indicate 802.11g type -*/ + * 0: indicate 802.11a type + * 1: indicate 802.11b type + * 2: indicate 802.11g type + */ #define BBP_TYPE_DEF 2 @@ -284,7 +284,8 @@ static int vnt_init_registers(struct vnt_private *priv) calib_rx_iq = priv->eeprom[EEP_OFS_CALIB_RX_IQ]; if (calib_tx_iq || calib_tx_dc || calib_rx_iq) { /* CR255, enable TX/RX IQ and - DC compensation mode */ +* DC compensation mode +*/ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xff, @@ -306,7 +307,8 @@ static int vnt_init_registers(struct vnt_private *priv) calib_rx_iq); } else { /* CR255, turn off - BB Calibration compensation */ +* BB Calibration compensation +*/ vnt_control_out_u8(priv, MESSAGE_REQUEST_BBREG, 0xff, -- 1.7.9.5 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel