Merge 4.19.299 into android-4.19-stable
Changes in 4.19.299 vfs: fix readahead(2) on block devices genirq/matrix: Exclude managed interrupts in irq_matrix_allocated() i40e: fix potential memory leaks in i40e_remove() tcp_metrics: add missing barriers on delete tcp_metrics: properly set tp->snd_ssthresh in tcp_init_metrics() tcp_metrics: do not create an entry from tcp_init_metrics() wifi: rtlwifi: fix EDCA limit set by BT coexistence can: dev: move driver related infrastructure into separate subdir can: dev: can_restart(): don't crash kernel if carrier is OK can: dev: can_restart(): fix race condition between controller restart and netif_carrier_on() thermal: core: prevent potential string overflow chtls: fix tp->rcv_tstamp initialization ACPI: sysfs: Fix create_pnp_modalias() and create_of_modalias() ipv6: avoid atomic fragment on GSO packets macsec: Fix traffic counters/statistics macsec: use DEV_STATS_INC() net: add DEV_STATS_READ() helper ipvlan: properly track tx_errors regmap: debugfs: Fix a erroneous check after snprintf() clk: qcom: clk-rcg2: Fix clock rate overflow for high parent frequencies clk: keystone: pll: fix a couple NULL vs IS_ERR() checks clk: npcm7xx: Fix incorrect kfree clk: mediatek: clk-mt6797: Add check for mtk_alloc_clk_data clk: mediatek: clk-mt2701: Add check for mtk_alloc_clk_data platform/x86: wmi: Fix probe failure when failing to register WMI devices platform/x86: wmi: remove unnecessary initializations platform/x86: wmi: Fix opening of char device hwmon: (coretemp) Fix potentially truncated sysfs attribute name drm/rockchip: vop: Fix reset of state in duplicate state crtc funcs drm/radeon: possible buffer overflow drm/rockchip: cdn-dp: Fix some error handling paths in cdn_dp_probe() ARM: dts: qcom: mdm9615: populate vsdcc fixed regulator firmware: ti_sci: Mark driver as non removable clk: scmi: Free scmi_clk allocated when the clocks with invalid info are skipped hwrng: geode - fix accessing registers sched/rt: Provide migrate_disable/enable() inlines nd_btt: Make BTT lanes preemptible HID: cp2112: Use irqchip template hid: cp2112: Fix duplicate workqueue initialization ARM: 9321/1: memset: cast the constant byte to unsigned char ext4: move 'ix' sanity check to corrent position RDMA/hfi1: Workaround truncation compilation error sh: bios: Revive earlyprintk support ASoC: Intel: Skylake: Fix mem leak when parsing UUIDs fails ASoC: ams-delta.c: use component after check mfd: dln2: Fix double put in dln2_probe leds: pwm: simplify if condition leds: pwm: convert to atomic PWM API leds: pwm: Don't disable the PWM when the LED should be off ledtrig-cpu: Limit to 8 CPUs leds: trigger: ledtrig-cpu:: Fix 'output may be truncated' issue for 'cpu' tty: tty_jobctrl: fix pid memleak in disassociate_ctty() usb: dwc2: fix possible NULL pointer dereference caused by driver concurrency dmaengine: ti: edma: handle irq_of_parse_and_map() errors misc: st_core: Do not call kfree_skb() under spin_lock_irqsave() tools: iio: privatize globals and functions in iio_generic_buffer.c file tools: iio: iio_generic_buffer: Fix some integer type and calculation tools: iio: iio_generic_buffer ensure alignment USB: usbip: fix stub_dev hub disconnect dmaengine: pxa_dma: Remove an erroneous BUG_ON() in pxad_free_desc() f2fs: fix to initialize map.m_pblk in f2fs_precache_extents() pcmcia: cs: fix possible hung task and memory leak pccardd() pcmcia: ds: fix refcount leak in pcmcia_device_add() pcmcia: ds: fix possible name leak in error path in pcmcia_device_add() media: bttv: fix use after free error due to btv->timeout timer media: s3c-camif: Avoid inappropriate kfree() media: dvb-usb-v2: af9035: fix missing unlock pwm: sti: Avoid conditional gotos pwm: sti: Reduce number of allocations and drop usage of chip_data pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume Input: synaptics-rmi4 - fix use after free in rmi_unregister_function() llc: verify mac len before reading mac header tipc: Change nla_policy for bearer-related names to NLA_NUL_STRING dccp: Call security_inet_conn_request() after setting IPv4 addresses. dccp/tcp: Call security_inet_conn_request() after setting IPv6 addresses. r8169: improve rtl_set_rx_mode net: r8169: Disable multicast filter for RTL8168H and RTL8107E net/smc: postpone release of clcsock net/smc: wait for pending work before clcsock release_sock net/smc: fix dangling sock under state SMC_APPFINCLOSEWAIT tg3: power down device only on SYSTEM_POWER_OFF r8169: respect userspace disabling IFF_MULTICAST netfilter: xt_recent: fix (increase) ipv6 literal buffer length fbdev: imsttfb: Fix error path of imsttfb_probe() fbdev: imsttfb: fix a resource leak in probe fbdev: fsl-diu-fb: mark wr_reg_wa() static Revert "mmc: core: Capture correct oemid-bits for eMMC cards" btrfs: use u64 for buffer sizes in the tree search ioctls Linux 4.19.299 Change-Id: I130ef8f6fcd9ce2815d8b2493f96082376730758 Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
2
Makefile
2
Makefile
@@ -1,7 +1,7 @@
|
|||||||
# SPDX-License-Identifier: GPL-2.0
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
VERSION = 4
|
VERSION = 4
|
||||||
PATCHLEVEL = 19
|
PATCHLEVEL = 19
|
||||||
SUBLEVEL = 298
|
SUBLEVEL = 299
|
||||||
EXTRAVERSION =
|
EXTRAVERSION =
|
||||||
NAME = "People's Front"
|
NAME = "People's Front"
|
||||||
|
|
||||||
|
|||||||
@@ -82,7 +82,6 @@
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
regulators {
|
|
||||||
vsdcc_fixed: vsdcc-regulator {
|
vsdcc_fixed: vsdcc-regulator {
|
||||||
compatible = "regulator-fixed";
|
compatible = "regulator-fixed";
|
||||||
regulator-name = "SDCC Power";
|
regulator-name = "SDCC Power";
|
||||||
@@ -90,7 +89,6 @@
|
|||||||
regulator-max-microvolt = <2700000>;
|
regulator-max-microvolt = <2700000>;
|
||||||
regulator-always-on;
|
regulator-always-on;
|
||||||
};
|
};
|
||||||
};
|
|
||||||
|
|
||||||
soc: soc {
|
soc: soc {
|
||||||
#address-cells = <1>;
|
#address-cells = <1>;
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
ENTRY(mmioset)
|
ENTRY(mmioset)
|
||||||
ENTRY(memset)
|
ENTRY(memset)
|
||||||
UNWIND( .fnstart )
|
UNWIND( .fnstart )
|
||||||
|
and r1, r1, #255 @ cast to unsigned char
|
||||||
ands r3, r0, #3 @ 1 unaligned?
|
ands r3, r0, #3 @ 1 unaligned?
|
||||||
mov ip, r0 @ preserve r0 as return value
|
mov ip, r0 @ preserve r0 as return value
|
||||||
bne 6f @ 1
|
bne 6f @ 1
|
||||||
|
|||||||
@@ -26,6 +26,17 @@ config STACK_DEBUG
|
|||||||
every function call and will therefore incur a major
|
every function call and will therefore incur a major
|
||||||
performance hit. Most users should say N.
|
performance hit. Most users should say N.
|
||||||
|
|
||||||
|
config EARLY_PRINTK
|
||||||
|
bool "Early printk"
|
||||||
|
depends on SH_STANDARD_BIOS
|
||||||
|
help
|
||||||
|
Say Y here to redirect kernel printk messages to the serial port
|
||||||
|
used by the SH-IPL bootloader, starting very early in the boot
|
||||||
|
process and ending when the kernel's serial console is initialised.
|
||||||
|
This option is only useful while porting the kernel to a new machine,
|
||||||
|
when the kernel may crash or hang before the serial console is
|
||||||
|
initialised. If unsure, say N.
|
||||||
|
|
||||||
config 4KSTACKS
|
config 4KSTACKS
|
||||||
bool "Use 4Kb for kernel stacks instead of 8Kb"
|
bool "Use 4Kb for kernel stacks instead of 8Kb"
|
||||||
depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB
|
depends on DEBUG_KERNEL && (MMU || BROKEN) && !PAGE_SIZE_64KB
|
||||||
|
|||||||
@@ -164,8 +164,8 @@ static int create_pnp_modalias(struct acpi_device *acpi_dev, char *modalias,
|
|||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
len = snprintf(modalias, size, "acpi:");
|
len = snprintf(modalias, size, "acpi:");
|
||||||
if (len <= 0)
|
if (len >= size)
|
||||||
return len;
|
return -ENOMEM;
|
||||||
|
|
||||||
size -= len;
|
size -= len;
|
||||||
|
|
||||||
@@ -218,8 +218,10 @@ static int create_of_modalias(struct acpi_device *acpi_dev, char *modalias,
|
|||||||
len = snprintf(modalias, size, "of:N%sT", (char *)buf.pointer);
|
len = snprintf(modalias, size, "of:N%sT", (char *)buf.pointer);
|
||||||
ACPI_FREE(buf.pointer);
|
ACPI_FREE(buf.pointer);
|
||||||
|
|
||||||
if (len <= 0)
|
if (len >= size)
|
||||||
return len;
|
return -ENOMEM;
|
||||||
|
|
||||||
|
size -= len;
|
||||||
|
|
||||||
of_compatible = acpi_dev->data.of_compatible;
|
of_compatible = acpi_dev->data.of_compatible;
|
||||||
if (of_compatible->type == ACPI_TYPE_PACKAGE) {
|
if (of_compatible->type == ACPI_TYPE_PACKAGE) {
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ static ssize_t regmap_name_read_file(struct file *file,
|
|||||||
name = map->dev->driver->name;
|
name = map->dev->driver->name;
|
||||||
|
|
||||||
ret = snprintf(buf, PAGE_SIZE, "%s\n", name);
|
ret = snprintf(buf, PAGE_SIZE, "%s\n", name);
|
||||||
if (ret < 0) {
|
if (ret >= PAGE_SIZE) {
|
||||||
kfree(buf);
|
kfree(buf);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -58,7 +58,8 @@ struct amd_geode_priv {
|
|||||||
|
|
||||||
static int geode_rng_data_read(struct hwrng *rng, u32 *data)
|
static int geode_rng_data_read(struct hwrng *rng, u32 *data)
|
||||||
{
|
{
|
||||||
void __iomem *mem = (void __iomem *)rng->priv;
|
struct amd_geode_priv *priv = (struct amd_geode_priv *)rng->priv;
|
||||||
|
void __iomem *mem = priv->membase;
|
||||||
|
|
||||||
*data = readl(mem + GEODE_RNG_DATA_REG);
|
*data = readl(mem + GEODE_RNG_DATA_REG);
|
||||||
|
|
||||||
@@ -67,7 +68,8 @@ static int geode_rng_data_read(struct hwrng *rng, u32 *data)
|
|||||||
|
|
||||||
static int geode_rng_data_present(struct hwrng *rng, int wait)
|
static int geode_rng_data_present(struct hwrng *rng, int wait)
|
||||||
{
|
{
|
||||||
void __iomem *mem = (void __iomem *)rng->priv;
|
struct amd_geode_priv *priv = (struct amd_geode_priv *)rng->priv;
|
||||||
|
void __iomem *mem = priv->membase;
|
||||||
int data, i;
|
int data, i;
|
||||||
|
|
||||||
for (i = 0; i < 20; i++) {
|
for (i = 0; i < 20; i++) {
|
||||||
|
|||||||
@@ -647,7 +647,7 @@ static void __init npcm7xx_clk_init(struct device_node *clk_np)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
npcm7xx_init_fail:
|
npcm7xx_init_fail:
|
||||||
kfree(npcm7xx_clk_data->hws);
|
kfree(npcm7xx_clk_data);
|
||||||
npcm7xx_init_np_err:
|
npcm7xx_init_np_err:
|
||||||
iounmap(clk_base);
|
iounmap(clk_base);
|
||||||
npcm7xx_init_error:
|
npcm7xx_init_error:
|
||||||
|
|||||||
@@ -170,6 +170,7 @@ static int scmi_clocks_probe(struct scmi_device *sdev)
|
|||||||
sclk->info = handle->clk_ops->info_get(handle, idx);
|
sclk->info = handle->clk_ops->info_get(handle, idx);
|
||||||
if (!sclk->info) {
|
if (!sclk->info) {
|
||||||
dev_dbg(dev, "invalid clock info for idx %d\n", idx);
|
dev_dbg(dev, "invalid clock info for idx %d\n", idx);
|
||||||
|
devm_kfree(dev, sclk);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -285,12 +285,13 @@ static void __init of_pll_div_clk_init(struct device_node *node)
|
|||||||
|
|
||||||
clk = clk_register_divider(NULL, clk_name, parent_name, 0, reg, shift,
|
clk = clk_register_divider(NULL, clk_name, parent_name, 0, reg, shift,
|
||||||
mask, 0, NULL);
|
mask, 0, NULL);
|
||||||
if (clk) {
|
if (IS_ERR(clk)) {
|
||||||
of_clk_add_provider(node, of_clk_src_simple_get, clk);
|
|
||||||
} else {
|
|
||||||
pr_err("%s: error registering divider %s\n", __func__, clk_name);
|
pr_err("%s: error registering divider %s\n", __func__, clk_name);
|
||||||
iounmap(reg);
|
iounmap(reg);
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
of_clk_add_provider(node, of_clk_src_simple_get, clk);
|
||||||
}
|
}
|
||||||
CLK_OF_DECLARE(pll_divider_clock, "ti,keystone,pll-divider-clock", of_pll_div_clk_init);
|
CLK_OF_DECLARE(pll_divider_clock, "ti,keystone,pll-divider-clock", of_pll_div_clk_init);
|
||||||
|
|
||||||
@@ -332,9 +333,11 @@ static void __init of_pll_mux_clk_init(struct device_node *node)
|
|||||||
clk = clk_register_mux(NULL, clk_name, (const char **)&parents,
|
clk = clk_register_mux(NULL, clk_name, (const char **)&parents,
|
||||||
ARRAY_SIZE(parents) , 0, reg, shift, mask,
|
ARRAY_SIZE(parents) , 0, reg, shift, mask,
|
||||||
0, NULL);
|
0, NULL);
|
||||||
if (clk)
|
if (IS_ERR(clk)) {
|
||||||
of_clk_add_provider(node, of_clk_src_simple_get, clk);
|
|
||||||
else
|
|
||||||
pr_err("%s: error registering mux %s\n", __func__, clk_name);
|
pr_err("%s: error registering mux %s\n", __func__, clk_name);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
of_clk_add_provider(node, of_clk_src_simple_get, clk);
|
||||||
}
|
}
|
||||||
CLK_OF_DECLARE(pll_mux_clock, "ti,keystone,pll-mux-clock", of_pll_mux_clk_init);
|
CLK_OF_DECLARE(pll_mux_clock, "ti,keystone,pll-mux-clock", of_pll_mux_clk_init);
|
||||||
|
|||||||
@@ -688,6 +688,8 @@ static int mtk_topckgen_init(struct platform_device *pdev)
|
|||||||
return PTR_ERR(base);
|
return PTR_ERR(base);
|
||||||
|
|
||||||
clk_data = mtk_alloc_clk_data(CLK_TOP_NR);
|
clk_data = mtk_alloc_clk_data(CLK_TOP_NR);
|
||||||
|
if (!clk_data)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks),
|
mtk_clk_register_fixed_clks(top_fixed_clks, ARRAY_SIZE(top_fixed_clks),
|
||||||
clk_data);
|
clk_data);
|
||||||
@@ -755,6 +757,8 @@ static void __init mtk_infrasys_init_early(struct device_node *node)
|
|||||||
|
|
||||||
if (!infra_clk_data) {
|
if (!infra_clk_data) {
|
||||||
infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
|
infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
|
||||||
|
if (!infra_clk_data)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < CLK_INFRA_NR; i++)
|
for (i = 0; i < CLK_INFRA_NR; i++)
|
||||||
infra_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
|
infra_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
|
||||||
@@ -781,6 +785,8 @@ static int mtk_infrasys_init(struct platform_device *pdev)
|
|||||||
|
|
||||||
if (!infra_clk_data) {
|
if (!infra_clk_data) {
|
||||||
infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
|
infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
|
||||||
|
if (!infra_clk_data)
|
||||||
|
return -ENOMEM;
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < CLK_INFRA_NR; i++) {
|
for (i = 0; i < CLK_INFRA_NR; i++) {
|
||||||
if (infra_clk_data->clks[i] == ERR_PTR(-EPROBE_DEFER))
|
if (infra_clk_data->clks[i] == ERR_PTR(-EPROBE_DEFER))
|
||||||
@@ -909,6 +915,8 @@ static int mtk_pericfg_init(struct platform_device *pdev)
|
|||||||
return PTR_ERR(base);
|
return PTR_ERR(base);
|
||||||
|
|
||||||
clk_data = mtk_alloc_clk_data(CLK_PERI_NR);
|
clk_data = mtk_alloc_clk_data(CLK_PERI_NR);
|
||||||
|
if (!clk_data)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks),
|
mtk_clk_register_gates(node, peri_clks, ARRAY_SIZE(peri_clks),
|
||||||
clk_data);
|
clk_data);
|
||||||
|
|||||||
@@ -396,6 +396,8 @@ static int mtk_topckgen_init(struct platform_device *pdev)
|
|||||||
return PTR_ERR(base);
|
return PTR_ERR(base);
|
||||||
|
|
||||||
clk_data = mtk_alloc_clk_data(CLK_TOP_NR);
|
clk_data = mtk_alloc_clk_data(CLK_TOP_NR);
|
||||||
|
if (!clk_data)
|
||||||
|
return -ENOMEM;
|
||||||
|
|
||||||
mtk_clk_register_factors(top_fixed_divs, ARRAY_SIZE(top_fixed_divs),
|
mtk_clk_register_factors(top_fixed_divs, ARRAY_SIZE(top_fixed_divs),
|
||||||
clk_data);
|
clk_data);
|
||||||
@@ -554,6 +556,8 @@ static void mtk_infrasys_init_early(struct device_node *node)
|
|||||||
|
|
||||||
if (!infra_clk_data) {
|
if (!infra_clk_data) {
|
||||||
infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
|
infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
|
||||||
|
if (!infra_clk_data)
|
||||||
|
return;
|
||||||
|
|
||||||
for (i = 0; i < CLK_INFRA_NR; i++)
|
for (i = 0; i < CLK_INFRA_NR; i++)
|
||||||
infra_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
|
infra_clk_data->clks[i] = ERR_PTR(-EPROBE_DEFER);
|
||||||
@@ -578,6 +582,8 @@ static int mtk_infrasys_init(struct platform_device *pdev)
|
|||||||
|
|
||||||
if (!infra_clk_data) {
|
if (!infra_clk_data) {
|
||||||
infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
|
infra_clk_data = mtk_alloc_clk_data(CLK_INFRA_NR);
|
||||||
|
if (!infra_clk_data)
|
||||||
|
return -ENOMEM;
|
||||||
} else {
|
} else {
|
||||||
for (i = 0; i < CLK_INFRA_NR; i++) {
|
for (i = 0; i < CLK_INFRA_NR; i++) {
|
||||||
if (infra_clk_data->clks[i] == ERR_PTR(-EPROBE_DEFER))
|
if (infra_clk_data->clks[i] == ERR_PTR(-EPROBE_DEFER))
|
||||||
|
|||||||
@@ -132,17 +132,11 @@ static int clk_rcg2_set_parent(struct clk_hw *hw, u8 index)
|
|||||||
static unsigned long
|
static unsigned long
|
||||||
calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div)
|
calc_rate(unsigned long rate, u32 m, u32 n, u32 mode, u32 hid_div)
|
||||||
{
|
{
|
||||||
if (hid_div) {
|
if (hid_div)
|
||||||
rate *= 2;
|
rate = mult_frac(rate, 2, hid_div + 1);
|
||||||
rate /= hid_div + 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (mode) {
|
if (mode)
|
||||||
u64 tmp = rate;
|
rate = mult_frac(rate, m, n);
|
||||||
tmp *= m;
|
|
||||||
do_div(tmp, n);
|
|
||||||
rate = tmp;
|
|
||||||
}
|
|
||||||
|
|
||||||
return rate;
|
return rate;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2071,7 +2071,7 @@ static void chtls_rx_ack(struct sock *sk, struct sk_buff *skb)
|
|||||||
|
|
||||||
if (tp->snd_una != snd_una) {
|
if (tp->snd_una != snd_una) {
|
||||||
tp->snd_una = snd_una;
|
tp->snd_una = snd_una;
|
||||||
tp->rcv_tstamp = tcp_time_stamp(tp);
|
tp->rcv_tstamp = tcp_jiffies32;
|
||||||
if (tp->snd_una == tp->snd_nxt &&
|
if (tp->snd_una == tp->snd_nxt &&
|
||||||
!csk_flag_nochk(csk, CSK_TX_FAILOVER))
|
!csk_flag_nochk(csk, CSK_TX_FAILOVER))
|
||||||
csk_reset_flag(csk, CSK_TX_WAIT_IDLE);
|
csk_reset_flag(csk, CSK_TX_WAIT_IDLE);
|
||||||
|
|||||||
@@ -772,7 +772,6 @@ static void pxad_free_desc(struct virt_dma_desc *vd)
|
|||||||
dma_addr_t dma;
|
dma_addr_t dma;
|
||||||
struct pxad_desc_sw *sw_desc = to_pxad_sw_desc(vd);
|
struct pxad_desc_sw *sw_desc = to_pxad_sw_desc(vd);
|
||||||
|
|
||||||
BUG_ON(sw_desc->nb_desc == 0);
|
|
||||||
for (i = sw_desc->nb_desc - 1; i >= 0; i--) {
|
for (i = sw_desc->nb_desc - 1; i >= 0; i--) {
|
||||||
if (i > 0)
|
if (i > 0)
|
||||||
dma = sw_desc->hw_desc[i - 1]->ddadr;
|
dma = sw_desc->hw_desc[i - 1]->ddadr;
|
||||||
|
|||||||
@@ -2303,7 +2303,7 @@ static int edma_probe(struct platform_device *pdev)
|
|||||||
if (irq < 0 && node)
|
if (irq < 0 && node)
|
||||||
irq = irq_of_parse_and_map(node, 0);
|
irq = irq_of_parse_and_map(node, 0);
|
||||||
|
|
||||||
if (irq >= 0) {
|
if (irq > 0) {
|
||||||
irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccint",
|
irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccint",
|
||||||
dev_name(dev));
|
dev_name(dev));
|
||||||
ret = devm_request_irq(dev, irq, dma_irq_handler, 0, irq_name,
|
ret = devm_request_irq(dev, irq, dma_irq_handler, 0, irq_name,
|
||||||
@@ -2319,7 +2319,7 @@ static int edma_probe(struct platform_device *pdev)
|
|||||||
if (irq < 0 && node)
|
if (irq < 0 && node)
|
||||||
irq = irq_of_parse_and_map(node, 2);
|
irq = irq_of_parse_and_map(node, 2);
|
||||||
|
|
||||||
if (irq >= 0) {
|
if (irq > 0) {
|
||||||
irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccerrint",
|
irq_name = devm_kasprintf(dev, GFP_KERNEL, "%s_ccerrint",
|
||||||
dev_name(dev));
|
dev_name(dev));
|
||||||
ret = devm_request_irq(dev, irq, dma_ccerr_handler, 0, irq_name,
|
ret = devm_request_irq(dev, irq, dma_ccerr_handler, 0, irq_name,
|
||||||
|
|||||||
@@ -205,19 +205,6 @@ static int ti_sci_debugfs_create(struct platform_device *pdev,
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* ti_sci_debugfs_destroy() - clean up log debug file
|
|
||||||
* @pdev: platform device pointer
|
|
||||||
* @info: Pointer to SCI entity information
|
|
||||||
*/
|
|
||||||
static void ti_sci_debugfs_destroy(struct platform_device *pdev,
|
|
||||||
struct ti_sci_info *info)
|
|
||||||
{
|
|
||||||
if (IS_ERR(info->debug_region))
|
|
||||||
return;
|
|
||||||
|
|
||||||
debugfs_remove(info->d);
|
|
||||||
}
|
|
||||||
#else /* CONFIG_DEBUG_FS */
|
#else /* CONFIG_DEBUG_FS */
|
||||||
static inline int ti_sci_debugfs_create(struct platform_device *dev,
|
static inline int ti_sci_debugfs_create(struct platform_device *dev,
|
||||||
struct ti_sci_info *info)
|
struct ti_sci_info *info)
|
||||||
@@ -1937,43 +1924,12 @@ static int ti_sci_probe(struct platform_device *pdev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ti_sci_remove(struct platform_device *pdev)
|
|
||||||
{
|
|
||||||
struct ti_sci_info *info;
|
|
||||||
struct device *dev = &pdev->dev;
|
|
||||||
int ret = 0;
|
|
||||||
|
|
||||||
of_platform_depopulate(dev);
|
|
||||||
|
|
||||||
info = platform_get_drvdata(pdev);
|
|
||||||
|
|
||||||
if (info->nb.notifier_call)
|
|
||||||
unregister_restart_handler(&info->nb);
|
|
||||||
|
|
||||||
mutex_lock(&ti_sci_list_mutex);
|
|
||||||
if (info->users)
|
|
||||||
ret = -EBUSY;
|
|
||||||
else
|
|
||||||
list_del(&info->node);
|
|
||||||
mutex_unlock(&ti_sci_list_mutex);
|
|
||||||
|
|
||||||
if (!ret) {
|
|
||||||
ti_sci_debugfs_destroy(pdev, info);
|
|
||||||
|
|
||||||
/* Safe to free channels since no more users */
|
|
||||||
mbox_free_channel(info->chan_tx);
|
|
||||||
mbox_free_channel(info->chan_rx);
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
static struct platform_driver ti_sci_driver = {
|
static struct platform_driver ti_sci_driver = {
|
||||||
.probe = ti_sci_probe,
|
.probe = ti_sci_probe,
|
||||||
.remove = ti_sci_remove,
|
|
||||||
.driver = {
|
.driver = {
|
||||||
.name = "ti-sci",
|
.name = "ti-sci",
|
||||||
.of_match_table = of_match_ptr(ti_sci_of_match),
|
.of_match_table = of_match_ptr(ti_sci_of_match),
|
||||||
|
.suppress_bind_attrs = true,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
module_platform_driver(ti_sci_driver);
|
module_platform_driver(ti_sci_driver);
|
||||||
|
|||||||
@@ -4815,14 +4815,15 @@ int evergreen_irq_process(struct radeon_device *rdev)
|
|||||||
break;
|
break;
|
||||||
case 44: /* hdmi */
|
case 44: /* hdmi */
|
||||||
afmt_idx = src_data;
|
afmt_idx = src_data;
|
||||||
if (!(afmt_status[afmt_idx] & AFMT_AZ_FORMAT_WTRIG))
|
|
||||||
DRM_DEBUG("IH: IH event w/o asserted irq bit?\n");
|
|
||||||
|
|
||||||
if (afmt_idx > 5) {
|
if (afmt_idx > 5) {
|
||||||
DRM_ERROR("Unhandled interrupt: %d %d\n",
|
DRM_ERROR("Unhandled interrupt: %d %d\n",
|
||||||
src_id, src_data);
|
src_id, src_data);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!(afmt_status[afmt_idx] & AFMT_AZ_FORMAT_WTRIG))
|
||||||
|
DRM_DEBUG("IH: IH event w/o asserted irq bit?\n");
|
||||||
|
|
||||||
afmt_status[afmt_idx] &= ~AFMT_AZ_FORMAT_WTRIG;
|
afmt_status[afmt_idx] &= ~AFMT_AZ_FORMAT_WTRIG;
|
||||||
queue_hdmi = true;
|
queue_hdmi = true;
|
||||||
DRM_DEBUG("IH: HDMI%d\n", afmt_idx + 1);
|
DRM_DEBUG("IH: HDMI%d\n", afmt_idx + 1);
|
||||||
|
|||||||
@@ -1156,6 +1156,7 @@ static int cdn_dp_probe(struct platform_device *pdev)
|
|||||||
struct cdn_dp_device *dp;
|
struct cdn_dp_device *dp;
|
||||||
struct extcon_dev *extcon;
|
struct extcon_dev *extcon;
|
||||||
struct phy *phy;
|
struct phy *phy;
|
||||||
|
int ret;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
|
dp = devm_kzalloc(dev, sizeof(*dp), GFP_KERNEL);
|
||||||
@@ -1196,9 +1197,19 @@ static int cdn_dp_probe(struct platform_device *pdev)
|
|||||||
mutex_init(&dp->lock);
|
mutex_init(&dp->lock);
|
||||||
dev_set_drvdata(dev, dp);
|
dev_set_drvdata(dev, dp);
|
||||||
|
|
||||||
cdn_dp_audio_codec_init(dp, dev);
|
ret = cdn_dp_audio_codec_init(dp, dev);
|
||||||
|
if (ret)
|
||||||
|
return ret;
|
||||||
|
|
||||||
return component_add(dev, &cdn_dp_component_ops);
|
ret = component_add(dev, &cdn_dp_component_ops);
|
||||||
|
if (ret)
|
||||||
|
goto err_audio_deinit;
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
err_audio_deinit:
|
||||||
|
platform_device_unregister(dp->audio_pdev);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int cdn_dp_remove(struct platform_device *pdev)
|
static int cdn_dp_remove(struct platform_device *pdev)
|
||||||
|
|||||||
@@ -1091,7 +1091,8 @@ static struct drm_crtc_state *vop_crtc_duplicate_state(struct drm_crtc *crtc)
|
|||||||
if (WARN_ON(!crtc->state))
|
if (WARN_ON(!crtc->state))
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
rockchip_state = kzalloc(sizeof(*rockchip_state), GFP_KERNEL);
|
rockchip_state = kmemdup(to_rockchip_crtc_state(crtc->state),
|
||||||
|
sizeof(*rockchip_state), GFP_KERNEL);
|
||||||
if (!rockchip_state)
|
if (!rockchip_state)
|
||||||
return NULL;
|
return NULL;
|
||||||
|
|
||||||
|
|||||||
@@ -1163,8 +1163,6 @@ static unsigned int cp2112_gpio_irq_startup(struct irq_data *d)
|
|||||||
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
struct gpio_chip *gc = irq_data_get_irq_chip_data(d);
|
||||||
struct cp2112_device *dev = gpiochip_get_data(gc);
|
struct cp2112_device *dev = gpiochip_get_data(gc);
|
||||||
|
|
||||||
INIT_DELAYED_WORK(&dev->gpio_poll_worker, cp2112_gpio_poll_callback);
|
|
||||||
|
|
||||||
if (!dev->gpio_poll) {
|
if (!dev->gpio_poll) {
|
||||||
dev->gpio_poll = true;
|
dev->gpio_poll = true;
|
||||||
schedule_delayed_work(&dev->gpio_poll_worker, 0);
|
schedule_delayed_work(&dev->gpio_poll_worker, 0);
|
||||||
@@ -1245,6 +1243,7 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
|||||||
struct cp2112_device *dev;
|
struct cp2112_device *dev;
|
||||||
u8 buf[3];
|
u8 buf[3];
|
||||||
struct cp2112_smbus_config_report config;
|
struct cp2112_smbus_config_report config;
|
||||||
|
struct gpio_irq_chip *girq;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);
|
dev = devm_kzalloc(&hdev->dev, sizeof(*dev), GFP_KERNEL);
|
||||||
@@ -1348,6 +1347,17 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
|||||||
dev->gc.can_sleep = 1;
|
dev->gc.can_sleep = 1;
|
||||||
dev->gc.parent = &hdev->dev;
|
dev->gc.parent = &hdev->dev;
|
||||||
|
|
||||||
|
girq = &dev->gc.irq;
|
||||||
|
girq->chip = &cp2112_gpio_irqchip;
|
||||||
|
/* The event comes from the outside so no parent handler */
|
||||||
|
girq->parent_handler = NULL;
|
||||||
|
girq->num_parents = 0;
|
||||||
|
girq->parents = NULL;
|
||||||
|
girq->default_type = IRQ_TYPE_NONE;
|
||||||
|
girq->handler = handle_simple_irq;
|
||||||
|
|
||||||
|
INIT_DELAYED_WORK(&dev->gpio_poll_worker, cp2112_gpio_poll_callback);
|
||||||
|
|
||||||
ret = gpiochip_add_data(&dev->gc, dev);
|
ret = gpiochip_add_data(&dev->gc, dev);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
hid_err(hdev, "error registering gpio chip\n");
|
hid_err(hdev, "error registering gpio chip\n");
|
||||||
@@ -1363,17 +1373,8 @@ static int cp2112_probe(struct hid_device *hdev, const struct hid_device_id *id)
|
|||||||
chmod_sysfs_attrs(hdev);
|
chmod_sysfs_attrs(hdev);
|
||||||
hid_hw_power(hdev, PM_HINT_NORMAL);
|
hid_hw_power(hdev, PM_HINT_NORMAL);
|
||||||
|
|
||||||
ret = gpiochip_irqchip_add(&dev->gc, &cp2112_gpio_irqchip, 0,
|
|
||||||
handle_simple_irq, IRQ_TYPE_NONE);
|
|
||||||
if (ret) {
|
|
||||||
dev_err(dev->gc.parent, "failed to add IRQ chip\n");
|
|
||||||
goto err_sysfs_remove;
|
|
||||||
}
|
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
err_sysfs_remove:
|
|
||||||
sysfs_remove_group(&hdev->dev.kobj, &cp2112_attr_group);
|
|
||||||
err_gpiochip_remove:
|
err_gpiochip_remove:
|
||||||
gpiochip_remove(&dev->gc);
|
gpiochip_remove(&dev->gc);
|
||||||
err_free_i2c:
|
err_free_i2c:
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ MODULE_PARM_DESC(tjmax, "TjMax value in degrees Celsius");
|
|||||||
#define PKG_SYSFS_ATTR_NO 1 /* Sysfs attribute for package temp */
|
#define PKG_SYSFS_ATTR_NO 1 /* Sysfs attribute for package temp */
|
||||||
#define BASE_SYSFS_ATTR_NO 2 /* Sysfs Base attr no for coretemp */
|
#define BASE_SYSFS_ATTR_NO 2 /* Sysfs Base attr no for coretemp */
|
||||||
#define NUM_REAL_CORES 128 /* Number of Real cores per cpu */
|
#define NUM_REAL_CORES 128 /* Number of Real cores per cpu */
|
||||||
#define CORETEMP_NAME_LENGTH 19 /* String Length of attrs */
|
#define CORETEMP_NAME_LENGTH 28 /* String Length of attrs */
|
||||||
#define MAX_CORE_ATTRS 4 /* Maximum no of basic attrs */
|
#define MAX_CORE_ATTRS 4 /* Maximum no of basic attrs */
|
||||||
#define TOTAL_ATTRS (MAX_CORE_ATTRS + 1)
|
#define TOTAL_ATTRS (MAX_CORE_ATTRS + 1)
|
||||||
#define MAX_CORE_DATA (NUM_REAL_CORES + BASE_SYSFS_ATTR_NO)
|
#define MAX_CORE_DATA (NUM_REAL_CORES + BASE_SYSFS_ATTR_NO)
|
||||||
|
|||||||
@@ -152,7 +152,7 @@ int read_hfi1_efi_var(struct hfi1_devdata *dd, const char *kind,
|
|||||||
unsigned long *size, void **return_data)
|
unsigned long *size, void **return_data)
|
||||||
{
|
{
|
||||||
char prefix_name[64];
|
char prefix_name[64];
|
||||||
char name[64];
|
char name[128];
|
||||||
int result;
|
int result;
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
|
|||||||
@@ -279,11 +279,11 @@ void rmi_unregister_function(struct rmi_function *fn)
|
|||||||
|
|
||||||
device_del(&fn->dev);
|
device_del(&fn->dev);
|
||||||
of_node_put(fn->dev.of_node);
|
of_node_put(fn->dev.of_node);
|
||||||
put_device(&fn->dev);
|
|
||||||
|
|
||||||
for (i = 0; i < fn->num_of_irqs; i++)
|
for (i = 0; i < fn->num_of_irqs; i++)
|
||||||
irq_dispose_mapping(fn->irq[i]);
|
irq_dispose_mapping(fn->irq[i]);
|
||||||
|
|
||||||
|
put_device(&fn->dev);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -25,9 +25,8 @@
|
|||||||
struct led_pwm_data {
|
struct led_pwm_data {
|
||||||
struct led_classdev cdev;
|
struct led_classdev cdev;
|
||||||
struct pwm_device *pwm;
|
struct pwm_device *pwm;
|
||||||
|
struct pwm_state pwmstate;
|
||||||
unsigned int active_low;
|
unsigned int active_low;
|
||||||
unsigned int period;
|
|
||||||
int duty;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
struct led_pwm_priv {
|
struct led_pwm_priv {
|
||||||
@@ -35,37 +34,23 @@ struct led_pwm_priv {
|
|||||||
struct led_pwm_data leds[0];
|
struct led_pwm_data leds[0];
|
||||||
};
|
};
|
||||||
|
|
||||||
static void __led_pwm_set(struct led_pwm_data *led_dat)
|
|
||||||
{
|
|
||||||
int new_duty = led_dat->duty;
|
|
||||||
|
|
||||||
pwm_config(led_dat->pwm, new_duty, led_dat->period);
|
|
||||||
|
|
||||||
if (new_duty == 0)
|
|
||||||
pwm_disable(led_dat->pwm);
|
|
||||||
else
|
|
||||||
pwm_enable(led_dat->pwm);
|
|
||||||
}
|
|
||||||
|
|
||||||
static int led_pwm_set(struct led_classdev *led_cdev,
|
static int led_pwm_set(struct led_classdev *led_cdev,
|
||||||
enum led_brightness brightness)
|
enum led_brightness brightness)
|
||||||
{
|
{
|
||||||
struct led_pwm_data *led_dat =
|
struct led_pwm_data *led_dat =
|
||||||
container_of(led_cdev, struct led_pwm_data, cdev);
|
container_of(led_cdev, struct led_pwm_data, cdev);
|
||||||
unsigned int max = led_dat->cdev.max_brightness;
|
unsigned int max = led_dat->cdev.max_brightness;
|
||||||
unsigned long long duty = led_dat->period;
|
unsigned long long duty = led_dat->pwmstate.period;
|
||||||
|
|
||||||
duty *= brightness;
|
duty *= brightness;
|
||||||
do_div(duty, max);
|
do_div(duty, max);
|
||||||
|
|
||||||
if (led_dat->active_low)
|
if (led_dat->active_low)
|
||||||
duty = led_dat->period - duty;
|
duty = led_dat->pwmstate.period - duty;
|
||||||
|
|
||||||
led_dat->duty = duty;
|
led_dat->pwmstate.duty_cycle = duty;
|
||||||
|
led_dat->pwmstate.enabled = true;
|
||||||
__led_pwm_set(led_dat);
|
return pwm_apply_state(led_dat->pwm, &led_dat->pwmstate);
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static inline size_t sizeof_pwm_leds_priv(int num_leds)
|
static inline size_t sizeof_pwm_leds_priv(int num_leds)
|
||||||
@@ -84,7 +69,6 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
|
|||||||
struct led_pwm *led, struct device_node *child)
|
struct led_pwm *led, struct device_node *child)
|
||||||
{
|
{
|
||||||
struct led_pwm_data *led_data = &priv->leds[priv->num_leds];
|
struct led_pwm_data *led_data = &priv->leds[priv->num_leds];
|
||||||
struct pwm_args pargs;
|
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
led_data->active_low = led->active_low;
|
led_data->active_low = led->active_low;
|
||||||
@@ -108,17 +92,10 @@ static int led_pwm_add(struct device *dev, struct led_pwm_priv *priv,
|
|||||||
|
|
||||||
led_data->cdev.brightness_set_blocking = led_pwm_set;
|
led_data->cdev.brightness_set_blocking = led_pwm_set;
|
||||||
|
|
||||||
/*
|
pwm_init_state(led_data->pwm, &led_data->pwmstate);
|
||||||
* FIXME: pwm_apply_args() should be removed when switching to the
|
|
||||||
* atomic PWM API.
|
|
||||||
*/
|
|
||||||
pwm_apply_args(led_data->pwm);
|
|
||||||
|
|
||||||
pwm_get_args(led_data->pwm, &pargs);
|
if (!led_data->pwmstate.period)
|
||||||
|
led_data->pwmstate.period = led->pwm_period_ns;
|
||||||
led_data->period = pargs.period;
|
|
||||||
if (!led_data->period && (led->pwm_period_ns > 0))
|
|
||||||
led_data->period = led->pwm_period_ns;
|
|
||||||
|
|
||||||
ret = led_classdev_register(dev, &led_data->cdev);
|
ret = led_classdev_register(dev, &led_data->cdev);
|
||||||
if (ret == 0) {
|
if (ret == 0) {
|
||||||
|
|||||||
@@ -1,14 +1,18 @@
|
|||||||
/*
|
/*
|
||||||
* ledtrig-cpu.c - LED trigger based on CPU activity
|
* ledtrig-cpu.c - LED trigger based on CPU activity
|
||||||
*
|
*
|
||||||
* This LED trigger will be registered for each possible CPU and named as
|
* This LED trigger will be registered for first 8 CPUs and named
|
||||||
* cpu0, cpu1, cpu2, cpu3, etc.
|
* as cpu0..cpu7. There's additional trigger called cpu that
|
||||||
|
* is on when any CPU is active.
|
||||||
|
*
|
||||||
|
* If you want support for arbitrary number of CPUs, make it one trigger,
|
||||||
|
* with additional sysfs file selecting which CPU to watch.
|
||||||
*
|
*
|
||||||
* It can be bound to any LED just like other triggers using either a
|
* It can be bound to any LED just like other triggers using either a
|
||||||
* board file or via sysfs interface.
|
* board file or via sysfs interface.
|
||||||
*
|
*
|
||||||
* An API named ledtrig_cpu is exported for any user, who want to add CPU
|
* An API named ledtrig_cpu is exported for any user, who want to add CPU
|
||||||
* activity indication in their code
|
* activity indication in their code.
|
||||||
*
|
*
|
||||||
* Copyright 2011 Linus Walleij <linus.walleij@linaro.org>
|
* Copyright 2011 Linus Walleij <linus.walleij@linaro.org>
|
||||||
* Copyright 2011 - 2012 Bryan Wu <bryan.wu@canonical.com>
|
* Copyright 2011 - 2012 Bryan Wu <bryan.wu@canonical.com>
|
||||||
@@ -130,7 +134,7 @@ static int ledtrig_prepare_down_cpu(unsigned int cpu)
|
|||||||
|
|
||||||
static int __init ledtrig_cpu_init(void)
|
static int __init ledtrig_cpu_init(void)
|
||||||
{
|
{
|
||||||
int cpu;
|
unsigned int cpu;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
/* Supports up to 9999 cpu cores */
|
/* Supports up to 9999 cpu cores */
|
||||||
@@ -149,7 +153,10 @@ static int __init ledtrig_cpu_init(void)
|
|||||||
for_each_possible_cpu(cpu) {
|
for_each_possible_cpu(cpu) {
|
||||||
struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu);
|
struct led_trigger_cpu *trig = &per_cpu(cpu_trig, cpu);
|
||||||
|
|
||||||
snprintf(trig->name, MAX_NAME_LEN, "cpu%d", cpu);
|
if (cpu >= 8)
|
||||||
|
continue;
|
||||||
|
|
||||||
|
snprintf(trig->name, MAX_NAME_LEN, "cpu%u", cpu);
|
||||||
|
|
||||||
led_trigger_register_simple(trig->name, &trig->_trig);
|
led_trigger_register_simple(trig->name, &trig->_trig);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4300,6 +4300,7 @@ static void bttv_remove(struct pci_dev *pci_dev)
|
|||||||
|
|
||||||
/* free resources */
|
/* free resources */
|
||||||
free_irq(btv->c.pci->irq,btv);
|
free_irq(btv->c.pci->irq,btv);
|
||||||
|
del_timer_sync(&btv->timeout);
|
||||||
iounmap(btv->bt848_mmio);
|
iounmap(btv->bt848_mmio);
|
||||||
release_mem_region(pci_resource_start(btv->c.pci,0),
|
release_mem_region(pci_resource_start(btv->c.pci,0),
|
||||||
pci_resource_len(btv->c.pci,0));
|
pci_resource_len(btv->c.pci,0));
|
||||||
|
|||||||
@@ -1142,12 +1142,12 @@ int s3c_camif_register_video_node(struct camif_dev *camif, int idx)
|
|||||||
|
|
||||||
ret = vb2_queue_init(q);
|
ret = vb2_queue_init(q);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_vd_rel;
|
return ret;
|
||||||
|
|
||||||
vp->pad.flags = MEDIA_PAD_FL_SINK;
|
vp->pad.flags = MEDIA_PAD_FL_SINK;
|
||||||
ret = media_entity_pads_init(&vfd->entity, 1, &vp->pad);
|
ret = media_entity_pads_init(&vfd->entity, 1, &vp->pad);
|
||||||
if (ret)
|
if (ret)
|
||||||
goto err_vd_rel;
|
return ret;
|
||||||
|
|
||||||
video_set_drvdata(vfd, vp);
|
video_set_drvdata(vfd, vp);
|
||||||
|
|
||||||
@@ -1179,8 +1179,6 @@ int s3c_camif_register_video_node(struct camif_dev *camif, int idx)
|
|||||||
v4l2_ctrl_handler_free(&vp->ctrl_handler);
|
v4l2_ctrl_handler_free(&vp->ctrl_handler);
|
||||||
err_me_cleanup:
|
err_me_cleanup:
|
||||||
media_entity_cleanup(&vfd->entity);
|
media_entity_cleanup(&vfd->entity);
|
||||||
err_vd_rel:
|
|
||||||
video_device_release(vfd);
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -337,8 +337,10 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
|
|||||||
ret = -EOPNOTSUPP;
|
ret = -EOPNOTSUPP;
|
||||||
} else if ((msg[0].addr == state->af9033_i2c_addr[0]) ||
|
} else if ((msg[0].addr == state->af9033_i2c_addr[0]) ||
|
||||||
(msg[0].addr == state->af9033_i2c_addr[1])) {
|
(msg[0].addr == state->af9033_i2c_addr[1])) {
|
||||||
if (msg[0].len < 3 || msg[1].len < 1)
|
if (msg[0].len < 3 || msg[1].len < 1) {
|
||||||
return -EOPNOTSUPP;
|
ret = -EOPNOTSUPP;
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
/* demod access via firmware interface */
|
/* demod access via firmware interface */
|
||||||
reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 |
|
reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 |
|
||||||
msg[0].buf[2];
|
msg[0].buf[2];
|
||||||
@@ -398,8 +400,10 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
|
|||||||
ret = -EOPNOTSUPP;
|
ret = -EOPNOTSUPP;
|
||||||
} else if ((msg[0].addr == state->af9033_i2c_addr[0]) ||
|
} else if ((msg[0].addr == state->af9033_i2c_addr[0]) ||
|
||||||
(msg[0].addr == state->af9033_i2c_addr[1])) {
|
(msg[0].addr == state->af9033_i2c_addr[1])) {
|
||||||
if (msg[0].len < 3)
|
if (msg[0].len < 3) {
|
||||||
return -EOPNOTSUPP;
|
ret = -EOPNOTSUPP;
|
||||||
|
goto unlock;
|
||||||
|
}
|
||||||
/* demod access via firmware interface */
|
/* demod access via firmware interface */
|
||||||
reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 |
|
reg = msg[0].buf[0] << 16 | msg[0].buf[1] << 8 |
|
||||||
msg[0].buf[2];
|
msg[0].buf[2];
|
||||||
@@ -474,6 +478,7 @@ static int af9035_i2c_master_xfer(struct i2c_adapter *adap,
|
|||||||
ret = -EOPNOTSUPP;
|
ret = -EOPNOTSUPP;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unlock:
|
||||||
mutex_unlock(&d->i2c_mutex);
|
mutex_unlock(&d->i2c_mutex);
|
||||||
|
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
|
|||||||
@@ -800,7 +800,6 @@ static int dln2_probe(struct usb_interface *interface,
|
|||||||
dln2_stop_rx_urbs(dln2);
|
dln2_stop_rx_urbs(dln2);
|
||||||
|
|
||||||
out_free:
|
out_free:
|
||||||
usb_put_dev(dln2->usb_dev);
|
|
||||||
dln2_free(dln2);
|
dln2_free(dln2);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <linux/skbuff.h>
|
#include <linux/skbuff.h>
|
||||||
|
|
||||||
#include <linux/ti_wilink_st.h>
|
#include <linux/ti_wilink_st.h>
|
||||||
|
#include <linux/netdevice.h>
|
||||||
|
|
||||||
extern void st_kim_recv(void *, const unsigned char *, long);
|
extern void st_kim_recv(void *, const unsigned char *, long);
|
||||||
void st_int_recv(void *, const unsigned char *, long);
|
void st_int_recv(void *, const unsigned char *, long);
|
||||||
@@ -436,7 +437,7 @@ static void st_int_enqueue(struct st_data_s *st_gdata, struct sk_buff *skb)
|
|||||||
case ST_LL_AWAKE_TO_ASLEEP:
|
case ST_LL_AWAKE_TO_ASLEEP:
|
||||||
pr_err("ST LL is illegal state(%ld),"
|
pr_err("ST LL is illegal state(%ld),"
|
||||||
"purging received skb.", st_ll_getstate(st_gdata));
|
"purging received skb.", st_ll_getstate(st_gdata));
|
||||||
kfree_skb(skb);
|
dev_kfree_skb_irq(skb);
|
||||||
break;
|
break;
|
||||||
case ST_LL_ASLEEP:
|
case ST_LL_ASLEEP:
|
||||||
skb_queue_tail(&st_gdata->tx_waitq, skb);
|
skb_queue_tail(&st_gdata->tx_waitq, skb);
|
||||||
@@ -445,7 +446,7 @@ static void st_int_enqueue(struct st_data_s *st_gdata, struct sk_buff *skb)
|
|||||||
default:
|
default:
|
||||||
pr_err("ST LL is illegal state(%ld),"
|
pr_err("ST LL is illegal state(%ld),"
|
||||||
"purging received skb.", st_ll_getstate(st_gdata));
|
"purging received skb.", st_ll_getstate(st_gdata));
|
||||||
kfree_skb(skb);
|
dev_kfree_skb_irq(skb);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -499,7 +500,7 @@ void st_tx_wakeup(struct st_data_s *st_data)
|
|||||||
spin_unlock_irqrestore(&st_data->lock, flags);
|
spin_unlock_irqrestore(&st_data->lock, flags);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
kfree_skb(skb);
|
dev_kfree_skb_irq(skb);
|
||||||
spin_unlock_irqrestore(&st_data->lock, flags);
|
spin_unlock_irqrestore(&st_data->lock, flags);
|
||||||
}
|
}
|
||||||
/* if wake-up is set in another context- restart sending */
|
/* if wake-up is set in another context- restart sending */
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ static int mmc_decode_cid(struct mmc_card *card)
|
|||||||
case 3: /* MMC v3.1 - v3.3 */
|
case 3: /* MMC v3.1 - v3.3 */
|
||||||
case 4: /* MMC v4 */
|
case 4: /* MMC v4 */
|
||||||
card->cid.manfid = UNSTUFF_BITS(resp, 120, 8);
|
card->cid.manfid = UNSTUFF_BITS(resp, 120, 8);
|
||||||
card->cid.oemid = UNSTUFF_BITS(resp, 104, 8);
|
card->cid.oemid = UNSTUFF_BITS(resp, 104, 16);
|
||||||
card->cid.prod_name[0] = UNSTUFF_BITS(resp, 96, 8);
|
card->cid.prod_name[0] = UNSTUFF_BITS(resp, 96, 8);
|
||||||
card->cid.prod_name[1] = UNSTUFF_BITS(resp, 88, 8);
|
card->cid.prod_name[1] = UNSTUFF_BITS(resp, 88, 8);
|
||||||
card->cid.prod_name[2] = UNSTUFF_BITS(resp, 80, 8);
|
card->cid.prod_name[2] = UNSTUFF_BITS(resp, 80, 8);
|
||||||
|
|||||||
@@ -7,12 +7,7 @@ obj-$(CONFIG_CAN_VCAN) += vcan.o
|
|||||||
obj-$(CONFIG_CAN_VXCAN) += vxcan.o
|
obj-$(CONFIG_CAN_VXCAN) += vxcan.o
|
||||||
obj-$(CONFIG_CAN_SLCAN) += slcan.o
|
obj-$(CONFIG_CAN_SLCAN) += slcan.o
|
||||||
|
|
||||||
obj-$(CONFIG_CAN_DEV) += can-dev.o
|
obj-y += dev/
|
||||||
can-dev-y += dev.o
|
|
||||||
can-dev-y += rx-offload.o
|
|
||||||
|
|
||||||
can-dev-$(CONFIG_CAN_LEDS) += led.o
|
|
||||||
|
|
||||||
obj-y += rcar/
|
obj-y += rcar/
|
||||||
obj-y += spi/
|
obj-y += spi/
|
||||||
obj-y += usb/
|
obj-y += usb/
|
||||||
|
|||||||
7
drivers/net/can/dev/Makefile
Normal file
7
drivers/net/can/dev/Makefile
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# SPDX-License-Identifier: GPL-2.0
|
||||||
|
|
||||||
|
obj-$(CONFIG_CAN_DEV) += can-dev.o
|
||||||
|
can-dev-y += dev.o
|
||||||
|
can-dev-y += rx-offload.o
|
||||||
|
|
||||||
|
can-dev-$(CONFIG_CAN_LEDS) += led.o
|
||||||
@@ -563,7 +563,8 @@ static void can_restart(struct net_device *dev)
|
|||||||
struct can_frame *cf;
|
struct can_frame *cf;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
BUG_ON(netif_carrier_ok(dev));
|
if (netif_carrier_ok(dev))
|
||||||
|
netdev_err(dev, "Attempt to restart for bus-off recovery, but carrier is OK?\n");
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* No synchronization needed because the device is bus-off and
|
* No synchronization needed because the device is bus-off and
|
||||||
@@ -589,11 +590,12 @@ static void can_restart(struct net_device *dev)
|
|||||||
priv->can_stats.restarts++;
|
priv->can_stats.restarts++;
|
||||||
|
|
||||||
/* Now restart the device */
|
/* Now restart the device */
|
||||||
err = priv->do_set_mode(dev, CAN_MODE_START);
|
|
||||||
|
|
||||||
netif_carrier_on(dev);
|
netif_carrier_on(dev);
|
||||||
if (err)
|
err = priv->do_set_mode(dev, CAN_MODE_START);
|
||||||
|
if (err) {
|
||||||
netdev_err(dev, "Error %d during restart", err);
|
netdev_err(dev, "Error %d during restart", err);
|
||||||
|
netif_carrier_off(dev);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static void can_restart_work(struct work_struct *work)
|
static void can_restart_work(struct work_struct *work)
|
||||||
@@ -18217,6 +18217,7 @@ static void tg3_shutdown(struct pci_dev *pdev)
|
|||||||
if (netif_running(dev))
|
if (netif_running(dev))
|
||||||
dev_close(dev);
|
dev_close(dev);
|
||||||
|
|
||||||
|
if (system_state == SYSTEM_POWER_OFF)
|
||||||
tg3_power_down(tp);
|
tg3_power_down(tp);
|
||||||
|
|
||||||
rtnl_unlock();
|
rtnl_unlock();
|
||||||
|
|||||||
@@ -14311,11 +14311,15 @@ static void i40e_remove(struct pci_dev *pdev)
|
|||||||
i40e_switch_branch_release(pf->veb[i]);
|
i40e_switch_branch_release(pf->veb[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Now we can shutdown the PF's VSI, just before we kill
|
/* Now we can shutdown the PF's VSIs, just before we kill
|
||||||
* adminq and hmc.
|
* adminq and hmc.
|
||||||
*/
|
*/
|
||||||
if (pf->vsi[pf->lan_vsi])
|
for (i = pf->num_alloc_vsi; i--;)
|
||||||
i40e_vsi_release(pf->vsi[pf->lan_vsi]);
|
if (pf->vsi[i]) {
|
||||||
|
i40e_vsi_close(pf->vsi[i]);
|
||||||
|
i40e_vsi_release(pf->vsi[i]);
|
||||||
|
pf->vsi[i] = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
i40e_cloud_filter_exit(pf);
|
i40e_cloud_filter_exit(pf);
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,7 @@
|
|||||||
|
|
||||||
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
|
/* Maximum number of multicast addresses to filter (vs. Rx-all-multicast).
|
||||||
The RTL chips use a 64 element hash table based on the Ethernet CRC. */
|
The RTL chips use a 64 element hash table based on the Ethernet CRC. */
|
||||||
static const int multicast_filter_limit = 32;
|
#define MC_FILTER_LIMIT 32
|
||||||
|
|
||||||
#define TX_DMA_BURST 7 /* Maximum PCI burst, '7' is unlimited */
|
#define TX_DMA_BURST 7 /* Maximum PCI burst, '7' is unlimited */
|
||||||
#define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */
|
#define InterFrameGap 0x03 /* 3 means InterFrameGap = the shortest one */
|
||||||
@@ -4614,54 +4614,50 @@ static void rtl8169_set_magic_reg(struct rtl8169_private *tp, unsigned mac_versi
|
|||||||
|
|
||||||
static void rtl_set_rx_mode(struct net_device *dev)
|
static void rtl_set_rx_mode(struct net_device *dev)
|
||||||
{
|
{
|
||||||
|
u32 rx_mode = AcceptBroadcast | AcceptMyPhys | AcceptMulticast;
|
||||||
|
/* Multicast hash filter */
|
||||||
|
u32 mc_filter[2] = { 0xffffffff, 0xffffffff };
|
||||||
struct rtl8169_private *tp = netdev_priv(dev);
|
struct rtl8169_private *tp = netdev_priv(dev);
|
||||||
u32 mc_filter[2]; /* Multicast hash filter */
|
u32 tmp;
|
||||||
int rx_mode;
|
|
||||||
u32 tmp = 0;
|
|
||||||
|
|
||||||
if (dev->flags & IFF_PROMISC) {
|
if (dev->flags & IFF_PROMISC) {
|
||||||
/* Unconditionally log net taps. */
|
/* Unconditionally log net taps. */
|
||||||
netif_notice(tp, link, dev, "Promiscuous mode enabled\n");
|
netif_notice(tp, link, dev, "Promiscuous mode enabled\n");
|
||||||
rx_mode =
|
rx_mode |= AcceptAllPhys;
|
||||||
AcceptBroadcast | AcceptMulticast | AcceptMyPhys |
|
} else if (!(dev->flags & IFF_MULTICAST)) {
|
||||||
AcceptAllPhys;
|
rx_mode &= ~AcceptMulticast;
|
||||||
mc_filter[1] = mc_filter[0] = 0xffffffff;
|
} else if (netdev_mc_count(dev) > MC_FILTER_LIMIT ||
|
||||||
} else if ((netdev_mc_count(dev) > multicast_filter_limit) ||
|
dev->flags & IFF_ALLMULTI ||
|
||||||
(dev->flags & IFF_ALLMULTI)) {
|
tp->mac_version == RTL_GIGA_MAC_VER_35 ||
|
||||||
/* Too many to filter perfectly -- accept all multicasts. */
|
tp->mac_version == RTL_GIGA_MAC_VER_46 ||
|
||||||
rx_mode = AcceptBroadcast | AcceptMulticast | AcceptMyPhys;
|
tp->mac_version == RTL_GIGA_MAC_VER_48) {
|
||||||
mc_filter[1] = mc_filter[0] = 0xffffffff;
|
/* accept all multicasts */
|
||||||
|
} else if (netdev_mc_empty(dev)) {
|
||||||
|
rx_mode &= ~AcceptMulticast;
|
||||||
} else {
|
} else {
|
||||||
struct netdev_hw_addr *ha;
|
struct netdev_hw_addr *ha;
|
||||||
|
|
||||||
rx_mode = AcceptBroadcast | AcceptMyPhys;
|
|
||||||
mc_filter[1] = mc_filter[0] = 0;
|
mc_filter[1] = mc_filter[0] = 0;
|
||||||
netdev_for_each_mc_addr(ha, dev) {
|
netdev_for_each_mc_addr(ha, dev) {
|
||||||
int bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
|
u32 bit_nr = ether_crc(ETH_ALEN, ha->addr) >> 26;
|
||||||
mc_filter[bit_nr >> 5] |= 1 << (bit_nr & 31);
|
mc_filter[bit_nr >> 5] |= BIT(bit_nr & 31);
|
||||||
rx_mode |= AcceptMulticast;
|
}
|
||||||
|
|
||||||
|
if (tp->mac_version > RTL_GIGA_MAC_VER_06) {
|
||||||
|
tmp = mc_filter[0];
|
||||||
|
mc_filter[0] = swab32(mc_filter[1]);
|
||||||
|
mc_filter[1] = swab32(tmp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dev->features & NETIF_F_RXALL)
|
if (dev->features & NETIF_F_RXALL)
|
||||||
rx_mode |= (AcceptErr | AcceptRunt);
|
rx_mode |= (AcceptErr | AcceptRunt);
|
||||||
|
|
||||||
tmp = (RTL_R32(tp, RxConfig) & ~RX_CONFIG_ACCEPT_MASK) | rx_mode;
|
|
||||||
|
|
||||||
if (tp->mac_version > RTL_GIGA_MAC_VER_06) {
|
|
||||||
u32 data = mc_filter[0];
|
|
||||||
|
|
||||||
mc_filter[0] = swab32(mc_filter[1]);
|
|
||||||
mc_filter[1] = swab32(data);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (tp->mac_version == RTL_GIGA_MAC_VER_35)
|
|
||||||
mc_filter[1] = mc_filter[0] = 0xffffffff;
|
|
||||||
|
|
||||||
RTL_W32(tp, MAR0 + 4, mc_filter[1]);
|
RTL_W32(tp, MAR0 + 4, mc_filter[1]);
|
||||||
RTL_W32(tp, MAR0 + 0, mc_filter[0]);
|
RTL_W32(tp, MAR0 + 0, mc_filter[0]);
|
||||||
|
|
||||||
RTL_W32(tp, RxConfig, tmp);
|
tmp = RTL_R32(tp, RxConfig);
|
||||||
|
RTL_W32(tp, RxConfig, (tmp & ~RX_CONFIG_ACCEPT_MASK) | rx_mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void rtl_hw_start(struct rtl8169_private *tp)
|
static void rtl_hw_start(struct rtl8169_private *tp)
|
||||||
|
|||||||
@@ -448,12 +448,12 @@ static int ipvlan_process_v4_outbound(struct sk_buff *skb)
|
|||||||
|
|
||||||
err = ip_local_out(net, skb->sk, skb);
|
err = ip_local_out(net, skb->sk, skb);
|
||||||
if (unlikely(net_xmit_eval(err)))
|
if (unlikely(net_xmit_eval(err)))
|
||||||
dev->stats.tx_errors++;
|
DEV_STATS_INC(dev, tx_errors);
|
||||||
else
|
else
|
||||||
ret = NET_XMIT_SUCCESS;
|
ret = NET_XMIT_SUCCESS;
|
||||||
goto out;
|
goto out;
|
||||||
err:
|
err:
|
||||||
dev->stats.tx_errors++;
|
DEV_STATS_INC(dev, tx_errors);
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
@@ -489,12 +489,12 @@ static int ipvlan_process_v6_outbound(struct sk_buff *skb)
|
|||||||
|
|
||||||
err = ip6_local_out(net, skb->sk, skb);
|
err = ip6_local_out(net, skb->sk, skb);
|
||||||
if (unlikely(net_xmit_eval(err)))
|
if (unlikely(net_xmit_eval(err)))
|
||||||
dev->stats.tx_errors++;
|
DEV_STATS_INC(dev, tx_errors);
|
||||||
else
|
else
|
||||||
ret = NET_XMIT_SUCCESS;
|
ret = NET_XMIT_SUCCESS;
|
||||||
goto out;
|
goto out;
|
||||||
err:
|
err:
|
||||||
dev->stats.tx_errors++;
|
DEV_STATS_INC(dev, tx_errors);
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
out:
|
out:
|
||||||
return ret;
|
return ret;
|
||||||
|
|||||||
@@ -392,6 +392,7 @@ static void ipvlan_get_stats64(struct net_device *dev,
|
|||||||
s->rx_dropped = rx_errs;
|
s->rx_dropped = rx_errs;
|
||||||
s->tx_dropped = tx_drps;
|
s->tx_dropped = tx_drps;
|
||||||
}
|
}
|
||||||
|
s->tx_errors = DEV_STATS_READ(dev, tx_errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int ipvlan_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
|
static int ipvlan_vlan_rx_add_vid(struct net_device *dev, __be16 proto, u16 vid)
|
||||||
|
|||||||
@@ -322,6 +322,19 @@ static struct macsec_rx_sa *macsec_rxsa_get(struct macsec_rx_sa __rcu *ptr)
|
|||||||
return sa;
|
return sa;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static struct macsec_rx_sa *macsec_active_rxsa_get(struct macsec_rx_sc *rx_sc)
|
||||||
|
{
|
||||||
|
struct macsec_rx_sa *sa = NULL;
|
||||||
|
int an;
|
||||||
|
|
||||||
|
for (an = 0; an < MACSEC_NUM_AN; an++) {
|
||||||
|
sa = macsec_rxsa_get(rx_sc->sa[an]);
|
||||||
|
if (sa)
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
return sa;
|
||||||
|
}
|
||||||
|
|
||||||
static void free_rx_sc_rcu(struct rcu_head *head)
|
static void free_rx_sc_rcu(struct rcu_head *head)
|
||||||
{
|
{
|
||||||
struct macsec_rx_sc *rx_sc = container_of(head, struct macsec_rx_sc, rcu_head);
|
struct macsec_rx_sc *rx_sc = container_of(head, struct macsec_rx_sc, rcu_head);
|
||||||
@@ -566,18 +579,28 @@ static void macsec_encrypt_finish(struct sk_buff *skb, struct net_device *dev)
|
|||||||
skb->protocol = eth_hdr(skb)->h_proto;
|
skb->protocol = eth_hdr(skb)->h_proto;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static unsigned int macsec_msdu_len(struct sk_buff *skb)
|
||||||
|
{
|
||||||
|
struct macsec_dev *macsec = macsec_priv(skb->dev);
|
||||||
|
struct macsec_secy *secy = &macsec->secy;
|
||||||
|
bool sci_present = macsec_skb_cb(skb)->has_sci;
|
||||||
|
|
||||||
|
return skb->len - macsec_hdr_len(sci_present) - secy->icv_len;
|
||||||
|
}
|
||||||
|
|
||||||
static void macsec_count_tx(struct sk_buff *skb, struct macsec_tx_sc *tx_sc,
|
static void macsec_count_tx(struct sk_buff *skb, struct macsec_tx_sc *tx_sc,
|
||||||
struct macsec_tx_sa *tx_sa)
|
struct macsec_tx_sa *tx_sa)
|
||||||
{
|
{
|
||||||
|
unsigned int msdu_len = macsec_msdu_len(skb);
|
||||||
struct pcpu_tx_sc_stats *txsc_stats = this_cpu_ptr(tx_sc->stats);
|
struct pcpu_tx_sc_stats *txsc_stats = this_cpu_ptr(tx_sc->stats);
|
||||||
|
|
||||||
u64_stats_update_begin(&txsc_stats->syncp);
|
u64_stats_update_begin(&txsc_stats->syncp);
|
||||||
if (tx_sc->encrypt) {
|
if (tx_sc->encrypt) {
|
||||||
txsc_stats->stats.OutOctetsEncrypted += skb->len;
|
txsc_stats->stats.OutOctetsEncrypted += msdu_len;
|
||||||
txsc_stats->stats.OutPktsEncrypted++;
|
txsc_stats->stats.OutPktsEncrypted++;
|
||||||
this_cpu_inc(tx_sa->stats->OutPktsEncrypted);
|
this_cpu_inc(tx_sa->stats->OutPktsEncrypted);
|
||||||
} else {
|
} else {
|
||||||
txsc_stats->stats.OutOctetsProtected += skb->len;
|
txsc_stats->stats.OutOctetsProtected += msdu_len;
|
||||||
txsc_stats->stats.OutPktsProtected++;
|
txsc_stats->stats.OutPktsProtected++;
|
||||||
this_cpu_inc(tx_sa->stats->OutPktsProtected);
|
this_cpu_inc(tx_sa->stats->OutPktsProtected);
|
||||||
}
|
}
|
||||||
@@ -607,9 +630,10 @@ static void macsec_encrypt_done(struct crypto_async_request *base, int err)
|
|||||||
aead_request_free(macsec_skb_cb(skb)->req);
|
aead_request_free(macsec_skb_cb(skb)->req);
|
||||||
|
|
||||||
rcu_read_lock_bh();
|
rcu_read_lock_bh();
|
||||||
macsec_encrypt_finish(skb, dev);
|
|
||||||
macsec_count_tx(skb, &macsec->secy.tx_sc, macsec_skb_cb(skb)->tx_sa);
|
macsec_count_tx(skb, &macsec->secy.tx_sc, macsec_skb_cb(skb)->tx_sa);
|
||||||
len = skb->len;
|
/* packet is encrypted/protected so tx_bytes must be calculated */
|
||||||
|
len = macsec_msdu_len(skb) + 2 * ETH_ALEN;
|
||||||
|
macsec_encrypt_finish(skb, dev);
|
||||||
ret = dev_queue_xmit(skb);
|
ret = dev_queue_xmit(skb);
|
||||||
count_tx(dev, ret, len);
|
count_tx(dev, ret, len);
|
||||||
rcu_read_unlock_bh();
|
rcu_read_unlock_bh();
|
||||||
@@ -765,6 +789,7 @@ static struct sk_buff *macsec_encrypt(struct sk_buff *skb,
|
|||||||
|
|
||||||
macsec_skb_cb(skb)->req = req;
|
macsec_skb_cb(skb)->req = req;
|
||||||
macsec_skb_cb(skb)->tx_sa = tx_sa;
|
macsec_skb_cb(skb)->tx_sa = tx_sa;
|
||||||
|
macsec_skb_cb(skb)->has_sci = sci_present;
|
||||||
aead_request_set_callback(req, 0, macsec_encrypt_done, skb);
|
aead_request_set_callback(req, 0, macsec_encrypt_done, skb);
|
||||||
|
|
||||||
dev_hold(skb->dev);
|
dev_hold(skb->dev);
|
||||||
@@ -805,15 +830,17 @@ static bool macsec_post_decrypt(struct sk_buff *skb, struct macsec_secy *secy, u
|
|||||||
u64_stats_update_begin(&rxsc_stats->syncp);
|
u64_stats_update_begin(&rxsc_stats->syncp);
|
||||||
rxsc_stats->stats.InPktsLate++;
|
rxsc_stats->stats.InPktsLate++;
|
||||||
u64_stats_update_end(&rxsc_stats->syncp);
|
u64_stats_update_end(&rxsc_stats->syncp);
|
||||||
|
DEV_STATS_INC(secy->netdev, rx_dropped);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (secy->validate_frames != MACSEC_VALIDATE_DISABLED) {
|
if (secy->validate_frames != MACSEC_VALIDATE_DISABLED) {
|
||||||
|
unsigned int msdu_len = macsec_msdu_len(skb);
|
||||||
u64_stats_update_begin(&rxsc_stats->syncp);
|
u64_stats_update_begin(&rxsc_stats->syncp);
|
||||||
if (hdr->tci_an & MACSEC_TCI_E)
|
if (hdr->tci_an & MACSEC_TCI_E)
|
||||||
rxsc_stats->stats.InOctetsDecrypted += skb->len;
|
rxsc_stats->stats.InOctetsDecrypted += msdu_len;
|
||||||
else
|
else
|
||||||
rxsc_stats->stats.InOctetsValidated += skb->len;
|
rxsc_stats->stats.InOctetsValidated += msdu_len;
|
||||||
u64_stats_update_end(&rxsc_stats->syncp);
|
u64_stats_update_end(&rxsc_stats->syncp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -826,6 +853,8 @@ static bool macsec_post_decrypt(struct sk_buff *skb, struct macsec_secy *secy, u
|
|||||||
u64_stats_update_begin(&rxsc_stats->syncp);
|
u64_stats_update_begin(&rxsc_stats->syncp);
|
||||||
rxsc_stats->stats.InPktsNotValid++;
|
rxsc_stats->stats.InPktsNotValid++;
|
||||||
u64_stats_update_end(&rxsc_stats->syncp);
|
u64_stats_update_end(&rxsc_stats->syncp);
|
||||||
|
this_cpu_inc(rx_sa->stats->InPktsNotValid);
|
||||||
|
DEV_STATS_INC(secy->netdev, rx_errors);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -911,9 +940,9 @@ static void macsec_decrypt_done(struct crypto_async_request *base, int err)
|
|||||||
|
|
||||||
macsec_finalize_skb(skb, macsec->secy.icv_len,
|
macsec_finalize_skb(skb, macsec->secy.icv_len,
|
||||||
macsec_extra_len(macsec_skb_cb(skb)->has_sci));
|
macsec_extra_len(macsec_skb_cb(skb)->has_sci));
|
||||||
|
len = skb->len;
|
||||||
macsec_reset_skb(skb, macsec->secy.netdev);
|
macsec_reset_skb(skb, macsec->secy.netdev);
|
||||||
|
|
||||||
len = skb->len;
|
|
||||||
if (gro_cells_receive(&macsec->gro_cells, skb) == NET_RX_SUCCESS)
|
if (gro_cells_receive(&macsec->gro_cells, skb) == NET_RX_SUCCESS)
|
||||||
count_rx(dev, len);
|
count_rx(dev, len);
|
||||||
|
|
||||||
@@ -1055,6 +1084,7 @@ static void handle_not_macsec(struct sk_buff *skb)
|
|||||||
u64_stats_update_begin(&secy_stats->syncp);
|
u64_stats_update_begin(&secy_stats->syncp);
|
||||||
secy_stats->stats.InPktsNoTag++;
|
secy_stats->stats.InPktsNoTag++;
|
||||||
u64_stats_update_end(&secy_stats->syncp);
|
u64_stats_update_end(&secy_stats->syncp);
|
||||||
|
DEV_STATS_INC(macsec->secy.netdev, rx_dropped);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1165,6 +1195,7 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
|
|||||||
u64_stats_update_begin(&secy_stats->syncp);
|
u64_stats_update_begin(&secy_stats->syncp);
|
||||||
secy_stats->stats.InPktsBadTag++;
|
secy_stats->stats.InPktsBadTag++;
|
||||||
u64_stats_update_end(&secy_stats->syncp);
|
u64_stats_update_end(&secy_stats->syncp);
|
||||||
|
DEV_STATS_INC(secy->netdev, rx_errors);
|
||||||
goto drop_nosa;
|
goto drop_nosa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1175,11 +1206,15 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
|
|||||||
/* If validateFrames is Strict or the C bit in the
|
/* If validateFrames is Strict or the C bit in the
|
||||||
* SecTAG is set, discard
|
* SecTAG is set, discard
|
||||||
*/
|
*/
|
||||||
|
struct macsec_rx_sa *active_rx_sa = macsec_active_rxsa_get(rx_sc);
|
||||||
if (hdr->tci_an & MACSEC_TCI_C ||
|
if (hdr->tci_an & MACSEC_TCI_C ||
|
||||||
secy->validate_frames == MACSEC_VALIDATE_STRICT) {
|
secy->validate_frames == MACSEC_VALIDATE_STRICT) {
|
||||||
u64_stats_update_begin(&rxsc_stats->syncp);
|
u64_stats_update_begin(&rxsc_stats->syncp);
|
||||||
rxsc_stats->stats.InPktsNotUsingSA++;
|
rxsc_stats->stats.InPktsNotUsingSA++;
|
||||||
u64_stats_update_end(&rxsc_stats->syncp);
|
u64_stats_update_end(&rxsc_stats->syncp);
|
||||||
|
DEV_STATS_INC(secy->netdev, rx_errors);
|
||||||
|
if (active_rx_sa)
|
||||||
|
this_cpu_inc(active_rx_sa->stats->InPktsNotUsingSA);
|
||||||
goto drop_nosa;
|
goto drop_nosa;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1189,6 +1224,8 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
|
|||||||
u64_stats_update_begin(&rxsc_stats->syncp);
|
u64_stats_update_begin(&rxsc_stats->syncp);
|
||||||
rxsc_stats->stats.InPktsUnusedSA++;
|
rxsc_stats->stats.InPktsUnusedSA++;
|
||||||
u64_stats_update_end(&rxsc_stats->syncp);
|
u64_stats_update_end(&rxsc_stats->syncp);
|
||||||
|
if (active_rx_sa)
|
||||||
|
this_cpu_inc(active_rx_sa->stats->InPktsUnusedSA);
|
||||||
goto deliver;
|
goto deliver;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1206,6 +1243,7 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
|
|||||||
u64_stats_update_begin(&rxsc_stats->syncp);
|
u64_stats_update_begin(&rxsc_stats->syncp);
|
||||||
rxsc_stats->stats.InPktsLate++;
|
rxsc_stats->stats.InPktsLate++;
|
||||||
u64_stats_update_end(&rxsc_stats->syncp);
|
u64_stats_update_end(&rxsc_stats->syncp);
|
||||||
|
DEV_STATS_INC(macsec->secy.netdev, rx_dropped);
|
||||||
goto drop;
|
goto drop;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1234,6 +1272,7 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
|
|||||||
deliver:
|
deliver:
|
||||||
macsec_finalize_skb(skb, secy->icv_len,
|
macsec_finalize_skb(skb, secy->icv_len,
|
||||||
macsec_extra_len(macsec_skb_cb(skb)->has_sci));
|
macsec_extra_len(macsec_skb_cb(skb)->has_sci));
|
||||||
|
len = skb->len;
|
||||||
macsec_reset_skb(skb, secy->netdev);
|
macsec_reset_skb(skb, secy->netdev);
|
||||||
|
|
||||||
if (rx_sa)
|
if (rx_sa)
|
||||||
@@ -1241,12 +1280,11 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
|
|||||||
macsec_rxsc_put(rx_sc);
|
macsec_rxsc_put(rx_sc);
|
||||||
|
|
||||||
skb_orphan(skb);
|
skb_orphan(skb);
|
||||||
len = skb->len;
|
|
||||||
ret = gro_cells_receive(&macsec->gro_cells, skb);
|
ret = gro_cells_receive(&macsec->gro_cells, skb);
|
||||||
if (ret == NET_RX_SUCCESS)
|
if (ret == NET_RX_SUCCESS)
|
||||||
count_rx(dev, len);
|
count_rx(dev, len);
|
||||||
else
|
else
|
||||||
macsec->secy.netdev->stats.rx_dropped++;
|
DEV_STATS_INC(macsec->secy.netdev, rx_dropped);
|
||||||
|
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
|
|
||||||
@@ -1283,6 +1321,7 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
|
|||||||
u64_stats_update_begin(&secy_stats->syncp);
|
u64_stats_update_begin(&secy_stats->syncp);
|
||||||
secy_stats->stats.InPktsNoSCI++;
|
secy_stats->stats.InPktsNoSCI++;
|
||||||
u64_stats_update_end(&secy_stats->syncp);
|
u64_stats_update_end(&secy_stats->syncp);
|
||||||
|
DEV_STATS_INC(macsec->secy.netdev, rx_errors);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1301,7 +1340,7 @@ static rx_handler_result_t macsec_handle_frame(struct sk_buff **pskb)
|
|||||||
secy_stats->stats.InPktsUnknownSCI++;
|
secy_stats->stats.InPktsUnknownSCI++;
|
||||||
u64_stats_update_end(&secy_stats->syncp);
|
u64_stats_update_end(&secy_stats->syncp);
|
||||||
} else {
|
} else {
|
||||||
macsec->secy.netdev->stats.rx_dropped++;
|
DEV_STATS_INC(macsec->secy.netdev, rx_dropped);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2733,21 +2772,21 @@ static netdev_tx_t macsec_start_xmit(struct sk_buff *skb,
|
|||||||
|
|
||||||
if (!secy->operational) {
|
if (!secy->operational) {
|
||||||
kfree_skb(skb);
|
kfree_skb(skb);
|
||||||
dev->stats.tx_dropped++;
|
DEV_STATS_INC(dev, tx_dropped);
|
||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
len = skb->len;
|
||||||
skb = macsec_encrypt(skb, dev);
|
skb = macsec_encrypt(skb, dev);
|
||||||
if (IS_ERR(skb)) {
|
if (IS_ERR(skb)) {
|
||||||
if (PTR_ERR(skb) != -EINPROGRESS)
|
if (PTR_ERR(skb) != -EINPROGRESS)
|
||||||
dev->stats.tx_dropped++;
|
DEV_STATS_INC(dev, tx_dropped);
|
||||||
return NETDEV_TX_OK;
|
return NETDEV_TX_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
macsec_count_tx(skb, &macsec->secy.tx_sc, macsec_skb_cb(skb)->tx_sa);
|
macsec_count_tx(skb, &macsec->secy.tx_sc, macsec_skb_cb(skb)->tx_sa);
|
||||||
|
|
||||||
macsec_encrypt_finish(skb, dev);
|
macsec_encrypt_finish(skb, dev);
|
||||||
len = skb->len;
|
|
||||||
ret = dev_queue_xmit(skb);
|
ret = dev_queue_xmit(skb);
|
||||||
count_tx(dev, ret, len);
|
count_tx(dev, ret, len);
|
||||||
return ret;
|
return ret;
|
||||||
@@ -2960,8 +2999,9 @@ static void macsec_get_stats64(struct net_device *dev,
|
|||||||
s->tx_bytes += tmp.tx_bytes;
|
s->tx_bytes += tmp.tx_bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
s->rx_dropped = dev->stats.rx_dropped;
|
s->rx_dropped = DEV_STATS_READ(dev, rx_dropped);
|
||||||
s->tx_dropped = dev->stats.tx_dropped;
|
s->tx_dropped = DEV_STATS_READ(dev, tx_dropped);
|
||||||
|
s->rx_errors = DEV_STATS_READ(dev, rx_errors);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int macsec_get_iflink(const struct net_device *dev)
|
static int macsec_get_iflink(const struct net_device *dev)
|
||||||
|
|||||||
@@ -827,7 +827,7 @@ static void rtl88e_dm_check_edca_turbo(struct ieee80211_hw *hw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rtlpriv->btcoexist.bt_edca_dl != 0) {
|
if (rtlpriv->btcoexist.bt_edca_dl != 0) {
|
||||||
edca_be_ul = rtlpriv->btcoexist.bt_edca_dl;
|
edca_be_dl = rtlpriv->btcoexist.bt_edca_dl;
|
||||||
bt_change_edca = true;
|
bt_change_edca = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -663,7 +663,7 @@ static void rtl92c_dm_check_edca_turbo(struct ieee80211_hw *hw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rtlpriv->btcoexist.bt_edca_dl != 0) {
|
if (rtlpriv->btcoexist.bt_edca_dl != 0) {
|
||||||
edca_be_ul = rtlpriv->btcoexist.bt_edca_dl;
|
edca_be_dl = rtlpriv->btcoexist.bt_edca_dl;
|
||||||
bt_change_edca = true;
|
bt_change_edca = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -592,7 +592,7 @@ static void rtl8723e_dm_check_edca_turbo(struct ieee80211_hw *hw)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (rtlpriv->btcoexist.bt_edca_dl != 0) {
|
if (rtlpriv->btcoexist.bt_edca_dl != 0) {
|
||||||
edca_be_ul = rtlpriv->btcoexist.bt_edca_dl;
|
edca_be_dl = rtlpriv->btcoexist.bt_edca_dl;
|
||||||
bt_change_edca = true;
|
bt_change_edca = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -949,7 +949,8 @@ unsigned int nd_region_acquire_lane(struct nd_region *nd_region)
|
|||||||
{
|
{
|
||||||
unsigned int cpu, lane;
|
unsigned int cpu, lane;
|
||||||
|
|
||||||
cpu = get_cpu();
|
migrate_disable();
|
||||||
|
cpu = smp_processor_id();
|
||||||
if (nd_region->num_lanes < nr_cpu_ids) {
|
if (nd_region->num_lanes < nr_cpu_ids) {
|
||||||
struct nd_percpu_lane *ndl_lock, *ndl_count;
|
struct nd_percpu_lane *ndl_lock, *ndl_count;
|
||||||
|
|
||||||
@@ -968,16 +969,15 @@ EXPORT_SYMBOL(nd_region_acquire_lane);
|
|||||||
void nd_region_release_lane(struct nd_region *nd_region, unsigned int lane)
|
void nd_region_release_lane(struct nd_region *nd_region, unsigned int lane)
|
||||||
{
|
{
|
||||||
if (nd_region->num_lanes < nr_cpu_ids) {
|
if (nd_region->num_lanes < nr_cpu_ids) {
|
||||||
unsigned int cpu = get_cpu();
|
unsigned int cpu = smp_processor_id();
|
||||||
struct nd_percpu_lane *ndl_lock, *ndl_count;
|
struct nd_percpu_lane *ndl_lock, *ndl_count;
|
||||||
|
|
||||||
ndl_count = per_cpu_ptr(nd_region->lane, cpu);
|
ndl_count = per_cpu_ptr(nd_region->lane, cpu);
|
||||||
ndl_lock = per_cpu_ptr(nd_region->lane, lane);
|
ndl_lock = per_cpu_ptr(nd_region->lane, lane);
|
||||||
if (--ndl_count->count == 0)
|
if (--ndl_count->count == 0)
|
||||||
spin_unlock(&ndl_lock->lock);
|
spin_unlock(&ndl_lock->lock);
|
||||||
put_cpu();
|
|
||||||
}
|
}
|
||||||
put_cpu();
|
migrate_enable();
|
||||||
}
|
}
|
||||||
EXPORT_SYMBOL(nd_region_release_lane);
|
EXPORT_SYMBOL(nd_region_release_lane);
|
||||||
|
|
||||||
|
|||||||
@@ -608,6 +608,7 @@ static int pccardd(void *__skt)
|
|||||||
dev_warn(&skt->dev, "PCMCIA: unable to register socket\n");
|
dev_warn(&skt->dev, "PCMCIA: unable to register socket\n");
|
||||||
skt->thread = NULL;
|
skt->thread = NULL;
|
||||||
complete(&skt->thread_done);
|
complete(&skt->thread_done);
|
||||||
|
put_device(&skt->dev);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
ret = pccard_sysfs_add_socket(&skt->dev);
|
ret = pccard_sysfs_add_socket(&skt->dev);
|
||||||
|
|||||||
@@ -521,9 +521,6 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s,
|
|||||||
/* by default don't allow DMA */
|
/* by default don't allow DMA */
|
||||||
p_dev->dma_mask = DMA_MASK_NONE;
|
p_dev->dma_mask = DMA_MASK_NONE;
|
||||||
p_dev->dev.dma_mask = &p_dev->dma_mask;
|
p_dev->dev.dma_mask = &p_dev->dma_mask;
|
||||||
dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no);
|
|
||||||
if (!dev_name(&p_dev->dev))
|
|
||||||
goto err_free;
|
|
||||||
p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev));
|
p_dev->devname = kasprintf(GFP_KERNEL, "pcmcia%s", dev_name(&p_dev->dev));
|
||||||
if (!p_dev->devname)
|
if (!p_dev->devname)
|
||||||
goto err_free;
|
goto err_free;
|
||||||
@@ -581,8 +578,15 @@ static struct pcmcia_device *pcmcia_device_add(struct pcmcia_socket *s,
|
|||||||
|
|
||||||
pcmcia_device_query(p_dev);
|
pcmcia_device_query(p_dev);
|
||||||
|
|
||||||
if (device_register(&p_dev->dev))
|
dev_set_name(&p_dev->dev, "%d.%d", p_dev->socket->sock, p_dev->device_no);
|
||||||
goto err_unreg;
|
if (device_register(&p_dev->dev)) {
|
||||||
|
mutex_lock(&s->ops_mutex);
|
||||||
|
list_del(&p_dev->socket_device_list);
|
||||||
|
s->device_count--;
|
||||||
|
mutex_unlock(&s->ops_mutex);
|
||||||
|
put_device(&p_dev->dev);
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
return p_dev;
|
return p_dev;
|
||||||
|
|
||||||
|
|||||||
@@ -172,7 +172,7 @@ static int get_subobj_info(acpi_handle handle, const char *pathname,
|
|||||||
|
|
||||||
static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable)
|
static acpi_status wmi_method_enable(struct wmi_block *wblock, int enable)
|
||||||
{
|
{
|
||||||
struct guid_block *block = NULL;
|
struct guid_block *block;
|
||||||
char method[5];
|
char method[5];
|
||||||
acpi_status status;
|
acpi_status status;
|
||||||
acpi_handle handle;
|
acpi_handle handle;
|
||||||
@@ -246,8 +246,8 @@ EXPORT_SYMBOL_GPL(wmi_evaluate_method);
|
|||||||
acpi_status wmidev_evaluate_method(struct wmi_device *wdev, u8 instance,
|
acpi_status wmidev_evaluate_method(struct wmi_device *wdev, u8 instance,
|
||||||
u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
|
u32 method_id, const struct acpi_buffer *in, struct acpi_buffer *out)
|
||||||
{
|
{
|
||||||
struct guid_block *block = NULL;
|
struct guid_block *block;
|
||||||
struct wmi_block *wblock = NULL;
|
struct wmi_block *wblock;
|
||||||
acpi_handle handle;
|
acpi_handle handle;
|
||||||
acpi_status status;
|
acpi_status status;
|
||||||
struct acpi_object_list input;
|
struct acpi_object_list input;
|
||||||
@@ -294,7 +294,7 @@ EXPORT_SYMBOL_GPL(wmidev_evaluate_method);
|
|||||||
static acpi_status __query_block(struct wmi_block *wblock, u8 instance,
|
static acpi_status __query_block(struct wmi_block *wblock, u8 instance,
|
||||||
struct acpi_buffer *out)
|
struct acpi_buffer *out)
|
||||||
{
|
{
|
||||||
struct guid_block *block = NULL;
|
struct guid_block *block;
|
||||||
acpi_handle handle;
|
acpi_handle handle;
|
||||||
acpi_status status, wc_status = AE_ERROR;
|
acpi_status status, wc_status = AE_ERROR;
|
||||||
struct acpi_object_list input;
|
struct acpi_object_list input;
|
||||||
@@ -409,8 +409,8 @@ EXPORT_SYMBOL_GPL(wmidev_block_query);
|
|||||||
acpi_status wmi_set_block(const char *guid_string, u8 instance,
|
acpi_status wmi_set_block(const char *guid_string, u8 instance,
|
||||||
const struct acpi_buffer *in)
|
const struct acpi_buffer *in)
|
||||||
{
|
{
|
||||||
struct guid_block *block = NULL;
|
|
||||||
struct wmi_block *wblock = NULL;
|
struct wmi_block *wblock = NULL;
|
||||||
|
struct guid_block *block;
|
||||||
acpi_handle handle;
|
acpi_handle handle;
|
||||||
struct acpi_object_list input;
|
struct acpi_object_list input;
|
||||||
union acpi_object params[2];
|
union acpi_object params[2];
|
||||||
@@ -793,21 +793,13 @@ static int wmi_dev_match(struct device *dev, struct device_driver *driver)
|
|||||||
}
|
}
|
||||||
static int wmi_char_open(struct inode *inode, struct file *filp)
|
static int wmi_char_open(struct inode *inode, struct file *filp)
|
||||||
{
|
{
|
||||||
const char *driver_name = filp->f_path.dentry->d_iname;
|
/*
|
||||||
struct wmi_block *wblock = NULL;
|
* The miscdevice already stores a pointer to itself
|
||||||
struct wmi_block *next = NULL;
|
* inside filp->private_data
|
||||||
|
*/
|
||||||
|
struct wmi_block *wblock = container_of(filp->private_data, struct wmi_block, char_dev);
|
||||||
|
|
||||||
list_for_each_entry_safe(wblock, next, &wmi_block_list, list) {
|
|
||||||
if (!wblock->dev.dev.driver)
|
|
||||||
continue;
|
|
||||||
if (strcmp(driver_name, wblock->dev.dev.driver->name) == 0) {
|
|
||||||
filp->private_data = wblock;
|
filp->private_data = wblock;
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!filp->private_data)
|
|
||||||
return -ENODEV;
|
|
||||||
|
|
||||||
return nonseekable_open(inode, filp);
|
return nonseekable_open(inode, filp);
|
||||||
}
|
}
|
||||||
@@ -827,8 +819,8 @@ static long wmi_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
|
|||||||
struct wmi_ioctl_buffer __user *input =
|
struct wmi_ioctl_buffer __user *input =
|
||||||
(struct wmi_ioctl_buffer __user *) arg;
|
(struct wmi_ioctl_buffer __user *) arg;
|
||||||
struct wmi_block *wblock = filp->private_data;
|
struct wmi_block *wblock = filp->private_data;
|
||||||
struct wmi_ioctl_buffer *buf = NULL;
|
struct wmi_ioctl_buffer *buf;
|
||||||
struct wmi_driver *wdriver = NULL;
|
struct wmi_driver *wdriver;
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
if (_IOC_TYPE(cmd) != WMI_IOC)
|
if (_IOC_TYPE(cmd) != WMI_IOC)
|
||||||
@@ -1131,8 +1123,8 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
|
|||||||
struct wmi_block *wblock, *next;
|
struct wmi_block *wblock, *next;
|
||||||
union acpi_object *obj;
|
union acpi_object *obj;
|
||||||
acpi_status status;
|
acpi_status status;
|
||||||
int retval = 0;
|
|
||||||
u32 i, total;
|
u32 i, total;
|
||||||
|
int retval;
|
||||||
|
|
||||||
status = acpi_evaluate_object(device->handle, "_WDG", NULL, &out);
|
status = acpi_evaluate_object(device->handle, "_WDG", NULL, &out);
|
||||||
if (ACPI_FAILURE(status))
|
if (ACPI_FAILURE(status))
|
||||||
@@ -1143,8 +1135,8 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
|
|||||||
return -ENXIO;
|
return -ENXIO;
|
||||||
|
|
||||||
if (obj->type != ACPI_TYPE_BUFFER) {
|
if (obj->type != ACPI_TYPE_BUFFER) {
|
||||||
retval = -ENXIO;
|
kfree(obj);
|
||||||
goto out_free_pointer;
|
return -ENXIO;
|
||||||
}
|
}
|
||||||
|
|
||||||
gblock = (const struct guid_block *)obj->buffer.pointer;
|
gblock = (const struct guid_block *)obj->buffer.pointer;
|
||||||
@@ -1165,8 +1157,8 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
|
|||||||
|
|
||||||
wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL);
|
wblock = kzalloc(sizeof(struct wmi_block), GFP_KERNEL);
|
||||||
if (!wblock) {
|
if (!wblock) {
|
||||||
retval = -ENOMEM;
|
dev_err(wmi_bus_dev, "Failed to allocate %pUL\n", &gblock[i].guid);
|
||||||
break;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
wblock->acpi_device = device;
|
wblock->acpi_device = device;
|
||||||
@@ -1205,9 +1197,9 @@ static int parse_wdg(struct device *wmi_bus_dev, struct acpi_device *device)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
out_free_pointer:
|
kfree(obj);
|
||||||
kfree(out.pointer);
|
|
||||||
return retval;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
@@ -307,7 +307,7 @@ static int brcmstb_pwm_suspend(struct device *dev)
|
|||||||
{
|
{
|
||||||
struct brcmstb_pwm *p = dev_get_drvdata(dev);
|
struct brcmstb_pwm *p = dev_get_drvdata(dev);
|
||||||
|
|
||||||
clk_disable(p->clk);
|
clk_disable_unprepare(p->clk);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -316,7 +316,7 @@ static int brcmstb_pwm_resume(struct device *dev)
|
|||||||
{
|
{
|
||||||
struct brcmstb_pwm *p = dev_get_drvdata(dev);
|
struct brcmstb_pwm *p = dev_get_drvdata(dev);
|
||||||
|
|
||||||
clk_enable(p->clk);
|
clk_prepare_enable(p->clk);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,6 +83,7 @@ struct sti_pwm_compat_data {
|
|||||||
unsigned int cpt_num_devs;
|
unsigned int cpt_num_devs;
|
||||||
unsigned int max_pwm_cnt;
|
unsigned int max_pwm_cnt;
|
||||||
unsigned int max_prescale;
|
unsigned int max_prescale;
|
||||||
|
struct sti_cpt_ddata *ddata;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct sti_pwm_chip {
|
struct sti_pwm_chip {
|
||||||
@@ -318,7 +319,7 @@ static int sti_pwm_capture(struct pwm_chip *chip, struct pwm_device *pwm,
|
|||||||
{
|
{
|
||||||
struct sti_pwm_chip *pc = to_sti_pwmchip(chip);
|
struct sti_pwm_chip *pc = to_sti_pwmchip(chip);
|
||||||
struct sti_pwm_compat_data *cdata = pc->cdata;
|
struct sti_pwm_compat_data *cdata = pc->cdata;
|
||||||
struct sti_cpt_ddata *ddata = pwm_get_chip_data(pwm);
|
struct sti_cpt_ddata *ddata = &cdata->ddata[pwm->hwpwm];
|
||||||
struct device *dev = pc->dev;
|
struct device *dev = pc->dev;
|
||||||
unsigned int effective_ticks;
|
unsigned int effective_ticks;
|
||||||
unsigned long long high, low;
|
unsigned long long high, low;
|
||||||
@@ -422,7 +423,7 @@ static irqreturn_t sti_pwm_interrupt(int irq, void *data)
|
|||||||
while (cpt_int_stat) {
|
while (cpt_int_stat) {
|
||||||
devicenum = ffs(cpt_int_stat) - 1;
|
devicenum = ffs(cpt_int_stat) - 1;
|
||||||
|
|
||||||
ddata = pwm_get_chip_data(&pc->chip.pwms[devicenum]);
|
ddata = &pc->cdata->ddata[devicenum];
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Capture input:
|
* Capture input:
|
||||||
@@ -600,9 +601,7 @@ static int sti_pwm_probe(struct platform_device *pdev)
|
|||||||
if (ret)
|
if (ret)
|
||||||
return ret;
|
return ret;
|
||||||
|
|
||||||
if (!cdata->pwm_num_devs)
|
if (cdata->pwm_num_devs) {
|
||||||
goto skip_pwm;
|
|
||||||
|
|
||||||
pc->pwm_clk = of_clk_get_by_name(dev->of_node, "pwm");
|
pc->pwm_clk = of_clk_get_by_name(dev->of_node, "pwm");
|
||||||
if (IS_ERR(pc->pwm_clk)) {
|
if (IS_ERR(pc->pwm_clk)) {
|
||||||
dev_err(dev, "failed to get PWM clock\n");
|
dev_err(dev, "failed to get PWM clock\n");
|
||||||
@@ -614,11 +613,9 @@ static int sti_pwm_probe(struct platform_device *pdev)
|
|||||||
dev_err(dev, "failed to prepare clock\n");
|
dev_err(dev, "failed to prepare clock\n");
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
skip_pwm:
|
if (cdata->cpt_num_devs) {
|
||||||
if (!cdata->cpt_num_devs)
|
|
||||||
goto skip_cpt;
|
|
||||||
|
|
||||||
pc->cpt_clk = of_clk_get_by_name(dev->of_node, "capture");
|
pc->cpt_clk = of_clk_get_by_name(dev->of_node, "capture");
|
||||||
if (IS_ERR(pc->cpt_clk)) {
|
if (IS_ERR(pc->cpt_clk)) {
|
||||||
dev_err(dev, "failed to get PWM capture clock\n");
|
dev_err(dev, "failed to get PWM capture clock\n");
|
||||||
@@ -631,12 +628,23 @@ static int sti_pwm_probe(struct platform_device *pdev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
skip_cpt:
|
cdata->ddata = devm_kzalloc(dev, cdata->cpt_num_devs * sizeof(*cdata->ddata), GFP_KERNEL);
|
||||||
|
if (!cdata->ddata)
|
||||||
|
return -ENOMEM;
|
||||||
|
}
|
||||||
|
|
||||||
pc->chip.dev = dev;
|
pc->chip.dev = dev;
|
||||||
pc->chip.ops = &sti_pwm_ops;
|
pc->chip.ops = &sti_pwm_ops;
|
||||||
pc->chip.base = -1;
|
pc->chip.base = -1;
|
||||||
pc->chip.npwm = pc->cdata->pwm_num_devs;
|
pc->chip.npwm = pc->cdata->pwm_num_devs;
|
||||||
|
|
||||||
|
for (i = 0; i < cdata->cpt_num_devs; i++) {
|
||||||
|
struct sti_cpt_ddata *ddata = &cdata->ddata[i];
|
||||||
|
|
||||||
|
init_waitqueue_head(&ddata->wait);
|
||||||
|
mutex_init(&ddata->lock);
|
||||||
|
}
|
||||||
|
|
||||||
ret = pwmchip_add(&pc->chip);
|
ret = pwmchip_add(&pc->chip);
|
||||||
if (ret < 0) {
|
if (ret < 0) {
|
||||||
clk_unprepare(pc->pwm_clk);
|
clk_unprepare(pc->pwm_clk);
|
||||||
@@ -644,19 +652,6 @@ static int sti_pwm_probe(struct platform_device *pdev)
|
|||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (i = 0; i < cdata->cpt_num_devs; i++) {
|
|
||||||
struct sti_cpt_ddata *ddata;
|
|
||||||
|
|
||||||
ddata = devm_kzalloc(dev, sizeof(*ddata), GFP_KERNEL);
|
|
||||||
if (!ddata)
|
|
||||||
return -ENOMEM;
|
|
||||||
|
|
||||||
init_waitqueue_head(&ddata->wait);
|
|
||||||
mutex_init(&ddata->lock);
|
|
||||||
|
|
||||||
pwm_set_chip_data(&pc->chip.pwms[i], ddata);
|
|
||||||
}
|
|
||||||
|
|
||||||
platform_set_drvdata(pdev, pc);
|
platform_set_drvdata(pdev, pc);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -765,7 +765,8 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
|
|||||||
if (result)
|
if (result)
|
||||||
goto release_ida;
|
goto release_ida;
|
||||||
|
|
||||||
sprintf(dev->attr_name, "cdev%d_trip_point", dev->id);
|
snprintf(dev->attr_name, sizeof(dev->attr_name), "cdev%d_trip_point",
|
||||||
|
dev->id);
|
||||||
sysfs_attr_init(&dev->attr.attr);
|
sysfs_attr_init(&dev->attr.attr);
|
||||||
dev->attr.attr.name = dev->attr_name;
|
dev->attr.attr.name = dev->attr_name;
|
||||||
dev->attr.attr.mode = 0644;
|
dev->attr.attr.mode = 0644;
|
||||||
@@ -775,7 +776,8 @@ int thermal_zone_bind_cooling_device(struct thermal_zone_device *tz,
|
|||||||
if (result)
|
if (result)
|
||||||
goto remove_symbol_link;
|
goto remove_symbol_link;
|
||||||
|
|
||||||
sprintf(dev->weight_attr_name, "cdev%d_weight", dev->id);
|
snprintf(dev->weight_attr_name, sizeof(dev->weight_attr_name),
|
||||||
|
"cdev%d_weight", dev->id);
|
||||||
sysfs_attr_init(&dev->weight_attr.attr);
|
sysfs_attr_init(&dev->weight_attr.attr);
|
||||||
dev->weight_attr.attr.name = dev->weight_attr_name;
|
dev->weight_attr.attr.name = dev->weight_attr_name;
|
||||||
dev->weight_attr.attr.mode = S_IWUSR | S_IRUGO;
|
dev->weight_attr.attr.mode = S_IWUSR | S_IRUGO;
|
||||||
|
|||||||
@@ -290,12 +290,7 @@ void disassociate_ctty(int on_exit)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
spin_lock_irq(¤t->sighand->siglock);
|
tty = get_current_tty();
|
||||||
put_pid(current->signal->tty_old_pgrp);
|
|
||||||
current->signal->tty_old_pgrp = NULL;
|
|
||||||
tty = tty_kref_get(current->signal->tty);
|
|
||||||
spin_unlock_irq(¤t->sighand->siglock);
|
|
||||||
|
|
||||||
if (tty) {
|
if (tty) {
|
||||||
unsigned long flags;
|
unsigned long flags;
|
||||||
|
|
||||||
@@ -310,6 +305,16 @@ void disassociate_ctty(int on_exit)
|
|||||||
tty_kref_put(tty);
|
tty_kref_put(tty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* If tty->ctrl.pgrp is not NULL, it may be assigned to
|
||||||
|
* current->signal->tty_old_pgrp in a race condition, and
|
||||||
|
* cause pid memleak. Release current->signal->tty_old_pgrp
|
||||||
|
* after tty->ctrl.pgrp set to NULL.
|
||||||
|
*/
|
||||||
|
spin_lock_irq(¤t->sighand->siglock);
|
||||||
|
put_pid(current->signal->tty_old_pgrp);
|
||||||
|
current->signal->tty_old_pgrp = NULL;
|
||||||
|
spin_unlock_irq(¤t->sighand->siglock);
|
||||||
|
|
||||||
/* Now clear signal->tty under the lock */
|
/* Now clear signal->tty under the lock */
|
||||||
read_lock(&tasklist_lock);
|
read_lock(&tasklist_lock);
|
||||||
session_clear_tty(task_session(current));
|
session_clear_tty(task_session(current));
|
||||||
|
|||||||
@@ -4845,8 +4845,8 @@ static int _dwc2_hcd_urb_enqueue(struct usb_hcd *hcd, struct urb *urb,
|
|||||||
if (qh_allocated && qh->channel && qh->channel->qh == qh)
|
if (qh_allocated && qh->channel && qh->channel->qh == qh)
|
||||||
qh->channel->qh = NULL;
|
qh->channel->qh = NULL;
|
||||||
fail2:
|
fail2:
|
||||||
spin_unlock_irqrestore(&hsotg->lock, flags);
|
|
||||||
urb->hcpriv = NULL;
|
urb->hcpriv = NULL;
|
||||||
|
spin_unlock_irqrestore(&hsotg->lock, flags);
|
||||||
kfree(qtd);
|
kfree(qtd);
|
||||||
qtd = NULL;
|
qtd = NULL;
|
||||||
fail1:
|
fail1:
|
||||||
|
|||||||
@@ -497,8 +497,13 @@ static void stub_disconnect(struct usb_device *udev)
|
|||||||
/* release port */
|
/* release port */
|
||||||
rc = usb_hub_release_port(udev->parent, udev->portnum,
|
rc = usb_hub_release_port(udev->parent, udev->portnum,
|
||||||
(struct usb_dev_state *) udev);
|
(struct usb_dev_state *) udev);
|
||||||
if (rc) {
|
/*
|
||||||
dev_dbg(&udev->dev, "unable to release port\n");
|
* NOTE: If a HUB disconnect triggered disconnect of the down stream
|
||||||
|
* device usb_hub_release_port will return -ENODEV so we can safely ignore
|
||||||
|
* that error here.
|
||||||
|
*/
|
||||||
|
if (rc && (rc != -ENODEV)) {
|
||||||
|
dev_dbg(&udev->dev, "unable to release port (%i)\n", rc);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -495,7 +495,7 @@ static enum fsl_diu_monitor_port fsl_diu_name_to_port(const char *s)
|
|||||||
* Workaround for failed writing desc register of planes.
|
* Workaround for failed writing desc register of planes.
|
||||||
* Needed with MPC5121 DIU rev 2.0 silicon.
|
* Needed with MPC5121 DIU rev 2.0 silicon.
|
||||||
*/
|
*/
|
||||||
void wr_reg_wa(u32 *reg, u32 val)
|
static void wr_reg_wa(u32 *reg, u32 val)
|
||||||
{
|
{
|
||||||
do {
|
do {
|
||||||
out_be32(reg, val);
|
out_be32(reg, val);
|
||||||
|
|||||||
@@ -1493,8 +1493,8 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||||||
|
|
||||||
if (!request_mem_region(addr, size, "imsttfb")) {
|
if (!request_mem_region(addr, size, "imsttfb")) {
|
||||||
printk(KERN_ERR "imsttfb: Can't reserve memory region\n");
|
printk(KERN_ERR "imsttfb: Can't reserve memory region\n");
|
||||||
framebuffer_release(info);
|
ret = -ENODEV;
|
||||||
return -ENODEV;
|
goto release_info;
|
||||||
}
|
}
|
||||||
|
|
||||||
switch (pdev->device) {
|
switch (pdev->device) {
|
||||||
@@ -1511,34 +1511,39 @@ static int imsttfb_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
|
|||||||
printk(KERN_INFO "imsttfb: Device 0x%x unknown, "
|
printk(KERN_INFO "imsttfb: Device 0x%x unknown, "
|
||||||
"contact maintainer.\n", pdev->device);
|
"contact maintainer.\n", pdev->device);
|
||||||
ret = -ENODEV;
|
ret = -ENODEV;
|
||||||
goto error;
|
goto release_mem_region;
|
||||||
}
|
}
|
||||||
|
|
||||||
info->fix.smem_start = addr;
|
info->fix.smem_start = addr;
|
||||||
info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ?
|
info->screen_base = (__u8 *)ioremap(addr, par->ramdac == IBM ?
|
||||||
0x400000 : 0x800000);
|
0x400000 : 0x800000);
|
||||||
if (!info->screen_base)
|
if (!info->screen_base)
|
||||||
goto error;
|
goto release_mem_region;
|
||||||
info->fix.mmio_start = addr + 0x800000;
|
info->fix.mmio_start = addr + 0x800000;
|
||||||
par->dc_regs = ioremap(addr + 0x800000, 0x1000);
|
par->dc_regs = ioremap(addr + 0x800000, 0x1000);
|
||||||
if (!par->dc_regs)
|
if (!par->dc_regs)
|
||||||
goto error;
|
goto unmap_screen_base;
|
||||||
par->cmap_regs_phys = addr + 0x840000;
|
par->cmap_regs_phys = addr + 0x840000;
|
||||||
par->cmap_regs = (__u8 *)ioremap(addr + 0x840000, 0x1000);
|
par->cmap_regs = (__u8 *)ioremap(addr + 0x840000, 0x1000);
|
||||||
if (!par->cmap_regs)
|
if (!par->cmap_regs)
|
||||||
goto error;
|
goto unmap_dc_regs;
|
||||||
info->pseudo_palette = par->palette;
|
info->pseudo_palette = par->palette;
|
||||||
ret = init_imstt(info);
|
ret = init_imstt(info);
|
||||||
if (!ret)
|
if (ret)
|
||||||
pci_set_drvdata(pdev, info);
|
goto unmap_cmap_regs;
|
||||||
return ret;
|
|
||||||
|
|
||||||
error:
|
pci_set_drvdata(pdev, info);
|
||||||
if (par->dc_regs)
|
return 0;
|
||||||
|
|
||||||
|
unmap_cmap_regs:
|
||||||
|
iounmap(par->cmap_regs);
|
||||||
|
unmap_dc_regs:
|
||||||
iounmap(par->dc_regs);
|
iounmap(par->dc_regs);
|
||||||
if (info->screen_base)
|
unmap_screen_base:
|
||||||
iounmap(info->screen_base);
|
iounmap(info->screen_base);
|
||||||
|
release_mem_region:
|
||||||
release_mem_region(addr, size);
|
release_mem_region(addr, size);
|
||||||
|
release_info:
|
||||||
framebuffer_release(info);
|
framebuffer_release(info);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2045,7 +2045,7 @@ static noinline int key_in_sk(struct btrfs_key *key,
|
|||||||
static noinline int copy_to_sk(struct btrfs_path *path,
|
static noinline int copy_to_sk(struct btrfs_path *path,
|
||||||
struct btrfs_key *key,
|
struct btrfs_key *key,
|
||||||
struct btrfs_ioctl_search_key *sk,
|
struct btrfs_ioctl_search_key *sk,
|
||||||
size_t *buf_size,
|
u64 *buf_size,
|
||||||
char __user *ubuf,
|
char __user *ubuf,
|
||||||
unsigned long *sk_offset,
|
unsigned long *sk_offset,
|
||||||
int *num_found)
|
int *num_found)
|
||||||
@@ -2177,7 +2177,7 @@ static noinline int copy_to_sk(struct btrfs_path *path,
|
|||||||
|
|
||||||
static noinline int search_ioctl(struct inode *inode,
|
static noinline int search_ioctl(struct inode *inode,
|
||||||
struct btrfs_ioctl_search_key *sk,
|
struct btrfs_ioctl_search_key *sk,
|
||||||
size_t *buf_size,
|
u64 *buf_size,
|
||||||
char __user *ubuf)
|
char __user *ubuf)
|
||||||
{
|
{
|
||||||
struct btrfs_fs_info *info = btrfs_sb(inode->i_sb);
|
struct btrfs_fs_info *info = btrfs_sb(inode->i_sb);
|
||||||
@@ -2249,7 +2249,7 @@ static noinline int btrfs_ioctl_tree_search(struct file *file,
|
|||||||
struct btrfs_ioctl_search_key sk;
|
struct btrfs_ioctl_search_key sk;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
int ret;
|
int ret;
|
||||||
size_t buf_size;
|
u64 buf_size;
|
||||||
|
|
||||||
if (!capable(CAP_SYS_ADMIN))
|
if (!capable(CAP_SYS_ADMIN))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
@@ -2283,8 +2283,8 @@ static noinline int btrfs_ioctl_tree_search_v2(struct file *file,
|
|||||||
struct btrfs_ioctl_search_args_v2 args;
|
struct btrfs_ioctl_search_args_v2 args;
|
||||||
struct inode *inode;
|
struct inode *inode;
|
||||||
int ret;
|
int ret;
|
||||||
size_t buf_size;
|
u64 buf_size;
|
||||||
const size_t buf_limit = SZ_16M;
|
const u64 buf_limit = SZ_16M;
|
||||||
|
|
||||||
if (!capable(CAP_SYS_ADMIN))
|
if (!capable(CAP_SYS_ADMIN))
|
||||||
return -EPERM;
|
return -EPERM;
|
||||||
|
|||||||
@@ -997,6 +997,11 @@ static int ext4_ext_insert_index(handle_t *handle, struct inode *inode,
|
|||||||
ix = curp->p_idx;
|
ix = curp->p_idx;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (unlikely(ix > EXT_MAX_INDEX(curp->p_hdr))) {
|
||||||
|
EXT4_ERROR_INODE(inode, "ix > EXT_MAX_INDEX!");
|
||||||
|
return -EFSCORRUPTED;
|
||||||
|
}
|
||||||
|
|
||||||
len = EXT_LAST_INDEX(curp->p_hdr) - ix + 1;
|
len = EXT_LAST_INDEX(curp->p_hdr) - ix + 1;
|
||||||
BUG_ON(len < 0);
|
BUG_ON(len < 0);
|
||||||
if (len > 0) {
|
if (len > 0) {
|
||||||
@@ -1006,11 +1011,6 @@ static int ext4_ext_insert_index(handle_t *handle, struct inode *inode,
|
|||||||
memmove(ix + 1, ix, len * sizeof(struct ext4_extent_idx));
|
memmove(ix + 1, ix, len * sizeof(struct ext4_extent_idx));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (unlikely(ix > EXT_MAX_INDEX(curp->p_hdr))) {
|
|
||||||
EXT4_ERROR_INODE(inode, "ix > EXT_MAX_INDEX!");
|
|
||||||
return -EFSCORRUPTED;
|
|
||||||
}
|
|
||||||
|
|
||||||
ix->ei_block = cpu_to_le32(logical);
|
ix->ei_block = cpu_to_le32(logical);
|
||||||
ext4_idx_store_pblock(ix, ptr);
|
ext4_idx_store_pblock(ix, ptr);
|
||||||
le16_add_cpu(&curp->p_hdr->eh_entries, 1);
|
le16_add_cpu(&curp->p_hdr->eh_entries, 1);
|
||||||
|
|||||||
@@ -3308,6 +3308,7 @@ int f2fs_precache_extents(struct inode *inode)
|
|||||||
return -EOPNOTSUPP;
|
return -EOPNOTSUPP;
|
||||||
|
|
||||||
map.m_lblk = 0;
|
map.m_lblk = 0;
|
||||||
|
map.m_pblk = 0;
|
||||||
map.m_next_pgofs = NULL;
|
map.m_next_pgofs = NULL;
|
||||||
map.m_next_extent = &m_next_extent;
|
map.m_next_extent = &m_next_extent;
|
||||||
map.m_seg_type = NO_CHECK_TYPE;
|
map.m_seg_type = NO_CHECK_TYPE;
|
||||||
|
|||||||
@@ -325,4 +325,34 @@ static inline void preempt_notifier_init(struct preempt_notifier *notifier,
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
/**
|
||||||
|
* migrate_disable - Prevent migration of the current task
|
||||||
|
*
|
||||||
|
* Maps to preempt_disable() which also disables preemption. Use
|
||||||
|
* migrate_disable() to annotate that the intent is to prevent migration,
|
||||||
|
* but not necessarily preemption.
|
||||||
|
*
|
||||||
|
* Can be invoked nested like preempt_disable() and needs the corresponding
|
||||||
|
* number of migrate_enable() invocations.
|
||||||
|
*/
|
||||||
|
static __always_inline void migrate_disable(void)
|
||||||
|
{
|
||||||
|
preempt_disable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* migrate_enable - Allow migration of the current task
|
||||||
|
*
|
||||||
|
* Counterpart to migrate_disable().
|
||||||
|
*
|
||||||
|
* As migrate_disable() can be invoked nested, only the outermost invocation
|
||||||
|
* reenables migration.
|
||||||
|
*
|
||||||
|
* Currently mapped to preempt_enable().
|
||||||
|
*/
|
||||||
|
static __always_inline void migrate_enable(void)
|
||||||
|
{
|
||||||
|
preempt_enable();
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __LINUX_PREEMPT_H */
|
#endif /* __LINUX_PREEMPT_H */
|
||||||
|
|||||||
@@ -466,16 +466,16 @@ unsigned int irq_matrix_reserved(struct irq_matrix *m)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* irq_matrix_allocated - Get the number of allocated irqs on the local cpu
|
* irq_matrix_allocated - Get the number of allocated non-managed irqs on the local CPU
|
||||||
* @m: Pointer to the matrix to search
|
* @m: Pointer to the matrix to search
|
||||||
*
|
*
|
||||||
* This returns number of allocated irqs
|
* This returns number of allocated non-managed interrupts.
|
||||||
*/
|
*/
|
||||||
unsigned int irq_matrix_allocated(struct irq_matrix *m)
|
unsigned int irq_matrix_allocated(struct irq_matrix *m)
|
||||||
{
|
{
|
||||||
struct cpumap *cm = this_cpu_ptr(m->maps);
|
struct cpumap *cm = this_cpu_ptr(m->maps);
|
||||||
|
|
||||||
return cm->allocated;
|
return cm->allocated - cm->managed_allocated;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef CONFIG_GENERIC_IRQ_DEBUGFS
|
#ifdef CONFIG_GENERIC_IRQ_DEBUGFS
|
||||||
|
|||||||
@@ -593,7 +593,8 @@ ssize_t ksys_readahead(int fd, loff_t offset, size_t count)
|
|||||||
*/
|
*/
|
||||||
ret = -EINVAL;
|
ret = -EINVAL;
|
||||||
if (!f.file->f_mapping || !f.file->f_mapping->a_ops ||
|
if (!f.file->f_mapping || !f.file->f_mapping->a_ops ||
|
||||||
!S_ISREG(file_inode(f.file)->i_mode))
|
(!S_ISREG(file_inode(f.file)->i_mode) &&
|
||||||
|
!S_ISBLK(file_inode(f.file)->i_mode)))
|
||||||
goto out;
|
goto out;
|
||||||
|
|
||||||
ret = vfs_fadvise(f.file, offset, count, POSIX_FADV_WILLNEED);
|
ret = vfs_fadvise(f.file, offset, count, POSIX_FADV_WILLNEED);
|
||||||
|
|||||||
@@ -612,9 +612,6 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
|
|||||||
if (dccp_parse_options(sk, dreq, skb))
|
if (dccp_parse_options(sk, dreq, skb))
|
||||||
goto drop_and_free;
|
goto drop_and_free;
|
||||||
|
|
||||||
if (security_inet_conn_request(sk, skb, req))
|
|
||||||
goto drop_and_free;
|
|
||||||
|
|
||||||
ireq = inet_rsk(req);
|
ireq = inet_rsk(req);
|
||||||
sk_rcv_saddr_set(req_to_sk(req), ip_hdr(skb)->daddr);
|
sk_rcv_saddr_set(req_to_sk(req), ip_hdr(skb)->daddr);
|
||||||
sk_daddr_set(req_to_sk(req), ip_hdr(skb)->saddr);
|
sk_daddr_set(req_to_sk(req), ip_hdr(skb)->saddr);
|
||||||
@@ -622,6 +619,9 @@ int dccp_v4_conn_request(struct sock *sk, struct sk_buff *skb)
|
|||||||
ireq->ireq_family = AF_INET;
|
ireq->ireq_family = AF_INET;
|
||||||
ireq->ir_iif = sk->sk_bound_dev_if;
|
ireq->ir_iif = sk->sk_bound_dev_if;
|
||||||
|
|
||||||
|
if (security_inet_conn_request(sk, skb, req))
|
||||||
|
goto drop_and_free;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Step 3: Process LISTEN state
|
* Step 3: Process LISTEN state
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -349,15 +349,15 @@ static int dccp_v6_conn_request(struct sock *sk, struct sk_buff *skb)
|
|||||||
if (dccp_parse_options(sk, dreq, skb))
|
if (dccp_parse_options(sk, dreq, skb))
|
||||||
goto drop_and_free;
|
goto drop_and_free;
|
||||||
|
|
||||||
if (security_inet_conn_request(sk, skb, req))
|
|
||||||
goto drop_and_free;
|
|
||||||
|
|
||||||
ireq = inet_rsk(req);
|
ireq = inet_rsk(req);
|
||||||
ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr;
|
ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr;
|
||||||
ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr;
|
ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr;
|
||||||
ireq->ireq_family = AF_INET6;
|
ireq->ireq_family = AF_INET6;
|
||||||
ireq->ir_mark = inet_request_mark(sk, skb);
|
ireq->ir_mark = inet_request_mark(sk, skb);
|
||||||
|
|
||||||
|
if (security_inet_conn_request(sk, skb, req))
|
||||||
|
goto drop_and_free;
|
||||||
|
|
||||||
if (ipv6_opt_accepted(sk, skb, IP6CB(skb)) ||
|
if (ipv6_opt_accepted(sk, skb, IP6CB(skb)) ||
|
||||||
np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
|
np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
|
||||||
np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) {
|
np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) {
|
||||||
|
|||||||
@@ -466,11 +466,15 @@ void tcp_init_metrics(struct sock *sk)
|
|||||||
u32 val, crtt = 0; /* cached RTT scaled by 8 */
|
u32 val, crtt = 0; /* cached RTT scaled by 8 */
|
||||||
|
|
||||||
sk_dst_confirm(sk);
|
sk_dst_confirm(sk);
|
||||||
|
/* ssthresh may have been reduced unnecessarily during.
|
||||||
|
* 3WHS. Restore it back to its initial default.
|
||||||
|
*/
|
||||||
|
tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
|
||||||
if (!dst)
|
if (!dst)
|
||||||
goto reset;
|
goto reset;
|
||||||
|
|
||||||
rcu_read_lock();
|
rcu_read_lock();
|
||||||
tm = tcp_get_metrics(sk, dst, true);
|
tm = tcp_get_metrics(sk, dst, false);
|
||||||
if (!tm) {
|
if (!tm) {
|
||||||
rcu_read_unlock();
|
rcu_read_unlock();
|
||||||
goto reset;
|
goto reset;
|
||||||
@@ -484,11 +488,6 @@ void tcp_init_metrics(struct sock *sk)
|
|||||||
tp->snd_ssthresh = val;
|
tp->snd_ssthresh = val;
|
||||||
if (tp->snd_ssthresh > tp->snd_cwnd_clamp)
|
if (tp->snd_ssthresh > tp->snd_cwnd_clamp)
|
||||||
tp->snd_ssthresh = tp->snd_cwnd_clamp;
|
tp->snd_ssthresh = tp->snd_cwnd_clamp;
|
||||||
} else {
|
|
||||||
/* ssthresh may have been reduced unnecessarily during.
|
|
||||||
* 3WHS. Restore it back to its initial default.
|
|
||||||
*/
|
|
||||||
tp->snd_ssthresh = TCP_INFINITE_SSTHRESH;
|
|
||||||
}
|
}
|
||||||
val = tcp_metric_get(tm, TCP_METRIC_REORDERING);
|
val = tcp_metric_get(tm, TCP_METRIC_REORDERING);
|
||||||
if (val && tp->reordering != val)
|
if (val && tp->reordering != val)
|
||||||
@@ -913,7 +912,7 @@ static void tcp_metrics_flush_all(struct net *net)
|
|||||||
match = net ? net_eq(tm_net(tm), net) :
|
match = net ? net_eq(tm_net(tm), net) :
|
||||||
!refcount_read(&tm_net(tm)->count);
|
!refcount_read(&tm_net(tm)->count);
|
||||||
if (match) {
|
if (match) {
|
||||||
*pp = tm->tcpm_next;
|
rcu_assign_pointer(*pp, tm->tcpm_next);
|
||||||
kfree_rcu(tm, rcu_head);
|
kfree_rcu(tm, rcu_head);
|
||||||
} else {
|
} else {
|
||||||
pp = &tm->tcpm_next;
|
pp = &tm->tcpm_next;
|
||||||
@@ -954,7 +953,7 @@ static int tcp_metrics_nl_cmd_del(struct sk_buff *skb, struct genl_info *info)
|
|||||||
if (addr_same(&tm->tcpm_daddr, &daddr) &&
|
if (addr_same(&tm->tcpm_daddr, &daddr) &&
|
||||||
(!src || addr_same(&tm->tcpm_saddr, &saddr)) &&
|
(!src || addr_same(&tm->tcpm_saddr, &saddr)) &&
|
||||||
net_eq(tm_net(tm), net)) {
|
net_eq(tm_net(tm), net)) {
|
||||||
*pp = tm->tcpm_next;
|
rcu_assign_pointer(*pp, tm->tcpm_next);
|
||||||
kfree_rcu(tm, rcu_head);
|
kfree_rcu(tm, rcu_head);
|
||||||
found = true;
|
found = true;
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -153,7 +153,13 @@ ip6_finish_output_gso_slowpath_drop(struct net *net, struct sock *sk,
|
|||||||
int err;
|
int err;
|
||||||
|
|
||||||
skb_mark_not_on_list(segs);
|
skb_mark_not_on_list(segs);
|
||||||
err = ip6_fragment(net, sk, segs, ip6_finish_output2);
|
/* Last GSO segment can be smaller than gso_size (and MTU).
|
||||||
|
* Adding a fragment header would produce an "atomic fragment",
|
||||||
|
* which is considered harmful (RFC-8021). Avoid that.
|
||||||
|
*/
|
||||||
|
err = segs->len > mtu ?
|
||||||
|
ip6_fragment(net, sk, segs, ip6_finish_output2) :
|
||||||
|
ip6_finish_output2(net, sk, segs);
|
||||||
if (err && ret == 0)
|
if (err && ret == 0)
|
||||||
ret = err;
|
ret = err;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,14 +184,15 @@ struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb)
|
|||||||
treq->af_specific = &tcp_request_sock_ipv6_ops;
|
treq->af_specific = &tcp_request_sock_ipv6_ops;
|
||||||
treq->tfo_listener = false;
|
treq->tfo_listener = false;
|
||||||
|
|
||||||
if (security_inet_conn_request(sk, skb, req))
|
|
||||||
goto out_free;
|
|
||||||
|
|
||||||
req->mss = mss;
|
req->mss = mss;
|
||||||
ireq->ir_rmt_port = th->source;
|
ireq->ir_rmt_port = th->source;
|
||||||
ireq->ir_num = ntohs(th->dest);
|
ireq->ir_num = ntohs(th->dest);
|
||||||
ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr;
|
ireq->ir_v6_rmt_addr = ipv6_hdr(skb)->saddr;
|
||||||
ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr;
|
ireq->ir_v6_loc_addr = ipv6_hdr(skb)->daddr;
|
||||||
|
|
||||||
|
if (security_inet_conn_request(sk, skb, req))
|
||||||
|
goto out_free;
|
||||||
|
|
||||||
if (ipv6_opt_accepted(sk, skb, &TCP_SKB_CB(skb)->header.h6) ||
|
if (ipv6_opt_accepted(sk, skb, &TCP_SKB_CB(skb)->header.h6) ||
|
||||||
np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
|
np->rxopt.bits.rxinfo || np->rxopt.bits.rxoinfo ||
|
||||||
np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) {
|
np->rxopt.bits.rxhlim || np->rxopt.bits.rxohlim) {
|
||||||
|
|||||||
@@ -127,8 +127,14 @@ static inline int llc_fixup_skb(struct sk_buff *skb)
|
|||||||
skb->transport_header += llc_len;
|
skb->transport_header += llc_len;
|
||||||
skb_pull(skb, llc_len);
|
skb_pull(skb, llc_len);
|
||||||
if (skb->protocol == htons(ETH_P_802_2)) {
|
if (skb->protocol == htons(ETH_P_802_2)) {
|
||||||
__be16 pdulen = eth_hdr(skb)->h_proto;
|
__be16 pdulen;
|
||||||
s32 data_size = ntohs(pdulen) - llc_len;
|
s32 data_size;
|
||||||
|
|
||||||
|
if (skb->mac_len < ETH_HLEN)
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
pdulen = eth_hdr(skb)->h_proto;
|
||||||
|
data_size = ntohs(pdulen) - llc_len;
|
||||||
|
|
||||||
if (data_size < 0 ||
|
if (data_size < 0 ||
|
||||||
!pskb_may_pull(skb, data_size))
|
!pskb_may_pull(skb, data_size))
|
||||||
|
|||||||
@@ -153,6 +153,9 @@ int llc_sap_action_send_test_r(struct llc_sap *sap, struct sk_buff *skb)
|
|||||||
int rc = 1;
|
int rc = 1;
|
||||||
u32 data_size;
|
u32 data_size;
|
||||||
|
|
||||||
|
if (skb->mac_len < ETH_HLEN)
|
||||||
|
return 1;
|
||||||
|
|
||||||
llc_pdu_decode_sa(skb, mac_da);
|
llc_pdu_decode_sa(skb, mac_da);
|
||||||
llc_pdu_decode_da(skb, mac_sa);
|
llc_pdu_decode_da(skb, mac_sa);
|
||||||
llc_pdu_decode_ssap(skb, &dsap);
|
llc_pdu_decode_ssap(skb, &dsap);
|
||||||
|
|||||||
@@ -77,6 +77,9 @@ static int llc_station_ac_send_test_r(struct sk_buff *skb)
|
|||||||
u32 data_size;
|
u32 data_size;
|
||||||
struct sk_buff *nskb;
|
struct sk_buff *nskb;
|
||||||
|
|
||||||
|
if (skb->mac_len < ETH_HLEN)
|
||||||
|
goto out;
|
||||||
|
|
||||||
/* The test request command is type U (llc_len = 3) */
|
/* The test request command is type U (llc_len = 3) */
|
||||||
data_size = ntohs(eth_hdr(skb)->h_proto) - 3;
|
data_size = ntohs(eth_hdr(skb)->h_proto) - 3;
|
||||||
nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, data_size);
|
nskb = llc_alloc_frame(NULL, skb->dev, LLC_PDU_TYPE_U, data_size);
|
||||||
|
|||||||
@@ -566,7 +566,7 @@ recent_mt_proc_write(struct file *file, const char __user *input,
|
|||||||
{
|
{
|
||||||
struct recent_table *t = PDE_DATA(file_inode(file));
|
struct recent_table *t = PDE_DATA(file_inode(file));
|
||||||
struct recent_entry *e;
|
struct recent_entry *e;
|
||||||
char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:5afe:c0de")];
|
char buf[sizeof("+b335:1d35:1e55:dead:c0de:1715:255.255.255.255")];
|
||||||
const char *c = buf;
|
const char *c = buf;
|
||||||
union nf_inet_addr addr = {};
|
union nf_inet_addr addr = {};
|
||||||
u_int16_t family;
|
u_int16_t family;
|
||||||
|
|||||||
@@ -141,34 +141,34 @@ static int smc_release(struct socket *sock)
|
|||||||
|
|
||||||
if (!smc->use_fallback) {
|
if (!smc->use_fallback) {
|
||||||
rc = smc_close_active(smc);
|
rc = smc_close_active(smc);
|
||||||
sock_set_flag(sk, SOCK_DEAD);
|
smc_sock_set_flag(sk, SOCK_DEAD);
|
||||||
sk->sk_shutdown |= SHUTDOWN_MASK;
|
sk->sk_shutdown |= SHUTDOWN_MASK;
|
||||||
|
} else {
|
||||||
|
if (sk->sk_state != SMC_LISTEN && sk->sk_state != SMC_INIT)
|
||||||
|
sock_put(sk); /* passive closing */
|
||||||
|
if (sk->sk_state == SMC_LISTEN) {
|
||||||
|
/* wake up clcsock accept */
|
||||||
|
rc = kernel_sock_shutdown(smc->clcsock, SHUT_RDWR);
|
||||||
|
}
|
||||||
|
sk->sk_state = SMC_CLOSED;
|
||||||
|
sk->sk_state_change(sk);
|
||||||
}
|
}
|
||||||
|
|
||||||
sk->sk_prot->unhash(sk);
|
sk->sk_prot->unhash(sk);
|
||||||
|
|
||||||
|
if (sk->sk_state == SMC_CLOSED) {
|
||||||
if (smc->clcsock) {
|
if (smc->clcsock) {
|
||||||
if (smc->use_fallback && sk->sk_state == SMC_LISTEN) {
|
release_sock(sk);
|
||||||
/* wake up clcsock accept */
|
smc_clcsock_release(smc);
|
||||||
rc = kernel_sock_shutdown(smc->clcsock, SHUT_RDWR);
|
lock_sock(sk);
|
||||||
}
|
}
|
||||||
mutex_lock(&smc->clcsock_release_lock);
|
if (!smc->use_fallback)
|
||||||
sock_release(smc->clcsock);
|
smc_conn_free(&smc->conn);
|
||||||
smc->clcsock = NULL;
|
|
||||||
mutex_unlock(&smc->clcsock_release_lock);
|
|
||||||
}
|
|
||||||
if (smc->use_fallback) {
|
|
||||||
if (sk->sk_state != SMC_LISTEN && sk->sk_state != SMC_INIT)
|
|
||||||
sock_put(sk); /* passive closing */
|
|
||||||
sk->sk_state = SMC_CLOSED;
|
|
||||||
sk->sk_state_change(sk);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* detach socket */
|
/* detach socket */
|
||||||
sock_orphan(sk);
|
sock_orphan(sk);
|
||||||
sock->sk = NULL;
|
sock->sk = NULL;
|
||||||
if (!smc->use_fallback && sk->sk_state == SMC_CLOSED)
|
|
||||||
smc_conn_free(&smc->conn);
|
|
||||||
release_sock(sk);
|
release_sock(sk);
|
||||||
|
|
||||||
sock_put(sk); /* final sock_put */
|
sock_put(sk); /* final sock_put */
|
||||||
@@ -852,7 +852,7 @@ static int smc_clcsock_accept(struct smc_sock *lsmc, struct smc_sock **new_smc)
|
|||||||
if (new_clcsock)
|
if (new_clcsock)
|
||||||
sock_release(new_clcsock);
|
sock_release(new_clcsock);
|
||||||
new_sk->sk_state = SMC_CLOSED;
|
new_sk->sk_state = SMC_CLOSED;
|
||||||
sock_set_flag(new_sk, SOCK_DEAD);
|
smc_sock_set_flag(new_sk, SOCK_DEAD);
|
||||||
sock_put(new_sk); /* final */
|
sock_put(new_sk); /* final */
|
||||||
*new_smc = NULL;
|
*new_smc = NULL;
|
||||||
goto out;
|
goto out;
|
||||||
@@ -1013,13 +1013,13 @@ static void smc_listen_out(struct smc_sock *new_smc)
|
|||||||
struct smc_sock *lsmc = new_smc->listen_smc;
|
struct smc_sock *lsmc = new_smc->listen_smc;
|
||||||
struct sock *newsmcsk = &new_smc->sk;
|
struct sock *newsmcsk = &new_smc->sk;
|
||||||
|
|
||||||
lock_sock_nested(&lsmc->sk, SINGLE_DEPTH_NESTING);
|
|
||||||
if (lsmc->sk.sk_state == SMC_LISTEN) {
|
if (lsmc->sk.sk_state == SMC_LISTEN) {
|
||||||
|
lock_sock_nested(&lsmc->sk, SINGLE_DEPTH_NESTING);
|
||||||
smc_accept_enqueue(&lsmc->sk, newsmcsk);
|
smc_accept_enqueue(&lsmc->sk, newsmcsk);
|
||||||
|
release_sock(&lsmc->sk);
|
||||||
} else { /* no longer listening */
|
} else { /* no longer listening */
|
||||||
smc_close_non_accepted(newsmcsk);
|
smc_close_non_accepted(newsmcsk);
|
||||||
}
|
}
|
||||||
release_sock(&lsmc->sk);
|
|
||||||
|
|
||||||
/* Wake up accept */
|
/* Wake up accept */
|
||||||
lsmc->sk.sk_data_ready(&lsmc->sk);
|
lsmc->sk.sk_data_ready(&lsmc->sk);
|
||||||
@@ -1215,6 +1215,9 @@ static void smc_listen_work(struct work_struct *work)
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
u8 ibport;
|
u8 ibport;
|
||||||
|
|
||||||
|
if (new_smc->listen_smc->sk.sk_state != SMC_LISTEN)
|
||||||
|
return smc_listen_out_err(new_smc);
|
||||||
|
|
||||||
if (new_smc->use_fallback) {
|
if (new_smc->use_fallback) {
|
||||||
smc_listen_out_connected(new_smc);
|
smc_listen_out_connected(new_smc);
|
||||||
return;
|
return;
|
||||||
|
|||||||
@@ -268,4 +268,9 @@ static inline bool using_ipsec(struct smc_sock *smc)
|
|||||||
struct sock *smc_accept_dequeue(struct sock *parent, struct socket *new_sock);
|
struct sock *smc_accept_dequeue(struct sock *parent, struct socket *new_sock);
|
||||||
void smc_close_non_accepted(struct sock *sk);
|
void smc_close_non_accepted(struct sock *sk);
|
||||||
|
|
||||||
|
static inline void smc_sock_set_flag(struct sock *sk, enum sock_flags flag)
|
||||||
|
{
|
||||||
|
set_bit(flag, &sk->sk_flags);
|
||||||
|
}
|
||||||
|
|
||||||
#endif /* __SMC_H */
|
#endif /* __SMC_H */
|
||||||
|
|||||||
@@ -304,7 +304,7 @@ static void smc_cdc_msg_recv_action(struct smc_sock *smc,
|
|||||||
smc->sk.sk_shutdown |= RCV_SHUTDOWN;
|
smc->sk.sk_shutdown |= RCV_SHUTDOWN;
|
||||||
if (smc->clcsock && smc->clcsock->sk)
|
if (smc->clcsock && smc->clcsock->sk)
|
||||||
smc->clcsock->sk->sk_shutdown |= RCV_SHUTDOWN;
|
smc->clcsock->sk->sk_shutdown |= RCV_SHUTDOWN;
|
||||||
sock_set_flag(&smc->sk, SOCK_DONE);
|
smc_sock_set_flag(&smc->sk, SOCK_DONE);
|
||||||
sock_hold(&smc->sk); /* sock_put in close_work */
|
sock_hold(&smc->sk); /* sock_put in close_work */
|
||||||
if (!schedule_work(&conn->close_work))
|
if (!schedule_work(&conn->close_work))
|
||||||
sock_put(&smc->sk);
|
sock_put(&smc->sk);
|
||||||
|
|||||||
@@ -21,6 +21,22 @@
|
|||||||
|
|
||||||
#define SMC_CLOSE_WAIT_LISTEN_CLCSOCK_TIME (5 * HZ)
|
#define SMC_CLOSE_WAIT_LISTEN_CLCSOCK_TIME (5 * HZ)
|
||||||
|
|
||||||
|
/* release the clcsock that is assigned to the smc_sock */
|
||||||
|
void smc_clcsock_release(struct smc_sock *smc)
|
||||||
|
{
|
||||||
|
struct socket *tcp;
|
||||||
|
|
||||||
|
if (smc->listen_smc && current_work() != &smc->smc_listen_work)
|
||||||
|
cancel_work_sync(&smc->smc_listen_work);
|
||||||
|
mutex_lock(&smc->clcsock_release_lock);
|
||||||
|
if (smc->clcsock) {
|
||||||
|
tcp = smc->clcsock;
|
||||||
|
smc->clcsock = NULL;
|
||||||
|
sock_release(tcp);
|
||||||
|
}
|
||||||
|
mutex_unlock(&smc->clcsock_release_lock);
|
||||||
|
}
|
||||||
|
|
||||||
static void smc_close_cleanup_listen(struct sock *parent)
|
static void smc_close_cleanup_listen(struct sock *parent)
|
||||||
{
|
{
|
||||||
struct sock *sk;
|
struct sock *sk;
|
||||||
@@ -148,7 +164,7 @@ static void smc_close_active_abort(struct smc_sock *smc)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
sock_set_flag(sk, SOCK_DEAD);
|
smc_sock_set_flag(sk, SOCK_DEAD);
|
||||||
sk->sk_state_change(sk);
|
sk->sk_state_change(sk);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -331,6 +347,7 @@ static void smc_close_passive_work(struct work_struct *work)
|
|||||||
close_work);
|
close_work);
|
||||||
struct smc_sock *smc = container_of(conn, struct smc_sock, conn);
|
struct smc_sock *smc = container_of(conn, struct smc_sock, conn);
|
||||||
struct smc_cdc_conn_state_flags *rxflags;
|
struct smc_cdc_conn_state_flags *rxflags;
|
||||||
|
bool release_clcsock = false;
|
||||||
struct sock *sk = &smc->sk;
|
struct sock *sk = &smc->sk;
|
||||||
int old_state;
|
int old_state;
|
||||||
|
|
||||||
@@ -415,10 +432,15 @@ static void smc_close_passive_work(struct work_struct *work)
|
|||||||
if (old_state != sk->sk_state) {
|
if (old_state != sk->sk_state) {
|
||||||
sk->sk_state_change(sk);
|
sk->sk_state_change(sk);
|
||||||
if ((sk->sk_state == SMC_CLOSED) &&
|
if ((sk->sk_state == SMC_CLOSED) &&
|
||||||
(sock_flag(sk, SOCK_DEAD) || !sk->sk_socket))
|
(sock_flag(sk, SOCK_DEAD) || !sk->sk_socket)) {
|
||||||
smc_conn_free(conn);
|
smc_conn_free(conn);
|
||||||
|
if (smc->clcsock)
|
||||||
|
release_clcsock = true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
release_sock(sk);
|
release_sock(sk);
|
||||||
|
if (release_clcsock)
|
||||||
|
smc_clcsock_release(smc);
|
||||||
sock_put(sk); /* sock_hold done by schedulers of close_work */
|
sock_put(sk); /* sock_hold done by schedulers of close_work */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,5 +23,6 @@ void smc_close_wake_tx_prepared(struct smc_sock *smc);
|
|||||||
int smc_close_active(struct smc_sock *smc);
|
int smc_close_active(struct smc_sock *smc);
|
||||||
int smc_close_shutdown_write(struct smc_sock *smc);
|
int smc_close_shutdown_write(struct smc_sock *smc);
|
||||||
void smc_close_init(struct smc_sock *smc);
|
void smc_close_init(struct smc_sock *smc);
|
||||||
|
void smc_clcsock_release(struct smc_sock *smc);
|
||||||
|
|
||||||
#endif /* SMC_CLOSE_H */
|
#endif /* SMC_CLOSE_H */
|
||||||
|
|||||||
@@ -87,7 +87,7 @@ const struct nla_policy tipc_nl_net_policy[TIPC_NLA_NET_MAX + 1] = {
|
|||||||
|
|
||||||
const struct nla_policy tipc_nl_link_policy[TIPC_NLA_LINK_MAX + 1] = {
|
const struct nla_policy tipc_nl_link_policy[TIPC_NLA_LINK_MAX + 1] = {
|
||||||
[TIPC_NLA_LINK_UNSPEC] = { .type = NLA_UNSPEC },
|
[TIPC_NLA_LINK_UNSPEC] = { .type = NLA_UNSPEC },
|
||||||
[TIPC_NLA_LINK_NAME] = { .type = NLA_STRING,
|
[TIPC_NLA_LINK_NAME] = { .type = NLA_NUL_STRING,
|
||||||
.len = TIPC_MAX_LINK_NAME },
|
.len = TIPC_MAX_LINK_NAME },
|
||||||
[TIPC_NLA_LINK_MTU] = { .type = NLA_U32 },
|
[TIPC_NLA_LINK_MTU] = { .type = NLA_U32 },
|
||||||
[TIPC_NLA_LINK_BROADCAST] = { .type = NLA_FLAG },
|
[TIPC_NLA_LINK_BROADCAST] = { .type = NLA_FLAG },
|
||||||
@@ -116,7 +116,7 @@ const struct nla_policy tipc_nl_prop_policy[TIPC_NLA_PROP_MAX + 1] = {
|
|||||||
|
|
||||||
const struct nla_policy tipc_nl_bearer_policy[TIPC_NLA_BEARER_MAX + 1] = {
|
const struct nla_policy tipc_nl_bearer_policy[TIPC_NLA_BEARER_MAX + 1] = {
|
||||||
[TIPC_NLA_BEARER_UNSPEC] = { .type = NLA_UNSPEC },
|
[TIPC_NLA_BEARER_UNSPEC] = { .type = NLA_UNSPEC },
|
||||||
[TIPC_NLA_BEARER_NAME] = { .type = NLA_STRING,
|
[TIPC_NLA_BEARER_NAME] = { .type = NLA_NUL_STRING,
|
||||||
.len = TIPC_MAX_BEARER_NAME },
|
.len = TIPC_MAX_BEARER_NAME },
|
||||||
[TIPC_NLA_BEARER_PROP] = { .type = NLA_NESTED },
|
[TIPC_NLA_BEARER_PROP] = { .type = NLA_NESTED },
|
||||||
[TIPC_NLA_BEARER_DOMAIN] = { .type = NLA_U32 }
|
[TIPC_NLA_BEARER_DOMAIN] = { .type = NLA_U32 }
|
||||||
|
|||||||
@@ -317,6 +317,7 @@ int snd_skl_parse_uuids(struct sst_dsp *ctx, const struct firmware *fw,
|
|||||||
module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL);
|
module->instance_id = devm_kzalloc(ctx->dev, size, GFP_KERNEL);
|
||||||
if (!module->instance_id) {
|
if (!module->instance_id) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
|
kfree(module);
|
||||||
goto free_uuid_list;
|
goto free_uuid_list;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -300,7 +300,7 @@ static int cx81801_open(struct tty_struct *tty)
|
|||||||
static void cx81801_close(struct tty_struct *tty)
|
static void cx81801_close(struct tty_struct *tty)
|
||||||
{
|
{
|
||||||
struct snd_soc_component *component = tty->disc_data;
|
struct snd_soc_component *component = tty->disc_data;
|
||||||
struct snd_soc_dapm_context *dapm = &component->card->dapm;
|
struct snd_soc_dapm_context *dapm;
|
||||||
|
|
||||||
del_timer_sync(&cx81801_timer);
|
del_timer_sync(&cx81801_timer);
|
||||||
|
|
||||||
@@ -312,6 +312,8 @@ static void cx81801_close(struct tty_struct *tty)
|
|||||||
|
|
||||||
v253_ops.close(tty);
|
v253_ops.close(tty);
|
||||||
|
|
||||||
|
dapm = &component->card->dapm;
|
||||||
|
|
||||||
/* Revert back to default audio input/output constellation */
|
/* Revert back to default audio input/output constellation */
|
||||||
snd_soc_dapm_mutex_lock(dapm);
|
snd_soc_dapm_mutex_lock(dapm);
|
||||||
|
|
||||||
|
|||||||
@@ -53,12 +53,15 @@ enum autochan {
|
|||||||
* Has the side effect of filling the channels[i].location values used
|
* Has the side effect of filling the channels[i].location values used
|
||||||
* in processing the buffer output.
|
* in processing the buffer output.
|
||||||
**/
|
**/
|
||||||
int size_from_channelarray(struct iio_channel_info *channels, int num_channels)
|
static unsigned int size_from_channelarray(struct iio_channel_info *channels, int num_channels)
|
||||||
{
|
{
|
||||||
int bytes = 0;
|
unsigned int bytes = 0;
|
||||||
int i = 0;
|
int i = 0, max = 0;
|
||||||
|
unsigned int misalignment;
|
||||||
|
|
||||||
while (i < num_channels) {
|
while (i < num_channels) {
|
||||||
|
if (channels[i].bytes > max)
|
||||||
|
max = channels[i].bytes;
|
||||||
if (bytes % channels[i].bytes == 0)
|
if (bytes % channels[i].bytes == 0)
|
||||||
channels[i].location = bytes;
|
channels[i].location = bytes;
|
||||||
else
|
else
|
||||||
@@ -68,11 +71,19 @@ int size_from_channelarray(struct iio_channel_info *channels, int num_channels)
|
|||||||
bytes = channels[i].location + channels[i].bytes;
|
bytes = channels[i].location + channels[i].bytes;
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
* We want the data in next sample to also be properly aligned so
|
||||||
|
* we'll add padding at the end if needed. Adding padding only
|
||||||
|
* works for channel data which size is 2^n bytes.
|
||||||
|
*/
|
||||||
|
misalignment = bytes % max;
|
||||||
|
if (misalignment)
|
||||||
|
bytes += max - misalignment;
|
||||||
|
|
||||||
return bytes;
|
return bytes;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print1byte(uint8_t input, struct iio_channel_info *info)
|
static void print1byte(uint8_t input, struct iio_channel_info *info)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Shift before conversion to avoid sign extension
|
* Shift before conversion to avoid sign extension
|
||||||
@@ -89,7 +100,7 @@ void print1byte(uint8_t input, struct iio_channel_info *info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void print2byte(uint16_t input, struct iio_channel_info *info)
|
static void print2byte(uint16_t input, struct iio_channel_info *info)
|
||||||
{
|
{
|
||||||
/* First swap if incorrect endian */
|
/* First swap if incorrect endian */
|
||||||
if (info->be)
|
if (info->be)
|
||||||
@@ -112,7 +123,7 @@ void print2byte(uint16_t input, struct iio_channel_info *info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void print4byte(uint32_t input, struct iio_channel_info *info)
|
static void print4byte(uint32_t input, struct iio_channel_info *info)
|
||||||
{
|
{
|
||||||
/* First swap if incorrect endian */
|
/* First swap if incorrect endian */
|
||||||
if (info->be)
|
if (info->be)
|
||||||
@@ -135,7 +146,7 @@ void print4byte(uint32_t input, struct iio_channel_info *info)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void print8byte(uint64_t input, struct iio_channel_info *info)
|
static void print8byte(uint64_t input, struct iio_channel_info *info)
|
||||||
{
|
{
|
||||||
/* First swap if incorrect endian */
|
/* First swap if incorrect endian */
|
||||||
if (info->be)
|
if (info->be)
|
||||||
@@ -171,8 +182,7 @@ void print8byte(uint64_t input, struct iio_channel_info *info)
|
|||||||
* to fill the location offsets.
|
* to fill the location offsets.
|
||||||
* @num_channels: number of channels
|
* @num_channels: number of channels
|
||||||
**/
|
**/
|
||||||
void process_scan(char *data,
|
static void process_scan(char *data, struct iio_channel_info *channels,
|
||||||
struct iio_channel_info *channels,
|
|
||||||
int num_channels)
|
int num_channels)
|
||||||
{
|
{
|
||||||
int k;
|
int k;
|
||||||
@@ -242,7 +252,7 @@ static int enable_disable_all_channels(char *dev_dir_name, int enable)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void print_usage(void)
|
static void print_usage(void)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Usage: generic_buffer [options]...\n"
|
fprintf(stderr, "Usage: generic_buffer [options]...\n"
|
||||||
"Capture, convert and output data from IIO device buffer\n"
|
"Capture, convert and output data from IIO device buffer\n"
|
||||||
@@ -261,12 +271,12 @@ void print_usage(void)
|
|||||||
" -w <n> Set delay between reads in us (event-less mode)\n");
|
" -w <n> Set delay between reads in us (event-less mode)\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
enum autochan autochannels = AUTOCHANNELS_DISABLED;
|
static enum autochan autochannels = AUTOCHANNELS_DISABLED;
|
||||||
char *dev_dir_name = NULL;
|
static char *dev_dir_name = NULL;
|
||||||
char *buf_dir_name = NULL;
|
static char *buf_dir_name = NULL;
|
||||||
bool current_trigger_set = false;
|
static bool current_trigger_set = false;
|
||||||
|
|
||||||
void cleanup(void)
|
static void cleanup(void)
|
||||||
{
|
{
|
||||||
int ret;
|
int ret;
|
||||||
|
|
||||||
@@ -298,14 +308,14 @@ void cleanup(void)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void sig_handler(int signum)
|
static void sig_handler(int signum)
|
||||||
{
|
{
|
||||||
fprintf(stderr, "Caught signal %d\n", signum);
|
fprintf(stderr, "Caught signal %d\n", signum);
|
||||||
cleanup();
|
cleanup();
|
||||||
exit(-signum);
|
exit(-signum);
|
||||||
}
|
}
|
||||||
|
|
||||||
void register_cleanup(void)
|
static void register_cleanup(void)
|
||||||
{
|
{
|
||||||
struct sigaction sa = { .sa_handler = sig_handler };
|
struct sigaction sa = { .sa_handler = sig_handler };
|
||||||
const int signums[] = { SIGINT, SIGTERM, SIGABRT };
|
const int signums[] = { SIGINT, SIGTERM, SIGABRT };
|
||||||
@@ -347,7 +357,7 @@ int main(int argc, char **argv)
|
|||||||
ssize_t read_size;
|
ssize_t read_size;
|
||||||
int dev_num = -1, trig_num = -1;
|
int dev_num = -1, trig_num = -1;
|
||||||
char *buffer_access = NULL;
|
char *buffer_access = NULL;
|
||||||
int scan_size;
|
unsigned int scan_size;
|
||||||
int noevents = 0;
|
int noevents = 0;
|
||||||
int notrigger = 0;
|
int notrigger = 0;
|
||||||
char *dummy;
|
char *dummy;
|
||||||
@@ -617,7 +627,16 @@ int main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
|
|
||||||
scan_size = size_from_channelarray(channels, num_channels);
|
scan_size = size_from_channelarray(channels, num_channels);
|
||||||
data = malloc(scan_size * buf_len);
|
|
||||||
|
size_t total_buf_len = scan_size * buf_len;
|
||||||
|
|
||||||
|
if (scan_size > 0 && total_buf_len / scan_size != buf_len) {
|
||||||
|
ret = -EFAULT;
|
||||||
|
perror("Integer overflow happened when calculate scan_size * buf_len");
|
||||||
|
goto error;
|
||||||
|
}
|
||||||
|
|
||||||
|
data = malloc(total_buf_len);
|
||||||
if (!data) {
|
if (!data) {
|
||||||
ret = -ENOMEM;
|
ret = -ENOMEM;
|
||||||
goto error;
|
goto error;
|
||||||
|
|||||||
Reference in New Issue
Block a user