Merge 6.1.78 into android14-6.1-lts

Changes in 6.1.78
	ext4: regenerate buddy after block freeing failed if under fc replay
	dmaengine: fsl-dpaa2-qdma: Fix the size of dma pools
	dmaengine: ti: k3-udma: Report short packet errors
	dmaengine: fsl-qdma: Fix a memory leak related to the status queue DMA
	dmaengine: fsl-qdma: Fix a memory leak related to the queue command DMA
	phy: renesas: rcar-gen3-usb2: Fix returning wrong error code
	dmaengine: fix is_slave_direction() return false when DMA_DEV_TO_DEV
	phy: ti: phy-omap-usb2: Fix NULL pointer dereference for SRP
	cifs: failure to add channel on iface should bump up weight
	drm/msms/dp: fixed link clock divider bits be over written in BPC unknown case
	drm/msm/dp: return correct Colorimetry for DP_TEST_DYNAMIC_RANGE_CEA case
	drm/msm/dpu: check for valid hw_pp in dpu_encoder_helper_phys_cleanup
	net: stmmac: xgmac: fix handling of DPP safety error for DMA channels
	wifi: mac80211: fix waiting for beacons logic
	netdevsim: avoid potential loop in nsim_dev_trap_report_work()
	net: atlantic: Fix DMA mapping for PTP hwts ring
	selftests: net: cut more slack for gro fwd tests.
	selftests: net: avoid just another constant wait
	tunnels: fix out of bounds access when building IPv6 PMTU error
	atm: idt77252: fix a memleak in open_card_ubr0
	octeontx2-pf: Fix a memleak otx2_sq_init
	hwmon: (aspeed-pwm-tacho) mutex for tach reading
	hwmon: (coretemp) Fix out-of-bounds memory access
	hwmon: (coretemp) Fix bogus core_id to attr name mapping
	inet: read sk->sk_family once in inet_recv_error()
	drm/i915/gvt: Fix uninitialized variable in handle_mmio()
	rxrpc: Fix response to PING RESPONSE ACKs to a dead call
	tipc: Check the bearer type before calling tipc_udp_nl_bearer_add()
	af_unix: Call kfree_skb() for dead unix_(sk)->oob_skb in GC.
	ppp_async: limit MRU to 64K
	selftests: cmsg_ipv6: repeat the exact packet
	netfilter: nft_compat: narrow down revision to unsigned 8-bits
	netfilter: nft_compat: reject unused compat flag
	netfilter: nft_compat: restrict match/target protocol to u16
	drm/amd/display: Implement bounds check for stream encoder creation in DCN301
	netfilter: nft_ct: reject direction for ct id
	netfilter: nft_set_pipapo: store index in scratch maps
	netfilter: nft_set_pipapo: add helper to release pcpu scratch area
	netfilter: nft_set_pipapo: remove scratch_aligned pointer
	fs/ntfs3: Fix an NULL dereference bug
	scsi: core: Move scsi_host_busy() out of host lock if it is for per-command
	blk-iocost: Fix an UBSAN shift-out-of-bounds warning
	fs: dlm: don't put dlm_local_addrs on heap
	mtd: parsers: ofpart: add workaround for #size-cells 0
	ALSA: usb-audio: Add delay quirk for MOTU M Series 2nd revision
	ALSA: usb-audio: Add a quirk for Yamaha YIT-W12TX transmitter
	ALSA: usb-audio: add quirk for RODE NT-USB+
	USB: serial: qcserial: add new usb-id for Dell Wireless DW5826e
	USB: serial: option: add Fibocom FM101-GL variant
	USB: serial: cp210x: add ID for IMST iM871A-USB
	usb: dwc3: host: Set XHCI_SG_TRB_CACHE_SIZE_QUIRK
	usb: host: xhci-plat: Add support for XHCI_SG_TRB_CACHE_SIZE_QUIRK
	hrtimer: Report offline hrtimer enqueue
	Input: i8042 - fix strange behavior of touchpad on Clevo NS70PU
	Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID
	io_uring/net: fix sr->len for IORING_OP_RECV with MSG_WAITALL and buffers
	Revert "ASoC: amd: Add new dmi entries for acp5x platform"
	vhost: use kzalloc() instead of kmalloc() followed by memset()
	RDMA/irdma: Fix support for 64k pages
	f2fs: add helper to check compression level
	block: treat poll queue enter similarly to timeouts
	clocksource: Skip watchdog check for large watchdog intervals
	net: stmmac: xgmac: use #define for string constants
	ALSA: usb-audio: Sort quirk table entries
	net: stmmac: xgmac: fix a typo of register name in DPP safety handling
	netfilter: nft_set_rbtree: skip end interval element from gc
	Linux 6.1.78

Change-Id: Iba16875d4cb88deffea077cf69495f9fe447ea23
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Greg Kroah-Hartman 2024-04-09 16:53:57 +00:00
commit 0e5af42a0a
66 changed files with 511 additions and 238 deletions

View File

@ -1,7 +1,7 @@
# SPDX-License-Identifier: GPL-2.0 # SPDX-License-Identifier: GPL-2.0
VERSION = 6 VERSION = 6
PATCHLEVEL = 1 PATCHLEVEL = 1
SUBLEVEL = 77 SUBLEVEL = 78
EXTRAVERSION = EXTRAVERSION =
NAME = Curry Ramen NAME = Curry Ramen

View File

@ -873,7 +873,16 @@ int bio_poll(struct bio *bio, struct io_comp_batch *iob, unsigned int flags)
*/ */
blk_flush_plug(current->plug, false); blk_flush_plug(current->plug, false);
if (bio_queue_enter(bio)) /*
* We need to be able to enter a frozen queue, similar to how
* timeouts also need to do that. If that is blocked, then we can
* have pending IO when a queue freeze is started, and then the
* wait for the freeze to finish will wait for polled requests to
* timeout as the poller is preventer from entering the queue and
* completing them. As long as we prevent new IO from being queued,
* that should be all that matters.
*/
if (!percpu_ref_tryget(&q->q_usage_counter))
return 0; return 0;
if (queue_is_mq(q)) { if (queue_is_mq(q)) {
ret = blk_mq_poll(q, cookie, iob, flags); ret = blk_mq_poll(q, cookie, iob, flags);

View File

@ -1337,6 +1337,13 @@ static bool iocg_kick_delay(struct ioc_gq *iocg, struct ioc_now *now)
lockdep_assert_held(&iocg->waitq.lock); lockdep_assert_held(&iocg->waitq.lock);
/*
* If the delay is set by another CPU, we may be in the past. No need to
* change anything if so. This avoids decay calculation underflow.
*/
if (time_before64(now->now, iocg->delay_at))
return false;
/* calculate the current delay in effect - 1/2 every second */ /* calculate the current delay in effect - 1/2 every second */
tdelta = now->now - iocg->delay_at; tdelta = now->now - iocg->delay_at;
if (iocg->delay) if (iocg->delay)

View File

@ -2930,6 +2930,8 @@ open_card_ubr0(struct idt77252_dev *card)
vc->scq = alloc_scq(card, vc->class); vc->scq = alloc_scq(card, vc->class);
if (!vc->scq) { if (!vc->scq) {
printk("%s: can't get SCQ.\n", card->name); printk("%s: can't get SCQ.\n", card->name);
kfree(card->vcs[0]);
card->vcs[0] = NULL;
return -ENOMEM; return -ENOMEM;
} }

View File

@ -38,15 +38,17 @@ static int dpaa2_qdma_alloc_chan_resources(struct dma_chan *chan)
if (!dpaa2_chan->fd_pool) if (!dpaa2_chan->fd_pool)
goto err; goto err;
dpaa2_chan->fl_pool = dma_pool_create("fl_pool", dev, dpaa2_chan->fl_pool =
sizeof(struct dpaa2_fl_entry), dma_pool_create("fl_pool", dev,
sizeof(struct dpaa2_fl_entry), 0); sizeof(struct dpaa2_fl_entry) * 3,
sizeof(struct dpaa2_fl_entry), 0);
if (!dpaa2_chan->fl_pool) if (!dpaa2_chan->fl_pool)
goto err_fd; goto err_fd;
dpaa2_chan->sdd_pool = dpaa2_chan->sdd_pool =
dma_pool_create("sdd_pool", dev, dma_pool_create("sdd_pool", dev,
sizeof(struct dpaa2_qdma_sd_d), sizeof(struct dpaa2_qdma_sd_d) * 2,
sizeof(struct dpaa2_qdma_sd_d), 0); sizeof(struct dpaa2_qdma_sd_d), 0);
if (!dpaa2_chan->sdd_pool) if (!dpaa2_chan->sdd_pool)
goto err_fl; goto err_fl;

View File

@ -514,11 +514,11 @@ static struct fsl_qdma_queue
queue_temp = queue_head + i + (j * queue_num); queue_temp = queue_head + i + (j * queue_num);
queue_temp->cq = queue_temp->cq =
dma_alloc_coherent(&pdev->dev, dmam_alloc_coherent(&pdev->dev,
sizeof(struct fsl_qdma_format) * sizeof(struct fsl_qdma_format) *
queue_size[i], queue_size[i],
&queue_temp->bus_addr, &queue_temp->bus_addr,
GFP_KERNEL); GFP_KERNEL);
if (!queue_temp->cq) if (!queue_temp->cq)
return NULL; return NULL;
queue_temp->block_base = fsl_qdma->block_base + queue_temp->block_base = fsl_qdma->block_base +
@ -563,11 +563,11 @@ static struct fsl_qdma_queue
/* /*
* Buffer for queue command * Buffer for queue command
*/ */
status_head->cq = dma_alloc_coherent(&pdev->dev, status_head->cq = dmam_alloc_coherent(&pdev->dev,
sizeof(struct fsl_qdma_format) * sizeof(struct fsl_qdma_format) *
status_size, status_size,
&status_head->bus_addr, &status_head->bus_addr,
GFP_KERNEL); GFP_KERNEL);
if (!status_head->cq) { if (!status_head->cq) {
devm_kfree(&pdev->dev, status_head); devm_kfree(&pdev->dev, status_head);
return NULL; return NULL;
@ -1272,8 +1272,6 @@ static void fsl_qdma_cleanup_vchan(struct dma_device *dmadev)
static int fsl_qdma_remove(struct platform_device *pdev) static int fsl_qdma_remove(struct platform_device *pdev)
{ {
int i;
struct fsl_qdma_queue *status;
struct device_node *np = pdev->dev.of_node; struct device_node *np = pdev->dev.of_node;
struct fsl_qdma_engine *fsl_qdma = platform_get_drvdata(pdev); struct fsl_qdma_engine *fsl_qdma = platform_get_drvdata(pdev);
@ -1282,11 +1280,6 @@ static int fsl_qdma_remove(struct platform_device *pdev)
of_dma_controller_free(np); of_dma_controller_free(np);
dma_async_device_unregister(&fsl_qdma->dma_dev); dma_async_device_unregister(&fsl_qdma->dma_dev);
for (i = 0; i < fsl_qdma->block_number; i++) {
status = fsl_qdma->status[i];
dma_free_coherent(&pdev->dev, sizeof(struct fsl_qdma_format) *
status->n_cq, status->cq, status->bus_addr);
}
return 0; return 0;
} }

View File

@ -3963,6 +3963,7 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc,
{ {
struct udma_chan *uc = to_udma_chan(&vc->chan); struct udma_chan *uc = to_udma_chan(&vc->chan);
struct udma_desc *d; struct udma_desc *d;
u8 status;
if (!vd) if (!vd)
return; return;
@ -3972,12 +3973,12 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc,
if (d->metadata_size) if (d->metadata_size)
udma_fetch_epib(uc, d); udma_fetch_epib(uc, d);
/* Provide residue information for the client */
if (result) { if (result) {
void *desc_vaddr = udma_curr_cppi5_desc_vaddr(d, d->desc_idx); void *desc_vaddr = udma_curr_cppi5_desc_vaddr(d, d->desc_idx);
if (cppi5_desc_get_type(desc_vaddr) == if (cppi5_desc_get_type(desc_vaddr) ==
CPPI5_INFO0_DESC_TYPE_VAL_HOST) { CPPI5_INFO0_DESC_TYPE_VAL_HOST) {
/* Provide residue information for the client */
result->residue = d->residue - result->residue = d->residue -
cppi5_hdesc_get_pktlen(desc_vaddr); cppi5_hdesc_get_pktlen(desc_vaddr);
if (result->residue) if (result->residue)
@ -3986,7 +3987,12 @@ static void udma_desc_pre_callback(struct virt_dma_chan *vc,
result->result = DMA_TRANS_NOERROR; result->result = DMA_TRANS_NOERROR;
} else { } else {
result->residue = 0; result->residue = 0;
result->result = DMA_TRANS_NOERROR; /* Propagate TR Response errors to the client */
status = d->hwdesc[0].tr_resp_base->status;
if (status)
result->result = DMA_TRANS_ABORTED;
else
result->result = DMA_TRANS_NOERROR;
} }
} }
} }

View File

@ -1014,7 +1014,7 @@ static struct stream_encoder *dcn301_stream_encoder_create(enum engine_id eng_id
vpg = dcn301_vpg_create(ctx, vpg_inst); vpg = dcn301_vpg_create(ctx, vpg_inst);
afmt = dcn301_afmt_create(ctx, afmt_inst); afmt = dcn301_afmt_create(ctx, afmt_inst);
if (!enc1 || !vpg || !afmt) { if (!enc1 || !vpg || !afmt || eng_id >= ARRAY_SIZE(stream_enc_regs)) {
kfree(enc1); kfree(enc1);
kfree(vpg); kfree(vpg);
kfree(afmt); kfree(afmt);

View File

@ -2844,8 +2844,7 @@ static int handle_mmio(struct intel_gvt_mmio_table_iter *iter, u32 offset,
for (i = start; i < end; i += 4) { for (i = start; i < end; i += 4) {
p = intel_gvt_find_mmio_info(gvt, i); p = intel_gvt_find_mmio_info(gvt, i);
if (p) { if (p) {
WARN(1, "dup mmio definition offset %x\n", WARN(1, "dup mmio definition offset %x\n", i);
info->offset);
/* We return -EEXIST here to make GVT-g load fail. /* We return -EEXIST here to make GVT-g load fail.
* So duplicated MMIO can be found as soon as * So duplicated MMIO can be found as soon as

View File

@ -2053,7 +2053,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)
} }
/* reset the merge 3D HW block */ /* reset the merge 3D HW block */
if (phys_enc->hw_pp->merge_3d) { if (phys_enc->hw_pp && phys_enc->hw_pp->merge_3d) {
phys_enc->hw_pp->merge_3d->ops.setup_3d_mode(phys_enc->hw_pp->merge_3d, phys_enc->hw_pp->merge_3d->ops.setup_3d_mode(phys_enc->hw_pp->merge_3d,
BLEND_3D_NONE); BLEND_3D_NONE);
if (phys_enc->hw_ctl->ops.update_pending_flush_merge_3d) if (phys_enc->hw_ctl->ops.update_pending_flush_merge_3d)
@ -2069,7 +2069,7 @@ void dpu_encoder_helper_phys_cleanup(struct dpu_encoder_phys *phys_enc)
if (phys_enc->hw_wb) if (phys_enc->hw_wb)
intf_cfg.wb = phys_enc->hw_wb->idx; intf_cfg.wb = phys_enc->hw_wb->idx;
if (phys_enc->hw_pp->merge_3d) if (phys_enc->hw_pp && phys_enc->hw_pp->merge_3d)
intf_cfg.merge_3d = phys_enc->hw_pp->merge_3d->idx; intf_cfg.merge_3d = phys_enc->hw_pp->merge_3d->idx;
if (ctl->ops.reset_intf_cfg) if (ctl->ops.reset_intf_cfg)

View File

@ -133,11 +133,6 @@ static void dp_ctrl_config_ctrl(struct dp_ctrl_private *ctrl)
tbd = dp_link_get_test_bits_depth(ctrl->link, tbd = dp_link_get_test_bits_depth(ctrl->link,
ctrl->panel->dp_mode.bpp); ctrl->panel->dp_mode.bpp);
if (tbd == DP_TEST_BIT_DEPTH_UNKNOWN) {
pr_debug("BIT_DEPTH not set. Configure default\n");
tbd = DP_TEST_BIT_DEPTH_8;
}
config |= tbd << DP_CONFIGURATION_CTRL_BPC_SHIFT; config |= tbd << DP_CONFIGURATION_CTRL_BPC_SHIFT;
/* Num of Lanes */ /* Num of Lanes */

View File

@ -7,6 +7,7 @@
#include <drm/drm_print.h> #include <drm/drm_print.h>
#include "dp_reg.h"
#include "dp_link.h" #include "dp_link.h"
#include "dp_panel.h" #include "dp_panel.h"
@ -1075,7 +1076,7 @@ int dp_link_process_request(struct dp_link *dp_link)
int dp_link_get_colorimetry_config(struct dp_link *dp_link) int dp_link_get_colorimetry_config(struct dp_link *dp_link)
{ {
u32 cc; u32 cc = DP_MISC0_COLORIMERY_CFG_LEGACY_RGB;
struct dp_link_private *link; struct dp_link_private *link;
if (!dp_link) { if (!dp_link) {
@ -1089,10 +1090,11 @@ int dp_link_get_colorimetry_config(struct dp_link *dp_link)
* Unless a video pattern CTS test is ongoing, use RGB_VESA * Unless a video pattern CTS test is ongoing, use RGB_VESA
* Only RGB_VESA and RGB_CEA supported for now * Only RGB_VESA and RGB_CEA supported for now
*/ */
if (dp_link_is_video_pattern_requested(link)) if (dp_link_is_video_pattern_requested(link)) {
cc = link->dp_link.test_video.test_dyn_range; if (link->dp_link.test_video.test_dyn_range &
else DP_TEST_DYNAMIC_RANGE_CEA)
cc = DP_TEST_DYNAMIC_RANGE_VESA; cc = DP_MISC0_COLORIMERY_CFG_CEA_RGB;
}
return cc; return cc;
} }
@ -1172,6 +1174,9 @@ void dp_link_reset_phy_params_vx_px(struct dp_link *dp_link)
u32 dp_link_get_test_bits_depth(struct dp_link *dp_link, u32 bpp) u32 dp_link_get_test_bits_depth(struct dp_link *dp_link, u32 bpp)
{ {
u32 tbd; u32 tbd;
struct dp_link_private *link;
link = container_of(dp_link, struct dp_link_private, dp_link);
/* /*
* Few simplistic rules and assumptions made here: * Few simplistic rules and assumptions made here:
@ -1189,12 +1194,13 @@ u32 dp_link_get_test_bits_depth(struct dp_link *dp_link, u32 bpp)
tbd = DP_TEST_BIT_DEPTH_10; tbd = DP_TEST_BIT_DEPTH_10;
break; break;
default: default:
tbd = DP_TEST_BIT_DEPTH_UNKNOWN; drm_dbg_dp(link->drm_dev, "bpp=%d not supported, use bpc=8\n",
bpp);
tbd = DP_TEST_BIT_DEPTH_8;
break; break;
} }
if (tbd != DP_TEST_BIT_DEPTH_UNKNOWN) tbd = (tbd >> DP_TEST_BIT_DEPTH_SHIFT);
tbd = (tbd >> DP_TEST_BIT_DEPTH_SHIFT);
return tbd; return tbd;
} }

View File

@ -129,6 +129,9 @@
#define DP_MISC0_COLORIMETRY_CFG_SHIFT (0x00000001) #define DP_MISC0_COLORIMETRY_CFG_SHIFT (0x00000001)
#define DP_MISC0_TEST_BITS_DEPTH_SHIFT (0x00000005) #define DP_MISC0_TEST_BITS_DEPTH_SHIFT (0x00000005)
#define DP_MISC0_COLORIMERY_CFG_LEGACY_RGB (0)
#define DP_MISC0_COLORIMERY_CFG_CEA_RGB (0x04)
#define REG_DP_VALID_BOUNDARY (0x00000030) #define REG_DP_VALID_BOUNDARY (0x00000030)
#define REG_DP_VALID_BOUNDARY_2 (0x00000034) #define REG_DP_VALID_BOUNDARY_2 (0x00000034)

View File

@ -194,6 +194,8 @@ struct aspeed_pwm_tacho_data {
u8 fan_tach_ch_source[16]; u8 fan_tach_ch_source[16];
struct aspeed_cooling_device *cdev[8]; struct aspeed_cooling_device *cdev[8];
const struct attribute_group *groups[3]; const struct attribute_group *groups[3];
/* protects access to shared ASPEED_PTCR_RESULT */
struct mutex tach_lock;
}; };
enum type { TYPEM, TYPEN, TYPEO }; enum type { TYPEM, TYPEN, TYPEO };
@ -528,6 +530,8 @@ static int aspeed_get_fan_tach_ch_rpm(struct aspeed_pwm_tacho_data *priv,
u8 fan_tach_ch_source, type, mode, both; u8 fan_tach_ch_source, type, mode, both;
int ret; int ret;
mutex_lock(&priv->tach_lock);
regmap_write(priv->regmap, ASPEED_PTCR_TRIGGER, 0); regmap_write(priv->regmap, ASPEED_PTCR_TRIGGER, 0);
regmap_write(priv->regmap, ASPEED_PTCR_TRIGGER, 0x1 << fan_tach_ch); regmap_write(priv->regmap, ASPEED_PTCR_TRIGGER, 0x1 << fan_tach_ch);
@ -545,6 +549,8 @@ static int aspeed_get_fan_tach_ch_rpm(struct aspeed_pwm_tacho_data *priv,
ASPEED_RPM_STATUS_SLEEP_USEC, ASPEED_RPM_STATUS_SLEEP_USEC,
usec); usec);
mutex_unlock(&priv->tach_lock);
/* return -ETIMEDOUT if we didn't get an answer. */ /* return -ETIMEDOUT if we didn't get an answer. */
if (ret) if (ret)
return ret; return ret;
@ -904,6 +910,7 @@ static int aspeed_pwm_tacho_probe(struct platform_device *pdev)
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
mutex_init(&priv->tach_lock);
priv->regmap = devm_regmap_init(dev, NULL, (__force void *)regs, priv->regmap = devm_regmap_init(dev, NULL, (__force void *)regs,
&aspeed_pwm_tacho_regmap_config); &aspeed_pwm_tacho_regmap_config);
if (IS_ERR(priv->regmap)) if (IS_ERR(priv->regmap))

View File

@ -380,7 +380,7 @@ static int get_tjmax(struct cpuinfo_x86 *c, u32 id, struct device *dev)
} }
static int create_core_attrs(struct temp_data *tdata, struct device *dev, static int create_core_attrs(struct temp_data *tdata, struct device *dev,
int attr_no) int index)
{ {
int i; int i;
static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev, static ssize_t (*const rd_ptr[TOTAL_ATTRS]) (struct device *dev,
@ -392,13 +392,20 @@ static int create_core_attrs(struct temp_data *tdata, struct device *dev,
}; };
for (i = 0; i < tdata->attr_size; i++) { for (i = 0; i < tdata->attr_size; i++) {
/*
* We map the attr number to core id of the CPU
* The attr number is always core id + 2
* The Pkgtemp will always show up as temp1_*, if available
*/
int attr_no = tdata->is_pkg_data ? 1 : tdata->cpu_core_id + 2;
snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH, snprintf(tdata->attr_name[i], CORETEMP_NAME_LENGTH,
"temp%d_%s", attr_no, suffixes[i]); "temp%d_%s", attr_no, suffixes[i]);
sysfs_attr_init(&tdata->sd_attrs[i].dev_attr.attr); sysfs_attr_init(&tdata->sd_attrs[i].dev_attr.attr);
tdata->sd_attrs[i].dev_attr.attr.name = tdata->attr_name[i]; tdata->sd_attrs[i].dev_attr.attr.name = tdata->attr_name[i];
tdata->sd_attrs[i].dev_attr.attr.mode = 0444; tdata->sd_attrs[i].dev_attr.attr.mode = 0444;
tdata->sd_attrs[i].dev_attr.show = rd_ptr[i]; tdata->sd_attrs[i].dev_attr.show = rd_ptr[i];
tdata->sd_attrs[i].index = attr_no; tdata->sd_attrs[i].index = index;
tdata->attrs[i] = &tdata->sd_attrs[i].dev_attr.attr; tdata->attrs[i] = &tdata->sd_attrs[i].dev_attr.attr;
} }
tdata->attr_group.attrs = tdata->attrs; tdata->attr_group.attrs = tdata->attrs;
@ -456,27 +463,22 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu,
struct platform_data *pdata = platform_get_drvdata(pdev); struct platform_data *pdata = platform_get_drvdata(pdev);
struct cpuinfo_x86 *c = &cpu_data(cpu); struct cpuinfo_x86 *c = &cpu_data(cpu);
u32 eax, edx; u32 eax, edx;
int err, index, attr_no; int err, index;
/* /*
* Find attr number for sysfs: * Get the index of tdata in pdata->core_data[]
* We map the attr number to core id of the CPU * tdata for package: pdata->core_data[1]
* The attr number is always core id + 2 * tdata for core: pdata->core_data[2] .. pdata->core_data[NUM_REAL_CORES + 1]
* The Pkgtemp will always show up as temp1_*, if available
*/ */
if (pkg_flag) { if (pkg_flag) {
attr_no = PKG_SYSFS_ATTR_NO; index = PKG_SYSFS_ATTR_NO;
} else { } else {
index = ida_alloc(&pdata->ida, GFP_KERNEL); index = ida_alloc_max(&pdata->ida, NUM_REAL_CORES - 1, GFP_KERNEL);
if (index < 0) if (index < 0)
return index; return index;
pdata->cpu_map[index] = topology_core_id(cpu);
attr_no = index + BASE_SYSFS_ATTR_NO;
}
if (attr_no > MAX_CORE_DATA - 1) { pdata->cpu_map[index] = topology_core_id(cpu);
err = -ERANGE; index += BASE_SYSFS_ATTR_NO;
goto ida_free;
} }
tdata = init_temp_data(cpu, pkg_flag); tdata = init_temp_data(cpu, pkg_flag);
@ -508,20 +510,20 @@ static int create_core_data(struct platform_device *pdev, unsigned int cpu,
} }
} }
pdata->core_data[attr_no] = tdata; pdata->core_data[index] = tdata;
/* Create sysfs interfaces */ /* Create sysfs interfaces */
err = create_core_attrs(tdata, pdata->hwmon_dev, attr_no); err = create_core_attrs(tdata, pdata->hwmon_dev, index);
if (err) if (err)
goto exit_free; goto exit_free;
return 0; return 0;
exit_free: exit_free:
pdata->core_data[attr_no] = NULL; pdata->core_data[index] = NULL;
kfree(tdata); kfree(tdata);
ida_free: ida_free:
if (!pkg_flag) if (!pkg_flag)
ida_free(&pdata->ida, index); ida_free(&pdata->ida, index - BASE_SYSFS_ATTR_NO);
return err; return err;
} }

View File

@ -2825,7 +2825,7 @@ static struct ib_mr *irdma_reg_user_mr(struct ib_pd *pd, u64 start, u64 len,
iwmr->ibmr.pd = pd; iwmr->ibmr.pd = pd;
iwmr->ibmr.device = pd->device; iwmr->ibmr.device = pd->device;
iwmr->ibmr.iova = virt; iwmr->ibmr.iova = virt;
iwmr->page_size = PAGE_SIZE; iwmr->page_size = SZ_4K;
if (req.reg_type == IRDMA_MEMREG_TYPE_MEM) { if (req.reg_type == IRDMA_MEMREG_TYPE_MEM) {
iwmr->page_size = ib_umem_find_best_pgsz(region, iwmr->page_size = ib_umem_find_best_pgsz(region,

View File

@ -792,7 +792,6 @@ static int atkbd_probe(struct atkbd *atkbd)
{ {
struct ps2dev *ps2dev = &atkbd->ps2dev; struct ps2dev *ps2dev = &atkbd->ps2dev;
unsigned char param[2]; unsigned char param[2];
bool skip_getid;
/* /*
* Some systems, where the bit-twiddling when testing the io-lines of the * Some systems, where the bit-twiddling when testing the io-lines of the
@ -806,6 +805,11 @@ static int atkbd_probe(struct atkbd *atkbd)
"keyboard reset failed on %s\n", "keyboard reset failed on %s\n",
ps2dev->serio->phys); ps2dev->serio->phys);
if (atkbd_skip_getid(atkbd)) {
atkbd->id = 0xab83;
return 0;
}
/* /*
* Then we check the keyboard ID. We should get 0xab83 under normal conditions. * Then we check the keyboard ID. We should get 0xab83 under normal conditions.
* Some keyboards report different values, but the first byte is always 0xab or * Some keyboards report different values, but the first byte is always 0xab or
@ -814,18 +818,17 @@ static int atkbd_probe(struct atkbd *atkbd)
*/ */
param[0] = param[1] = 0xa5; /* initialize with invalid values */ param[0] = param[1] = 0xa5; /* initialize with invalid values */
skip_getid = atkbd_skip_getid(atkbd); if (ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
if (skip_getid || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
/* /*
* If the get ID command was skipped or failed, we check if we can at least set * If the get ID command failed, we check if we can at least set
* the LEDs on the keyboard. This should work on every keyboard out there. * the LEDs on the keyboard. This should work on every keyboard out there.
* It also turns the LEDs off, which we want anyway. * It also turns the LEDs off, which we want anyway.
*/ */
param[0] = 0; param[0] = 0;
if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS)) if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
return -1; return -1;
atkbd->id = skip_getid ? 0xab83 : 0xabba; atkbd->id = 0xabba;
return 0; return 0;
} }

View File

@ -1208,6 +1208,12 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP | SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
SERIO_QUIRK_NOPNP) SERIO_QUIRK_NOPNP)
}, },
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "NS5x_7xPU"),
},
.driver_data = (void *)(SERIO_QUIRK_NOAUX)
},
{ {
.matches = { .matches = {
DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"), DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),

View File

@ -122,6 +122,25 @@ static int parse_fixed_partitions(struct mtd_info *master,
a_cells = of_n_addr_cells(pp); a_cells = of_n_addr_cells(pp);
s_cells = of_n_size_cells(pp); s_cells = of_n_size_cells(pp);
if (!dedicated && s_cells == 0) {
/*
* This is a ugly workaround to not create
* regression on devices that are still creating
* partitions as direct children of the nand controller.
* This can happen in case the nand controller node has
* #size-cells equal to 0 and the firmware (e.g.
* U-Boot) just add the partitions there assuming
* 32-bit addressing.
*
* If you get this warning your firmware and/or DTS
* should be really fixed.
*
* This is working only for devices smaller than 4GiB.
*/
pr_warn("%s: ofpart partition %pOF (%pOF) #size-cells is wrongly set to <0>, assuming <1> for parsing partitions.\n",
master->name, pp, mtd_node);
s_cells = 1;
}
if (len / 4 != a_cells + s_cells) { if (len / 4 != a_cells + s_cells) {
pr_debug("%s: ofpart partition %pOF (%pOF) error parsing reg property.\n", pr_debug("%s: ofpart partition %pOF (%pOF) error parsing reg property.\n",
master->name, pp, master->name, pp,

View File

@ -993,7 +993,7 @@ int aq_ptp_ring_alloc(struct aq_nic_s *aq_nic)
return 0; return 0;
err_exit_hwts_rx: err_exit_hwts_rx:
aq_ring_free(&aq_ptp->hwts_rx); aq_ring_hwts_rx_free(&aq_ptp->hwts_rx);
err_exit_ptp_rx: err_exit_ptp_rx:
aq_ring_free(&aq_ptp->ptp_rx); aq_ring_free(&aq_ptp->ptp_rx);
err_exit_ptp_tx: err_exit_ptp_tx:
@ -1011,7 +1011,7 @@ void aq_ptp_ring_free(struct aq_nic_s *aq_nic)
aq_ring_free(&aq_ptp->ptp_tx); aq_ring_free(&aq_ptp->ptp_tx);
aq_ring_free(&aq_ptp->ptp_rx); aq_ring_free(&aq_ptp->ptp_rx);
aq_ring_free(&aq_ptp->hwts_rx); aq_ring_hwts_rx_free(&aq_ptp->hwts_rx);
aq_ptp_skb_ring_release(&aq_ptp->skb_ring); aq_ptp_skb_ring_release(&aq_ptp->skb_ring);
} }

View File

@ -919,6 +919,19 @@ void aq_ring_free(struct aq_ring_s *self)
} }
} }
void aq_ring_hwts_rx_free(struct aq_ring_s *self)
{
if (!self)
return;
if (self->dx_ring) {
dma_free_coherent(aq_nic_get_dev(self->aq_nic),
self->size * self->dx_size + AQ_CFG_RXDS_DEF,
self->dx_ring, self->dx_ring_pa);
self->dx_ring = NULL;
}
}
unsigned int aq_ring_fill_stats_data(struct aq_ring_s *self, u64 *data) unsigned int aq_ring_fill_stats_data(struct aq_ring_s *self, u64 *data)
{ {
unsigned int count; unsigned int count;

View File

@ -210,6 +210,7 @@ int aq_ring_rx_fill(struct aq_ring_s *self);
int aq_ring_hwts_rx_alloc(struct aq_ring_s *self, int aq_ring_hwts_rx_alloc(struct aq_ring_s *self,
struct aq_nic_s *aq_nic, unsigned int idx, struct aq_nic_s *aq_nic, unsigned int idx,
unsigned int size, unsigned int dx_size); unsigned int size, unsigned int dx_size);
void aq_ring_hwts_rx_free(struct aq_ring_s *self);
void aq_ring_hwts_rx_clean(struct aq_ring_s *self, struct aq_nic_s *aq_nic); void aq_ring_hwts_rx_clean(struct aq_ring_s *self, struct aq_nic_s *aq_nic);
unsigned int aq_ring_fill_stats_data(struct aq_ring_s *self, u64 *data); unsigned int aq_ring_fill_stats_data(struct aq_ring_s *self, u64 *data);

View File

@ -930,8 +930,11 @@ int otx2_sq_init(struct otx2_nic *pfvf, u16 qidx, u16 sqb_aura)
if (pfvf->ptp && qidx < pfvf->hw.tx_queues) { if (pfvf->ptp && qidx < pfvf->hw.tx_queues) {
err = qmem_alloc(pfvf->dev, &sq->timestamps, qset->sqe_cnt, err = qmem_alloc(pfvf->dev, &sq->timestamps, qset->sqe_cnt,
sizeof(*sq->timestamps)); sizeof(*sq->timestamps));
if (err) if (err) {
kfree(sq->sg);
sq->sg = NULL;
return err; return err;
}
} }
sq->head = 0; sq->head = 0;
@ -947,7 +950,14 @@ int otx2_sq_init(struct otx2_nic *pfvf, u16 qidx, u16 sqb_aura)
sq->stats.bytes = 0; sq->stats.bytes = 0;
sq->stats.pkts = 0; sq->stats.pkts = 0;
return pfvf->hw_ops->sq_aq_init(pfvf, qidx, sqb_aura); err = pfvf->hw_ops->sq_aq_init(pfvf, qidx, sqb_aura);
if (err) {
kfree(sq->sg);
sq->sg = NULL;
return err;
}
return 0;
} }

View File

@ -209,6 +209,7 @@ struct stmmac_safety_stats {
unsigned long mac_errors[32]; unsigned long mac_errors[32];
unsigned long mtl_errors[32]; unsigned long mtl_errors[32];
unsigned long dma_errors[32]; unsigned long dma_errors[32];
unsigned long dma_dpp_errors[32];
}; };
/* Number of fields in Safety Stats */ /* Number of fields in Safety Stats */

View File

@ -282,6 +282,8 @@
#define XGMAC_RXCEIE BIT(4) #define XGMAC_RXCEIE BIT(4)
#define XGMAC_TXCEIE BIT(0) #define XGMAC_TXCEIE BIT(0)
#define XGMAC_MTL_ECC_INT_STATUS 0x000010cc #define XGMAC_MTL_ECC_INT_STATUS 0x000010cc
#define XGMAC_MTL_DPP_CONTROL 0x000010e0
#define XGMAC_DPP_DISABLE BIT(0)
#define XGMAC_MTL_TXQ_OPMODE(x) (0x00001100 + (0x80 * (x))) #define XGMAC_MTL_TXQ_OPMODE(x) (0x00001100 + (0x80 * (x)))
#define XGMAC_TQS GENMASK(25, 16) #define XGMAC_TQS GENMASK(25, 16)
#define XGMAC_TQS_SHIFT 16 #define XGMAC_TQS_SHIFT 16
@ -364,6 +366,7 @@
#define XGMAC_DCEIE BIT(1) #define XGMAC_DCEIE BIT(1)
#define XGMAC_TCEIE BIT(0) #define XGMAC_TCEIE BIT(0)
#define XGMAC_DMA_ECC_INT_STATUS 0x0000306c #define XGMAC_DMA_ECC_INT_STATUS 0x0000306c
#define XGMAC_DMA_DPP_INT_STATUS 0x00003074
#define XGMAC_DMA_CH_CONTROL(x) (0x00003100 + (0x80 * (x))) #define XGMAC_DMA_CH_CONTROL(x) (0x00003100 + (0x80 * (x)))
#define XGMAC_SPH BIT(24) #define XGMAC_SPH BIT(24)
#define XGMAC_PBLx8 BIT(16) #define XGMAC_PBLx8 BIT(16)

View File

@ -789,6 +789,44 @@ static const struct dwxgmac3_error_desc dwxgmac3_dma_errors[32]= {
{ false, "UNKNOWN", "Unknown Error" }, /* 31 */ { false, "UNKNOWN", "Unknown Error" }, /* 31 */
}; };
#define DPP_RX_ERR "Read Rx Descriptor Parity checker Error"
#define DPP_TX_ERR "Read Tx Descriptor Parity checker Error"
static const struct dwxgmac3_error_desc dwxgmac3_dma_dpp_errors[32] = {
{ true, "TDPES0", DPP_TX_ERR },
{ true, "TDPES1", DPP_TX_ERR },
{ true, "TDPES2", DPP_TX_ERR },
{ true, "TDPES3", DPP_TX_ERR },
{ true, "TDPES4", DPP_TX_ERR },
{ true, "TDPES5", DPP_TX_ERR },
{ true, "TDPES6", DPP_TX_ERR },
{ true, "TDPES7", DPP_TX_ERR },
{ true, "TDPES8", DPP_TX_ERR },
{ true, "TDPES9", DPP_TX_ERR },
{ true, "TDPES10", DPP_TX_ERR },
{ true, "TDPES11", DPP_TX_ERR },
{ true, "TDPES12", DPP_TX_ERR },
{ true, "TDPES13", DPP_TX_ERR },
{ true, "TDPES14", DPP_TX_ERR },
{ true, "TDPES15", DPP_TX_ERR },
{ true, "RDPES0", DPP_RX_ERR },
{ true, "RDPES1", DPP_RX_ERR },
{ true, "RDPES2", DPP_RX_ERR },
{ true, "RDPES3", DPP_RX_ERR },
{ true, "RDPES4", DPP_RX_ERR },
{ true, "RDPES5", DPP_RX_ERR },
{ true, "RDPES6", DPP_RX_ERR },
{ true, "RDPES7", DPP_RX_ERR },
{ true, "RDPES8", DPP_RX_ERR },
{ true, "RDPES9", DPP_RX_ERR },
{ true, "RDPES10", DPP_RX_ERR },
{ true, "RDPES11", DPP_RX_ERR },
{ true, "RDPES12", DPP_RX_ERR },
{ true, "RDPES13", DPP_RX_ERR },
{ true, "RDPES14", DPP_RX_ERR },
{ true, "RDPES15", DPP_RX_ERR },
};
static void dwxgmac3_handle_dma_err(struct net_device *ndev, static void dwxgmac3_handle_dma_err(struct net_device *ndev,
void __iomem *ioaddr, bool correctable, void __iomem *ioaddr, bool correctable,
struct stmmac_safety_stats *stats) struct stmmac_safety_stats *stats)
@ -800,6 +838,13 @@ static void dwxgmac3_handle_dma_err(struct net_device *ndev,
dwxgmac3_log_error(ndev, value, correctable, "DMA", dwxgmac3_log_error(ndev, value, correctable, "DMA",
dwxgmac3_dma_errors, STAT_OFF(dma_errors), stats); dwxgmac3_dma_errors, STAT_OFF(dma_errors), stats);
value = readl(ioaddr + XGMAC_DMA_DPP_INT_STATUS);
writel(value, ioaddr + XGMAC_DMA_DPP_INT_STATUS);
dwxgmac3_log_error(ndev, value, false, "DMA_DPP",
dwxgmac3_dma_dpp_errors,
STAT_OFF(dma_dpp_errors), stats);
} }
static int static int
@ -838,6 +883,12 @@ dwxgmac3_safety_feat_config(void __iomem *ioaddr, unsigned int asp,
value |= XGMAC_TMOUTEN; /* FSM Timeout Feature */ value |= XGMAC_TMOUTEN; /* FSM Timeout Feature */
writel(value, ioaddr + XGMAC_MAC_FSM_CONTROL); writel(value, ioaddr + XGMAC_MAC_FSM_CONTROL);
/* 5. Enable Data Path Parity Protection */
value = readl(ioaddr + XGMAC_MTL_DPP_CONTROL);
/* already enabled by default, explicit enable it again */
value &= ~XGMAC_DPP_DISABLE;
writel(value, ioaddr + XGMAC_MTL_DPP_CONTROL);
return 0; return 0;
} }
@ -871,7 +922,11 @@ static int dwxgmac3_safety_feat_irq_status(struct net_device *ndev,
ret |= !corr; ret |= !corr;
} }
err = dma & (XGMAC_DEUIS | XGMAC_DECIS); /* DMA_DPP_Interrupt_Status is indicated by MCSIS bit in
* DMA_Safety_Interrupt_Status, so we handle DMA Data Path
* Parity Errors here
*/
err = dma & (XGMAC_DEUIS | XGMAC_DECIS | XGMAC_MCSIS);
corr = dma & XGMAC_DECIS; corr = dma & XGMAC_DECIS;
if (err) { if (err) {
dwxgmac3_handle_dma_err(ndev, ioaddr, corr, stats); dwxgmac3_handle_dma_err(ndev, ioaddr, corr, stats);
@ -887,6 +942,7 @@ static const struct dwxgmac3_error {
{ dwxgmac3_mac_errors }, { dwxgmac3_mac_errors },
{ dwxgmac3_mtl_errors }, { dwxgmac3_mtl_errors },
{ dwxgmac3_dma_errors }, { dwxgmac3_dma_errors },
{ dwxgmac3_dma_dpp_errors },
}; };
static int dwxgmac3_safety_feat_dump(struct stmmac_safety_stats *stats, static int dwxgmac3_safety_feat_dump(struct stmmac_safety_stats *stats,

View File

@ -835,14 +835,14 @@ static void nsim_dev_trap_report_work(struct work_struct *work)
trap_report_dw.work); trap_report_dw.work);
nsim_dev = nsim_trap_data->nsim_dev; nsim_dev = nsim_trap_data->nsim_dev;
/* For each running port and enabled packet trap, generate a UDP
* packet with a random 5-tuple and report it.
*/
if (!devl_trylock(priv_to_devlink(nsim_dev))) { if (!devl_trylock(priv_to_devlink(nsim_dev))) {
schedule_delayed_work(&nsim_dev->trap_data->trap_report_dw, 0); schedule_delayed_work(&nsim_dev->trap_data->trap_report_dw, 1);
return; return;
} }
/* For each running port and enabled packet trap, generate a UDP
* packet with a random 5-tuple and report it.
*/
list_for_each_entry(nsim_dev_port, &nsim_dev->port_list, list) { list_for_each_entry(nsim_dev_port, &nsim_dev->port_list, list) {
if (!netif_running(nsim_dev_port->ns->netdev)) if (!netif_running(nsim_dev_port->ns->netdev))
continue; continue;

View File

@ -469,6 +469,10 @@ ppp_async_ioctl(struct ppp_channel *chan, unsigned int cmd, unsigned long arg)
case PPPIOCSMRU: case PPPIOCSMRU:
if (get_user(val, p)) if (get_user(val, p))
break; break;
if (val > U16_MAX) {
err = -EINVAL;
break;
}
if (val < PPP_MRU) if (val < PPP_MRU)
val = PPP_MRU; val = PPP_MRU;
ap->mru = val; ap->mru = val;

View File

@ -675,8 +675,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
channel->irq = platform_get_irq_optional(pdev, 0); channel->irq = platform_get_irq_optional(pdev, 0);
channel->dr_mode = rcar_gen3_get_dr_mode(dev->of_node); channel->dr_mode = rcar_gen3_get_dr_mode(dev->of_node);
if (channel->dr_mode != USB_DR_MODE_UNKNOWN) { if (channel->dr_mode != USB_DR_MODE_UNKNOWN) {
int ret;
channel->is_otg_channel = true; channel->is_otg_channel = true;
channel->uses_otg_pins = !of_property_read_bool(dev->of_node, channel->uses_otg_pins = !of_property_read_bool(dev->of_node,
"renesas,no-otg-pins"); "renesas,no-otg-pins");
@ -740,8 +738,6 @@ static int rcar_gen3_phy_usb2_probe(struct platform_device *pdev)
ret = PTR_ERR(provider); ret = PTR_ERR(provider);
goto error; goto error;
} else if (channel->is_otg_channel) { } else if (channel->is_otg_channel) {
int ret;
ret = device_create_file(dev, &dev_attr_role); ret = device_create_file(dev, &dev_attr_role);
if (ret < 0) if (ret < 0)
goto error; goto error;

View File

@ -116,7 +116,7 @@ static int omap_usb_set_vbus(struct usb_otg *otg, bool enabled)
{ {
struct omap_usb *phy = phy_to_omapusb(otg->usb_phy); struct omap_usb *phy = phy_to_omapusb(otg->usb_phy);
if (!phy->comparator) if (!phy->comparator || !phy->comparator->set_vbus)
return -ENODEV; return -ENODEV;
return phy->comparator->set_vbus(phy->comparator, enabled); return phy->comparator->set_vbus(phy->comparator, enabled);
@ -126,7 +126,7 @@ static int omap_usb_start_srp(struct usb_otg *otg)
{ {
struct omap_usb *phy = phy_to_omapusb(otg->usb_phy); struct omap_usb *phy = phy_to_omapusb(otg->usb_phy);
if (!phy->comparator) if (!phy->comparator || !phy->comparator->start_srp)
return -ENODEV; return -ENODEV;
return phy->comparator->start_srp(phy->comparator); return phy->comparator->start_srp(phy->comparator);

View File

@ -282,11 +282,12 @@ static void scsi_eh_inc_host_failed(struct rcu_head *head)
{ {
struct scsi_cmnd *scmd = container_of(head, typeof(*scmd), rcu); struct scsi_cmnd *scmd = container_of(head, typeof(*scmd), rcu);
struct Scsi_Host *shost = scmd->device->host; struct Scsi_Host *shost = scmd->device->host;
unsigned int busy = scsi_host_busy(shost);
unsigned long flags; unsigned long flags;
spin_lock_irqsave(shost->host_lock, flags); spin_lock_irqsave(shost->host_lock, flags);
shost->host_failed++; shost->host_failed++;
scsi_eh_wakeup(shost, scsi_host_busy(shost)); scsi_eh_wakeup(shost, busy);
spin_unlock_irqrestore(shost->host_lock, flags); spin_unlock_irqrestore(shost->host_lock, flags);
} }

View File

@ -279,9 +279,11 @@ static void scsi_dec_host_busy(struct Scsi_Host *shost, struct scsi_cmnd *cmd)
rcu_read_lock(); rcu_read_lock();
__clear_bit(SCMD_STATE_INFLIGHT, &cmd->state); __clear_bit(SCMD_STATE_INFLIGHT, &cmd->state);
if (unlikely(scsi_host_in_recovery(shost))) { if (unlikely(scsi_host_in_recovery(shost))) {
unsigned int busy = scsi_host_busy(shost);
spin_lock_irqsave(shost->host_lock, flags); spin_lock_irqsave(shost->host_lock, flags);
if (shost->host_failed || shost->host_eh_scheduled) if (shost->host_failed || shost->host_eh_scheduled)
scsi_eh_wakeup(shost, scsi_host_busy(shost)); scsi_eh_wakeup(shost, busy);
spin_unlock_irqrestore(shost->host_lock, flags); spin_unlock_irqrestore(shost->host_lock, flags);
} }
rcu_read_unlock(); rcu_read_unlock();

View File

@ -146,6 +146,7 @@ static const struct usb_device_id id_table[] = {
{ USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */ { USB_DEVICE(0x10C4, 0x85F8) }, /* Virtenio Preon32 */
{ USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */ { USB_DEVICE(0x10C4, 0x8664) }, /* AC-Services CAN-IF */
{ USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */ { USB_DEVICE(0x10C4, 0x8665) }, /* AC-Services OBD-IF */
{ USB_DEVICE(0x10C4, 0x87ED) }, /* IMST USB-Stick for Smart Meter */
{ USB_DEVICE(0x10C4, 0x8856) }, /* CEL EM357 ZigBee USB Stick - LR */ { USB_DEVICE(0x10C4, 0x8856) }, /* CEL EM357 ZigBee USB Stick - LR */
{ USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */ { USB_DEVICE(0x10C4, 0x8857) }, /* CEL EM357 ZigBee USB Stick */
{ USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */ { USB_DEVICE(0x10C4, 0x88A4) }, /* MMB Networks ZigBee USB Device */

View File

@ -2269,6 +2269,7 @@ static const struct usb_device_id option_ids[] = {
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x0111, 0xff) }, /* Fibocom FM160 (MBIM mode) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a0, 0xff) }, /* Fibocom NL668-AM/NL652-EU (laptop MBIM) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a2, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a3, 0xff) }, /* Fibocom FM101-GL (laptop MBIM) */
{ USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */ { USB_DEVICE_INTERFACE_CLASS(0x2cb7, 0x01a4, 0xff), /* Fibocom FM101-GL (laptop MBIM) */
.driver_info = RSVD(4) }, .driver_info = RSVD(4) },
{ USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */ { USB_DEVICE_INTERFACE_CLASS(0x2df3, 0x9d03, 0xff) }, /* LongSung M5710 */

View File

@ -184,6 +184,8 @@ static const struct usb_device_id id_table[] = {
{DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */ {DEVICE_SWI(0x413c, 0x81d0)}, /* Dell Wireless 5819 */
{DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */ {DEVICE_SWI(0x413c, 0x81d1)}, /* Dell Wireless 5818 */
{DEVICE_SWI(0x413c, 0x81d2)}, /* Dell Wireless 5818 */ {DEVICE_SWI(0x413c, 0x81d2)}, /* Dell Wireless 5818 */
{DEVICE_SWI(0x413c, 0x8217)}, /* Dell Wireless DW5826e */
{DEVICE_SWI(0x413c, 0x8218)}, /* Dell Wireless DW5826e QDL */
/* Huawei devices */ /* Huawei devices */
{DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */ {DEVICE_HWI(0x03f0, 0x581d)}, /* HP lt4112 LTE/HSPA+ Gobi 4G Modem (Huawei me906e) */

View File

@ -2588,12 +2588,11 @@ EXPORT_SYMBOL_GPL(vhost_disable_notify);
/* Create a new message. */ /* Create a new message. */
struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type) struct vhost_msg_node *vhost_new_msg(struct vhost_virtqueue *vq, int type)
{ {
struct vhost_msg_node *node = kmalloc(sizeof *node, GFP_KERNEL); /* Make sure all padding within the structure is initialized. */
struct vhost_msg_node *node = kzalloc(sizeof(*node), GFP_KERNEL);
if (!node) if (!node)
return NULL; return NULL;
/* Make sure all padding within the structure is initialized. */
memset(&node->msg, 0, sizeof node->msg);
node->vq = vq; node->vq = vq;
node->msg.type = type; node->msg.type = type;
return node; return node;

View File

@ -174,7 +174,7 @@ static LIST_HEAD(dlm_node_addrs);
static DEFINE_SPINLOCK(dlm_node_addrs_spin); static DEFINE_SPINLOCK(dlm_node_addrs_spin);
static struct listen_connection listen_con; static struct listen_connection listen_con;
static struct sockaddr_storage *dlm_local_addr[DLM_MAX_ADDR_COUNT]; static struct sockaddr_storage dlm_local_addr[DLM_MAX_ADDR_COUNT];
static int dlm_local_count; static int dlm_local_count;
int dlm_allow_conn; int dlm_allow_conn;
@ -398,7 +398,7 @@ static int nodeid_to_addr(int nodeid, struct sockaddr_storage *sas_out,
if (!sa_out) if (!sa_out)
return 0; return 0;
if (dlm_local_addr[0]->ss_family == AF_INET) { if (dlm_local_addr[0].ss_family == AF_INET) {
struct sockaddr_in *in4 = (struct sockaddr_in *) &sas; struct sockaddr_in *in4 = (struct sockaddr_in *) &sas;
struct sockaddr_in *ret4 = (struct sockaddr_in *) sa_out; struct sockaddr_in *ret4 = (struct sockaddr_in *) sa_out;
ret4->sin_addr.s_addr = in4->sin_addr.s_addr; ret4->sin_addr.s_addr = in4->sin_addr.s_addr;
@ -727,7 +727,7 @@ static void add_sock(struct socket *sock, struct connection *con)
static void make_sockaddr(struct sockaddr_storage *saddr, uint16_t port, static void make_sockaddr(struct sockaddr_storage *saddr, uint16_t port,
int *addr_len) int *addr_len)
{ {
saddr->ss_family = dlm_local_addr[0]->ss_family; saddr->ss_family = dlm_local_addr[0].ss_family;
if (saddr->ss_family == AF_INET) { if (saddr->ss_family == AF_INET) {
struct sockaddr_in *in4_addr = (struct sockaddr_in *)saddr; struct sockaddr_in *in4_addr = (struct sockaddr_in *)saddr;
in4_addr->sin_port = cpu_to_be16(port); in4_addr->sin_port = cpu_to_be16(port);
@ -1167,7 +1167,7 @@ static int sctp_bind_addrs(struct socket *sock, uint16_t port)
int i, addr_len, result = 0; int i, addr_len, result = 0;
for (i = 0; i < dlm_local_count; i++) { for (i = 0; i < dlm_local_count; i++) {
memcpy(&localaddr, dlm_local_addr[i], sizeof(localaddr)); memcpy(&localaddr, &dlm_local_addr[i], sizeof(localaddr));
make_sockaddr(&localaddr, port, &addr_len); make_sockaddr(&localaddr, port, &addr_len);
if (!i) if (!i)
@ -1187,7 +1187,7 @@ static int sctp_bind_addrs(struct socket *sock, uint16_t port)
/* Get local addresses */ /* Get local addresses */
static void init_local(void) static void init_local(void)
{ {
struct sockaddr_storage sas, *addr; struct sockaddr_storage sas;
int i; int i;
dlm_local_count = 0; dlm_local_count = 0;
@ -1195,21 +1195,10 @@ static void init_local(void)
if (dlm_our_addr(&sas, i)) if (dlm_our_addr(&sas, i))
break; break;
addr = kmemdup(&sas, sizeof(*addr), GFP_NOFS); memcpy(&dlm_local_addr[dlm_local_count++], &sas, sizeof(sas));
if (!addr)
break;
dlm_local_addr[dlm_local_count++] = addr;
} }
} }
static void deinit_local(void)
{
int i;
for (i = 0; i < dlm_local_count; i++)
kfree(dlm_local_addr[i]);
}
static struct writequeue_entry *new_writequeue_entry(struct connection *con) static struct writequeue_entry *new_writequeue_entry(struct connection *con)
{ {
struct writequeue_entry *entry; struct writequeue_entry *entry;
@ -1575,7 +1564,7 @@ static void dlm_connect(struct connection *con)
} }
/* Create a socket to communicate with */ /* Create a socket to communicate with */
result = sock_create_kern(&init_net, dlm_local_addr[0]->ss_family, result = sock_create_kern(&init_net, dlm_local_addr[0].ss_family,
SOCK_STREAM, dlm_proto_ops->proto, &sock); SOCK_STREAM, dlm_proto_ops->proto, &sock);
if (result < 0) if (result < 0)
goto socket_err; goto socket_err;
@ -1786,7 +1775,6 @@ void dlm_lowcomms_stop(void)
foreach_conn(free_conn); foreach_conn(free_conn);
srcu_read_unlock(&connections_srcu, idx); srcu_read_unlock(&connections_srcu, idx);
work_stop(); work_stop();
deinit_local();
dlm_proto_ops = NULL; dlm_proto_ops = NULL;
} }
@ -1803,7 +1791,7 @@ static int dlm_listen_for_all(void)
if (result < 0) if (result < 0)
return result; return result;
result = sock_create_kern(&init_net, dlm_local_addr[0]->ss_family, result = sock_create_kern(&init_net, dlm_local_addr[0].ss_family,
SOCK_STREAM, dlm_proto_ops->proto, &sock); SOCK_STREAM, dlm_proto_ops->proto, &sock);
if (result < 0) { if (result < 0) {
log_print("Can't create comms socket: %d", result); log_print("Can't create comms socket: %d", result);
@ -1842,7 +1830,7 @@ static int dlm_tcp_bind(struct socket *sock)
/* Bind to our cluster-known address connecting to avoid /* Bind to our cluster-known address connecting to avoid
* routing problems. * routing problems.
*/ */
memcpy(&src_addr, dlm_local_addr[0], sizeof(src_addr)); memcpy(&src_addr, &dlm_local_addr[0], sizeof(src_addr));
make_sockaddr(&src_addr, 0, &addr_len); make_sockaddr(&src_addr, 0, &addr_len);
result = kernel_bind(sock, (struct sockaddr *)&src_addr, result = kernel_bind(sock, (struct sockaddr *)&src_addr,
@ -1899,9 +1887,9 @@ static int dlm_tcp_listen_bind(struct socket *sock)
int addr_len; int addr_len;
/* Bind to our port */ /* Bind to our port */
make_sockaddr(dlm_local_addr[0], dlm_config.ci_tcp_port, &addr_len); make_sockaddr(&dlm_local_addr[0], dlm_config.ci_tcp_port, &addr_len);
return kernel_bind(sock, (struct sockaddr *)&dlm_local_addr[0], return kernel_bind(sock, (struct sockaddr *)&dlm_local_addr[0],
addr_len); addr_len);
} }
static const struct dlm_proto_ops dlm_tcp_ops = { static const struct dlm_proto_ops dlm_tcp_ops = {
@ -1992,7 +1980,7 @@ int dlm_lowcomms_start(void)
error = work_start(); error = work_start();
if (error) if (error)
goto fail_local; goto fail;
dlm_allow_conn = 1; dlm_allow_conn = 1;
@ -2022,8 +2010,6 @@ int dlm_lowcomms_start(void)
fail_proto_ops: fail_proto_ops:
dlm_allow_conn = 0; dlm_allow_conn = 0;
work_stop(); work_stop();
fail_local:
deinit_local();
fail: fail:
return error; return error;
} }

View File

@ -1118,6 +1118,24 @@ void ext4_mb_generate_buddy(struct super_block *sb,
atomic64_add(period, &sbi->s_mb_generation_time); atomic64_add(period, &sbi->s_mb_generation_time);
} }
static void mb_regenerate_buddy(struct ext4_buddy *e4b)
{
int count;
int order = 1;
void *buddy;
while ((buddy = mb_find_buddy(e4b, order++, &count)))
mb_set_bits(buddy, 0, count);
e4b->bd_info->bb_fragments = 0;
memset(e4b->bd_info->bb_counters, 0,
sizeof(*e4b->bd_info->bb_counters) *
(e4b->bd_sb->s_blocksize_bits + 2));
ext4_mb_generate_buddy(e4b->bd_sb, e4b->bd_buddy,
e4b->bd_bitmap, e4b->bd_group, e4b->bd_info);
}
/* The buddy information is attached the buddy cache inode /* The buddy information is attached the buddy cache inode
* for convenience. The information regarding each group * for convenience. The information regarding each group
* is loaded via ext4_mb_load_buddy. The information involve * is loaded via ext4_mb_load_buddy. The information involve
@ -1796,6 +1814,8 @@ static void mb_free_blocks(struct inode *inode, struct ext4_buddy *e4b,
ext4_mark_group_bitmap_corrupted( ext4_mark_group_bitmap_corrupted(
sb, e4b->bd_group, sb, e4b->bd_group,
EXT4_GROUP_INFO_BBITMAP_CORRUPT); EXT4_GROUP_INFO_BBITMAP_CORRUPT);
} else {
mb_regenerate_buddy(e4b);
} }
goto done; goto done;
} }

View File

@ -55,6 +55,7 @@ struct f2fs_compress_ops {
int (*init_decompress_ctx)(struct decompress_io_ctx *dic); int (*init_decompress_ctx)(struct decompress_io_ctx *dic);
void (*destroy_decompress_ctx)(struct decompress_io_ctx *dic); void (*destroy_decompress_ctx)(struct decompress_io_ctx *dic);
int (*decompress_pages)(struct decompress_io_ctx *dic); int (*decompress_pages)(struct decompress_io_ctx *dic);
bool (*is_level_valid)(int level);
}; };
static unsigned int offset_in_cluster(struct compress_ctx *cc, pgoff_t index) static unsigned int offset_in_cluster(struct compress_ctx *cc, pgoff_t index)
@ -308,11 +309,21 @@ static int lz4_decompress_pages(struct decompress_io_ctx *dic)
return 0; return 0;
} }
static bool lz4_is_level_valid(int lvl)
{
#ifdef CONFIG_F2FS_FS_LZ4HC
return !lvl || (lvl >= LZ4HC_MIN_CLEVEL && lvl <= LZ4HC_MAX_CLEVEL);
#else
return lvl == 0;
#endif
}
static const struct f2fs_compress_ops f2fs_lz4_ops = { static const struct f2fs_compress_ops f2fs_lz4_ops = {
.init_compress_ctx = lz4_init_compress_ctx, .init_compress_ctx = lz4_init_compress_ctx,
.destroy_compress_ctx = lz4_destroy_compress_ctx, .destroy_compress_ctx = lz4_destroy_compress_ctx,
.compress_pages = lz4_compress_pages, .compress_pages = lz4_compress_pages,
.decompress_pages = lz4_decompress_pages, .decompress_pages = lz4_decompress_pages,
.is_level_valid = lz4_is_level_valid,
}; };
#endif #endif
@ -476,6 +487,11 @@ static int zstd_decompress_pages(struct decompress_io_ctx *dic)
return 0; return 0;
} }
static bool zstd_is_level_valid(int lvl)
{
return lvl >= zstd_min_clevel() && lvl <= zstd_max_clevel();
}
static const struct f2fs_compress_ops f2fs_zstd_ops = { static const struct f2fs_compress_ops f2fs_zstd_ops = {
.init_compress_ctx = zstd_init_compress_ctx, .init_compress_ctx = zstd_init_compress_ctx,
.destroy_compress_ctx = zstd_destroy_compress_ctx, .destroy_compress_ctx = zstd_destroy_compress_ctx,
@ -483,6 +499,7 @@ static const struct f2fs_compress_ops f2fs_zstd_ops = {
.init_decompress_ctx = zstd_init_decompress_ctx, .init_decompress_ctx = zstd_init_decompress_ctx,
.destroy_decompress_ctx = zstd_destroy_decompress_ctx, .destroy_decompress_ctx = zstd_destroy_decompress_ctx,
.decompress_pages = zstd_decompress_pages, .decompress_pages = zstd_decompress_pages,
.is_level_valid = zstd_is_level_valid,
}; };
#endif #endif
@ -541,6 +558,16 @@ bool f2fs_is_compress_backend_ready(struct inode *inode)
return f2fs_cops[F2FS_I(inode)->i_compress_algorithm]; return f2fs_cops[F2FS_I(inode)->i_compress_algorithm];
} }
bool f2fs_is_compress_level_valid(int alg, int lvl)
{
const struct f2fs_compress_ops *cops = f2fs_cops[alg];
if (cops->is_level_valid)
return cops->is_level_valid(lvl);
return lvl == 0;
}
static mempool_t *compress_page_pool; static mempool_t *compress_page_pool;
static int num_compress_pages = 512; static int num_compress_pages = 512;
module_param(num_compress_pages, uint, 0444); module_param(num_compress_pages, uint, 0444);

View File

@ -4234,6 +4234,7 @@ bool f2fs_compress_write_end(struct inode *inode, void *fsdata,
int f2fs_truncate_partial_cluster(struct inode *inode, u64 from, bool lock); int f2fs_truncate_partial_cluster(struct inode *inode, u64 from, bool lock);
void f2fs_compress_write_end_io(struct bio *bio, struct page *page); void f2fs_compress_write_end_io(struct bio *bio, struct page *page);
bool f2fs_is_compress_backend_ready(struct inode *inode); bool f2fs_is_compress_backend_ready(struct inode *inode);
bool f2fs_is_compress_level_valid(int alg, int lvl);
int __init f2fs_init_compress_mempool(void); int __init f2fs_init_compress_mempool(void);
void f2fs_destroy_compress_mempool(void); void f2fs_destroy_compress_mempool(void);
void f2fs_decompress_cluster(struct decompress_io_ctx *dic, bool in_task); void f2fs_decompress_cluster(struct decompress_io_ctx *dic, bool in_task);
@ -4298,6 +4299,7 @@ static inline bool f2fs_is_compress_backend_ready(struct inode *inode)
/* not support compression */ /* not support compression */
return false; return false;
} }
static inline bool f2fs_is_compress_level_valid(int alg, int lvl) { return false; }
static inline struct page *f2fs_compress_control_page(struct page *page) static inline struct page *f2fs_compress_control_page(struct page *page)
{ {
WARN_ON_ONCE(1); WARN_ON_ONCE(1);

View File

@ -627,7 +627,7 @@ static int f2fs_set_lz4hc_level(struct f2fs_sb_info *sbi, const char *str)
if (kstrtouint(str + 1, 10, &level)) if (kstrtouint(str + 1, 10, &level))
return -EINVAL; return -EINVAL;
if (level < LZ4HC_MIN_CLEVEL || level > LZ4HC_MAX_CLEVEL) { if (!f2fs_is_compress_level_valid(COMPRESS_LZ4, level)) {
f2fs_info(sbi, "invalid lz4hc compress level: %d", level); f2fs_info(sbi, "invalid lz4hc compress level: %d", level);
return -EINVAL; return -EINVAL;
} }
@ -665,7 +665,7 @@ static int f2fs_set_zstd_level(struct f2fs_sb_info *sbi, const char *str)
if (kstrtouint(str + 1, 10, &level)) if (kstrtouint(str + 1, 10, &level))
return -EINVAL; return -EINVAL;
if (level < zstd_min_clevel() || level > zstd_max_clevel()) { if (!f2fs_is_compress_level_valid(COMPRESS_ZSTD, level)) {
f2fs_info(sbi, "invalid zstd compress level: %d", level); f2fs_info(sbi, "invalid zstd compress level: %d", level);
return -EINVAL; return -EINVAL;
} }

View File

@ -468,7 +468,7 @@ bool al_delete_le(struct ntfs_inode *ni, enum ATTR_TYPE type, CLST vcn,
int al_update(struct ntfs_inode *ni, int sync); int al_update(struct ntfs_inode *ni, int sync);
static inline size_t al_aligned(size_t size) static inline size_t al_aligned(size_t size)
{ {
return (size + 1023) & ~(size_t)1023; return size_add(size, 1023) & ~(size_t)1023;
} }
/* Globals from bitfunc.c */ /* Globals from bitfunc.c */

View File

@ -248,6 +248,8 @@ int cifs_try_adding_channels(struct cifs_sb_info *cifs_sb, struct cifs_ses *ses)
&iface->sockaddr, &iface->sockaddr,
rc); rc);
kref_put(&iface->refcount, release_iface); kref_put(&iface->refcount, release_iface);
/* failure to add chan should increase weight */
iface->weight_fulfilled++;
continue; continue;
} }

View File

@ -960,7 +960,8 @@ static inline int dmaengine_slave_config(struct dma_chan *chan,
static inline bool is_slave_direction(enum dma_transfer_direction direction) static inline bool is_slave_direction(enum dma_transfer_direction direction)
{ {
return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM); return (direction == DMA_MEM_TO_DEV) || (direction == DMA_DEV_TO_MEM) ||
(direction == DMA_DEV_TO_DEV);
} }
static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single( static inline struct dma_async_tx_descriptor *dmaengine_prep_slave_single(

View File

@ -200,6 +200,7 @@ enum hrtimer_base_type {
* @max_hang_time: Maximum time spent in hrtimer_interrupt * @max_hang_time: Maximum time spent in hrtimer_interrupt
* @softirq_expiry_lock: Lock which is taken while softirq based hrtimer are * @softirq_expiry_lock: Lock which is taken while softirq based hrtimer are
* expired * expired
* @online: CPU is online from an hrtimers point of view
* @timer_waiters: A hrtimer_cancel() invocation waits for the timer * @timer_waiters: A hrtimer_cancel() invocation waits for the timer
* callback to finish. * callback to finish.
* @expires_next: absolute time of the next event, is required for remote * @expires_next: absolute time of the next event, is required for remote
@ -222,7 +223,8 @@ struct hrtimer_cpu_base {
unsigned int hres_active : 1, unsigned int hres_active : 1,
in_hrtirq : 1, in_hrtirq : 1,
hang_detected : 1, hang_detected : 1,
softirq_activated : 1; softirq_activated : 1,
online : 1;
#ifdef CONFIG_HIGH_RES_TIMERS #ifdef CONFIG_HIGH_RES_TIMERS
unsigned int nr_events; unsigned int nr_events;
unsigned short nr_retries; unsigned short nr_retries;

View File

@ -266,9 +266,11 @@ enum nft_rule_attributes {
/** /**
* enum nft_rule_compat_flags - nf_tables rule compat flags * enum nft_rule_compat_flags - nf_tables rule compat flags
* *
* @NFT_RULE_COMPAT_F_UNUSED: unused
* @NFT_RULE_COMPAT_F_INV: invert the check result * @NFT_RULE_COMPAT_F_INV: invert the check result
*/ */
enum nft_rule_compat_flags { enum nft_rule_compat_flags {
NFT_RULE_COMPAT_F_UNUSED = (1 << 0),
NFT_RULE_COMPAT_F_INV = (1 << 1), NFT_RULE_COMPAT_F_INV = (1 << 1),
NFT_RULE_COMPAT_F_MASK = NFT_RULE_COMPAT_F_INV, NFT_RULE_COMPAT_F_MASK = NFT_RULE_COMPAT_F_INV,
}; };

View File

@ -875,6 +875,7 @@ int io_recv(struct io_kiocb *req, unsigned int issue_flags)
if (!buf) if (!buf)
return -ENOBUFS; return -ENOBUFS;
sr->buf = buf; sr->buf = buf;
sr->len = len;
} }
ret = import_single_range(ITER_DEST, sr->buf, len, &iov, &msg.msg_iter); ret = import_single_range(ITER_DEST, sr->buf, len, &iov, &msg.msg_iter);

View File

@ -126,6 +126,7 @@ static DECLARE_WORK(watchdog_work, clocksource_watchdog_work);
static DEFINE_SPINLOCK(watchdog_lock); static DEFINE_SPINLOCK(watchdog_lock);
static int watchdog_running; static int watchdog_running;
static atomic_t watchdog_reset_pending; static atomic_t watchdog_reset_pending;
static int64_t watchdog_max_interval;
static inline void clocksource_watchdog_lock(unsigned long *flags) static inline void clocksource_watchdog_lock(unsigned long *flags)
{ {
@ -144,6 +145,7 @@ static void __clocksource_change_rating(struct clocksource *cs, int rating);
* Interval: 0.5sec. * Interval: 0.5sec.
*/ */
#define WATCHDOG_INTERVAL (HZ >> 1) #define WATCHDOG_INTERVAL (HZ >> 1)
#define WATCHDOG_INTERVAL_MAX_NS ((2 * WATCHDOG_INTERVAL) * (NSEC_PER_SEC / HZ))
static void clocksource_watchdog_work(struct work_struct *work) static void clocksource_watchdog_work(struct work_struct *work)
{ {
@ -396,8 +398,8 @@ static inline void clocksource_reset_watchdog(void)
static void clocksource_watchdog(struct timer_list *unused) static void clocksource_watchdog(struct timer_list *unused)
{ {
u64 csnow, wdnow, cslast, wdlast, delta; u64 csnow, wdnow, cslast, wdlast, delta;
int64_t wd_nsec, cs_nsec, interval;
int next_cpu, reset_pending; int next_cpu, reset_pending;
int64_t wd_nsec, cs_nsec;
struct clocksource *cs; struct clocksource *cs;
enum wd_read_status read_ret; enum wd_read_status read_ret;
unsigned long extra_wait = 0; unsigned long extra_wait = 0;
@ -467,6 +469,27 @@ static void clocksource_watchdog(struct timer_list *unused)
if (atomic_read(&watchdog_reset_pending)) if (atomic_read(&watchdog_reset_pending))
continue; continue;
/*
* The processing of timer softirqs can get delayed (usually
* on account of ksoftirqd not getting to run in a timely
* manner), which causes the watchdog interval to stretch.
* Skew detection may fail for longer watchdog intervals
* on account of fixed margins being used.
* Some clocksources, e.g. acpi_pm, cannot tolerate
* watchdog intervals longer than a few seconds.
*/
interval = max(cs_nsec, wd_nsec);
if (unlikely(interval > WATCHDOG_INTERVAL_MAX_NS)) {
if (system_state > SYSTEM_SCHEDULING &&
interval > 2 * watchdog_max_interval) {
watchdog_max_interval = interval;
pr_warn("Long readout interval, skipping watchdog check: cs_nsec: %lld wd_nsec: %lld\n",
cs_nsec, wd_nsec);
}
watchdog_timer.expires = jiffies;
continue;
}
/* Check the deviation from the watchdog clocksource. */ /* Check the deviation from the watchdog clocksource. */
md = cs->uncertainty_margin + watchdog->uncertainty_margin; md = cs->uncertainty_margin + watchdog->uncertainty_margin;
if (abs(cs_nsec - wd_nsec) > md) { if (abs(cs_nsec - wd_nsec) > md) {

View File

@ -1082,6 +1082,7 @@ static int enqueue_hrtimer(struct hrtimer *timer,
enum hrtimer_mode mode) enum hrtimer_mode mode)
{ {
debug_activate(timer, mode); debug_activate(timer, mode);
WARN_ON_ONCE(!base->cpu_base->online);
base->cpu_base->active_bases |= 1 << base->index; base->cpu_base->active_bases |= 1 << base->index;
@ -2180,6 +2181,7 @@ int hrtimers_prepare_cpu(unsigned int cpu)
cpu_base->softirq_next_timer = NULL; cpu_base->softirq_next_timer = NULL;
cpu_base->expires_next = KTIME_MAX; cpu_base->expires_next = KTIME_MAX;
cpu_base->softirq_expires_next = KTIME_MAX; cpu_base->softirq_expires_next = KTIME_MAX;
cpu_base->online = 1;
hrtimer_cpu_base_init_expiry_lock(cpu_base); hrtimer_cpu_base_init_expiry_lock(cpu_base);
return 0; return 0;
} }

View File

@ -1613,10 +1613,12 @@ EXPORT_SYMBOL(inet_current_timestamp);
int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len) int inet_recv_error(struct sock *sk, struct msghdr *msg, int len, int *addr_len)
{ {
if (sk->sk_family == AF_INET) unsigned int family = READ_ONCE(sk->sk_family);
if (family == AF_INET)
return ip_recv_error(sk, msg, len, addr_len); return ip_recv_error(sk, msg, len, addr_len);
#if IS_ENABLED(CONFIG_IPV6) #if IS_ENABLED(CONFIG_IPV6)
if (sk->sk_family == AF_INET6) if (family == AF_INET6)
return pingv6_ops.ipv6_recv_error(sk, msg, len, addr_len); return pingv6_ops.ipv6_recv_error(sk, msg, len, addr_len);
#endif #endif
return -EINVAL; return -EINVAL;

View File

@ -332,7 +332,7 @@ static int iptunnel_pmtud_build_icmpv6(struct sk_buff *skb, int mtu)
}; };
skb_reset_network_header(skb); skb_reset_network_header(skb);
csum = csum_partial(icmp6h, len, 0); csum = skb_checksum(skb, skb_transport_offset(skb), len, 0);
icmp6h->icmp6_cksum = csum_ipv6_magic(&nip6h->saddr, &nip6h->daddr, len, icmp6h->icmp6_cksum = csum_ipv6_magic(&nip6h->saddr, &nip6h->daddr, len,
IPPROTO_ICMPV6, csum); IPPROTO_ICMPV6, csum);

View File

@ -7221,8 +7221,7 @@ int ieee80211_mgd_assoc(struct ieee80211_sub_if_data *sdata,
rcu_read_lock(); rcu_read_lock();
beacon_ies = rcu_dereference(req->bss->beacon_ies); beacon_ies = rcu_dereference(req->bss->beacon_ies);
if (!beacon_ies) {
if (beacon_ies) {
/* /*
* Wait up to one beacon interval ... * Wait up to one beacon interval ...
* should this be more if we miss one? * should this be more if we miss one?

View File

@ -135,7 +135,7 @@ static void nft_target_eval_bridge(const struct nft_expr *expr,
static const struct nla_policy nft_target_policy[NFTA_TARGET_MAX + 1] = { static const struct nla_policy nft_target_policy[NFTA_TARGET_MAX + 1] = {
[NFTA_TARGET_NAME] = { .type = NLA_NUL_STRING }, [NFTA_TARGET_NAME] = { .type = NLA_NUL_STRING },
[NFTA_TARGET_REV] = { .type = NLA_U32 }, [NFTA_TARGET_REV] = NLA_POLICY_MAX(NLA_BE32, 255),
[NFTA_TARGET_INFO] = { .type = NLA_BINARY }, [NFTA_TARGET_INFO] = { .type = NLA_BINARY },
}; };
@ -200,6 +200,7 @@ static const struct nla_policy nft_rule_compat_policy[NFTA_RULE_COMPAT_MAX + 1]
static int nft_parse_compat(const struct nlattr *attr, u16 *proto, bool *inv) static int nft_parse_compat(const struct nlattr *attr, u16 *proto, bool *inv)
{ {
struct nlattr *tb[NFTA_RULE_COMPAT_MAX+1]; struct nlattr *tb[NFTA_RULE_COMPAT_MAX+1];
u32 l4proto;
u32 flags; u32 flags;
int err; int err;
@ -212,12 +213,18 @@ static int nft_parse_compat(const struct nlattr *attr, u16 *proto, bool *inv)
return -EINVAL; return -EINVAL;
flags = ntohl(nla_get_be32(tb[NFTA_RULE_COMPAT_FLAGS])); flags = ntohl(nla_get_be32(tb[NFTA_RULE_COMPAT_FLAGS]));
if (flags & ~NFT_RULE_COMPAT_F_MASK) if (flags & NFT_RULE_COMPAT_F_UNUSED ||
flags & ~NFT_RULE_COMPAT_F_MASK)
return -EINVAL; return -EINVAL;
if (flags & NFT_RULE_COMPAT_F_INV) if (flags & NFT_RULE_COMPAT_F_INV)
*inv = true; *inv = true;
*proto = ntohl(nla_get_be32(tb[NFTA_RULE_COMPAT_PROTO])); l4proto = ntohl(nla_get_be32(tb[NFTA_RULE_COMPAT_PROTO]));
if (l4proto > U16_MAX)
return -EINVAL;
*proto = l4proto;
return 0; return 0;
} }
@ -418,7 +425,7 @@ static void nft_match_eval(const struct nft_expr *expr,
static const struct nla_policy nft_match_policy[NFTA_MATCH_MAX + 1] = { static const struct nla_policy nft_match_policy[NFTA_MATCH_MAX + 1] = {
[NFTA_MATCH_NAME] = { .type = NLA_NUL_STRING }, [NFTA_MATCH_NAME] = { .type = NLA_NUL_STRING },
[NFTA_MATCH_REV] = { .type = NLA_U32 }, [NFTA_MATCH_REV] = NLA_POLICY_MAX(NLA_BE32, 255),
[NFTA_MATCH_INFO] = { .type = NLA_BINARY }, [NFTA_MATCH_INFO] = { .type = NLA_BINARY },
}; };
@ -721,7 +728,7 @@ static int nfnl_compat_get_rcu(struct sk_buff *skb,
static const struct nla_policy nfnl_compat_policy_get[NFTA_COMPAT_MAX+1] = { static const struct nla_policy nfnl_compat_policy_get[NFTA_COMPAT_MAX+1] = {
[NFTA_COMPAT_NAME] = { .type = NLA_NUL_STRING, [NFTA_COMPAT_NAME] = { .type = NLA_NUL_STRING,
.len = NFT_COMPAT_NAME_MAX-1 }, .len = NFT_COMPAT_NAME_MAX-1 },
[NFTA_COMPAT_REV] = { .type = NLA_U32 }, [NFTA_COMPAT_REV] = NLA_POLICY_MAX(NLA_BE32, 255),
[NFTA_COMPAT_TYPE] = { .type = NLA_U32 }, [NFTA_COMPAT_TYPE] = { .type = NLA_U32 },
}; };

View File

@ -484,6 +484,9 @@ static int nft_ct_get_init(const struct nft_ctx *ctx,
break; break;
#endif #endif
case NFT_CT_ID: case NFT_CT_ID:
if (tb[NFTA_CT_DIRECTION])
return -EINVAL;
len = sizeof(u32); len = sizeof(u32);
break; break;
default: default:

View File

@ -342,9 +342,6 @@
#include "nft_set_pipapo_avx2.h" #include "nft_set_pipapo_avx2.h"
#include "nft_set_pipapo.h" #include "nft_set_pipapo.h"
/* Current working bitmap index, toggled between field matches */
static DEFINE_PER_CPU(bool, nft_pipapo_scratch_index);
/** /**
* pipapo_refill() - For each set bit, set bits from selected mapping table item * pipapo_refill() - For each set bit, set bits from selected mapping table item
* @map: Bitmap to be scanned for set bits * @map: Bitmap to be scanned for set bits
@ -412,6 +409,7 @@ bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set,
const u32 *key, const struct nft_set_ext **ext) const u32 *key, const struct nft_set_ext **ext)
{ {
struct nft_pipapo *priv = nft_set_priv(set); struct nft_pipapo *priv = nft_set_priv(set);
struct nft_pipapo_scratch *scratch;
unsigned long *res_map, *fill_map; unsigned long *res_map, *fill_map;
u8 genmask = nft_genmask_cur(net); u8 genmask = nft_genmask_cur(net);
const u8 *rp = (const u8 *)key; const u8 *rp = (const u8 *)key;
@ -422,15 +420,17 @@ bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set,
local_bh_disable(); local_bh_disable();
map_index = raw_cpu_read(nft_pipapo_scratch_index);
m = rcu_dereference(priv->match); m = rcu_dereference(priv->match);
if (unlikely(!m || !*raw_cpu_ptr(m->scratch))) if (unlikely(!m || !*raw_cpu_ptr(m->scratch)))
goto out; goto out;
res_map = *raw_cpu_ptr(m->scratch) + (map_index ? m->bsize_max : 0); scratch = *raw_cpu_ptr(m->scratch);
fill_map = *raw_cpu_ptr(m->scratch) + (map_index ? 0 : m->bsize_max);
map_index = scratch->map_index;
res_map = scratch->map + (map_index ? m->bsize_max : 0);
fill_map = scratch->map + (map_index ? 0 : m->bsize_max);
memset(res_map, 0xff, m->bsize_max * sizeof(*res_map)); memset(res_map, 0xff, m->bsize_max * sizeof(*res_map));
@ -460,7 +460,7 @@ bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set,
b = pipapo_refill(res_map, f->bsize, f->rules, fill_map, f->mt, b = pipapo_refill(res_map, f->bsize, f->rules, fill_map, f->mt,
last); last);
if (b < 0) { if (b < 0) {
raw_cpu_write(nft_pipapo_scratch_index, map_index); scratch->map_index = map_index;
local_bh_enable(); local_bh_enable();
return false; return false;
@ -477,7 +477,7 @@ bool nft_pipapo_lookup(const struct net *net, const struct nft_set *set,
* current inactive bitmap is clean and can be reused as * current inactive bitmap is clean and can be reused as
* *next* bitmap (not initial) for the next packet. * *next* bitmap (not initial) for the next packet.
*/ */
raw_cpu_write(nft_pipapo_scratch_index, map_index); scratch->map_index = map_index;
local_bh_enable(); local_bh_enable();
return true; return true;
@ -1101,6 +1101,25 @@ static void pipapo_map(struct nft_pipapo_match *m,
f->mt[map[i].to + j].e = e; f->mt[map[i].to + j].e = e;
} }
/**
* pipapo_free_scratch() - Free per-CPU map at original (not aligned) address
* @m: Matching data
* @cpu: CPU number
*/
static void pipapo_free_scratch(const struct nft_pipapo_match *m, unsigned int cpu)
{
struct nft_pipapo_scratch *s;
void *mem;
s = *per_cpu_ptr(m->scratch, cpu);
if (!s)
return;
mem = s;
mem -= s->align_off;
kfree(mem);
}
/** /**
* pipapo_realloc_scratch() - Reallocate scratch maps for partial match results * pipapo_realloc_scratch() - Reallocate scratch maps for partial match results
* @clone: Copy of matching data with pending insertions and deletions * @clone: Copy of matching data with pending insertions and deletions
@ -1114,12 +1133,13 @@ static int pipapo_realloc_scratch(struct nft_pipapo_match *clone,
int i; int i;
for_each_possible_cpu(i) { for_each_possible_cpu(i) {
unsigned long *scratch; struct nft_pipapo_scratch *scratch;
#ifdef NFT_PIPAPO_ALIGN #ifdef NFT_PIPAPO_ALIGN
unsigned long *scratch_aligned; void *scratch_aligned;
u32 align_off;
#endif #endif
scratch = kzalloc_node(struct_size(scratch, map,
scratch = kzalloc_node(bsize_max * sizeof(*scratch) * 2 + bsize_max * 2) +
NFT_PIPAPO_ALIGN_HEADROOM, NFT_PIPAPO_ALIGN_HEADROOM,
GFP_KERNEL, cpu_to_node(i)); GFP_KERNEL, cpu_to_node(i));
if (!scratch) { if (!scratch) {
@ -1133,14 +1153,25 @@ static int pipapo_realloc_scratch(struct nft_pipapo_match *clone,
return -ENOMEM; return -ENOMEM;
} }
kfree(*per_cpu_ptr(clone->scratch, i)); pipapo_free_scratch(clone, i);
*per_cpu_ptr(clone->scratch, i) = scratch;
#ifdef NFT_PIPAPO_ALIGN #ifdef NFT_PIPAPO_ALIGN
scratch_aligned = NFT_PIPAPO_LT_ALIGN(scratch); /* Align &scratch->map (not the struct itself): the extra
*per_cpu_ptr(clone->scratch_aligned, i) = scratch_aligned; * %NFT_PIPAPO_ALIGN_HEADROOM bytes passed to kzalloc_node()
* above guarantee we can waste up to those bytes in order
* to align the map field regardless of its offset within
* the struct.
*/
BUILD_BUG_ON(offsetof(struct nft_pipapo_scratch, map) > NFT_PIPAPO_ALIGN_HEADROOM);
scratch_aligned = NFT_PIPAPO_LT_ALIGN(&scratch->map);
scratch_aligned -= offsetof(struct nft_pipapo_scratch, map);
align_off = scratch_aligned - (void *)scratch;
scratch = scratch_aligned;
scratch->align_off = align_off;
#endif #endif
*per_cpu_ptr(clone->scratch, i) = scratch;
} }
return 0; return 0;
@ -1294,11 +1325,6 @@ static struct nft_pipapo_match *pipapo_clone(struct nft_pipapo_match *old)
if (!new->scratch) if (!new->scratch)
goto out_scratch; goto out_scratch;
#ifdef NFT_PIPAPO_ALIGN
new->scratch_aligned = alloc_percpu(*new->scratch_aligned);
if (!new->scratch_aligned)
goto out_scratch;
#endif
for_each_possible_cpu(i) for_each_possible_cpu(i)
*per_cpu_ptr(new->scratch, i) = NULL; *per_cpu_ptr(new->scratch, i) = NULL;
@ -1350,10 +1376,7 @@ static struct nft_pipapo_match *pipapo_clone(struct nft_pipapo_match *old)
} }
out_scratch_realloc: out_scratch_realloc:
for_each_possible_cpu(i) for_each_possible_cpu(i)
kfree(*per_cpu_ptr(new->scratch, i)); pipapo_free_scratch(new, i);
#ifdef NFT_PIPAPO_ALIGN
free_percpu(new->scratch_aligned);
#endif
out_scratch: out_scratch:
free_percpu(new->scratch); free_percpu(new->scratch);
kfree(new); kfree(new);
@ -1638,13 +1661,9 @@ static void pipapo_free_match(struct nft_pipapo_match *m)
int i; int i;
for_each_possible_cpu(i) for_each_possible_cpu(i)
kfree(*per_cpu_ptr(m->scratch, i)); pipapo_free_scratch(m, i);
#ifdef NFT_PIPAPO_ALIGN
free_percpu(m->scratch_aligned);
#endif
free_percpu(m->scratch); free_percpu(m->scratch);
pipapo_free_fields(m); pipapo_free_fields(m);
kfree(m); kfree(m);
@ -2132,7 +2151,7 @@ static int nft_pipapo_init(const struct nft_set *set,
m->field_count = field_count; m->field_count = field_count;
m->bsize_max = 0; m->bsize_max = 0;
m->scratch = alloc_percpu(unsigned long *); m->scratch = alloc_percpu(struct nft_pipapo_scratch *);
if (!m->scratch) { if (!m->scratch) {
err = -ENOMEM; err = -ENOMEM;
goto out_scratch; goto out_scratch;
@ -2140,16 +2159,6 @@ static int nft_pipapo_init(const struct nft_set *set,
for_each_possible_cpu(i) for_each_possible_cpu(i)
*per_cpu_ptr(m->scratch, i) = NULL; *per_cpu_ptr(m->scratch, i) = NULL;
#ifdef NFT_PIPAPO_ALIGN
m->scratch_aligned = alloc_percpu(unsigned long *);
if (!m->scratch_aligned) {
err = -ENOMEM;
goto out_free;
}
for_each_possible_cpu(i)
*per_cpu_ptr(m->scratch_aligned, i) = NULL;
#endif
rcu_head_init(&m->rcu); rcu_head_init(&m->rcu);
nft_pipapo_for_each_field(f, i, m) { nft_pipapo_for_each_field(f, i, m) {
@ -2180,9 +2189,6 @@ static int nft_pipapo_init(const struct nft_set *set,
return 0; return 0;
out_free: out_free:
#ifdef NFT_PIPAPO_ALIGN
free_percpu(m->scratch_aligned);
#endif
free_percpu(m->scratch); free_percpu(m->scratch);
out_scratch: out_scratch:
kfree(m); kfree(m);
@ -2234,11 +2240,10 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx,
if (m) { if (m) {
rcu_barrier(); rcu_barrier();
#ifdef NFT_PIPAPO_ALIGN nft_set_pipapo_match_destroy(ctx, set, m);
free_percpu(m->scratch_aligned);
#endif
for_each_possible_cpu(cpu) for_each_possible_cpu(cpu)
kfree(*per_cpu_ptr(m->scratch, cpu)); pipapo_free_scratch(m, cpu);
free_percpu(m->scratch); free_percpu(m->scratch);
pipapo_free_fields(m); pipapo_free_fields(m);
kfree(m); kfree(m);
@ -2250,11 +2255,8 @@ static void nft_pipapo_destroy(const struct nft_ctx *ctx,
nft_set_pipapo_match_destroy(ctx, set, m); nft_set_pipapo_match_destroy(ctx, set, m);
#ifdef NFT_PIPAPO_ALIGN
free_percpu(priv->clone->scratch_aligned);
#endif
for_each_possible_cpu(cpu) for_each_possible_cpu(cpu)
kfree(*per_cpu_ptr(priv->clone->scratch, cpu)); pipapo_free_scratch(priv->clone, cpu);
free_percpu(priv->clone->scratch); free_percpu(priv->clone->scratch);
pipapo_free_fields(priv->clone); pipapo_free_fields(priv->clone);

View File

@ -130,21 +130,29 @@ struct nft_pipapo_field {
union nft_pipapo_map_bucket *mt; union nft_pipapo_map_bucket *mt;
}; };
/**
* struct nft_pipapo_scratch - percpu data used for lookup and matching
* @map_index: Current working bitmap index, toggled between field matches
* @align_off: Offset to get the originally allocated address
* @map: store partial matching results during lookup
*/
struct nft_pipapo_scratch {
u8 map_index;
u32 align_off;
unsigned long map[];
};
/** /**
* struct nft_pipapo_match - Data used for lookup and matching * struct nft_pipapo_match - Data used for lookup and matching
* @field_count Amount of fields in set * @field_count Amount of fields in set
* @scratch: Preallocated per-CPU maps for partial matching results * @scratch: Preallocated per-CPU maps for partial matching results
* @scratch_aligned: Version of @scratch aligned to NFT_PIPAPO_ALIGN bytes
* @bsize_max: Maximum lookup table bucket size of all fields, in longs * @bsize_max: Maximum lookup table bucket size of all fields, in longs
* @rcu Matching data is swapped on commits * @rcu Matching data is swapped on commits
* @f: Fields, with lookup and mapping tables * @f: Fields, with lookup and mapping tables
*/ */
struct nft_pipapo_match { struct nft_pipapo_match {
int field_count; int field_count;
#ifdef NFT_PIPAPO_ALIGN struct nft_pipapo_scratch * __percpu *scratch;
unsigned long * __percpu *scratch_aligned;
#endif
unsigned long * __percpu *scratch;
size_t bsize_max; size_t bsize_max;
struct rcu_head rcu; struct rcu_head rcu;
struct nft_pipapo_field f[]; struct nft_pipapo_field f[];

View File

@ -71,9 +71,6 @@
#define NFT_PIPAPO_AVX2_ZERO(reg) \ #define NFT_PIPAPO_AVX2_ZERO(reg) \
asm volatile("vpxor %ymm" #reg ", %ymm" #reg ", %ymm" #reg) asm volatile("vpxor %ymm" #reg ", %ymm" #reg ", %ymm" #reg)
/* Current working bitmap index, toggled between field matches */
static DEFINE_PER_CPU(bool, nft_pipapo_avx2_scratch_index);
/** /**
* nft_pipapo_avx2_prepare() - Prepare before main algorithm body * nft_pipapo_avx2_prepare() - Prepare before main algorithm body
* *
@ -1120,11 +1117,12 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
const u32 *key, const struct nft_set_ext **ext) const u32 *key, const struct nft_set_ext **ext)
{ {
struct nft_pipapo *priv = nft_set_priv(set); struct nft_pipapo *priv = nft_set_priv(set);
unsigned long *res, *fill, *scratch; struct nft_pipapo_scratch *scratch;
u8 genmask = nft_genmask_cur(net); u8 genmask = nft_genmask_cur(net);
const u8 *rp = (const u8 *)key; const u8 *rp = (const u8 *)key;
struct nft_pipapo_match *m; struct nft_pipapo_match *m;
struct nft_pipapo_field *f; struct nft_pipapo_field *f;
unsigned long *res, *fill;
bool map_index; bool map_index;
int i, ret = 0; int i, ret = 0;
@ -1141,15 +1139,16 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
*/ */
kernel_fpu_begin_mask(0); kernel_fpu_begin_mask(0);
scratch = *raw_cpu_ptr(m->scratch_aligned); scratch = *raw_cpu_ptr(m->scratch);
if (unlikely(!scratch)) { if (unlikely(!scratch)) {
kernel_fpu_end(); kernel_fpu_end();
return false; return false;
} }
map_index = raw_cpu_read(nft_pipapo_avx2_scratch_index);
res = scratch + (map_index ? m->bsize_max : 0); map_index = scratch->map_index;
fill = scratch + (map_index ? 0 : m->bsize_max);
res = scratch->map + (map_index ? m->bsize_max : 0);
fill = scratch->map + (map_index ? 0 : m->bsize_max);
/* Starting map doesn't need to be set for this implementation */ /* Starting map doesn't need to be set for this implementation */
@ -1221,7 +1220,7 @@ bool nft_pipapo_avx2_lookup(const struct net *net, const struct nft_set *set,
out: out:
if (i % 2) if (i % 2)
raw_cpu_write(nft_pipapo_avx2_scratch_index, !map_index); scratch->map_index = !map_index;
kernel_fpu_end(); kernel_fpu_end();
return ret >= 0; return ret >= 0;

View File

@ -41,6 +41,14 @@ static void rxrpc_conn_retransmit_call(struct rxrpc_connection *conn,
_enter("%d", conn->debug_id); _enter("%d", conn->debug_id);
if (sp && sp->hdr.type == RXRPC_PACKET_TYPE_ACK) {
if (skb_copy_bits(skb, sizeof(struct rxrpc_wire_header),
&pkt.ack, sizeof(pkt.ack)) < 0)
return;
if (pkt.ack.reason == RXRPC_ACK_PING_RESPONSE)
return;
}
chan = &conn->channels[channel]; chan = &conn->channels[channel];
/* If the last call got moved on whilst we were waiting to run, just /* If the last call got moved on whilst we were waiting to run, just

View File

@ -1088,6 +1088,12 @@ int tipc_nl_bearer_add(struct sk_buff *skb, struct genl_info *info)
#ifdef CONFIG_TIPC_MEDIA_UDP #ifdef CONFIG_TIPC_MEDIA_UDP
if (attrs[TIPC_NLA_BEARER_UDP_OPTS]) { if (attrs[TIPC_NLA_BEARER_UDP_OPTS]) {
if (b->media->type_id != TIPC_MEDIA_TYPE_UDP) {
rtnl_unlock();
NL_SET_ERR_MSG(info->extack, "UDP option is unsupported");
return -EINVAL;
}
err = tipc_udp_nl_bearer_add(b, err = tipc_udp_nl_bearer_add(b,
attrs[TIPC_NLA_BEARER_UDP_OPTS]); attrs[TIPC_NLA_BEARER_UDP_OPTS]);
if (err) { if (err) {

View File

@ -314,6 +314,17 @@ void unix_gc(void)
/* Here we are. Hitlist is filled. Die. */ /* Here we are. Hitlist is filled. Die. */
__skb_queue_purge(&hitlist); __skb_queue_purge(&hitlist);
#if IS_ENABLED(CONFIG_AF_UNIX_OOB)
list_for_each_entry_safe(u, next, &gc_candidates, link) {
struct sk_buff *skb = u->oob_skb;
if (skb) {
u->oob_skb = NULL;
kfree_skb(skb);
}
}
#endif
spin_lock(&unix_gc_lock); spin_lock(&unix_gc_lock);
/* There could be io_uring registered files, just push them back to /* There could be io_uring registered files, just push them back to

View File

@ -3,7 +3,7 @@
// This file is provided under a dual BSD/GPLv2 license. When using or // This file is provided under a dual BSD/GPLv2 license. When using or
// redistributing this file, you may do so under either license. // redistributing this file, you may do so under either license.
// //
// Copyright(c) 2021, 2023 Advanced Micro Devices, Inc. // Copyright(c) 2021 Advanced Micro Devices, Inc.
// //
// Authors: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com> // Authors: Ajit Kumar Pandey <AjitKumar.Pandey@amd.com>
// //
@ -35,19 +35,6 @@ static const struct config_entry config_table[] = {
{} {}
}, },
}, },
{
.flags = FLAG_AMD_LEGACY,
.device = ACP_PCI_DEV_ID,
.dmi_table = (const struct dmi_system_id []) {
{
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "Valve"),
DMI_MATCH(DMI_PRODUCT_NAME, "Jupiter"),
},
},
{}
},
},
{ {
.flags = FLAG_AMD_SOF, .flags = FLAG_AMD_SOF,
.device = ACP_PCI_DEV_ID, .device = ACP_PCI_DEV_ID,

View File

@ -2029,10 +2029,14 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_CTL_MSG_DELAY_1M | QUIRK_FLAG_IGNORE_CTL_ERROR), QUIRK_FLAG_CTL_MSG_DELAY_1M | QUIRK_FLAG_IGNORE_CTL_ERROR),
DEVICE_FLG(0x0499, 0x1509, /* Steinberg UR22 */ DEVICE_FLG(0x0499, 0x1509, /* Steinberg UR22 */
QUIRK_FLAG_GENERIC_IMPLICIT_FB), QUIRK_FLAG_GENERIC_IMPLICIT_FB),
DEVICE_FLG(0x0499, 0x3108, /* Yamaha YIT-W12TX */
QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x04d8, 0xfeea, /* Benchmark DAC1 Pre */ DEVICE_FLG(0x04d8, 0xfeea, /* Benchmark DAC1 Pre */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x04e8, 0xa051, /* Samsung USBC Headset (AKG) */ DEVICE_FLG(0x04e8, 0xa051, /* Samsung USBC Headset (AKG) */
QUIRK_FLAG_SKIP_CLOCK_SELECTOR | QUIRK_FLAG_CTL_MSG_DELAY_5M), QUIRK_FLAG_SKIP_CLOCK_SELECTOR | QUIRK_FLAG_CTL_MSG_DELAY_5M),
DEVICE_FLG(0x0525, 0xa4ad, /* Hamedal C20 usb camero */
QUIRK_FLAG_IFACE_SKIP_CLOSE),
DEVICE_FLG(0x054c, 0x0b8c, /* Sony WALKMAN NW-A45 DAC */ DEVICE_FLG(0x054c, 0x0b8c, /* Sony WALKMAN NW-A45 DAC */
QUIRK_FLAG_SET_IFACE_FIRST), QUIRK_FLAG_SET_IFACE_FIRST),
DEVICE_FLG(0x0556, 0x0014, /* Phoenix Audio TMX320VC */ DEVICE_FLG(0x0556, 0x0014, /* Phoenix Audio TMX320VC */
@ -2071,14 +2075,22 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_GENERIC_IMPLICIT_FB), QUIRK_FLAG_GENERIC_IMPLICIT_FB),
DEVICE_FLG(0x0763, 0x2031, /* M-Audio Fast Track C600 */ DEVICE_FLG(0x0763, 0x2031, /* M-Audio Fast Track C600 */
QUIRK_FLAG_GENERIC_IMPLICIT_FB), QUIRK_FLAG_GENERIC_IMPLICIT_FB),
DEVICE_FLG(0x07fd, 0x000b, /* MOTU M Series 2nd hardware revision */
QUIRK_FLAG_CTL_MSG_DELAY_1M),
DEVICE_FLG(0x08bb, 0x2702, /* LineX FM Transmitter */ DEVICE_FLG(0x08bb, 0x2702, /* LineX FM Transmitter */
QUIRK_FLAG_IGNORE_CTL_ERROR), QUIRK_FLAG_IGNORE_CTL_ERROR),
DEVICE_FLG(0x0951, 0x16ad, /* Kingston HyperX */ DEVICE_FLG(0x0951, 0x16ad, /* Kingston HyperX */
QUIRK_FLAG_CTL_MSG_DELAY_1M), QUIRK_FLAG_CTL_MSG_DELAY_1M),
DEVICE_FLG(0x0b0e, 0x0349, /* Jabra 550a */ DEVICE_FLG(0x0b0e, 0x0349, /* Jabra 550a */
QUIRK_FLAG_CTL_MSG_DELAY_1M), QUIRK_FLAG_CTL_MSG_DELAY_1M),
DEVICE_FLG(0x0ecb, 0x205c, /* JBL Quantum610 Wireless */
QUIRK_FLAG_FIXED_RATE),
DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */
QUIRK_FLAG_FIXED_RATE),
DEVICE_FLG(0x0fd9, 0x0008, /* Hauppauge HVR-950Q */ DEVICE_FLG(0x0fd9, 0x0008, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER), QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER),
DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */
QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */ DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x1397, 0x0507, /* Behringer UMC202HD */ DEVICE_FLG(0x1397, 0x0507, /* Behringer UMC202HD */
@ -2111,6 +2123,10 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_ITF_USB_DSD_DAC | QUIRK_FLAG_CTL_MSG_DELAY), QUIRK_FLAG_ITF_USB_DSD_DAC | QUIRK_FLAG_CTL_MSG_DELAY),
DEVICE_FLG(0x1901, 0x0191, /* GE B850V3 CP2114 audio interface */ DEVICE_FLG(0x1901, 0x0191, /* GE B850V3 CP2114 audio interface */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x19f7, 0x0035, /* RODE NT-USB+ */
QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x1bcf, 0x2283, /* NexiGo N930AF FHD Webcam */
QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x2040, 0x7200, /* Hauppauge HVR-950Q */ DEVICE_FLG(0x2040, 0x7200, /* Hauppauge HVR-950Q */
QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER), QUIRK_FLAG_SHARE_MEDIA_DEVICE | QUIRK_FLAG_ALIGN_TRANSFER),
DEVICE_FLG(0x2040, 0x7201, /* Hauppauge HVR-950Q-MXL */ DEVICE_FLG(0x2040, 0x7201, /* Hauppauge HVR-950Q-MXL */
@ -2153,6 +2169,12 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_IGNORE_CTL_ERROR), QUIRK_FLAG_IGNORE_CTL_ERROR),
DEVICE_FLG(0x2912, 0x30c8, /* Audioengine D1 */ DEVICE_FLG(0x2912, 0x30c8, /* Audioengine D1 */
QUIRK_FLAG_GET_SAMPLE_RATE), QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x2b53, 0x0023, /* Fiero SC-01 (firmware v1.0.0 @ 48 kHz) */
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
DEVICE_FLG(0x2b53, 0x0024, /* Fiero SC-01 (firmware v1.0.0 @ 96 kHz) */
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
DEVICE_FLG(0x30be, 0x0101, /* Schiit Hel */ DEVICE_FLG(0x30be, 0x0101, /* Schiit Hel */
QUIRK_FLAG_IGNORE_CTL_ERROR), QUIRK_FLAG_IGNORE_CTL_ERROR),
DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */ DEVICE_FLG(0x413c, 0xa506, /* Dell AE515 sound bar */
@ -2161,22 +2183,6 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
QUIRK_FLAG_ALIGN_TRANSFER), QUIRK_FLAG_ALIGN_TRANSFER),
DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */ DEVICE_FLG(0x534d, 0x2109, /* MacroSilicon MS2109 */
QUIRK_FLAG_ALIGN_TRANSFER), QUIRK_FLAG_ALIGN_TRANSFER),
DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */
QUIRK_FLAG_GET_SAMPLE_RATE),
DEVICE_FLG(0x2b53, 0x0023, /* Fiero SC-01 (firmware v1.0.0 @ 48 kHz) */
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
DEVICE_FLG(0x2b53, 0x0024, /* Fiero SC-01 (firmware v1.0.0 @ 96 kHz) */
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
DEVICE_FLG(0x2b53, 0x0031, /* Fiero SC-01 (firmware v1.1.0) */
QUIRK_FLAG_GENERIC_IMPLICIT_FB),
DEVICE_FLG(0x0525, 0xa4ad, /* Hamedal C20 usb camero */
QUIRK_FLAG_IFACE_SKIP_CLOSE),
DEVICE_FLG(0x0ecb, 0x205c, /* JBL Quantum610 Wireless */
QUIRK_FLAG_FIXED_RATE),
DEVICE_FLG(0x0ecb, 0x2069, /* JBL Quantum810 Wireless */
QUIRK_FLAG_FIXED_RATE),
DEVICE_FLG(0x1bcf, 0x2283, /* NexiGo N930AF FHD Webcam */
QUIRK_FLAG_GET_SAMPLE_RATE),
/* Vendor matches */ /* Vendor matches */
VENDOR_FLG(0x045e, /* MS Lifecam */ VENDOR_FLG(0x045e, /* MS Lifecam */

View File

@ -91,7 +91,7 @@ for ovr in setsock cmsg both diff; do
check_result $? 0 "TCLASS $prot $ovr - pass" check_result $? 0 "TCLASS $prot $ovr - pass"
while [ -d /proc/$BG ]; do while [ -d /proc/$BG ]; do
$NSEXE ./cmsg_sender -6 -p u $TGT6 1234 $NSEXE ./cmsg_sender -6 -p $p $m $((TOS2)) $TGT6 1234
done done
tcpdump -r $TMPF -v 2>&1 | grep "class $TOS2" >> /dev/null tcpdump -r $TMPF -v 2>&1 | grep "class $TOS2" >> /dev/null
@ -128,7 +128,7 @@ for ovr in setsock cmsg both diff; do
check_result $? 0 "HOPLIMIT $prot $ovr - pass" check_result $? 0 "HOPLIMIT $prot $ovr - pass"
while [ -d /proc/$BG ]; do while [ -d /proc/$BG ]; do
$NSEXE ./cmsg_sender -6 -p u $TGT6 1234 $NSEXE ./cmsg_sender -6 -p $p $m $LIM $TGT6 1234
done done
tcpdump -r $TMPF -v 2>&1 | grep "hlim $LIM[^0-9]" >> /dev/null tcpdump -r $TMPF -v 2>&1 | grep "hlim $LIM[^0-9]" >> /dev/null

View File

@ -1928,6 +1928,13 @@ check_command() {
return 0 return 0
} }
check_running() {
pid=${1}
cmd=${2}
[ "$(cat /proc/${pid}/cmdline 2>/dev/null | tr -d '\0')" = "{cmd}" ]
}
test_cleanup_vxlanX_exception() { test_cleanup_vxlanX_exception() {
outer="${1}" outer="${1}"
encap="vxlan" encap="vxlan"
@ -1958,11 +1965,12 @@ test_cleanup_vxlanX_exception() {
${ns_a} ip link del dev veth_A-R1 & ${ns_a} ip link del dev veth_A-R1 &
iplink_pid=$! iplink_pid=$!
sleep 1 for i in $(seq 1 20); do
if [ "$(cat /proc/${iplink_pid}/cmdline 2>/dev/null | tr -d '\0')" = "iplinkdeldevveth_A-R1" ]; then check_running ${iplink_pid} "iplinkdeldevveth_A-R1" || return 0
err " can't delete veth device in a timely manner, PMTU dst likely leaked" sleep 0.1
return 1 done
fi err " can't delete veth device in a timely manner, PMTU dst likely leaked"
return 1
} }
test_cleanup_ipv6_exception() { test_cleanup_ipv6_exception() {

View File

@ -37,6 +37,10 @@ create_ns() {
for ns in $NS_SRC $NS_DST; do for ns in $NS_SRC $NS_DST; do
ip netns add $ns ip netns add $ns
ip -n $ns link set dev lo up ip -n $ns link set dev lo up
# disable route solicitations to decrease 'noise' traffic
ip netns exec $ns sysctl -qw net.ipv6.conf.default.router_solicitations=0
ip netns exec $ns sysctl -qw net.ipv6.conf.all.router_solicitations=0
done done
ip link add name veth$SRC type veth peer name veth$DST ip link add name veth$SRC type veth peer name veth$DST
@ -78,6 +82,12 @@ create_vxlan_pair() {
create_vxlan_endpoint $BASE$ns veth$ns $BM_NET_V6$((3 - $ns)) vxlan6$ns 6 create_vxlan_endpoint $BASE$ns veth$ns $BM_NET_V6$((3 - $ns)) vxlan6$ns 6
ip -n $BASE$ns addr add dev vxlan6$ns $OL_NET_V6$ns/24 nodad ip -n $BASE$ns addr add dev vxlan6$ns $OL_NET_V6$ns/24 nodad
done done
# preload neighbur cache, do avoid some noisy traffic
local addr_dst=$(ip -j -n $BASE$DST link show dev vxlan6$DST |jq -r '.[]["address"]')
local addr_src=$(ip -j -n $BASE$SRC link show dev vxlan6$SRC |jq -r '.[]["address"]')
ip -n $BASE$DST neigh add dev vxlan6$DST lladdr $addr_src $OL_NET_V6$SRC
ip -n $BASE$SRC neigh add dev vxlan6$SRC lladdr $addr_dst $OL_NET_V6$DST
} }
is_ipv6() { is_ipv6() {
@ -117,7 +127,7 @@ run_test() {
# not enable GRO # not enable GRO
ip netns exec $NS_DST $ipt -A INPUT -p udp --dport 4789 ip netns exec $NS_DST $ipt -A INPUT -p udp --dport 4789
ip netns exec $NS_DST $ipt -A INPUT -p udp --dport 8000 ip netns exec $NS_DST $ipt -A INPUT -p udp --dport 8000
ip netns exec $NS_DST ./udpgso_bench_rx -C 1000 -R 10 -n 10 -l 1300 $rx_args & ip netns exec $NS_DST ./udpgso_bench_rx -C 2000 -R 100 -n 10 -l 1300 $rx_args &
local spid=$! local spid=$!
sleep 0.1 sleep 0.1
ip netns exec $NS_SRC ./udpgso_bench_tx $family -M 1 -s 13000 -S 1300 -D $dst ip netns exec $NS_SRC ./udpgso_bench_tx $family -M 1 -s 13000 -S 1300 -D $dst
@ -166,7 +176,7 @@ run_bench() {
# bind the sender and the receiver to different CPUs to try # bind the sender and the receiver to different CPUs to try
# get reproducible results # get reproducible results
ip netns exec $NS_DST bash -c "echo 2 > /sys/class/net/veth$DST/queues/rx-0/rps_cpus" ip netns exec $NS_DST bash -c "echo 2 > /sys/class/net/veth$DST/queues/rx-0/rps_cpus"
ip netns exec $NS_DST taskset 0x2 ./udpgso_bench_rx -C 1000 -R 10 & ip netns exec $NS_DST taskset 0x2 ./udpgso_bench_rx -C 2000 -R 100 &
local spid=$! local spid=$!
sleep 0.1 sleep 0.1
ip netns exec $NS_SRC taskset 0x1 ./udpgso_bench_tx $family -l 3 -S 1300 -D $dst ip netns exec $NS_SRC taskset 0x1 ./udpgso_bench_tx $family -l 3 -S 1300 -D $dst

View File

@ -375,7 +375,7 @@ static void do_recv(void)
do_flush_udp(fd); do_flush_udp(fd);
tnow = gettimeofday_ms(); tnow = gettimeofday_ms();
if (tnow > treport) { if (!cfg_expected_pkt_nr && tnow > treport) {
if (packets) if (packets)
fprintf(stderr, fprintf(stderr,
"%s rx: %6lu MB/s %8lu calls/s\n", "%s rx: %6lu MB/s %8lu calls/s\n",