Merge branch 'linux-4.19.y-st' into linux-4.19.y-cip
Brings the tree up-to-date with 5.4.296. Signed-off-by: Ulrich Hecht <uli@kernel.org>
This commit is contained in:
@@ -589,7 +589,7 @@ Description: This file shows the thin provisioning type. This is one of
|
||||
about the descriptor could be found at UFS specifications 2.1.
|
||||
The file is read only.
|
||||
|
||||
What: /sys/class/scsi_device/*/device/unit_descriptor/physical_memory_resourse_count
|
||||
What: /sys/class/scsi_device/*/device/unit_descriptor/physical_memory_resource_count
|
||||
Date: February 2018
|
||||
Contact: Stanislav Nijnikov <stanislav.nijnikov@wdc.com>
|
||||
Description: This file shows the total physical memory resources. This is
|
||||
|
||||
@@ -1018,7 +1018,8 @@ int pud_free_pmd_page(pud_t *pudp, unsigned long addr)
|
||||
next = addr;
|
||||
end = addr + PUD_SIZE;
|
||||
do {
|
||||
pmd_free_pte_page(pmdp, next);
|
||||
if (pmd_present(READ_ONCE(*pmdp)))
|
||||
pmd_free_pte_page(pmdp, next);
|
||||
} while (pmdp++, next += PMD_SIZE, next != end);
|
||||
|
||||
pud_clear(pudp);
|
||||
|
||||
@@ -23,10 +23,10 @@
|
||||
#define TCSETSW _IOW('t', 21, struct termios)
|
||||
#define TCSETSF _IOW('t', 22, struct termios)
|
||||
|
||||
#define TCGETA _IOR('t', 23, struct termio)
|
||||
#define TCSETA _IOW('t', 24, struct termio)
|
||||
#define TCSETAW _IOW('t', 25, struct termio)
|
||||
#define TCSETAF _IOW('t', 28, struct termio)
|
||||
#define TCGETA 0x40147417 /* _IOR('t', 23, struct termio) */
|
||||
#define TCSETA 0x80147418 /* _IOW('t', 24, struct termio) */
|
||||
#define TCSETAW 0x80147419 /* _IOW('t', 25, struct termio) */
|
||||
#define TCSETAF 0x8014741c /* _IOW('t', 28, struct termio) */
|
||||
|
||||
#define TCSBRK _IO('t', 29)
|
||||
#define TCXONC _IO('t', 30)
|
||||
|
||||
@@ -41,7 +41,7 @@ int start_io_thread(unsigned long sp, int *fd_out)
|
||||
*fd_out = fds[1];
|
||||
|
||||
err = os_set_fd_block(*fd_out, 0);
|
||||
err = os_set_fd_block(kernel_fd, 0);
|
||||
err |= os_set_fd_block(kernel_fd, 0);
|
||||
if (err) {
|
||||
printk("start_io_thread - failed to set nonblocking I/O.\n");
|
||||
goto out_close;
|
||||
|
||||
@@ -2322,15 +2322,9 @@ static int mce_cpu_dead(unsigned int cpu)
|
||||
static int mce_cpu_online(unsigned int cpu)
|
||||
{
|
||||
struct timer_list *t = this_cpu_ptr(&mce_timer);
|
||||
int ret;
|
||||
|
||||
mce_device_create(cpu);
|
||||
|
||||
ret = mce_threshold_create_device(cpu);
|
||||
if (ret) {
|
||||
mce_device_remove(cpu);
|
||||
return ret;
|
||||
}
|
||||
mce_threshold_create_device(cpu);
|
||||
mce_reenable_cpu();
|
||||
mce_start_timer(t);
|
||||
return 0;
|
||||
|
||||
@@ -252,7 +252,6 @@ static void smca_configure(unsigned int bank, unsigned int cpu)
|
||||
|
||||
struct thresh_restart {
|
||||
struct threshold_block *b;
|
||||
int reset;
|
||||
int set_lvt_off;
|
||||
int lvt_off;
|
||||
u16 old_limit;
|
||||
@@ -343,13 +342,13 @@ static void threshold_restart_bank(void *_tr)
|
||||
|
||||
rdmsr(tr->b->address, lo, hi);
|
||||
|
||||
if (tr->b->threshold_limit < (hi & THRESHOLD_MAX))
|
||||
tr->reset = 1; /* limit cannot be lower than err count */
|
||||
|
||||
if (tr->reset) { /* reset err count and overflow bit */
|
||||
hi =
|
||||
(hi & ~(MASK_ERR_COUNT_HI | MASK_OVERFLOW_HI)) |
|
||||
(THRESHOLD_MAX - tr->b->threshold_limit);
|
||||
/*
|
||||
* Reset error count and overflow bit.
|
||||
* This is done during init or after handling an interrupt.
|
||||
*/
|
||||
if (hi & MASK_OVERFLOW_HI || tr->set_lvt_off) {
|
||||
hi &= ~(MASK_ERR_COUNT_HI | MASK_OVERFLOW_HI);
|
||||
hi |= THRESHOLD_MAX - tr->b->threshold_limit;
|
||||
} else if (tr->old_limit) { /* change limit w/o reset */
|
||||
int new_count = (hi & THRESHOLD_MAX) +
|
||||
(tr->old_limit - tr->b->threshold_limit);
|
||||
|
||||
@@ -516,4 +516,5 @@ void mce_intel_feature_init(struct cpuinfo_x86 *c)
|
||||
void mce_intel_feature_clear(struct cpuinfo_x86 *c)
|
||||
{
|
||||
intel_clear_lmce();
|
||||
cmci_clear();
|
||||
}
|
||||
|
||||
@@ -135,8 +135,11 @@ static void round_robin_cpu(unsigned int tsk_index)
|
||||
static void exit_round_robin(unsigned int tsk_index)
|
||||
{
|
||||
struct cpumask *pad_busy_cpus = to_cpumask(pad_busy_cpus_bits);
|
||||
cpumask_clear_cpu(tsk_in_cpu[tsk_index], pad_busy_cpus);
|
||||
tsk_in_cpu[tsk_index] = -1;
|
||||
|
||||
if (tsk_in_cpu[tsk_index] != -1) {
|
||||
cpumask_clear_cpu(tsk_in_cpu[tsk_index], pad_busy_cpus);
|
||||
tsk_in_cpu[tsk_index] = -1;
|
||||
}
|
||||
}
|
||||
|
||||
static unsigned int idle_pct = 5; /* percentage */
|
||||
|
||||
@@ -483,6 +483,13 @@ acpi_ds_call_control_method(struct acpi_thread_state *thread,
|
||||
return_ACPI_STATUS(AE_NULL_OBJECT);
|
||||
}
|
||||
|
||||
if (this_walk_state->num_operands < obj_desc->method.param_count) {
|
||||
ACPI_ERROR((AE_INFO, "Missing argument for method [%4.4s]",
|
||||
acpi_ut_get_node_name(method_node)));
|
||||
|
||||
return_ACPI_STATUS(AE_AML_UNINITIALIZED_ARG);
|
||||
}
|
||||
|
||||
/* Init for new method, possibly wait on method mutex */
|
||||
|
||||
status =
|
||||
|
||||
@@ -279,23 +279,10 @@ static int acpi_battery_get_property(struct power_supply *psy,
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_CURRENT_NOW:
|
||||
case POWER_SUPPLY_PROP_POWER_NOW:
|
||||
if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN) {
|
||||
if (battery->rate_now == ACPI_BATTERY_VALUE_UNKNOWN)
|
||||
ret = -ENODEV;
|
||||
break;
|
||||
}
|
||||
|
||||
val->intval = battery->rate_now * 1000;
|
||||
/*
|
||||
* When discharging, the current should be reported as a
|
||||
* negative number as per the power supply class interface
|
||||
* definition.
|
||||
*/
|
||||
if (psp == POWER_SUPPLY_PROP_CURRENT_NOW &&
|
||||
(battery->state & ACPI_BATTERY_STATE_DISCHARGING) &&
|
||||
acpi_battery_handle_discharging(battery)
|
||||
== POWER_SUPPLY_STATUS_DISCHARGING)
|
||||
val->intval = -val->intval;
|
||||
|
||||
else
|
||||
val->intval = battery->rate_now * 1000;
|
||||
break;
|
||||
case POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN:
|
||||
case POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN:
|
||||
|
||||
@@ -39,7 +39,7 @@
|
||||
#include <scsi/scsi_host.h>
|
||||
#include <linux/dmi.h>
|
||||
|
||||
#ifdef CONFIG_X86_32
|
||||
#if defined(CONFIG_X86) && defined(CONFIG_X86_32)
|
||||
#include <asm/msr.h>
|
||||
static int use_msr;
|
||||
module_param_named(msr, use_msr, int, 0644);
|
||||
|
||||
@@ -849,6 +849,8 @@ queue_skb(struct idt77252_dev *card, struct vc_map *vc,
|
||||
|
||||
IDT77252_PRV_PADDR(skb) = dma_map_single(&card->pcidev->dev, skb->data,
|
||||
skb->len, DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(&card->pcidev->dev, IDT77252_PRV_PADDR(skb)))
|
||||
return -ENOMEM;
|
||||
|
||||
error = -EINVAL;
|
||||
|
||||
@@ -1863,6 +1865,8 @@ add_rx_skb(struct idt77252_dev *card, int queue,
|
||||
paddr = dma_map_single(&card->pcidev->dev, skb->data,
|
||||
skb_end_pointer(skb) - skb->data,
|
||||
DMA_FROM_DEVICE);
|
||||
if (dma_mapping_error(&card->pcidev->dev, paddr))
|
||||
goto outpoolrm;
|
||||
IDT77252_PRV_PADDR(skb) = paddr;
|
||||
|
||||
if (push_rx_skb(card, skb, queue)) {
|
||||
@@ -1877,6 +1881,7 @@ outunmap:
|
||||
dma_unmap_single(&card->pcidev->dev, IDT77252_PRV_PADDR(skb),
|
||||
skb_end_pointer(skb) - skb->data, DMA_FROM_DEVICE);
|
||||
|
||||
outpoolrm:
|
||||
handle = IDT77252_PRV_POOL(skb);
|
||||
card->sbpool[POOL_QUEUE(handle)].skb[POOL_INDEX(handle)] = NULL;
|
||||
|
||||
|
||||
@@ -546,10 +546,13 @@ retry:
|
||||
goto retry;
|
||||
}
|
||||
|
||||
ret = dma_fence_wait_timeout(fence, intr, ret);
|
||||
ret = dma_fence_wait_timeout(fence, intr, timeout);
|
||||
dma_fence_put(fence);
|
||||
if (ret > 0 && wait_all && (i + 1 < shared_count))
|
||||
goto retry;
|
||||
/* Even for zero timeout the return value is 1 */
|
||||
if (ret > 0 && timeout == 0)
|
||||
ret = 1;
|
||||
}
|
||||
return ret;
|
||||
|
||||
|
||||
@@ -2508,6 +2508,8 @@ static int xilinx_dma_chan_probe(struct xilinx_dma_device *xdev,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
xdev->common.directions |= chan->direction;
|
||||
|
||||
/* Request the interrupt */
|
||||
chan->irq = irq_of_parse_and_map(node, 0);
|
||||
err = request_irq(chan->irq, xilinx_dma_irq_handler, IRQF_SHARED,
|
||||
|
||||
@@ -1155,7 +1155,7 @@ static int cdns_dsi_attach(struct mipi_dsi_host *host,
|
||||
if (!IS_ERR(panel)) {
|
||||
bridge = drm_panel_bridge_add(panel, DRM_MODE_CONNECTOR_DSI);
|
||||
} else {
|
||||
bridge = of_drm_find_bridge(dev->dev.of_node);
|
||||
bridge = of_drm_find_bridge(np);
|
||||
if (!bridge)
|
||||
bridge = ERR_PTR(-EINVAL);
|
||||
}
|
||||
|
||||
@@ -1092,10 +1092,16 @@ static struct drm_plane *tegra_dc_add_shared_planes(struct drm_device *drm,
|
||||
if (wgrp->dc == dc->pipe) {
|
||||
for (j = 0; j < wgrp->num_windows; j++) {
|
||||
unsigned int index = wgrp->windows[j];
|
||||
enum drm_plane_type type;
|
||||
|
||||
if (primary)
|
||||
type = DRM_PLANE_TYPE_OVERLAY;
|
||||
else
|
||||
type = DRM_PLANE_TYPE_PRIMARY;
|
||||
|
||||
plane = tegra_shared_plane_create(drm, dc,
|
||||
wgrp->index,
|
||||
index);
|
||||
index, type);
|
||||
if (IS_ERR(plane))
|
||||
return plane;
|
||||
|
||||
@@ -1103,10 +1109,8 @@ static struct drm_plane *tegra_dc_add_shared_planes(struct drm_device *drm,
|
||||
* Choose the first shared plane owned by this
|
||||
* head as the primary plane.
|
||||
*/
|
||||
if (!primary) {
|
||||
plane->type = DRM_PLANE_TYPE_PRIMARY;
|
||||
if (!primary)
|
||||
primary = plane;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -535,9 +535,9 @@ static const struct drm_plane_helper_funcs tegra_shared_plane_helper_funcs = {
|
||||
struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
|
||||
struct tegra_dc *dc,
|
||||
unsigned int wgrp,
|
||||
unsigned int index)
|
||||
unsigned int index,
|
||||
enum drm_plane_type type)
|
||||
{
|
||||
enum drm_plane_type type = DRM_PLANE_TYPE_OVERLAY;
|
||||
struct tegra_drm *tegra = drm->dev_private;
|
||||
struct tegra_display_hub *hub = tegra->hub;
|
||||
/* planes can be assigned to arbitrary CRTCs */
|
||||
|
||||
@@ -81,7 +81,8 @@ void tegra_display_hub_cleanup(struct tegra_display_hub *hub);
|
||||
struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
|
||||
struct tegra_dc *dc,
|
||||
unsigned int wgrp,
|
||||
unsigned int index);
|
||||
unsigned int index,
|
||||
enum drm_plane_type type);
|
||||
|
||||
int tegra_display_hub_atomic_check(struct drm_device *drm,
|
||||
struct drm_atomic_state *state);
|
||||
|
||||
@@ -275,6 +275,8 @@
|
||||
#define USB_DEVICE_ID_CHICONY_WIRELESS2 0x1123
|
||||
#define USB_DEVICE_ID_ASUS_AK1D 0x1125
|
||||
#define USB_DEVICE_ID_CHICONY_ACER_SWITCH12 0x1421
|
||||
#define USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA 0xb824
|
||||
#define USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA2 0xb82c
|
||||
|
||||
#define USB_VENDOR_ID_CHUNGHWAT 0x2247
|
||||
#define USB_DEVICE_ID_CHUNGHWAT_MULTITOUCH 0x0001
|
||||
@@ -1287,4 +1289,7 @@
|
||||
#define USB_VENDOR_ID_UGTIZER 0x2179
|
||||
#define USB_DEVICE_ID_UGTIZER_TABLET_GP0610 0x0053
|
||||
|
||||
#define USB_VENDOR_ID_SMARTLINKTECHNOLOGY 0x4c4a
|
||||
#define USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155 0x4155
|
||||
|
||||
#endif
|
||||
|
||||
@@ -761,6 +761,8 @@ static const struct hid_device_id hid_ignore_list[] = {
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_AVERMEDIA, USB_DEVICE_ID_AVER_FM_MR800) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_AXENTIA, USB_DEVICE_ID_AXENTIA_FM_RADIO) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_BERKSHIRE, USB_DEVICE_ID_BERKSHIRE_PCWD) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CHICONY, USB_DEVICE_ID_CHICONY_HP_5MP_CAMERA2) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CIDC, 0x0103) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI470X) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_CYGNAL, USB_DEVICE_ID_CYGNAL_RADIO_SI4713) },
|
||||
@@ -908,6 +910,7 @@ static const struct hid_device_id hid_ignore_list[] = {
|
||||
#endif
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_YEALINK, USB_DEVICE_ID_YEALINK_P1K_P4K_B2K) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_QUANTA, USB_DEVICE_ID_QUANTA_HP_5MP_CAMERA_5473) },
|
||||
{ HID_USB_DEVICE(USB_VENDOR_ID_SMARTLINKTECHNOLOGY, USB_DEVICE_ID_SMARTLINKTECHNOLOGY_4155) },
|
||||
{ }
|
||||
};
|
||||
|
||||
|
||||
@@ -1991,14 +1991,18 @@ static int wacom_initialize_remotes(struct wacom *wacom)
|
||||
|
||||
remote->remote_dir = kobject_create_and_add("wacom_remote",
|
||||
&wacom->hdev->dev.kobj);
|
||||
if (!remote->remote_dir)
|
||||
if (!remote->remote_dir) {
|
||||
kfifo_free(&remote->remote_fifo);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
error = sysfs_create_files(remote->remote_dir, remote_unpair_attrs);
|
||||
|
||||
if (error) {
|
||||
hid_err(wacom->hdev,
|
||||
"cannot create sysfs group err: %d\n", error);
|
||||
kfifo_free(&remote->remote_fifo);
|
||||
kobject_put(remote->remote_dir);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
||||
@@ -114,6 +114,11 @@ static u32 osif_func(struct i2c_adapter *adapter)
|
||||
return I2C_FUNC_I2C | I2C_FUNC_SMBUS_EMUL;
|
||||
}
|
||||
|
||||
/* prevent invalid 0-length usb_control_msg */
|
||||
static const struct i2c_adapter_quirks osif_quirks = {
|
||||
.flags = I2C_AQ_NO_ZERO_LEN_READ,
|
||||
};
|
||||
|
||||
static const struct i2c_algorithm osif_algorithm = {
|
||||
.master_xfer = osif_xfer,
|
||||
.functionality = osif_func,
|
||||
@@ -146,6 +151,7 @@ static int osif_probe(struct usb_interface *interface,
|
||||
|
||||
priv->adapter.owner = THIS_MODULE;
|
||||
priv->adapter.class = I2C_CLASS_HWMON;
|
||||
priv->adapter.quirks = &osif_quirks;
|
||||
priv->adapter.algo = &osif_algorithm;
|
||||
priv->adapter.algo_data = priv;
|
||||
snprintf(priv->adapter.name, sizeof(priv->adapter.name),
|
||||
|
||||
@@ -144,6 +144,11 @@ out:
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* prevent invalid 0-length usb_control_msg */
|
||||
static const struct i2c_adapter_quirks usb_quirks = {
|
||||
.flags = I2C_AQ_NO_ZERO_LEN_READ,
|
||||
};
|
||||
|
||||
/* This is the actual algorithm we define */
|
||||
static const struct i2c_algorithm usb_algorithm = {
|
||||
.master_xfer = usb_xfer,
|
||||
@@ -250,6 +255,7 @@ static int i2c_tiny_usb_probe(struct usb_interface *interface,
|
||||
/* setup i2c adapter description */
|
||||
dev->adapter.owner = THIS_MODULE;
|
||||
dev->adapter.class = I2C_CLASS_HWMON;
|
||||
dev->adapter.quirks = &usb_quirks;
|
||||
dev->adapter.algo = &usb_algorithm;
|
||||
dev->adapter.algo_data = dev;
|
||||
snprintf(dev->adapter.name, sizeof(dev->adapter.name),
|
||||
|
||||
@@ -589,7 +589,7 @@ static int zpa2326_fill_sample_buffer(struct iio_dev *indio_dev,
|
||||
struct {
|
||||
u32 pressure;
|
||||
u16 temperature;
|
||||
u64 timestamp;
|
||||
aligned_s64 timestamp;
|
||||
} sample;
|
||||
int err;
|
||||
|
||||
|
||||
@@ -210,8 +210,7 @@ static void free_cm_id(struct iwcm_id_private *cm_id_priv)
|
||||
*/
|
||||
static int iwcm_deref_id(struct iwcm_id_private *cm_id_priv)
|
||||
{
|
||||
BUG_ON(atomic_read(&cm_id_priv->refcount)==0);
|
||||
if (atomic_dec_and_test(&cm_id_priv->refcount)) {
|
||||
if (refcount_dec_and_test(&cm_id_priv->refcount)) {
|
||||
BUG_ON(!list_empty(&cm_id_priv->work_list));
|
||||
free_cm_id(cm_id_priv);
|
||||
return 1;
|
||||
@@ -224,7 +223,7 @@ static void add_ref(struct iw_cm_id *cm_id)
|
||||
{
|
||||
struct iwcm_id_private *cm_id_priv;
|
||||
cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
|
||||
atomic_inc(&cm_id_priv->refcount);
|
||||
refcount_inc(&cm_id_priv->refcount);
|
||||
}
|
||||
|
||||
static void rem_ref(struct iw_cm_id *cm_id)
|
||||
@@ -256,7 +255,7 @@ struct iw_cm_id *iw_create_cm_id(struct ib_device *device,
|
||||
cm_id_priv->id.add_ref = add_ref;
|
||||
cm_id_priv->id.rem_ref = rem_ref;
|
||||
spin_lock_init(&cm_id_priv->lock);
|
||||
atomic_set(&cm_id_priv->refcount, 1);
|
||||
refcount_set(&cm_id_priv->refcount, 1);
|
||||
init_waitqueue_head(&cm_id_priv->connect_wait);
|
||||
init_completion(&cm_id_priv->destroy_comp);
|
||||
INIT_LIST_HEAD(&cm_id_priv->work_list);
|
||||
@@ -367,12 +366,9 @@ EXPORT_SYMBOL(iw_cm_disconnect);
|
||||
/*
|
||||
* CM_ID <-- DESTROYING
|
||||
*
|
||||
* Clean up all resources associated with the connection and release
|
||||
* the initial reference taken by iw_create_cm_id.
|
||||
*
|
||||
* Returns true if and only if the last cm_id_priv reference has been dropped.
|
||||
* Clean up all resources associated with the connection.
|
||||
*/
|
||||
static bool destroy_cm_id(struct iw_cm_id *cm_id)
|
||||
static void destroy_cm_id(struct iw_cm_id *cm_id)
|
||||
{
|
||||
struct iwcm_id_private *cm_id_priv;
|
||||
unsigned long flags;
|
||||
@@ -439,20 +435,22 @@ static bool destroy_cm_id(struct iw_cm_id *cm_id)
|
||||
iwpm_remove_mapinfo(&cm_id->local_addr, &cm_id->m_local_addr);
|
||||
iwpm_remove_mapping(&cm_id->local_addr, RDMA_NL_IWCM);
|
||||
}
|
||||
|
||||
return iwcm_deref_id(cm_id_priv);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is only called by the application thread and cannot
|
||||
* be called by the event thread. The function will wait for all
|
||||
* references to be released on the cm_id and then kfree the cm_id
|
||||
* object.
|
||||
* Destroy cm_id. If the cm_id still has other references, wait for all
|
||||
* references to be released on the cm_id and then release the initial
|
||||
* reference taken by iw_create_cm_id.
|
||||
*/
|
||||
void iw_destroy_cm_id(struct iw_cm_id *cm_id)
|
||||
{
|
||||
if (!destroy_cm_id(cm_id))
|
||||
struct iwcm_id_private *cm_id_priv;
|
||||
|
||||
cm_id_priv = container_of(cm_id, struct iwcm_id_private, id);
|
||||
destroy_cm_id(cm_id);
|
||||
if (refcount_read(&cm_id_priv->refcount) > 1)
|
||||
flush_workqueue(iwcm_wq);
|
||||
iwcm_deref_id(cm_id_priv);
|
||||
}
|
||||
EXPORT_SYMBOL(iw_destroy_cm_id);
|
||||
|
||||
@@ -1024,8 +1022,10 @@ static void cm_work_handler(struct work_struct *_work)
|
||||
|
||||
if (!test_bit(IWCM_F_DROP_EVENTS, &cm_id_priv->flags)) {
|
||||
ret = process_event(cm_id_priv, &levent);
|
||||
if (ret)
|
||||
WARN_ON_ONCE(destroy_cm_id(&cm_id_priv->id));
|
||||
if (ret) {
|
||||
destroy_cm_id(&cm_id_priv->id);
|
||||
WARN_ON_ONCE(iwcm_deref_id(cm_id_priv));
|
||||
}
|
||||
} else
|
||||
pr_debug("dropping event %d\n", levent.event);
|
||||
if (iwcm_deref_id(cm_id_priv))
|
||||
@@ -1083,7 +1083,7 @@ static int cm_event_handler(struct iw_cm_id *cm_id,
|
||||
}
|
||||
}
|
||||
|
||||
atomic_inc(&cm_id_priv->refcount);
|
||||
refcount_inc(&cm_id_priv->refcount);
|
||||
if (list_empty(&cm_id_priv->work_list)) {
|
||||
list_add_tail(&work->list, &cm_id_priv->work_list);
|
||||
queue_work(iwcm_wq, &work->work);
|
||||
|
||||
@@ -52,7 +52,7 @@ struct iwcm_id_private {
|
||||
wait_queue_head_t connect_wait;
|
||||
struct list_head work_list;
|
||||
spinlock_t lock;
|
||||
atomic_t refcount;
|
||||
refcount_t refcount;
|
||||
struct list_head work_free_list;
|
||||
};
|
||||
|
||||
|
||||
@@ -5172,7 +5172,7 @@ static int mlx5_ib_get_hw_stats(struct ib_device *ibdev,
|
||||
*/
|
||||
goto done;
|
||||
}
|
||||
ret = mlx5_lag_query_cong_counters(dev->mdev,
|
||||
ret = mlx5_lag_query_cong_counters(mdev,
|
||||
stats->value +
|
||||
port->cnts.num_q_counters,
|
||||
port->cnts.num_cong_counters,
|
||||
|
||||
@@ -161,6 +161,7 @@ static const struct xpad_device {
|
||||
{ 0x05fd, 0x107a, "InterAct 'PowerPad Pro' X-Box pad (Germany)", 0, XTYPE_XBOX },
|
||||
{ 0x05fe, 0x3030, "Chic Controller", 0, XTYPE_XBOX },
|
||||
{ 0x05fe, 0x3031, "Chic Controller", 0, XTYPE_XBOX },
|
||||
{ 0x0502, 0x1305, "Acer NGR200", 0, XTYPE_XBOX },
|
||||
{ 0x062a, 0x0020, "Logic3 Xbox GamePad", 0, XTYPE_XBOX },
|
||||
{ 0x062a, 0x0033, "Competition Pro Steering Wheel", 0, XTYPE_XBOX },
|
||||
{ 0x06a3, 0x0200, "Saitek Racing Wheel", 0, XTYPE_XBOX },
|
||||
@@ -289,6 +290,7 @@ static const struct xpad_device {
|
||||
{ 0x1689, 0xfd00, "Razer Onza Tournament Edition", 0, XTYPE_XBOX360 },
|
||||
{ 0x1689, 0xfd01, "Razer Onza Classic Edition", 0, XTYPE_XBOX360 },
|
||||
{ 0x1689, 0xfe00, "Razer Sabertooth", 0, XTYPE_XBOX360 },
|
||||
{ 0x1949, 0x041a, "Amazon Game Controller", 0, XTYPE_XBOX360 },
|
||||
{ 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
|
||||
{ 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
|
||||
{ 0x1bad, 0x0130, "Ion Drum Rocker", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
|
||||
@@ -453,6 +455,7 @@ static const struct usb_device_id xpad_table[] = {
|
||||
XPAD_XBOX360_VENDOR(0x045e), /* Microsoft X-Box 360 controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft X-Box One controllers */
|
||||
XPAD_XBOX360_VENDOR(0x046d), /* Logitech X-Box 360 style controllers */
|
||||
XPAD_XBOX360_VENDOR(0x0502), /* Acer Inc. Xbox 360 style controllers */
|
||||
XPAD_XBOX360_VENDOR(0x056e), /* Elecom JC-U3613M */
|
||||
XPAD_XBOX360_VENDOR(0x06a3), /* Saitek P3600 */
|
||||
XPAD_XBOX360_VENDOR(0x0738), /* Mad Catz X-Box 360 controllers */
|
||||
@@ -465,6 +468,7 @@ static const struct usb_device_id xpad_table[] = {
|
||||
XPAD_XBOX360_VENDOR(0x0f0d), /* Hori Controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x0f0d), /* Hori Controllers */
|
||||
XPAD_XBOX360_VENDOR(0x1038), /* SteelSeries Controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x10f5), /* Turtle Beach Controllers */
|
||||
XPAD_XBOX360_VENDOR(0x11c9), /* Nacon GC100XF */
|
||||
XPAD_XBOX360_VENDOR(0x11ff), /* PXN V900 */
|
||||
XPAD_XBOX360_VENDOR(0x1209), /* Ardwiino Controllers */
|
||||
@@ -476,6 +480,7 @@ static const struct usb_device_id xpad_table[] = {
|
||||
XPAD_XBOX360_VENDOR(0x15e4), /* Numark X-Box 360 controllers */
|
||||
XPAD_XBOX360_VENDOR(0x162e), /* Joytech X-Box 360 controllers */
|
||||
XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */
|
||||
XPAD_XBOX360_VENDOR(0x1949), /* Amazon controllers */
|
||||
XPAD_XBOX360_VENDOR(0x1bad), /* Harminix Rock Band Guitar and Drums */
|
||||
XPAD_XBOX360_VENDOR(0x20d6), /* PowerA Controllers */
|
||||
XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA Controllers */
|
||||
|
||||
@@ -778,7 +778,7 @@ static int atkbd_probe(struct atkbd *atkbd)
|
||||
|
||||
if (atkbd_skip_getid(atkbd)) {
|
||||
atkbd->id = 0xab83;
|
||||
return 0;
|
||||
goto deactivate_kbd;
|
||||
}
|
||||
|
||||
/*
|
||||
@@ -815,6 +815,7 @@ static int atkbd_probe(struct atkbd *atkbd)
|
||||
return -1;
|
||||
}
|
||||
|
||||
deactivate_kbd:
|
||||
/*
|
||||
* Make sure nothing is coming from the keyboard and disturbs our
|
||||
* internal state.
|
||||
|
||||
@@ -432,8 +432,8 @@ void mbox_free_channel(struct mbox_chan *chan)
|
||||
if (chan->txdone_method == TXDONE_BY_ACK)
|
||||
chan->txdone_method = TXDONE_BY_POLL;
|
||||
|
||||
module_put(chan->mbox->dev->driver->owner);
|
||||
spin_unlock_irqrestore(&chan->lock, flags);
|
||||
module_put(chan->mbox->dev->driver->owner);
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(mbox_free_channel);
|
||||
|
||||
|
||||
@@ -2406,7 +2406,7 @@ static int super_init_validation(struct raid_set *rs, struct md_rdev *rdev)
|
||||
*/
|
||||
sb_retrieve_failed_devices(sb, failed_devices);
|
||||
rdev_for_each(r, mddev) {
|
||||
if (test_bit(Journal, &rdev->flags) ||
|
||||
if (test_bit(Journal, &r->flags) ||
|
||||
!r->sb_page)
|
||||
continue;
|
||||
sb2 = page_address(r->sb_page);
|
||||
|
||||
@@ -548,7 +548,7 @@ static int md_bitmap_new_disk_sb(struct bitmap *bitmap)
|
||||
* is a good choice? We choose COUNTER_MAX / 2 arbitrarily.
|
||||
*/
|
||||
write_behind = bitmap->mddev->bitmap_info.max_write_behind;
|
||||
if (write_behind > COUNTER_MAX)
|
||||
if (write_behind > COUNTER_MAX / 2)
|
||||
write_behind = COUNTER_MAX / 2;
|
||||
sb->write_behind = cpu_to_le32(write_behind);
|
||||
bitmap->mddev->bitmap_info.max_write_behind = write_behind;
|
||||
|
||||
@@ -3279,6 +3279,7 @@ static int raid1_reshape(struct mddev *mddev)
|
||||
/* ok, everything is stopped */
|
||||
oldpool = conf->r1bio_pool;
|
||||
conf->r1bio_pool = newpool;
|
||||
init_waitqueue_head(&conf->r1bio_pool.wait);
|
||||
|
||||
for (d = d2 = 0; d < conf->raid_disks; d++) {
|
||||
struct md_rdev *rdev = conf->mirrors[d].rdev;
|
||||
|
||||
@@ -449,8 +449,8 @@ static int ccdc_lsc_config(struct isp_ccdc_device *ccdc,
|
||||
if (ret < 0)
|
||||
goto done;
|
||||
|
||||
dma_sync_sg_for_cpu(isp->dev, req->table.sgt.sgl,
|
||||
req->table.sgt.nents, DMA_TO_DEVICE);
|
||||
dma_sync_sgtable_for_cpu(isp->dev, &req->table.sgt,
|
||||
DMA_TO_DEVICE);
|
||||
|
||||
if (copy_from_user(req->table.addr, config->lsc,
|
||||
req->config.size)) {
|
||||
@@ -458,8 +458,8 @@ static int ccdc_lsc_config(struct isp_ccdc_device *ccdc,
|
||||
goto done;
|
||||
}
|
||||
|
||||
dma_sync_sg_for_device(isp->dev, req->table.sgt.sgl,
|
||||
req->table.sgt.nents, DMA_TO_DEVICE);
|
||||
dma_sync_sgtable_for_device(isp->dev, &req->table.sgt,
|
||||
DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
spin_lock_irqsave(&ccdc->lsc.req_lock, flags);
|
||||
|
||||
@@ -164,8 +164,7 @@ static void isp_stat_buf_sync_for_device(struct ispstat *stat,
|
||||
if (ISP_STAT_USES_DMAENGINE(stat))
|
||||
return;
|
||||
|
||||
dma_sync_sg_for_device(stat->isp->dev, buf->sgt.sgl,
|
||||
buf->sgt.nents, DMA_FROM_DEVICE);
|
||||
dma_sync_sgtable_for_device(stat->isp->dev, &buf->sgt, DMA_FROM_DEVICE);
|
||||
}
|
||||
|
||||
static void isp_stat_buf_sync_for_cpu(struct ispstat *stat,
|
||||
@@ -174,8 +173,7 @@ static void isp_stat_buf_sync_for_cpu(struct ispstat *stat,
|
||||
if (ISP_STAT_USES_DMAENGINE(stat))
|
||||
return;
|
||||
|
||||
dma_sync_sg_for_cpu(stat->isp->dev, buf->sgt.sgl,
|
||||
buf->sgt.nents, DMA_FROM_DEVICE);
|
||||
dma_sync_sgtable_for_cpu(stat->isp->dev, &buf->sgt, DMA_FROM_DEVICE);
|
||||
}
|
||||
|
||||
static void isp_stat_buf_clear(struct ispstat *stat)
|
||||
|
||||
@@ -923,8 +923,8 @@ int vivid_vid_cap_s_selection(struct file *file, void *fh, struct v4l2_selection
|
||||
if (dev->has_compose_cap) {
|
||||
v4l2_rect_set_min_size(compose, &min_rect);
|
||||
v4l2_rect_set_max_size(compose, &max_rect);
|
||||
v4l2_rect_map_inside(compose, &fmt);
|
||||
}
|
||||
v4l2_rect_map_inside(compose, &fmt);
|
||||
dev->fmt_cap_rect = fmt;
|
||||
tpg_s_buf_height(&dev->tpg, fmt.height);
|
||||
} else if (dev->has_compose_cap) {
|
||||
|
||||
@@ -1434,7 +1434,9 @@ static bool uvc_ctrl_xctrls_has_control(const struct v4l2_ext_control *xctrls,
|
||||
}
|
||||
|
||||
static void uvc_ctrl_send_events(struct uvc_fh *handle,
|
||||
const struct v4l2_ext_control *xctrls, unsigned int xctrls_count)
|
||||
struct uvc_entity *entity,
|
||||
const struct v4l2_ext_control *xctrls,
|
||||
unsigned int xctrls_count)
|
||||
{
|
||||
struct uvc_control_mapping *mapping;
|
||||
struct uvc_control *ctrl;
|
||||
@@ -1445,6 +1447,9 @@ static void uvc_ctrl_send_events(struct uvc_fh *handle,
|
||||
u32 changes = V4L2_EVENT_CTRL_CH_VALUE;
|
||||
|
||||
ctrl = uvc_find_control(handle->chain, xctrls[i].id, &mapping);
|
||||
if (ctrl->entity != entity)
|
||||
continue;
|
||||
|
||||
if (ctrl->info.flags & UVC_CTRL_FLAG_ASYNCHRONOUS)
|
||||
/* Notification will be sent from an Interrupt event. */
|
||||
continue;
|
||||
@@ -1565,14 +1570,19 @@ int uvc_ctrl_begin(struct uvc_video_chain *chain)
|
||||
return mutex_lock_interruptible(&chain->ctrl_mutex) ? -ERESTARTSYS : 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the number of uvc controls that have been correctly set, or a
|
||||
* negative number if there has been an error.
|
||||
*/
|
||||
static int uvc_ctrl_commit_entity(struct uvc_device *dev,
|
||||
struct uvc_fh *handle,
|
||||
struct uvc_entity *entity,
|
||||
int rollback)
|
||||
{
|
||||
unsigned int processed_ctrls = 0;
|
||||
struct uvc_control *ctrl;
|
||||
unsigned int i;
|
||||
int ret;
|
||||
int ret = 0;
|
||||
|
||||
if (entity == NULL)
|
||||
return 0;
|
||||
@@ -1600,8 +1610,9 @@ static int uvc_ctrl_commit_entity(struct uvc_device *dev,
|
||||
dev->intfnum, ctrl->info.selector,
|
||||
uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT),
|
||||
ctrl->info.size);
|
||||
else
|
||||
ret = 0;
|
||||
|
||||
if (!ret)
|
||||
processed_ctrls++;
|
||||
|
||||
if (rollback || ret < 0)
|
||||
memcpy(uvc_ctrl_data(ctrl, UVC_CTRL_DATA_CURRENT),
|
||||
@@ -1610,15 +1621,23 @@ static int uvc_ctrl_commit_entity(struct uvc_device *dev,
|
||||
|
||||
ctrl->dirty = 0;
|
||||
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
if (!rollback && handle &&
|
||||
if (!rollback && handle && !ret &&
|
||||
ctrl->info.flags & UVC_CTRL_FLAG_ASYNCHRONOUS)
|
||||
uvc_ctrl_set_handle(handle, ctrl, handle);
|
||||
|
||||
if (ret < 0 && !rollback) {
|
||||
/*
|
||||
* If we fail to set a control, we need to rollback
|
||||
* the next ones.
|
||||
*/
|
||||
rollback = 1;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
return processed_ctrls;
|
||||
}
|
||||
|
||||
int __uvc_ctrl_commit(struct uvc_fh *handle, int rollback,
|
||||
@@ -1627,21 +1646,31 @@ int __uvc_ctrl_commit(struct uvc_fh *handle, int rollback,
|
||||
{
|
||||
struct uvc_video_chain *chain = handle->chain;
|
||||
struct uvc_entity *entity;
|
||||
int ret = 0;
|
||||
int ret_out = 0;
|
||||
int ret;
|
||||
|
||||
/* Find the control. */
|
||||
list_for_each_entry(entity, &chain->entities, chain) {
|
||||
ret = uvc_ctrl_commit_entity(chain->dev, handle, entity,
|
||||
rollback);
|
||||
if (ret < 0)
|
||||
goto done;
|
||||
if (ret < 0) {
|
||||
/*
|
||||
* When we fail to commit an entity, we need to
|
||||
* restore the UVC_CTRL_DATA_BACKUP for all the
|
||||
* controls in the other entities, otherwise our cache
|
||||
* and the hardware will be out of sync.
|
||||
*/
|
||||
rollback = 1;
|
||||
|
||||
ret_out = ret;
|
||||
} else if (ret > 0 && !rollback) {
|
||||
uvc_ctrl_send_events(handle, entity, xctrls,
|
||||
xctrls_count);
|
||||
}
|
||||
}
|
||||
|
||||
if (!rollback)
|
||||
uvc_ctrl_send_events(handle, xctrls, xctrls_count);
|
||||
done:
|
||||
mutex_unlock(&chain->ctrl_mutex);
|
||||
return ret;
|
||||
return ret_out;
|
||||
}
|
||||
|
||||
int uvc_ctrl_get(struct uvc_video_chain *chain,
|
||||
|
||||
@@ -477,6 +477,7 @@ static int max14577_i2c_remove(struct i2c_client *i2c)
|
||||
{
|
||||
struct max14577 *max14577 = i2c_get_clientdata(i2c);
|
||||
|
||||
device_init_wakeup(max14577->dev, false);
|
||||
mfd_remove_devices(max14577->dev);
|
||||
regmap_del_irq_chip(max14577->irq, max14577->irq_data);
|
||||
if (max14577->dev_type == MAXIM_DEVICE_TYPE_MAX77836)
|
||||
|
||||
@@ -231,6 +231,7 @@ static int drv_cp_harray_to_user(void __user *user_buf_uva,
|
||||
static int vmci_host_setup_notify(struct vmci_ctx *context,
|
||||
unsigned long uva)
|
||||
{
|
||||
struct page *page;
|
||||
int retval;
|
||||
|
||||
if (context->notify_page) {
|
||||
@@ -249,11 +250,11 @@ static int vmci_host_setup_notify(struct vmci_ctx *context,
|
||||
/*
|
||||
* Lock physical page backing a given user VA.
|
||||
*/
|
||||
retval = get_user_pages_fast(uva, 1, 1, &context->notify_page);
|
||||
if (retval != 1) {
|
||||
context->notify_page = NULL;
|
||||
retval = get_user_pages_fast(uva, 1, 1, &page);
|
||||
if (retval != 1)
|
||||
return VMCI_ERROR_GENERIC;
|
||||
}
|
||||
|
||||
context->notify_page = page;
|
||||
|
||||
/*
|
||||
* Map the locked page and set up notify pointer.
|
||||
|
||||
@@ -602,21 +602,23 @@ static inline void msdc_dma_setup(struct msdc_host *host, struct msdc_dma *dma,
|
||||
writel(lower_32_bits(dma->gpd_addr), host->base + MSDC_DMA_SA);
|
||||
}
|
||||
|
||||
static void msdc_prepare_data(struct msdc_host *host, struct mmc_request *mrq)
|
||||
static void msdc_prepare_data(struct msdc_host *host, struct mmc_data *data)
|
||||
{
|
||||
struct mmc_data *data = mrq->data;
|
||||
|
||||
if (!(data->host_cookie & MSDC_PREPARE_FLAG)) {
|
||||
data->host_cookie |= MSDC_PREPARE_FLAG;
|
||||
data->sg_count = dma_map_sg(host->dev, data->sg, data->sg_len,
|
||||
mmc_get_dma_dir(data));
|
||||
if (data->sg_count)
|
||||
data->host_cookie |= MSDC_PREPARE_FLAG;
|
||||
}
|
||||
}
|
||||
|
||||
static void msdc_unprepare_data(struct msdc_host *host, struct mmc_request *mrq)
|
||||
static bool msdc_data_prepared(struct mmc_data *data)
|
||||
{
|
||||
struct mmc_data *data = mrq->data;
|
||||
return data->host_cookie & MSDC_PREPARE_FLAG;
|
||||
}
|
||||
|
||||
static void msdc_unprepare_data(struct msdc_host *host, struct mmc_data *data)
|
||||
{
|
||||
if (data->host_cookie & MSDC_ASYNC_FLAG)
|
||||
return;
|
||||
|
||||
@@ -941,7 +943,7 @@ static void msdc_request_done(struct msdc_host *host, struct mmc_request *mrq)
|
||||
|
||||
msdc_track_cmd_data(host, mrq->cmd, mrq->data);
|
||||
if (mrq->data)
|
||||
msdc_unprepare_data(host, mrq);
|
||||
msdc_unprepare_data(host, mrq->data);
|
||||
mmc_request_done(host->mmc, mrq);
|
||||
}
|
||||
|
||||
@@ -1101,8 +1103,18 @@ static void msdc_ops_request(struct mmc_host *mmc, struct mmc_request *mrq)
|
||||
WARN_ON(host->mrq);
|
||||
host->mrq = mrq;
|
||||
|
||||
if (mrq->data)
|
||||
msdc_prepare_data(host, mrq);
|
||||
if (mrq->data) {
|
||||
msdc_prepare_data(host, mrq->data);
|
||||
if (!msdc_data_prepared(mrq->data)) {
|
||||
/*
|
||||
* Failed to prepare DMA area, fail fast before
|
||||
* starting any commands.
|
||||
*/
|
||||
mrq->cmd->error = -ENOSPC;
|
||||
mmc_request_done(mmc, mrq);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
/* if SBC is required, we have HW option and SW option.
|
||||
* if HW option is enabled, and SBC does not have "special" flags,
|
||||
@@ -1123,7 +1135,7 @@ static void msdc_pre_req(struct mmc_host *mmc, struct mmc_request *mrq)
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
msdc_prepare_data(host, mrq);
|
||||
msdc_prepare_data(host, data);
|
||||
data->host_cookie |= MSDC_ASYNC_FLAG;
|
||||
}
|
||||
|
||||
@@ -1131,14 +1143,14 @@ static void msdc_post_req(struct mmc_host *mmc, struct mmc_request *mrq,
|
||||
int err)
|
||||
{
|
||||
struct msdc_host *host = mmc_priv(mmc);
|
||||
struct mmc_data *data;
|
||||
struct mmc_data *data = mrq->data;
|
||||
|
||||
data = mrq->data;
|
||||
if (!data)
|
||||
return;
|
||||
|
||||
if (data->host_cookie) {
|
||||
data->host_cookie &= ~MSDC_ASYNC_FLAG;
|
||||
msdc_unprepare_data(host, mrq);
|
||||
msdc_unprepare_data(host, data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1533,15 +1533,10 @@ void sdhci_set_clock(struct sdhci_host *host, unsigned int clock)
|
||||
|
||||
host->mmc->actual_clock = 0;
|
||||
|
||||
clk = sdhci_readw(host, SDHCI_CLOCK_CONTROL);
|
||||
if (clk & SDHCI_CLOCK_CARD_EN)
|
||||
sdhci_writew(host, clk & ~SDHCI_CLOCK_CARD_EN,
|
||||
SDHCI_CLOCK_CONTROL);
|
||||
sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
|
||||
|
||||
if (clock == 0) {
|
||||
sdhci_writew(host, 0, SDHCI_CLOCK_CONTROL);
|
||||
if (clock == 0)
|
||||
return;
|
||||
}
|
||||
|
||||
clk = sdhci_calc_clk(host, clock, &host->mmc->actual_clock);
|
||||
sdhci_enable_clk(host, clk);
|
||||
|
||||
@@ -761,4 +761,20 @@ void sdhci_end_tuning(struct sdhci_host *host);
|
||||
void sdhci_reset_tuning(struct sdhci_host *host);
|
||||
void sdhci_send_tuning(struct sdhci_host *host, u32 opcode);
|
||||
|
||||
#if defined(CONFIG_DYNAMIC_DEBUG) || \
|
||||
(defined(CONFIG_DYNAMIC_DEBUG_CORE) && defined(DYNAMIC_DEBUG_MODULE))
|
||||
#define SDHCI_DBG_ANYWAY 0
|
||||
#elif defined(DEBUG)
|
||||
#define SDHCI_DBG_ANYWAY 1
|
||||
#else
|
||||
#define SDHCI_DBG_ANYWAY 0
|
||||
#endif
|
||||
|
||||
#define sdhci_dbg_dumpregs(host, fmt) \
|
||||
do { \
|
||||
DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
|
||||
if (DYNAMIC_DEBUG_BRANCH(descriptor) || SDHCI_DBG_ANYWAY) \
|
||||
sdhci_dumpregs(host); \
|
||||
} while (0)
|
||||
|
||||
#endif /* __SDHCI_HW_H */
|
||||
|
||||
@@ -539,7 +539,7 @@ static int m_can_handle_lost_msg(struct net_device *dev)
|
||||
struct sk_buff *skb;
|
||||
struct can_frame *frame;
|
||||
|
||||
netdev_err(dev, "msg lost in rxf0\n");
|
||||
netdev_dbg(dev, "msg lost in rxf0\n");
|
||||
|
||||
stats->rx_errors++;
|
||||
stats->rx_over_errors++;
|
||||
|
||||
@@ -1355,6 +1355,8 @@
|
||||
#define MDIO_VEND2_CTRL1_SS13 BIT(13)
|
||||
#endif
|
||||
|
||||
#define XGBE_VEND2_MAC_AUTO_SW BIT(9)
|
||||
|
||||
/* MDIO mask values */
|
||||
#define XGBE_AN_CL73_INT_CMPLT BIT(0)
|
||||
#define XGBE_AN_CL73_INC_LINK BIT(1)
|
||||
|
||||
@@ -363,6 +363,10 @@ static void xgbe_an37_set(struct xgbe_prv_data *pdata, bool enable,
|
||||
reg |= MDIO_VEND2_CTRL1_AN_RESTART;
|
||||
|
||||
XMDIO_WRITE(pdata, MDIO_MMD_VEND2, MDIO_CTRL1, reg);
|
||||
|
||||
reg = XMDIO_READ(pdata, MDIO_MMD_VEND2, MDIO_PCS_DIG_CTRL);
|
||||
reg |= XGBE_VEND2_MAC_AUTO_SW;
|
||||
XMDIO_WRITE(pdata, MDIO_MMD_VEND2, MDIO_PCS_DIG_CTRL, reg);
|
||||
}
|
||||
|
||||
static void xgbe_an37_restart(struct xgbe_prv_data *pdata)
|
||||
@@ -991,6 +995,11 @@ static void xgbe_an37_init(struct xgbe_prv_data *pdata)
|
||||
|
||||
netif_dbg(pdata, link, pdata->netdev, "CL37 AN (%s) initialized\n",
|
||||
(pdata->an_mode == XGBE_AN_MODE_CL37) ? "BaseX" : "SGMII");
|
||||
|
||||
reg = XMDIO_READ(pdata, MDIO_MMD_AN, MDIO_CTRL1);
|
||||
reg &= ~MDIO_AN_CTRL1_ENABLE;
|
||||
XMDIO_WRITE(pdata, MDIO_MMD_AN, MDIO_CTRL1, reg);
|
||||
|
||||
}
|
||||
|
||||
static void xgbe_an73_init(struct xgbe_prv_data *pdata)
|
||||
|
||||
@@ -292,11 +292,11 @@
|
||||
#define XGBE_LINK_TIMEOUT 5
|
||||
#define XGBE_KR_TRAINING_WAIT_ITER 50
|
||||
|
||||
#define XGBE_SGMII_AN_LINK_STATUS BIT(1)
|
||||
#define XGBE_SGMII_AN_LINK_DUPLEX BIT(1)
|
||||
#define XGBE_SGMII_AN_LINK_SPEED (BIT(2) | BIT(3))
|
||||
#define XGBE_SGMII_AN_LINK_SPEED_100 0x04
|
||||
#define XGBE_SGMII_AN_LINK_SPEED_1000 0x08
|
||||
#define XGBE_SGMII_AN_LINK_DUPLEX BIT(4)
|
||||
#define XGBE_SGMII_AN_LINK_STATUS BIT(4)
|
||||
|
||||
/* ECC correctable error notification window (seconds) */
|
||||
#define XGBE_ECC_LIMIT 60
|
||||
|
||||
@@ -1882,14 +1882,21 @@ static u16 atl1_alloc_rx_buffers(struct atl1_adapter *adapter)
|
||||
break;
|
||||
}
|
||||
|
||||
buffer_info->alloced = 1;
|
||||
buffer_info->skb = skb;
|
||||
buffer_info->length = (u16) adapter->rx_buffer_len;
|
||||
page = virt_to_page(skb->data);
|
||||
offset = offset_in_page(skb->data);
|
||||
buffer_info->dma = pci_map_page(pdev, page, offset,
|
||||
adapter->rx_buffer_len,
|
||||
PCI_DMA_FROMDEVICE);
|
||||
if (pci_dma_mapping_error(pdev, buffer_info->dma)) {
|
||||
kfree_skb(skb);
|
||||
adapter->soft_stats.rx_dropped++;
|
||||
break;
|
||||
}
|
||||
|
||||
buffer_info->alloced = 1;
|
||||
buffer_info->skb = skb;
|
||||
buffer_info->length = (u16)adapter->rx_buffer_len;
|
||||
|
||||
rfd_desc->buffer_addr = cpu_to_le64(buffer_info->dma);
|
||||
rfd_desc->buf_len = cpu_to_le16(adapter->rx_buffer_len);
|
||||
rfd_desc->coalese = 0;
|
||||
@@ -2201,8 +2208,8 @@ static int atl1_tx_csum(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
struct tx_packet_desc *ptpd)
|
||||
static bool atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
struct tx_packet_desc *ptpd)
|
||||
{
|
||||
struct atl1_tpd_ring *tpd_ring = &adapter->tpd_ring;
|
||||
struct atl1_buffer *buffer_info;
|
||||
@@ -2212,6 +2219,7 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
unsigned int nr_frags;
|
||||
unsigned int f;
|
||||
int retval;
|
||||
u16 first_mapped;
|
||||
u16 next_to_use;
|
||||
u16 data_len;
|
||||
u8 hdr_len;
|
||||
@@ -2219,6 +2227,7 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
buf_len -= skb->data_len;
|
||||
nr_frags = skb_shinfo(skb)->nr_frags;
|
||||
next_to_use = atomic_read(&tpd_ring->next_to_use);
|
||||
first_mapped = next_to_use;
|
||||
buffer_info = &tpd_ring->buffer_info[next_to_use];
|
||||
BUG_ON(buffer_info->skb);
|
||||
/* put skb in last TPD */
|
||||
@@ -2234,6 +2243,8 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
buffer_info->dma = pci_map_page(adapter->pdev, page,
|
||||
offset, hdr_len,
|
||||
PCI_DMA_TODEVICE);
|
||||
if (pci_dma_mapping_error(adapter->pdev, buffer_info->dma))
|
||||
goto dma_err;
|
||||
|
||||
if (++next_to_use == tpd_ring->count)
|
||||
next_to_use = 0;
|
||||
@@ -2259,6 +2270,9 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
buffer_info->dma = pci_map_page(adapter->pdev,
|
||||
page, offset, buffer_info->length,
|
||||
PCI_DMA_TODEVICE);
|
||||
if (pci_dma_mapping_error(adapter->pdev,
|
||||
buffer_info->dma))
|
||||
goto dma_err;
|
||||
if (++next_to_use == tpd_ring->count)
|
||||
next_to_use = 0;
|
||||
}
|
||||
@@ -2270,6 +2284,8 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
offset = offset_in_page(skb->data);
|
||||
buffer_info->dma = pci_map_page(adapter->pdev, page,
|
||||
offset, buf_len, PCI_DMA_TODEVICE);
|
||||
if (pci_dma_mapping_error(adapter->pdev, buffer_info->dma))
|
||||
goto dma_err;
|
||||
if (++next_to_use == tpd_ring->count)
|
||||
next_to_use = 0;
|
||||
}
|
||||
@@ -2294,6 +2310,9 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
buffer_info->dma = skb_frag_dma_map(&adapter->pdev->dev,
|
||||
frag, i * ATL1_MAX_TX_BUF_LEN,
|
||||
buffer_info->length, DMA_TO_DEVICE);
|
||||
if (dma_mapping_error(&adapter->pdev->dev,
|
||||
buffer_info->dma))
|
||||
goto dma_err;
|
||||
|
||||
if (++next_to_use == tpd_ring->count)
|
||||
next_to_use = 0;
|
||||
@@ -2302,6 +2321,22 @@ static void atl1_tx_map(struct atl1_adapter *adapter, struct sk_buff *skb,
|
||||
|
||||
/* last tpd's buffer-info */
|
||||
buffer_info->skb = skb;
|
||||
|
||||
return true;
|
||||
|
||||
dma_err:
|
||||
while (first_mapped != next_to_use) {
|
||||
buffer_info = &tpd_ring->buffer_info[first_mapped];
|
||||
pci_unmap_page(adapter->pdev,
|
||||
buffer_info->dma,
|
||||
buffer_info->length,
|
||||
PCI_DMA_TODEVICE);
|
||||
buffer_info->dma = 0;
|
||||
|
||||
if (++first_mapped == tpd_ring->count)
|
||||
first_mapped = 0;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void atl1_tx_queue(struct atl1_adapter *adapter, u16 count,
|
||||
@@ -2372,10 +2407,8 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
|
||||
|
||||
len = skb_headlen(skb);
|
||||
|
||||
if (unlikely(skb->len <= 0)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
if (unlikely(skb->len <= 0))
|
||||
goto drop_packet;
|
||||
|
||||
nr_frags = skb_shinfo(skb)->nr_frags;
|
||||
for (f = 0; f < nr_frags; f++) {
|
||||
@@ -2389,10 +2422,8 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
|
||||
if (skb->protocol == htons(ETH_P_IP)) {
|
||||
proto_hdr_len = (skb_transport_offset(skb) +
|
||||
tcp_hdrlen(skb));
|
||||
if (unlikely(proto_hdr_len > len)) {
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
if (unlikely(proto_hdr_len > len))
|
||||
goto drop_packet;
|
||||
/* need additional TPD ? */
|
||||
if (proto_hdr_len != len)
|
||||
count += (len - proto_hdr_len +
|
||||
@@ -2424,24 +2455,27 @@ static netdev_tx_t atl1_xmit_frame(struct sk_buff *skb,
|
||||
}
|
||||
|
||||
tso = atl1_tso(adapter, skb, ptpd);
|
||||
if (tso < 0) {
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
if (tso < 0)
|
||||
goto drop_packet;
|
||||
|
||||
if (!tso) {
|
||||
ret_val = atl1_tx_csum(adapter, skb, ptpd);
|
||||
if (ret_val < 0) {
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
if (ret_val < 0)
|
||||
goto drop_packet;
|
||||
}
|
||||
|
||||
atl1_tx_map(adapter, skb, ptpd);
|
||||
if (!atl1_tx_map(adapter, skb, ptpd))
|
||||
goto drop_packet;
|
||||
|
||||
atl1_tx_queue(adapter, count, ptpd);
|
||||
atl1_update_mailbox(adapter);
|
||||
mmiowb();
|
||||
return NETDEV_TX_OK;
|
||||
|
||||
drop_packet:
|
||||
adapter->soft_stats.tx_errors++;
|
||||
dev_kfree_skb_any(skb);
|
||||
return NETDEV_TX_OK;
|
||||
}
|
||||
|
||||
static int atl1_rings_clean(struct napi_struct *napi, int budget)
|
||||
|
||||
@@ -457,7 +457,9 @@ static int bnxt_ets_validate(struct bnxt *bp, struct ieee_ets *ets, u8 *tc)
|
||||
|
||||
if ((ets->tc_tx_bw[i] || ets->tc_tsa[i]) && i > bp->max_tc)
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
for (i = 0; i < max_tc; i++) {
|
||||
switch (ets->tc_tsa[i]) {
|
||||
case IEEE_8021QAZ_TSA_STRICT:
|
||||
break;
|
||||
|
||||
@@ -2093,10 +2093,10 @@ static int enic_change_mtu(struct net_device *netdev, int new_mtu)
|
||||
if (enic_is_dynamic(enic) || enic_is_sriov_vf(enic))
|
||||
return -EOPNOTSUPP;
|
||||
|
||||
if (netdev->mtu > enic->port_mtu)
|
||||
if (new_mtu > enic->port_mtu)
|
||||
netdev_warn(netdev,
|
||||
"interface MTU (%d) set higher than port MTU (%d)\n",
|
||||
netdev->mtu, enic->port_mtu);
|
||||
new_mtu, enic->port_mtu);
|
||||
|
||||
return _enic_change_mtu(netdev, new_mtu);
|
||||
}
|
||||
|
||||
@@ -880,7 +880,7 @@ static int be_cmd_lock(struct be_adapter *adapter)
|
||||
static void be_cmd_unlock(struct be_adapter *adapter)
|
||||
{
|
||||
if (use_mcc(adapter))
|
||||
return spin_unlock_bh(&adapter->mcc_lock);
|
||||
spin_unlock_bh(&adapter->mcc_lock);
|
||||
else
|
||||
return mutex_unlock(&adapter->mbox_lock);
|
||||
}
|
||||
|
||||
@@ -3319,7 +3319,7 @@ static int niu_rbr_add_page(struct niu *np, struct rx_ring_info *rp,
|
||||
|
||||
addr = np->ops->map_page(np->device, page, 0,
|
||||
PAGE_SIZE, DMA_FROM_DEVICE);
|
||||
if (!addr) {
|
||||
if (np->ops->mapping_error(np->device, addr)) {
|
||||
__free_page(page);
|
||||
return -ENOMEM;
|
||||
}
|
||||
@@ -6656,6 +6656,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
|
||||
len = skb_headlen(skb);
|
||||
mapping = np->ops->map_single(np->device, skb->data,
|
||||
len, DMA_TO_DEVICE);
|
||||
if (np->ops->mapping_error(np->device, mapping))
|
||||
goto out_drop;
|
||||
|
||||
prod = rp->prod;
|
||||
|
||||
@@ -6697,6 +6699,8 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
|
||||
mapping = np->ops->map_page(np->device, skb_frag_page(frag),
|
||||
frag->page_offset, len,
|
||||
DMA_TO_DEVICE);
|
||||
if (np->ops->mapping_error(np->device, mapping))
|
||||
goto out_unmap;
|
||||
|
||||
rp->tx_buffs[prod].skb = NULL;
|
||||
rp->tx_buffs[prod].mapping = mapping;
|
||||
@@ -6721,6 +6725,19 @@ static netdev_tx_t niu_start_xmit(struct sk_buff *skb,
|
||||
out:
|
||||
return NETDEV_TX_OK;
|
||||
|
||||
out_unmap:
|
||||
while (i--) {
|
||||
const skb_frag_t *frag;
|
||||
|
||||
prod = PREVIOUS_TX(rp, prod);
|
||||
frag = &skb_shinfo(skb)->frags[i];
|
||||
np->ops->unmap_page(np->device, rp->tx_buffs[prod].mapping,
|
||||
skb_frag_size(frag), DMA_TO_DEVICE);
|
||||
}
|
||||
|
||||
np->ops->unmap_single(np->device, rp->tx_buffs[rp->prod].mapping,
|
||||
skb_headlen(skb), DMA_TO_DEVICE);
|
||||
|
||||
out_drop:
|
||||
rp->tx_errors++;
|
||||
kfree_skb(skb);
|
||||
@@ -9613,6 +9630,11 @@ static void niu_pci_unmap_single(struct device *dev, u64 dma_address,
|
||||
dma_unmap_single(dev, dma_address, size, direction);
|
||||
}
|
||||
|
||||
static int niu_pci_mapping_error(struct device *dev, u64 addr)
|
||||
{
|
||||
return dma_mapping_error(dev, addr);
|
||||
}
|
||||
|
||||
static const struct niu_ops niu_pci_ops = {
|
||||
.alloc_coherent = niu_pci_alloc_coherent,
|
||||
.free_coherent = niu_pci_free_coherent,
|
||||
@@ -9620,6 +9642,7 @@ static const struct niu_ops niu_pci_ops = {
|
||||
.unmap_page = niu_pci_unmap_page,
|
||||
.map_single = niu_pci_map_single,
|
||||
.unmap_single = niu_pci_unmap_single,
|
||||
.mapping_error = niu_pci_mapping_error,
|
||||
};
|
||||
|
||||
static void niu_driver_version(void)
|
||||
@@ -9997,6 +10020,11 @@ static void niu_phys_unmap_single(struct device *dev, u64 dma_address,
|
||||
/* Nothing to do. */
|
||||
}
|
||||
|
||||
static int niu_phys_mapping_error(struct device *dev, u64 dma_address)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
static const struct niu_ops niu_phys_ops = {
|
||||
.alloc_coherent = niu_phys_alloc_coherent,
|
||||
.free_coherent = niu_phys_free_coherent,
|
||||
@@ -10004,6 +10032,7 @@ static const struct niu_ops niu_phys_ops = {
|
||||
.unmap_page = niu_phys_unmap_page,
|
||||
.map_single = niu_phys_map_single,
|
||||
.unmap_single = niu_phys_unmap_single,
|
||||
.mapping_error = niu_phys_mapping_error,
|
||||
};
|
||||
|
||||
static int niu_of_probe(struct platform_device *op)
|
||||
|
||||
@@ -2879,6 +2879,9 @@ struct tx_ring_info {
|
||||
#define NEXT_TX(tp, index) \
|
||||
(((index) + 1) < (tp)->pending ? ((index) + 1) : 0)
|
||||
|
||||
#define PREVIOUS_TX(tp, index) \
|
||||
(((index) - 1) >= 0 ? ((index) - 1) : (((tp)->pending) - 1))
|
||||
|
||||
static inline u32 niu_tx_avail(struct tx_ring_info *tp)
|
||||
{
|
||||
return (tp->pending -
|
||||
@@ -3140,6 +3143,7 @@ struct niu_ops {
|
||||
enum dma_data_direction direction);
|
||||
void (*unmap_single)(struct device *dev, u64 dma_address,
|
||||
size_t size, enum dma_data_direction direction);
|
||||
int (*mapping_error)(struct device *dev, u64 dma_address);
|
||||
};
|
||||
|
||||
struct niu_link_config {
|
||||
|
||||
@@ -1385,6 +1385,7 @@ static const struct usb_device_id products[] = {
|
||||
{QMI_FIXED_INTF(0x03f0, 0x9d1d, 1)}, /* HP lt4120 Snapdragon X5 LTE */
|
||||
{QMI_FIXED_INTF(0x22de, 0x9061, 3)}, /* WeTelecom WPD-600N */
|
||||
{QMI_QUIRK_SET_DTR(0x1e0e, 0x9001, 5)}, /* SIMCom 7100E, 7230E, 7600E ++ */
|
||||
{QMI_QUIRK_SET_DTR(0x1e0e, 0x9071, 3)}, /* SIMCom 8230C ++ */
|
||||
{QMI_QUIRK_SET_DTR(0x2c7c, 0x0121, 4)}, /* Quectel EC21 Mini PCIe */
|
||||
{QMI_QUIRK_SET_DTR(0x2c7c, 0x0191, 4)}, /* Quectel EG91 */
|
||||
{QMI_QUIRK_SET_DTR(0x2c7c, 0x0195, 4)}, /* Quectel EG95 */
|
||||
|
||||
@@ -87,7 +87,9 @@ int ath6kl_bmi_get_target_info(struct ath6kl *ar,
|
||||
* We need to do some backwards compatibility to make this work.
|
||||
*/
|
||||
if (le32_to_cpu(targ_info->byte_count) != sizeof(*targ_info)) {
|
||||
WARN_ON(1);
|
||||
ath6kl_err("mismatched byte count %d vs. expected %zd\n",
|
||||
le32_to_cpu(targ_info->byte_count),
|
||||
sizeof(*targ_info));
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
|
||||
@@ -597,7 +597,11 @@ void zd_mac_tx_to_dev(struct sk_buff *skb, int error)
|
||||
|
||||
skb_queue_tail(q, skb);
|
||||
while (skb_queue_len(q) > ZD_MAC_MAX_ACK_WAITERS) {
|
||||
zd_mac_tx_status(hw, skb_dequeue(q),
|
||||
skb = skb_dequeue(q);
|
||||
if (!skb)
|
||||
break;
|
||||
|
||||
zd_mac_tx_status(hw, skb,
|
||||
mac->ack_pending ? mac->ack_signal : 0,
|
||||
NULL);
|
||||
mac->ack_pending = 0;
|
||||
|
||||
@@ -3395,6 +3395,8 @@ static int qla4xxx_alloc_pdu(struct iscsi_task *task, uint8_t opcode)
|
||||
task_data->data_dma = dma_map_single(&ha->pdev->dev, task->data,
|
||||
task->data_count,
|
||||
PCI_DMA_TODEVICE);
|
||||
if (dma_mapping_error(&ha->pdev->dev, task_data->data_dma))
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
DEBUG2(ql4_printk(KERN_INFO, ha, "%s: MaxRecvLen %u, iscsi hrd %d\n",
|
||||
|
||||
@@ -750,7 +750,7 @@ UFS_UNIT_DESC_PARAM(logical_block_size, _LOGICAL_BLK_SIZE, 1);
|
||||
UFS_UNIT_DESC_PARAM(logical_block_count, _LOGICAL_BLK_COUNT, 8);
|
||||
UFS_UNIT_DESC_PARAM(erase_block_size, _ERASE_BLK_SIZE, 4);
|
||||
UFS_UNIT_DESC_PARAM(provisioning_type, _PROVISIONING_TYPE, 1);
|
||||
UFS_UNIT_DESC_PARAM(physical_memory_resourse_count, _PHY_MEM_RSRC_CNT, 8);
|
||||
UFS_UNIT_DESC_PARAM(physical_memory_resource_count, _PHY_MEM_RSRC_CNT, 8);
|
||||
UFS_UNIT_DESC_PARAM(context_capabilities, _CTX_CAPABILITIES, 2);
|
||||
UFS_UNIT_DESC_PARAM(large_unit_granularity, _LARGE_UNIT_SIZE_M1, 1);
|
||||
|
||||
@@ -765,7 +765,7 @@ static struct attribute *ufs_sysfs_unit_descriptor[] = {
|
||||
&dev_attr_logical_block_count.attr,
|
||||
&dev_attr_erase_block_size.attr,
|
||||
&dev_attr_provisioning_type.attr,
|
||||
&dev_attr_physical_memory_resourse_count.attr,
|
||||
&dev_attr_physical_memory_resource_count.attr,
|
||||
&dev_attr_context_capabilities.attr,
|
||||
&dev_attr_large_unit_granularity.attr,
|
||||
NULL,
|
||||
|
||||
@@ -1333,30 +1333,21 @@ static sint aes_cipher(u8 *key, uint hdrlen,
|
||||
num_blocks, payload_index;
|
||||
|
||||
u8 pn_vector[6];
|
||||
u8 mic_iv[16];
|
||||
u8 mic_header1[16];
|
||||
u8 mic_header2[16];
|
||||
u8 ctr_preload[16];
|
||||
u8 mic_iv[16] = {};
|
||||
u8 mic_header1[16] = {};
|
||||
u8 mic_header2[16] = {};
|
||||
u8 ctr_preload[16] = {};
|
||||
|
||||
/* Intermediate Buffers */
|
||||
u8 chain_buffer[16];
|
||||
u8 aes_out[16];
|
||||
u8 padded_buffer[16];
|
||||
u8 chain_buffer[16] = {};
|
||||
u8 aes_out[16] = {};
|
||||
u8 padded_buffer[16] = {};
|
||||
u8 mic[8];
|
||||
uint frtype = GetFrameType(pframe);
|
||||
uint frsubtype = GetFrameSubType(pframe);
|
||||
|
||||
frsubtype = frsubtype>>4;
|
||||
|
||||
|
||||
memset((void *)mic_iv, 0, 16);
|
||||
memset((void *)mic_header1, 0, 16);
|
||||
memset((void *)mic_header2, 0, 16);
|
||||
memset((void *)ctr_preload, 0, 16);
|
||||
memset((void *)chain_buffer, 0, 16);
|
||||
memset((void *)aes_out, 0, 16);
|
||||
memset((void *)padded_buffer, 0, 16);
|
||||
|
||||
if ((hdrlen == WLAN_HDR_A3_LEN) || (hdrlen == WLAN_HDR_A3_QOS_LEN))
|
||||
a4_exists = 0;
|
||||
else
|
||||
@@ -1581,15 +1572,15 @@ static sint aes_decipher(u8 *key, uint hdrlen,
|
||||
num_blocks, payload_index;
|
||||
sint res = _SUCCESS;
|
||||
u8 pn_vector[6];
|
||||
u8 mic_iv[16];
|
||||
u8 mic_header1[16];
|
||||
u8 mic_header2[16];
|
||||
u8 ctr_preload[16];
|
||||
u8 mic_iv[16] = {};
|
||||
u8 mic_header1[16] = {};
|
||||
u8 mic_header2[16] = {};
|
||||
u8 ctr_preload[16] = {};
|
||||
|
||||
/* Intermediate Buffers */
|
||||
u8 chain_buffer[16];
|
||||
u8 aes_out[16];
|
||||
u8 padded_buffer[16];
|
||||
u8 chain_buffer[16] = {};
|
||||
u8 aes_out[16] = {};
|
||||
u8 padded_buffer[16] = {};
|
||||
u8 mic[8];
|
||||
|
||||
|
||||
@@ -1599,15 +1590,6 @@ static sint aes_decipher(u8 *key, uint hdrlen,
|
||||
|
||||
frsubtype = frsubtype>>4;
|
||||
|
||||
|
||||
memset((void *)mic_iv, 0, 16);
|
||||
memset((void *)mic_header1, 0, 16);
|
||||
memset((void *)mic_header2, 0, 16);
|
||||
memset((void *)ctr_preload, 0, 16);
|
||||
memset((void *)chain_buffer, 0, 16);
|
||||
memset((void *)aes_out, 0, 16);
|
||||
memset((void *)padded_buffer, 0, 16);
|
||||
|
||||
/* start to decrypt the payload */
|
||||
|
||||
num_blocks = (plen-8) / 16; /* plen including LLC, payload_length and mic) */
|
||||
|
||||
@@ -4299,6 +4299,7 @@ void do_unblank_screen(int leaving_gfx)
|
||||
set_palette(vc);
|
||||
set_cursor(vc);
|
||||
vt_event_post(VT_EVENT_UNBLANK, vc->vc_num, vc->vc_num);
|
||||
notify_update(vc);
|
||||
}
|
||||
EXPORT_SYMBOL(do_unblank_screen);
|
||||
|
||||
|
||||
@@ -89,7 +89,6 @@ struct wdm_device {
|
||||
u16 wMaxCommand;
|
||||
u16 wMaxPacketSize;
|
||||
__le16 inum;
|
||||
int reslength;
|
||||
int length;
|
||||
int read;
|
||||
int count;
|
||||
@@ -201,6 +200,11 @@ static void wdm_in_callback(struct urb *urb)
|
||||
if (desc->rerr == 0 && status != -EPIPE)
|
||||
desc->rerr = status;
|
||||
|
||||
if (length == 0) {
|
||||
dev_dbg(&desc->intf->dev, "received ZLP\n");
|
||||
goto skip_zlp;
|
||||
}
|
||||
|
||||
if (length + desc->length > desc->wMaxCommand) {
|
||||
/* The buffer would overflow */
|
||||
set_bit(WDM_OVERFLOW, &desc->flags);
|
||||
@@ -209,18 +213,18 @@ static void wdm_in_callback(struct urb *urb)
|
||||
if (!test_bit(WDM_OVERFLOW, &desc->flags)) {
|
||||
memmove(desc->ubuf + desc->length, desc->inbuf, length);
|
||||
desc->length += length;
|
||||
desc->reslength = length;
|
||||
}
|
||||
}
|
||||
skip_error:
|
||||
|
||||
if (desc->rerr) {
|
||||
/*
|
||||
* Since there was an error, userspace may decide to not read
|
||||
* any data after poll'ing.
|
||||
* If there was a ZLP or an error, userspace may decide to not
|
||||
* read any data after poll'ing.
|
||||
* We should respond to further attempts from the device to send
|
||||
* data, so that we can get unstuck.
|
||||
*/
|
||||
skip_zlp:
|
||||
schedule_work(&desc->service_outs_intr);
|
||||
} else {
|
||||
set_bit(WDM_READ, &desc->flags);
|
||||
@@ -571,15 +575,6 @@ retry:
|
||||
goto retry;
|
||||
}
|
||||
|
||||
if (!desc->reslength) { /* zero length read */
|
||||
dev_dbg(&desc->intf->dev, "zero length - clearing WDM_READ\n");
|
||||
clear_bit(WDM_READ, &desc->flags);
|
||||
rv = service_outstanding_interrupt(desc);
|
||||
spin_unlock_irq(&desc->iuspin);
|
||||
if (rv < 0)
|
||||
goto err;
|
||||
goto retry;
|
||||
}
|
||||
cntr = desc->length;
|
||||
spin_unlock_irq(&desc->iuspin);
|
||||
}
|
||||
@@ -839,7 +834,7 @@ static void service_interrupt_work(struct work_struct *work)
|
||||
|
||||
spin_lock_irq(&desc->iuspin);
|
||||
service_outstanding_interrupt(desc);
|
||||
if (!desc->resp_count) {
|
||||
if (!desc->resp_count && (desc->length || desc->rerr)) {
|
||||
set_bit(WDM_READ, &desc->flags);
|
||||
wake_up(&desc->wait);
|
||||
}
|
||||
|
||||
@@ -224,7 +224,8 @@ static const struct usb_device_id usb_quirk_list[] = {
|
||||
{ USB_DEVICE(0x046a, 0x0023), .driver_info = USB_QUIRK_RESET_RESUME },
|
||||
|
||||
/* Logitech HD Webcam C270 */
|
||||
{ USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME },
|
||||
{ USB_DEVICE(0x046d, 0x0825), .driver_info = USB_QUIRK_RESET_RESUME |
|
||||
USB_QUIRK_NO_LPM},
|
||||
|
||||
/* Logitech HD Pro Webcams C920, C920-C, C922, C925e and C930e */
|
||||
{ USB_DEVICE(0x046d, 0x082d), .driver_info = USB_QUIRK_DELAY_INIT },
|
||||
|
||||
@@ -697,15 +697,16 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
|
||||
dev_set_name(&dev->dev, "usb%d", bus->busnum);
|
||||
root_hub = 1;
|
||||
} else {
|
||||
int n;
|
||||
|
||||
/* match any labeling on the hubs; it's one-based */
|
||||
if (parent->devpath[0] == '0') {
|
||||
snprintf(dev->devpath, sizeof dev->devpath,
|
||||
"%d", port1);
|
||||
n = snprintf(dev->devpath, sizeof(dev->devpath), "%d", port1);
|
||||
/* Root ports are not counted in route string */
|
||||
dev->route = 0;
|
||||
} else {
|
||||
snprintf(dev->devpath, sizeof dev->devpath,
|
||||
"%s.%d", parent->devpath, port1);
|
||||
n = snprintf(dev->devpath, sizeof(dev->devpath), "%s.%d",
|
||||
parent->devpath, port1);
|
||||
/* Route string assumes hubs have less than 16 ports */
|
||||
if (port1 < 15)
|
||||
dev->route = parent->route +
|
||||
@@ -714,6 +715,11 @@ struct usb_device *usb_alloc_dev(struct usb_device *parent,
|
||||
dev->route = parent->route +
|
||||
(15 << ((parent->level - 1)*4));
|
||||
}
|
||||
if (n >= sizeof(dev->devpath)) {
|
||||
usb_put_hcd(bus_to_hcd(bus));
|
||||
usb_put_dev(dev);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
dev->dev.parent = &parent->dev;
|
||||
dev_set_name(&dev->dev, "%d-%s", bus->busnum, dev->devpath);
|
||||
|
||||
@@ -1333,14 +1333,14 @@ static struct se_portal_group *usbg_make_tpg(struct se_wwn *wwn,
|
||||
struct usbg_tport *tport = container_of(wwn, struct usbg_tport,
|
||||
tport_wwn);
|
||||
struct usbg_tpg *tpg;
|
||||
unsigned long tpgt;
|
||||
u16 tpgt;
|
||||
int ret;
|
||||
struct f_tcm_opts *opts;
|
||||
unsigned i;
|
||||
|
||||
if (strstr(name, "tpgt_") != name)
|
||||
return ERR_PTR(-EINVAL);
|
||||
if (kstrtoul(name + 5, 0, &tpgt) || tpgt > UINT_MAX)
|
||||
if (kstrtou16(name + 5, 0, &tpgt))
|
||||
return ERR_PTR(-EINVAL);
|
||||
ret = -ENODEV;
|
||||
mutex_lock(&tpg_instances_lock);
|
||||
|
||||
@@ -286,8 +286,8 @@ __acquires(&port->port_lock)
|
||||
break;
|
||||
}
|
||||
|
||||
if (do_tty_wake && port->port.tty)
|
||||
tty_wakeup(port->port.tty);
|
||||
if (do_tty_wake)
|
||||
tty_port_tty_wakeup(&port->port);
|
||||
return status;
|
||||
}
|
||||
|
||||
@@ -571,7 +571,7 @@ static int gs_start_io(struct gs_port *port)
|
||||
gs_start_tx(port);
|
||||
/* Unblock any pending writes into our circular buffer, in case
|
||||
* we didn't in gs_start_tx() */
|
||||
tty_wakeup(port->port.tty);
|
||||
tty_port_tty_wakeup(&port->port);
|
||||
} else {
|
||||
/* Free reqs only if we are still connected */
|
||||
if (port->port_usb) {
|
||||
|
||||
@@ -288,6 +288,9 @@ static int dp_altmode_vdm(struct typec_altmode *alt,
|
||||
break;
|
||||
case CMDT_RSP_NAK:
|
||||
switch (cmd) {
|
||||
case DP_CMD_STATUS_UPDATE:
|
||||
dp->state = DP_STATE_EXIT;
|
||||
break;
|
||||
case DP_CMD_CONFIGURE:
|
||||
dp->data.conf = 0;
|
||||
ret = dp_altmode_configured(dp);
|
||||
@@ -488,7 +491,7 @@ static ssize_t pin_assignment_show(struct device *dev,
|
||||
|
||||
assignments = get_current_pin_assignments(dp);
|
||||
|
||||
for (i = 0; assignments; assignments >>= 1, i++) {
|
||||
for (i = 0; assignments && i < DP_PIN_ASSIGN_MAX; assignments >>= 1, i++) {
|
||||
if (assignments & 1) {
|
||||
if (i == cur)
|
||||
len += sprintf(buf + len, "[%s] ",
|
||||
|
||||
@@ -4524,7 +4524,6 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
int err = 0;
|
||||
struct btrfs_root *root = BTRFS_I(dir)->root;
|
||||
struct btrfs_trans_handle *trans;
|
||||
u64 last_unlink_trans;
|
||||
|
||||
if (inode->i_size > BTRFS_EMPTY_DIR_SIZE)
|
||||
return -ENOTEMPTY;
|
||||
@@ -4535,6 +4534,23 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
if (IS_ERR(trans))
|
||||
return PTR_ERR(trans);
|
||||
|
||||
/*
|
||||
* Propagate the last_unlink_trans value of the deleted dir to its
|
||||
* parent directory. This is to prevent an unrecoverable log tree in the
|
||||
* case we do something like this:
|
||||
* 1) create dir foo
|
||||
* 2) create snapshot under dir foo
|
||||
* 3) delete the snapshot
|
||||
* 4) rmdir foo
|
||||
* 5) mkdir foo
|
||||
* 6) fsync foo or some file inside foo
|
||||
*
|
||||
* This is because we can't unlink other roots when replaying the dir
|
||||
* deletes for directory foo.
|
||||
*/
|
||||
if (BTRFS_I(inode)->last_unlink_trans >= trans->transid)
|
||||
btrfs_record_snapshot_destroy(trans, BTRFS_I(dir));
|
||||
|
||||
if (unlikely(btrfs_ino(BTRFS_I(inode)) == BTRFS_EMPTY_SUBVOL_DIR_OBJECTID)) {
|
||||
err = btrfs_unlink_subvol(trans, dir, dentry);
|
||||
goto out;
|
||||
@@ -4544,28 +4560,12 @@ static int btrfs_rmdir(struct inode *dir, struct dentry *dentry)
|
||||
if (err)
|
||||
goto out;
|
||||
|
||||
last_unlink_trans = BTRFS_I(inode)->last_unlink_trans;
|
||||
|
||||
/* now the directory is empty */
|
||||
err = btrfs_unlink_inode(trans, root, BTRFS_I(dir),
|
||||
BTRFS_I(d_inode(dentry)), dentry->d_name.name,
|
||||
dentry->d_name.len);
|
||||
if (!err) {
|
||||
if (!err)
|
||||
btrfs_i_size_write(BTRFS_I(inode), 0);
|
||||
/*
|
||||
* Propagate the last_unlink_trans value of the deleted dir to
|
||||
* its parent directory. This is to prevent an unrecoverable
|
||||
* log tree in the case we do something like this:
|
||||
* 1) create dir foo
|
||||
* 2) create snapshot under dir foo
|
||||
* 3) delete the snapshot
|
||||
* 4) rmdir foo
|
||||
* 5) mkdir foo
|
||||
* 6) fsync foo or some file inside foo
|
||||
*/
|
||||
if (last_unlink_trans >= trans->transid)
|
||||
BTRFS_I(dir)->last_unlink_trans = last_unlink_trans;
|
||||
}
|
||||
out:
|
||||
btrfs_end_transaction(trans);
|
||||
btrfs_btree_balance_dirty(root->fs_info);
|
||||
|
||||
@@ -783,6 +783,9 @@ static int create_snapshot(struct btrfs_root *root, struct inode *dir,
|
||||
if (!test_bit(BTRFS_ROOT_REF_COWS, &root->state))
|
||||
return -EINVAL;
|
||||
|
||||
if (btrfs_root_refs(&root->root_item) == 0)
|
||||
return -ENOENT;
|
||||
|
||||
pending_snapshot = kzalloc(sizeof(*pending_snapshot), GFP_KERNEL);
|
||||
if (!pending_snapshot)
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -1015,7 +1015,9 @@ again:
|
||||
search_key.type = BTRFS_INODE_REF_KEY;
|
||||
search_key.offset = parent_objectid;
|
||||
ret = btrfs_search_slot(NULL, root, &search_key, path, 0, 0);
|
||||
if (ret == 0) {
|
||||
if (ret < 0) {
|
||||
return ret;
|
||||
} else if (ret == 0) {
|
||||
struct btrfs_inode_ref *victim_ref;
|
||||
unsigned long ptr;
|
||||
unsigned long ptr_end;
|
||||
|
||||
@@ -1702,7 +1702,7 @@ static int ceph_zero_objects(struct inode *inode, loff_t offset, loff_t length)
|
||||
s32 stripe_unit = ci->i_layout.stripe_unit;
|
||||
s32 stripe_count = ci->i_layout.stripe_count;
|
||||
s32 object_size = ci->i_layout.object_size;
|
||||
u64 object_set_size = object_size * stripe_count;
|
||||
u64 object_set_size = (u64) object_size * stripe_count;
|
||||
u64 nearly, t;
|
||||
|
||||
/* round offset up to next period boundary */
|
||||
|
||||
@@ -295,6 +295,14 @@ check_smb_hdr(struct smb_hdr *smb)
|
||||
if (smb->Command == SMB_COM_LOCKING_ANDX)
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Windows NT server returns error resposne (e.g. STATUS_DELETE_PENDING
|
||||
* or STATUS_OBJECT_NAME_NOT_FOUND or ERRDOS/ERRbadfile or any other)
|
||||
* for some TRANS2 requests without the RESPONSE flag set in header.
|
||||
*/
|
||||
if (smb->Command == SMB_COM_TRANSACTION2 && smb->Status.CifsError != 0)
|
||||
return 0;
|
||||
|
||||
cifs_dbg(VFS, "Server sent request, not response. mid=%u\n",
|
||||
get_mid(smb));
|
||||
return 1;
|
||||
|
||||
@@ -191,45 +191,30 @@ int dbMount(struct inode *ipbmap)
|
||||
dbmp_le = (struct dbmap_disk *) mp->data;
|
||||
bmp->db_mapsize = le64_to_cpu(dbmp_le->dn_mapsize);
|
||||
bmp->db_nfree = le64_to_cpu(dbmp_le->dn_nfree);
|
||||
|
||||
bmp->db_l2nbperpage = le32_to_cpu(dbmp_le->dn_l2nbperpage);
|
||||
if (bmp->db_l2nbperpage > L2PSIZE - L2MINBLOCKSIZE ||
|
||||
bmp->db_l2nbperpage < 0) {
|
||||
err = -EINVAL;
|
||||
goto err_release_metapage;
|
||||
}
|
||||
|
||||
bmp->db_numag = le32_to_cpu(dbmp_le->dn_numag);
|
||||
if (!bmp->db_numag || bmp->db_numag > MAXAG) {
|
||||
err = -EINVAL;
|
||||
goto err_release_metapage;
|
||||
}
|
||||
|
||||
bmp->db_maxlevel = le32_to_cpu(dbmp_le->dn_maxlevel);
|
||||
bmp->db_maxag = le32_to_cpu(dbmp_le->dn_maxag);
|
||||
bmp->db_agpref = le32_to_cpu(dbmp_le->dn_agpref);
|
||||
if (bmp->db_maxag >= MAXAG || bmp->db_maxag < 0 ||
|
||||
bmp->db_agpref >= MAXAG || bmp->db_agpref < 0) {
|
||||
err = -EINVAL;
|
||||
goto err_release_metapage;
|
||||
}
|
||||
|
||||
bmp->db_aglevel = le32_to_cpu(dbmp_le->dn_aglevel);
|
||||
bmp->db_agheight = le32_to_cpu(dbmp_le->dn_agheight);
|
||||
bmp->db_agwidth = le32_to_cpu(dbmp_le->dn_agwidth);
|
||||
if (!bmp->db_agwidth) {
|
||||
err = -EINVAL;
|
||||
goto err_release_metapage;
|
||||
}
|
||||
bmp->db_agstart = le32_to_cpu(dbmp_le->dn_agstart);
|
||||
bmp->db_agl2size = le32_to_cpu(dbmp_le->dn_agl2size);
|
||||
if (bmp->db_agl2size > L2MAXL2SIZE - L2MAXAG ||
|
||||
bmp->db_agl2size < 0) {
|
||||
err = -EINVAL;
|
||||
goto err_release_metapage;
|
||||
}
|
||||
|
||||
if (((bmp->db_mapsize - 1) >> bmp->db_agl2size) > MAXAG) {
|
||||
if ((bmp->db_l2nbperpage > L2PSIZE - L2MINBLOCKSIZE) ||
|
||||
(bmp->db_l2nbperpage < 0) ||
|
||||
!bmp->db_numag || (bmp->db_numag > MAXAG) ||
|
||||
(bmp->db_maxag >= MAXAG) || (bmp->db_maxag < 0) ||
|
||||
(bmp->db_agpref >= MAXAG) || (bmp->db_agpref < 0) ||
|
||||
(bmp->db_agheight < 0) || (bmp->db_agheight > (L2LPERCTL >> 1)) ||
|
||||
(bmp->db_agwidth < 1) || (bmp->db_agwidth > (LPERCTL / MAXAG)) ||
|
||||
(bmp->db_agwidth > (1 << (L2LPERCTL - (bmp->db_agheight << 1)))) ||
|
||||
(bmp->db_agstart < 0) ||
|
||||
(bmp->db_agstart > (CTLTREESIZE - 1 - bmp->db_agwidth * (MAXAG - 1))) ||
|
||||
(bmp->db_agl2size > L2MAXL2SIZE - L2MAXAG) ||
|
||||
(bmp->db_agl2size < 0) ||
|
||||
((bmp->db_mapsize - 1) >> bmp->db_agl2size) > MAXAG) {
|
||||
err = -EINVAL;
|
||||
goto err_release_metapage;
|
||||
}
|
||||
|
||||
@@ -195,7 +195,9 @@ enum ovl_path_type ovl_path_real(struct dentry *dentry, struct path *path)
|
||||
|
||||
struct dentry *ovl_dentry_upper(struct dentry *dentry)
|
||||
{
|
||||
return ovl_upperdentry_dereference(OVL_I(d_inode(dentry)));
|
||||
struct inode *inode = d_inode(dentry);
|
||||
|
||||
return inode ? ovl_upperdentry_dereference(OVL_I(inode)) : NULL;
|
||||
}
|
||||
|
||||
struct dentry *ovl_dentry_lower(struct dentry *dentry)
|
||||
|
||||
@@ -34,21 +34,27 @@ static void proc_evict_inode(struct inode *inode)
|
||||
{
|
||||
struct proc_dir_entry *de;
|
||||
struct ctl_table_header *head;
|
||||
struct proc_inode *ei = PROC_I(inode);
|
||||
|
||||
truncate_inode_pages_final(&inode->i_data);
|
||||
clear_inode(inode);
|
||||
|
||||
/* Stop tracking associated processes */
|
||||
put_pid(PROC_I(inode)->pid);
|
||||
if (ei->pid) {
|
||||
put_pid(ei->pid);
|
||||
ei->pid = NULL;
|
||||
}
|
||||
|
||||
/* Let go of any associated proc directory entry */
|
||||
de = PDE(inode);
|
||||
if (de)
|
||||
de = ei->pde;
|
||||
if (de) {
|
||||
pde_put(de);
|
||||
ei->pde = NULL;
|
||||
}
|
||||
|
||||
head = PROC_I(inode)->sysctl;
|
||||
head = ei->sysctl;
|
||||
if (head) {
|
||||
RCU_INIT_POINTER(PROC_I(inode)->sysctl, NULL);
|
||||
WRITE_ONCE(ei->sysctl, NULL);
|
||||
proc_sys_evict_inode(inode, head);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -907,17 +907,21 @@ static int proc_sys_compare(const struct dentry *dentry,
|
||||
struct ctl_table_header *head;
|
||||
struct inode *inode;
|
||||
|
||||
/* Although proc doesn't have negative dentries, rcu-walk means
|
||||
* that inode here can be NULL */
|
||||
/* AV: can it, indeed? */
|
||||
inode = d_inode_rcu(dentry);
|
||||
if (!inode)
|
||||
return 1;
|
||||
if (name->len != len)
|
||||
return 1;
|
||||
if (memcmp(name->name, str, len))
|
||||
return 1;
|
||||
head = rcu_dereference(PROC_I(inode)->sysctl);
|
||||
|
||||
// false positive is fine here - we'll recheck anyway
|
||||
if (d_in_lookup(dentry))
|
||||
return 0;
|
||||
|
||||
inode = d_inode_rcu(dentry);
|
||||
// we just might have run into dentry in the middle of __dentry_kill()
|
||||
if (!inode)
|
||||
return 1;
|
||||
|
||||
head = READ_ONCE(PROC_I(inode)->sysctl);
|
||||
return !head || !sysctl_is_seen(head);
|
||||
}
|
||||
|
||||
|
||||
@@ -70,9 +70,11 @@ static inline bool spsc_queue_push(struct spsc_queue *queue, struct spsc_node *n
|
||||
|
||||
preempt_disable();
|
||||
|
||||
atomic_inc(&queue->job_count);
|
||||
smp_mb__after_atomic();
|
||||
|
||||
tail = (struct spsc_node **)atomic_long_xchg(&queue->tail, (long)&node->next);
|
||||
WRITE_ONCE(*tail, node);
|
||||
atomic_inc(&queue->job_count);
|
||||
|
||||
/*
|
||||
* In case of first element verify new node will be visible to the consumer
|
||||
|
||||
@@ -51,6 +51,7 @@ enum {
|
||||
DP_PIN_ASSIGN_D,
|
||||
DP_PIN_ASSIGN_E,
|
||||
DP_PIN_ASSIGN_F, /* Not supported after v1.0b */
|
||||
DP_PIN_ASSIGN_MAX,
|
||||
};
|
||||
|
||||
/* DisplayPort alt mode specific commands */
|
||||
|
||||
@@ -17,6 +17,10 @@
|
||||
#ifndef _UAPI_VM_SOCKETS_H
|
||||
#define _UAPI_VM_SOCKETS_H
|
||||
|
||||
#ifndef __KERNEL__
|
||||
#include <sys/socket.h> /* for struct sockaddr and sa_family_t */
|
||||
#endif
|
||||
|
||||
#include <linux/socket.h>
|
||||
|
||||
/* Option name for STREAM socket buffer size. Use as the option name in
|
||||
|
||||
@@ -1 +1 @@
|
||||
-st6
|
||||
-st7
|
||||
|
||||
@@ -567,6 +567,7 @@ static int atrtr_create(struct rtentry *r, struct net_device *devhint)
|
||||
|
||||
/* Fill in the routing entry */
|
||||
rt->target = ta->sat_addr;
|
||||
dev_put(rt->dev); /* Release old device */
|
||||
dev_hold(devhint);
|
||||
rt->dev = devhint;
|
||||
rt->flags = r->rt_flags;
|
||||
|
||||
@@ -44,7 +44,8 @@
|
||||
#include <net/atmclip.h>
|
||||
|
||||
static struct net_device *clip_devs;
|
||||
static struct atm_vcc *atmarpd;
|
||||
static struct atm_vcc __rcu *atmarpd;
|
||||
static DEFINE_MUTEX(atmarpd_lock);
|
||||
static struct timer_list idle_timer;
|
||||
static const struct neigh_ops clip_neigh_ops;
|
||||
|
||||
@@ -52,24 +53,35 @@ static int to_atmarpd(enum atmarp_ctrl_type type, int itf, __be32 ip)
|
||||
{
|
||||
struct sock *sk;
|
||||
struct atmarp_ctrl *ctrl;
|
||||
struct atm_vcc *vcc;
|
||||
struct sk_buff *skb;
|
||||
int err = 0;
|
||||
|
||||
pr_debug("(%d)\n", type);
|
||||
if (!atmarpd)
|
||||
return -EUNATCH;
|
||||
|
||||
rcu_read_lock();
|
||||
vcc = rcu_dereference(atmarpd);
|
||||
if (!vcc) {
|
||||
err = -EUNATCH;
|
||||
goto unlock;
|
||||
}
|
||||
skb = alloc_skb(sizeof(struct atmarp_ctrl), GFP_ATOMIC);
|
||||
if (!skb)
|
||||
return -ENOMEM;
|
||||
if (!skb) {
|
||||
err = -ENOMEM;
|
||||
goto unlock;
|
||||
}
|
||||
ctrl = skb_put(skb, sizeof(struct atmarp_ctrl));
|
||||
ctrl->type = type;
|
||||
ctrl->itf_num = itf;
|
||||
ctrl->ip = ip;
|
||||
atm_force_charge(atmarpd, skb->truesize);
|
||||
atm_force_charge(vcc, skb->truesize);
|
||||
|
||||
sk = sk_atm(atmarpd);
|
||||
sk = sk_atm(vcc);
|
||||
skb_queue_tail(&sk->sk_receive_queue, skb);
|
||||
sk->sk_data_ready(sk);
|
||||
return 0;
|
||||
unlock:
|
||||
rcu_read_unlock();
|
||||
return err;
|
||||
}
|
||||
|
||||
static void link_vcc(struct clip_vcc *clip_vcc, struct atmarp_entry *entry)
|
||||
@@ -417,6 +429,8 @@ static int clip_mkip(struct atm_vcc *vcc, int timeout)
|
||||
|
||||
if (!vcc->push)
|
||||
return -EBADFD;
|
||||
if (vcc->user_back)
|
||||
return -EINVAL;
|
||||
clip_vcc = kmalloc(sizeof(struct clip_vcc), GFP_KERNEL);
|
||||
if (!clip_vcc)
|
||||
return -ENOMEM;
|
||||
@@ -607,17 +621,27 @@ static void atmarpd_close(struct atm_vcc *vcc)
|
||||
{
|
||||
pr_debug("\n");
|
||||
|
||||
rtnl_lock();
|
||||
atmarpd = NULL;
|
||||
mutex_lock(&atmarpd_lock);
|
||||
RCU_INIT_POINTER(atmarpd, NULL);
|
||||
mutex_unlock(&atmarpd_lock);
|
||||
|
||||
synchronize_rcu();
|
||||
skb_queue_purge(&sk_atm(vcc)->sk_receive_queue);
|
||||
rtnl_unlock();
|
||||
|
||||
pr_debug("(done)\n");
|
||||
module_put(THIS_MODULE);
|
||||
}
|
||||
|
||||
static int atmarpd_send(struct atm_vcc *vcc, struct sk_buff *skb)
|
||||
{
|
||||
atm_return_tx(vcc, skb);
|
||||
dev_kfree_skb_any(skb);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static const struct atmdev_ops atmarpd_dev_ops = {
|
||||
.close = atmarpd_close
|
||||
.close = atmarpd_close,
|
||||
.send = atmarpd_send
|
||||
};
|
||||
|
||||
|
||||
@@ -631,15 +655,18 @@ static struct atm_dev atmarpd_dev = {
|
||||
|
||||
static int atm_init_atmarp(struct atm_vcc *vcc)
|
||||
{
|
||||
rtnl_lock();
|
||||
if (vcc->push == clip_push)
|
||||
return -EINVAL;
|
||||
|
||||
mutex_lock(&atmarpd_lock);
|
||||
if (atmarpd) {
|
||||
rtnl_unlock();
|
||||
mutex_unlock(&atmarpd_lock);
|
||||
return -EADDRINUSE;
|
||||
}
|
||||
|
||||
mod_timer(&idle_timer, jiffies + CLIP_CHECK_INTERVAL * HZ);
|
||||
|
||||
atmarpd = vcc;
|
||||
rcu_assign_pointer(atmarpd, vcc);
|
||||
set_bit(ATM_VF_META, &vcc->flags);
|
||||
set_bit(ATM_VF_READY, &vcc->flags);
|
||||
/* allow replies and avoid getting closed if signaling dies */
|
||||
@@ -648,13 +675,14 @@ static int atm_init_atmarp(struct atm_vcc *vcc)
|
||||
vcc->push = NULL;
|
||||
vcc->pop = NULL; /* crash */
|
||||
vcc->push_oam = NULL; /* crash */
|
||||
rtnl_unlock();
|
||||
mutex_unlock(&atmarpd_lock);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int clip_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||
{
|
||||
struct atm_vcc *vcc = ATM_SD(sock);
|
||||
struct sock *sk = sock->sk;
|
||||
int err = 0;
|
||||
|
||||
switch (cmd) {
|
||||
@@ -675,14 +703,18 @@ static int clip_ioctl(struct socket *sock, unsigned int cmd, unsigned long arg)
|
||||
err = clip_create(arg);
|
||||
break;
|
||||
case ATMARPD_CTRL:
|
||||
lock_sock(sk);
|
||||
err = atm_init_atmarp(vcc);
|
||||
if (!err) {
|
||||
sock->state = SS_CONNECTED;
|
||||
__module_get(THIS_MODULE);
|
||||
}
|
||||
release_sock(sk);
|
||||
break;
|
||||
case ATMARP_MKIP:
|
||||
lock_sock(sk);
|
||||
err = clip_mkip(vcc, arg);
|
||||
release_sock(sk);
|
||||
break;
|
||||
case ATMARP_SETENTRY:
|
||||
err = clip_setentry(vcc, (__force __be32)arg);
|
||||
|
||||
@@ -148,11 +148,10 @@ void atm_dev_deregister(struct atm_dev *dev)
|
||||
*/
|
||||
mutex_lock(&atm_dev_mutex);
|
||||
list_del(&dev->dev_list);
|
||||
mutex_unlock(&atm_dev_mutex);
|
||||
|
||||
atm_dev_release_vccs(dev);
|
||||
atm_unregister_sysfs(dev);
|
||||
atm_proc_dev_deregister(dev);
|
||||
mutex_unlock(&atm_dev_mutex);
|
||||
|
||||
atm_dev_put(dev);
|
||||
}
|
||||
|
||||
@@ -3364,7 +3364,7 @@ static int l2cap_parse_conf_req(struct l2cap_chan *chan, void *data, size_t data
|
||||
struct l2cap_conf_rfc rfc = { .mode = L2CAP_MODE_BASIC };
|
||||
struct l2cap_conf_efs efs;
|
||||
u8 remote_efs = 0;
|
||||
u16 mtu = L2CAP_DEFAULT_MTU;
|
||||
u16 mtu = 0;
|
||||
u16 result = L2CAP_CONF_SUCCESS;
|
||||
u16 size;
|
||||
|
||||
@@ -3475,6 +3475,13 @@ done:
|
||||
/* Configure output options and let the other side know
|
||||
* which ones we don't like. */
|
||||
|
||||
/* If MTU is not provided in configure request, use the most recently
|
||||
* explicitly or implicitly accepted value for the other direction,
|
||||
* or the default value.
|
||||
*/
|
||||
if (mtu == 0)
|
||||
mtu = chan->imtu ? chan->imtu : L2CAP_DEFAULT_MTU;
|
||||
|
||||
if (mtu < L2CAP_DEFAULT_MIN_MTU)
|
||||
result = L2CAP_CONF_UNACCEPT;
|
||||
else {
|
||||
|
||||
@@ -2393,7 +2393,8 @@ static void __ip6_rt_update_pmtu(struct dst_entry *dst, const struct sock *sk,
|
||||
if (confirm_neigh)
|
||||
dst_confirm_neigh(dst, daddr);
|
||||
|
||||
mtu = max_t(u32, mtu, IPV6_MIN_MTU);
|
||||
if (mtu < IPV6_MIN_MTU)
|
||||
return;
|
||||
if (mtu >= dst_mtu(dst))
|
||||
return;
|
||||
|
||||
|
||||
@@ -3904,6 +3904,10 @@ static bool ieee80211_accept_frame(struct ieee80211_rx_data *rx)
|
||||
if (!multicast &&
|
||||
!ether_addr_equal(sdata->dev->dev_addr, hdr->addr1))
|
||||
return false;
|
||||
/* reject invalid/our STA address */
|
||||
if (!is_valid_ether_addr(hdr->addr2) ||
|
||||
ether_addr_equal(sdata->dev->dev_addr, hdr->addr2))
|
||||
return false;
|
||||
if (!rx->sta) {
|
||||
int rate_idx;
|
||||
if (status->encoding != RX_ENC_LEGACY)
|
||||
|
||||
@@ -3436,7 +3436,7 @@ void ieee80211_recalc_dtim(struct ieee80211_local *local,
|
||||
{
|
||||
u64 tsf = drv_get_tsf(local, sdata);
|
||||
u64 dtim_count = 0;
|
||||
u16 beacon_int = sdata->vif.bss_conf.beacon_int * 1024;
|
||||
u32 beacon_int = sdata->vif.bss_conf.beacon_int * 1024;
|
||||
u8 dtim_period = sdata->vif.bss_conf.dtim_period;
|
||||
struct ps_data *ps;
|
||||
u8 bcns_from_dtim;
|
||||
|
||||
@@ -387,7 +387,6 @@ static void netlink_skb_set_owner_r(struct sk_buff *skb, struct sock *sk)
|
||||
WARN_ON(skb->sk != NULL);
|
||||
skb->sk = sk;
|
||||
skb->destructor = netlink_skb_destructor;
|
||||
atomic_add(skb->truesize, &sk->sk_rmem_alloc);
|
||||
sk_mem_charge(sk, skb->truesize);
|
||||
}
|
||||
|
||||
@@ -1216,41 +1215,48 @@ static struct sk_buff *netlink_alloc_large_skb(unsigned int size,
|
||||
int netlink_attachskb(struct sock *sk, struct sk_buff *skb,
|
||||
long *timeo, struct sock *ssk)
|
||||
{
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
struct netlink_sock *nlk;
|
||||
unsigned int rmem;
|
||||
|
||||
nlk = nlk_sk(sk);
|
||||
rmem = atomic_add_return(skb->truesize, &sk->sk_rmem_alloc);
|
||||
|
||||
if ((atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
|
||||
test_bit(NETLINK_S_CONGESTED, &nlk->state))) {
|
||||
DECLARE_WAITQUEUE(wait, current);
|
||||
if (!*timeo) {
|
||||
if (!ssk || netlink_is_kernel(ssk))
|
||||
netlink_overrun(sk);
|
||||
sock_put(sk);
|
||||
kfree_skb(skb);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
__set_current_state(TASK_INTERRUPTIBLE);
|
||||
add_wait_queue(&nlk->wait, &wait);
|
||||
|
||||
if ((atomic_read(&sk->sk_rmem_alloc) > sk->sk_rcvbuf ||
|
||||
test_bit(NETLINK_S_CONGESTED, &nlk->state)) &&
|
||||
!sock_flag(sk, SOCK_DEAD))
|
||||
*timeo = schedule_timeout(*timeo);
|
||||
|
||||
__set_current_state(TASK_RUNNING);
|
||||
remove_wait_queue(&nlk->wait, &wait);
|
||||
sock_put(sk);
|
||||
|
||||
if (signal_pending(current)) {
|
||||
kfree_skb(skb);
|
||||
return sock_intr_errno(*timeo);
|
||||
}
|
||||
return 1;
|
||||
if ((rmem == skb->truesize || rmem < READ_ONCE(sk->sk_rcvbuf)) &&
|
||||
!test_bit(NETLINK_S_CONGESTED, &nlk->state)) {
|
||||
netlink_skb_set_owner_r(skb, sk);
|
||||
return 0;
|
||||
}
|
||||
netlink_skb_set_owner_r(skb, sk);
|
||||
return 0;
|
||||
|
||||
atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
|
||||
|
||||
if (!*timeo) {
|
||||
if (!ssk || netlink_is_kernel(ssk))
|
||||
netlink_overrun(sk);
|
||||
sock_put(sk);
|
||||
kfree_skb(skb);
|
||||
return -EAGAIN;
|
||||
}
|
||||
|
||||
__set_current_state(TASK_INTERRUPTIBLE);
|
||||
add_wait_queue(&nlk->wait, &wait);
|
||||
rmem = atomic_read(&sk->sk_rmem_alloc);
|
||||
|
||||
if (((rmem && rmem + skb->truesize > READ_ONCE(sk->sk_rcvbuf)) ||
|
||||
test_bit(NETLINK_S_CONGESTED, &nlk->state)) &&
|
||||
!sock_flag(sk, SOCK_DEAD))
|
||||
*timeo = schedule_timeout(*timeo);
|
||||
|
||||
__set_current_state(TASK_RUNNING);
|
||||
remove_wait_queue(&nlk->wait, &wait);
|
||||
sock_put(sk);
|
||||
|
||||
if (signal_pending(current)) {
|
||||
kfree_skb(skb);
|
||||
return sock_intr_errno(*timeo);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
static int __netlink_sendskb(struct sock *sk, struct sk_buff *skb)
|
||||
@@ -1310,6 +1316,7 @@ static int netlink_unicast_kernel(struct sock *sk, struct sk_buff *skb,
|
||||
ret = -ECONNREFUSED;
|
||||
if (nlk->netlink_rcv != NULL) {
|
||||
ret = skb->len;
|
||||
atomic_add(skb->truesize, &sk->sk_rmem_alloc);
|
||||
netlink_skb_set_owner_r(skb, sk);
|
||||
NETLINK_CB(skb).sk = ssk;
|
||||
netlink_deliver_tap_kernel(sk, ssk, skb);
|
||||
@@ -1380,13 +1387,19 @@ EXPORT_SYMBOL_GPL(netlink_has_listeners);
|
||||
static int netlink_broadcast_deliver(struct sock *sk, struct sk_buff *skb)
|
||||
{
|
||||
struct netlink_sock *nlk = nlk_sk(sk);
|
||||
unsigned int rmem, rcvbuf;
|
||||
|
||||
if (atomic_read(&sk->sk_rmem_alloc) <= sk->sk_rcvbuf &&
|
||||
rmem = atomic_add_return(skb->truesize, &sk->sk_rmem_alloc);
|
||||
rcvbuf = READ_ONCE(sk->sk_rcvbuf);
|
||||
|
||||
if ((rmem == skb->truesize || rmem <= rcvbuf) &&
|
||||
!test_bit(NETLINK_S_CONGESTED, &nlk->state)) {
|
||||
netlink_skb_set_owner_r(skb, sk);
|
||||
__netlink_sendskb(sk, skb);
|
||||
return atomic_read(&sk->sk_rmem_alloc) > (sk->sk_rcvbuf >> 1);
|
||||
return rmem > (rcvbuf >> 1);
|
||||
}
|
||||
|
||||
atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@@ -2164,6 +2177,7 @@ static int netlink_dump(struct sock *sk)
|
||||
struct netlink_sock *nlk = nlk_sk(sk);
|
||||
struct netlink_callback *cb;
|
||||
struct sk_buff *skb = NULL;
|
||||
unsigned int rmem, rcvbuf;
|
||||
struct nlmsghdr *nlh;
|
||||
struct module *module;
|
||||
int err = -ENOBUFS;
|
||||
@@ -2176,9 +2190,6 @@ static int netlink_dump(struct sock *sk)
|
||||
goto errout_skb;
|
||||
}
|
||||
|
||||
if (atomic_read(&sk->sk_rmem_alloc) >= sk->sk_rcvbuf)
|
||||
goto errout_skb;
|
||||
|
||||
/* NLMSG_GOODSIZE is small to avoid high order allocations being
|
||||
* required, but it makes sense to _attempt_ a 16K bytes allocation
|
||||
* to reduce number of system calls on dump operations, if user
|
||||
@@ -2200,6 +2211,13 @@ static int netlink_dump(struct sock *sk)
|
||||
if (!skb)
|
||||
goto errout_skb;
|
||||
|
||||
rcvbuf = READ_ONCE(sk->sk_rcvbuf);
|
||||
rmem = atomic_add_return(skb->truesize, &sk->sk_rmem_alloc);
|
||||
if (rmem != skb->truesize && rmem >= rcvbuf) {
|
||||
atomic_sub(skb->truesize, &sk->sk_rmem_alloc);
|
||||
goto errout_skb;
|
||||
}
|
||||
|
||||
/* Trim skb to allocated size. User is expected to provide buffer as
|
||||
* large as max(min_dump_alloc, 16KiB (mac_recvmsg_len capped at
|
||||
* netlink_recvmsg())). dump will pack as many smaller messages as
|
||||
|
||||
@@ -350,6 +350,7 @@ static int rose_del_node(struct rose_route_struct *rose_route,
|
||||
case 1:
|
||||
rose_node->neighbour[1] =
|
||||
rose_node->neighbour[2];
|
||||
break;
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
@@ -499,21 +500,15 @@ void rose_rt_device_down(struct net_device *dev)
|
||||
t = rose_node;
|
||||
rose_node = rose_node->next;
|
||||
|
||||
for (i = 0; i < t->count; i++) {
|
||||
for (i = t->count - 1; i >= 0; i--) {
|
||||
if (t->neighbour[i] != s)
|
||||
continue;
|
||||
|
||||
t->count--;
|
||||
|
||||
switch (i) {
|
||||
case 0:
|
||||
t->neighbour[0] = t->neighbour[1];
|
||||
/* fall through */
|
||||
case 1:
|
||||
t->neighbour[1] = t->neighbour[2];
|
||||
case 2:
|
||||
break;
|
||||
}
|
||||
memmove(&t->neighbour[i], &t->neighbour[i + 1],
|
||||
sizeof(t->neighbour[0]) *
|
||||
(t->count - i));
|
||||
}
|
||||
|
||||
if (t->count <= 0)
|
||||
|
||||
@@ -267,6 +267,9 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(struct rxrpc_sock *rx,
|
||||
unsigned short call_tail, conn_tail, peer_tail;
|
||||
unsigned short call_count, conn_count;
|
||||
|
||||
if (!b)
|
||||
return NULL;
|
||||
|
||||
/* #calls >= #conns >= #peers must hold true. */
|
||||
call_head = smp_load_acquire(&b->call_backlog_head);
|
||||
call_tail = b->call_backlog_tail;
|
||||
|
||||
@@ -333,20 +333,23 @@ out:
|
||||
return q;
|
||||
}
|
||||
|
||||
static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid)
|
||||
static struct Qdisc *qdisc_leaf(struct Qdisc *p, u32 classid,
|
||||
struct netlink_ext_ack *extack)
|
||||
{
|
||||
unsigned long cl;
|
||||
struct Qdisc *leaf;
|
||||
const struct Qdisc_class_ops *cops = p->ops->cl_ops;
|
||||
|
||||
if (cops == NULL)
|
||||
return NULL;
|
||||
if (cops == NULL) {
|
||||
NL_SET_ERR_MSG(extack, "Parent qdisc is not classful");
|
||||
return ERR_PTR(-EOPNOTSUPP);
|
||||
}
|
||||
cl = cops->find(p, classid);
|
||||
|
||||
if (cl == 0)
|
||||
return NULL;
|
||||
leaf = cops->leaf(p, cl);
|
||||
return leaf;
|
||||
if (cl == 0) {
|
||||
NL_SET_ERR_MSG(extack, "Specified class not found");
|
||||
return ERR_PTR(-ENOENT);
|
||||
}
|
||||
return cops->leaf(p, cl);
|
||||
}
|
||||
|
||||
/* Find queueing discipline by name */
|
||||
@@ -771,15 +774,12 @@ static u32 qdisc_alloc_handle(struct net_device *dev)
|
||||
void qdisc_tree_reduce_backlog(struct Qdisc *sch, unsigned int n,
|
||||
unsigned int len)
|
||||
{
|
||||
bool qdisc_is_offloaded = sch->flags & TCQ_F_OFFLOADED;
|
||||
const struct Qdisc_class_ops *cops;
|
||||
unsigned long cl;
|
||||
u32 parentid;
|
||||
bool notify;
|
||||
int drops;
|
||||
|
||||
if (n == 0 && len == 0)
|
||||
return;
|
||||
drops = max_t(int, n, 0);
|
||||
rcu_read_lock();
|
||||
while ((parentid = sch->parent)) {
|
||||
@@ -788,17 +788,8 @@ void qdisc_tree_reduce_backlog(struct Qdisc *sch, unsigned int n,
|
||||
|
||||
if (sch->flags & TCQ_F_NOPARENT)
|
||||
break;
|
||||
/* Notify parent qdisc only if child qdisc becomes empty.
|
||||
*
|
||||
* If child was empty even before update then backlog
|
||||
* counter is screwed and we skip notification because
|
||||
* parent class is already passive.
|
||||
*
|
||||
* If the original child was offloaded then it is allowed
|
||||
* to be seem as empty, so the parent is notified anyway.
|
||||
*/
|
||||
notify = !sch->q.qlen && !WARN_ON_ONCE(!n &&
|
||||
!qdisc_is_offloaded);
|
||||
/* Notify parent qdisc only if child qdisc becomes empty. */
|
||||
notify = !sch->q.qlen;
|
||||
/* TODO: perform the search on a per txq basis */
|
||||
sch = qdisc_lookup(qdisc_dev(sch), TC_H_MAJ(parentid));
|
||||
if (sch == NULL) {
|
||||
@@ -807,6 +798,9 @@ void qdisc_tree_reduce_backlog(struct Qdisc *sch, unsigned int n,
|
||||
}
|
||||
cops = sch->ops->cl_ops;
|
||||
if (notify && cops->qlen_notify) {
|
||||
/* Note that qlen_notify must be idempotent as it may get called
|
||||
* multiple times.
|
||||
*/
|
||||
cl = cops->find(sch, parentid);
|
||||
cops->qlen_notify(sch, cl);
|
||||
}
|
||||
@@ -1392,7 +1386,7 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
|
||||
NL_SET_ERR_MSG(extack, "Failed to find qdisc with specified classid");
|
||||
return -ENOENT;
|
||||
}
|
||||
q = qdisc_leaf(p, clid);
|
||||
q = qdisc_leaf(p, clid, extack);
|
||||
} else if (dev_ingress_queue(dev)) {
|
||||
q = dev_ingress_queue(dev)->qdisc_sleeping;
|
||||
}
|
||||
@@ -1403,6 +1397,8 @@ static int tc_get_qdisc(struct sk_buff *skb, struct nlmsghdr *n,
|
||||
NL_SET_ERR_MSG(extack, "Cannot find specified qdisc on specified device");
|
||||
return -ENOENT;
|
||||
}
|
||||
if (IS_ERR(q))
|
||||
return PTR_ERR(q);
|
||||
|
||||
if (tcm->tcm_handle && q->handle != tcm->tcm_handle) {
|
||||
NL_SET_ERR_MSG(extack, "Invalid handle");
|
||||
@@ -1499,7 +1495,9 @@ replay:
|
||||
NL_SET_ERR_MSG(extack, "Failed to find specified qdisc");
|
||||
return -ENOENT;
|
||||
}
|
||||
q = qdisc_leaf(p, clid);
|
||||
q = qdisc_leaf(p, clid, extack);
|
||||
if (IS_ERR(q))
|
||||
return PTR_ERR(q);
|
||||
} else if (dev_ingress_queue_create(dev)) {
|
||||
q = dev_ingress_queue(dev)->qdisc_sleeping;
|
||||
}
|
||||
|
||||
@@ -706,8 +706,10 @@ static void tipc_topsrv_stop(struct net *net)
|
||||
for (id = 0; srv->idr_in_use; id++) {
|
||||
con = idr_find(&srv->conn_idr, id);
|
||||
if (con) {
|
||||
conn_get(con);
|
||||
spin_unlock_bh(&srv->idr_lock);
|
||||
tipc_conn_close(con);
|
||||
conn_put(con);
|
||||
spin_lock_bh(&srv->idr_lock);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -133,6 +133,8 @@ vmci_transport_packet_init(struct vmci_transport_packet *pkt,
|
||||
u16 proto,
|
||||
struct vmci_handle handle)
|
||||
{
|
||||
memset(pkt, 0, sizeof(*pkt));
|
||||
|
||||
/* We register the stream control handler as an any cid handle so we
|
||||
* must always send from a source address of VMADDR_CID_ANY
|
||||
*/
|
||||
@@ -145,8 +147,6 @@ vmci_transport_packet_init(struct vmci_transport_packet *pkt,
|
||||
pkt->type = type;
|
||||
pkt->src_port = src->svm_port;
|
||||
pkt->dst_port = dst->svm_port;
|
||||
memset(&pkt->proto, 0, sizeof(pkt->proto));
|
||||
memset(&pkt->_reserved2, 0, sizeof(pkt->_reserved2));
|
||||
|
||||
switch (pkt->type) {
|
||||
case VMCI_TRANSPORT_PACKET_TYPE_INVALID:
|
||||
|
||||
@@ -737,6 +737,10 @@ static int snd_sb16_dma_control_put(struct snd_kcontrol *kcontrol, struct snd_ct
|
||||
change = nval != oval;
|
||||
snd_sb16_set_dma_mode(chip, nval);
|
||||
spin_unlock_irqrestore(&chip->reg_lock, flags);
|
||||
if (change) {
|
||||
snd_dma_disable(chip->dma8);
|
||||
snd_dma_disable(chip->dma16);
|
||||
}
|
||||
return change;
|
||||
}
|
||||
|
||||
|
||||
@@ -43,7 +43,7 @@ static void hda_codec_unsol_event(struct hdac_device *dev, unsigned int ev)
|
||||
struct hda_codec *codec = container_of(dev, struct hda_codec, core);
|
||||
|
||||
/* ignore unsol events during shutdown */
|
||||
if (codec->bus->shutdown)
|
||||
if (codec->card->shutdown || codec->bus->shutdown)
|
||||
return;
|
||||
|
||||
/* ignore unsol events during system suspend/resume */
|
||||
|
||||
@@ -985,6 +985,8 @@ snd_usb_get_audioformat_uac3(struct snd_usb_audio *chip,
|
||||
* and request Cluster Descriptor
|
||||
*/
|
||||
wLength = le16_to_cpu(hc_header.wLength);
|
||||
if (wLength < sizeof(cluster))
|
||||
return NULL;
|
||||
cluster = kzalloc(wLength, GFP_KERNEL);
|
||||
if (!cluster)
|
||||
return ERR_PTR(-ENOMEM);
|
||||
|
||||
Reference in New Issue
Block a user