You've already forked linux-rockchip
mirror of
https://github.com/armbian/linux-rockchip.git
synced 2026-01-06 11:08:10 -08:00
Merge 47e61cadc7 ("MIPS: fw: Allow firmware to pass a empty env") into android12-5.10-lts
Steps on the way to 5.10.180 to help resolve some testing errors. Change-Id: I291b51c58e5eeff603ad8bfa999b88c628b0fe8a Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
@@ -499,6 +499,8 @@ int kvm_arm_set_fw_reg(struct kvm_vcpu *vcpu, const struct kvm_one_reg *reg)
|
||||
u64 val;
|
||||
int wa_level;
|
||||
|
||||
if (KVM_REG_SIZE(reg->id) != sizeof(val))
|
||||
return -ENOENT;
|
||||
if (copy_from_user(&val, uaddr, KVM_REG_SIZE(reg->id)))
|
||||
return -EFAULT;
|
||||
|
||||
|
||||
@@ -53,7 +53,7 @@ char *fw_getenv(char *envname)
|
||||
{
|
||||
char *result = NULL;
|
||||
|
||||
if (_fw_envp != NULL) {
|
||||
if (_fw_envp != NULL && fw_envp(0) != NULL) {
|
||||
/*
|
||||
* Return a pointer to the given environment variable.
|
||||
* YAMON uses "name", "value" pairs, while U-Boot uses
|
||||
|
||||
@@ -25,17 +25,7 @@
|
||||
*/
|
||||
union fpregs_state init_fpstate __read_mostly;
|
||||
|
||||
/*
|
||||
* Track whether the kernel is using the FPU state
|
||||
* currently.
|
||||
*
|
||||
* This flag is used:
|
||||
*
|
||||
* - by IRQ context code to potentially use the FPU
|
||||
* if it's unused.
|
||||
*
|
||||
* - to debug kernel_fpu_begin()/end() correctness
|
||||
*/
|
||||
/* Track in-kernel FPU usage */
|
||||
static DEFINE_PER_CPU(bool, in_kernel_fpu);
|
||||
|
||||
/*
|
||||
@@ -43,42 +33,37 @@ static DEFINE_PER_CPU(bool, in_kernel_fpu);
|
||||
*/
|
||||
DEFINE_PER_CPU(struct fpu *, fpu_fpregs_owner_ctx);
|
||||
|
||||
static bool kernel_fpu_disabled(void)
|
||||
{
|
||||
return this_cpu_read(in_kernel_fpu);
|
||||
}
|
||||
|
||||
static bool interrupted_kernel_fpu_idle(void)
|
||||
{
|
||||
return !kernel_fpu_disabled();
|
||||
}
|
||||
|
||||
/*
|
||||
* Were we in user mode (or vm86 mode) when we were
|
||||
* interrupted?
|
||||
*
|
||||
* Doing kernel_fpu_begin/end() is ok if we are running
|
||||
* in an interrupt context from user mode - we'll just
|
||||
* save the FPU state as required.
|
||||
*/
|
||||
static bool interrupted_user_mode(void)
|
||||
{
|
||||
struct pt_regs *regs = get_irq_regs();
|
||||
return regs && user_mode(regs);
|
||||
}
|
||||
|
||||
/*
|
||||
* Can we use the FPU in kernel mode with the
|
||||
* whole "kernel_fpu_begin/end()" sequence?
|
||||
*
|
||||
* It's always ok in process context (ie "not interrupt")
|
||||
* but it is sometimes ok even from an irq.
|
||||
*/
|
||||
bool irq_fpu_usable(void)
|
||||
{
|
||||
return !in_interrupt() ||
|
||||
interrupted_user_mode() ||
|
||||
interrupted_kernel_fpu_idle();
|
||||
if (WARN_ON_ONCE(in_nmi()))
|
||||
return false;
|
||||
|
||||
/* In kernel FPU usage already active? */
|
||||
if (this_cpu_read(in_kernel_fpu))
|
||||
return false;
|
||||
|
||||
/*
|
||||
* When not in NMI or hard interrupt context, FPU can be used in:
|
||||
*
|
||||
* - Task context except from within fpregs_lock()'ed critical
|
||||
* regions.
|
||||
*
|
||||
* - Soft interrupt processing context which cannot happen
|
||||
* while in a fpregs_lock()'ed critical region.
|
||||
*/
|
||||
if (!in_irq())
|
||||
return true;
|
||||
|
||||
/*
|
||||
* In hard interrupt context it's safe when soft interrupts
|
||||
* are enabled, which means the interrupt did not hit in
|
||||
* a fpregs_lock()'ed critical region.
|
||||
*/
|
||||
return !softirq_count();
|
||||
}
|
||||
EXPORT_SYMBOL(irq_fpu_usable);
|
||||
|
||||
|
||||
@@ -489,7 +489,8 @@ static const struct attribute_group *cpu_root_attr_groups[] = {
|
||||
bool cpu_is_hotpluggable(unsigned cpu)
|
||||
{
|
||||
struct device *dev = get_cpu_device(cpu);
|
||||
return dev && container_of(dev, struct cpu, dev)->hotpluggable;
|
||||
return dev && container_of(dev, struct cpu, dev)->hotpluggable
|
||||
&& tick_nohz_cpu_hotpluggable(cpu);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(cpu_is_hotpluggable);
|
||||
|
||||
|
||||
@@ -677,7 +677,12 @@ static int really_probe_debug(struct device *dev, struct device_driver *drv)
|
||||
calltime = ktime_get();
|
||||
ret = really_probe(dev, drv);
|
||||
rettime = ktime_get();
|
||||
pr_debug("probe of %s returned %d after %lld usecs\n",
|
||||
/*
|
||||
* Don't change this to pr_debug() because that requires
|
||||
* CONFIG_DYNAMIC_DEBUG and we want a simple 'initcall_debug' on the
|
||||
* kernel commandline to print this all the time at the debug level.
|
||||
*/
|
||||
printk(KERN_DEBUG "probe of %s returned %d after %lld usecs\n",
|
||||
dev_name(dev), ret, ktime_us_delta(rettime, calltime));
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -62,10 +62,6 @@ struct quad8_iio {
|
||||
#define QUAD8_REG_CHAN_OP 0x11
|
||||
#define QUAD8_REG_INDEX_INPUT_LEVELS 0x16
|
||||
#define QUAD8_DIFF_ENCODER_CABLE_STATUS 0x17
|
||||
/* Borrow Toggle flip-flop */
|
||||
#define QUAD8_FLAG_BT BIT(0)
|
||||
/* Carry Toggle flip-flop */
|
||||
#define QUAD8_FLAG_CT BIT(1)
|
||||
/* Error flag */
|
||||
#define QUAD8_FLAG_E BIT(4)
|
||||
/* Up/Down flag */
|
||||
@@ -104,9 +100,6 @@ static int quad8_read_raw(struct iio_dev *indio_dev,
|
||||
{
|
||||
struct quad8_iio *const priv = iio_priv(indio_dev);
|
||||
const int base_offset = priv->base + 2 * chan->channel;
|
||||
unsigned int flags;
|
||||
unsigned int borrow;
|
||||
unsigned int carry;
|
||||
int i;
|
||||
|
||||
switch (mask) {
|
||||
@@ -117,12 +110,7 @@ static int quad8_read_raw(struct iio_dev *indio_dev,
|
||||
return IIO_VAL_INT;
|
||||
}
|
||||
|
||||
flags = inb(base_offset + 1);
|
||||
borrow = flags & QUAD8_FLAG_BT;
|
||||
carry = !!(flags & QUAD8_FLAG_CT);
|
||||
|
||||
/* Borrow XOR Carry effectively doubles count range */
|
||||
*val = (borrow ^ carry) << 24;
|
||||
*val = 0;
|
||||
|
||||
mutex_lock(&priv->lock);
|
||||
|
||||
@@ -643,17 +631,9 @@ static int quad8_count_read(struct counter_device *counter,
|
||||
{
|
||||
struct quad8_iio *const priv = counter->priv;
|
||||
const int base_offset = priv->base + 2 * count->id;
|
||||
unsigned int flags;
|
||||
unsigned int borrow;
|
||||
unsigned int carry;
|
||||
int i;
|
||||
|
||||
flags = inb(base_offset + 1);
|
||||
borrow = flags & QUAD8_FLAG_BT;
|
||||
carry = !!(flags & QUAD8_FLAG_CT);
|
||||
|
||||
/* Borrow XOR Carry effectively doubles count range */
|
||||
*val = (unsigned long)(borrow ^ carry) << 24;
|
||||
*val = 0;
|
||||
|
||||
mutex_lock(&priv->lock);
|
||||
|
||||
@@ -1198,8 +1178,8 @@ static ssize_t quad8_count_ceiling_read(struct counter_device *counter,
|
||||
|
||||
mutex_unlock(&priv->lock);
|
||||
|
||||
/* By default 0x1FFFFFF (25 bits unsigned) is maximum count */
|
||||
return sprintf(buf, "33554431\n");
|
||||
/* By default 0xFFFFFF (24 bits unsigned) is maximum count */
|
||||
return sprintf(buf, "16777215\n");
|
||||
}
|
||||
|
||||
static ssize_t quad8_count_ceiling_write(struct counter_device *counter,
|
||||
|
||||
@@ -1299,6 +1299,9 @@ int drm_fb_helper_check_var(struct fb_var_screeninfo *var,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
var->xres_virtual = fb->width;
|
||||
var->yres_virtual = fb->height;
|
||||
|
||||
/*
|
||||
* Workaround for SDL 1.2, which is known to be setting all pixel format
|
||||
* fields values to zero in some cases. We treat this situation as a
|
||||
|
||||
@@ -1515,9 +1515,9 @@ static int adt7475_set_pwm_polarity(struct i2c_client *client)
|
||||
int ret, i;
|
||||
u8 val;
|
||||
|
||||
ret = of_property_read_u32_array(client->dev.of_node,
|
||||
"adi,pwm-active-state", states,
|
||||
ARRAY_SIZE(states));
|
||||
ret = device_property_read_u32_array(&client->dev,
|
||||
"adi,pwm-active-state", states,
|
||||
ARRAY_SIZE(states));
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -74,6 +74,7 @@ static DEFINE_MUTEX(nb_smu_ind_mutex);
|
||||
|
||||
#define ZEN_CUR_TEMP_SHIFT 21
|
||||
#define ZEN_CUR_TEMP_RANGE_SEL_MASK BIT(19)
|
||||
#define ZEN_CUR_TEMP_TJ_SEL_MASK GENMASK(17, 16)
|
||||
|
||||
#define ZEN_SVI_BASE 0x0005A000
|
||||
|
||||
@@ -173,7 +174,8 @@ static long get_raw_temp(struct k10temp_data *data)
|
||||
|
||||
data->read_tempreg(data->pdev, ®val);
|
||||
temp = (regval >> ZEN_CUR_TEMP_SHIFT) * 125;
|
||||
if (regval & data->temp_adjust_mask)
|
||||
if ((regval & data->temp_adjust_mask) ||
|
||||
(regval & ZEN_CUR_TEMP_TJ_SEL_MASK) == ZEN_CUR_TEMP_TJ_SEL_MASK)
|
||||
temp -= 49000;
|
||||
return temp;
|
||||
}
|
||||
|
||||
@@ -628,7 +628,7 @@ out:
|
||||
|
||||
static int palmas_gpadc_remove(struct platform_device *pdev)
|
||||
{
|
||||
struct iio_dev *indio_dev = dev_to_iio_dev(&pdev->dev);
|
||||
struct iio_dev *indio_dev = dev_get_drvdata(&pdev->dev);
|
||||
struct palmas_gpadc *adc = iio_priv(indio_dev);
|
||||
|
||||
if (adc->wakeup1_enable || adc->wakeup2_enable)
|
||||
|
||||
@@ -46,7 +46,7 @@ static void wg_expired_retransmit_handshake(struct timer_list *timer)
|
||||
if (peer->timer_handshake_attempts > MAX_TIMER_HANDSHAKES) {
|
||||
pr_debug("%s: Handshake for peer %llu (%pISpfsc) did not complete after %d attempts, giving up\n",
|
||||
peer->device->dev->name, peer->internal_id,
|
||||
&peer->endpoint.addr, MAX_TIMER_HANDSHAKES + 2);
|
||||
&peer->endpoint.addr, (int)MAX_TIMER_HANDSHAKES + 2);
|
||||
|
||||
del_timer(&peer->timer_send_keepalive);
|
||||
/* We drop all packets without a keypair and don't try again,
|
||||
@@ -64,7 +64,7 @@ static void wg_expired_retransmit_handshake(struct timer_list *timer)
|
||||
++peer->timer_handshake_attempts;
|
||||
pr_debug("%s: Handshake for peer %llu (%pISpfsc) did not complete after %d seconds, retrying (try %d)\n",
|
||||
peer->device->dev->name, peer->internal_id,
|
||||
&peer->endpoint.addr, REKEY_TIMEOUT,
|
||||
&peer->endpoint.addr, (int)REKEY_TIMEOUT,
|
||||
peer->timer_handshake_attempts + 1);
|
||||
|
||||
/* We clear the endpoint address src address, in case this is
|
||||
@@ -94,7 +94,7 @@ static void wg_expired_new_handshake(struct timer_list *timer)
|
||||
|
||||
pr_debug("%s: Retrying handshake with peer %llu (%pISpfsc) because we stopped hearing back after %d seconds\n",
|
||||
peer->device->dev->name, peer->internal_id,
|
||||
&peer->endpoint.addr, KEEPALIVE_TIMEOUT + REKEY_TIMEOUT);
|
||||
&peer->endpoint.addr, (int)(KEEPALIVE_TIMEOUT + REKEY_TIMEOUT));
|
||||
/* We clear the endpoint address src address, in case this is the cause
|
||||
* of trouble.
|
||||
*/
|
||||
@@ -126,7 +126,7 @@ static void wg_queued_expired_zero_key_material(struct work_struct *work)
|
||||
|
||||
pr_debug("%s: Zeroing out all keys for peer %llu (%pISpfsc), since we haven't received a new one in %d seconds\n",
|
||||
peer->device->dev->name, peer->internal_id,
|
||||
&peer->endpoint.addr, REJECT_AFTER_TIME * 3);
|
||||
&peer->endpoint.addr, (int)REJECT_AFTER_TIME * 3);
|
||||
wg_noise_handshake_clear(&peer->handshake);
|
||||
wg_noise_keypairs_clear(&peer->keypairs);
|
||||
wg_peer_put(peer);
|
||||
|
||||
@@ -5834,6 +5834,11 @@ static s32 brcmf_get_assoc_ies(struct brcmf_cfg80211_info *cfg,
|
||||
(struct brcmf_cfg80211_assoc_ielen_le *)cfg->extra_buf;
|
||||
req_len = le32_to_cpu(assoc_info->req_len);
|
||||
resp_len = le32_to_cpu(assoc_info->resp_len);
|
||||
if (req_len > WL_EXTRA_BUF_MAX || resp_len > WL_EXTRA_BUF_MAX) {
|
||||
bphy_err(drvr, "invalid lengths in assoc info: req %u resp %u\n",
|
||||
req_len, resp_len);
|
||||
return -EINVAL;
|
||||
}
|
||||
if (req_len) {
|
||||
err = brcmf_fil_iovar_data_get(ifp, "assoc_req_ies",
|
||||
cfg->extra_buf,
|
||||
|
||||
@@ -1210,11 +1210,9 @@ static int qcom_pcie_init_2_7_0(struct qcom_pcie *pcie)
|
||||
val |= BIT(4);
|
||||
writel(val, pcie->parf + PCIE20_PARF_MHI_CLOCK_RESET_CTRL);
|
||||
|
||||
if (IS_ENABLED(CONFIG_PCI_MSI)) {
|
||||
val = readl(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT);
|
||||
val |= BIT(31);
|
||||
writel(val, pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT);
|
||||
}
|
||||
val = readl(pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2);
|
||||
val |= BIT(31);
|
||||
writel(val, pcie->parf + PCIE20_PARF_AXI_MSTR_WR_ADDR_HALT_V2);
|
||||
|
||||
return 0;
|
||||
err_disable_clocks:
|
||||
|
||||
@@ -63,7 +63,14 @@ int pciehp_configure_device(struct controller *ctrl)
|
||||
|
||||
pci_assign_unassigned_bridge_resources(bridge);
|
||||
pcie_bus_configure_settings(parent);
|
||||
|
||||
/*
|
||||
* Release reset_lock during driver binding
|
||||
* to avoid AB-BA deadlock with device_lock.
|
||||
*/
|
||||
up_read(&ctrl->reset_lock);
|
||||
pci_bus_add_devices(parent);
|
||||
down_read_nested(&ctrl->reset_lock, ctrl->depth);
|
||||
|
||||
out:
|
||||
pci_unlock_rescan_remove();
|
||||
@@ -104,7 +111,15 @@ void pciehp_unconfigure_device(struct controller *ctrl, bool presence)
|
||||
list_for_each_entry_safe_reverse(dev, temp, &parent->devices,
|
||||
bus_list) {
|
||||
pci_dev_get(dev);
|
||||
|
||||
/*
|
||||
* Release reset_lock during driver unbinding
|
||||
* to avoid AB-BA deadlock with device_lock.
|
||||
*/
|
||||
up_read(&ctrl->reset_lock);
|
||||
pci_stop_and_remove_bus_device(dev);
|
||||
down_read_nested(&ctrl->reset_lock, ctrl->depth);
|
||||
|
||||
/*
|
||||
* Ensure that no new Requests will be generated from
|
||||
* the device.
|
||||
|
||||
@@ -101,7 +101,7 @@ struct ad2s1210_state {
|
||||
static const int ad2s1210_mode_vals[4][2] = {
|
||||
[MOD_POS] = { 0, 0 },
|
||||
[MOD_VEL] = { 0, 1 },
|
||||
[MOD_CONFIG] = { 1, 0 },
|
||||
[MOD_CONFIG] = { 1, 1 },
|
||||
};
|
||||
|
||||
static inline void ad2s1210_set_mode(enum ad2s1210_mode mode,
|
||||
|
||||
@@ -1627,13 +1627,11 @@ static int dwc3_probe(struct platform_device *pdev)
|
||||
spin_lock_init(&dwc->lock);
|
||||
mutex_init(&dwc->mutex);
|
||||
|
||||
pm_runtime_get_noresume(dev);
|
||||
pm_runtime_set_active(dev);
|
||||
pm_runtime_use_autosuspend(dev);
|
||||
pm_runtime_set_autosuspend_delay(dev, DWC3_DEFAULT_AUTOSUSPEND_DELAY);
|
||||
pm_runtime_enable(dev);
|
||||
ret = pm_runtime_get_sync(dev);
|
||||
if (ret < 0)
|
||||
goto err1;
|
||||
|
||||
pm_runtime_forbid(dev);
|
||||
|
||||
@@ -1692,12 +1690,10 @@ err3:
|
||||
dwc3_free_event_buffers(dwc);
|
||||
|
||||
err2:
|
||||
pm_runtime_allow(&pdev->dev);
|
||||
|
||||
err1:
|
||||
pm_runtime_put_sync(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
|
||||
pm_runtime_allow(dev);
|
||||
pm_runtime_disable(dev);
|
||||
pm_runtime_set_suspended(dev);
|
||||
pm_runtime_put_noidle(dev);
|
||||
disable_clks:
|
||||
clk_bulk_disable_unprepare(dwc->num_clks, dwc->clks);
|
||||
assert_reset:
|
||||
@@ -1721,6 +1717,7 @@ static int dwc3_remove(struct platform_device *pdev)
|
||||
dwc3_core_exit(dwc);
|
||||
dwc3_ulpi_exit(dwc);
|
||||
|
||||
pm_runtime_allow(&pdev->dev);
|
||||
pm_runtime_disable(&pdev->dev);
|
||||
pm_runtime_put_noidle(&pdev->dev);
|
||||
pm_runtime_set_suspended(&pdev->dev);
|
||||
|
||||
@@ -133,6 +133,7 @@ static void xhci_debugfs_regset(struct xhci_hcd *xhci, u32 base,
|
||||
regset->regs = regs;
|
||||
regset->nregs = nregs;
|
||||
regset->base = hcd->regs + base;
|
||||
regset->dev = hcd->self.controller;
|
||||
|
||||
debugfs_create_regset32((const char *)rgs->name, 0444, parent, regset);
|
||||
}
|
||||
|
||||
@@ -595,6 +595,11 @@ static void option_instat_callback(struct urb *urb);
|
||||
#define SIERRA_VENDOR_ID 0x1199
|
||||
#define SIERRA_PRODUCT_EM9191 0x90d3
|
||||
|
||||
/* UNISOC (Spreadtrum) products */
|
||||
#define UNISOC_VENDOR_ID 0x1782
|
||||
/* TOZED LT70-C based on UNISOC SL8563 uses UNISOC's vendor ID */
|
||||
#define TOZED_PRODUCT_LT70C 0x4055
|
||||
|
||||
/* Device flags */
|
||||
|
||||
/* Highest interface number which can be used with NCTRL() and RSVD() */
|
||||
@@ -2225,6 +2230,7 @@ static const struct usb_device_id option_ids[] = {
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(OPPO_VENDOR_ID, OPPO_PRODUCT_R11, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0xff, 0x30) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(SIERRA_VENDOR_ID, SIERRA_PRODUCT_EM9191, 0xff, 0, 0) },
|
||||
{ USB_DEVICE_AND_INTERFACE_INFO(UNISOC_VENDOR_ID, TOZED_PRODUCT_LT70C, 0xff, 0, 0) },
|
||||
{ } /* Terminating entry */
|
||||
};
|
||||
MODULE_DEVICE_TABLE(usb, option_ids);
|
||||
|
||||
@@ -242,7 +242,6 @@ retry:
|
||||
handle = ext4_journal_start(inode, EXT4_HT_XATTR, credits);
|
||||
if (IS_ERR(handle))
|
||||
return PTR_ERR(handle);
|
||||
ext4_fc_start_update(inode);
|
||||
|
||||
if ((type == ACL_TYPE_ACCESS) && acl) {
|
||||
error = posix_acl_update_mode(inode, &mode, &acl);
|
||||
@@ -260,7 +259,6 @@ retry:
|
||||
}
|
||||
out_stop:
|
||||
ext4_journal_stop(handle);
|
||||
ext4_fc_stop_update(inode);
|
||||
if (error == -ENOSPC && ext4_should_retry_alloc(inode->i_sb, &retries))
|
||||
goto retry;
|
||||
return error;
|
||||
|
||||
@@ -4694,7 +4694,6 @@ long ext4_fallocate(struct file *file, int mode, loff_t offset, loff_t len)
|
||||
FALLOC_FL_INSERT_RANGE))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
ext4_fc_start_update(inode);
|
||||
inode_lock(inode);
|
||||
ret = ext4_convert_inline_data(inode);
|
||||
inode_unlock(inode);
|
||||
@@ -4764,7 +4763,6 @@ out:
|
||||
inode_unlock(inode);
|
||||
trace_ext4_fallocate_exit(inode, offset, max_blocks, ret);
|
||||
exit:
|
||||
ext4_fc_stop_update(inode);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user