Searched refs:sai (Results 1 - 8 of 8) sorted by relevance

/linux-4.4.14/sound/soc/fsl/
H A Dfsl_sai.c43 struct fsl_sai *sai = (struct fsl_sai *)devid; fsl_sai_isr() local
44 struct device *dev = &sai->pdev->dev; fsl_sai_isr()
56 regmap_read(sai->regmap, FSL_SAI_TCSR, &xcsr); fsl_sai_isr()
86 regmap_write(sai->regmap, FSL_SAI_TCSR, flags | xcsr); fsl_sai_isr()
90 regmap_read(sai->regmap, FSL_SAI_RCSR, &xcsr); fsl_sai_isr()
120 regmap_write(sai->regmap, FSL_SAI_RCSR, flags | xcsr); fsl_sai_isr()
132 struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); fsl_sai_set_dai_sysclk_tr() local
153 regmap_update_bits(sai->regmap, FSL_SAI_xCR2(tx), fsl_sai_set_dai_sysclk_tr()
185 struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); fsl_sai_set_dai_fmt_tr() local
189 if (!sai->is_lsb_first) fsl_sai_set_dai_fmt_tr()
220 sai->is_dsp_mode = true; fsl_sai_set_dai_fmt_tr()
228 sai->is_dsp_mode = true; fsl_sai_set_dai_fmt_tr()
265 sai->is_slave_mode = true; fsl_sai_set_dai_fmt_tr()
272 sai->is_slave_mode = true; fsl_sai_set_dai_fmt_tr()
278 regmap_update_bits(sai->regmap, FSL_SAI_xCR2(tx), fsl_sai_set_dai_fmt_tr()
280 regmap_update_bits(sai->regmap, FSL_SAI_xCR4(tx), fsl_sai_set_dai_fmt_tr()
306 struct fsl_sai *sai = snd_soc_dai_get_drvdata(dai); fsl_sai_set_bclk() local
313 if (sai->is_slave_mode) fsl_sai_set_bclk()
317 clk_rate = clk_get_rate(sai->mclk_clk[id]); fsl_sai_set_bclk()
343 sai->mclk_id[tx] = id; fsl_sai_set_bclk()
357 if ((tx && sai->synchronous[TX]) || (!tx && !sai->synchronous[RX])) { fsl_sai_set_bclk()
358 regmap_update_bits(sai->regmap, FSL_SAI_RCR2, fsl_sai_set_bclk()
360 FSL_SAI_CR2_MSEL(sai->mclk_id[tx])); fsl_sai_set_bclk()
361 regmap_update_bits(sai->regmap, FSL_SAI_RCR2, fsl_sai_set_bclk()
364 regmap_update_bits(sai->regmap, FSL_SAI_TCR2, fsl_sai_set_bclk()
366 FSL_SAI_CR2_MSEL(sai->mclk_id[tx])); fsl_sai_set_bclk()
367 regmap_update_bits(sai->regmap, FSL_SAI_TCR2, fsl_sai_set_bclk()
372 sai->mclk_id[tx], savediv, savesub); fsl_sai_set_bclk()
381 struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); fsl_sai_hw_params() local
388 if (!sai->is_slave_mode) { fsl_sai_hw_params()
395 if (!(sai->mclk_streams & BIT(substream->stream))) { fsl_sai_hw_params()
396 ret = clk_prepare_enable(sai->mclk_clk[sai->mclk_id[tx]]); fsl_sai_hw_params()
400 sai->mclk_streams |= BIT(substream->stream); fsl_sai_hw_params()
405 if (!sai->is_dsp_mode) fsl_sai_hw_params()
411 if (sai->is_lsb_first) fsl_sai_hw_params()
418 regmap_update_bits(sai->regmap, FSL_SAI_xCR4(tx), fsl_sai_hw_params()
421 regmap_update_bits(sai->regmap, FSL_SAI_xCR5(tx), fsl_sai_hw_params()
424 regmap_write(sai->regmap, FSL_SAI_xMR(tx), ~0UL - ((1 << channels) - 1)); fsl_sai_hw_params()
432 struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); fsl_sai_hw_free() local
435 if (!sai->is_slave_mode && fsl_sai_hw_free()
436 sai->mclk_streams & BIT(substream->stream)) { fsl_sai_hw_free()
437 clk_disable_unprepare(sai->mclk_clk[sai->mclk_id[tx]]); fsl_sai_hw_free()
438 sai->mclk_streams &= ~BIT(substream->stream); fsl_sai_hw_free()
448 struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); fsl_sai_trigger() local
457 regmap_update_bits(sai->regmap, FSL_SAI_TCR2, FSL_SAI_CR2_SYNC, fsl_sai_trigger()
458 sai->synchronous[TX] ? FSL_SAI_CR2_SYNC : 0); fsl_sai_trigger()
459 regmap_update_bits(sai->regmap, FSL_SAI_RCR2, FSL_SAI_CR2_SYNC, fsl_sai_trigger()
460 sai->synchronous[RX] ? FSL_SAI_CR2_SYNC : 0); fsl_sai_trigger()
470 regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx), fsl_sai_trigger()
473 regmap_update_bits(sai->regmap, FSL_SAI_RCSR, fsl_sai_trigger()
475 regmap_update_bits(sai->regmap, FSL_SAI_TCSR, fsl_sai_trigger()
478 regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx), fsl_sai_trigger()
484 regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx), fsl_sai_trigger()
486 regmap_update_bits(sai->regmap, FSL_SAI_xCSR(tx), fsl_sai_trigger()
490 regmap_read(sai->regmap, FSL_SAI_xCSR(!tx), &xcsr); fsl_sai_trigger()
493 regmap_update_bits(sai->regmap, FSL_SAI_TCSR, fsl_sai_trigger()
495 regmap_update_bits(sai->regmap, FSL_SAI_RCSR, fsl_sai_trigger()
501 regmap_read(sai->regmap, FSL_SAI_xCSR(tx), &xcsr); fsl_sai_trigger()
504 regmap_update_bits(sai->regmap, FSL_SAI_TCSR, fsl_sai_trigger()
506 regmap_update_bits(sai->regmap, FSL_SAI_RCSR, fsl_sai_trigger()
510 * For sai master mode, after several open/close sai, fsl_sai_trigger()
514 * next sai version. fsl_sai_trigger()
516 if (!sai->is_slave_mode) { fsl_sai_trigger()
518 regmap_write(sai->regmap, fsl_sai_trigger()
520 regmap_write(sai->regmap, fsl_sai_trigger()
523 regmap_write(sai->regmap, FSL_SAI_TCSR, 0); fsl_sai_trigger()
524 regmap_write(sai->regmap, FSL_SAI_RCSR, 0); fsl_sai_trigger()
538 struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); fsl_sai_startup() local
540 struct device *dev = &sai->pdev->dev; fsl_sai_startup()
543 ret = clk_prepare_enable(sai->bus_clk); fsl_sai_startup()
549 regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx), FSL_SAI_CR3_TRCE, fsl_sai_startup()
561 struct fsl_sai *sai = snd_soc_dai_get_drvdata(cpu_dai); fsl_sai_shutdown() local
564 regmap_update_bits(sai->regmap, FSL_SAI_xCR3(tx), FSL_SAI_CR3_TRCE, 0); fsl_sai_shutdown()
566 clk_disable_unprepare(sai->bus_clk); fsl_sai_shutdown()
581 struct fsl_sai *sai = dev_get_drvdata(cpu_dai->dev); fsl_sai_dai_probe() local
584 regmap_write(sai->regmap, FSL_SAI_TCSR, FSL_SAI_CSR_SR); fsl_sai_dai_probe()
585 regmap_write(sai->regmap, FSL_SAI_RCSR, FSL_SAI_CSR_SR); fsl_sai_dai_probe()
587 regmap_write(sai->regmap, FSL_SAI_TCSR, 0); fsl_sai_dai_probe()
588 regmap_write(sai->regmap, FSL_SAI_RCSR, 0); fsl_sai_dai_probe()
590 regmap_update_bits(sai->regmap, FSL_SAI_TCR1, FSL_SAI_CR1_RFW_MASK, fsl_sai_dai_probe()
592 regmap_update_bits(sai->regmap, FSL_SAI_RCR1, FSL_SAI_CR1_RFW_MASK, fsl_sai_dai_probe()
595 snd_soc_dai_init_dma_data(cpu_dai, &sai->dma_params_tx, fsl_sai_dai_probe()
596 &sai->dma_params_rx); fsl_sai_dai_probe()
598 snd_soc_dai_set_drvdata(cpu_dai, sai); fsl_sai_dai_probe()
627 .name = "fsl-sai",
711 struct fsl_sai *sai; fsl_sai_probe() local
717 sai = devm_kzalloc(&pdev->dev, sizeof(*sai), GFP_KERNEL); fsl_sai_probe()
718 if (!sai) fsl_sai_probe()
721 sai->pdev = pdev; fsl_sai_probe()
723 if (of_device_is_compatible(pdev->dev.of_node, "fsl,imx6sx-sai")) fsl_sai_probe()
724 sai->sai_on_imx = true; fsl_sai_probe()
726 sai->is_lsb_first = of_property_read_bool(np, "lsb-first"); fsl_sai_probe()
733 sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev, fsl_sai_probe()
737 if (IS_ERR(sai->regmap)) fsl_sai_probe()
738 sai->regmap = devm_regmap_init_mmio_clk(&pdev->dev, fsl_sai_probe()
739 "sai", base, &fsl_sai_regmap_config); fsl_sai_probe()
740 if (IS_ERR(sai->regmap)) { fsl_sai_probe()
742 return PTR_ERR(sai->regmap); fsl_sai_probe()
746 sai->bus_clk = devm_clk_get(&pdev->dev, "bus"); fsl_sai_probe()
747 if (IS_ERR(sai->bus_clk)) { fsl_sai_probe()
749 PTR_ERR(sai->bus_clk)); fsl_sai_probe()
750 sai->bus_clk = NULL; fsl_sai_probe()
753 sai->mclk_clk[0] = sai->bus_clk; fsl_sai_probe()
756 sai->mclk_clk[i] = devm_clk_get(&pdev->dev, tmp); fsl_sai_probe()
757 if (IS_ERR(sai->mclk_clk[i])) { fsl_sai_probe()
759 i + 1, PTR_ERR(sai->mclk_clk[i])); fsl_sai_probe()
760 sai->mclk_clk[i] = NULL; fsl_sai_probe()
770 ret = devm_request_irq(&pdev->dev, irq, fsl_sai_isr, 0, np->name, sai); fsl_sai_probe()
777 sai->synchronous[RX] = true; fsl_sai_probe()
778 sai->synchronous[TX] = false; fsl_sai_probe()
783 if (of_find_property(np, "fsl,sai-synchronous-rx", NULL) && fsl_sai_probe()
784 of_find_property(np, "fsl,sai-asynchronous", NULL)) { fsl_sai_probe()
790 if (of_find_property(np, "fsl,sai-synchronous-rx", NULL)) { fsl_sai_probe()
792 sai->synchronous[RX] = false; fsl_sai_probe()
793 sai->synchronous[TX] = true; fsl_sai_probe()
794 } else if (of_find_property(np, "fsl,sai-asynchronous", NULL)) { fsl_sai_probe()
796 sai->synchronous[RX] = false; fsl_sai_probe()
797 sai->synchronous[TX] = false; fsl_sai_probe()
803 sai->dma_params_rx.addr = res->start + FSL_SAI_RDR; fsl_sai_probe()
804 sai->dma_params_tx.addr = res->start + FSL_SAI_TDR; fsl_sai_probe()
805 sai->dma_params_rx.maxburst = FSL_SAI_MAXBURST_RX; fsl_sai_probe()
806 sai->dma_params_tx.maxburst = FSL_SAI_MAXBURST_TX; fsl_sai_probe()
808 platform_set_drvdata(pdev, sai); fsl_sai_probe()
815 if (sai->sai_on_imx) fsl_sai_probe()
822 { .compatible = "fsl,vf610-sai", },
823 { .compatible = "fsl,imx6sx-sai", },
831 struct fsl_sai *sai = dev_get_drvdata(dev); fsl_sai_suspend() local
833 regcache_cache_only(sai->regmap, true); fsl_sai_suspend()
834 regcache_mark_dirty(sai->regmap); fsl_sai_suspend()
841 struct fsl_sai *sai = dev_get_drvdata(dev); fsl_sai_resume() local
843 regcache_cache_only(sai->regmap, false); fsl_sai_resume()
844 regmap_write(sai->regmap, FSL_SAI_TCSR, FSL_SAI_CSR_SR); fsl_sai_resume()
845 regmap_write(sai->regmap, FSL_SAI_RCSR, FSL_SAI_CSR_SR); fsl_sai_resume()
847 regmap_write(sai->regmap, FSL_SAI_TCSR, 0); fsl_sai_resume()
848 regmap_write(sai->regmap, FSL_SAI_RCSR, 0); fsl_sai_resume()
849 return regcache_sync(sai->regmap); fsl_sai_resume()
860 .name = "fsl-sai",
869 MODULE_ALIAS("platform:fsl-sai");
H A DMakefile16 snd-soc-fsl-sai-objs := fsl_sai.o
25 obj-$(CONFIG_SND_SOC_FSL_SAI) += snd-soc-fsl-sai.o
H A Dfsl-asoc-card.c563 } else if (strstr(cpu_np->name, "sai")) { fsl_asoc_card_probe()
/linux-4.4.14/drivers/staging/lustre/lustre/llite/
H A Dstatahead.c61 /* link into sai->sai_entries */
63 /* link into sai->sai_entries_{received,stated} */
65 /* link into sai hash table locally */
69 /* entry index in the sai */
113 ll_sa_entry_enhash(struct ll_statahead_info *sai, struct ll_sa_entry *entry) ll_sa_entry_enhash() argument
117 spin_lock(&sai->sai_cache_lock[i]); ll_sa_entry_enhash()
118 list_add_tail(&entry->se_hash, &sai->sai_cache[i]); ll_sa_entry_enhash()
119 spin_unlock(&sai->sai_cache_lock[i]); ll_sa_entry_enhash()
126 ll_sa_entry_unhash(struct ll_statahead_info *sai, struct ll_sa_entry *entry) ll_sa_entry_unhash() argument
130 spin_lock(&sai->sai_cache_lock[i]); ll_sa_entry_unhash()
132 spin_unlock(&sai->sai_cache_lock[i]); ll_sa_entry_unhash()
135 static inline int agl_should_run(struct ll_statahead_info *sai, agl_should_run() argument
138 return (inode != NULL && S_ISREG(inode->i_mode) && sai->sai_agl_valid); agl_should_run()
142 sa_first_received_entry(struct ll_statahead_info *sai) sa_first_received_entry() argument
144 return list_entry(sai->sai_entries_received.next, sa_first_received_entry()
149 agl_first_entry(struct ll_statahead_info *sai) agl_first_entry() argument
151 return list_entry(sai->sai_entries_agl.next, agl_first_entry()
155 static inline int sa_sent_full(struct ll_statahead_info *sai) sa_sent_full() argument
157 return atomic_read(&sai->sai_cache_count) >= sai->sai_max; sa_sent_full()
160 static inline int sa_received_empty(struct ll_statahead_info *sai) sa_received_empty() argument
162 return list_empty(&sai->sai_entries_received); sa_received_empty()
165 static inline int agl_list_empty(struct ll_statahead_info *sai) agl_list_empty() argument
167 return list_empty(&sai->sai_entries_agl); agl_list_empty()
176 static inline int sa_low_hit(struct ll_statahead_info *sai) sa_low_hit() argument
178 return ((sai->sai_hit > 7 && sai->sai_hit < 4 * sai->sai_miss) || sa_low_hit()
179 (sai->sai_consecutive_miss > 8)); sa_low_hit()
186 static inline int is_omitted_entry(struct ll_statahead_info *sai, __u64 index) is_omitted_entry() argument
188 return ((__u64)sai->sai_max + index + SA_OMITTED_ENTRY_MAX < is_omitted_entry()
189 sai->sai_index); is_omitted_entry()
196 ll_sa_entry_alloc(struct ll_statahead_info *sai, __u64 index, ll_sa_entry_alloc() argument
247 lli = ll_i2info(sai->sai_inode); ll_sa_entry_alloc()
249 list_add_tail(&entry->se_link, &sai->sai_entries); ll_sa_entry_alloc()
251 ll_sa_entry_enhash(sai, entry); ll_sa_entry_alloc()
254 atomic_inc(&sai->sai_cache_count); ll_sa_entry_alloc()
267 ll_sa_entry_get_byname(struct ll_statahead_info *sai, const struct qstr *qstr) ll_sa_entry_get_byname() argument
272 list_for_each_entry(entry, &sai->sai_cache[i], se_hash) { ll_sa_entry_get_byname()
289 ll_sa_entry_get_byindex(struct ll_statahead_info *sai, __u64 index) ll_sa_entry_get_byindex() argument
293 list_for_each_entry(entry, &sai->sai_entries, se_link) { ll_sa_entry_get_byindex()
305 static void ll_sa_entry_cleanup(struct ll_statahead_info *sai, ll_sa_entry_cleanup() argument
324 static void ll_sa_entry_put(struct ll_statahead_info *sai, ll_sa_entry_put() argument
336 ll_sa_entry_cleanup(sai, entry); ll_sa_entry_put()
340 atomic_dec(&sai->sai_cache_count); ll_sa_entry_put()
345 do_sa_entry_fini(struct ll_statahead_info *sai, struct ll_sa_entry *entry) do_sa_entry_fini() argument
347 struct ll_inode_info *lli = ll_i2info(sai->sai_inode); do_sa_entry_fini()
352 ll_sa_entry_unhash(sai, entry); do_sa_entry_fini()
361 ll_sa_entry_put(sai, entry); do_sa_entry_fini()
368 ll_sa_entry_fini(struct ll_statahead_info *sai, struct ll_sa_entry *entry) ll_sa_entry_fini() argument
373 do_sa_entry_fini(sai, entry); ll_sa_entry_fini()
376 list_for_each_entry_safe(pos, next, &sai->sai_entries, se_link) { ll_sa_entry_fini()
377 if (!is_omitted_entry(sai, pos->se_index)) ll_sa_entry_fini()
379 do_sa_entry_fini(sai, pos); ll_sa_entry_fini()
387 do_sa_entry_to_stated(struct ll_statahead_info *sai, do_sa_entry_to_stated() argument
391 struct list_head *pos = &sai->sai_entries_stated; do_sa_entry_to_stated()
396 list_for_each_entry_reverse(se, &sai->sai_entries_stated, se_list) { do_sa_entry_to_stated()
413 ll_sa_entry_to_stated(struct ll_statahead_info *sai, ll_sa_entry_to_stated() argument
416 struct ll_inode_info *lli = ll_i2info(sai->sai_inode); ll_sa_entry_to_stated()
419 ll_sa_entry_cleanup(sai, entry); ll_sa_entry_to_stated()
423 do_sa_entry_to_stated(sai, entry, stat); ll_sa_entry_to_stated()
434 static void ll_agl_add(struct ll_statahead_info *sai, ll_agl_add() argument
438 struct ll_inode_info *parent = ll_i2info(sai->sai_inode); ll_agl_add()
450 if (agl_list_empty(sai)) ll_agl_add()
452 list_add_tail(&child->lli_agl_list, &sai->sai_entries_agl); ll_agl_add()
459 wake_up(&sai->sai_agl_thread.t_ctl_waitq); ll_agl_add()
464 struct ll_statahead_info *sai; ll_sai_alloc() local
467 sai = kzalloc(sizeof(*sai), GFP_NOFS); ll_sai_alloc()
468 if (!sai) ll_sai_alloc()
471 atomic_set(&sai->sai_refcount, 1); ll_sai_alloc()
474 sai->sai_generation = ++sai_generation; ll_sai_alloc()
476 sai->sai_generation = ++sai_generation; ll_sai_alloc()
479 sai->sai_max = LL_SA_RPC_MIN; ll_sai_alloc()
480 sai->sai_index = 1; ll_sai_alloc()
481 init_waitqueue_head(&sai->sai_waitq); ll_sai_alloc()
482 init_waitqueue_head(&sai->sai_thread.t_ctl_waitq); ll_sai_alloc()
483 init_waitqueue_head(&sai->sai_agl_thread.t_ctl_waitq); ll_sai_alloc()
485 INIT_LIST_HEAD(&sai->sai_entries); ll_sai_alloc()
486 INIT_LIST_HEAD(&sai->sai_entries_received); ll_sai_alloc()
487 INIT_LIST_HEAD(&sai->sai_entries_stated); ll_sai_alloc()
488 INIT_LIST_HEAD(&sai->sai_entries_agl); ll_sai_alloc()
491 INIT_LIST_HEAD(&sai->sai_cache[i]); ll_sai_alloc()
492 spin_lock_init(&sai->sai_cache_lock[i]); ll_sai_alloc()
494 atomic_set(&sai->sai_cache_count, 0); ll_sai_alloc()
496 return sai; ll_sai_alloc()
500 ll_sai_get(struct ll_statahead_info *sai) ll_sai_get() argument
502 atomic_inc(&sai->sai_refcount); ll_sai_get()
503 return sai; ll_sai_get()
506 static void ll_sai_put(struct ll_statahead_info *sai) ll_sai_put() argument
508 struct inode *inode = sai->sai_inode; ll_sai_put()
511 if (atomic_dec_and_lock(&sai->sai_refcount, &lli->lli_sa_lock)) { ll_sai_put()
514 if (unlikely(atomic_read(&sai->sai_refcount) > 0)) { ll_sai_put()
522 LASSERT(thread_is_stopped(&sai->sai_thread)); ll_sai_put()
523 LASSERT(thread_is_stopped(&sai->sai_agl_thread)); ll_sai_put()
529 if (sai->sai_sent > sai->sai_replied) ll_sai_put()
533 sai->sai_sent, sai->sai_replied); ll_sai_put()
536 &sai->sai_entries, se_link) ll_sai_put()
537 do_sa_entry_fini(sai, entry); ll_sai_put()
539 LASSERT(list_empty(&sai->sai_entries)); ll_sai_put()
540 LASSERT(sa_received_empty(sai)); ll_sai_put()
541 LASSERT(list_empty(&sai->sai_entries_stated)); ll_sai_put()
543 LASSERT(atomic_read(&sai->sai_cache_count) == 0); ll_sai_put()
544 LASSERT(agl_list_empty(sai)); ll_sai_put()
547 kfree(sai); ll_sai_put()
552 static void ll_agl_trigger(struct inode *inode, struct ll_statahead_info *sai) ll_agl_trigger() argument
561 if (is_omitted_entry(sai, index + 1)) { ll_agl_trigger()
611 static void ll_post_statahead(struct ll_statahead_info *sai) ll_post_statahead() argument
613 struct inode *dir = sai->sai_inode; ll_post_statahead()
624 if (unlikely(sa_received_empty(sai))) { ll_post_statahead()
628 entry = sa_first_received_entry(sai); ll_post_statahead()
686 if (agl_should_run(sai, child)) ll_post_statahead()
687 ll_agl_add(sai, child, entry->se_index); ll_post_statahead()
694 rc = ll_sa_entry_to_stated(sai, entry, ll_post_statahead()
696 if (rc == 0 && entry->se_index == sai->sai_index_wait) ll_post_statahead()
697 wake_up(&sai->sai_waitq); ll_post_statahead()
698 ll_sa_entry_put(sai, entry); ll_post_statahead()
707 struct ll_statahead_info *sai = NULL; ll_statahead_interpret() local
732 sai = ll_sai_get(lli->lli_sai); ll_statahead_interpret()
733 if (unlikely(!thread_is_running(&sai->sai_thread))) { ll_statahead_interpret()
734 sai->sai_replied++; ll_statahead_interpret()
740 entry = ll_sa_entry_get_byindex(sai, minfo->mi_cbdata); ll_statahead_interpret()
742 sai->sai_replied++; ll_statahead_interpret()
749 do_sa_entry_to_stated(sai, entry, SA_ENTRY_INVA); ll_statahead_interpret()
750 wakeup = (entry->se_index == sai->sai_index_wait); ll_statahead_interpret()
759 wakeup = sa_received_empty(sai); ll_statahead_interpret()
761 &sai->sai_entries_received); ll_statahead_interpret()
763 sai->sai_replied++; ll_statahead_interpret()
766 ll_sa_entry_put(sai, entry); ll_statahead_interpret()
768 wake_up(&sai->sai_thread.t_ctl_waitq); ll_statahead_interpret()
777 if (sai != NULL) ll_statahead_interpret()
778 ll_sai_put(sai); ll_statahead_interpret()
911 struct ll_statahead_info *sai = lli->lli_sai; ll_statahead_one() local
917 entry = ll_sa_entry_alloc(sai, sai->sai_index, entry_name, ll_statahead_one()
927 if (rc == 1 && agl_should_run(sai, d_inode(dentry))) ll_statahead_one()
928 ll_agl_add(sai, d_inode(dentry), entry->se_index); ll_statahead_one()
935 rc1 = ll_sa_entry_to_stated(sai, entry, ll_statahead_one()
937 if (rc1 == 0 && entry->se_index == sai->sai_index_wait) ll_statahead_one()
938 wake_up(&sai->sai_waitq); ll_statahead_one()
940 sai->sai_sent++; ll_statahead_one()
943 sai->sai_index++; ll_statahead_one()
945 ll_sa_entry_put(sai, entry); ll_statahead_one()
955 struct ll_statahead_info *sai = ll_sai_get(plli->lli_sai); ll_agl_thread() local
956 struct ptlrpc_thread *thread = &sai->sai_agl_thread; ll_agl_thread()
960 CDEBUG(D_READA, "agl thread started: sai %p, parent %pd\n", ll_agl_thread()
961 sai, parent); ll_agl_thread()
965 sai->sai_agl_valid = 1; ll_agl_thread()
976 !agl_list_empty(sai) || ll_agl_thread()
986 if (!agl_list_empty(sai)) { ll_agl_thread()
987 clli = agl_first_entry(sai); ll_agl_thread()
990 ll_agl_trigger(&clli->lli_vfs_inode, sai); ll_agl_thread()
997 sai->sai_agl_valid = 0; ll_agl_thread()
998 while (!agl_list_empty(sai)) { ll_agl_thread()
999 clli = agl_first_entry(sai); ll_agl_thread()
1009 ll_sai_put(sai); ll_agl_thread()
1010 CDEBUG(D_READA, "agl thread stopped: sai %p, parent %pd\n", ll_agl_thread()
1011 sai, parent); ll_agl_thread()
1015 static void ll_start_agl(struct dentry *parent, struct ll_statahead_info *sai) ll_start_agl() argument
1017 struct ptlrpc_thread *thread = &sai->sai_agl_thread; ll_start_agl()
1022 CDEBUG(D_READA, "start agl thread: sai %p, parent %pd\n", ll_start_agl()
1023 sai, parent); ll_start_agl()
1046 struct ll_statahead_info *sai = ll_sai_get(plli->lli_sai); ll_statahead_thread() local
1047 struct ptlrpc_thread *thread = &sai->sai_thread; ll_statahead_thread()
1048 struct ptlrpc_thread *agl_thread = &sai->sai_agl_thread; ll_statahead_thread()
1057 CDEBUG(D_READA, "statahead thread starting: sai %p, parent %pd\n", ll_statahead_thread()
1058 sai, parent); ll_statahead_thread()
1061 ll_start_agl(parent, sai); ll_statahead_thread()
1083 PFID(ll_inode2fid(dir)), pos, sai->sai_index, ll_statahead_thread()
1121 } else if (!sai->sai_ls_all) { ll_statahead_thread()
1125 sai->sai_skip_hidden++; ll_statahead_thread()
1138 !sa_sent_full(sai) || ll_statahead_thread()
1139 !sa_received_empty(sai) || ll_statahead_thread()
1140 !agl_list_empty(sai) || ll_statahead_thread()
1145 while (!sa_received_empty(sai)) ll_statahead_thread()
1146 ll_post_statahead(sai); ll_statahead_thread()
1157 if (sa_sent_full(sai)) { ll_statahead_thread()
1159 while (!agl_list_empty(sai)) { ll_statahead_thread()
1160 clli = agl_first_entry(sai); ll_statahead_thread()
1164 sai); ll_statahead_thread()
1166 if (!sa_received_empty(sai)) ll_statahead_thread()
1176 if (!sa_sent_full(sai)) ll_statahead_thread()
1197 !sa_received_empty(sai) || ll_statahead_thread()
1198 sai->sai_sent == sai->sai_replied || ll_statahead_thread()
1202 while (!sa_received_empty(sai)) ll_statahead_thread()
1203 ll_post_statahead(sai); ll_statahead_thread()
1210 if (sai->sai_sent == sai->sai_replied && ll_statahead_thread()
1211 sa_received_empty(sai)) ll_statahead_thread()
1216 while (!agl_list_empty(sai) && ll_statahead_thread()
1218 clli = agl_first_entry(sai); ll_statahead_thread()
1221 ll_agl_trigger(&clli->lli_vfs_inode, sai); ll_statahead_thread()
1246 if (sai->sai_agl_valid) { ll_statahead_thread()
1252 CDEBUG(D_READA, "stop agl thread: sai %p pid %u\n", ll_statahead_thread()
1253 sai, (unsigned int)agl_thread->t_pid); ll_statahead_thread()
1259 thread_set_flags(&sai->sai_agl_thread, SVC_STOPPED); ll_statahead_thread()
1263 if (!sa_received_empty(sai)) { ll_statahead_thread()
1268 while (!sa_received_empty(sai)) ll_statahead_thread()
1269 ll_post_statahead(sai); ll_statahead_thread()
1275 wake_up(&sai->sai_waitq); ll_statahead_thread()
1277 ll_sai_put(sai); ll_statahead_thread()
1279 CDEBUG(D_READA, "statahead thread stopped: sai %p, parent %pd\n", ll_statahead_thread()
1280 sai, parent); ll_statahead_thread()
1311 CDEBUG(D_READA, "stop statahead thread: sai %p pid %u\n", ll_stop_statahead()
1459 ll_sai_unplug(struct ll_statahead_info *sai, struct ll_sa_entry *entry) ll_sai_unplug() argument
1461 struct ptlrpc_thread *thread = &sai->sai_thread; ll_sai_unplug()
1462 struct ll_sb_info *sbi = ll_i2sbi(sai->sai_inode); ll_sai_unplug()
1470 ll_sa_entry_fini(sai, entry); ll_sai_unplug()
1472 sai->sai_hit++; ll_sai_unplug()
1473 sai->sai_consecutive_miss = 0; ll_sai_unplug()
1474 sai->sai_max = min(2 * sai->sai_max, sbi->ll_sa_max); ll_sai_unplug()
1476 struct ll_inode_info *lli = ll_i2info(sai->sai_inode); ll_sai_unplug()
1478 sai->sai_miss++; ll_sai_unplug()
1479 sai->sai_consecutive_miss++; ll_sai_unplug()
1480 if (sa_low_hit(sai) && thread_is_running(thread)) { ll_sai_unplug()
1483 PFID(&lli->lli_fid), sai->sai_hit, ll_sai_unplug()
1484 sai->sai_miss, sai->sai_sent, ll_sai_unplug()
1485 sai->sai_replied); ll_sai_unplug()
1510 struct ll_statahead_info *sai = lli->lli_sai; do_statahead_enter() local
1520 if (sai) { do_statahead_enter()
1521 thread = &sai->sai_thread; do_statahead_enter()
1523 list_empty(&sai->sai_entries_stated))) { do_statahead_enter()
1530 if (sai->sai_ls_all || do_statahead_enter()
1531 sai->sai_miss_hidden >= sai->sai_skip_hidden) { do_statahead_enter()
1538 if (!sai->sai_ls_all) do_statahead_enter()
1545 sai->sai_ls_all = 1; do_statahead_enter()
1551 sai->sai_miss_hidden++; do_statahead_enter()
1556 entry = ll_sa_entry_get_byname(sai, &(*dentryp)->d_name); do_statahead_enter()
1558 ll_sai_unplug(sai, entry); do_statahead_enter()
1563 sai->sai_index_wait = entry->se_index; do_statahead_enter()
1566 rc = l_wait_event(sai->sai_waitq, do_statahead_enter()
1571 ll_sai_unplug(sai, entry); do_statahead_enter()
1593 ll_sai_unplug(sai, entry); do_statahead_enter()
1606 ll_sai_unplug(sai, entry); do_statahead_enter()
1620 ll_sai_unplug(sai, entry); do_statahead_enter()
1632 sai = ll_sai_alloc(); do_statahead_enter()
1633 if (sai == NULL) { do_statahead_enter()
1638 sai->sai_ls_all = (rc == LS_FIRST_DOT_DE); do_statahead_enter()
1639 sai->sai_inode = igrab(dir); do_statahead_enter()
1640 if (unlikely(sai->sai_inode == NULL)) { do_statahead_enter()
1649 if (unlikely(sai->sai_inode != d_inode(parent))) { do_statahead_enter()
1656 iput(sai->sai_inode); do_statahead_enter()
1661 CDEBUG(D_READA, "start statahead thread: sai %p, parent %pd\n", do_statahead_enter()
1662 sai, parent); do_statahead_enter()
1664 /* The sai buffer already has one reference taken at allocation time, do_statahead_enter()
1665 * but as soon as we expose the sai by attaching it to the lli that do_statahead_enter()
1668 * the sai buffer while we intend to access it. */ do_statahead_enter()
1669 ll_sai_get(sai); do_statahead_enter()
1670 lli->lli_sai = sai; do_statahead_enter()
1675 thread = &sai->sai_thread; do_statahead_enter()
1681 thread_set_flags(&sai->sai_agl_thread, SVC_STOPPED); do_statahead_enter()
1684 ll_sai_put(sai); do_statahead_enter()
1685 ll_sai_put(sai); do_statahead_enter()
1693 ll_sai_put(sai); do_statahead_enter()
1702 kfree(sai); do_statahead_enter()
H A Dllite_internal.h1169 struct ll_statahead_info *sai = lli->lli_sai; ll_statahead_mark() local
1177 if (sai != NULL) ll_statahead_mark()
1178 ldd->lld_sa_generation = sai->sai_generation; ll_statahead_mark()
/linux-4.4.14/drivers/dma/
H A Dtxx9dmac.c338 u32 sai, dai; txx9dmac_dostart() local
356 sai = ds->reg_width; txx9dmac_dostart()
359 sai = 0; txx9dmac_dostart()
363 sai = 8; txx9dmac_dostart()
366 channel64_writel(dc, SAIR, sai); txx9dmac_dostart()
377 sai = ds->reg_width; txx9dmac_dostart()
380 sai = 0; txx9dmac_dostart()
384 sai = 4; txx9dmac_dostart()
387 channel32_writel(dc, SAIR, sai); txx9dmac_dostart()
837 u32 sai, dai; for_each_sg() local
867 sai = ds->reg_width; for_each_sg()
870 sai = 0; for_each_sg()
873 txx9dmac_desc_set_nosimple(ddev, desc, sai, dai, for_each_sg()
H A Dtxx9dmac.h292 u32 sai, u32 dai, u32 ccr) txx9dmac_desc_set_nosimple()
295 desc->hwdesc.SAIR = sai; txx9dmac_desc_set_nosimple()
299 desc->hwdesc32.SAIR = sai; txx9dmac_desc_set_nosimple()
290 txx9dmac_desc_set_nosimple(struct txx9dmac_dev *ddev, struct txx9dmac_desc *desc, u32 sai, u32 dai, u32 ccr) txx9dmac_desc_set_nosimple() argument
/linux-4.4.14/net/sctp/
H A Dulpevent.c603 struct sctp_adaptation_event *sai; sctp_ulpevent_make_adaptation_indication() local
612 sai = (struct sctp_adaptation_event *) sctp_ulpevent_make_adaptation_indication()
615 sai->sai_type = SCTP_ADAPTATION_INDICATION; sctp_ulpevent_make_adaptation_indication()
616 sai->sai_flags = 0; sctp_ulpevent_make_adaptation_indication()
617 sai->sai_length = sizeof(struct sctp_adaptation_event); sctp_ulpevent_make_adaptation_indication()
618 sai->sai_adaptation_ind = asoc->peer.adaptation_ind; sctp_ulpevent_make_adaptation_indication()
620 sai->sai_assoc_id = sctp_assoc2id(asoc); sctp_ulpevent_make_adaptation_indication()

Completed in 486 milliseconds