/linux/Documentation/devicetree/bindings/i2c/ |
H A D | i2c-arb-gpio-challenge.yaml | 1 # SPDX-License-Identifier: GPL-2.0-only OR BSD-2-Clause 3 --- 4 $id: http://devicetree.org/schemas/i2c/i2c-arb-gpio-challenge.yaml# 5 $schema: http://devicetree.org/meta-schemas/core.yaml# 7 title: GPIO-based I2C Arbitration Using a Challenge & Response Mechanism 10 - Doug Anderson <dianders@chromium.org> 11 - Peter Rosin <peda@axentia.se> 18 standard I2C multi-master rules. Using GPIOs is generally useful in the case 30 others can see. These are all active low with pull-ups enabled. We'll 32 * OUR_CLAIM: output from us signaling to other hosts that we want the bus [all …]
|
/linux/drivers/mtd/chips/ |
H A D | cfi_cmdset_0020.c | 1 // SPDX-License-Identifier: GPL-2.0 9 * - completely revamped method functions so they are aware and 11 * - scalability vs code size is completely set at compile-time 13 * - optimized write buffer method 14 * 06/21/2002 Joern Engel <joern@wh.fh-wedel.de> and others 15 * - modified Intel Command Set 0x0001 to support ST Advanced Architecture 17 * - added a writev function 18 * 07/13/2005 Joern Engel <joern@wh.fh-wedel.de> 19 * - Plugged memory leak in cfi_staa_writev(). 69 printk(" Feature/Command Support: %4.4X\n", extp->FeatureSupport); in cfi_tell_features() [all …]
|
/linux/arch/mips/kernel/ |
H A D | sync-r4k.c | 1 // SPDX-License-Identifier: GPL-2.0 17 #include <asm/r4k-timer.h> 35 * we want to have the fastest, inlined, non-debug version 36 * of a critical section, to be able to prove counter time-warps: 82 * we saw a time-warp of the counter going backwards: in check_counter_warp() 86 max_warp = max(max_warp, prev - now); in check_counter_warp() 99 WARN(!(now-start), in check_counter_warp() 101 now-start, end-start); in check_counter_warp() 114 retry: in check_counter_sync_source() 115 /* Wait for the target to start. */ in check_counter_sync_source() [all …]
|
/linux/Documentation/locking/ |
H A D | ww-mutex-design.rst | 2 Wound/Wait Deadlock-Proof Mutex Design 5 Please read mutex-design.rst first, as it applies to wait/wound mutexes too. 7 Motivation for WW-Mutexes 8 ------------------------- 14 a handful of situations where the driver needs to wait for buffers to 37 and the deadlock handling approach is called Wait-Die. The name is based on 41 and dies. Hence Wait-Die. 42 There is also another algorithm called Wound-Wait: 46 transaction. Hence Wound-Wait. 48 However, the Wound-Wait algorithm is typically stated to generate fewer backoffs [all …]
|
/linux/drivers/infiniband/hw/hfi1/ |
H A D | firmware.c | 1 // SPDX-License-Identifier: GPL-2.0 OR BSD-3-Clause 3 * Copyright(c) 2015 - 2017 Intel Corporation. 103 #define AUGMENT_SIZE (sizeof(struct augmented_firmware_file) - \ 161 /* 8051 memory access timeout, in us */ 162 #define DC8051_ACCESS_TIMEOUT 100 /* us */ 217 * Read a single 64-bit value from 8051 data memory. 224 * ignored - i.e. the hardware will always do aligned 8-byte reads as if 227 * Return 0 on success, -ENXIO on a read error (timeout). 242 /* wait until ACCESS_COMPLETED is set */ in __read_8051_data() 250 return -ENXIO; in __read_8051_data() [all …]
|
/linux/kernel/futex/ |
H A D | waitwake.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 36 * sys_futex(WAIT, futex, val); 50 * This would cause the waiter on CPU 0 to wait forever because it 60 * sys_futex(WAIT, futex, val); 64 * smp_mb(); (A) <-- paired with -. 73 * `--------> smp_mb(); (B) 80 * waiters--; (b) unlock(hash_bucket(futex)); 99 * the wait call can return error, in which case we backtrack from it in (b). 104 * acquiring the lock. It then decrements them again after releasing it - 112 if (WARN(q->pi_state || q->rt_waiter, "refusing to wake PI futex\n")) in __futex_wake_mark() [all …]
|
H A D | requeue.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 26 * Q_REQUEUE_PI_NONE -> Q_REQUEUE_PI_IGNORE 27 * Q_REQUEUE_PI_IN_PROGRESS -> Q_REQUEUE_PI_WAIT 30 * Q_REQUEUE_PI_NONE -> Q_REQUEUE_PI_INPROGRESS 31 * Q_REQUEUE_PI_IN_PROGRESS -> Q_REQUEUE_PI_DONE/LOCKED 32 * Q_REQUEUE_PI_IN_PROGRESS -> Q_REQUEUE_PI_NONE (requeue failed) 33 * Q_REQUEUE_PI_WAIT -> Q_REQUEUE_PI_DONE/LOCKED 34 * Q_REQUEUE_PI_WAIT -> Q_REQUEUE_PI_IGNORE (requeue failed) 38 * the waiter is still on the 'wait' futex, i.e. uaddr1. 43 * proceed to take the hash bucket lock of uaddr1. If it set state to WAIT, [all …]
|
/linux/sound/soc/au1x/ |
H A D | ac97c.c | 1 // SPDX-License-Identifier: GPL-2.0-only 8 * Charles Eidsness <charles@cooper-street.com> 23 #include <asm/mach-au1x00/au1000.h> 57 /* how often to retry failed codec register reads/writes */ 74 return __raw_readl(ctx->mmio + reg); in RD() 79 __raw_writel(v, ctx->mmio + reg); in WR() 87 unsigned int tmo, retry; in au1xac97c_ac97_read() local 91 retry = AC97_RW_RETRIES; in au1xac97c_ac97_read() 93 mutex_lock(&ctx->lock); in au1xac97c_ac97_read() 96 while ((RD(ctx, AC97_STATUS) & STAT_CP) && --tmo) in au1xac97c_ac97_read() [all …]
|
/linux/drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/ |
H A D | dcn401_clk_mgr_smu_msg.c | 1 // SPDX-License-Identifier: MIT 25 * Function to be used instead of REG_WAIT macro because the wait ends when 42 } while (max_retries--); in dcn401_smu_wait_for_response() 49 /* Wait for response register to be ready */ in dcn401_smu_send_msg_with_param() 61 /* Wait for response */ in dcn401_smu_send_msg_with_param() 95 } while (max_retries--); in dcn401_smu_wait_for_response_delay() 97 TRACE_SMU_DELAY(*total_delay_us, clk_mgr->base.ctx); in dcn401_smu_wait_for_response_delay() 107 /* Wait for response register to be ready */ in dcn401_smu_send_msg_with_param_delay() 119 TRACE_SMU_MSG(msg_id, param_in, clk_mgr->base.ctx); in dcn401_smu_send_msg_with_param_delay() 121 /* Wait for response */ in dcn401_smu_send_msg_with_param_delay() [all …]
|
/linux/drivers/gpu/drm/amd/display/dc/dce/ |
H A D | dmub_replay.c | 1 // SPDX-License-Identifier: MIT 28 // Send gpint command and wait for ack in dmub_replay_get_state() 29 if (!dc_wake_and_execute_gpint(dmub->ctx, DMUB_GPINT__GET_REPLAY_STATE, panel_inst, in dmub_replay_get_state() 36 // Assert if max retry hit in dmub_replay_get_state() 39 /* To-do: Add retry fail log */ in dmub_replay_get_state() 46 static void dmub_replay_enable(struct dmub_replay *dmub, bool enable, bool wait, uint8_t panel_inst) in dmub_replay_enable() argument 49 struct dc_context *dc = dmub->ctx; in dmub_replay_enable() 67 /* Below loops 1000 x 500us = 500 ms. in dmub_replay_enable() 68 * Exit REPLAY may need to wait 1-2 frames to power up. Timeout after at in dmub_replay_enable() 69 * least a few frames. Should never hit the max retry assert below. in dmub_replay_enable() [all …]
|
/linux/drivers/gpu/drm/i915/gt/ |
H A D | intel_reset.c | 1 // SPDX-License-Identifier: MIT 3 * Copyright © 2008-2018 Intel Corporation 41 struct drm_i915_file_private *file_priv = ctx->file_priv; in client_mark_guilty() 52 prev_hang = xchg(&file_priv->hang_timestamp, jiffies); in client_mark_guilty() 57 atomic_add(score, &file_priv->ban_score); in client_mark_guilty() 59 drm_dbg(&ctx->i915->drm, in client_mark_guilty() 61 ctx->name, score, in client_mark_guilty() 62 atomic_read(&file_priv->ban_score)); in client_mark_guilty() 73 if (intel_context_is_closed(rq->context)) in mark_guilty() 77 ctx = rcu_dereference(rq->context->gem_context); in mark_guilty() [all …]
|
/linux/drivers/gpu/drm/i915/display/ |
H A D | intel_fdi.c | 1 // SPDX-License-Identifier: MIT 29 struct intel_display *display = &dev_priv->display; in assert_fdi_tx() 37 * so pipe->transcoder cast is fine here. in assert_fdi_tx() 63 struct intel_display *display = &dev_priv->display; in assert_fdi_rx() 85 struct intel_display *display = &i915->display; in assert_fdi_tx_pll_enabled() 104 struct intel_display *display = &i915->display; in assert_fdi_rx_pll() 126 struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); in intel_fdi_link_train() 128 dev_priv->display.funcs.fdi->fdi_link_train(crtc, crtc_state); in intel_fdi_link_train() 132 * intel_fdi_add_affected_crtcs - add CRTCs on FDI affected by other modeset CRTCs 145 struct drm_i915_private *i915 = to_i915(state->base.dev); in intel_fdi_add_affected_crtcs() [all …]
|
/linux/drivers/usb/typec/tcpm/ |
H A D | tcpci_rt1711h.c | 1 // SPDX-License-Identifier: GPL-2.0+ 5 * Richtek RT1711H Type-C Chip Driver 73 return regmap_raw_read(chip->data.regmap, reg, val, sizeof(u16)); in rt1711h_read16() 78 return regmap_raw_write(chip->data.regmap, reg, &val, sizeof(u16)); in rt1711h_write16() 83 return regmap_raw_read(chip->data.regmap, reg, val, sizeof(u8)); in rt1711h_read8() 88 return regmap_raw_write(chip->data.regmap, reg, &val, sizeof(u8)); in rt1711h_write8() 106 struct regmap *regmap = chip->data.regmap; in rt1711h_init() 116 if (chip->info->enable_pd30_extended_message) { in rt1711h_init() 129 /* tTCPCfilter : (26.7 * val) us */ in rt1711h_init() 144 /* Enable phy discard retry, retry count 7, rx filter deglitch 100 us */ in rt1711h_init() [all …]
|
/linux/drivers/parport/ |
H A D | ieee1284_ops.c | 1 // SPDX-License-Identifier: GPL-2.0 2 /* IEEE-1284 operations for parport. 5 * they are used by the low-level drivers. If they have a special way 7 * the function pointers in port->ops); if not, they can just use these 31 * One-way data transfer functions. * 43 struct pardevice *dev = port->physport->cad; in parport_ieee1284_write_compat() 47 if (port->irq != PARPORT_IRQ_NONE) { in parport_ieee1284_write_compat() 52 port->physport->ieee1284.phase = IEEE1284_PH_FWD_DATA; in parport_ieee1284_write_compat() 56 unsigned long expire = jiffies + dev->timeout; in parport_ieee1284_write_compat() 57 long wait = msecs_to_jiffies(10); in parport_ieee1284_write_compat() local [all …]
|
/linux/arch/arm/boot/dts/samsung/ |
H A D | exynos5250-snow-common.dtsi | 1 // SPDX-License-Identifier: GPL-2.0 8 #include <dt-bindings/gpio/gpio.h> 9 #include <dt-bindings/clock/maxim,max77686.h> 10 #include <dt-bindings/interrupt-controller/irq.h> 11 #include <dt-bindings/input/input.h> 12 #include <dt-bindings/sound/samsung-i2s.h> 30 stdout-path = "serial3:115200n8"; 33 gpio-keys { 34 compatible = "gpio-keys"; 35 pinctrl-names = "default"; [all …]
|
/linux/arch/x86/kernel/ |
H A D | tsc_sync.c | 1 // SPDX-License-Identifier: GPL-2.0 8 * print a warning if not and turn off the TSC clock-source. 10 * The warp-check is point-to-point between two CPUs, the CPU 14 * Only two CPUs may participate - they can enter in any order. 63 if (!resume && time_before(jiffies, adj->nextcheck)) in tsc_verify_tsc_adjust() 66 adj->nextcheck = jiffies + HZ; in tsc_verify_tsc_adjust() 69 if (adj->adjusted == curval) in tsc_verify_tsc_adjust() 73 wrmsrl(MSR_IA32_TSC_ADJUST, adj->adjusted); in tsc_verify_tsc_adjust() 75 if (!adj->warned || resume) { in tsc_verify_tsc_adjust() 76 pr_warn(FW_BUG "TSC ADJUST differs: CPU%u %lld --> %lld. Restoring\n", in tsc_verify_tsc_adjust() [all …]
|
/linux/io_uring/ |
H A D | poll.c | 1 // SPDX-License-Identifier: GPL-2.0 49 * We usually have 1-2 refs taken, 128 is more than enough and we want to 56 static int io_poll_wake(struct wait_queue_entry *wait, unsigned mode, int sync, 61 unsigned long priv = (unsigned long)wqe->private; in wqe_to_req() 68 unsigned long priv = (unsigned long)wqe->private; in wqe_is_double() 79 * grabbing the ownership. Instead of incrementing set a retry flag in io_poll_get_ownership_slowpath() 82 v = atomic_fetch_or(IO_POLL_RETRY_FLAG, &req->poll_refs); in io_poll_get_ownership_slowpath() 85 return !(atomic_fetch_inc(&req->poll_refs) & IO_POLL_REF_MASK); in io_poll_get_ownership_slowpath() 89 * If refs part of ->poll_refs (see IO_POLL_REF_MASK) is 0, it's free. We can 96 if (unlikely(atomic_read(&req->poll_refs) >= IO_POLL_REF_BIAS)) in io_poll_get_ownership() [all …]
|
/linux/drivers/mtd/lpddr/ |
H A D | lpddr_cmds.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 37 struct lpddr_private *lpddr = map->fldrv_priv; in lpddr_cmdset() 47 mtd->priv = map; in lpddr_cmdset() 48 mtd->type = MTD_NORFLASH; in lpddr_cmdset() 51 mtd->_read = lpddr_read; in lpddr_cmdset() 52 mtd->type = MTD_NORFLASH; in lpddr_cmdset() 53 mtd->flags = MTD_CAP_NORFLASH; in lpddr_cmdset() 54 mtd->flags &= ~MTD_BIT_WRITEABLE; in lpddr_cmdset() 55 mtd->_erase = lpddr_erase; in lpddr_cmdset() 56 mtd->_write = lpddr_write_buffers; in lpddr_cmdset() [all …]
|
/linux/mm/ |
H A D | filemap.c | 1 // SPDX-License-Identifier: GPL-2.0-only 5 * Copyright (C) 1994-1999 Linus Torvalds 30 #include <linux/error-injection.h> 33 #include <linux/backing-dev.h> 72 * finished 'unifying' the page and buffer cache and SMP-threaded the 73 * page-cache, 21.05.1999, Ingo Molnar <mingo@redhat.com> 75 * SMP-threaded pagemap-LRU 1999, Andrea Arcangeli <andrea@suse.de> 81 * ->i_mmap_rwsem (truncate_pagecache) 82 * ->private_lock (__free_pte->block_dirty_folio) 83 * ->swap_lock (exclusive_swap_page, others) [all …]
|
H A D | userfaultfd.c | 1 // SPDX-License-Identifier: GPL-2.0-only 26 if (dst_end > dst_vma->vm_end) in validate_dst_vma() 34 if (!dst_vma->vm_userfaultfd_ctx.ctx) in validate_dst_vma() 49 vma = ERR_PTR(-ENOENT); in find_vma_and_prepare_anon() 50 else if (!(vma->vm_flags & VM_SHARED) && in find_vma_and_prepare_anon() 52 vma = ERR_PTR(-ENOMEM); in find_vma_and_prepare_anon() 59 * uffd_lock_vma() - Looku [all...] |
/linux/drivers/usb/ |
H A D | usb-skeleton.c | 1 // SPDX-License-Identifier: GPL-2.0 3 * USB Skeleton driver - 2.2 5 * Copyright (C) 2001-2004 Greg Kroah-Hartman (greg@kroah.com) 7 * This driver is based on the 2.6.3 version of drivers/usb/usb-skeleton.c 37 #define MAX_TRANSFER (PAGE_SIZE - 512) 65 wait_queue_head_t bulk_in_wait; /* to wait for an ongoing read */ 76 usb_free_urb(dev->bulk_in_urb); in skel_delete() 77 usb_put_intf(dev->interface); in skel_delete() 78 usb_put_dev(dev->udev); in skel_delete() 79 kfree(dev->bulk_in_buffer); in skel_delete() [all …]
|
/linux/fs/btrfs/ |
H A D | direct-io.c | 1 // SPDX-License-Identifier: GPL-2.0 6 #include "delalloc-space.h" 7 #include "direct-io.h" 8 #include "extent-tree.h" 39 struct extent_io_tree *io_tree = &BTRFS_I(inode)->io_tree; in lock_extent_direct() 46 return -EAGAIN; in lock_extent_direct() 55 ret = -EAGAIN; in lock_extent_direct() 67 lockend - lockstart + 1); in lock_extent_direct() 77 (!writing || !filemap_range_has_page(inode->i_mapping, in lock_extent_direct() 86 ret = -EAGAIN; in lock_extent_direct() [all …]
|
/linux/drivers/rtc/ |
H A D | rtc-tegra.c | 1 // SPDX-License-Identifier: GPL-2.0+ 5 * Copyright (c) 2010-2019, NVIDIA Corporation. 59 * eight 32 kHz clocks (~250 us). Outside of these updates the CPU is free to 64 return readl(info->base + TEGRA_RTC_REG_BUSY) & 1; in tegra_rtc_check_busy() 68 * Wait for hardware to be ready for writing. This function tries to maximize 74 * AHB side) occurs every eight 32 kHz clocks (~250 us). The behavior of this 75 * function allows us to make some assumptions without introducing a race, 76 * because 250 us is plenty of time to read/write a value. 81 int retries = 500; /* ~490 us is the worst case, ~250 us is best */ in tegra_rtc_wait_while_busy() 84 * First wait for the RTC to become busy. This is when it posts its in tegra_rtc_wait_while_busy() [all …]
|
/linux/sound/pci/emu10k1/ |
H A D | io.c | 1 // SPDX-License-Identifier: GPL-2.0-or-later 4 * Lee Revell <rlrevell@joe-job.com> 5 * James Courtier-Dutton <James@superbug.co.uk> 23 if (snd_BUG_ON(reg & (emu->audigy ? (0xffff0000 & ~A_PTR_ADDRESS_MASK) in check_ptr_reg() 41 spin_lock_irqsave(&emu->emu_lock, flags); in snd_emu10k1_ptr_read() 42 outl(regptr, emu->port + PTR); in snd_emu10k1_ptr_read() 43 val = inl(emu->port + DATA); in snd_emu10k1_ptr_read() 44 spin_unlock_irqrestore(&emu->emu_lock, flags); in snd_emu10k1_ptr_read() 51 mask = (1 << size) - 1; in snd_emu10k1_ptr_read() 76 mask = (1 << size) - 1; in snd_emu10k1_ptr_write() [all …]
|
/linux/net/atm/ |
H A D | lec.h | 1 /* SPDX-License-Identifier: GPL-2.0 */ 88 * establishes multiple Multicast Forward VCCs to us. This list 108 * An LE Client MUST not retry an LE_ARP_REQUEST for a 109 * given frame's LAN Destination more than maximum retry count times, 130 * Time limit ot wait to receive an LE_FLUSH_RESPONSE after the 153 #define LEC_VCC_PRIV(vcc) ((struct lec_vcc_priv *)((vcc)->user_back))
|