Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'char-misc-7.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull char / misc / IIO driver fixes from Greg KH:
"Here are some char/misc/iio/binder fixes for 7.0-rc4. Nothing major in
here, just the usual:

- lots of iio driver fixes for reported issues

- rust binder fixes for problems found

- gpib driver binding to the wrong device fix

- firmware driver fix

All of these have been in linux-next with no reported issues"

* tag 'char-misc-7.0-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (28 commits)
gpib: lpvo_usb: fix unintended binding of FTDI 8U232AM devices
firmware: stratix10-svc: Add Multi SVC clients support
rust_binder: use lock_vma_under_rcu() in use_page_slow()
rust_binder: call set_notification_done() without proc lock
rust_binder: avoid reading the written value in offsets array
rust_binder: check ownership before using vma
rust_binder: fix oneway spam detection
firmware: stratix10-rsu: Fix NULL pointer dereference when RSU is disabled
iio: imu: adis: Fix NULL pointer dereference in adis_init
iio: imu: inv_icm45600: fix regulator put warning when probe fails
iio: buffer: Fix wait_queue not being removed
iio: gyro: mpu3050-core: fix pm_runtime error handling
iio: gyro: mpu3050-i2c: fix pm_runtime error handling
iio: adc: ad7768-1: Fix ERR_PTR dereference in ad7768_fill_scale_tbl
iio: chemical: sps30_serial: fix buffer size in sps30_serial_read_meas()
iio: chemical: sps30_i2c: fix buffer size in sps30_i2c_read_meas()
iio: magnetometer: tlv493d: remove erroneous shift in X-axis data
iio: proximity: hx9023s: Protect against division by zero in set_samp_freq
iio: proximity: hx9023s: fix assignment order for __counted_by
iio: chemical: bme680: Fix measurement wait duration calculation
...

+325 -181
+64 -20
drivers/android/binder/page_range.rs
··· 142 142 _pin: PhantomPinned, 143 143 } 144 144 145 + // We do not define any ops. For now, used only to check identity of vmas. 146 + static BINDER_VM_OPS: bindings::vm_operations_struct = pin_init::zeroed(); 147 + 148 + // To ensure that we do not accidentally install pages into or zap pages from the wrong vma, we 149 + // check its vm_ops and private data before using it. 150 + fn check_vma(vma: &virt::VmaRef, owner: *const ShrinkablePageRange) -> Option<&virt::VmaMixedMap> { 151 + // SAFETY: Just reading the vm_ops pointer of any active vma is safe. 152 + let vm_ops = unsafe { (*vma.as_ptr()).vm_ops }; 153 + if !ptr::eq(vm_ops, &BINDER_VM_OPS) { 154 + return None; 155 + } 156 + 157 + // SAFETY: Reading the vm_private_data pointer of a binder-owned vma is safe. 158 + let vm_private_data = unsafe { (*vma.as_ptr()).vm_private_data }; 159 + // The ShrinkablePageRange is only dropped when the Process is dropped, which only happens once 160 + // the file's ->release handler is invoked, which means the ShrinkablePageRange outlives any 161 + // VMA associated with it, so there can't be any false positives due to pointer reuse here. 162 + if !ptr::eq(vm_private_data, owner.cast()) { 163 + return None; 164 + } 165 + 166 + vma.as_mixedmap_vma() 167 + } 168 + 145 169 struct Inner { 146 170 /// Array of pages. 147 171 /// ··· 332 308 inner.size = num_pages; 333 309 inner.vma_addr = vma.start(); 334 310 311 + // This pointer is only used for comparison - it's not dereferenced. 312 + // 313 + // SAFETY: We own the vma, and we don't use any methods on VmaNew that rely on 314 + // `vm_private_data`. 315 + unsafe { 316 + (*vma.as_ptr()).vm_private_data = ptr::from_ref(self).cast_mut().cast::<c_void>() 317 + }; 318 + 319 + // SAFETY: We own the vma, and we don't use any methods on VmaNew that rely on 320 + // `vm_ops`. 321 + unsafe { (*vma.as_ptr()).vm_ops = &BINDER_VM_OPS }; 322 + 335 323 Ok(num_pages) 336 324 } 337 325 ··· 435 399 // 436 400 // Using `mmput_async` avoids this, because then the `mm` cleanup is instead queued to a 437 401 // workqueue. 438 - MmWithUser::into_mmput_async(self.mm.mmget_not_zero().ok_or(ESRCH)?) 439 - .mmap_read_lock() 440 - .vma_lookup(vma_addr) 441 - .ok_or(ESRCH)? 442 - .as_mixedmap_vma() 443 - .ok_or(ESRCH)? 444 - .vm_insert_page(user_page_addr, &new_page) 445 - .inspect_err(|err| { 446 - pr_warn!( 447 - "Failed to vm_insert_page({}): vma_addr:{} i:{} err:{:?}", 448 - user_page_addr, 449 - vma_addr, 450 - i, 451 - err 452 - ) 453 - })?; 402 + let mm = MmWithUser::into_mmput_async(self.mm.mmget_not_zero().ok_or(ESRCH)?); 403 + { 404 + let vma_read; 405 + let mmap_read; 406 + let vma = if let Some(ret) = mm.lock_vma_under_rcu(vma_addr) { 407 + vma_read = ret; 408 + check_vma(&vma_read, self) 409 + } else { 410 + mmap_read = mm.mmap_read_lock(); 411 + mmap_read 412 + .vma_lookup(vma_addr) 413 + .and_then(|vma| check_vma(vma, self)) 414 + }; 415 + 416 + match vma { 417 + Some(vma) => vma.vm_insert_page(user_page_addr, &new_page)?, 418 + None => return Err(ESRCH), 419 + } 420 + } 454 421 455 422 let inner = self.lock.lock(); 456 423 ··· 706 667 let mmap_read; 707 668 let mm_mutex; 708 669 let vma_addr; 670 + let range_ptr; 709 671 710 672 { 711 673 // CAST: The `list_head` field is first in `PageInfo`. 712 674 let info = item as *mut PageInfo; 713 675 // SAFETY: The `range` field of `PageInfo` is immutable. 714 - let range = unsafe { &*((*info).range) }; 676 + range_ptr = unsafe { (*info).range }; 677 + // SAFETY: The `range` outlives its `PageInfo` values. 678 + let range = unsafe { &*range_ptr }; 715 679 716 680 mm = match range.mm.mmget_not_zero() { 717 681 Some(mm) => MmWithUser::into_mmput_async(mm), ··· 759 717 // SAFETY: The lru lock is locked when this method is called. 760 718 unsafe { bindings::spin_unlock(&raw mut (*lru).lock) }; 761 719 762 - if let Some(vma) = mmap_read.vma_lookup(vma_addr) { 763 - let user_page_addr = vma_addr + (page_index << PAGE_SHIFT); 764 - vma.zap_page_range_single(user_page_addr, PAGE_SIZE); 720 + if let Some(unchecked_vma) = mmap_read.vma_lookup(vma_addr) { 721 + if let Some(vma) = check_vma(unchecked_vma, range_ptr) { 722 + let user_page_addr = vma_addr + (page_index << PAGE_SHIFT); 723 + vma.zap_page_range_single(user_page_addr, PAGE_SIZE); 724 + } 765 725 } 766 726 767 727 drop(mmap_read);
+2 -1
drivers/android/binder/process.rs
··· 1295 1295 } 1296 1296 1297 1297 pub(crate) fn dead_binder_done(&self, cookie: u64, thread: &Thread) { 1298 - if let Some(death) = self.inner.lock().pull_delivered_death(cookie) { 1298 + let death = self.inner.lock().pull_delivered_death(cookie); 1299 + if let Some(death) = death { 1299 1300 death.set_notification_done(thread); 1300 1301 } 1301 1302 }
+33 -2
drivers/android/binder/range_alloc/array.rs
··· 118 118 size: usize, 119 119 is_oneway: bool, 120 120 pid: Pid, 121 - ) -> Result<usize> { 121 + ) -> Result<(usize, bool)> { 122 122 // Compute new value of free_oneway_space, which is set only on success. 123 123 let new_oneway_space = if is_oneway { 124 124 match self.free_oneway_space.checked_sub(size) { ··· 146 146 .ok() 147 147 .unwrap(); 148 148 149 - Ok(insert_at_offset) 149 + // Start detecting spammers once we have less than 20% 150 + // of async space left (which is less than 10% of total 151 + // buffer size). 152 + // 153 + // (This will short-circuit, so `low_oneway_space` is 154 + // only called when necessary.) 155 + let oneway_spam_detected = 156 + is_oneway && new_oneway_space < self.size / 10 && self.low_oneway_space(pid); 157 + 158 + Ok((insert_at_offset, oneway_spam_detected)) 159 + } 160 + 161 + /// Find the amount and size of buffers allocated by the current caller. 162 + /// 163 + /// The idea is that once we cross the threshold, whoever is responsible 164 + /// for the low async space is likely to try to send another async transaction, 165 + /// and at some point we'll catch them in the act. This is more efficient 166 + /// than keeping a map per pid. 167 + fn low_oneway_space(&self, calling_pid: Pid) -> bool { 168 + let mut total_alloc_size = 0; 169 + let mut num_buffers = 0; 170 + 171 + // Warn if this pid has more than 50 transactions, or more than 50% of 172 + // async space (which is 25% of total buffer size). Oneway spam is only 173 + // detected when the threshold is exceeded. 174 + for range in &self.ranges { 175 + if range.state.is_oneway() && range.state.pid() == calling_pid { 176 + total_alloc_size += range.size; 177 + num_buffers += 1; 178 + } 179 + } 180 + num_buffers > 50 || total_alloc_size > self.size / 4 150 181 } 151 182 152 183 pub(crate) fn reservation_abort(&mut self, offset: usize) -> Result<FreedRange> {
+2 -2
drivers/android/binder/range_alloc/mod.rs
··· 188 188 self.reserve_new(args) 189 189 } 190 190 Impl::Array(array) => { 191 - let offset = 191 + let (offset, oneway_spam_detected) = 192 192 array.reserve_new(args.debug_id, args.size, args.is_oneway, args.pid)?; 193 193 Ok(ReserveNew::Success(ReserveNewSuccess { 194 194 offset, 195 - oneway_spam_detected: false, 195 + oneway_spam_detected, 196 196 _empty_array_alloc: args.empty_array_alloc, 197 197 _new_tree_alloc: args.new_tree_alloc, 198 198 _tree_alloc: args.tree_alloc,
+9 -9
drivers/android/binder/range_alloc/tree.rs
··· 164 164 self.free_oneway_space 165 165 }; 166 166 167 - // Start detecting spammers once we have less than 20% 168 - // of async space left (which is less than 10% of total 169 - // buffer size). 170 - // 171 - // (This will short-circut, so `low_oneway_space` is 172 - // only called when necessary.) 173 - let oneway_spam_detected = 174 - is_oneway && new_oneway_space < self.size / 10 && self.low_oneway_space(pid); 175 - 176 167 let (found_size, found_off, tree_node, free_tree_node) = match self.find_best_match(size) { 177 168 None => { 178 169 pr_warn!("ENOSPC from range_alloc.reserve_new - size: {}", size); ··· 193 202 self.tree.insert(tree_node); 194 203 self.free_tree.insert(free_tree_node); 195 204 } 205 + 206 + // Start detecting spammers once we have less than 20% 207 + // of async space left (which is less than 10% of total 208 + // buffer size). 209 + // 210 + // (This will short-circuit, so `low_oneway_space` is 211 + // only called when necessary.) 212 + let oneway_spam_detected = 213 + is_oneway && new_oneway_space < self.size / 10 && self.low_oneway_space(pid); 196 214 197 215 Ok((found_off, oneway_spam_detected)) 198 216 }
+6 -11
drivers/android/binder/thread.rs
··· 1015 1015 1016 1016 // Copy offsets if there are any. 1017 1017 if offsets_size > 0 { 1018 - { 1019 - let mut reader = 1020 - UserSlice::new(UserPtr::from_addr(trd_data_ptr.offsets as _), offsets_size) 1021 - .reader(); 1022 - alloc.copy_into(&mut reader, aligned_data_size, offsets_size)?; 1023 - } 1018 + let mut offsets_reader = 1019 + UserSlice::new(UserPtr::from_addr(trd_data_ptr.offsets as _), offsets_size) 1020 + .reader(); 1024 1021 1025 1022 let offsets_start = aligned_data_size; 1026 1023 let offsets_end = aligned_data_size + offsets_size; ··· 1038 1041 .step_by(size_of::<u64>()) 1039 1042 .enumerate() 1040 1043 { 1041 - let offset: usize = view 1042 - .alloc 1043 - .read::<u64>(index_offset)? 1044 - .try_into() 1045 - .map_err(|_| EINVAL)?; 1044 + let offset = offsets_reader.read::<u64>()?; 1045 + view.alloc.write(index_offset, &offset)?; 1046 + let offset: usize = offset.try_into().map_err(|_| EINVAL)?; 1046 1047 1047 1048 if offset < end_of_previous_object || !is_aligned(offset, size_of::<u32>()) { 1048 1049 pr_warn!("Got transaction with invalid offset.");
+2
drivers/firmware/stratix10-rsu.c
··· 768 768 rsu_async_status_callback); 769 769 if (ret) { 770 770 dev_err(dev, "Error, getting RSU status %i\n", ret); 771 + stratix10_svc_remove_async_client(priv->chan); 771 772 stratix10_svc_free_channel(priv->chan); 773 + return ret; 772 774 } 773 775 774 776 /* get DCMF version from firmware */
+126 -102
drivers/firmware/stratix10-svc.c
··· 37 37 * service layer will return error to FPGA manager when timeout occurs, 38 38 * timeout is set to 30 seconds (30 * 1000) at Intel Stratix10 SoC. 39 39 */ 40 - #define SVC_NUM_DATA_IN_FIFO 32 40 + #define SVC_NUM_DATA_IN_FIFO 8 41 41 #define SVC_NUM_CHANNEL 4 42 - #define FPGA_CONFIG_DATA_CLAIM_TIMEOUT_MS 200 42 + #define FPGA_CONFIG_DATA_CLAIM_TIMEOUT_MS 2000 43 43 #define FPGA_CONFIG_STATUS_TIMEOUT_SEC 30 44 44 #define BYTE_TO_WORD_SIZE 4 45 45 46 46 /* stratix10 service layer clients */ 47 47 #define STRATIX10_RSU "stratix10-rsu" 48 - #define INTEL_FCS "intel-fcs" 49 48 50 49 /* Maximum number of SDM client IDs. */ 51 50 #define MAX_SDM_CLIENT_IDS 16 ··· 104 105 /** 105 106 * struct stratix10_svc - svc private data 106 107 * @stratix10_svc_rsu: pointer to stratix10 RSU device 107 - * @intel_svc_fcs: pointer to the FCS device 108 108 */ 109 109 struct stratix10_svc { 110 110 struct platform_device *stratix10_svc_rsu; 111 - struct platform_device *intel_svc_fcs; 112 111 }; 113 112 114 113 /** ··· 248 251 * @num_active_client: number of active service client 249 252 * @node: list management 250 253 * @genpool: memory pool pointing to the memory region 251 - * @task: pointer to the thread task which handles SMC or HVC call 252 - * @svc_fifo: a queue for storing service message data 253 254 * @complete_status: state for completion 254 - * @svc_fifo_lock: protect access to service message data queue 255 255 * @invoke_fn: function to issue secure monitor call or hypervisor call 256 256 * @svc: manages the list of client svc drivers 257 + * @sdm_lock: only allows a single command single response to SDM 257 258 * @actrl: async control structure 258 259 * 259 260 * This struct is used to create communication channels for service clients, to ··· 264 269 int num_active_client; 265 270 struct list_head node; 266 271 struct gen_pool *genpool; 267 - struct task_struct *task; 268 - struct kfifo svc_fifo; 269 272 struct completion complete_status; 270 - spinlock_t svc_fifo_lock; 271 273 svc_invoke_fn *invoke_fn; 272 274 struct stratix10_svc *svc; 275 + struct mutex sdm_lock; 273 276 struct stratix10_async_ctrl actrl; 274 277 }; 275 278 ··· 276 283 * @ctrl: pointer to service controller which is the provider of this channel 277 284 * @scl: pointer to service client which owns the channel 278 285 * @name: service client name associated with the channel 286 + * @task: pointer to the thread task which handles SMC or HVC call 287 + * @svc_fifo: a queue for storing service message data (separate fifo for every channel) 288 + * @svc_fifo_lock: protect access to service message data queue (locking pending fifo) 279 289 * @lock: protect access to the channel 280 290 * @async_chan: reference to asynchronous channel object for this channel 281 291 * ··· 289 293 struct stratix10_svc_controller *ctrl; 290 294 struct stratix10_svc_client *scl; 291 295 char *name; 296 + struct task_struct *task; 297 + struct kfifo svc_fifo; 298 + spinlock_t svc_fifo_lock; 292 299 spinlock_t lock; 293 300 struct stratix10_async_chan *async_chan; 294 301 }; ··· 526 527 */ 527 528 static int svc_normal_to_secure_thread(void *data) 528 529 { 529 - struct stratix10_svc_controller 530 - *ctrl = (struct stratix10_svc_controller *)data; 531 - struct stratix10_svc_data *pdata; 532 - struct stratix10_svc_cb_data *cbdata; 530 + struct stratix10_svc_chan *chan = (struct stratix10_svc_chan *)data; 531 + struct stratix10_svc_controller *ctrl = chan->ctrl; 532 + struct stratix10_svc_data *pdata = NULL; 533 + struct stratix10_svc_cb_data *cbdata = NULL; 533 534 struct arm_smccc_res res; 534 535 unsigned long a0, a1, a2, a3, a4, a5, a6, a7; 535 536 int ret_fifo = 0; ··· 554 555 a6 = 0; 555 556 a7 = 0; 556 557 557 - pr_debug("smc_hvc_shm_thread is running\n"); 558 + pr_debug("%s: %s: Thread is running!\n", __func__, chan->name); 558 559 559 560 while (!kthread_should_stop()) { 560 - ret_fifo = kfifo_out_spinlocked(&ctrl->svc_fifo, 561 + ret_fifo = kfifo_out_spinlocked(&chan->svc_fifo, 561 562 pdata, sizeof(*pdata), 562 - &ctrl->svc_fifo_lock); 563 + &chan->svc_fifo_lock); 563 564 564 565 if (!ret_fifo) 565 566 continue; ··· 568 569 (unsigned int)pdata->paddr, pdata->command, 569 570 (unsigned int)pdata->size); 570 571 572 + /* SDM can only process one command at a time */ 573 + pr_debug("%s: %s: Thread is waiting for mutex!\n", 574 + __func__, chan->name); 575 + if (mutex_lock_interruptible(&ctrl->sdm_lock)) { 576 + /* item already dequeued; notify client to unblock it */ 577 + cbdata->status = BIT(SVC_STATUS_ERROR); 578 + cbdata->kaddr1 = NULL; 579 + cbdata->kaddr2 = NULL; 580 + cbdata->kaddr3 = NULL; 581 + if (pdata->chan->scl) 582 + pdata->chan->scl->receive_cb(pdata->chan->scl, 583 + cbdata); 584 + break; 585 + } 586 + 571 587 switch (pdata->command) { 572 588 case COMMAND_RECONFIG_DATA_CLAIM: 573 589 svc_thread_cmd_data_claim(ctrl, pdata, cbdata); 590 + mutex_unlock(&ctrl->sdm_lock); 574 591 continue; 575 592 case COMMAND_RECONFIG: 576 593 a0 = INTEL_SIP_SMC_FPGA_CONFIG_START; ··· 715 700 break; 716 701 default: 717 702 pr_warn("it shouldn't happen\n"); 718 - break; 703 + mutex_unlock(&ctrl->sdm_lock); 704 + continue; 719 705 } 720 - pr_debug("%s: before SMC call -- a0=0x%016x a1=0x%016x", 721 - __func__, 706 + pr_debug("%s: %s: before SMC call -- a0=0x%016x a1=0x%016x", 707 + __func__, chan->name, 722 708 (unsigned int)a0, 723 709 (unsigned int)a1); 724 710 pr_debug(" a2=0x%016x\n", (unsigned int)a2); ··· 728 712 pr_debug(" a5=0x%016x\n", (unsigned int)a5); 729 713 ctrl->invoke_fn(a0, a1, a2, a3, a4, a5, a6, a7, &res); 730 714 731 - pr_debug("%s: after SMC call -- res.a0=0x%016x", 732 - __func__, (unsigned int)res.a0); 715 + pr_debug("%s: %s: after SMC call -- res.a0=0x%016x", 716 + __func__, chan->name, (unsigned int)res.a0); 733 717 pr_debug(" res.a1=0x%016x, res.a2=0x%016x", 734 718 (unsigned int)res.a1, (unsigned int)res.a2); 735 719 pr_debug(" res.a3=0x%016x\n", (unsigned int)res.a3); ··· 744 728 cbdata->kaddr2 = NULL; 745 729 cbdata->kaddr3 = NULL; 746 730 pdata->chan->scl->receive_cb(pdata->chan->scl, cbdata); 731 + mutex_unlock(&ctrl->sdm_lock); 747 732 continue; 748 733 } 749 734 ··· 818 801 break; 819 802 820 803 } 804 + 805 + mutex_unlock(&ctrl->sdm_lock); 821 806 } 822 807 823 808 kfree(cbdata); ··· 1715 1696 if (!p_data) 1716 1697 return -ENOMEM; 1717 1698 1718 - /* first client will create kernel thread */ 1719 - if (!chan->ctrl->task) { 1720 - chan->ctrl->task = 1721 - kthread_run_on_cpu(svc_normal_to_secure_thread, 1722 - (void *)chan->ctrl, 1723 - cpu, "svc_smc_hvc_thread"); 1724 - if (IS_ERR(chan->ctrl->task)) { 1699 + /* first caller creates the per-channel kthread */ 1700 + if (!chan->task) { 1701 + struct task_struct *task; 1702 + 1703 + task = kthread_run_on_cpu(svc_normal_to_secure_thread, 1704 + (void *)chan, 1705 + cpu, "svc_smc_hvc_thread"); 1706 + if (IS_ERR(task)) { 1725 1707 dev_err(chan->ctrl->dev, 1726 1708 "failed to create svc_smc_hvc_thread\n"); 1727 1709 kfree(p_data); 1728 1710 return -EINVAL; 1729 1711 } 1712 + 1713 + spin_lock(&chan->lock); 1714 + if (chan->task) { 1715 + /* another caller won the race; discard our thread */ 1716 + spin_unlock(&chan->lock); 1717 + kthread_stop(task); 1718 + } else { 1719 + chan->task = task; 1720 + spin_unlock(&chan->lock); 1721 + } 1730 1722 } 1731 1723 1732 - pr_debug("%s: sent P-va=%p, P-com=%x, P-size=%u\n", __func__, 1733 - p_msg->payload, p_msg->command, 1724 + pr_debug("%s: %s: sent P-va=%p, P-com=%x, P-size=%u\n", __func__, 1725 + chan->name, p_msg->payload, p_msg->command, 1734 1726 (unsigned int)p_msg->payload_length); 1735 1727 1736 1728 if (list_empty(&svc_data_mem)) { ··· 1777 1747 p_data->arg[2] = p_msg->arg[2]; 1778 1748 p_data->size = p_msg->payload_length; 1779 1749 p_data->chan = chan; 1780 - pr_debug("%s: put to FIFO pa=0x%016x, cmd=%x, size=%u\n", __func__, 1781 - (unsigned int)p_data->paddr, p_data->command, 1782 - (unsigned int)p_data->size); 1783 - ret = kfifo_in_spinlocked(&chan->ctrl->svc_fifo, p_data, 1750 + pr_debug("%s: %s: put to FIFO pa=0x%016x, cmd=%x, size=%u\n", 1751 + __func__, 1752 + chan->name, 1753 + (unsigned int)p_data->paddr, 1754 + p_data->command, 1755 + (unsigned int)p_data->size); 1756 + 1757 + ret = kfifo_in_spinlocked(&chan->svc_fifo, p_data, 1784 1758 sizeof(*p_data), 1785 - &chan->ctrl->svc_fifo_lock); 1759 + &chan->svc_fifo_lock); 1786 1760 1787 1761 kfree(p_data); 1788 1762 ··· 1807 1773 */ 1808 1774 void stratix10_svc_done(struct stratix10_svc_chan *chan) 1809 1775 { 1810 - /* stop thread when thread is running AND only one active client */ 1811 - if (chan->ctrl->task && chan->ctrl->num_active_client <= 1) { 1812 - pr_debug("svc_smc_hvc_shm_thread is stopped\n"); 1813 - kthread_stop(chan->ctrl->task); 1814 - chan->ctrl->task = NULL; 1776 + /* stop thread when thread is running */ 1777 + if (chan->task) { 1778 + pr_debug("%s: %s: svc_smc_hvc_shm_thread is stopping\n", 1779 + __func__, chan->name); 1780 + kthread_stop(chan->task); 1781 + chan->task = NULL; 1815 1782 } 1816 1783 } 1817 1784 EXPORT_SYMBOL_GPL(stratix10_svc_done); ··· 1852 1817 pmem->paddr = pa; 1853 1818 pmem->size = s; 1854 1819 list_add_tail(&pmem->node, &svc_data_mem); 1855 - pr_debug("%s: va=%p, pa=0x%016x\n", __func__, 1856 - pmem->vaddr, (unsigned int)pmem->paddr); 1820 + pr_debug("%s: %s: va=%p, pa=0x%016x\n", __func__, 1821 + chan->name, pmem->vaddr, (unsigned int)pmem->paddr); 1857 1822 1858 1823 return (void *)va; 1859 1824 } ··· 1890 1855 {}, 1891 1856 }; 1892 1857 1858 + static const char * const chan_names[SVC_NUM_CHANNEL] = { 1859 + SVC_CLIENT_FPGA, 1860 + SVC_CLIENT_RSU, 1861 + SVC_CLIENT_FCS, 1862 + SVC_CLIENT_HWMON 1863 + }; 1864 + 1893 1865 static int stratix10_svc_drv_probe(struct platform_device *pdev) 1894 1866 { 1895 1867 struct device *dev = &pdev->dev; ··· 1904 1862 struct stratix10_svc_chan *chans; 1905 1863 struct gen_pool *genpool; 1906 1864 struct stratix10_svc_sh_memory *sh_memory; 1907 - struct stratix10_svc *svc; 1865 + struct stratix10_svc *svc = NULL; 1908 1866 1909 1867 svc_invoke_fn *invoke_fn; 1910 1868 size_t fifo_size; 1911 - int ret; 1869 + int ret, i = 0; 1912 1870 1913 1871 /* get SMC or HVC function */ 1914 1872 invoke_fn = get_invoke_func(dev); ··· 1947 1905 controller->num_active_client = 0; 1948 1906 controller->chans = chans; 1949 1907 controller->genpool = genpool; 1950 - controller->task = NULL; 1951 1908 controller->invoke_fn = invoke_fn; 1909 + INIT_LIST_HEAD(&controller->node); 1952 1910 init_completion(&controller->complete_status); 1953 1911 1954 1912 ret = stratix10_svc_async_init(controller); ··· 1959 1917 } 1960 1918 1961 1919 fifo_size = sizeof(struct stratix10_svc_data) * SVC_NUM_DATA_IN_FIFO; 1962 - ret = kfifo_alloc(&controller->svc_fifo, fifo_size, GFP_KERNEL); 1963 - if (ret) { 1964 - dev_err(dev, "failed to allocate FIFO\n"); 1965 - goto err_async_exit; 1920 + mutex_init(&controller->sdm_lock); 1921 + 1922 + for (i = 0; i < SVC_NUM_CHANNEL; i++) { 1923 + chans[i].scl = NULL; 1924 + chans[i].ctrl = controller; 1925 + chans[i].name = (char *)chan_names[i]; 1926 + spin_lock_init(&chans[i].lock); 1927 + ret = kfifo_alloc(&chans[i].svc_fifo, fifo_size, GFP_KERNEL); 1928 + if (ret) { 1929 + dev_err(dev, "failed to allocate FIFO %d\n", i); 1930 + goto err_free_fifos; 1931 + } 1932 + spin_lock_init(&chans[i].svc_fifo_lock); 1966 1933 } 1967 - spin_lock_init(&controller->svc_fifo_lock); 1968 - 1969 - chans[0].scl = NULL; 1970 - chans[0].ctrl = controller; 1971 - chans[0].name = SVC_CLIENT_FPGA; 1972 - spin_lock_init(&chans[0].lock); 1973 - 1974 - chans[1].scl = NULL; 1975 - chans[1].ctrl = controller; 1976 - chans[1].name = SVC_CLIENT_RSU; 1977 - spin_lock_init(&chans[1].lock); 1978 - 1979 - chans[2].scl = NULL; 1980 - chans[2].ctrl = controller; 1981 - chans[2].name = SVC_CLIENT_FCS; 1982 - spin_lock_init(&chans[2].lock); 1983 - 1984 - chans[3].scl = NULL; 1985 - chans[3].ctrl = controller; 1986 - chans[3].name = SVC_CLIENT_HWMON; 1987 - spin_lock_init(&chans[3].lock); 1988 1934 1989 1935 list_add_tail(&controller->node, &svc_ctrl); 1990 1936 platform_set_drvdata(pdev, controller); ··· 1981 1951 svc = devm_kzalloc(dev, sizeof(*svc), GFP_KERNEL); 1982 1952 if (!svc) { 1983 1953 ret = -ENOMEM; 1984 - goto err_free_kfifo; 1954 + goto err_free_fifos; 1985 1955 } 1986 1956 controller->svc = svc; 1987 1957 ··· 1989 1959 if (!svc->stratix10_svc_rsu) { 1990 1960 dev_err(dev, "failed to allocate %s device\n", STRATIX10_RSU); 1991 1961 ret = -ENOMEM; 1992 - goto err_free_kfifo; 1962 + goto err_free_fifos; 1993 1963 } 1994 1964 1995 1965 ret = platform_device_add(svc->stratix10_svc_rsu); 1996 - if (ret) { 1997 - platform_device_put(svc->stratix10_svc_rsu); 1998 - goto err_free_kfifo; 1999 - } 2000 - 2001 - svc->intel_svc_fcs = platform_device_alloc(INTEL_FCS, 1); 2002 - if (!svc->intel_svc_fcs) { 2003 - dev_err(dev, "failed to allocate %s device\n", INTEL_FCS); 2004 - ret = -ENOMEM; 2005 - goto err_unregister_rsu_dev; 2006 - } 2007 - 2008 - ret = platform_device_add(svc->intel_svc_fcs); 2009 - if (ret) { 2010 - platform_device_put(svc->intel_svc_fcs); 2011 - goto err_unregister_rsu_dev; 2012 - } 1966 + if (ret) 1967 + goto err_put_device; 2013 1968 2014 1969 ret = of_platform_default_populate(dev_of_node(dev), NULL, dev); 2015 1970 if (ret) 2016 - goto err_unregister_fcs_dev; 1971 + goto err_unregister_rsu_dev; 2017 1972 2018 1973 pr_info("Intel Service Layer Driver Initialized\n"); 2019 1974 2020 1975 return 0; 2021 1976 2022 - err_unregister_fcs_dev: 2023 - platform_device_unregister(svc->intel_svc_fcs); 2024 1977 err_unregister_rsu_dev: 2025 1978 platform_device_unregister(svc->stratix10_svc_rsu); 2026 - err_free_kfifo: 2027 - kfifo_free(&controller->svc_fifo); 2028 - err_async_exit: 1979 + goto err_free_fifos; 1980 + err_put_device: 1981 + platform_device_put(svc->stratix10_svc_rsu); 1982 + err_free_fifos: 1983 + /* only remove from list if list_add_tail() was reached */ 1984 + if (!list_empty(&controller->node)) 1985 + list_del(&controller->node); 1986 + /* free only the FIFOs that were successfully allocated */ 1987 + while (i--) 1988 + kfifo_free(&chans[i].svc_fifo); 2029 1989 stratix10_svc_async_exit(controller); 2030 1990 err_destroy_pool: 2031 1991 gen_pool_destroy(genpool); 1992 + 2032 1993 return ret; 2033 1994 } 2034 1995 2035 1996 static void stratix10_svc_drv_remove(struct platform_device *pdev) 2036 1997 { 1998 + int i; 2037 1999 struct stratix10_svc_controller *ctrl = platform_get_drvdata(pdev); 2038 2000 struct stratix10_svc *svc = ctrl->svc; 2039 2001 ··· 2033 2011 2034 2012 of_platform_depopulate(ctrl->dev); 2035 2013 2036 - platform_device_unregister(svc->intel_svc_fcs); 2037 2014 platform_device_unregister(svc->stratix10_svc_rsu); 2038 2015 2039 - kfifo_free(&ctrl->svc_fifo); 2040 - if (ctrl->task) { 2041 - kthread_stop(ctrl->task); 2042 - ctrl->task = NULL; 2016 + for (i = 0; i < SVC_NUM_CHANNEL; i++) { 2017 + if (ctrl->chans[i].task) { 2018 + kthread_stop(ctrl->chans[i].task); 2019 + ctrl->chans[i].task = NULL; 2020 + } 2021 + kfifo_free(&ctrl->chans[i].svc_fifo); 2043 2022 } 2023 + 2044 2024 if (ctrl->genpool) 2045 2025 gen_pool_destroy(ctrl->genpool); 2046 2026 list_del(&ctrl->node);
+4 -3
drivers/gpib/lpvo_usb_gpib/lpvo_usb_gpib.c
··· 38 38 /* 39 39 * Table of devices that work with this driver. 40 40 * 41 - * Currently, only one device is known to be used in the 42 - * lpvo_usb_gpib adapter (FTDI 0403:6001). 41 + * Currently, only one device is known to be used in the lpvo_usb_gpib 42 + * adapter (FTDI 0403:6001) but as this device id is already handled by the 43 + * ftdi_sio USB serial driver the LPVO driver must not bind to it by default. 44 + * 43 45 * If your adapter uses a different chip, insert a line 44 46 * in the following table with proper <Vendor-id>, <Product-id>. 45 47 * ··· 52 50 */ 53 51 54 52 static const struct usb_device_id skel_table[] = { 55 - { USB_DEVICE(0x0403, 0x6001) }, 56 53 { } /* Terminating entry */ 57 54 }; 58 55 MODULE_DEVICE_TABLE(usb, skel_table);
+11 -2
drivers/iio/adc/ad7768-1.c
··· 531 531 return ret; 532 532 } 533 533 534 - static void ad7768_fill_scale_tbl(struct iio_dev *dev) 534 + static int ad7768_fill_scale_tbl(struct iio_dev *dev) 535 535 { 536 536 struct ad7768_state *st = iio_priv(dev); 537 537 const struct iio_scan_type *scan_type; ··· 541 541 u64 tmp2; 542 542 543 543 scan_type = iio_get_current_scan_type(dev, &dev->channels[0]); 544 + if (IS_ERR(scan_type)) { 545 + dev_err(&st->spi->dev, "Failed to get scan type.\n"); 546 + return PTR_ERR(scan_type); 547 + } 548 + 544 549 if (scan_type->sign == 's') 545 550 val2 = scan_type->realbits - 1; 546 551 else ··· 570 565 st->scale_tbl[i][0] = tmp0; /* Integer part */ 571 566 st->scale_tbl[i][1] = abs(tmp1); /* Fractional part */ 572 567 } 568 + 569 + return 0; 573 570 } 574 571 575 572 static int ad7768_set_sinc3_dec_rate(struct ad7768_state *st, ··· 676 669 } 677 670 678 671 /* Update scale table: scale values vary according to the precision */ 679 - ad7768_fill_scale_tbl(dev); 672 + ret = ad7768_fill_scale_tbl(dev); 673 + if (ret) 674 + return ret; 680 675 681 676 ad7768_fill_samp_freq_tbl(st); 682 677
+1 -1
drivers/iio/chemical/bme680_core.c
··· 613 613 * + heater duration 614 614 */ 615 615 int wait_eoc_us = ((data->oversampling_temp + data->oversampling_press + 616 - data->oversampling_humid) * 1936) + (477 * 4) + 616 + data->oversampling_humid) * 1963) + (477 * 4) + 617 617 (477 * 5) + 1000 + (data->heater_dur * 1000); 618 618 619 619 fsleep(wait_eoc_us);
+1 -1
drivers/iio/chemical/sps30_i2c.c
··· 171 171 if (!sps30_i2c_meas_ready(state)) 172 172 return -ETIMEDOUT; 173 173 174 - return sps30_i2c_command(state, SPS30_I2C_READ_MEAS, NULL, 0, meas, sizeof(num) * num); 174 + return sps30_i2c_command(state, SPS30_I2C_READ_MEAS, NULL, 0, meas, sizeof(*meas) * num); 175 175 } 176 176 177 177 static int sps30_i2c_clean_fan(struct sps30_state *state)
+1 -1
drivers/iio/chemical/sps30_serial.c
··· 303 303 if (msleep_interruptible(1000)) 304 304 return -EINTR; 305 305 306 - ret = sps30_serial_command(state, SPS30_SERIAL_READ_MEAS, NULL, 0, meas, num * sizeof(num)); 306 + ret = sps30_serial_command(state, SPS30_SERIAL_READ_MEAS, NULL, 0, meas, num * sizeof(*meas)); 307 307 if (ret < 0) 308 308 return ret; 309 309 /* if measurements aren't ready sensor returns empty frame */
+1 -1
drivers/iio/dac/ds4424.c
··· 140 140 141 141 switch (mask) { 142 142 case IIO_CHAN_INFO_RAW: 143 - if (val < S8_MIN || val > S8_MAX) 143 + if (val <= S8_MIN || val > S8_MAX) 144 144 return -EINVAL; 145 145 146 146 if (val > 0) {
+1 -1
drivers/iio/frequency/adf4377.c
··· 508 508 return ret; 509 509 510 510 return regmap_read_poll_timeout(st->regmap, 0x0, read_val, 511 - !(read_val & (ADF4377_0000_SOFT_RESET_R_MSK | 511 + !(read_val & (ADF4377_0000_SOFT_RESET_MSK | 512 512 ADF4377_0000_SOFT_RESET_R_MSK)), 200, 200 * 100); 513 513 } 514 514
+13 -5
drivers/iio/gyro/mpu3050-core.c
··· 322 322 } 323 323 case IIO_CHAN_INFO_RAW: 324 324 /* Resume device */ 325 - pm_runtime_get_sync(mpu3050->dev); 325 + ret = pm_runtime_resume_and_get(mpu3050->dev); 326 + if (ret) 327 + return ret; 326 328 mutex_lock(&mpu3050->lock); 327 329 328 330 ret = mpu3050_set_8khz_samplerate(mpu3050); ··· 649 647 static int mpu3050_buffer_preenable(struct iio_dev *indio_dev) 650 648 { 651 649 struct mpu3050 *mpu3050 = iio_priv(indio_dev); 650 + int ret; 652 651 653 - pm_runtime_get_sync(mpu3050->dev); 652 + ret = pm_runtime_resume_and_get(mpu3050->dev); 653 + if (ret) 654 + return ret; 654 655 655 656 /* Unless we have OUR trigger active, run at full speed */ 656 - if (!mpu3050->hw_irq_trigger) 657 - return mpu3050_set_8khz_samplerate(mpu3050); 657 + if (!mpu3050->hw_irq_trigger) { 658 + ret = mpu3050_set_8khz_samplerate(mpu3050); 659 + if (ret) 660 + pm_runtime_put_autosuspend(mpu3050->dev); 661 + } 658 662 659 - return 0; 663 + return ret; 660 664 } 661 665 662 666 static int mpu3050_buffer_postdisable(struct iio_dev *indio_dev)
+1 -2
drivers/iio/gyro/mpu3050-i2c.c
··· 19 19 struct mpu3050 *mpu3050 = i2c_mux_priv(mux); 20 20 21 21 /* Just power up the device, that is all that is needed */ 22 - pm_runtime_get_sync(mpu3050->dev); 23 - return 0; 22 + return pm_runtime_resume_and_get(mpu3050->dev); 24 23 } 25 24 26 25 static int mpu3050_i2c_bypass_deselect(struct i2c_mux_core *mux, u32 chan_id)
+1 -1
drivers/iio/imu/adis.c
··· 526 526 527 527 adis->spi = spi; 528 528 adis->data = data; 529 - if (!adis->ops->write && !adis->ops->read && !adis->ops->reset) 529 + if (!adis->ops) 530 530 adis->ops = &adis_default_ops; 531 531 else if (!adis->ops->write || !adis->ops->read || !adis->ops->reset) 532 532 return -EINVAL;
+2
drivers/iio/imu/inv_icm42600/inv_icm42600_accel.c
··· 651 651 return -EINVAL; 652 652 653 653 conf.odr = inv_icm42600_accel_odr_conv[idx / 2]; 654 + if (conf.odr == st->conf.accel.odr) 655 + return 0; 654 656 655 657 pm_runtime_get_sync(dev); 656 658 mutex_lock(&st->lock);
+4
drivers/iio/imu/inv_icm42600/inv_icm42600_buffer.c
··· 371 371 static int inv_icm42600_buffer_postdisable(struct iio_dev *indio_dev) 372 372 { 373 373 struct inv_icm42600_state *st = iio_device_get_drvdata(indio_dev); 374 + struct inv_icm42600_sensor_state *sensor_st = iio_priv(indio_dev); 375 + struct inv_sensors_timestamp *ts = &sensor_st->ts; 374 376 struct device *dev = regmap_get_device(st->map); 375 377 unsigned int sensor; 376 378 unsigned int *watermark; ··· 393 391 } 394 392 395 393 mutex_lock(&st->lock); 394 + 395 + inv_sensors_timestamp_apply_odr(ts, 0, 0, 0); 396 396 397 397 ret = inv_icm42600_buffer_set_fifo_en(st, st->fifo.en & ~sensor); 398 398 if (ret)
+2
drivers/iio/imu/inv_icm42600/inv_icm42600_gyro.c
··· 358 358 return -EINVAL; 359 359 360 360 conf.odr = inv_icm42600_gyro_odr_conv[idx / 2]; 361 + if (conf.odr == st->conf.gyro.odr) 362 + return 0; 361 363 362 364 pm_runtime_get_sync(dev); 363 365 mutex_lock(&st->lock);
+1 -1
drivers/iio/imu/inv_icm45600/inv_icm45600.h
··· 205 205 #define INV_ICM45600_SPI_SLEW_RATE_38NS 0 206 206 207 207 #define INV_ICM45600_REG_INT1_CONFIG2 0x0018 208 - #define INV_ICM45600_INT1_CONFIG2_PUSH_PULL BIT(2) 208 + #define INV_ICM45600_INT1_CONFIG2_OPEN_DRAIN BIT(2) 209 209 #define INV_ICM45600_INT1_CONFIG2_LATCHED BIT(1) 210 210 #define INV_ICM45600_INT1_CONFIG2_ACTIVE_HIGH BIT(0) 211 211 #define INV_ICM45600_INT1_CONFIG2_ACTIVE_LOW 0x00
+8 -3
drivers/iio/imu/inv_icm45600/inv_icm45600_core.c
··· 637 637 break; 638 638 } 639 639 640 - if (!open_drain) 641 - val |= INV_ICM45600_INT1_CONFIG2_PUSH_PULL; 640 + if (open_drain) 641 + val |= INV_ICM45600_INT1_CONFIG2_OPEN_DRAIN; 642 642 643 643 ret = regmap_write(st->map, INV_ICM45600_REG_INT1_CONFIG2, val); 644 644 if (ret) ··· 744 744 */ 745 745 fsleep(5 * USEC_PER_MSEC); 746 746 747 + /* set pm_runtime active early for disable vddio resource cleanup */ 748 + ret = pm_runtime_set_active(dev); 749 + if (ret) 750 + return ret; 751 + 747 752 ret = inv_icm45600_enable_regulator_vddio(st); 748 753 if (ret) 749 754 return ret; ··· 781 776 if (ret) 782 777 return ret; 783 778 784 - ret = devm_pm_runtime_set_active_enabled(dev); 779 + ret = devm_pm_runtime_enable(dev); 785 780 if (ret) 786 781 return ret; 787 782
+8
drivers/iio/imu/inv_mpu6050/inv_mpu_core.c
··· 1943 1943 irq_type); 1944 1944 return -EINVAL; 1945 1945 } 1946 + 1947 + /* 1948 + * Acking interrupts by status register does not work reliably 1949 + * but seem to work when this bit is set. 1950 + */ 1951 + if (st->chip_type == INV_MPU9150) 1952 + st->irq_mask |= INV_MPU6050_INT_RD_CLEAR; 1953 + 1946 1954 device_set_wakeup_capable(dev, true); 1947 1955 1948 1956 st->vdd_supply = devm_regulator_get(dev, "vdd");
+2
drivers/iio/imu/inv_mpu6050/inv_mpu_iio.h
··· 390 390 /* enable level triggering */ 391 391 #define INV_MPU6050_LATCH_INT_EN 0x20 392 392 #define INV_MPU6050_BIT_BYPASS_EN 0x2 393 + /* allow acking interrupts by any register read */ 394 + #define INV_MPU6050_INT_RD_CLEAR 0x10 393 395 394 396 /* Allowed timestamp period jitter in percent */ 395 397 #define INV_MPU6050_TS_PERIOD_JITTER 4
+4 -1
drivers/iio/imu/inv_mpu6050/inv_mpu_trigger.c
··· 248 248 switch (st->chip_type) { 249 249 case INV_MPU6000: 250 250 case INV_MPU6050: 251 - case INV_MPU9150: 252 251 /* 253 252 * WoM is not supported and interrupt status read seems to be broken for 254 253 * some chips. Since data ready is the only interrupt, bypass interrupt ··· 256 257 wom_bits = 0; 257 258 int_status = INV_MPU6050_BIT_RAW_DATA_RDY_INT; 258 259 goto data_ready_interrupt; 260 + case INV_MPU9150: 261 + /* IRQ needs to be acked */ 262 + wom_bits = 0; 263 + break; 259 264 case INV_MPU6500: 260 265 case INV_MPU6515: 261 266 case INV_MPU6880:
+4 -2
drivers/iio/industrialio-buffer.c
··· 228 228 written = 0; 229 229 add_wait_queue(&rb->pollq, &wait); 230 230 do { 231 - if (!indio_dev->info) 232 - return -ENODEV; 231 + if (!indio_dev->info) { 232 + ret = -ENODEV; 233 + break; 234 + } 233 235 234 236 if (!iio_buffer_space_available(rb)) { 235 237 if (signal_pending(current)) {
+1 -1
drivers/iio/light/bh1780.c
··· 109 109 case IIO_LIGHT: 110 110 pm_runtime_get_sync(&bh1780->client->dev); 111 111 value = bh1780_read_word(bh1780, BH1780_REG_DLOW); 112 + pm_runtime_put_autosuspend(&bh1780->client->dev); 112 113 if (value < 0) 113 114 return value; 114 - pm_runtime_put_autosuspend(&bh1780->client->dev); 115 115 *val = value; 116 116 117 117 return IIO_VAL_INT;
+1 -1
drivers/iio/magnetometer/tlv493d.c
··· 171 171 switch (ch) { 172 172 case TLV493D_AXIS_X: 173 173 val = FIELD_GET(TLV493D_BX_MAG_X_AXIS_MSB, b[TLV493D_RD_REG_BX]) << 4 | 174 - FIELD_GET(TLV493D_BX2_MAG_X_AXIS_LSB, b[TLV493D_RD_REG_BX2]) >> 4; 174 + FIELD_GET(TLV493D_BX2_MAG_X_AXIS_LSB, b[TLV493D_RD_REG_BX2]); 175 175 break; 176 176 case TLV493D_AXIS_Y: 177 177 val = FIELD_GET(TLV493D_BY_MAG_Y_AXIS_MSB, b[TLV493D_RD_REG_BY]) << 4 |
+1 -1
drivers/iio/potentiometer/mcp4131.c
··· 221 221 222 222 mutex_lock(&data->lock); 223 223 224 - data->buf[0] = address << MCP4131_WIPER_SHIFT; 224 + data->buf[0] = address; 225 225 data->buf[0] |= MCP4131_WRITE | (val >> 8); 226 226 data->buf[1] = val & 0xFF; /* 8 bits here */ 227 227
+4 -2
drivers/iio/proximity/hx9023s.c
··· 719 719 struct device *dev = regmap_get_device(data->regmap); 720 720 unsigned int i, period_ms; 721 721 722 + if (!val && !val2) 723 + return -EINVAL; 724 + 722 725 period_ms = div_u64(NANO, (val * MEGA + val2)); 723 726 724 727 for (i = 0; i < ARRAY_SIZE(hx9023s_samp_freq_table); i++) { ··· 1037 1034 if (!bin) 1038 1035 return -ENOMEM; 1039 1036 1040 - memcpy(bin->data, fw->data, fw->size); 1041 - 1042 1037 bin->fw_size = fw->size; 1038 + memcpy(bin->data, fw->data, bin->fw_size); 1043 1039 bin->fw_ver = bin->data[FW_VER_OFFSET]; 1044 1040 bin->reg_count = get_unaligned_le16(bin->data + FW_REG_CNT_OFFSET); 1045 1041
+4 -4
include/linux/firmware/intel/stratix10-svc-client.h
··· 68 68 * timeout value used in Stratix10 FPGA manager driver. 69 69 * timeout value used in RSU driver 70 70 */ 71 - #define SVC_RECONFIG_REQUEST_TIMEOUT_MS 300 72 - #define SVC_RECONFIG_BUFFER_TIMEOUT_MS 720 73 - #define SVC_RSU_REQUEST_TIMEOUT_MS 300 71 + #define SVC_RECONFIG_REQUEST_TIMEOUT_MS 5000 72 + #define SVC_RECONFIG_BUFFER_TIMEOUT_MS 5000 73 + #define SVC_RSU_REQUEST_TIMEOUT_MS 2000 74 74 #define SVC_FCS_REQUEST_TIMEOUT_MS 2000 75 75 #define SVC_COMPLETED_TIMEOUT_MS 30000 76 - #define SVC_HWMON_REQUEST_TIMEOUT_MS 300 76 + #define SVC_HWMON_REQUEST_TIMEOUT_MS 2000 77 77 78 78 struct stratix10_svc_chan; 79 79