5.4.13-stable review
Subsystems (11)
Greg Kroah-Hartman
maintainerPATCH 101/203 crypto: virtio - implement missing support for output IVs
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
commit 500e6807ce93b1fdc7d5b827c5cc167cc35630db upstream.
In order to allow for CBC to be chained, which is something that the CTS template relies upon, implementations of CBC need to pass the IV to be used for subsequent invocations via the IV buffer. This was not implemented yet for virtio-crypto so implement it now.
--- drivers/crypto/virtio/virtio_crypto_algs.c | 9 +++++++++ 1 file changed, 9 insertions(+)
drivers/crypto/virtio/virtio_crypto_algs.c +9 -0
@@ -435,6 +435,11 @@ __virtio_crypto_ablkcipher_do_req(struct goto free; }memcpy (iv, req->info, ivsize); +if (!vc_sym_req->encrypt) +scatterwalk_map_and_copy (req->info, req->src, + req->nbytes -AES_BLOCK_SIZE , +AES_BLOCK_SIZE ,0 ); +sg_init_one (&iv_sg, iv, ivsize); sgs[num_out++] = &iv_sg; vc_sym_req->iv = iv;
@@ -571,6 +576,10 @@ static void virtio_crypto_ablkcipher_fin struct ablkcipher_request *req, int err) { +if (vc_sym_req->encrypt) +scatterwalk_map_and_copy (req->info, req->dst, + req->nbytes -AES_BLOCK_SIZE , +AES_BLOCK_SIZE ,0 );crypto_finalize_ablkcipher_request (vc_sym_req->base.dataq->engine, req, err);kzfree (vc_sym_req->iv);
Greg Kroah-Hartman
maintainerPATCH 168/203 spi: pxa2xx: Set controller->max_transfer_size in dma mode
In reply to Greg Kroah-HartmanFrom: Daniel Vetter <daniel.vetter-/[email protected]>
commit b2662a164f9dc48da8822e56600686d639056282 upstream.
In DMA mode we have a maximum transfer size, past that the driver falls back to PIO (see the check at the top of pxa2xx_spi_transfer_one). Falling back to PIO for big transfers defeats the point of a dma engine, hence set the max transfer size to inform spi clients that they need to do something smarter.
This was uncovered by the drm_mipi_dbi spi panel code, which does large spi transfers, but stopped splitting them after:
commit e143364b4c1774f68e923a5a0bb0fca28ac25888
Author: Noralf Trønnes <[email protected]> Date: Fri Jul 19 17:59:10 2019 +0200
drm/tinydrm: Remove tinydrm_spi_max_transfer_size()
After this commit the code relied on the spi core to split transfers into max dma-able blocks, which also papered over the PIO fallback issue.
Fix this by setting the overall max transfer size to the DMA limit, but only when the controller runs in DMA mode.
--- drivers/spi/spi-pxa2xx.c | 7 +++++++ 1 file changed, 7 insertions(+)
drivers/spi/spi-pxa2xx.c +7 -0
@@ -1612,6 +1612,11 @@ static int pxa2xx_spi_fw_translate_cs(streturn cs; } +static size_t pxa2xx_spi_max_dma_transfer_size (struct spi_device *spi) +{ +return MAX_DMA_LEN ; +} +static int pxa2xx_spi_probe (struct platform_device *pdev) {struct device *dev = &pdev->dev;
@@ -1717,6 +1722,8 @@ static int pxa2xx_spi_probe(struct platf }else { controller->can_dma = pxa2xx_spi_can_dma; controller->max_dma_len =MAX_DMA_LEN ; + controller->max_transfer_size = + pxa2xx_spi_max_dma_transfer_size; } }
Greg Kroah-Hartman
maintainerPATCH 1/203 HID: hidraw, uhid: Always report EPOLLOUT
In reply to Greg Kroah-HartmanFrom: Jiri Kosina <[email protected]>
[ Upstream commit 9e635c2851df6caee651e589fbf937b637973c91 ]
hidraw and uhid device nodes are always available for writing so we should always report EPOLLOUT and EPOLLWRNORM bits, not only in the cases when there is nothing to read.
--- drivers/hid/hidraw.c | 7 ++++--- drivers/hid/uhid.c | 5 +++-- 2 files changed, 7 insertions(+), 5 deletions(-)
drivers/hid/hidraw.c +4 -3
@@ -249,13 +249,14 @@ out:static __poll_t hidraw_poll (struct file *file,poll_table *wait) {struct hidraw_list *list = file->private_data; +__poll_t mask =EPOLLOUT |EPOLLWRNORM ;/* hidraw is always writable */ poll_wait (file, &list->hidraw->wait, wait);if (list->head != list->tail) -return EPOLLIN |EPOLLRDNORM ; + mask |=EPOLLIN |EPOLLRDNORM ;if (!list->hidraw->exist) -return EPOLLERR |EPOLLHUP ; -return EPOLLOUT |EPOLLWRNORM ; + mask |=EPOLLERR |EPOLLHUP ; +return mask; }static int hidraw_open (struct inode *inode,struct file *file)
drivers/hid/uhid.c +3 -2
@@ -766,13 +766,14 @@ unlock:static __poll_t uhid_char_poll (struct file *file,poll_table *wait) {struct uhid_device *uhid = file->private_data; +__poll_t mask =EPOLLOUT |EPOLLWRNORM ;/* uhid is always writable */ poll_wait (file, &uhid->waitq, wait);if (uhid->head != uhid->tail) -return EPOLLIN |EPOLLRDNORM ; + mask |=EPOLLIN |EPOLLRDNORM ; -return EPOLLOUT |EPOLLWRNORM ; +return mask; }static const struct file_operations uhid_fops = {
Greg Kroah-Hartman
maintainerPATCH 2/203 rtc: mt6397: fix alarm register overwrite
In reply to Greg Kroah-HartmanFrom: Ran Bi <[email protected]>
commit 653997eeecef95c3ead4fba1b2d27e6a5854d6cd upstream.
Alarm registers high byte was reserved for other functions. This add mask in alarm registers operation functions. This also fix error condition in interrupt handler.
--- drivers/rtc/rtc-mt6397.c | 47 +++++++++++++++++++++++++++++++++-------------- 1 file changed, 33 insertions(+), 14 deletions(-)
drivers/rtc/rtc-mt6397.c +33 -14
@@ -47,6 +47,14 @@#define RTC_AL_SEC 0x0018 +#define RTC_AL_SEC_MASK 0x003f +#define RTC_AL_MIN_MASK 0x003f +#define RTC_AL_HOU_MASK 0x001f +#define RTC_AL_DOM_MASK 0x001f +#define RTC_AL_DOW_MASK 0x0007 +#define RTC_AL_MTH_MASK 0x000f +#define RTC_AL_YEA_MASK 0x007f +#define RTC_PDN2 0x002e#define RTC_PDN2_PWRON_ALARM BIT(4)
@@ -103,7 +111,7 @@ static irqreturn_t mtk_rtc_irq_handler_t irqen = irqsta & ~RTC_IRQ_EN_AL ;mutex_lock (&rtc->lock);if (regmap_write (rtc->regmap, rtc->addr_base +RTC_IRQ_EN , - irqen) <0 ) + irqen) ==0 )mtk_rtc_write_trigger (rtc);mutex_unlock (&rtc->lock);
@@ -225,12 +233,12 @@ static int mtk_rtc_read_alarm(struct dev alm->pending = !!(pdn2 &RTC_PDN2_PWRON_ALARM );mutex_unlock (&rtc->lock); - tm->tm_sec = data[RTC_OFFSET_SEC ]; - tm->tm_min = data[RTC_OFFSET_MIN ]; - tm->tm_hour = data[RTC_OFFSET_HOUR ]; - tm->tm_mday = data[RTC_OFFSET_DOM ]; - tm->tm_mon = data[RTC_OFFSET_MTH ]; - tm->tm_year = data[RTC_OFFSET_YEAR ]; + tm->tm_sec = data[RTC_OFFSET_SEC ] &RTC_AL_SEC_MASK ; + tm->tm_min = data[RTC_OFFSET_MIN ] &RTC_AL_MIN_MASK ; + tm->tm_hour = data[RTC_OFFSET_HOUR ] &RTC_AL_HOU_MASK ; + tm->tm_mday = data[RTC_OFFSET_DOM ] &RTC_AL_DOM_MASK ; + tm->tm_mon = data[RTC_OFFSET_MTH ] &RTC_AL_MTH_MASK ; + tm->tm_year = data[RTC_OFFSET_YEAR ] &RTC_AL_YEA_MASK ; tm->tm_year +=RTC_MIN_YEAR_OFFSET ; tm->tm_mon--;
@@ -251,14 +259,25 @@ static int mtk_rtc_set_alarm(struct devi tm->tm_year -=RTC_MIN_YEAR_OFFSET ; tm->tm_mon++; - data[RTC_OFFSET_SEC ] = tm->tm_sec; - data[RTC_OFFSET_MIN ] = tm->tm_min; - data[RTC_OFFSET_HOUR ] = tm->tm_hour; - data[RTC_OFFSET_DOM ] = tm->tm_mday; - data[RTC_OFFSET_MTH ] = tm->tm_mon; - data[RTC_OFFSET_YEAR ] = tm->tm_year; -mutex_lock (&rtc->lock); + ret =regmap_bulk_read (rtc->regmap, rtc->addr_base +RTC_AL_SEC , + data,RTC_OFFSET_COUNT ); +if (ret <0 ) + goto exit; + + data[RTC_OFFSET_SEC ] = ((data[RTC_OFFSET_SEC ] & ~(RTC_AL_SEC_MASK )) | + (tm->tm_sec &RTC_AL_SEC_MASK )); + data[RTC_OFFSET_MIN ] = ((data[RTC_OFFSET_MIN ] & ~(RTC_AL_MIN_MASK )) | + (tm->tm_min &RTC_AL_MIN_MASK )); + data[RTC_OFFSET_HOUR ] = ((data[RTC_OFFSET_HOUR ] & ~(RTC_AL_HOU_MASK )) | + (tm->tm_hour &RTC_AL_HOU_MASK )); + data[RTC_OFFSET_DOM ] = ((data[RTC_OFFSET_DOM ] & ~(RTC_AL_DOM_MASK )) | + (tm->tm_mday &RTC_AL_DOM_MASK )); + data[RTC_OFFSET_MTH ] = ((data[RTC_OFFSET_MTH ] & ~(RTC_AL_MTH_MASK )) | + (tm->tm_mon &RTC_AL_MTH_MASK )); + data[RTC_OFFSET_YEAR ] = ((data[RTC_OFFSET_YEAR ] & ~(RTC_AL_YEA_MASK )) | + (tm->tm_year &RTC_AL_YEA_MASK )); +if (alm->enabled) { ret = regmap_bulk_write(rtc->regmap, rtc->addr_base + RTC_AL_SEC,
Greg Kroah-Hartman
maintainerPATCH 3/203 phy: mapphone-mdm6600: Fix uninitialized status value regression
In reply to Greg Kroah-HartmanFrom: Tony Lindgren <[email protected]>
commit af5d44de571811a151510bfd1236407b7f551cd9 upstream.
Only the used bits get cleared with bitmap_zero() when we call gpiod_get_array_value_cansleep(). We must mask only the bits we're using for ddata->status as the other bits in the bitmap may not be initialized.
And let's also drop useless debug code accidentally left over while at it.
--- drivers/phy/motorola/phy-mapphone-mdm6600.c | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-)
drivers/phy/motorola/phy-mapphone-mdm6600.c +3 -8
@@ -200,7 +200,7 @@ static void phy_mdm6600_status(struct wostruct phy_mdm6600 *ddata;struct device *dev;DECLARE_BITMAP (values,PHY_MDM6600_NR_STATUS_LINES ); -int error, i, val =0 ; +int error; ddata = container_of(work, struct phy_mdm6600, status_work.work); dev = ddata->dev;
@@ -212,16 +212,11 @@ static void phy_mdm6600_status(struct woif (error)return ; -for (i =0 ; i <PHY_MDM6600_NR_STATUS_LINES ; i++) { - val |=test_bit (i, values) << i; -dev_dbg (ddata->dev,"XXX %s: i: %i values[i]: %i val: %i\n" , - __func__, i,test_bit (i, values), val); - } - ddata->status = values[0 ]; + ddata->status = values[0 ] & ((1 <<PHY_MDM6600_NR_STATUS_LINES ) -1 );dev_info (dev,"modem status: %i %s\n" , ddata->status, - phy_mdm6600_status_name[ddata->status &7 ]); + phy_mdm6600_status_name[ddata->status]);complete (&ddata->ack); }
Greg Kroah-Hartman
maintainerPATCH 4/203 RDMA/bnxt_re: Avoid freeing MR resources if dereg fails
In reply to Greg Kroah-HartmanFrom: Selvin Xavier <[email protected]>
commit 9a4467a6b282a299b932608ac2c9034f8415359f upstream.
The driver returns an error code for MR dereg, but frees the MR structure. When the MR dereg is retried due to previous error, the system crashes as the structure is already freed.
BUG: unable to handle kernel NULL pointer dereference at 00000000000001b8 PGD 0 P4D 0 Oops: 0000 [#1] SMP PTI CPU: 7 PID: 12178 Comm: ib_send_bw Kdump: loaded Not tainted 4.18.0-124.el8.x86_64 #1 Hardware name: Dell Inc. PowerEdge R430/03XKDV, BIOS 1.1.10 03/10/2015 RIP: 0010:__dev_printk+0x2a/0x70 Code: 0f 1f 44 00 00 49 89 d1 48 85 f6 0f 84 f6 2b 00 00 4c 8b 46 70 4d 85 c0 75 04 4c 8b
46 10 48 8b 86 a8 00 00 00 48 85 c0 74 16 <48> 8b 08 0f be 7f 01 48 c7 c2 13 ac ac 83 83 ef 30 e9 10 fe ff ff
RSP: 0018:ffffaf7c04607a60 EFLAGS: 00010006
RAX: 00000000000001b8 RBX: ffffa0010c91c488 RCX: 0000000000000246
RDX: ffffaf7c04607a68 RSI: ffffa0010c91caa8 RDI: ffffffff83a788eb
RBP: ffffaf7c04607ac8 R08: 0000000000000000 R09: ffffaf7c04607a68
R10: 0000000000000000 R11: 0000000000000001 R12: ffffaf7c04607b90
R13: 000000000000000e R14: 0000000000000000 R15: 00000000ffffa001
FS: 0000146fa1f1cdc0(0000) GS:ffffa0012fac0000(0000) knlGS:0000000000000000
CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00000000000001b8 CR3: 000000007680a003 CR4: 00000000001606e0
Call Trace: dev_err+0x6c/0x90 ? dev_printk_emit+0x4e/0x70 bnxt_qplib_rcfw_send_message+0x594/0x660 [bnxt_re] ? dev_err+0x6c/0x90 bnxt_qplib_free_mrw+0x80/0xe0 [bnxt_re] bnxt_re_dereg_mr+0x2e/0xd0 [bnxt_re] ib_dereg_mr+0x2f/0x50 [ib_core] destroy_hw_idr_uobject+0x20/0x70 [ib_uverbs] uverbs_destroy_uobject+0x2e/0x170 [ib_uverbs] __uverbs_cleanup_ufile+0x6e/0x90 [ib_uverbs] uverbs_destroy_ufile_hw+0x61/0x130 [ib_uverbs] ib_uverbs_close+0x1f/0x80 [ib_uverbs] __fput+0xb7/0x230 task_work_run+0x8a/0xb0 do_exit+0x2da/0xb40 ... RIP: 0033:0x146fa113a387 Code: Bad RIP value. RSP: 002b:00007fff945d1478 EFLAGS: 00000246 ORIG_RAX: ffffffffffffff02 RAX: 0000000000000000 RBX: 000055a248908d70 RCX: 0000000000000000 RDX: 0000146fa1f2b000 RSI: 0000000000000001 RDI: 000055a248906488 RBP: 000055a248909630 R08: 0000000000010000 R09: 0000000000000000 R10: 0000000000000000 R11: 0000000000000000 R12: 000055a248906488 R13: 0000000000000001 R14: 0000000000000000 R15: 000055a2489095f0
Do not free the MR structures, when driver returns error to the stack.
--- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/bnxt_re/ib_verbs.c +3 -1
@@ -3323,8 +3323,10 @@ int bnxt_re_dereg_mr(struct ib_mr *ib_mrint rc; rc =bnxt_qplib_free_mrw (&rdev->qplib_res, &mr->qplib_mr); -if (rc) +if (rc) {dev_err (rdev_to_dev (rdev),"Dereg MR failed: %#x\n" , rc); +return rc; + }if (mr->pages) { rc = bnxt_qplib_free_fast_reg_page_list(&rdev->qplib_res,
Greg Kroah-Hartman
maintainerPATCH 5/203 RDMA/bnxt_re: Fix Send Work Entry state check while polling completions
In reply to Greg Kroah-HartmanFrom: Selvin Xavier <[email protected]>
commit c5275723580922e5f3264f96751337661a153c7d upstream.
Some adapters need a fence Work Entry to handle retransmission. Currently the driver checks for this condition, only if the Send queue entry is signalled. Implement the condition check, irrespective of the signalled state of the Work queue entries
Failure to add the fence can result in access to memory that is already marked as completed, triggering data corruption, transmission failure, IOMMU failures, etc.
--- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/infiniband/hw/bnxt_re/qplib_fp.c +6 -6
@@ -2283,13 +2283,13 @@ static int bnxt_qplib_cq_process_req(str/* Add qp to flush list of the CQ */ bnxt_qplib_add_flush_qp (qp); }else { +/* Before we complete, do WA 9060 */ +if (do_wa9060 (qp, cq, cq_cons, sw_sq_cons, + cqe_sq_cons)) { + *lib_qp = qp; + goto out; + }if (swq->flags &SQ_SEND_FLAGS_SIGNAL_COMP ) { -/* Before we complete, do WA 9060 */ -if (do_wa9060 (qp, cq, cq_cons, sw_sq_cons, - cqe_sq_cons)) { - *lib_qp = qp; - goto out; - } cqe->status =CQ_REQ_STATUS_OK ; cqe++; (*budget)--;
Greg Kroah-Hartman
maintainerPATCH 6/203 IB/hfi1: Dont cancel unused work item
In reply to Greg Kroah-HartmanFrom: Kaike Wan <[email protected]>
commit ca9033ba69c7e3477f207df69867b2ea969197c8 upstream.
In the iowait structure, two iowait_work entries were included to queue a given object: one for normal IB operations, and the other for TID RDMA operations. For non-TID RDMA operations, the iowait_work structure for TID RDMA is initialized to contain a NULL function (not used). When the QP is reset, the function iowait_cancel_work will be called to cancel any pending work. The problem is that this function will call cancel_work_sync() for both iowait_work entries, even though the one for TID RDMA is not used at all. Eventually, the call cascades to __flush_work(), wherein a WARN_ON will be triggered due to the fact that work->func is NULL.
The WARN_ON was introduced in commit 4d43d395fed1 ("workqueue: Try to catch flush_work() without INIT_WORK().")
This patch fixes the issue by making sure that a work function is present for TID RDMA before calling cancel_work_sync in iowait_cancel_work.
--- drivers/infiniband/hw/hfi1/iowait.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/infiniband/hw/hfi1/iowait.c +3 -1
@@ -81,7 +81,9 @@ void iowait_init(struct iowait *wait, u3void iowait_cancel_work (struct iowait *w) {cancel_work_sync (&iowait_get_ib_work (w)->iowork); -cancel_work_sync (&iowait_get_tid_work (w)->iowork); +/* Make sure that the iowork for TID RDMA is used */ +if (iowait_get_tid_work (w)->iowork.func) +cancel_work_sync (&iowait_get_tid_work (w)->iowork); }/**
Greg Kroah-Hartman
maintainerPATCH 7/203 mtd: rawnand: stm32_fmc2: avoid to lock the CPU bus
In reply to Greg Kroah-HartmanFrom: Christophe Kerello <[email protected]>
commit 4114b17af41272e14939b000ce8f3ed7ba937e3c upstream.
We are currently using nand_soft_waitrdy to poll the status of the NAND flash. FMC2 enables the wait feature bit (this feature is mandatory for the sequencer mode). By enabling this feature, we can't poll the status of the NAND flash, the read status command is stucked in FMC2 pipeline until R/B# signal is high, and locks the CPU bus.
To avoid to lock the CPU bus, we poll FMC2 ISR register. This register reports the status of the R/B# signal.
--- drivers/mtd/nand/raw/stm32_fmc2_nand.c | 38 +++++++++++++++++++++++++++++++-- 1 file changed, 36 insertions(+), 2 deletions(-)
drivers/mtd/nand/raw/stm32_fmc2_nand.c +36 -2
@@ -37,6 +37,7 @@/* Max ECC buffer length */ #define FMC2_MAX_ECC_BUF_LEN (FMC2_BCHDSRS_LEN * FMC2_MAX_SG) +#define FMC2_TIMEOUT_US 1000#define FMC2_TIMEOUT_MS 1000/* Timings */
@@ -53,6 +54,8 @@#define FMC2_PMEM 0x88#define FMC2_PATT 0x8c#define FMC2_HECCR 0x94 +#define FMC2_ISR 0x184 +#define FMC2_ICR 0x188#define FMC2_CSQCR 0x200#define FMC2_CSQCFGR1 0x204#define FMC2_CSQCFGR2 0x208
@@ -118,6 +121,12 @@#define FMC2_PATT_ATTHIZ (x) (((x) & 0xff) << 24)#define FMC2_PATT_DEFAULT 0x0a0a0a0a +/* Register: FMC2_ISR */ +#define FMC2_ISR_IHLF BIT(1) + +/* Register: FMC2_ICR */ +#define FMC2_ICR_CIHLF BIT(1) +/* Register: FMC2_CSQCR */ #define FMC2_CSQCR_CSQSTART BIT(0)
@@ -1322,6 +1331,31 @@ static void stm32_fmc2_write_data(structstm32_fmc2_set_buswidth_16 (fmc2, true); } +static int stm32_fmc2_waitrdy (struct nand_chip *chip,unsigned long timeout_ms) +{ +struct stm32_fmc2_nfc *fmc2 =to_stm32_nfc (chip->controller); +const struct nand_sdr_timings *timings; +u32 isr, sr; + +/* Check if there is no pending requests to the NAND flash */ +if (readl_relaxed_poll_timeout_atomic (fmc2->io_base +FMC2_SR , sr, + sr &FMC2_SR_NWRF ,1 , +FMC2_TIMEOUT_US )) +dev_warn (fmc2->dev,"Waitrdy timeout\n" ); + +/* Wait tWB before R/B# signal is low */ + timings =nand_get_sdr_timings (&chip->data_interface); +ndelay (PSEC_TO_NSEC (timings->tWB_max)); + +/* R/B# signal is low, clear high level flag */ +writel_relaxed (FMC2_ICR_CIHLF , fmc2->io_base +FMC2_ICR ); + +/* Wait R/B# signal is high */ +return readl_relaxed_poll_timeout_atomic (fmc2->io_base +FMC2_ISR , + isr, isr &FMC2_ISR_IHLF , +5 ,1000 * timeout_ms); +} +static int stm32_fmc2_exec_op (struct nand_chip *chip,const struct nand_operation *op,bool check_only)
@@ -1366,8 +1400,8 @@ static int stm32_fmc2_exec_op(struct nanbreak ;case NAND_OP_WAITRDY_INSTR : - ret =nand_soft_waitrdy (chip, - instr->ctx.waitrdy.timeout_ms); + ret =stm32_fmc2_waitrdy (chip, + instr->ctx.waitrdy.timeout_ms);break ; } }
Greg Kroah-Hartman
maintainerPATCH 8/203 i2c: bcm2835: Store pointer to bus clock
In reply to Greg Kroah-HartmanFrom: Stefan Wahren <[email protected]>
commit 3b722da6672df8392f9c43d7c7e04bddd81d7e37 upstream.
The commit bebff81fb8b9 ("i2c: bcm2835: Model Divider in CCF") introduced a NULL pointer dereference on driver unload. It seems that we can't fetch the bus clock via devm_clk_get in bcm2835_i2c_remove. As an alternative approach store a pointer to the bus clock in the private driver structure.
--- drivers/i2c/busses/i2c-bcm2835.c | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-)
drivers/i2c/busses/i2c-bcm2835.c +8 -9
@@ -58,6 +58,7 @@ struct bcm2835_i2c_dev {struct i2c_adapter adapter;struct completion completion;struct i2c_msg *curr_msg; +struct clk *bus_clk;int num_msgs;u32 msg_err;u8 *msg_buf;
@@ -404,7 +405,6 @@ static int bcm2835_i2c_probe(struct platstruct resource *mem, *irq;int ret;struct i2c_adapter *adap; -struct clk *bus_clk;struct clk *mclk;u32 bus_clk_rate;
@@ -427,11 +427,11 @@ static int bcm2835_i2c_probe(struct platreturn PTR_ERR (mclk); } - bus_clk =bcm2835_i2c_register_div (&pdev->dev, mclk, i2c_dev); + i2c_dev->bus_clk =bcm2835_i2c_register_div (&pdev->dev, mclk, i2c_dev); -if (IS_ERR (bus_clk)) { +if (IS_ERR (i2c_dev->bus_clk)) {dev_err (&pdev->dev,"Could not register clock\n" ); -return PTR_ERR (bus_clk); +return PTR_ERR (i2c_dev->bus_clk); } ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency",
@@ -442,13 +442,13 @@ static int bcm2835_i2c_probe(struct plat bus_clk_rate =100000 ; } - ret =clk_set_rate_exclusive (bus_clk, bus_clk_rate); + ret =clk_set_rate_exclusive (i2c_dev->bus_clk, bus_clk_rate);if (ret <0 ) {dev_err (&pdev->dev,"Could not set clock frequency\n" );return ret; } - ret =clk_prepare_enable (bus_clk); + ret =clk_prepare_enable (i2c_dev->bus_clk);if (ret) {dev_err (&pdev->dev,"Couldn't prepare clock" );return ret;
@@ -491,10 +491,9 @@ static int bcm2835_i2c_probe(struct platstatic int bcm2835_i2c_remove (struct platform_device *pdev) {struct bcm2835_i2c_dev *i2c_dev =platform_get_drvdata (pdev); -struct clk *bus_clk =devm_clk_get (i2c_dev->dev,"div" ); -clk_rate_exclusive_put (bus_clk); -clk_disable_unprepare (bus_clk); +clk_rate_exclusive_put (i2c_dev->bus_clk); +clk_disable_unprepare (i2c_dev->bus_clk);free_irq (i2c_dev->irq, i2c_dev);i2c_del_adapter (&i2c_dev->adapter);
Greg Kroah-Hartman
maintainercover 5.4.13-stable review
This is the start of the stable review cycle for the 5.4.13 release. There are 203 patches in this series, all will be posted as a response to this one. If anyone has any issues with these being applied, please let me know.
Responses should be made by Sat, 18 Jan 2020 23:16:00 +0000. Anything received after that time might be too late.
The whole patch series can be found in one patch at:
https://www.kernel.org/pub/linux/kernel/v5.x/stable-review/patch-5.4.13-rc1.gz
or in the git tree and branch at:
git://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable-rc.git linux-5.4.y
and the diffstat can be found below.
thanks,
greg k-h
-------------
Pseudo-Shortlog of commits:
Greg Kroah-Hartman <[email protected]>
Linux 5.4.13-rc1
Kai Li <[email protected]>
ocfs2: call journal flush to mark journal as empty after journal recovery when mount
Nick Desaulniers <[email protected]>
hexagon: work around compiler crash
Nick Desaulniers <[email protected]>
hexagon: parenthesize registers in asm predicates
Ard Biesheuvel <[email protected]>
kbuild/deb-pkg: annotate libelf-dev dependency as :native
Sakari Ailus <[email protected]>
media: intel-ipu3: Align struct ipu3_uapi_awb_fr_config_s to 32 bytes
changzhu <[email protected]>
drm/amdgpu: enable gfxoff for raven1 refresh
[email protected] <[email protected]>
ioat: ioat_alloc_ring() failure handling.
Julian Wiedmann <[email protected]>
s390/qeth: lock the card while changing its hsuid
John Stultz <[email protected]>
dmaengine: k3dma: Avoid null pointer traversal
David Howells <[email protected]>
rxrpc: Fix missing security check on incoming calls
David Howells <[email protected]>
rxrpc: Don't take call->user_mutex in rxrpc_new_incoming_call()
David Howells <[email protected]>
rxrpc: Unlock new call in rxrpc_new_incoming_call() rather than the caller
Ben Dooks (Codethink) <[email protected]>
drm/arm/mali: make malidp_mw_connector_helper_funcs static
Jouni Hogander <[email protected]>
MIPS: Prevent link failure with kcov instrumentation
Tetsuo Handa <[email protected]>
tomoyo: Suppress RCU warning at list_for_each_entry_rcu().
Vincenzo Frascino <[email protected]>
mips: Fix gettimeofday() in the vdso library
Vladimir Kondratiev <[email protected]>
mips: cacheinfo: report shared CPU map
Olof Johansson <[email protected]>
riscv: export flush_icache_all to modules
Mathieu Desnoyers <[email protected]>
rseq/selftests: Turn off timeout setting
Shuah Khan <[email protected]>
selftests: firmware: Fix it to do root uid check and skip
Israel Rukshin <[email protected]>
scsi: target/iblock: Fix protection error with blocks greater than 512B
Varun Prakash <[email protected]>
scsi: libcxgbi: fix NULL pointer dereference in cxgbi_device_destroy()
Johnson CH Chen (陳昭勳) <[email protected]>
gpio: mpc8xxx: Add platform device to gpiochip->parent
Matti Vaittinen <[email protected]>
rtc: bd70528: Add MODULE ALIAS to autoload module
Chuhong Yuan <[email protected]>
rtc: brcmstb-waketimer: add missed clk_disable_unprepare
Kars de Jong <[email protected]>
rtc: msm6242: Fix reading of 10-hour digit
Olga Kornievskaia <[email protected]>
NFSD fixing possible null pointer derefering in copy offload
Chao Yu <[email protected]>
f2fs: fix potential overflow
Victorien Molle <[email protected]>
sch_cake: Add missing NLA policy entry TCA_CAKE_SPLIT_GSO
Luca Coelho <[email protected]>
iwlwifi: mvm: fix support for single antenna diversity
Nathan Chancellor <[email protected]>
rtlwifi: Remove unnecessary NULL check in rtl_regd_init
Mordechay Goodstein <[email protected]>
iwlwifi: mvm: consider ieee80211 station max amsdu value
Navid Emamdoost <[email protected]>
spi: lpspi: fix memory leak in fsl_lpspi_probe
Geert Uytterhoeven <[email protected]>
spi: rspi: Use platform_get_irq_byname_optional() for optional irqs
Mans Rullgard <[email protected]>
spi: atmel: fix handling of cs_change set on non-last xfer
Daniel Vetter <[email protected]>
spi: pxa2xx: Set controller->max_transfer_size in dma mode
Sergei Shtylyov <[email protected]>
mtd: spi-nor: fix silent truncation in spi_nor_read_raw()
Sergei Shtylyov <[email protected]>
mtd: spi-nor: fix silent truncation in spi_nor_read()
Huanpeng Xin <[email protected]>
spi: sprd: Fix the incorrect SPI register
Zhihao Cheng <[email protected]>
ubifs: do_kill_orphans: Fix a memory leak bug
Ben Dooks (Codethink) <[email protected]>
ubifs: Fixed missed le64_to_cpu() in journal
Richard Weinberger <[email protected]>
Revert "ubifs: Fix memory leak bug in alloc_ubifs_info() error path"
Yong Wu <[email protected]>
memory: mtk-smi: Add PM suspend and resume ops
Yong Wu <[email protected]>
iommu/mediatek: Add a new tlb_lock for tlb_flush
Yong Wu <[email protected]>
iommu/mediatek: Correct the flush_iotlb_all callback
Jonas Karlman <[email protected]>
media: hantro: Set H264 FIELDPIC_FLAG_E flag correctly
Navid Emamdoost <[email protected]>
media: aspeed-video: Fix memory leaks in aspeed_video_probe
Jonas Karlman <[email protected]>
media: hantro: Do not reorder H264 scaling list
Jonas Karlman <[email protected]>
media: cedrus: Use correct H264 8x8 scaling list
Philipp Zabel <[email protected]>
media: coda: fix deadlock between decoder picture run and start command
Seung-Woo Kim <[email protected]>
media: exynos4-is: Fix recursive locking in isp_video_release()
Christophe JAILLET <[email protected]>
media: v4l: cadence: Fix how unsued lanes are handled in 'csi2rx_start()'
Boris Brezillon <[email protected]>
media: hantro: h264: Fix the frame_num wraparound case
Niklas Söderlund <[email protected]>
media: rcar-vin: Fix incorrect return statement in rvin_try_format()
Janusz Krzysztofik <[email protected]>
media: ov6650: Fix default format not applied on device probe
Janusz Krzysztofik <[email protected]>
media: ov6650: Fix .get_fmt() V4L2_SUBDEV_FORMAT_TRY support
Janusz Krzysztofik <[email protected]>
media: ov6650: Fix some format attributes not under control
Janusz Krzysztofik <[email protected]>
media: ov6650: Fix incorrect use of JPEG colorspace
Dietmar Eggemann <[email protected]>
ARM: 8943/1: Fix topology setup in case of CPU hotplug for CONFIG_SCHED_MC
Peng Fan <[email protected]>
tty: serial: pch_uart: correct usage of dma_unmap_sg
Peng Fan <[email protected]>
tty: serial: imx: use the sg count from dma_map_sg
Thomas Bogendoerfer <[email protected]>
MIPS: SGI-IP27: Fix crash, when CPUs are disabled via nr_cpus parameter
Tiezhu Yang <[email protected]>
MIPS: Loongson: Fix return value of loongson_hwmon_init
Thomas Bogendoerfer <[email protected]>
MIPS: PCI: remember nasid changed by set interrupt affinity
Oliver O'Halloran <[email protected]>
powerpc/powernv: Disable native PCIe port management
Bjorn Helgaas <[email protected]>
PCI/PTM: Remove spurious "d" from granularity message
Hewenliang <[email protected]>
tools: PCI: Fix fd leakage
Bjorn Helgaas <[email protected]>
PCI/PM: Clear PCIe PME Status even for legacy power management
Rob Herring <[email protected]>
PCI: Fix missing bridge dma_ranges resource list cleanup
Niklas Cassel <[email protected]>
PCI: dwc: Fix find_next_bit() usage
Remi Pommarel <[email protected]>
PCI: aardvark: Fix PCI_EXP_RTCTL register configuration
Remi Pommarel <[email protected]>
PCI: aardvark: Use LTSSM state to build link training flag
Arnd Bergmann <[email protected]>
compat_ioctl: handle SIOCOUTQNSD
Arnd Bergmann <[email protected]>
af_unix: add compat_ioctl support
Arnd Bergmann <[email protected]>
gfs2: add compat_ioctl support
Loic Poulain <[email protected]>
arm64: dts: apq8096-db820c: Increase load on l21 for SDCARD
Arnd Bergmann <[email protected]>
scsi: sd: enable compat ioctls for sed-opal
Xiaojie Yuan <[email protected]>
drm/amdgpu/discovery: reserve discovery data at the top of VRAM
Christian König <[email protected]>
drm/amdgpu: cleanup creating BOs at fixed location (v2)
Greg Kroah-Hartman <[email protected]>
Revert "drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper."
Mika Westerberg <[email protected]>
PCI: pciehp: Do not disable interrupt twice on suspend
Andy Shevchenko <[email protected]>
pinctrl: lewisburg: Update pin list according to v1.1v6
Geert Uytterhoeven <[email protected]>
pinctrl: sh-pfc: Do not use platform_get_irq() to count interrupts
Keiya Nobuta <[email protected]>
pinctrl: sh-pfc: Fix PINMUX_IPSR_PHYS() to set GPSR
Colin Ian King <[email protected]>
pinctl: ti: iodelay: fix error checking on pinctrl_count_index_with_args call
Navid Emamdoost <[email protected]>
affs: fix a memory leak in affs_remount
Denis Efremov <[email protected]>
rsi: fix potential null dereference in rsi_probe()
Leonard Crestez <[email protected]>
clk: imx: pll14xx: Fix quick switch of S/K parameter
Andy Shevchenko <[email protected]>
dmaengine: dw: platform: Mark 'hclk' clock optional
Kishon Vijay Abraham I <[email protected]>
clk: Fix memory leak in clk_unregister()
Marian Mihailescu <[email protected]>
clk: samsung: exynos5420: Preserve CPU clocks configuration during suspend/resume
Jerome Brunet <[email protected]>
clk: meson: axg-audio: fix regmap last register
Alexander Usyskin <[email protected]>
mei: fix modalias documentation
Alexandru Ardelean <[email protected]>
iio: imu: adis16480: assign bias value only if operation succeeded
Lorenzo Bianconi <[email protected]>
iio: imu: st_lsm6dsx: fix gyro gain definitions for LSM9DS1
Trond Myklebust <[email protected]>
NFSv4.x: Drop the slot if nfs4_delegreturn_prepare waits for layoutreturn
Trond Myklebust <[email protected]>
NFSv4.x: Handle bad/dead sessions correctly in nfs41_sequence_process()
Scott Mayhew <[email protected]>
nfsd: v4 support requires CRYPTO_SHA256
Scott Mayhew <[email protected]>
nfsd: Fix cld_net->cn_tfm initialization
Trond Myklebust <[email protected]>
NFSv2: Fix a typo in encode_sattr()
Eric Biggers <[email protected]>
crypto: geode-aes - convert to skcipher API and make thread-safe
Herbert Xu <[email protected]>
crypto: algif_skcipher - Use chunksize instead of blocksize
Ard Biesheuvel <[email protected]>
crypto: virtio - implement missing support for output IVs
Yunfeng Ye <[email protected]>
crypto: arm64/aes-neonbs - add return value of skcipher_walk_done() in __xts_crypt()
Zhou Wang <[email protected]>
crypto: hisilicon - select NEED_SG_DMA_LENGTH in qm Kconfig
Phani Kiran Hemadri <[email protected]>
crypto: cavium/nitrox - fix firmware assignment to AE cores
Can Guo <[email protected]>
scsi: ufs: Give an unique ID to each ufs-bsg
Diego Calleja <[email protected]>
dm: add dm-clone to the documentation index
Chuck Lever <[email protected]>
xprtrdma: Fix oops in Receive handler after device removal
Chuck Lever <[email protected]>
xprtrdma: Fix completion wait during device removal
Chuck Lever <[email protected]>
xprtrdma: Fix create_qp crash on device unload
Vadim Pasternak <[email protected]>
Documentation/ABI: Add missed attribute for mlxreg-io sysfs interfaces
Vadim Pasternak <[email protected]>
Documentation/ABI: Fix documentation inconsistency for mlxreg-io sysfs interfaces
Mike Rapoport <[email protected]>
asm-generic/nds32: don't redefine cacheflush primitives
Hans de Goede <[email protected]>
platform/x86: GPD pocket fan: Use default values when wrong modparams are given
Jian-Hong Pan <[email protected]>
platform/x86: asus-wmi: Fix keyboard brightness cannot be set to 0
Liming Sun <[email protected]>
platform/mellanox: fix potential deadlock in the tmfifo driver
Xiang Chen <[email protected]>
scsi: sd: Clear sdkp->protection_type if disk is reformatted without PI
James Bottomley <[email protected]>
scsi: enclosure: Fix stale device oops with hot replug
David Howells <[email protected]>
keys: Fix request_key() cache
David Howells <[email protected]>
afs: Fix afs_lookup() to not clobber the version on a new dentry
David Howells <[email protected]>
afs: Fix use-after-loss-of-ref
Andrii Nakryiko <[email protected]>
libbpf: Fix Makefile' libbpf symbol mismatch diagnostic
Stanislav Fomichev <[email protected]>
bpf: Support pre-2.25-binutils objcopy for vmlinux BTF
John Fastabend <[email protected]>
bpf: skmsg, fix potential psock NULL pointer dereference
Daniel Borkmann <[email protected]>
bpf: Make use of probe_user_write in probe write helper
Daniel Borkmann <[email protected]>
uaccess: Add non-pagefault user-space write function
Bart Van Assche <[email protected]>
RDMA/srpt: Report the SCSI residual to the initiator
Leon Romanovsky <[email protected]>
RDMA/mlx5: Return proper error value
Jason Gunthorpe <[email protected]>
rdma: Remove nes ABI header
Yangyang Li <[email protected]>
RDMA/hns: Bugfix for qpc/cqc timer configuration
Lijun Ou <[email protected]>
RDMA/hns: Fix to support 64K page for srq
Chuck Lever <[email protected]>
xprtrdma: Close window between waking RPC senders and posting Receives
Chuck Lever <[email protected]>
xprtrdma: Fix MR list handling
Chuck Lever <[email protected]>
xprtrdma: Connection becomes unstable after a reconnect
Chuck Lever <[email protected]>
xprtrdma: Add unique trace points for posting Local Invalidate WRs
Yangyang Li <[email protected]>
RDMA/hns: Release qp resources when failed to destroy qp
Arnd Bergmann <[email protected]>
RDMA/hns: Fix build error again
Bart Van Assche <[email protected]>
RDMA/siw: Fix port number endianness in a debug message
Mark Zhang <[email protected]>
RDMA/counter: Prevent QP counter manual binding in auto mode
Lang Cheng <[email protected]>
RDMA/hns: Modify return value of restrack functions
Weihang Li <[email protected]>
RDMA/hns: remove a redundant le16_to_cpu
Jason Gunthorpe <[email protected]>
RDMA/hns: Prevent undefined behavior in hns_roce_set_user_sq_size()
Nilkanth Ahirrao <[email protected]>
ASoC: rsnd: fix DALIGN register for SSIU
Takashi Iwai <[email protected]>
ASoC: core: Fix compile warning with CONFIG_DEBUG_FS=n
Pierre-Louis Bossart <[email protected]>
ASoC: SOF: Intel: Broadwell: clarify mutual exclusion with legacy driver
Shengjiu Wang <[email protected]>
ASoC: fsl_esai: Add spin lock to protect reset, stop and start
Daniel Baluta <[email protected]>
ASoC: simple_card_utils.h: Add missing include
Tzung-Bi Shih <[email protected]>
ASoC: dt-bindings: mt8183: add missing update
Arnd Bergmann <[email protected]>
netfilter: nft_meta: use 64-bit time arithmetic
Pablo Neira Ayuso <[email protected]>
netfilter: nf_tables_offload: release flow_rule on error from commit path
Goldwyn Rodrigues <[email protected]>
btrfs: simplify inode locking for RWF_NOWAIT
Taehee Yoo <[email protected]>
hsr: fix slab-out-of-bounds Read in hsr_debugfs_rename()
Sami Tolvanen <[email protected]>
syscalls/x86: Fix function types in COND_SYSCALL
Sami Tolvanen <[email protected]>
syscalls/x86: Use the correct function type for sys_ni_syscall
Sami Tolvanen <[email protected]>
syscalls/x86: Use COMPAT_SYSCALL_DEFINE0 for IA32 (rt_)sigreturn
Andy Lutomirski <[email protected]>
syscalls/x86: Wire up COMPAT_SYSCALL_DEFINE0
Ed Maste <[email protected]>
perf vendor events s390: Remove name from L1D_RO_EXCL_WRITES description
David Howells <[email protected]>
afs: Fix missing cell comparison in afs_test_super()
Florian Fainelli <[email protected]>
reset: brcmstb: Remove resource checks
Florian Fainelli <[email protected]>
dt-bindings: reset: Fix brcmstb-reset example
Marc Kleine-Budde <[email protected]>
can: j1939: fix address claim code example
Christian Lamparter <[email protected]>
ath9k: use iowrite32 over __raw_writel
Andy Shevchenko <[email protected]>
MAINTAINERS: Append missed file to the database
Paul Menzel <[email protected]>
scsi: smartpqi: Update attribute name to driver_version
Nathan Chancellor <[email protected]>
cifs: Adjust indentation in smb2_open_file
Julian Wiedmann <[email protected]>
s390/qeth: fix initialization on old HW
Alexandra Winter <[email protected]>
s390/qeth: vnicc Fix init to default
Alexandra Winter <[email protected]>
s390/qeth: Fix vnicc_is_in_use if rx_bcast not set
Alexandra Winter <[email protected]>
s390/qeth: fix false reporting of VNIC CHAR config failure
Julian Wiedmann <[email protected]>
s390/qeth: fix qdio teardown after early init error
Taehee Yoo <[email protected]>
hsr: reset network header when supervision frame is created
Taehee Yoo <[email protected]>
hsr: rename debugfs file when interface name is changed
Taehee Yoo <[email protected]>
hsr: add hsr root debugfs directory
Thierry Reding <[email protected]>
drm/tegra: Fix ordering of cleanup code
Neil Armstrong <[email protected]>
PCI: amlogic: Fix probed clock names
Arnd Bergmann <[email protected]>
PM / devfreq: tegra: Add COMMON_CLK dependency
Geert Uytterhoeven <[email protected]>
gpio: Fix error message on out-of-range GPIO in lookup table
Dan Carpenter <[email protected]>
scsi: mpt3sas: Fix double free in attach error handling
Ming Lei <[email protected]>
fs: move guard_bio_eod() after bio_set_op_attrs
Roman Gushchin <[email protected]>
bpf: cgroup: prevent out-of-order release of cgroup bpf
Jon Derrick <[email protected]>
iommu: Remove device link to group on failure
Jon Derrick <[email protected]>
iommu/vt-d: Unlink device if failed to add to group
Hangbin Liu <[email protected]>
selftests: loopback.sh: skip this test if the driver does not support
Qianggui Song <[email protected]>
pinctrl: meson: Fix wrong shift value when get drive-strength
Swapna Manupati <[email protected]>
gpio: zynq: Fix for bug in zynq_gpio_restore_context API
Peter Ujfalusi <[email protected]>
mtd: onenand: omap2: Pass correct flags for prep_dma_memcpy
Daniel Baluta <[email protected]>
ASoC: SOF: imx8: Fix dsp_box offset
wenxu <[email protected]>
netfilter: nft_flow_offload: fix underflow in flowtable reference counter
Arnd Bergmann <[email protected]>
pinctrl: lochnagar: select GPIOLIB
Olivier Moysan <[email protected]>
ASoC: stm32: spdifrx: fix input pin state management
Olivier Moysan <[email protected]>
ASoC: stm32: spdifrx: fix race condition in irq handler
Olivier Moysan <[email protected]>
ASoC: stm32: spdifrx: fix inconsistent lock state
Daniel Baluta <[email protected]>
ASoC: soc-core: Set dpcm_playback / dpcm_capture
Colin Ian King <[email protected]>
ASoC: SOF: imx8: fix memory allocation failure check on priv->pd_dev
Stefan Wahren <[email protected]>
i2c: bcm2835: Store pointer to bus clock
Christophe Kerello <[email protected]>
mtd: rawnand: stm32_fmc2: avoid to lock the CPU bus
Kaike Wan <[email protected]>
IB/hfi1: Don't cancel unused work item
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Fix Send Work Entry state check while polling completions
Selvin Xavier <[email protected]>
RDMA/bnxt_re: Avoid freeing MR resources if dereg fails
Tony Lindgren <[email protected]>
phy: mapphone-mdm6600: Fix uninitialized status value regression
Ran Bi <[email protected]>
rtc: mt6397: fix alarm register overwrite
Jiri Kosina <[email protected]>
HID: hidraw, uhid: Always report EPOLLOUT
-------------
Diffstat:
Documentation/ABI/stable/sysfs-driver-mlxreg-io | 13 +- Documentation/ABI/testing/sysfs-bus-mei | 2 +- Documentation/admin-guide/device-mapper/index.rst | 1 + .../bindings/reset/brcm,brcmstb-reset.txt | 2 +- .../sound/mt8183-mt6358-ts3a227-max98357.txt | 4 +- Documentation/networking/j1939.rst | 2 +- Documentation/scsi/smartpqi.txt | 2 +- MAINTAINERS | 1 + Makefile | 4 +- arch/arm/kernel/smp.c | 4 + arch/arm/kernel/topology.c | 10 +- arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 2 + arch/arm64/crypto/aes-neonbs-glue.c | 2 +- arch/hexagon/include/asm/atomic.h | 8 +- arch/hexagon/include/asm/bitops.h | 8 +- arch/hexagon/include/asm/cmpxchg.h | 2 +- arch/hexagon/include/asm/futex.h | 6 +- arch/hexagon/include/asm/spinlock.h | 20 +- arch/hexagon/kernel/stacktrace.c | 4 +- arch/hexagon/kernel/vm_entry.S | 2 +- arch/mips/boot/compressed/Makefile | 3 + arch/mips/include/asm/vdso/gettimeofday.h | 13 - arch/mips/kernel/cacheinfo.c | 27 +- arch/mips/pci/pci-xtalk-bridge.c | 5 +- arch/mips/sgi-ip27/ip27-irq.c | 4 + arch/mips/vdso/vgettimeofday.c | 20 + arch/nds32/include/asm/cacheflush.h | 11 +- arch/powerpc/platforms/powernv/pci.c | 17 + arch/riscv/mm/cacheflush.c | 1 + arch/x86/entry/syscall_32.c | 8 +- arch/x86/entry/syscall_64.c | 14 +- arch/x86/entry/syscalls/syscall_32.tbl | 8 +- arch/x86/ia32/ia32_signal.c | 5 +- arch/x86/include/asm/syscall_wrapper.h | 53 ++- block/bio.c | 12 +- crypto/algif_skcipher.c | 2 +- drivers/clk/clk.c | 1 + drivers/clk/imx/clk-pll14xx.c | 40 +- drivers/clk/meson/axg-audio.c | 2 +- drivers/clk/samsung/clk-exynos5420.c | 2 + drivers/crypto/cavium/nitrox/nitrox_main.c | 9 +- drivers/crypto/geode-aes.c | 440 +++++++-------------- drivers/crypto/geode-aes.h | 15 +- drivers/crypto/hisilicon/Kconfig | 1 + drivers/crypto/virtio/virtio_crypto_algs.c | 9 + drivers/devfreq/Kconfig | 1 + drivers/dma/dw/platform.c | 2 +- drivers/dma/ioat/dma.c | 3 +- drivers/dma/k3dma.c | 12 +- drivers/gpio/gpio-mpc8xxx.c | 1 + drivers/gpio/gpio-zynq.c | 8 +- drivers/gpio/gpiolib.c | 5 +- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 4 +- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.h | 2 + drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 61 +++ drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 85 +--- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 99 ++--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 +- drivers/gpu/drm/amd/include/discovery.h | 1 - drivers/gpu/drm/arm/malidp_mw.c | 2 +- drivers/gpu/drm/tegra/drm.c | 14 +- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 28 +- drivers/hid/hidraw.c | 7 +- drivers/hid/uhid.c | 5 +- drivers/i2c/busses/i2c-bcm2835.c | 17 +- drivers/iio/imu/adis16480.c | 6 +- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 7 +- drivers/infiniband/core/counters.c | 12 +- drivers/infiniband/hw/bnxt_re/ib_verbs.c | 4 +- drivers/infiniband/hw/bnxt_re/qplib_fp.c | 12 +- drivers/infiniband/hw/hfi1/iowait.c | 4 +- drivers/infiniband/hw/hns/Kconfig | 17 +- drivers/infiniband/hw/hns/Makefile | 8 +- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 18 +- drivers/infiniband/hw/hns/hns_roce_hw_v2.h | 4 +- drivers/infiniband/hw/hns/hns_roce_qp.c | 10 +- drivers/infiniband/hw/hns/hns_roce_restrack.c | 2 +- drivers/infiniband/hw/mlx5/mr.c | 2 +- drivers/infiniband/sw/siw/siw_cm.c | 9 +- drivers/infiniband/ulp/srpt/ib_srpt.c | 24 ++ drivers/iommu/intel-iommu.c | 13 +- drivers/iommu/iommu.c | 1 + drivers/iommu/mtk_iommu.c | 25 +- drivers/iommu/mtk_iommu.h | 1 + drivers/media/i2c/ov6650.c | 79 ++-- drivers/media/platform/aspeed-video.c | 3 +- drivers/media/platform/cadence/cdns-csi2rx.c | 2 +- drivers/media/platform/coda/coda-common.c | 4 +- drivers/media/platform/exynos4-is/fimc-isp-video.c | 2 +- drivers/media/platform/rcar-vin/rcar-v4l2.c | 3 +- drivers/memory/mtk-smi.c | 4 + drivers/misc/enclosure.c | 3 +- drivers/mtd/nand/onenand/omap2.c | 3 +- drivers/mtd/nand/raw/stm32_fmc2_nand.c | 38 +- drivers/mtd/spi-nor/spi-nor.c | 4 +- .../net/wireless/ath/ath9k/ath9k_pci_owl_loader.c | 2 +- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 20 +- drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 8 +- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 7 +- drivers/net/wireless/realtek/rtlwifi/regd.c | 2 +- drivers/net/wireless/rsi/rsi_91x_usb.c | 2 +- drivers/pci/controller/dwc/pci-meson.c | 6 +- drivers/pci/controller/dwc/pcie-designware-host.c | 11 +- drivers/pci/controller/pci-aardvark.c | 42 +- drivers/pci/hotplug/pciehp_core.c | 25 +- drivers/pci/pci-driver.c | 3 +- drivers/pci/pcie/ptm.c | 2 +- drivers/pci/probe.c | 1 + drivers/phy/motorola/phy-mapphone-mdm6600.c | 11 +- drivers/pinctrl/cirrus/Kconfig | 1 + drivers/pinctrl/intel/pinctrl-lewisburg.c | 171 ++++---- drivers/pinctrl/meson/pinctrl-meson.c | 1 + drivers/pinctrl/sh-pfc/core.c | 16 +- drivers/pinctrl/sh-pfc/sh_pfc.h | 4 +- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 2 +- drivers/platform/mellanox/mlxbf-tmfifo.c | 19 +- drivers/platform/mips/cpu_hwmon.c | 2 +- drivers/platform/x86/asus-wmi.c | 8 +- drivers/platform/x86/gpd-pocket-fan.c | 25 +- drivers/reset/reset-brcmstb.c | 6 - drivers/rtc/rtc-bd70528.c | 1 + drivers/rtc/rtc-brcmstb-waketimer.c | 1 + drivers/rtc/rtc-msm6242.c | 3 +- drivers/rtc/rtc-mt6397.c | 47 ++- drivers/s390/net/qeth_core_main.c | 29 +- drivers/s390/net/qeth_l2_main.c | 10 +- drivers/s390/net/qeth_l3_main.c | 2 +- drivers/s390/net/qeth_l3_sys.c | 40 +- drivers/scsi/cxgbi/libcxgbi.c | 3 +- drivers/scsi/mpt3sas/mpt3sas_base.c | 1 - drivers/scsi/sd.c | 18 +- drivers/scsi/ufs/ufs_bsg.c | 2 +- drivers/spi/spi-atmel.c | 10 +- drivers/spi/spi-fsl-lpspi.c | 2 +- drivers/spi/spi-pxa2xx.c | 7 + drivers/spi/spi-rspi.c | 8 +- drivers/spi/spi-sprd.c | 2 +- drivers/staging/media/hantro/hantro_g1_h264_dec.c | 2 +- drivers/staging/media/hantro/hantro_h264.c | 73 ++-- drivers/staging/media/ipu3/include/intel-ipu3.h | 2 +- drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 4 +- drivers/target/target_core_iblock.c | 4 +- drivers/tty/serial/imx.c | 2 +- drivers/tty/serial/pch_uart.c | 5 +- fs/affs/super.c | 6 - fs/afs/dir.c | 18 +- fs/afs/super.c | 1 + fs/btrfs/file.c | 5 +- fs/buffer.c | 8 +- fs/cifs/smb2file.c | 2 +- fs/f2fs/data.c | 2 +- fs/f2fs/file.c | 2 +- fs/gfs2/file.c | 30 ++ fs/internal.h | 2 +- fs/mpage.c | 2 +- fs/nfs/nfs2xdr.c | 2 +- fs/nfs/nfs4proc.c | 38 +- fs/nfsd/Kconfig | 2 +- fs/nfsd/nfs4proc.c | 3 +- fs/nfsd/nfs4recover.c | 12 +- fs/ocfs2/journal.c | 8 + fs/ubifs/journal.c | 2 +- fs/ubifs/orphan.c | 17 +- fs/ubifs/super.c | 4 +- include/asm-generic/cacheflush.h | 33 +- include/crypto/internal/skcipher.h | 30 -- include/crypto/skcipher.h | 30 ++ include/linux/uaccess.h | 12 + include/sound/simple_card_utils.h | 1 + include/trace/events/afs.h | 12 +- include/trace/events/rpcrdma.h | 25 ++ include/uapi/rdma/nes-abi.h | 115 ------ kernel/bpf/cgroup.c | 11 +- kernel/cred.c | 4 +- kernel/trace/bpf_trace.c | 6 +- mm/maccess.c | 45 ++- net/core/skmsg.c | 13 +- net/hsr/hsr_debugfs.c | 36 +- net/hsr/hsr_device.c | 2 + net/hsr/hsr_main.c | 5 + net/hsr/hsr_main.h | 10 + net/hsr/hsr_netlink.c | 1 + net/netfilter/nf_tables_offload.c | 26 +- net/netfilter/nft_flow_offload.c | 3 - net/netfilter/nft_meta.c | 10 +- net/rxrpc/ar-internal.h | 10 +- net/rxrpc/call_accept.c | 60 +-- net/rxrpc/conn_event.c | 16 +- net/rxrpc/conn_service.c | 4 + net/rxrpc/input.c | 18 - net/rxrpc/rxkad.c | 5 +- net/rxrpc/security.c | 70 ++-- net/sched/sch_cake.c | 1 + net/socket.c | 1 + net/sunrpc/xprtrdma/frwr_ops.c | 4 +- net/sunrpc/xprtrdma/rpc_rdma.c | 1 + net/sunrpc/xprtrdma/transport.c | 3 + net/sunrpc/xprtrdma/verbs.c | 103 +++-- net/sunrpc/xprtrdma/xprt_rdma.h | 3 + net/unix/af_unix.c | 19 + scripts/link-vmlinux.sh | 7 +- scripts/package/mkdebian | 2 +- security/tomoyo/common.c | 9 +- security/tomoyo/domain.c | 15 +- security/tomoyo/group.c | 9 +- security/tomoyo/util.c | 6 +- sound/soc/fsl/fsl_esai.c | 12 + sound/soc/intel/Kconfig | 3 + sound/soc/sh/rcar/core.c | 20 +- sound/soc/soc-core.c | 2 + sound/soc/soc-pcm.c | 2 + sound/soc/sof/imx/imx8.c | 5 +- sound/soc/sof/intel/Kconfig | 10 +- sound/soc/stm/stm32_spdifrx.c | 40 +- tools/lib/bpf/Makefile | 2 +- tools/pci/pcitest.c | 1 + .../perf/pmu-events/arch/s390/cf_z14/extended.json | 2 +- tools/testing/selftests/firmware/fw_lib.sh | 6 + tools/testing/selftests/net/forwarding/loopback.sh | 8 + tools/testing/selftests/rseq/settings | 1 + 222 files changed, 1849 insertions(+), 1423 deletions(-)
Greg Kroah-Hartman
maintainerPATCH 20/203 selftests: loopback.sh: skip this test if the driver does not support
From: Hangbin Liu <[email protected]>
commit cc7e3f63d7299dd1119be39aa187b867d6f8aa17 upstream.
The loopback feature is only supported on a few drivers like broadcom, mellanox, etc. The default veth driver has not supported it yet. To avoid returning failed and making the runner feel confused, let's just skip the test on drivers that not support loopback.
--- tools/testing/selftests/net/forwarding/loopback.sh | 8 ++++++++ 1 file changed, 8 insertions(+)
tools/testing/selftests/net/forwarding/loopback.sh +8 -0
@@ -1,6 +1,9 @@ #!/bin/bash # SPDX-License-Identifier: GPL-2.0 +# Kselftest framework requirement - SKIP code is 4. +ksft_skip=4 + ALL_TESTS="loopback_test" NUM_NETIFS=2 source tc_common.sh
@@ -72,6 +75,11 @@ setup_prepare() h1_create h2_create + + if ethtool -k $h1 | grep loopback | grep -q fixed; then + log_test "SKIP: dev $h1 does not support loopback feature" + exit $ksft_skip + fi } cleanup()
Greg Kroah-Hartman
maintainerPATCH 22/203 iommu: Remove device link to group on failure
In reply to Greg Kroah-HartmanFrom: Jon Derrick <[email protected]>
commit 7d4e6ccd1fb09dbfbc49746ca82bd5c25ad4bfe4 upstream.
This adds the missing teardown step that removes the device link from the group when the device addition fails.
--- drivers/iommu/iommu.c | 1 + 1 file changed, 1 insertion(+)
drivers/iommu/iommu.c +1 -0
@@ -751,6 +751,7 @@ err_put_group:mutex_unlock (&group->mutex); dev->iommu_group =NULL ;kobject_put (group->devices_kobj); +sysfs_remove_link (group->devices_kobj, device->name); err_free_name:kfree (device->name); err_remove_link:
Greg Kroah-Hartman
maintainerPATCH 23/203 bpf: cgroup: prevent out-of-order release of cgroup bpf
In reply to Greg Kroah-HartmanFrom: Roman Gushchin <[email protected]>
commit e10360f815ca6367357b2c2cfef17fc663e50f7b upstream.
Before commit 4bfc0bb2c60e ("bpf: decouple the lifetime of cgroup_bpf from cgroup itself") cgroup bpf structures were released with
corresponding cgroup structures. It guaranteed the hierarchical order
of destruction: children were always first. It preserved attached
programs from being released before their propagated copies.
But with cgroup auto-detachment there are no such guarantees anymore:
cgroup bpf is released as soon as the cgroup is offline and there are no live associated sockets. It means that an attached program can be detached and released, while its propagated copy is still living in the cgroup subtree. This will obviously lead to an use-after-free bug.
To reproduce the issue the following script can be used:
#!/bin/bash
CGROOT=/sys/fs/cgroup
mkdir -p ${CGROOT}/A ${CGROOT}/B ${CGROOT}/A/C
sleep 1
./test_cgrp2_attach ${CGROOT}/A egress &
A_PID=$!
./test_cgrp2_attach ${CGROOT}/B egress &
B_PID=$!
echo $$ > ${CGROOT}/A/C/cgroup.procs
iperf -s &
S_PID=$!
iperf -c localhost -t 100 &
C_PID=$!sleep 1
echo $$ > ${CGROOT}/B/cgroup.procs
echo ${S_PID} > ${CGROOT}/B/cgroup.procs
echo ${C_PID} > ${CGROOT}/B/cgroup.procssleep 1
rmdir ${CGROOT}/A/C
rmdir ${CGROOT}/Asleep 1
kill -9 ${S_PID} ${C_PID} ${A_PID} ${B_PID}On the unpatched kernel the following stacktrace can be obtained:
[ 33.619799] BUG: unable to handle page fault for address: ffffbdb4801ab002 [ 33.620677] #PF: supervisor read access in kernel mode [ 33.621293] #PF: error_code(0x0000) - not-present page [ 33.622754] Oops: 0000 [#1] SMP NOPTI [ 33.623202] CPU: 0 PID: 601 Comm: iperf Not tainted 5.5.0-rc2+ #23 [ 33.625545] RIP: 0010:__cgroup_bpf_run_filter_skb+0x29f/0x3d0 [ 33.635809] Call Trace: [ 33.636118] ? __cgroup_bpf_run_filter_skb+0x2bf/0x3d0 [ 33.636728] ? __switch_to_asm+0x40/0x70 [ 33.637196] ip_finish_output+0x68/0xa0 [ 33.637654] ip_output+0x76/0xf0 [ 33.638046] ? __ip_finish_output+0x1c0/0x1c0 [ 33.638576] __ip_queue_xmit+0x157/0x410 [ 33.639049] __tcp_transmit_skb+0x535/0xaf0 [ 33.639557] tcp_write_xmit+0x378/0x1190 [ 33.640049] ? _copy_from_iter_full+0x8d/0x260 [ 33.640592] tcp_sendmsg_locked+0x2a2/0xdc0 [ 33.641098] ? sock_has_perm+0x10/0xa0 [ 33.641574] tcp_sendmsg+0x28/0x40 [ 33.641985] sock_sendmsg+0x57/0x60 [ 33.642411] sock_write_iter+0x97/0x100 [ 33.642876] new_sync_write+0x1b6/0x1d0 [ 33.643339] vfs_write+0xb6/0x1a0 [ 33.643752] ksys_write+0xa7/0xe0 [ 33.644156] do_syscall_64+0x5b/0x1b0 [ 33.644605] entry_SYSCALL_64_after_hwframe+0x44/0xa9
Fix this by grabbing a reference to the bpf structure of each ancestor on the initialization of the cgroup bpf structure, and dropping the reference at the end of releasing the cgroup bpf structure.
This will restore the hierarchical order of cgroup bpf releasing, without adding any operations on hot paths.
Thanks to Josef Bacik for the debugging and the initial analysis of the problem.
--- kernel/bpf/cgroup.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-)
kernel/bpf/cgroup.c +9 -2
@@ -35,8 +35,8 @@ void cgroup_bpf_offline(struct cgroup *c*/ static void cgroup_bpf_release (struct work_struct *work) { - struct cgroup *cgrp = container_of(work, struct cgroup, - bpf.release_work); + struct cgroup *p, *cgrp = container_of(work, struct cgroup, + bpf.release_work);enum bpf_cgroup_storage_type stype;struct bpf_prog_array *old_array;unsigned int type;
@@ -65,6 +65,9 @@ static void cgroup_bpf_release(struct womutex_unlock (&cgroup_mutex); +for (p =cgroup_parent (cgrp); p; p =cgroup_parent (p)) +cgroup_bpf_put (p); +percpu_ref_exit (&cgrp->bpf.refcnt);cgroup_put (cgrp); }
@@ -199,6 +202,7 @@ int cgroup_bpf_inherit(struct cgroup *cg*/ #define NR ARRAY_SIZE(cgrp->bpf.effective)struct bpf_prog_array *arrays[NR ] = {}; +struct cgroup *p;int ret, i; ret = percpu_ref_init(&cgrp->bpf.refcnt, cgroup_bpf_release_fn, 0,
@@ -206,6 +210,9 @@ int cgroup_bpf_inherit(struct cgroup *cgif (ret)return ret; +for (p =cgroup_parent (cgrp); p; p =cgroup_parent (p)) +cgroup_bpf_get (p); +for (i =0 ; i <NR ; i++)INIT_LIST_HEAD (&cgrp->bpf.progs[i]);
Greg Kroah-Hartman
maintainerPATCH 27/203 PM / devfreq: tegra: Add COMMON_CLK dependency
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 5fdb0684b5b0f41402161f068d3d84bf6ed1c3f4 upstream.
Compile-testing this driver fails if CONFIG_COMMON_CLK is not set:
drivers/devfreq/tegra30-devfreq.o: In function `tegra_devfreq_target':
tegra30-devfreq.c:(.text+0x164): undefined reference to `clk_set_min_rate'
--- drivers/devfreq/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/devfreq/Kconfig +1 -0
@@ -99,6 +99,7 @@ config ARM_TEGRA_DEVFREQ ARCH_TEGRA_210_SOC || \ COMPILE_TEST select PM_OPP + depends on COMMON_CLK help This adds the DEVFREQ driver for the Tegra family of SoCs. It reads ACTMON counters of memory controllers and adjusts the
Greg Kroah-Hartman
maintainerPATCH 24/203 fs: move guard_bio_eod() after bio_set_op_attrs
In reply to Greg Kroah-HartmanFrom: Ming Lei <[email protected]>
commit 83c9c547168e8b914ea6398430473a4de68c52cc upstream.
Commit 85a8ce62c2ea ("block: add bio_truncate to fix guard_bio_eod") adds bio_truncate() for handling bio EOD. However, bio_truncate() doesn't use the passed 'op' parameter from guard_bio_eod's callers.
So bio_trunacate() may retrieve wrong 'op', and zering pages may not be done for READ bio.
Fixes this issue by moving guard_bio_eod() after bio_set_op_attrs() in submit_bh_wbc() so that bio_truncate() can always retrieve correct op info.
Meantime remove the 'op' parameter from guard_bio_eod() because it isn't used any more.
Fold in kerneldoc and bio_op() change.
--- block/bio.c | 12 +++++++++++- fs/buffer.c | 8 ++++---- fs/internal.h | 2 +- fs/mpage.c | 2 +- 4 files changed, 17 insertions(+), 7 deletions(-)
block/bio.c +11 -1
@@ -535,6 +535,16 @@ void zero_fill_bio_iter(struct bio *bio, }EXPORT_SYMBOL (zero_fill_bio_iter); +/** +* bio_truncate - truncate the bio to small size of @new_size +* @bio: the bio to be truncated +* @new_size: new size for truncating the bio +* +* Description: +* Truncate the bio to new size of @new_size. If bio_op(bio) is +* REQ_OP_READ, zero the truncated part. This function should only +* be used for handling corner cases, such as bio eod. +*/ void bio_truncate (struct bio *bio,unsigned new_size) {struct bio_vec bv;
@@ -545,7 +555,7 @@ void bio_truncate(struct bio *bio, unsigif (new_size >= bio->bi_iter.bi_size)return ; -if (bio_data_dir (bio) !=READ ) +if (bio_op (bio) !=REQ_OP_READ ) goto exit;bio_for_each_segment (bv, bio, iter) {
fs/buffer.c +4 -4
@@ -2991,7 +2991,7 @@ static void end_bio_bh_io_sync(struct bi* errors, this only handles the "we need to be able to * do IO at the final sector" case. */ -void guard_bio_eod (int op,struct bio *bio) +void guard_bio_eod (struct bio *bio) {sector_t maxsector;struct hd_struct *part;
@@ -3055,15 +3055,15 @@ static int submit_bh_wbc(int op, int op_ bio->bi_end_io = end_bio_bh_io_sync; bio->bi_private = bh; -/* Take care of bh's that straddle the end of the device */ -guard_bio_eod (op, bio); -if (buffer_meta (bh)) op_flags |=REQ_META ;if (buffer_prio (bh)) op_flags |=REQ_PRIO ;bio_set_op_attrs (bio, op, op_flags); +/* Take care of bh's that straddle the end of the device */ +guard_bio_eod (bio); +if (wbc) {wbc_init_bio (wbc, bio);wbc_account_cgroup_owner (wbc, bh->b_page, bh->b_size);
fs/internal.h +1 -1
@@ -38,7 +38,7 @@ static inline int __sync_blockdev(struct/* * buffer.c */ -extern void guard_bio_eod (int rw,struct bio *bio); +extern void guard_bio_eod (struct bio *bio);extern int __block_write_begin_int (struct page *page,loff_t pos,unsigned len,get_block_t *get_block,struct iomap *iomap);
fs/mpage.c +1 -1
@@ -62,7 +62,7 @@ static struct bio *mpage_bio_submit(int { bio->bi_end_io = mpage_end_io;bio_set_op_attrs (bio, op, op_flags); -guard_bio_eod (op, bio); +guard_bio_eod (bio);submit_bio (bio);return NULL ; }
Greg Kroah-Hartman
maintainerPATCH 28/203 PCI: amlogic: Fix probed clock names
In reply to Greg Kroah-HartmanFrom: Neil Armstrong <[email protected]>
commit eacaf7dcf08eb062a1059c6c115fa3fced3374ae upstream.
Fix the clock names used in the probe function according to the bindings.
--- drivers/pci/controller/dwc/pci-meson.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
drivers/pci/controller/dwc/pci-meson.c +3 -3
@@ -250,15 +250,15 @@ static int meson_pcie_probe_clocks(strucif (IS_ERR (res->port_clk))return PTR_ERR (res->port_clk); - res->mipi_gate =meson_pcie_probe_clock (dev,"pcie_mipi_en" ,0 ); + res->mipi_gate =meson_pcie_probe_clock (dev,"mipi" ,0 );if (IS_ERR (res->mipi_gate))return PTR_ERR (res->mipi_gate); - res->general_clk =meson_pcie_probe_clock (dev,"pcie_general" ,0 ); + res->general_clk =meson_pcie_probe_clock (dev,"general" ,0 );if (IS_ERR (res->general_clk))return PTR_ERR (res->general_clk); - res->clk =meson_pcie_probe_clock (dev,"pcie" ,0 ); + res->clk =meson_pcie_probe_clock (dev,"pclk" ,0 );if (IS_ERR (res->clk))return PTR_ERR (res->clk);
Greg Kroah-Hartman
maintainerPATCH 25/203 scsi: mpt3sas: Fix double free in attach error handling
In reply to Greg Kroah-HartmanFrom: Dan Carpenter <[email protected]>
commit ee560e7bbab0c10cf3f0e71997fbc354ab2ee5cb upstream.
The caller also calls _base_release_memory_pools() on error so it leads to a number of double frees:
drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->chain_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->hpr_lookup' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->internal_lookup' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->pcie_sgl_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_free_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_post_free_array_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->reply_post_free_dma_pool' double freed drivers/scsi/mpt3sas/mpt3sas_base.c:7207 mpt3sas_base_attach() warn: 'ioc->sense_dma_pool' double freed
--- drivers/scsi/mpt3sas/mpt3sas_base.c | 1 - 1 file changed, 1 deletion(-)
drivers/scsi/mpt3sas/mpt3sas_base.c +0 -1
@@ -5234,7 +5234,6 @@ _base_allocate_memory_pools(struct MPT3S &ct->chain_buffer_dma);if (!ct->chain_buffer) {ioc_err (ioc,"chain_lookup: pci_pool_alloc failed\n" ); -_base_release_memory_pools (ioc); goto out; } }
Greg Kroah-Hartman
maintainerPATCH 13/203 ASoC: stm32: spdifrx: fix input pin state management
In reply to Greg Kroah-HartmanFrom: Olivier Moysan <[email protected]>
commit 3b7658679d88b5628939f9bdc8e613f79cd821f9 upstream.
Changing input state in iec capture control is not safe, as the pin state may be changed concurrently by ASoC framework.
Remove pin state handling in iec capture control.
Note: This introduces a restriction on capture control, when pin sleep state is defined in device tree. In this case channel status can be captured only when an audio stream capture is active.
--- sound/soc/stm/stm32_spdifrx.c | 4 ---- 1 file changed, 4 deletions(-)
sound/soc/stm/stm32_spdifrx.c +0 -4
@@ -12,7 +12,6 @@#include <linux/delay.h> #include <linux/module.h> #include <linux/of_platform.h> -#include <linux/pinctrl/consumer.h> #include <linux/regmap.h> #include <linux/reset.h>
@@ -482,8 +481,6 @@ static int stm32_spdifrx_get_ctrl_data(smemset (spdifrx->cs,0 ,SPDIFRX_CS_BYTES_NB );memset (spdifrx->ub,0 ,SPDIFRX_UB_BYTES_NB ); -pinctrl_pm_select_default_state (&spdifrx->pdev->dev); - ret =stm32_spdifrx_dma_ctrl_start (spdifrx);if (ret <0 )return ret;
@@ -515,7 +512,6 @@ static int stm32_spdifrx_get_ctrl_data(s end:clk_disable_unprepare (spdifrx->kclk); -pinctrl_pm_select_sleep_state (&spdifrx->pdev->dev);return ret; }
Greg Kroah-Hartman
maintainerPATCH 14/203 pinctrl: lochnagar: select GPIOLIB
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit f7e36e18946b4ec756b9c5cf4fb8891be8d1e4a3 upstream.
In a rare randconfig build I came across one configuration that does not enable CONFIG_GPIOLIB, which is needed by lochnagar:
ERROR: "devm_gpiochip_add_data" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
ERROR: "gpiochip_generic_free" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
ERROR: "gpiochip_generic_request" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
ERROR: "gpiochip_get_data" [drivers/pinctrl/cirrus/pinctrl-lochnagar.ko] undefined!
Add another 'select' like all other pinctrl drivers have.
--- drivers/pinctrl/cirrus/Kconfig | 1 + 1 file changed, 1 insertion(+)
drivers/pinctrl/cirrus/Kconfig +1 -0
@@ -2,6 +2,7 @@ config PINCTRL_LOCHNAGAR tristate "Cirrus Logic Lochnagar pinctrl driver" depends on MFD_LOCHNAGAR + select GPIOLIB select PINMUX select PINCONF select GENERIC_PINCONF
Greg Kroah-Hartman
maintainerPATCH 15/203 netfilter: nft_flow_offload: fix underflow in flowtable reference counter
In reply to Greg Kroah-HartmanFrom: wenxu <[email protected]>
commit 8ca79606cdfde2e37ee4f0707b9d1874a6f0eb38 upstream.
The .deactivate and .activate interfaces already deal with the reference counter. Otherwise, this results in spurious "Device is busy" errors.
--- net/netfilter/nft_flow_offload.c | 3 --- 1 file changed, 3 deletions(-)
net/netfilter/nft_flow_offload.c +0 -3
@@ -197,9 +197,6 @@ static void nft_flow_offload_activate(costatic void nft_flow_offload_destroy (const struct nft_ctx *ctx,const struct nft_expr *expr) { -struct nft_flow_offload *priv =nft_expr_priv (expr); - - priv->flowtable->use--;nf_ct_netns_put (ctx->net, ctx->family); }
Greg Kroah-Hartman
maintainerPATCH 18/203 gpio: zynq: Fix for bug in zynq_gpio_restore_context API
In reply to Greg Kroah-HartmanFrom: Swapna Manupati <[email protected]>
commit 36f2e7207f21a83ca0054116191f119ac64583ab upstream.
This patch writes the inverse value of Interrupt Mask Status register into the Interrupt Enable register in zynq_gpio_restore_context API to fix the bug.
--- drivers/gpio/gpio-zynq.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpio/gpio-zynq.c +5 -3
@@ -681,6 +681,8 @@ static void zynq_gpio_restore_context(stunsigned int bank_num;for (bank_num =0 ; bank_num < gpio->p_data->max_bank; bank_num++) { +writel_relaxed (ZYNQ_GPIO_IXR_DISABLE_ALL , gpio->base_addr + +ZYNQ_GPIO_INTDIS_OFFSET (bank_num));writel_relaxed (gpio->context.datalsw[bank_num], gpio->base_addr +ZYNQ_GPIO_DATA_LSW_OFFSET (bank_num));
@@ -690,9 +692,6 @@ static void zynq_gpio_restore_context(stwritel_relaxed (gpio->context.dirm[bank_num], gpio->base_addr +ZYNQ_GPIO_DIRM_OFFSET (bank_num)); -writel_relaxed (gpio->context.int_en[bank_num], - gpio->base_addr + -ZYNQ_GPIO_INTEN_OFFSET (bank_num));writel_relaxed (gpio->context.int_type[bank_num], gpio->base_addr +ZYNQ_GPIO_INTTYPE_OFFSET (bank_num));
@@ -702,6 +701,9 @@ static void zynq_gpio_restore_context(stwritel_relaxed (gpio->context.int_any[bank_num], gpio->base_addr +ZYNQ_GPIO_INTANY_OFFSET (bank_num)); +writel_relaxed (~(gpio->context.int_en[bank_num]), + gpio->base_addr + +ZYNQ_GPIO_INTEN_OFFSET (bank_num)); } }
Greg Kroah-Hartman
maintainerPATCH 19/203 pinctrl: meson: Fix wrong shift value when get drive-strength
In reply to Greg Kroah-HartmanFrom: Qianggui Song <[email protected]>
commit 35c60be220572de7d6605c4318f640d133982040 upstream.
In meson_pinconf_get_drive_strength, variable bit is calculated by meson_calc_reg_and_bit, this value is the offset from the first pin of a certain bank to current pin, while Meson SoCs use two bits for each pin to depict drive-strength. So a left shift by 1 should be done or node pinconf-pins shows wrong message.
--- drivers/pinctrl/meson/pinctrl-meson.c | 1 + 1 file changed, 1 insertion(+)
drivers/pinctrl/meson/pinctrl-meson.c +1 -0
@@ -441,6 +441,7 @@ static int meson_pinconf_get_drive_strenreturn ret;meson_calc_reg_and_bit (bank, pin,REG_DS , ®, &bit); + bit = bit <<1 ; ret =regmap_read (pc->reg_ds, reg, &val);if (ret)
Greg Kroah-Hartman
maintainerPATCH 10/203 ASoC: soc-core: Set dpcm_playback / dpcm_capture
In reply to Greg Kroah-HartmanFrom: Daniel Baluta <[email protected]>
commit 218fe9b7ec7f32c10a07539365488d80af7b0084 upstream.
When converting a normal link to a DPCM link we need to set dpcm_playback / dpcm_capture otherwise playback/capture streams will not be created resulting in errors like this:
[ 36.039111] sai1-wm8960-hifi: ASoC: no backend playback stream
--- sound/soc/soc-core.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/soc-core.c +2 -0
@@ -1886,6 +1886,8 @@ match:/* convert non BE into BE */ dai_link->no_pcm =1 ; + dai_link->dpcm_playback =1 ; + dai_link->dpcm_capture =1 ;/* override any BE fixups */ dai_link->be_hw_params_fixup =
Greg Kroah-Hartman
maintainerPATCH 39/203 scsi: smartpqi: Update attribute name to `driver_version`
In reply to Greg Kroah-HartmanFrom: Paul Menzel <[email protected]>
commit a2bdd0c904da12b223c8d7218e98138d4e6d9f4f upstream.
The file name in the documentation is currently incorrect, so fix it.
--- Documentation/scsi/smartpqi.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/scsi/smartpqi.txt +1 -1
@@ -29,7 +29,7 @@ smartpqi specific entries in /sys smartpqi host attributes: ------------------------- /sys/class/scsi_host/host*/rescan - /sys/class/scsi_host/host*/version + /sys/class/scsi_host/host*/driver_version The host rescan attribute is a write only attribute. Writing to this attribute will trigger the driver to scan for new, changed, or removed
Greg Kroah-Hartman
maintainerPATCH 40/203 MAINTAINERS: Append missed file to the database
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
commit 44fe5cb32c7599a4059931a98794e0418619aa96 upstream.
When gpiolib.h internal header had been split to few, the commit 77cb907abe6c ("gpiolib: acpi: Split ACPI stuff to gpiolib-acpi.h") in particular missed the MAINTAINERS database update. Do it here.
--- MAINTAINERS | 1 + 1 file changed, 1 insertion(+)
MAINTAINERS +1 -0
@@ -6973,6 +6973,7 @@ L: [email protected] S: Maintained F: Documentation/firmware-guide/acpi/gpio-properties.rst F: drivers/gpio/gpiolib-acpi.c +F: drivers/gpio/gpiolib-acpi.h GPIO IR Transmitter M: Sean Young <[email protected]>
Greg Kroah-Hartman
maintainerPATCH 41/203 ath9k: use iowrite32 over __raw_writel
In reply to Greg Kroah-HartmanFrom: Christian Lamparter <[email protected]>
commit 22d0d5ae7a089967e9295a06694aa3e8a812b15e upstream.
This patch changes the ath9k_pci_owl_loader to use the same iowrite32 memory accessor that ath9k_pci is using to communicate with the PCI(e) chip.
This will fix endian issues that came up during testing with loaned AVM Fritz!Box 7360 (Lantiq MIPS SoCs + AR9287).
--- drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/ath/ath9k/ath9k_pci_owl_loader.c +1 -1
@@ -84,7 +84,7 @@ static int ath9k_pci_fixup(struct pci_de val =swahb32 (val); } -__raw_writel (val, mem + reg); +iowrite32 (val, mem + reg);usleep_range (100 ,120 ); }
Greg Kroah-Hartman
maintainerPATCH 42/203 can: j1939: fix address claim code example
In reply to Greg Kroah-HartmanFrom: Marc Kleine-Budde <[email protected]>
commit 8ac9d71d601374222a230804e419cd40c4492e1c upstream.
During development the define J1939_PGN_ADDRESS_REQUEST was renamed to J1939_PGN_REQUEST. It was forgotten to adjust the documentation accordingly.
This patch fixes the name of the symbol.
--- Documentation/networking/j1939.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/networking/j1939.rst +1 -1
@@ -339,7 +339,7 @@ To claim an address following code examp .pgn = J1939_PGN_ADDRESS_CLAIMED, .pgn_mask = J1939_PGN_PDU1_MAX, }, { - .pgn = J1939_PGN_ADDRESS_REQUEST, + .pgn = J1939_PGN_REQUEST, .pgn_mask = J1939_PGN_PDU1_MAX, }, { .pgn = J1939_PGN_ADDRESS_COMMANDED,
Greg Kroah-Hartman
maintainerPATCH 43/203 dt-bindings: reset: Fix brcmstb-reset example
In reply to Greg Kroah-HartmanFrom: Florian Fainelli <[email protected]>
commit 392a9f63058f2cdcec8363b849a25532ee40da9f upstream.
The reset controller has a #reset-cells value of 1, so we should see a phandle plus a register identifier, fix the example.
--- Documentation/devicetree/bindings/reset/brcm,brcmstb-reset.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/devicetree/bindings/reset/brcm,brcmstb-reset.txt +1 -1
@@ -22,6 +22,6 @@ Example: }; ðernet_switch { - resets = <&reset>; + resets = <&reset 26>; reset-names = "switch"; };
Greg Kroah-Hartman
maintainerPATCH 45/203 afs: Fix missing cell comparison in afs_test_super()
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
commit 106bc79843c3c6f4f00753d1f46e54e815f99377 upstream.
Fix missing cell comparison in afs_test_super(). Without this, any pair volumes that have the same volume ID will share a superblock, no matter the cell, unless they're in different network namespaces.
Normally, most users will only deal with a single cell and so they won't see this. Even if they do look into a second cell, they won't see a problem unless they happen to hit a volume with the same ID as one they've already got mounted.
Before the patch:
# ls /afs/grand.central.org/archive
linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/
# ls /afs/kth.se/
linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/
# cat /proc/mounts | grep afs
none /afs afs rw,relatime,dyn,autocell 0 0
#grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0
#grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0
#grand.central.org:root.archive /afs/kth.se afs ro,relatime 0 0After the patch:
# ls /afs/grand.central.org/archive
linuxdev/ mailman/ moin/ mysql/ pipermail/ stage/ twiki/
# ls /afs/kth.se/
admin/ common/ install/ OldFiles/ service/ system/
bakrestores/ home/ misc/ pkg/ src/ wsadmin/
# cat /proc/mounts | grep afs
none /afs afs rw,relatime,dyn,autocell 0 0
#grand.central.org:root.cell /afs/grand.central.org afs ro,relatime 0 0
#grand.central.org:root.archive /afs/grand.central.org/archive afs ro,relatime 0 0
#kth.se:root.cell /afs/kth.se afs ro,relatime 0 0--- fs/afs/super.c | 1 + 1 file changed, 1 insertion(+)
fs/afs/super.c +1 -0
@@ -404,6 +404,7 @@ static int afs_test_super(struct super_breturn (as->net_ns == fc->net_ns && as->volume && as->volume->vid == ctx->volume->vid && + as->cell == ctx->cell && !as->dyn_root); }
Greg Kroah-Hartman
maintainerPATCH 31/203 hsr: rename debugfs file when interface name is changed
In reply to Greg Kroah-HartmanFrom: Taehee Yoo <[email protected]>
commit 4c2d5e33dcd3a6333a7895be3b542ff3d373177c upstream.
hsr interface has own debugfs file, which name is same with interface name. So, interface name is changed, debugfs file name should be changed too.
--- net/hsr/hsr_debugfs.c | 13 +++++++++++++ net/hsr/hsr_main.c | 3 +++ net/hsr/hsr_main.h | 4 ++++ 3 files changed, 20 insertions(+)
net/hsr/hsr_debugfs.c +13 -0
@@ -65,6 +65,19 @@ hsr_node_table_open(struct inode *inode,return single_open (filp, hsr_node_table_show, inode->i_private); } +void hsr_debugfs_rename (struct net_device *dev) +{ +struct hsr_priv *priv =netdev_priv (dev); +struct dentry *d; + + d =debugfs_rename (hsr_debugfs_root_dir, priv->node_tbl_root, + hsr_debugfs_root_dir, dev->name); +if (IS_ERR (d)) +netdev_warn (dev,"failed to rename\n" ); +else + priv->node_tbl_root = d; +} +static const struct file_operations hsr_fops = { .open = hsr_node_table_open, .read = seq_read,
net/hsr/hsr_main.c +3 -0
@@ -45,6 +45,9 @@ static int hsr_netdev_notify(struct noticase NETDEV_CHANGE :/* Link (carrier) state changes */ hsr_check_carrier_and_operstate (hsr);break ; +case NETDEV_CHANGENAME : +hsr_debugfs_rename (dev); +break ;case NETDEV_CHANGEADDR :if (port->type ==HSR_PT_MASTER ) {/* This should not happen since there's no
net/hsr/hsr_main.h +4 -0
@@ -185,11 +185,15 @@ static inline u16 hsr_get_skb_sequence_n }#if IS_ENABLED (CONFIG_DEBUG_FS ) +void hsr_debugfs_rename (struct net_device *dev);void hsr_debugfs_init (struct hsr_priv *priv,struct net_device *hsr_dev);void hsr_debugfs_term (struct hsr_priv *priv);void hsr_debugfs_create_root (void );void hsr_debugfs_remove_root (void );#else +static inline void void hsr_debugfs_rename(struct net_device *dev) +{ +}static inline void hsr_debugfs_init (struct hsr_priv *priv,struct net_device *hsr_dev) {}
Greg Kroah-Hartman
maintainerPATCH 32/203 hsr: reset network header when supervision frame is created
In reply to Greg Kroah-HartmanFrom: Taehee Yoo <[email protected]>
commit 3ed0a1d563903bdb4b4c36c58c4d9c1bcb23a6e6 upstream.
The supervision frame is L2 frame.
When supervision frame is created, hsr module doesn't set network header. If tap routine is enabled, dev_queue_xmit_nit() is called and it checks network_header. If network_header pointer wasn't set(or invalid), it resets network_header and warns.
In order to avoid unnecessary warning message, resetting network_header is needed.
Test commands:
ip netns add nst
ip link add veth0 type veth peer name veth1
ip link add veth2 type veth peer name veth3
ip link set veth1 netns nst
ip link set veth3 netns nst
ip link set veth0 up
ip link set veth2 up
ip link add hsr0 type hsr slave1 veth0 slave2 veth2
ip a a 192.168.100.1/24 dev hsr0
ip link set hsr0 up
ip netns exec nst ip link set veth1 up
ip netns exec nst ip link set veth3 up
ip netns exec nst ip link add hsr1 type hsr slave1 veth1 slave2 veth3 ip netns exec nst ip a a 192.168.100.2/24 dev hsr1
ip netns exec nst ip link set hsr1 up
tcpdump -nei veth0
Splat looks like:
[ 175.852292][ C3] protocol 88fb is buggy, dev veth0
--- net/hsr/hsr_device.c | 2 ++ 1 file changed, 2 insertions(+)
net/hsr/hsr_device.c +2 -0
@@ -272,6 +272,8 @@ static void send_hsr_supervision_frame(s skb->dev->dev_addr, skb->len) <= 0) goto out;skb_reset_mac_header (skb); +skb_reset_network_header (skb); +skb_reset_transport_header (skb);if (hsr_ver >0 ) { hsr_tag =skb_put (skb,sizeof (struct hsr_tag ));
Greg Kroah-Hartman
maintainerPATCH 33/203 s390/qeth: fix qdio teardown after early init error
In reply to Greg Kroah-HartmanFrom: Julian Wiedmann <[email protected]>
commit 8b5026bc16938920e4780b9094c3bf20e1e0939d upstream.
qeth_l?_set_online() goes through a number of initialization steps, and on any error uses qeth_l?_stop_card() to tear down the residual state.
The first initialization step is qeth_core_hardsetup_card(). When this fails after having established a QDIO context on the device (ie. somewhere after qeth_mpc_initialize()), qeth_l?_stop_card() doesn't shut down this QDIO context again (since the card state hasn't progressed from DOWN at this stage).
Even worse, we then call qdio_free() as final teardown step to free the QDIO data structures - while some of them are still hooked into wider QDIO infrastructure such as the IRQ list. This is inevitably followed by use-after-frees and other nastyness.
Fix this by unconditionally calling qeth_qdio_clear_card() to shut down the QDIO context, and also to halt/clear any pending activity on the various IO channels.
Remove the naive attempt at handling the teardown in qeth_mpc_initialize(), it clearly doesn't suffice and we're handling it properly now in the wider teardown code.
--- drivers/s390/net/qeth_core_main.c | 20 ++++++++------------ drivers/s390/net/qeth_l2_main.c | 2 +- drivers/s390/net/qeth_l3_main.c | 2 +- 3 files changed, 10 insertions(+), 14 deletions(-)
drivers/s390/net/qeth_core_main.c +8 -12
@@ -2451,50 +2451,46 @@ static int qeth_mpc_initialize(struct qe rc =qeth_cm_enable (card);if (rc) {QETH_CARD_TEXT_ (card,2 ,"2err%d" , rc); - goto out_qdio; +return rc; } rc =qeth_cm_setup (card);if (rc) {QETH_CARD_TEXT_ (card,2 ,"3err%d" , rc); - goto out_qdio; +return rc; } rc =qeth_ulp_enable (card);if (rc) {QETH_CARD_TEXT_ (card,2 ,"4err%d" , rc); - goto out_qdio; +return rc; } rc =qeth_ulp_setup (card);if (rc) {QETH_CARD_TEXT_ (card,2 ,"5err%d" , rc); - goto out_qdio; +return rc; } rc =qeth_alloc_qdio_queues (card);if (rc) {QETH_CARD_TEXT_ (card,2 ,"5err%d" , rc); - goto out_qdio; +return rc; } rc =qeth_qdio_establish (card);if (rc) {QETH_CARD_TEXT_ (card,2 ,"6err%d" , rc);qeth_free_qdio_queues (card); - goto out_qdio; +return rc; } rc =qeth_qdio_activate (card);if (rc) {QETH_CARD_TEXT_ (card,2 ,"7err%d" , rc); - goto out_qdio; +return rc; } rc =qeth_dm_act (card);if (rc) {QETH_CARD_TEXT_ (card,2 ,"8err%d" , rc); - goto out_qdio; +return rc; }return 0 ; -out_qdio: -qeth_qdio_clear_card (card, !IS_IQD (card)); -qdio_free (CARD_DDEV (card)); -return rc; }void qeth_print_status_message (struct qeth_card *card)
drivers/s390/net/qeth_l2_main.c +1 -1
@@ -287,12 +287,12 @@ static void qeth_l2_stop_card(struct qet card->state =CARD_STATE_HARDSETUP ; }if (card->state ==CARD_STATE_HARDSETUP ) { -qeth_qdio_clear_card (card,0 );qeth_drain_output_queues (card);qeth_clear_working_pool_list (card); card->state =CARD_STATE_DOWN ; } +qeth_qdio_clear_card (card,0 );flush_workqueue (card->event_wq); card->info.mac_bits &= ~QETH_LAYER2_MAC_REGISTERED ; card->info.promisc_mode =0 ;
drivers/s390/net/qeth_l3_main.c +1 -1
@@ -1426,12 +1426,12 @@ static void qeth_l3_stop_card(struct qet card->state =CARD_STATE_HARDSETUP ; }if (card->state ==CARD_STATE_HARDSETUP ) { -qeth_qdio_clear_card (card,0 );qeth_drain_output_queues (card);qeth_clear_working_pool_list (card); card->state =CARD_STATE_DOWN ; } +qeth_qdio_clear_card (card,0 );flush_workqueue (card->event_wq); card->info.promisc_mode =0 ; }
Greg Kroah-Hartman
maintainerPATCH 35/203 s390/qeth: Fix vnicc_is_in_use if rx_bcast not set
In reply to Greg Kroah-HartmanFrom: Alexandra Winter <[email protected]>
commit e8a66d800471e2df7f0b484e2e46898b21d1fa82 upstream.
Symptom: After vnicc/rx_bcast has been manually set to 0,
bridge_* sysfs parameters can still be set or written.
Only occurs on HiperSockets, as OSA doesn't support changing rx_bcast.
Vnic characteristics and bridgeport settings are mutually exclusive. rx_bcast defaults to 1, so manually setting it to 0 should disable bridge_* parameters.
Instead it makes sense here to check the supported mask. If the card does not support vnicc at all, bridge commands are always allowed.
--- drivers/s390/net/qeth_l2_main.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/s390/net/qeth_l2_main.c +1 -2
@@ -1983,8 +1983,7 @@ int qeth_l2_vnicc_get_timeout(struct qet/* check if VNICC is currently enabled */ bool qeth_l2_vnicc_is_in_use (struct qeth_card *card) { -/* if everything is turned off, VNICC is not active */ -if (!card->options.vnicc.cur_chars) +if (!card->options.vnicc.sup_chars)return false;/* default values are only OK if rx_bcast was not enabled by user * or the card is offline.
Greg Kroah-Hartman
maintainerPATCH 37/203 s390/qeth: fix initialization on old HW
In reply to Greg Kroah-HartmanFrom: Julian Wiedmann <[email protected]>
commit 0b698c838e84149b690c7e979f78cccb6f8aa4b9 upstream.
I stumbled over an old OSA model that claims to support DIAG_ASSIST, but then rejects the cmd to query its DIAG capabilities.
In the old code this was ok, as the returned raw error code was > 0. Now that we translate the raw codes to errnos, the "rc < 0" causes us to fail the initialization of the device.
The fix is trivial: don't bail out when the DIAG query fails. Such an error is not critical, we can still use the device (with a slightly reduced set of features).
--- drivers/s390/net/qeth_core_main.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
drivers/s390/net/qeth_core_main.c +1 -3
@@ -4968,10 +4968,8 @@ retriable: }if (qeth_adp_supported (card,IPA_SETADP_SET_DIAG_ASSIST )) { rc =qeth_query_setdiagass (card); -if (rc <0 ) { +if (rc)QETH_CARD_TEXT_ (card,2 ,"8err%d" , rc); - goto out; - } }return 0 ; out:
Greg Kroah-Hartman
maintainerPATCH 38/203 cifs: Adjust indentation in smb2_open_file
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
commit 7935799e041ae10d380d04ea23868240f082bd11 upstream.
Clang warns:
../fs/cifs/smb2file.c:70:3: warning: misleading indentation; statement is not part of the previous 'if' [-Wmisleading-indentation]
if (oparms->tcon->use_resilient) {
^
../fs/cifs/smb2file.c:66:2: note: previous statement is here
if (rc)
^1 warning generated.
This warning occurs because there is a space after the tab on this line. Remove it so that the indentation is consistent with the Linux kernel coding style and clang no longer warns.
--- fs/cifs/smb2file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/cifs/smb2file.c +1 -1
@@ -67,7 +67,7 @@ smb2_open_file(const unsigned int xid, s goto out; -if (oparms->tcon->use_resilient) { +if (oparms->tcon->use_resilient) {/* default timeout is 0, servers pick default (120 seconds) */ nr_ioctl_req.Timeout =cpu_to_le32 (oparms->tcon->handle_timeout);
Greg Kroah-Hartman
maintainerPATCH 29/203 drm/tegra: Fix ordering of cleanup code
In reply to Greg Kroah-HartmanFrom: Thierry Reding <[email protected]>
commit 051172e8c1ceef8749f19faacc1d3bef65d20d8d upstream.
Commit Fixes: b9f8b09ce256 ("drm/tegra: Setup shared IOMMU domain after initialization") changed the initialization order of the IOMMU related bits but didn't update the cleanup path accordingly. This asymmetry can cause failures during error recovery.
--- drivers/gpu/drm/tegra/drm.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-)
drivers/gpu/drm/tegra/drm.c +7 -7
@@ -201,19 +201,19 @@ hub:if (tegra->hub)tegra_display_hub_cleanup (tegra->hub); device: -host1x_device_exit (device); -fbdev: -drm_kms_helper_poll_fini (drm); -tegra_drm_fb_free (drm); -config: -drm_mode_config_cleanup (drm); -if (tegra->domain) {mutex_destroy (&tegra->mm_lock);drm_mm_takedown (&tegra->mm);put_iova_domain (&tegra->carveout.domain);iova_cache_put (); } + +host1x_device_exit (device); +fbdev: +drm_kms_helper_poll_fini (drm); +tegra_drm_fb_free (drm); +config: +drm_mode_config_cleanup (drm); domain:if (tegra->domain)iommu_domain_free (tegra->domain);
Greg Kroah-Hartman
maintainerPATCH 48/203 syscalls/x86: Use COMPAT_SYSCALL_DEFINE0 for IA32 (rt_)sigreturn
In reply to Greg Kroah-HartmanFrom: Sami Tolvanen <[email protected]>
commit 00198a6eaf66609de5e4de9163bb42c7ca9dd7b7 upstream.
Use COMPAT_SYSCALL_DEFINE0 to define (rt_)sigreturn() syscalls to replace sys32_sigreturn() and sys32_rt_sigreturn(). This fixes indirect call mismatches with Control-Flow Integrity (CFI) checking.
--- arch/x86/entry/syscalls/syscall_32.tbl | 4 ++-- arch/x86/ia32/ia32_signal.c | 5 +++-- 2 files changed, 5 insertions(+), 4 deletions(-)
arch/x86/entry/syscalls/syscall_32.tbl +2 -2
@@ -130,7 +130,7 @@ 116 i386 sysinfo sys_sysinfo __ia32_compat_sys_sysinfo 117 i386 ipc sys_ipc __ia32_compat_sys_ipc 118 i386 fsync sys_fsync __ia32_sys_fsync -119 i386 sigreturn sys_sigreturn sys32_sigreturn +119 i386 sigreturn sys_sigreturn __ia32_compat_sys_sigreturn 120 i386 clone sys_clone __ia32_compat_sys_x86_clone 121 i386 setdomainname sys_setdomainname __ia32_sys_setdomainname 122 i386 uname sys_newuname __ia32_sys_newuname
@@ -184,7 +184,7 @@ 170 i386 setresgid sys_setresgid16 __ia32_sys_setresgid16 171 i386 getresgid sys_getresgid16 __ia32_sys_getresgid16 172 i386 prctl sys_prctl __ia32_sys_prctl -173 i386 rt_sigreturn sys_rt_sigreturn sys32_rt_sigreturn +173 i386 rt_sigreturn sys_rt_sigreturn __ia32_compat_sys_rt_sigreturn 174 i386 rt_sigaction sys_rt_sigaction __ia32_compat_sys_rt_sigaction 175 i386 rt_sigprocmask sys_rt_sigprocmask __ia32_compat_sys_rt_sigprocmask 176 i386 rt_sigpending sys_rt_sigpending __ia32_compat_sys_rt_sigpending
arch/x86/ia32/ia32_signal.c +3 -2
@@ -21,6 +21,7 @@#include <linux/personality.h> #include <linux/compat.h> #include <linux/binfmts.h> +#include <linux/syscalls.h> #include <asm/ucontext.h> #include <linux/uaccess.h> #include <asm/fpu/internal.h>
@@ -118,7 +119,7 @@ static int ia32_restore_sigcontext(strucreturn err; } -asmlinkage long sys32_sigreturn (void ) +COMPAT_SYSCALL_DEFINE0 (sigreturn) {struct pt_regs *regs =current_pt_regs ();struct sigframe_ia32 __user *frame = (struct sigframe_ia32 __user *)(regs->sp-8 );
@@ -144,7 +145,7 @@ badframe:return 0 ; } -asmlinkage long sys32_rt_sigreturn (void ) +COMPAT_SYSCALL_DEFINE0 (rt_sigreturn) {struct pt_regs *regs =current_pt_regs ();struct rt_sigframe_ia32 __user *frame;
Greg Kroah-Hartman
maintainerPATCH 59/203 ASoC: core: Fix compile warning with CONFIG_DEBUG_FS=n
In reply to Greg Kroah-HartmanFrom: Takashi Iwai <[email protected]>
commit bd0b609e0c3362cb167c51d4bd4330d79fc00987 upstream.
Paper over a compile warning:
sound/soc/soc-pcm.c:1185:8: warning: unused variable ‘name’
--- sound/soc/soc-pcm.c | 2 ++ 1 file changed, 2 insertions(+)
sound/soc/soc-pcm.c +2 -0
@@ -1148,7 +1148,9 @@ static int dpcm_be_connect(struct snd_so {struct snd_soc_dpcm *dpcm;unsigned long flags; +#ifdef CONFIG_DEBUG_FS char *name; +#endif /* only add new dpcms */ for_each_dpcm_be (fe, stream, dpcm) {
Greg Kroah-Hartman
maintainerPATCH 60/203 ASoC: rsnd: fix DALIGN register for SSIU
In reply to Greg Kroah-HartmanFrom: Nilkanth Ahirrao <[email protected]>
commit ef8e14794308a428b194f8b06ad9ae06b43466e4 upstream.
The current driver only sets 0x76543210 and 0x67452301 for DALIGN. This doesn’t work well for TDM split and ex-split mode for all SSIU. This patch programs the DALIGN registers based on the SSIU number.
--- sound/soc/sh/rcar/core.c | 20 ++++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-)
sound/soc/sh/rcar/core.c +18 -2
@@ -376,6 +376,17 @@ u32 rsnd_get_adinr_bit(struct rsnd_mod **/ u32 rsnd_get_dalign (struct rsnd_mod *mod,struct rsnd_dai_stream *io) { +static const u32 dalign_values[8 ][2 ] = { + {0x76543210 ,0x67452301 }, + {0x00000032 ,0x00000023 }, + {0x00007654 ,0x00006745 }, + {0x00000076 ,0x00000067 }, + {0xfedcba98 ,0xefcdab89 }, + {0x000000ba ,0x000000ab }, + {0x0000fedc ,0x0000efcd }, + {0x000000fe ,0x000000ef }, + }; +int id =0 , inv;struct rsnd_mod *ssiu =rsnd_io_to_mod_ssiu (io);struct rsnd_mod *target;struct snd_pcm_runtime *runtime =rsnd_io_to_runtime (io);
@@ -411,13 +422,18 @@ u32 rsnd_get_dalign(struct rsnd_mod *mod target = cmd ? cmd : ssiu; } +if (mod == ssiu) + id =rsnd_mod_id_sub (mod); +/* Non target mod or non 16bit needs normal DALIGN */ if ((snd_pcm_format_width (runtime->format) !=16 ) || (mod != target)) -return 0x76543210 ; + inv =0 ;/* Target mod needs inverted DALIGN when 16bit */ else -return 0x67452301 ; + inv =1 ; + +return dalign_values[id][inv]; }u32 rsnd_get_busif_shift (struct rsnd_dai_stream *io,struct rsnd_mod *mod)
Greg Kroah-Hartman
maintainerPATCH 62/203 RDMA/hns: remove a redundant le16_to_cpu
In reply to Greg Kroah-HartmanFrom: Weihang Li <[email protected]>
commit 9f7d7064009c37cb26eee4a83302cf077fe180d6 upstream.
Type of ah->av.vlan is u16, there will be a problem using le16_to_cpu on it.
--- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +1 -1
@@ -389,7 +389,7 @@ static int hns_roce_v2_post_send(structroce_set_field (ud_sq_wqe->byte_36,V2_UD_SEND_WQE_BYTE_36_VLAN_M ,V2_UD_SEND_WQE_BYTE_36_VLAN_S , -le16_to_cpu (ah->av.vlan)); + ah->av.vlan); roce_set_field(ud_sq_wqe->byte_36, V2_UD_SEND_WQE_BYTE_36_HOPLIMIT_M, V2_UD_SEND_WQE_BYTE_36_HOPLIMIT_S,
Greg Kroah-Hartman
maintainerPATCH 63/203 RDMA/hns: Modify return value of restrack functions
In reply to Greg Kroah-HartmanFrom: Lang Cheng <[email protected]>
commit cfd82da4e741c16d71a12123bf0cb585af2b8796 upstream.
The restrack function return EINVAL instead of EMSGSIZE when the driver operation fails.
--- drivers/infiniband/hw/hns/hns_roce_restrack.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/infiniband/hw/hns/hns_roce_restrack.c +1 -1
@@ -95,7 +95,7 @@ static int hns_roce_fill_res_cq_entry(st ret = hr_dev->dfx->query_cqc_info (hr_dev, hr_cq->cqn, (int *)context);if (ret) - goto err; +return -EINVAL ; table_attr =nla_nest_start (msg,RDMA_NLDEV_ATTR_DRIVER );if (!table_attr) {
Greg Kroah-Hartman
maintainerPATCH 49/203 syscalls/x86: Use the correct function type for sys_ni_syscall
In reply to Greg Kroah-HartmanFrom: Sami Tolvanen <[email protected]>
commit f48f01a92cca09e86d46c91d8edf9d5a71c61727 upstream.
Use the correct function type for sys_ni_syscall() in system call tables to fix indirect call mismatches with Control-Flow Integrity (CFI) checking.
--- arch/x86/entry/syscall_32.c | 8 +++----- arch/x86/entry/syscall_64.c | 14 ++++++++++---- arch/x86/entry/syscalls/syscall_32.tbl | 4 ++-- 3 files changed, 15 insertions(+), 11 deletions(-)
arch/x86/entry/syscall_32.c +3 -5
@@ -10,13 +10,11 @@#ifdef CONFIG_IA32_EMULATION /* On X86_64, we use struct pt_regs * to pass parameters to syscalls */ #define __SYSCALL_I386 (nr, sym, qual) extern asmlinkage long sym(const struct pt_regs *); - -/* this is a lie, but it does not hurt as sys_ni_syscall just returns -EINVAL */ -extern asmlinkage long sys_ni_syscall (const struct pt_regs *); - +#define __sys_ni_syscall __ia32_sys_ni_syscall#else /* CONFIG_IA32_EMULATION */ #define __SYSCALL_I386 (nr, sym, qual) extern asmlinkage long sym(unsigned long, unsigned long, unsigned long, unsigned long, unsigned long, unsigned long);extern asmlinkage long sys_ni_syscall (unsigned long ,unsigned long ,unsigned long ,unsigned long ,unsigned long ,unsigned long ); +#define __sys_ni_syscall sys_ni_syscall#endif /* CONFIG_IA32_EMULATION */ #include <asm/syscalls_32.h>
@@ -29,6 +27,6 @@ __visible const sys_call_ptr_t ia32_sys_* Smells like a compiler bug -- it doesn't work * when the & below is removed. */ - [0 ... __NR_syscall_compat_max] = &sys_ni_syscall, + [0 ... __NR_syscall_compat_max] = &__sys_ni_syscall,#include <asm/syscalls_32.h> };
arch/x86/entry/syscall_64.c +10 -4
@@ -4,11 +4,17 @@#include <linux/linkage.h> #include <linux/sys.h> #include <linux/cache.h> +#include <linux/syscalls.h> #include <asm/asm-offsets.h> #include <asm/syscall.h> -/* this is a lie, but it does not hurt as sys_ni_syscall just returns -EINVAL */ -extern asmlinkage long sys_ni_syscall (const struct pt_regs *); +extern asmlinkage long sys_ni_syscall (void ); + +SYSCALL_DEFINE0 (ni_syscall) +{ +return sys_ni_syscall (); +} +#define __SYSCALL_64 (nr, sym, qual) extern asmlinkage long sym(const struct pt_regs *);#define __SYSCALL_X32 (nr, sym, qual) __SYSCALL_64(nr, sym, qual)#include <asm/syscalls_64.h>
@@ -23,7 +29,7 @@ asmlinkage const sys_call_ptr_t sys_call* Smells like a compiler bug -- it doesn't work * when the & below is removed. */ - [0 ... __NR_syscall_max] = &sys_ni_syscall, + [0 ... __NR_syscall_max] = &__x64_sys_ni_syscall,#include <asm/syscalls_64.h> };
@@ -40,7 +46,7 @@ asmlinkage const sys_call_ptr_t x32_sys_* Smells like a compiler bug -- it doesn't work * when the & below is removed. */ - [0 ... __NR_syscall_x32_max] = &sys_ni_syscall, + [0 ... __NR_syscall_x32_max] = &__x64_sys_ni_syscall,#include <asm/syscalls_64.h> };
arch/x86/entry/syscalls/syscall_32.tbl +2 -2
@@ -124,7 +124,7 @@ 110 i386 iopl sys_iopl __ia32_sys_iopl 111 i386 vhangup sys_vhangup __ia32_sys_vhangup 112 i386 idle -113 i386 vm86old sys_vm86old sys_ni_syscall +113 i386 vm86old sys_vm86old __ia32_sys_ni_syscall 114 i386 wait4 sys_wait4 __ia32_compat_sys_wait4 115 i386 swapoff sys_swapoff __ia32_sys_swapoff 116 i386 sysinfo sys_sysinfo __ia32_compat_sys_sysinfo
@@ -177,7 +177,7 @@ 163 i386 mremap sys_mremap __ia32_sys_mremap 164 i386 setresuid sys_setresuid16 __ia32_sys_setresuid16 165 i386 getresuid sys_getresuid16 __ia32_sys_getresuid16 -166 i386 vm86 sys_vm86 sys_ni_syscall +166 i386 vm86 sys_vm86 __ia32_sys_ni_syscall 167 i386 query_module 168 i386 poll sys_poll __ia32_sys_poll 169 i386 nfsservctl
Greg Kroah-Hartman
maintainerPATCH 51/203 hsr: fix slab-out-of-bounds Read in hsr_debugfs_rename()
In reply to Greg Kroah-HartmanFrom: Taehee Yoo <[email protected]>
commit 04b69426d846cd04ca9acefff1ea39e1c64d2714 upstream.
hsr slave interfaces don't have debugfs directory.
So, hsr_debugfs_rename() shouldn't be called when hsr slave interface name is changed.
Test commands:
ip link add dummy0 type dummy
ip link add dummy1 type dummy
ip link add hsr0 type hsr slave1 dummy0 slave2 dummy1 ip link set dummy0 name ap
Splat looks like:
[21071.899367][T22666] ap: renamed from dummy0 [21071.914005][T22666] ================================================================== [21071.919008][T22666] BUG: KASAN: slab-out-of-bounds in hsr_debugfs_rename+0xaa/0xb0 [hsr] [21071.923640][T22666] Read of size 8 at addr ffff88805febcd98 by task ip/22666 [21071.926941][T22666] [21071.927750][T22666] CPU: 0 PID: 22666 Comm: ip Not tainted 5.5.0-rc2+ #240 [21071.929919][T22666] Hardware name: innotek GmbH VirtualBox/VirtualBox, BIOS VirtualBox 12/01/2006 [21071.935094][T22666] Call Trace: [21071.935867][T22666] dump_stack+0x96/0xdb [21071.936687][T22666] ? hsr_debugfs_rename+0xaa/0xb0 [hsr] [21071.937774][T22666] print_address_description.constprop.5+0x1be/0x360 [21071.939019][T22666] ? hsr_debugfs_rename+0xaa/0xb0 [hsr] [21071.940081][T22666] ? hsr_debugfs_rename+0xaa/0xb0 [hsr] [21071.940949][T22666] __kasan_report+0x12a/0x16f [21071.941758][T22666] ? hsr_debugfs_rename+0xaa/0xb0 [hsr] [21071.942674][T22666] kasan_report+0xe/0x20 [21071.943325][T22666] hsr_debugfs_rename+0xaa/0xb0 [hsr] [21071.944187][T22666] hsr_netdev_notify+0x1fe/0x9b0 [hsr] [21071.945052][T22666] ? __module_text_address+0x13/0x140 [21071.945897][T22666] notifier_call_chain+0x90/0x160 [21071.946743][T22666] dev_change_name+0x419/0x840 [21071.947496][T22666] ? __read_once_size_nocheck.constprop.6+0x10/0x10 [21071.948600][T22666] ? netdev_adjacent_rename_links+0x280/0x280 [21071.949577][T22666] ? __read_once_size_nocheck.constprop.6+0x10/0x10 [21071.950672][T22666] ? lock_downgrade+0x6e0/0x6e0 [21071.951345][T22666] ? do_setlink+0x811/0x2ef0 [21071.951991][T22666] do_setlink+0x811/0x2ef0 [21071.952613][T22666] ? is_bpf_text_address+0x81/0xe0
[ ... ]
--- net/hsr/hsr_main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
net/hsr/hsr_main.c +2 -1
@@ -46,7 +46,8 @@ static int hsr_netdev_notify(struct notihsr_check_carrier_and_operstate (hsr);break ;case NETDEV_CHANGENAME : -hsr_debugfs_rename (dev); +if (is_hsr_master (dev)) +hsr_debugfs_rename (dev);break ;case NETDEV_CHANGEADDR :if (port->type ==HSR_PT_MASTER ) {
Greg Kroah-Hartman
maintainerPATCH 52/203 btrfs: simplify inode locking for RWF_NOWAIT
In reply to Greg Kroah-HartmanFrom: Goldwyn Rodrigues <[email protected]>
commit 9cf35f673583ccc9f3e2507498b3079d56614ad3 upstream.
This is similar to 942491c9e6d6 ("xfs: fix AIM7 regression"). Apparently our current rwsem code doesn't like doing the trylock, then lock for real scheme. This causes extra contention on the lock and can be measured eg. by AIM7 benchmark. So change our read/write methods to just do the trylock for the RWF_NOWAIT case.
--- fs/btrfs/file.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
fs/btrfs/file.c +3 -2
@@ -1903,9 +1903,10 @@ static ssize_t btrfs_file_write_iter(str (iocb->ki_flags & IOCB_NOWAIT))return -EOPNOTSUPP ; -if (!inode_trylock (inode)) { -if (iocb->ki_flags &IOCB_NOWAIT ) +if (iocb->ki_flags &IOCB_NOWAIT ) { +if (!inode_trylock (inode))return -EAGAIN ; + }else {inode_lock (inode); }
Greg Kroah-Hartman
maintainerPATCH 54/203 netfilter: nft_meta: use 64-bit time arithmetic
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 6408c40c39d8eee5caaf97f5219b7dd4e041cc59 upstream.
On 32-bit architectures, get_seconds() returns an unsigned 32-bit time value, which also matches the type used in the nft_meta code. This will not overflow in year 2038 as a time_t would, but it still suffers from the overflow problem later on in year 2106.
Change this instance to use the time64_t type consistently and avoid the deprecated get_seconds().
The nft_meta_weekday() calculation potentially gets a little slower on 32-bit architectures, but now it has the same behavior as on 64-bit architectures and does not overflow.
--- net/netfilter/nft_meta.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
net/netfilter/nft_meta.c +5 -5
@@ -33,19 +33,19 @@ static DEFINE_PER_CPU(struct rnd_state, nft_prandom_state); -static u8 nft_meta_weekday (unsigned long secs) +static u8 nft_meta_weekday (time64_t secs) {unsigned int dse;u8 wday; secs -=NFT_META_SECS_PER_MINUTE * sys_tz.tz_minuteswest; - dse = secs /NFT_META_SECS_PER_DAY ; + dse =div_u64 (secs,NFT_META_SECS_PER_DAY ); wday = (4 + dse) %NFT_META_DAYS_PER_WEEK ;return wday; } -static u32 nft_meta_hour (unsigned long secs) +static u32 nft_meta_hour (time64_t secs) {struct tm tm;
@@ -250,10 +250,10 @@ void nft_meta_get_eval(const struct nft_nft_reg_store64 (dest,ktime_get_real_ns ());break ;case NFT_META_TIME_DAY : -nft_reg_store8 (dest,nft_meta_weekday (get_seconds ())); +nft_reg_store8 (dest,nft_meta_weekday (ktime_get_real_seconds ()));break ;case NFT_META_TIME_HOUR : - *dest =nft_meta_hour (get_seconds ()); + *dest =nft_meta_hour (ktime_get_real_seconds ());break ;default :WARN_ON (1 );
Greg Kroah-Hartman
maintainerPATCH 55/203 ASoC: dt-bindings: mt8183: add missing update
In reply to Greg Kroah-HartmanFrom: Tzung-Bi Shih <[email protected]>
commit 7cf2804775f8a388411624b3e768e55d08711e9d upstream.
Headset codec is optional. Add missing update to DT binding document.
--- Documentation/devicetree/bindings/sound/mt8183-mt6358-ts3a227-max98357.txt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
Documentation/devicetree/bindings/sound/mt8183-mt6358-ts3a227-max98357.txt +3 -1
@@ -2,9 +2,11 @@ MT8183 with MT6358, TS3A227 and MAX98357 Required properties: - compatible : "mediatek,mt8183_mt6358_ts3a227_max98357" -- mediatek,headset-codec: the phandles of ts3a227 codecs - mediatek,platform: the phandle of MT8183 ASoC platform +Optional properties: +- mediatek,headset-codec: the phandles of ts3a227 codecs + Example: sound {
Greg Kroah-Hartman
maintainerPATCH 56/203 ASoC: simple_card_utils.h: Add missing include
In reply to Greg Kroah-HartmanFrom: Daniel Baluta <[email protected]>
commit 4bbee14d8e5487e3d2662138e3767cf4678cdf57 upstream.
When debug is enabled compiler cannot find the definition of clk_get_rate resulting in the following error:
./include/sound/simple_card_utils.h:168:40: note: previous implicit declaration of ‘clk_get_rate’ was here
dev_dbg(dev, "%s clk %luHz\n", name, clk_get_rate(dai->clk));./include/sound/simple_card_utils.h:168:3: note: in expansion of macro ‘dev_dbg’
dev_dbg(dev, "%s clk %luHz\n", name, clk_get_rate(dai->clk));
Fix this by including the appropriate header.
--- include/sound/simple_card_utils.h | 1 + 1 file changed, 1 insertion(+)
include/sound/simple_card_utils.h +1 -0
@@ -8,6 +8,7 @@#ifndef __SIMPLE_CARD_UTILS_H#define __SIMPLE_CARD_UTILS_H +#include <linux/clk.h> #include <sound/soc.h> #define asoc_simple_init_hp (card, sjack, prefix) \
Greg Kroah-Hartman
maintainerPATCH 76/203 RDMA/srpt: Report the SCSI residual to the initiator
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
commit e88982ad1bb12db699de96fbc07096359ef6176c upstream.
The code added by this patch is similar to the code that already exists in ibmvscsis_determine_resid(). This patch has been tested by running the following command:
strace sg_raw -r 1k /dev/sdb 12 00 00 00 60 00 -o inquiry.bin |&
grep resid=
--- drivers/infiniband/ulp/srpt/ib_srpt.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+)
drivers/infiniband/ulp/srpt/ib_srpt.c +24 -0
@@ -1364,9 +1364,11 @@ static int srpt_build_cmd_rsp(struct srp struct srpt_send_ioctx *ioctx, u64 tag, int status) { + struct se_cmd *cmd = &ioctx->cmd;struct srp_rsp *srp_rsp;const u8 *sense_data;int sense_data_len, max_sense_len; +u32 resid = cmd->residual_count;/* * The lowest bit of all SAM-3 status codes is zero (see also
@@ -1388,6 +1390,28 @@ static int srpt_build_cmd_rsp(struct srp srp_rsp->tag = tag; srp_rsp->status = status; +if (cmd->se_cmd_flags &SCF_UNDERFLOW_BIT ) { +if (cmd->data_direction ==DMA_TO_DEVICE ) { +/* residual data from an underflow write */ + srp_rsp->flags =SRP_RSP_FLAG_DOUNDER ; + srp_rsp->data_out_res_cnt =cpu_to_be32 (resid); + }else if (cmd->data_direction ==DMA_FROM_DEVICE ) { +/* residual data from an underflow read */ + srp_rsp->flags =SRP_RSP_FLAG_DIUNDER ; + srp_rsp->data_in_res_cnt =cpu_to_be32 (resid); + } + }else if (cmd->se_cmd_flags &SCF_OVERFLOW_BIT ) { +if (cmd->data_direction ==DMA_TO_DEVICE ) { +/* residual data from an overflow write */ + srp_rsp->flags =SRP_RSP_FLAG_DOOVER ; + srp_rsp->data_out_res_cnt =cpu_to_be32 (resid); + }else if (cmd->data_direction ==DMA_FROM_DEVICE ) { +/* residual data from an overflow read */ + srp_rsp->flags =SRP_RSP_FLAG_DIOVER ; + srp_rsp->data_in_res_cnt =cpu_to_be32 (resid); + } + } +if (sense_data_len) {BUILD_BUG_ON (MIN_MAX_RSP_SIZE <=sizeof (*srp_rsp)); max_sense_len = ch->max_ti_iu_len -sizeof (*srp_rsp);
Greg Kroah-Hartman
maintainerPATCH 66/203 RDMA/hns: Fix build error again
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit d5b60e26e86a463ca83bb5ec502dda6ea685159e upstream.
This is not the first attempt to fix building random configurations, unfortunately the attempt in commit a07fc0bb483e ("RDMA/hns: Fix build error") caused a new problem when CONFIG_INFINIBAND_HNS_HIP06=m and CONFIG_INFINIBAND_HNS_HIP08=y:
drivers/infiniband/hw/hns/hns_roce_main.o:(.rodata+0xe60): undefined reference to `__this_module'
Revert commits a07fc0bb483e ("RDMA/hns: Fix build error") and a3e2d4c7e766 ("RDMA/hns: remove obsolete Kconfig comment") to get back to the previous state, then fix the issues described there differently, by adding more specific dependencies: INFINIBAND_HNS can now only be built-in if at least one of HNS or HNS3 are built-in, and the individual back-ends are only available if that code is reachable from the main driver.
--- drivers/infiniband/hw/hns/Kconfig | 17 ++++++++++++++--- drivers/infiniband/hw/hns/Makefile | 8 ++++++-- 2 files changed, 20 insertions(+), 5 deletions(-)
drivers/infiniband/hw/hns/Kconfig +14 -3
@@ -1,23 +1,34 @@ # SPDX-License-Identifier: GPL-2.0-only config INFINIBAND_HNS - bool "HNS RoCE Driver" + tristate "HNS RoCE Driver" depends on NET_VENDOR_HISILICON depends on ARM64 || (COMPILE_TEST && 64BIT) + depends on (HNS_DSAF && HNS_ENET) || HNS3 ---help--- This is a RoCE/RDMA driver for the Hisilicon RoCE engine. The engine is used in Hisilicon Hip06 and more further ICT SoC based on platform device. + To compile HIP06 or HIP08 driver as module, choose M here. + config INFINIBAND_HNS_HIP06 - tristate "Hisilicon Hip06 Family RoCE support" + bool "Hisilicon Hip06 Family RoCE support" depends on INFINIBAND_HNS && HNS && HNS_DSAF && HNS_ENET + depends on INFINIBAND_HNS=m || (HNS_DSAF=y && HNS_ENET=y) ---help--- RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip06 and Hip07 SoC. These RoCE engines are platform devices. + To compile this driver, choose Y here: if INFINIBAND_HNS is m, this + module will be called hns-roce-hw-v1 + config INFINIBAND_HNS_HIP08 - tristate "Hisilicon Hip08 Family RoCE support" + bool "Hisilicon Hip08 Family RoCE support" depends on INFINIBAND_HNS && PCI && HNS3 + depends on INFINIBAND_HNS=m || HNS3=y ---help--- RoCE driver support for Hisilicon RoCE engine in Hisilicon Hip08 SoC. The RoCE engine is a PCI device. + + To compile this driver, choose Y here: if INFINIBAND_HNS is m, this + module will be called hns-roce-hw-v2.
drivers/infiniband/hw/hns/Makefile +6 -2
@@ -9,8 +9,12 @@ hns-roce-objs := hns_roce_main.o hns_roc hns_roce_ah.o hns_roce_hem.o hns_roce_mr.o hns_roce_qp.o \ hns_roce_cq.o hns_roce_alloc.o hns_roce_db.o hns_roce_srq.o hns_roce_restrack.o +ifdef CONFIG_INFINIBAND_HNS_HIP06 hns-roce-hw-v1-objs := hns_roce_hw_v1.o $(hns-roce-objs) -obj-$(CONFIG_INFINIBAND_HNS_HIP06) += hns-roce-hw-v1.o +obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v1.o +endif +ifdef CONFIG_INFINIBAND_HNS_HIP08 hns-roce-hw-v2-objs := hns_roce_hw_v2.o hns_roce_hw_v2_dfx.o $(hns-roce-objs) -obj-$(CONFIG_INFINIBAND_HNS_HIP08) += hns-roce-hw-v2.o +obj-$(CONFIG_INFINIBAND_HNS) += hns-roce-hw-v2.o +endif
Greg Kroah-Hartman
maintainerPATCH 80/203 bpf: Support pre-2.25-binutils objcopy for vmlinux BTF
In reply to Greg Kroah-HartmanFrom: Stanislav Fomichev <[email protected]>
commit da5fb18225b49b97bb37c51bcbbb2990a507c364 upstream.
If vmlinux BTF generation fails, but CONFIG_DEBUG_INFO_BTF is set, .BTF section of vmlinux is empty and kernel will prohibit BPF loading and return "in-kernel BTF is malformed".
--dump-section argument to binutils' objcopy was added in version 2.25. When using pre-2.25 binutils, BTF generation silently fails. Convert to --only-section which is present on pre-2.25 binutils.
Documentation/process/changes.rst states that binutils 2.21+ is supported, not sure those standards apply to BPF subsystem.
v2:
* exit and print an error if gen_btf fails (John Fastabend)
v3:
* resend with Andrii's Acked-by/Tested-by tags
--- scripts/link-vmlinux.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
scripts/link-vmlinux.sh +6 -1
@@ -127,7 +127,8 @@ gen_btf() cut -d, -f1 | cut -d' ' -f2) bin_format=$(LANG=C ${OBJDUMP} -f ${1} | grep 'file format' | \ awk '{print $4}') - ${OBJCOPY} --dump-section .BTF=.btf.vmlinux.bin ${1} 2>/dev/null + ${OBJCOPY} --set-section-flags .BTF=alloc -O binary \ + --only-section=.BTF ${1} .btf.vmlinux.bin 2>/dev/null ${OBJCOPY} -I binary -O ${bin_format} -B ${bin_arch} \ --rename-section .data=.BTF .btf.vmlinux.bin ${2} }
@@ -253,6 +254,10 @@ btf_vmlinux_bin_o="" if [ -n "${CONFIG_DEBUG_INFO_BTF}" ]; then if gen_btf .tmp_vmlinux.btf .btf.vmlinux.bin.o ; then btf_vmlinux_bin_o=.btf.vmlinux.bin.o + else + echo >&2 "Failed to generate BTF for vmlinux" + echo >&2 "Try to disable CONFIG_DEBUG_INFO_BTF" + exit 1 fi fi
Greg Kroah-Hartman
maintainerPATCH 77/203 uaccess: Add non-pagefault user-space write function
In reply to Greg Kroah-HartmanFrom: Daniel Borkmann <[email protected]>
commit 1d1585ca0f48fe7ed95c3571f3e4a82b2b5045dc upstream.
Commit 3d7081822f7f ("uaccess: Add non-pagefault user-space read functions") missed to add probe write function, therefore factor out a probe_write_common() helper with most logic of probe_kernel_write() except setting KERNEL_DS, and add a new probe_user_write() helper so it can be used from BPF side.
Again, on some archs, the user address space and kernel address space can co-exist and be overlapping, so in such case, setting KERNEL_DS would mean that the given address is treated as being in kernel address space.
--- include/linux/uaccess.h | 12 ++++++++++++ mm/maccess.c | 45 +++++++++++++++++++++++++++++++++++++++++---- 2 files changed, 53 insertions(+), 4 deletions(-)
include/linux/uaccess.h +12 -0
@@ -337,6 +337,18 @@ extern long __probe_user_read(void *dst,extern long notrace probe_kernel_write (void *dst,const void *src,size_t size);extern long notrace __probe_kernel_write (void *dst,const void *src,size_t size); +/* +* probe_user_write(): safely attempt to write to a location in user space +* @dst: address to write to +* @src: pointer to the data that shall be written +* @size: size of the data chunk +* +* Safely write to address @dst from the buffer at @src. If a kernel fault +* happens, handle that and return -EFAULT. +*/ +extern long notrace probe_user_write (void __user *dst,const void *src,size_t size); +extern long notrace __probe_user_write (void __user *dst,const void *src,size_t size); +extern long strncpy_from_unsafe (char *dst,const void *unsafe_addr,long count);extern long strncpy_from_unsafe_user (char *dst,const void __user *unsafe_addr,long count);
mm/maccess.c +41 -4
68 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 81/203 libbpf: Fix Makefile libbpf symbol mismatch diagnostic
In reply to Greg Kroah-HartmanFrom: Andrii Nakryiko <[email protected]>
commit b568405856906ee4d9ba6284fd36f2928653a623 upstream.
Fix Makefile's diagnostic diff output when there is LIBBPF_API-versioned symbols mismatch.
--- tools/lib/bpf/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/lib/bpf/Makefile +1 -1
@@ -215,7 +215,7 @@ check_abi: $(OUTPUT)libbpf.so "versioned symbols in $^ ($(VERSIONED_SYM_COUNT))." \ "Please make sure all LIBBPF_API symbols are" \ "versioned in $(VERSION_SCRIPT)." >&2; \ - readelf -s --wide $(OUTPUT)libbpf-in.o | \ + readelf -s --wide $(BPF_IN_SHARED) | \ cut -d "@" -f1 | sed 's/_v[0-9]_[0-9]_[0-9].*//' | \ awk '/GLOBAL/ && /DEFAULT/ && !/UND/ {print $$8}'| \ sort -u > $(OUTPUT)libbpf_global_syms.tmp; \
Greg Kroah-Hartman
maintainerPATCH 78/203 bpf: Make use of probe_user_write in probe write helper
In reply to Greg Kroah-HartmanFrom: Daniel Borkmann <[email protected]>
commit eb1b66887472eaa7342305b7890ae510dd9d1a79 upstream.
Convert the bpf_probe_write_user() helper to probe_user_write() such that writes are not attempted under KERNEL_DS anymore which is buggy as kernel and user space pointers can have overlapping addresses. Also, given we have the access_ok() check inside probe_user_write(), the helper doesn't need to do it twice.
--- kernel/trace/bpf_trace.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-)
kernel/trace/bpf_trace.c +2 -4
@@ -163,7 +163,7 @@ static const struct bpf_func_proto bpf_p .arg3_type = ARG_ANYTHING, }; -BPF_CALL_3(bpf_probe_write_user, void *, unsafe_ptr, const void *, src, +BPF_CALL_3(bpf_probe_write_user, void __user *, unsafe_ptr, const void *, src, u32, size) {/*
@@ -186,10 +186,8 @@ BPF_CALL_3(bpf_probe_write_user, void *,return -EPERM ;if (unlikely (!nmi_uaccess_okay ()))return -EPERM ; -if (!access_ok (unsafe_ptr, size)) -return -EPERM ; -return probe_kernel_write (unsafe_ptr, src, size); +return probe_user_write (unsafe_ptr, src, size); }static const struct bpf_func_proto bpf_probe_write_user_proto = {
Greg Kroah-Hartman
maintainerPATCH 67/203 RDMA/hns: Release qp resources when failed to destroy qp
In reply to Greg Kroah-HartmanFrom: Yangyang Li <[email protected]>
commit d302c6e3a6895608a5856bc708c47bda1770b24d upstream.
Even if no response from hardware, we should make sure that qp related resources are released to avoid memory leaks.
--- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-)
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +4 -8
@@ -4650,16 +4650,14 @@ static int hns_roce_v2_destroy_qp_common {struct hns_roce_cq *send_cq, *recv_cq;struct ib_device *ibdev = &hr_dev->ib_dev; -int ret; +int ret =0 ;if (hr_qp->ibqp.qp_type ==IB_QPT_RC && hr_qp->state !=IB_QPS_RESET ) {/* Modify qp to reset before destroying qp */ ret =hns_roce_v2_modify_qp (&hr_qp->ibqp,NULL ,0 , hr_qp->state,IB_QPS_RESET ); -if (ret) { +if (ret)ibdev_err (ibdev,"modify QP to Reset failed.\n" ); -return ret; - } } send_cq =to_hr_cq (hr_qp->ibqp.send_cq);
@@ -4715,7 +4713,7 @@ static int hns_roce_v2_destroy_qp_commonkfree (hr_qp->rq_inl_buf.wqe_list); } -return 0 ; +return ret; }static int hns_roce_v2_destroy_qp (struct ib_qp *ibqp,struct ib_udata *udata)
@@ -4725,11 +4723,9 @@ static int hns_roce_v2_destroy_qp(structint ret; ret =hns_roce_v2_destroy_qp_common (hr_dev, hr_qp, udata); -if (ret) { +if (ret)ibdev_err (&hr_dev->ib_dev,"Destroy qp 0x%06lx failed(%d)\n" , hr_qp->qpn, ret); -return ret; - }if (hr_qp->ibqp.qp_type ==IB_QPT_GSI )kfree (hr_to_hr_sqp (hr_qp));
Greg Kroah-Hartman
maintainerPATCH 71/203 xprtrdma: Close window between waking RPC senders and posting Receives
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
commit 2ae50ad68cd79224198b525f7bd645c9da98b6ff upstream.
A recent clean up attempted to separate Receive handling and RPC Reply processing, in the name of clean layering.
Unfortunately, we can't do this because the Receive Queue has to be refilled _after_ the most recent credit update from the responder is parsed from the transport header, but _before_ we wake up the next RPC sender. That is right in the middle of rpcrdma_reply_handler().
Usually this isn't a problem because current responder implementations don't vary their credit grant. The one exception is when a connection is established: the grant goes from one to a much larger number on the first Receive. The requester MUST post enough Receives right then so that any outstanding requests can be sent without risking RNR and connection loss.
--- net/sunrpc/xprtrdma/rpc_rdma.c | 1 + net/sunrpc/xprtrdma/verbs.c | 11 +++++++---- net/sunrpc/xprtrdma/xprt_rdma.h | 1 + 3 files changed, 9 insertions(+), 4 deletions(-)
net/sunrpc/xprtrdma/rpc_rdma.c +1 -0
@@ -1362,6 +1362,7 @@ void rpcrdma_reply_handler(struct rpcrdm xprt->cwnd = credits <<RPC_CWNDSHIFT ;spin_unlock (&xprt->transport_lock); } +rpcrdma_post_recvs (r_xprt, false); req =rpcr_to_rdmar (rqst);if (req->rl_reply) {
net/sunrpc/xprtrdma/verbs.c +7 -4
@@ -84,7 +84,6 @@ rpcrdma_regbuf_alloc(size_t size, enum d gfp_t flags);static void rpcrdma_regbuf_dma_unmap (struct rpcrdma_regbuf *rb);static void rpcrdma_regbuf_free (struct rpcrdma_regbuf *rb); -static void rpcrdma_post_recvs (struct rpcrdma_xprt *r_xprt,bool temp);/* Wait for outstanding transport work to finish. ib_drain_qp * handles the drains in the wrong order for us, so open code
@@ -170,7 +169,6 @@ rpcrdma_wc_receive(struct ib_cq *cq, strrdmab_addr (rep->rr_rdmabuf), wc->byte_len, DMA_FROM_DEVICE); -rpcrdma_post_recvs (r_xprt, false);rpcrdma_reply_handler (rep);return ;
@@ -1478,8 +1476,13 @@ rpcrdma_ep_post(struct rpcrdma_ia *ia,return 0 ; } -static void -rpcrdma_post_recvs (struct rpcrdma_xprt *r_xprt,bool temp) +/** +* rpcrdma_post_recvs - Refill the Receive Queue +* @r_xprt: controlling transport instance +* @temp: mark Receive buffers to be deleted after use +* +*/ +void rpcrdma_post_recvs (struct rpcrdma_xprt *r_xprt,bool temp) {struct rpcrdma_buffer *buf = &r_xprt->rx_buf;struct rpcrdma_ep *ep = &r_xprt->rx_ep;
net/sunrpc/xprtrdma/xprt_rdma.h +1 -0
@@ -474,6 +474,7 @@ void rpcrdma_ep_disconnect(struct rpcrdmint rpcrdma_ep_post (struct rpcrdma_ia *,struct rpcrdma_ep *,struct rpcrdma_req *); +void rpcrdma_post_recvs (struct rpcrdma_xprt *r_xprt,bool temp);/* * Buffer calls - xprtrdma/verbs.c
Greg Kroah-Hartman
maintainerPATCH 68/203 xprtrdma: Add unique trace points for posting Local Invalidate WRs
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
commit 4b93dab36f28e673725e5e6123ebfccf7697f96a upstream.
When adding frwr_unmap_async way back when, I re-used the existing trace_xprtrdma_post_send() trace point to record the return code of ib_post_send.
Unfortunately there are some cases where re-using that trace point causes a crash. Instead, construct a trace point specific to posting Local Invalidate WRs that will always be safe to use in that context, and will act as a trace log eye-catcher for Local Invalidation.
--- include/trace/events/rpcrdma.h | 25 +++++++++++++++++++++++++ net/sunrpc/xprtrdma/frwr_ops.c | 4 ++-- 2 files changed, 27 insertions(+), 2 deletions(-)
include/trace/events/rpcrdma.h +25 -0
@@ -735,6 +735,31 @@ TRACE_EVENT(xprtrdma_post_recvs, ) ); +TRACE_EVENT (xprtrdma_post_linv, +TP_PROTO ( + const struct rpcrdma_req *req, + int status + ), + +TP_ARGS (req, status), + +TP_STRUCT__entry ( + __field(const void *, req) + __field(int, status) +__field (u32, xid) + ), + +TP_fast_assign ( + __entry->req = req; + __entry->status = status; + __entry->xid = be32_to_cpu(req->rl_slot.rq_xid); + ), + +TP_printk ("req=%p xid=0x%08x status=%d" , + __entry->req, __entry->xid, __entry->status + ) +); +/** ** Completion events **/
net/sunrpc/xprtrdma/frwr_ops.c +2 -2
@@ -570,7 +570,6 @@ void frwr_unmap_sync(struct rpcrdma_xprt*/ bad_wr =NULL ; rc =ib_post_send (r_xprt->rx_ia.ri_id->qp, first, &bad_wr); -trace_xprtrdma_post_send (req, rc);/* The final LOCAL_INV WR in the chain is supposed to * do the wake. If it was never posted, the wake will
@@ -583,6 +582,7 @@ void frwr_unmap_sync(struct rpcrdma_xprt/* Recycle MRs in the LOCAL_INV chain that did not get posted. */ +trace_xprtrdma_post_linv (req, rc);while (bad_wr) { frwr = container_of(bad_wr, struct rpcrdma_frwr, fr_invwr);
@@ -673,12 +673,12 @@ void frwr_unmap_async(struct rpcrdma_xpr*/ bad_wr =NULL ; rc =ib_post_send (r_xprt->rx_ia.ri_id->qp, first, &bad_wr); -trace_xprtrdma_post_send (req, rc);if (!rc)return ;/* Recycle MRs in the LOCAL_INV chain that did not get posted. */ +trace_xprtrdma_post_linv (req, rc);while (bad_wr) { frwr = container_of(bad_wr, struct rpcrdma_frwr, fr_invwr); mr = container_of(frwr, struct rpcrdma_mr, frwr);
Greg Kroah-Hartman
maintainerPATCH 74/203 rdma: Remove nes ABI header
In reply to Greg Kroah-HartmanFrom: Jason Gunthorpe <[email protected]>
commit 949b452f9cfef17e78055239f978d95ba729eee1 upstream.
This was missed when nes was removed.
--- include/uapi/rdma/nes-abi.h | 115 -------------------------------------------- 1 file changed, 115 deletions(-)
include/uapi/rdma/nes-abi.h deleted +0 -115
@@ -1,115 +0,0 @@ -/* SPDX-License-Identifier: ((GPL-2.0 WITH Linux-syscall-note) OR Linux-OpenIB) */ -/* -* Copyright (c) 2006 - 2011 Intel Corporation. All rights reserved. -* Copyright (c) 2005 Topspin Communications. All rights reserved. -* Copyright (c) 2005 Cisco Systems. All rights reserved. -* Copyright (c) 2005 Open Grid Computing, Inc. All rights reserved. -* -* This software is available to you under a choice of one of two -* licenses. You may choose to be licensed under the terms of the GNU -* General Public License (GPL) Version 2, available from the file -* COPYING in the main directory of this source tree, or the -* OpenIB.org BSD license below: -* -* Redistribution and use in source and binary forms, with or -* without modification, are permitted provided that the following -* conditions are met: -* -* - Redistributions of source code must retain the above -* copyright notice, this list of conditions and the following -* disclaimer. -* -* - Redistributions in binary form must reproduce the above -* copyright notice, this list of conditions and the following -* disclaimer in the documentation and/or other materials -* provided with the distribution. -* -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -* EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -* NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -* BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -* ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -* SOFTWARE. -* -*/ - -#ifndef NES_ABI_USER_H -#define NES_ABI_USER_H - -#include <linux/types.h> - -#define NES_ABI_USERSPACE_VER 2 -#define NES_ABI_KERNEL_VER 2 - -/* -* Make sure that all structs defined in this file remain laid out so -* that they pack the same way on 32-bit and 64-bit architectures (to -* avoid incompatibility between 32-bit userspace and 64-bit kernels). -* In particular do not use pointer types -- pass pointers in __u64 -* instead. -*/ - -struct nes_alloc_ucontext_req { -__u32 reserved32; -__u8 userspace_ver; -__u8 reserved8[3 ]; -}; - -struct nes_alloc_ucontext_resp { -__u32 max_pds;/* maximum pds allowed for this user process */ -__u32 max_qps;/* maximum qps allowed for this user process */ -__u32 wq_size;/* size of the WQs (sq+rq) allocated to the mmaped area */ -__u8 virtwq;/* flag to indicate if virtual WQ are to be used or not */ -__u8 kernel_ver; -__u8 reserved[2 ]; -}; - -struct nes_alloc_pd_resp { -__u32 pd_id; -__u32 mmap_db_index; -}; - -struct nes_create_cq_req { -__aligned_u64 user_cq_buffer; -__u32 mcrqf; -__u8 reserved[4 ]; -}; - -struct nes_create_qp_req { -__aligned_u64 user_wqe_buffers; -__aligned_u64 user_qp_buffer; -}; - -enum iwnes_memreg_type { -IWNES_MEMREG_TYPE_MEM =0x0000 , -IWNES_MEMREG_TYPE_QP =0x0001 , -IWNES_MEMREG_TYPE_CQ =0x0002 , -IWNES_MEMREG_TYPE_MW =0x0003 , -IWNES_MEMREG_TYPE_FMR =0x0004 , -IWNES_MEMREG_TYPE_FMEM =0x0005 , -}; - -struct nes_mem_reg_req { -__u32 reg_type;/* indicates if id is memory, QP or CQ */ -__u32 reserved; -}; - -struct nes_create_cq_resp { -__u32 cq_id; -__u32 cq_size; -__u32 mmap_db_index; -__u32 reserved; -}; - -struct nes_create_qp_resp { -__u32 qp_id; -__u32 actual_sq_size; -__u32 actual_rq_size; -__u32 mmap_sq_db_index; -__u32 mmap_rq_db_index; -__u32 nes_drv_opt; -}; - -#endif /* NES_ABI_USER_H */
Greg Kroah-Hartman
maintainerPATCH 72/203 RDMA/hns: Fix to support 64K page for srq
In reply to Greg Kroah-HartmanFrom: Lijun Ou <[email protected]>
commit 5c7e76fb7cb5071be800c938ebf2c475e140d3f0 upstream.
SRQ's page size configuration of BA and buffer should depend on current PAGE_SHIFT, or it can't work in scenario of 64K page.
--- drivers/infiniband/hw/hns/hns_roce_hw_v2.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/infiniband/hw/hns/hns_roce_hw_v2.c +2 -2
@@ -6088,11 +6088,11 @@ static void hns_roce_v2_write_srqc(strucroce_set_field (srq_context->byte_44_idxbufpgsz_addr,SRQC_BYTE_44_SRQ_IDX_BA_PG_SZ_M ,SRQC_BYTE_44_SRQ_IDX_BA_PG_SZ_S , - hr_dev->caps.idx_ba_pg_sz); + hr_dev->caps.idx_ba_pg_sz +PG_SHIFT_OFFSET );roce_set_field (srq_context->byte_44_idxbufpgsz_addr,SRQC_BYTE_44_SRQ_IDX_BUF_PG_SZ_M ,SRQC_BYTE_44_SRQ_IDX_BUF_PG_SZ_S , - hr_dev->caps.idx_buf_pg_sz); + hr_dev->caps.idx_buf_pg_sz +PG_SHIFT_OFFSET ); srq_context->idx_nxt_blk_addr =cpu_to_le32 (mtts_idx[1 ] >>PAGE_ADDR_SHIFT );
Greg Kroah-Hartman
maintainerPATCH 65/203 RDMA/siw: Fix port number endianness in a debug message
In reply to Greg Kroah-HartmanFrom: Bart Van Assche <[email protected]>
commit 050dbddf249eee3e936b5734c30b2e1b427efdc3 upstream.
sin_port and sin6_port are big endian member variables. Convert these port numbers into CPU endianness before printing.
--- drivers/infiniband/sw/siw/siw_cm.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-)
drivers/infiniband/sw/siw/siw_cm.c +1 -8
@@ -1867,14 +1867,7 @@ static int siw_listen_address(struct iw_list_add_tail (&cep->listenq, (struct list_head *)id->provider_data); cep->state =SIW_EPSTATE_LISTENING ; -if (addr_family ==AF_INET ) -siw_dbg (id->device,"Listen at laddr %pI4 %u\n" , - &(((struct sockaddr_in *)laddr)->sin_addr), - ((struct sockaddr_in *)laddr)->sin_port); -else -siw_dbg (id->device,"Listen at laddr %pI6 %u\n" , - &(((struct sockaddr_in6 *)laddr)->sin6_addr), - ((struct sockaddr_in6 *)laddr)->sin6_port); +siw_dbg (id->device,"Listen at laddr %pISp\n" , laddr);return 0 ;
Greg Kroah-Hartman
maintainerPATCH 93/203 xprtrdma: Fix create_qp crash on device unload
In reply to Greg Kroah-HartmanFrom: Chuck Lever <[email protected]>
commit b32b9ed493f938e191f790a0991d20b18b38c35b upstream.
On device re-insertion, the RDMA device driver crashes trying to set up a new QP:
Nov 27 16:32:06 manet kernel: BUG: kernel NULL pointer dereference, address: 00000000000001c0 Nov 27 16:32:06 manet kernel: #PF: supervisor write access in kernel mode Nov 27 16:32:06 manet kernel: #PF: error_code(0x0002) - not-present page Nov 27 16:32:06 manet kernel: PGD 0 P4D 0 Nov 27 16:32:06 manet kernel: Oops: 0002 [#1] SMP Nov 27 16:32:06 manet kernel: CPU: 1 PID: 345 Comm: kworker/u28:0 Tainted: G W 5.4.0 #852 Nov 27 16:32:06 manet kernel: Hardware name: Supermicro SYS-6028R-T/X10DRi, BIOS 1.1a 10/16/2015 Nov 27 16:32:06 manet kernel: Workqueue: xprtiod xprt_rdma_connect_worker [rpcrdma] Nov 27 16:32:06 manet kernel: RIP: 0010:atomic_try_cmpxchg+0x2/0x12 Nov 27 16:32:06 manet kernel: Code: ff ff 48 8b 04 24 5a c3 c6 07 00 0f 1f 40 00 c3 31 c0 48 81 ff 08 09 68 81 72 0c 31 c0 48 81 ff 83 0c 68 81 0f 92 c0 c3 8b 06 <f0> 0f b1 17 0f 94 c2 84 d2 75 02 89 06 88 d0 c3 53 ba 01 00 00 00 Nov 27 16:32:06 manet kernel: RSP: 0018:ffffc900035abbf0 EFLAGS: 00010046 Nov 27 16:32:06 manet kernel: RAX: 0000000000000000 RBX: 00000000000001c0 RCX: 0000000000000000 Nov 27 16:32:06 manet kernel: RDX: 0000000000000001 RSI: ffffc900035abbfc RDI: 00000000000001c0 Nov 27 16:32:06 manet kernel: RBP: ffffc900035abde0 R08: 000000000000000e R09: ffffffffffffc000 Nov 27 16:32:06 manet kernel: R10: 0000000000000000 R11: 000000000002e800 R12: ffff88886169d9f8 Nov 27 16:32:06 manet kernel: R13: ffff88886169d9f4 R14: 0000000000000246 R15: 0000000000000000 Nov 27 16:32:06 manet kernel: FS: 0000000000000000(0000) GS:ffff88846fa40000(0000) knlGS:0000000000000000 Nov 27 16:32:06 manet kernel: CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 Nov 27 16:32:06 manet kernel: CR2: 00000000000001c0 CR3: 0000000002009006 CR4: 00000000001606e0 Nov 27 16:32:06 manet kernel: Call Trace: Nov 27 16:32:06 manet kernel: do_raw_spin_lock+0x2f/0x5a Nov 27 16:32:06 manet kernel: create_qp_common.isra.47+0x856/0xadf [mlx4_ib] Nov 27 16:32:06 manet kernel: ? slab_post_alloc_hook.isra.60+0xa/0x1a Nov 27 16:32:06 manet kernel: ? __kmalloc+0x125/0x139 Nov 27 16:32:06 manet kernel: mlx4_ib_create_qp+0x57f/0x972 [mlx4_ib]
The fix is to copy the qp_init_attr struct that was just created by rpcrdma_ep_create() instead of using the one from the previous connection instance.
--- net/sunrpc/xprtrdma/verbs.c | 2 ++ 1 file changed, 2 insertions(+)
net/sunrpc/xprtrdma/verbs.c +2 -0
@@ -607,6 +607,7 @@ static int rpcrdma_ep_recreate_xprt(stru struct ib_qp_init_attr *qp_init_attr) {struct rpcrdma_ia *ia = &r_xprt->rx_ia; +struct rpcrdma_ep *ep = &r_xprt->rx_ep;int rc, err;trace_xprtrdma_reinsert (r_xprt);
@@ -621,6 +622,7 @@ static int rpcrdma_ep_recreate_xprt(strupr_err ("rpcrdma: rpcrdma_ep_create returned %d\n" , err); goto out2; } +memcpy (qp_init_attr, &ep->rep_attr,sizeof (*qp_init_attr)); rc = -ENETUNREACH ; err =rdma_create_qp (ia->ri_id, ia->ri_pd, qp_init_attr);
Greg Kroah-Hartman
maintainerPATCH 97/203 scsi: ufs: Give an unique ID to each ufs-bsg
In reply to Greg Kroah-HartmanFrom: Can Guo <[email protected]>
commit 8c850a0296004409e7bcb9464712fb2807da656a upstream.
Considering there can be multiple UFS hosts in SoC, give each ufs-bsg an unique ID by appending the scsi host number to its device name.
--- drivers/scsi/ufs/ufs_bsg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/scsi/ufs/ufs_bsg.c +1 -1
@@ -202,7 +202,7 @@ int ufs_bsg_probe(struct ufs_hba *hba) bsg_dev->parent =get_device (parent); bsg_dev->release = ufs_bsg_node_release; -dev_set_name (bsg_dev,"ufs-bsg" ); +dev_set_name (bsg_dev,"ufs-bsg%u" , shost->host_no); ret =device_add (bsg_dev);if (ret)
Greg Kroah-Hartman
maintainerPATCH 98/203 crypto: cavium/nitrox - fix firmware assignment to AE cores
In reply to Greg Kroah-HartmanFrom: Phani Kiran Hemadri <[email protected]>
commit 6a97a99db848748d582d79447f7c9c330ce1688e upstream.
This patch fixes assigning UCD block number of Asymmetric crypto firmware to AE cores of CNN55XX device.
--- drivers/crypto/cavium/nitrox/nitrox_main.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-)
drivers/crypto/cavium/nitrox/nitrox_main.c +4 -5
@@ -103,8 +103,7 @@ static void write_to_ucd_unit(struct nit offset =UCD_UCODE_LOAD_BLOCK_NUM ;nitrox_write_csr (ndev, offset, block_num); - code_size = ucode_size; - code_size =roundup (code_size,8 ); + code_size =roundup (ucode_size,16 );while (code_size) { data = ucode_data[i];/* write 8 bytes at a time */
@@ -220,11 +219,11 @@ static int nitrox_load_fw(struct nitrox_/* write block number and firmware length * bit:<2:0> block number -* bit:3 is set SE uses 32KB microcode -* bit:3 is clear SE uses 64KB microcode +* bit:3 is set AE uses 32KB microcode +* bit:3 is clear AE uses 64KB microcode */ core_2_eid_val.value =0ULL ; - core_2_eid_val.ucode_blk =0 ; + core_2_eid_val.ucode_blk =2 ;if (ucode_size <=CNN55XX_UCD_BLOCK_SIZE ) core_2_eid_val.ucode_len =1 ;else
Greg Kroah-Hartman
maintainerPATCH 100/203 crypto: arm64/aes-neonbs - add return value of skcipher_walk_done() in __xts_crypt()
In reply to Greg Kroah-HartmanFrom: Yunfeng Ye <[email protected]>
commit 9b537997b669c42cec67893538037e8d1c83c91c upstream.
A warning is found by the static code analysis tool:
"Identical condition 'err', second condition is always false"
Fix this by adding return value of skcipher_walk_done().
--- arch/arm64/crypto/aes-neonbs-glue.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/crypto/aes-neonbs-glue.c +1 -1
@@ -384,7 +384,7 @@ static int __xts_crypt(struct skcipher_r goto xts_tail;kernel_neon_end (); -skcipher_walk_done (&walk, nbytes); + err =skcipher_walk_done (&walk, nbytes); }if (err ||likely (!tail))
Greg Kroah-Hartman
maintainerPATCH 85/203 scsi: enclosure: Fix stale device oops with hot replug
In reply to Greg Kroah-HartmanFrom: James Bottomley <[email protected]>
commit 529244bd1afc102ab164429d338d310d5d65e60d upstream.
Doing an add/remove/add on a SCSI device in an enclosure leads to an oops caused by poisoned values in the enclosure device list pointers. The reason is because we are keeping the enclosure device across the enclosed device add/remove/add but the current code is doing a device_add/device_del/device_add on it. This is the wrong thing to do in sysfs, so fix it by not doing a device_del on the enclosure device simply because of a hot remove of the drive in the slot.
[mkp: added missing email addresses]
--- drivers/misc/enclosure.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/misc/enclosure.c +1 -2
@@ -406,10 +406,9 @@ int enclosure_remove_device(struct enclo cdev = &edev->component[i];if (cdev->dev == dev) {enclosure_remove_links (cdev); -device_del (&cdev->cdev);put_device (dev); cdev->dev =NULL ; -return device_add (&cdev->cdev); +return 0 ; } }return -ENODEV ;
Greg Kroah-Hartman
maintainerPATCH 86/203 scsi: sd: Clear sdkp->protection_type if disk is reformatted without PI
In reply to Greg Kroah-HartmanFrom: Xiang Chen <[email protected]>
commit 465f4edaecc6c37f81349233e84d46246bcac11a upstream.
If an attached disk with protection information enabled is reformatted to Type 0 the revalidation code does not clear the original protection type and subsequent accesses will keep setting RDPROTECT/WRPROTECT.
Set the protection type to 0 if the disk reports PROT_EN=0 in READ CAPACITY(16).
[mkp: commit desc]
--- drivers/scsi/sd.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/scsi/sd.c +3 -1
@@ -2192,8 +2192,10 @@ static int sd_read_protection_type(strucu8 type;int ret =0 ; -if (scsi_device_protection (sdp) ==0 || (buffer[12 ] &1 ) ==0 ) +if (scsi_device_protection (sdp) ==0 || (buffer[12 ] &1 ) ==0 ) { + sdkp->protection_type =0 ;return ret; + } type = ((buffer[12 ] >>1 ) &7 ) +1 ;/* P_TYPE 0 = Type 1 */
Greg Kroah-Hartman
maintainerPATCH 88/203 platform/x86: asus-wmi: Fix keyboard brightness cannot be set to 0
In reply to Greg Kroah-HartmanFrom: Jian-Hong Pan <[email protected]>
commit 176a7fca81c5090a7240664e3002c106d296bf31 upstream.
Some of ASUS laptops like UX431FL keyboard backlight cannot be set to brightness 0. According to ASUS' information, the brightness should be 0x80 ~ 0x83. This patch fixes it by following the logic.
--- drivers/platform/x86/asus-wmi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-)
drivers/platform/x86/asus-wmi.c +1 -7
@@ -512,13 +512,7 @@ static void kbd_led_update(struct asus_w {int ctrl_param =0 ; -/* -* bits 0-2: level -* bit 7: light on/off -*/ -if (asus->kbd_led_wk >0 ) - ctrl_param =0x80 | (asus->kbd_led_wk &0x7F ); - + ctrl_param =0x80 | (asus->kbd_led_wk &0x7F );asus_wmi_set_devstate (ASUS_WMI_DEVID_KBD_BACKLIGHT , ctrl_param,NULL ); }
Greg Kroah-Hartman
maintainerPATCH 89/203 platform/x86: GPD pocket fan: Use default values when wrong modparams are given
In reply to Greg Kroah-HartmanFrom: Hans de Goede <[email protected]>
commit 6ae01050e49f0080ae30575d9b45a6d4a3d7ee23 upstream.
Use our default values when wrong module-parameters are given, instead of refusing to load. Refusing to load leaves the fan at the BIOS default setting, which is "Off". The CPU's thermal throttling should protect the system from damage, but not-loading is really not the best fallback in this case.
This commit fixes this by re-setting module-parameter values to their defaults if they are out of range, instead of failing the probe with -EINVAL.
--- drivers/platform/x86/gpd-pocket-fan.c | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-)
drivers/platform/x86/gpd-pocket-fan.c +19 -6
@@ -16,17 +16,27 @@#define MAX_SPEED 3 -static int temp_limits[3 ] = {55000 ,60000 ,65000 }; +#define TEMP_LIMIT0_DEFAULT 55000 +#define TEMP_LIMIT1_DEFAULT 60000 +#define TEMP_LIMIT2_DEFAULT 65000 + +#define HYSTERESIS_DEFAULT 3000 + +#define SPEED_ON_AC_DEFAULT 2 + +static int temp_limits[3 ] = { +TEMP_LIMIT0_DEFAULT ,TEMP_LIMIT1_DEFAULT ,TEMP_LIMIT2_DEFAULT , +};module_param_array (temp_limits, int,NULL ,0444 );MODULE_PARM_DESC (temp_limits,"Millicelsius values above which the fan speed increases" ); -static int hysteresis =3000 ; +static int hysteresis =HYSTERESIS_DEFAULT ;module_param (hysteresis, int,0444 );MODULE_PARM_DESC (hysteresis,"Hysteresis in millicelsius before lowering the fan speed" ); -static int speed_on_ac =2 ; +static int speed_on_ac =SPEED_ON_AC_DEFAULT ;module_param (speed_on_ac, int,0444 );MODULE_PARM_DESC (speed_on_ac,"minimum fan speed to allow when system is powered by AC" );
@@ -120,18 +130,21 @@ static int gpd_pocket_fan_probe(struct pif (temp_limits[i] <40000 || temp_limits[i] >70000 ) {dev_err (&pdev->dev,"Invalid temp-limit %d (must be between 40000 and 70000)\n" , temp_limits[i]); -return -EINVAL ; + temp_limits[0 ] =TEMP_LIMIT0_DEFAULT ; + temp_limits[1 ] =TEMP_LIMIT1_DEFAULT ; + temp_limits[2 ] =TEMP_LIMIT2_DEFAULT ; +break ; } }if (hysteresis <1000 || hysteresis >10000 ) {dev_err (&pdev->dev,"Invalid hysteresis %d (must be between 1000 and 10000)\n" , hysteresis); -return -EINVAL ; + hysteresis =HYSTERESIS_DEFAULT ; }if (speed_on_ac <0 || speed_on_ac >MAX_SPEED ) {dev_err (&pdev->dev,"Invalid speed_on_ac %d (must be between 0 and 3)\n" , speed_on_ac); -return -EINVAL ; + speed_on_ac =SPEED_ON_AC_DEFAULT ; } fan =devm_kzalloc (&pdev->dev,sizeof (*fan),GFP_KERNEL );
Greg Kroah-Hartman
maintainerPATCH 90/203 asm-generic/nds32: dont redefine cacheflush primitives
In reply to Greg Kroah-HartmanFrom: Mike Rapoport <[email protected]>
commit 4f0bd808134d73184054ad09173821c84f31dd5d upstream.
The commit c296d4dc13ae ("asm-generic: fix a compilation warning") changed asm-generic/cachflush.h to use static inlines instead of macros and as a result the nds32 build with CONFIG_CPU_CACHE_ALIASING=n fails:
CC init/main.o
In file included from arch/nds32/include/asm/cacheflush.h:43,
from include/linux/highmem.h:12,
from include/linux/pagemap.h:11,
from include/linux/blkdev.h:16,
from include/linux/blk-cgroup.h:23,
from include/linux/writeback.h:14,
from init/main.c:44:
include/asm-generic/cacheflush.h:50:20: error: static declaration of 'flush_icache_range' follows non-static declaration
static inline void flush_icache_range(unsigned long start, unsigned long end)
^~~~~~~~~~~~~~~~~~
In file included from include/linux/highmem.h:12,
from include/linux/pagemap.h:11,
from include/linux/blkdev.h:16,
from include/linux/blk-cgroup.h:23,
from include/linux/writeback.h:14,
from init/main.c:44:
arch/nds32/include/asm/cacheflush.h:11:6: note: previous declaration of 'flush_icache_range' was here
void flush_icache_range(unsigned long start, unsigned long end);
^~~~~~~~~~~~~~~~~~Surround the inline functions in asm-generic/cacheflush.h by ifdef's so that architectures could override them and add the required overrides to nds32.
--- arch/nds32/include/asm/cacheflush.h | 11 +++++++---- include/asm-generic/cacheflush.h | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 39 insertions(+), 5 deletions(-)
arch/nds32/include/asm/cacheflush.h +7 -4
@@ -9,7 +9,11 @@#define PG_dcache_dirty PG_arch_1void flush_icache_range (unsigned long start,unsigned long end); +#define flush_icache_range flush_icache_range +void flush_icache_page (struct vm_area_struct *vma,struct page *page); +#define flush_icache_page flush_icache_page +#ifdef CONFIG_CPU_CACHE_ALIASING void flush_cache_mm (struct mm_struct *mm);void flush_cache_dup_mm (struct mm_struct *mm);
@@ -40,12 +44,11 @@ void invalidate_kernel_vmap_range(void *#define flush_dcache_mmap_unlock (mapping) xa_unlock_irq(&(mapping)->i_pages)#else -#include <asm-generic/cacheflush.h> -#undef flush_icache_range -#undef flush_icache_page -#undef flush_icache_user_rangevoid flush_icache_user_range (struct vm_area_struct *vma,struct page *page,unsigned long addr,int len); +#define flush_icache_user_range flush_icache_user_range + +#include <asm-generic/cacheflush.h> #endif #endif /* __NDS32_CACHEFLUSH_H__ */
include/asm-generic/cacheflush.h +32 -1
@@ -11,71 +11,102 @@* The cache doesn't need to be flushed when TLB entries change when * the cache is mapped to physical memory, not virtual memory */ +#ifndef flush_cache_allstatic inline void flush_cache_all (void ) { } +#endif +#ifndef flush_cache_mmstatic inline void flush_cache_mm (struct mm_struct *mm) { } +#endif +#ifndef flush_cache_dup_mmstatic inline void flush_cache_dup_mm (struct mm_struct *mm) { } +#endif +#ifndef flush_cache_rangestatic inline void flush_cache_range (struct vm_area_struct *vma,unsigned long start,unsigned long end) { } +#endif +#ifndef flush_cache_pagestatic inline void flush_cache_page (struct vm_area_struct *vma,unsigned long vmaddr,unsigned long pfn) { } +#endif +#ifndef flush_dcache_pagestatic inline void flush_dcache_page (struct page *page) { } +#endif +#ifndef flush_dcache_mmap_lockstatic inline void flush_dcache_mmap_lock (struct address_space *mapping) { } +#endif +#ifndef flush_dcache_mmap_unlockstatic inline void flush_dcache_mmap_unlock (struct address_space *mapping) { } +#endif +#ifndef flush_icache_rangestatic inline void flush_icache_range (unsigned long start,unsigned long end) { } +#endif +#ifndef flush_icache_pagestatic inline void flush_icache_page (struct vm_area_struct *vma,struct page *page) { } +#endif +#ifndef flush_icache_user_rangestatic inline void flush_icache_user_range (struct vm_area_struct *vma,struct page *page,unsigned long addr,int len) { } +#endif +#ifndef flush_cache_vmapstatic inline void flush_cache_vmap (unsigned long start,unsigned long end) { } +#endif +#ifndef flush_cache_vunmapstatic inline void flush_cache_vunmap (unsigned long start,unsigned long end) { } +#endif -#define copy_to_user_page (vma, page, vaddr, dst, src, len) \ +#ifndef copy_to_user_page +#define copy_to_user_page (vma, page, vaddr, dst, src, len) \ do { \ memcpy(dst, src, len); \ flush_icache_user_range(vma, page, vaddr, len); \ } while (0) +#endif + +#ifndef copy_from_user_page#define copy_from_user_page (vma, page, vaddr, dst, src, len) \ memcpy(dst, src, len) +#endif #endif /* __ASM_CACHEFLUSH_H */
Greg Kroah-Hartman
maintainerPATCH 92/203 Documentation/ABI: Add missed attribute for mlxreg-io sysfs interfaces
In reply to Greg Kroah-HartmanFrom: Vadim Pasternak <[email protected]>
commit f3efc406d67e6236b513c4302133b0c9be74fd99 upstream.
Add missed "cpld4_version" attribute.
--- Documentation/ABI/stable/sysfs-driver-mlxreg-io | 9 +++++++++ 1 file changed, 9 insertions(+)
Documentation/ABI/stable/sysfs-driver-mlxreg-io +9 -0
@@ -121,6 +121,15 @@ Description: These files show the system The files are read only. +What: /sys/devices/platform/mlxplat/mlxreg-io/hwmon/hwmon*/cpld4_version +Date: November 2018 +KernelVersion: 5.0 +Contact: Vadim Pasternak <vadimpmellanox.com> +Description: These files show with which CPLD versions have been burned + on LED board. + + The files are read only. + Date: June 2019 KernelVersion: 5.3 Contact: Vadim Pasternak <vadimpmellanox.com>
Greg Kroah-Hartman
maintainerPATCH 83/203 afs: Fix afs_lookup() to not clobber the version on a new dentry
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
commit f52b83b0b1c40ada38df917973ab719a4a753951 upstream.
Fix afs_lookup() to not clobber the version set on a new dentry by afs_do_lookup() - especially as it's using the wrong version of the version (we need to use the one given to us by whatever op the dir contents correspond to rather than what's in the afs_vnode).
--- fs/afs/dir.c | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-)
fs/afs/dir.c +1 -5
@@ -952,12 +952,8 @@ static struct dentry *afs_lookup(structafs_stat_v (dvnode, n_lookup); inode =afs_do_lookup (dir, dentry, key);key_put (key); -if (inode ==ERR_PTR (-ENOENT )) { +if (inode ==ERR_PTR (-ENOENT )) inode =afs_try_auto_mntpt (dentry, dir); - }else { - dentry->d_fsdata = - (void *)(unsigned long )dvnode->status.data_version; - }if (!IS_ERR_OR_NULL (inode)) fid =AFS_FS_I (inode)->fid;
Greg Kroah-Hartman
maintainerPATCH 102/203 crypto: algif_skcipher - Use chunksize instead of blocksize
In reply to Greg Kroah-HartmanFrom: Herbert Xu <[email protected]>
commit 5b0fe9552336338acb52756daf65dd7a4eeca73f upstream.
When algif_skcipher does a partial operation it always process data that is a multiple of blocksize. However, for algorithms such as CTR this is wrong because even though it can process any number of bytes overall, the partial block must come at the very end and not in the middle.
This is exactly what chunksize is meant to describe so this patch changes blocksize to chunksize.
--- crypto/algif_skcipher.c | 2 +- include/crypto/internal/skcipher.h | 30 ------------------------------ include/crypto/skcipher.h | 30 ++++++++++++++++++++++++++++++ 3 files changed, 31 insertions(+), 31 deletions(-)
crypto/algif_skcipher.c +1 -1
@@ -56,7 +56,7 @@ static int _skcipher_recvmsg(struct sockstruct alg_sock *pask =alg_sk (psk);struct af_alg_ctx *ctx = ask->private;struct crypto_skcipher *tfm = pask->private; -unsigned int bs =crypto_skcipher_blocksize (tfm); +unsigned int bs =crypto_skcipher_chunksize (tfm);struct af_alg_async_req *areq;int err =0 ;size_t len =0 ;
include/crypto/internal/skcipher.h +0 -30
@@ -205,19 +205,6 @@ static inline unsigned int crypto_skciphreturn alg->max_keysize; } -static inline unsigned int crypto_skcipher_alg_chunksize ( -struct skcipher_alg *alg) -{ -if ((alg->base.cra_flags &CRYPTO_ALG_TYPE_MASK ) == -CRYPTO_ALG_TYPE_BLKCIPHER ) -return alg->base.cra_blocksize; - -if (alg->base.cra_ablkcipher.encrypt) -return alg->base.cra_blocksize; - -return alg->chunksize; -} -static inline unsigned int crypto_skcipher_alg_walksize (struct skcipher_alg *alg) {
@@ -232,23 +219,6 @@ static inline unsigned int crypto_skciph }/** -* crypto_skcipher_chunksize() - obtain chunk size -* @tfm: cipher handle -* -* The block size is set to one for ciphers such as CTR. However, -* you still need to provide incremental updates in multiples of -* the underlying block size as the IV does not have sub-block -* granularity. This is known in this API as the chunk size. -* -* Return: chunk size in bytes -*/ -static inline unsigned int crypto_skcipher_chunksize ( -struct crypto_skcipher *tfm) -{ -return crypto_skcipher_alg_chunksize (crypto_skcipher_alg (tfm)); -} - -/** * crypto_skcipher_walksize() - obtain walk size * @tfm: cipher handle *
include/crypto/skcipher.h +30 -0
@@ -304,6 +304,36 @@ static inline unsigned int crypto_skciphreturn crypto_tfm_alg_blocksize (crypto_skcipher_tfm (tfm)); } +static inline unsigned int crypto_skcipher_alg_chunksize ( +struct skcipher_alg *alg) +{ +if ((alg->base.cra_flags &CRYPTO_ALG_TYPE_MASK ) == +CRYPTO_ALG_TYPE_BLKCIPHER ) +return alg->base.cra_blocksize; + +if (alg->base.cra_ablkcipher.encrypt) +return alg->base.cra_blocksize; + +return alg->chunksize; +} + +/** +* crypto_skcipher_chunksize() - obtain chunk size +* @tfm: cipher handle +* +* The block size is set to one for ciphers such as CTR. However, +* you still need to provide incremental updates in multiples of +* the underlying block size as the IV does not have sub-block +* granularity. This is known in this API as the chunk size. +* +* Return: chunk size in bytes +*/ +static inline unsigned int crypto_skcipher_chunksize ( +struct crypto_skcipher *tfm) +{ +return crypto_skcipher_alg_chunksize (crypto_skcipher_alg (tfm)); +} +static inline unsigned int crypto_sync_skcipher_blocksize (struct crypto_sync_skcipher *tfm) {
Greg Kroah-Hartman
maintainerPATCH 111/203 mei: fix modalias documentation
In reply to Greg Kroah-HartmanFrom: Alexander Usyskin <[email protected]>
commit 73668309215285366c433489de70d31362987be9 upstream.
mei client bus added the client protocol version to the device alias, but ABI documentation was not updated.
--- Documentation/ABI/testing/sysfs-bus-mei | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Documentation/ABI/testing/sysfs-bus-mei +1 -1
@@ -4,7 +4,7 @@ KernelVersion: 3.10 Contact: Samuel Ortiz <[email protected]> [email protected] Description: Stores the same MODALIAS value emitted by uevent - Format: mei:<mei device name>:<device uuid>: + Format: mei:<mei device name>:<device uuid>:<protocol version> What: /sys/bus/mei/devices/.../name Date: May 2015
Greg Kroah-Hartman
maintainerPATCH 112/203 clk: meson: axg-audio: fix regmap last register
In reply to Greg Kroah-HartmanFrom: Jerome Brunet <[email protected]>
commit 255cab9d27d78703f7450d720859ee146d0ee6e1 upstream.
Since the addition of the g12a, the last register is AUDIO_CLK_SPDIFOUT_B_CTRL.
--- drivers/clk/meson/axg-audio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/clk/meson/axg-audio.c +1 -1
@@ -1001,7 +1001,7 @@ static const struct regmap_config axg_au .reg_bits = 32, .val_bits = 32, .reg_stride = 4, - .max_register = AUDIO_CLK_PDMIN_CTRL1, + .max_register = AUDIO_CLK_SPDIFOUT_B_CTRL, };struct audioclk_data {
Greg Kroah-Hartman
maintainerPATCH 113/203 clk: samsung: exynos5420: Preserve CPU clocks configuration during suspend/resume
In reply to Greg Kroah-HartmanFrom: Marian Mihailescu <[email protected]>
commit e21be0d1d7bd7f78a77613f6bcb6965e72b22fc1 upstream.
Save and restore top PLL related configuration registers for big (APLL) and LITTLE (KPLL) cores during suspend/resume cycle. So far, CPU clocks were reset to default values after suspend/resume cycle and performance after system resume was affected when performance governor has been selected.
--- drivers/clk/samsung/clk-exynos5420.c | 2 ++ 1 file changed, 2 insertions(+)
drivers/clk/samsung/clk-exynos5420.c +2 -0
@@ -165,6 +165,8 @@ static const unsigned long exynos5x_clk_GATE_BUS_CPU ,GATE_SCLK_CPU ,CLKOUT_CMU_CPU , +APLL_CON0 , +KPLL_CON0 ,CPLL_CON0 ,DPLL_CON0 , EPLL_CON0,
Greg Kroah-Hartman
maintainerPATCH 116/203 clk: imx: pll14xx: Fix quick switch of S/K parameter
In reply to Greg Kroah-HartmanFrom: Leonard Crestez <[email protected]>
commit 094234fcf46146339caaac8282aa15d225a5911a upstream.
The PLL14xx on imx8m can change the S and K parameter without requiring a reset and relock of the whole PLL.
Fix clk_pll144xx_mp_change register reading and use it for pll1443 as well since no reset+relock is required on K changes either.
--- drivers/clk/imx/clk-pll14xx.c | 40 ++++++++-------------------------------- 1 file changed, 8 insertions(+), 32 deletions(-)
drivers/clk/imx/clk-pll14xx.c +8 -32
@@ -112,43 +112,17 @@ static unsigned long clk_pll1443x_recalcreturn fvco; } -static inline bool clk_pll1416x_mp_change (const struct imx_pll14xx_rate_table *rate, +static inline bool clk_pll14xx_mp_change (const struct imx_pll14xx_rate_table *rate,u32 pll_div) {u32 old_mdiv, old_pdiv; - old_mdiv = (pll_div >>MDIV_SHIFT ) &MDIV_MASK ; - old_pdiv = (pll_div >>PDIV_SHIFT ) &PDIV_MASK ; + old_mdiv = (pll_div &MDIV_MASK ) >>MDIV_SHIFT ; + old_pdiv = (pll_div &PDIV_MASK ) >>PDIV_SHIFT ;return rate->mdiv != old_mdiv || rate->pdiv != old_pdiv; } -static inline bool clk_pll1443x_mpk_change (const struct imx_pll14xx_rate_table *rate, -u32 pll_div_ctl0,u32 pll_div_ctl1) -{ -u32 old_mdiv, old_pdiv, old_kdiv; - - old_mdiv = (pll_div_ctl0 >>MDIV_SHIFT ) &MDIV_MASK ; - old_pdiv = (pll_div_ctl0 >>PDIV_SHIFT ) &PDIV_MASK ; - old_kdiv = (pll_div_ctl1 >>KDIV_SHIFT ) &KDIV_MASK ; - -return rate->mdiv != old_mdiv || rate->pdiv != old_pdiv || - rate->kdiv != old_kdiv; -} - -static inline bool clk_pll1443x_mp_change (const struct imx_pll14xx_rate_table *rate, -u32 pll_div_ctl0,u32 pll_div_ctl1) -{ -u32 old_mdiv, old_pdiv, old_kdiv; - - old_mdiv = (pll_div_ctl0 >>MDIV_SHIFT ) &MDIV_MASK ; - old_pdiv = (pll_div_ctl0 >>PDIV_SHIFT ) &PDIV_MASK ; - old_kdiv = (pll_div_ctl1 >>KDIV_SHIFT ) &KDIV_MASK ; - -return rate->mdiv != old_mdiv || rate->pdiv != old_pdiv || - rate->kdiv != old_kdiv; -} -static int clk_pll14xx_wait_lock (struct clk_pll14xx *pll) {u32 val;
@@ -174,7 +148,7 @@ static int clk_pll1416x_set_rate(struct tmp =readl_relaxed (pll->base +4 ); -if (!clk_pll1416x_mp_change (rate, tmp)) { +if (!clk_pll14xx_mp_change (rate, tmp)) { tmp &= ~(SDIV_MASK ) <<SDIV_SHIFT ; tmp |= rate->sdiv <<SDIV_SHIFT ;writel_relaxed (tmp, pll->base +4 );
@@ -239,13 +213,15 @@ static int clk_pll1443x_set_rate(struct } tmp =readl_relaxed (pll->base +4 ); - div_val =readl_relaxed (pll->base +8 ); -if (!clk_pll1443x_mpk_change (rate, tmp, div_val)) { +if (!clk_pll14xx_mp_change (rate, tmp)) { tmp &= ~(SDIV_MASK ) <<SDIV_SHIFT ; tmp |= rate->sdiv <<SDIV_SHIFT ;writel_relaxed (tmp, pll->base +4 ); + tmp = rate->kdiv <<KDIV_SHIFT ; +writel_relaxed (tmp, pll->base +8 ); +return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 115/203 dmaengine: dw: platform: Mark hclk clock optional
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
commit f27c22736d133baff0ab3fdc7b015d998267d817 upstream.
On some platforms the clock can be fixed rate, always running one and there is no need to do anything with it.
In order to support those platforms, switch to use optional clock.
Depends-on: 60b8f0ddf1a9 ("clk: Add (devm_)clk_get_optional() functions")
--- drivers/dma/dw/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/dma/dw/platform.c +1 -1
@@ -66,7 +66,7 @@ static int dw_probe(struct platform_devi data->chip = chip; - chip->clk =devm_clk_get (chip->dev,"hclk" ); + chip->clk =devm_clk_get_optional (chip->dev,"hclk" );if (IS_ERR (chip->clk))return PTR_ERR (chip->clk); err =clk_prepare_enable (chip->clk);
Greg Kroah-Hartman
maintainerPATCH 103/203 crypto: geode-aes - convert to skcipher API and make thread-safe
In reply to Greg Kroah-HartmanFrom: Eric Biggers <[email protected]>
commit 4549f7e5aa27ffc2cba63b5db8842a3b486f5688 upstream.
The geode AES driver is heavily broken because it stores per-request state in the transform context. So it will crash or produce the wrong result if used by any of the many places in the kernel that issue concurrent requests for the same transform object.
This driver is also implemented using the deprecated blkcipher API, which makes it difficult to fix, and puts it among the drivers preventing that API from being removed.
Convert this driver to use the skcipher API, and change it to not store per-request state in the transform context.
--- drivers/crypto/geode-aes.c | 448 +++++++++++++++------------------------------ drivers/crypto/geode-aes.h | 15 - 2 files changed, 153 insertions(+), 310 deletions(-)
drivers/crypto/geode-aes.c +151 -297
@@ -10,7 +10,7 @@#include <linux/spinlock.h> #include <crypto/algapi.h> #include <crypto/aes.h> -#include <crypto/skcipher.h> +#include <crypto/internal/skcipher.h> #include <linux/io.h> #include <linux/delay.h>
@@ -24,12 +24,12 @@ static spinlock_t lock;/* Write a 128 bit field (either a writable key or IV) */ static inline void -_writefield (u32 offset,void *value) +_writefield (u32 offset,const void *value) {int i;for (i =0 ; i <4 ; i++) -iowrite32 (((u32 *) value)[i], _iobase + offset + (i *4 )); +iowrite32 (((const u32 *) value)[i], _iobase + offset + (i *4 )); }/* Read a 128 bit field (either a writable key or IV) */
@@ -43,12 +43,12 @@ _readfield(u32 offset, void *value) }static int -do_crypt (void *src,void *dst,int len,u32 flags) +do_crypt (const void *src,void *dst,u32 len,u32 flags) {u32 status;u32 counter =AES_OP_TIMEOUT ; -iowrite32 (virt_to_phys (src), _iobase +AES_SOURCEA_REG ); +iowrite32 (virt_to_phys ((void *)src), _iobase +AES_SOURCEA_REG );iowrite32 (virt_to_phys (dst), _iobase +AES_DSTA_REG );iowrite32 (len, _iobase +AES_LENA_REG );
@@ -65,16 +65,14 @@ do_crypt(void *src, void *dst, int len,return counter ?0 :1 ; } -static unsigned int -geode_aes_crypt (struct geode_aes_op *op) +static void +geode_aes_crypt (const struct geode_aes_tfm_ctx *tctx,const void *src, +void *dst,u32 len,u8 *iv,int mode,int dir) {u32 flags =0 ;unsigned long iflags;int ret; -if (op->len ==0 ) -return 0 ; -/* If the source and destination is the same, then * we need to turn on the coherent flags, otherwise * we don't need to worry
@@ -82,32 +80,28 @@ geode_aes_crypt(struct geode_aes_op *op) flags |= (AES_CTRL_DCA |AES_CTRL_SCA ); -if (op->dir ==AES_DIR_ENCRYPT ) +if (dir ==AES_DIR_ENCRYPT ) flags |=AES_CTRL_ENCRYPT ;/* Start the critical section */ spin_lock_irqsave (&lock, iflags); -if (op->mode ==AES_MODE_CBC ) { +if (mode ==AES_MODE_CBC ) { flags |=AES_CTRL_CBC ; -_writefield (AES_WRITEIV0_REG , op->iv); +_writefield (AES_WRITEIV0_REG , iv); } -if (!(op->flags &AES_FLAGS_HIDDENKEY )) { - flags |=AES_CTRL_WRKEY ; -_writefield (AES_WRITEKEY0_REG , op->key); - } + flags |=AES_CTRL_WRKEY ; +_writefield (AES_WRITEKEY0_REG , tctx->key); - ret =do_crypt (op->src, op->dst, op->len, flags); + ret =do_crypt (src, dst, len, flags);BUG_ON (ret); -if (op->mode ==AES_MODE_CBC ) -_readfield (AES_WRITEIV0_REG , op->iv); +if (mode ==AES_MODE_CBC ) +_readfield (AES_WRITEIV0_REG , iv);spin_unlock_irqrestore (&lock, iflags); - -return op->len; }/* CRYPTO-API Functions */
@@ -115,13 +109,13 @@ geode_aes_crypt(struct geode_aes_op *op)static int geode_setkey_cip (struct crypto_tfm *tfm,const u8 *key,unsigned int len) { -struct geode_aes_op *op =crypto_tfm_ctx (tfm); +struct geode_aes_tfm_ctx *tctx =crypto_tfm_ctx (tfm);unsigned int ret; - op->keylen = len; + tctx->keylen = len;if (len ==AES_KEYSIZE_128 ) { -memcpy (op->key, key, len); +memcpy (tctx->key, key, len);return 0 ; }
@@ -134,132 +128,93 @@ static int geode_setkey_cip(struct crypt/* * The requested key size is not supported by HW, do a fallback */ - op->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK ; - op->fallback.cip->base.crt_flags |= (tfm->crt_flags &CRYPTO_TFM_REQ_MASK ); + tctx->fallback.cip->base.crt_flags &= ~CRYPTO_TFM_REQ_MASK ; + tctx->fallback.cip->base.crt_flags |= + (tfm->crt_flags &CRYPTO_TFM_REQ_MASK ); - ret =crypto_cipher_setkey (op->fallback.cip, key, len); + ret =crypto_cipher_setkey (tctx->fallback.cip, key, len);if (ret) { tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK ; - tfm->crt_flags |= (op->fallback.cip->base.crt_flags &CRYPTO_TFM_RES_MASK ); + tfm->crt_flags |= (tctx->fallback.cip->base.crt_flags & +CRYPTO_TFM_RES_MASK ); }return ret; } -static int geode_setkey_blk (struct crypto_tfm *tfm,const u8 *key, -unsigned int len) +static int geode_setkey_skcipher (struct crypto_skcipher *tfm,const u8 *key, +unsigned int len) { -struct geode_aes_op *op =crypto_tfm_ctx (tfm); +struct geode_aes_tfm_ctx *tctx =crypto_skcipher_ctx (tfm);unsigned int ret; - op->keylen = len; + tctx->keylen = len;if (len ==AES_KEYSIZE_128 ) { -memcpy (op->key, key, len); +memcpy (tctx->key, key, len);return 0 ; }if (len !=AES_KEYSIZE_192 && len !=AES_KEYSIZE_256 ) {/* not supported at all */ - tfm->crt_flags |=CRYPTO_TFM_RES_BAD_KEY_LEN ; +crypto_skcipher_set_flags (tfm,CRYPTO_TFM_RES_BAD_KEY_LEN );return -EINVAL ; }/* * The requested key size is not supported by HW, do a fallback */ -crypto_sync_skcipher_clear_flags (op->fallback.blk,CRYPTO_TFM_REQ_MASK ); -crypto_sync_skcipher_set_flags (op->fallback.blk, - tfm->crt_flags &CRYPTO_TFM_REQ_MASK ); - - ret =crypto_sync_skcipher_setkey (op->fallback.blk, key, len); -if (ret) { - tfm->crt_flags &= ~CRYPTO_TFM_RES_MASK ; - tfm->crt_flags |=crypto_sync_skcipher_get_flags (op->fallback.blk) & -CRYPTO_TFM_RES_MASK ; - } +crypto_skcipher_clear_flags (tctx->fallback.skcipher, +CRYPTO_TFM_REQ_MASK ); +crypto_skcipher_set_flags (tctx->fallback.skcipher, +crypto_skcipher_get_flags (tfm) & +CRYPTO_TFM_REQ_MASK ); + ret =crypto_skcipher_setkey (tctx->fallback.skcipher, key, len); +crypto_skcipher_set_flags (tfm, +crypto_skcipher_get_flags (tctx->fallback.skcipher) & +CRYPTO_TFM_RES_MASK );return ret; } -static int fallback_blk_dec (struct blkcipher_desc *desc, -struct scatterlist *dst,struct scatterlist *src, -unsigned int nbytes) -{ -struct geode_aes_op *op =crypto_blkcipher_ctx (desc->tfm); -SYNC_SKCIPHER_REQUEST_ON_STACK (req, op->fallback.blk); - -skcipher_request_set_sync_tfm (req, op->fallback.blk); -skcipher_request_set_callback (req,0 ,NULL ,NULL ); -skcipher_request_set_crypt (req, src, dst, nbytes, desc->info); - -return crypto_skcipher_decrypt (req); -} - -static int fallback_blk_enc (struct blkcipher_desc *desc, -struct scatterlist *dst,struct scatterlist *src, -unsigned int nbytes) -{ -struct geode_aes_op *op =crypto_blkcipher_ctx (desc->tfm); -SYNC_SKCIPHER_REQUEST_ON_STACK (req, op->fallback.blk); - -skcipher_request_set_sync_tfm (req, op->fallback.blk); -skcipher_request_set_callback (req,0 ,NULL ,NULL ); -skcipher_request_set_crypt (req, src, dst, nbytes, desc->info); - -return crypto_skcipher_encrypt (req); -} -static void geode_encrypt (struct crypto_tfm *tfm,u8 *out,const u8 *in) { -struct geode_aes_op *op =crypto_tfm_ctx (tfm); +const struct geode_aes_tfm_ctx *tctx =crypto_tfm_ctx (tfm); -if (unlikely (op->keylen !=AES_KEYSIZE_128 )) { -crypto_cipher_encrypt_one (op->fallback.cip, out, in); +if (unlikely (tctx->keylen !=AES_KEYSIZE_128 )) { +crypto_cipher_encrypt_one (tctx->fallback.cip, out, in);return ; } - op->src = (void *) in; - op->dst = (void *) out; - op->mode =AES_MODE_ECB ; - op->flags =0 ; - op->len =AES_BLOCK_SIZE ; - op->dir =AES_DIR_ENCRYPT ; - -geode_aes_crypt (op); +geode_aes_crypt (tctx, in, out,AES_BLOCK_SIZE ,NULL , +AES_MODE_ECB ,AES_DIR_ENCRYPT ); }static void geode_decrypt (struct crypto_tfm *tfm,u8 *out,const u8 *in) { -struct geode_aes_op *op =crypto_tfm_ctx (tfm); +const struct geode_aes_tfm_ctx *tctx =crypto_tfm_ctx (tfm); -if (unlikely (op->keylen !=AES_KEYSIZE_128 )) { -crypto_cipher_decrypt_one (op->fallback.cip, out, in); +if (unlikely (tctx->keylen !=AES_KEYSIZE_128 )) { +crypto_cipher_decrypt_one (tctx->fallback.cip, out, in);return ; } - op->src = (void *) in; - op->dst = (void *) out; - op->mode =AES_MODE_ECB ; - op->flags =0 ; - op->len =AES_BLOCK_SIZE ; - op->dir =AES_DIR_DECRYPT ; - -geode_aes_crypt (op); +geode_aes_crypt (tctx, in, out,AES_BLOCK_SIZE ,NULL , +AES_MODE_ECB ,AES_DIR_DECRYPT ); }static int fallback_init_cip (struct crypto_tfm *tfm) {const char *name =crypto_tfm_alg_name (tfm); -struct geode_aes_op *op =crypto_tfm_ctx (tfm); +struct geode_aes_tfm_ctx *tctx =crypto_tfm_ctx (tfm); - op->fallback.cip =crypto_alloc_cipher (name,0 , -CRYPTO_ALG_NEED_FALLBACK ); + tctx->fallback.cip =crypto_alloc_cipher (name,0 , +CRYPTO_ALG_NEED_FALLBACK ); -if (IS_ERR (op->fallback.cip)) { +if (IS_ERR (tctx->fallback.cip)) {printk (KERN_ERR "Error allocating fallback algo %s\n" , name); -return PTR_ERR (op->fallback.cip); +return PTR_ERR (tctx->fallback.cip); }return 0 ;
@@ -267,10 +222,9 @@ static int fallback_init_cip(struct crypstatic void fallback_exit_cip (struct crypto_tfm *tfm) { -struct geode_aes_op *op =crypto_tfm_ctx (tfm); +struct geode_aes_tfm_ctx *tctx =crypto_tfm_ctx (tfm); -crypto_free_cipher (op->fallback.cip); - op->fallback.cip =NULL ; +crypto_free_cipher (tctx->fallback.cip); }static struct crypto_alg geode_alg = {
@@ -283,7 +237,7 @@ static struct crypto_alg geode_alg = { .cra_init = fallback_init_cip, .cra_exit = fallback_exit_cip, .cra_blocksize = AES_BLOCK_SIZE, - .cra_ctxsize = sizeof(struct geode_aes_op), + .cra_ctxsize = sizeof(struct geode_aes_tfm_ctx), .cra_module = THIS_MODULE, .cra_u = { .cipher = {
@@ -296,220 +250,126 @@ static struct crypto_alg geode_alg = { } }; -static int -geode_cbc_decrypt (struct blkcipher_desc *desc, -struct scatterlist *dst,struct scatterlist *src, -unsigned int nbytes) -{ -struct geode_aes_op *op =crypto_blkcipher_ctx (desc->tfm); -struct blkcipher_walk walk; -int err, ret; - -if (nbytes %AES_BLOCK_SIZE ) -return -EINVAL ; - -if (unlikely (op->keylen !=AES_KEYSIZE_128 )) -return fallback_blk_dec (desc, dst, src, nbytes); - -blkcipher_walk_init (&walk, dst, src, nbytes); - err =blkcipher_walk_virt (desc, &walk); - op->iv = walk.iv; - -while ((nbytes = walk.nbytes)) { - op->src = walk.src.virt.addr, - op->dst = walk.dst.virt.addr; - op->mode =AES_MODE_CBC ; - op->len = nbytes - (nbytes %AES_BLOCK_SIZE ); - op->dir =AES_DIR_DECRYPT ; - - ret =geode_aes_crypt (op); - - nbytes -= ret; - err =blkcipher_walk_done (desc, &walk, nbytes); - } - -return err; -} - -static int -geode_cbc_encrypt (struct blkcipher_desc *desc, -struct scatterlist *dst,struct scatterlist *src, -unsigned int nbytes) -{ -struct geode_aes_op *op =crypto_blkcipher_ctx (desc->tfm); -struct blkcipher_walk walk; -int err, ret; - -if (nbytes %AES_BLOCK_SIZE ) -return -EINVAL ; - -if (unlikely (op->keylen !=AES_KEYSIZE_128 )) -return fallback_blk_enc (desc, dst, src, nbytes); - -blkcipher_walk_init (&walk, dst, src, nbytes); - err =blkcipher_walk_virt (desc, &walk); - op->iv = walk.iv; - -while ((nbytes = walk.nbytes)) { - op->src = walk.src.virt.addr, - op->dst = walk.dst.virt.addr; - op->mode =AES_MODE_CBC ; - op->len = nbytes - (nbytes %AES_BLOCK_SIZE ); - op->dir =AES_DIR_ENCRYPT ; - - ret =geode_aes_crypt (op); - nbytes -= ret; - err =blkcipher_walk_done (desc, &walk, nbytes); - } - -return err; -} - -static int fallback_init_blk (struct crypto_tfm *tfm) +static int geode_init_skcipher (struct crypto_skcipher *tfm) { -const char *name =crypto_tfm_alg_name (tfm); -struct geode_aes_op *op =crypto_tfm_ctx (tfm); +const char *name =crypto_tfm_alg_name (&tfm->base); +struct geode_aes_tfm_ctx *tctx =crypto_skcipher_ctx (tfm); - op->fallback.blk =crypto_alloc_sync_skcipher (name,0 , -CRYPTO_ALG_NEED_FALLBACK ); -if (IS_ERR (op->fallback.blk)) { + tctx->fallback.skcipher = +crypto_alloc_skcipher (name,0 ,CRYPTO_ALG_NEED_FALLBACK | +CRYPTO_ALG_ASYNC ); +if (IS_ERR (tctx->fallback.skcipher)) {printk (KERN_ERR "Error allocating fallback algo %s\n" , name); -return PTR_ERR (op->fallback.blk); +return PTR_ERR (tctx->fallback.skcipher); } +crypto_skcipher_set_reqsize (tfm,sizeof (struct skcipher_request ) + +crypto_skcipher_reqsize (tctx->fallback.skcipher));return 0 ; } -static void fallback_exit_blk (struct crypto_tfm *tfm) +static void geode_exit_skcipher (struct crypto_skcipher *tfm) { -struct geode_aes_op *op =crypto_tfm_ctx (tfm); +struct geode_aes_tfm_ctx *tctx =crypto_skcipher_ctx (tfm); -crypto_free_sync_skcipher (op->fallback.blk); - op->fallback.blk =NULL ; +crypto_free_skcipher (tctx->fallback.skcipher); } -static struct crypto_alg geode_cbc_alg = { - .cra_name ="cbc(aes)" , - .cra_driver_name ="cbc-aes-geode" , - .cra_priority =400 , - .cra_flags =CRYPTO_ALG_TYPE_BLKCIPHER | -CRYPTO_ALG_KERN_DRIVER_ONLY | -CRYPTO_ALG_NEED_FALLBACK , - .cra_init = fallback_init_blk, - .cra_exit = fallback_exit_blk, - .cra_blocksize =AES_BLOCK_SIZE , - .cra_ctxsize =sizeof (struct geode_aes_op ), - .cra_alignmask =15 , - .cra_type = &crypto_blkcipher_type, - .cra_module =THIS_MODULE , - .cra_u = { - .blkcipher = { - .min_keysize =AES_MIN_KEY_SIZE , - .max_keysize =AES_MAX_KEY_SIZE , - .setkey = geode_setkey_blk, - .encrypt = geode_cbc_encrypt, - .decrypt = geode_cbc_decrypt, - .ivsize =AES_BLOCK_SIZE , - } - } -}; - -static int -geode_ecb_decrypt (struct blkcipher_desc *desc, -struct scatterlist *dst,struct scatterlist *src, -unsigned int nbytes) -{ -struct geode_aes_op *op =crypto_blkcipher_ctx (desc->tfm); -struct blkcipher_walk walk; -int err, ret; +static int geode_skcipher_crypt (struct skcipher_request *req,int mode,int dir) +{ +struct crypto_skcipher *tfm =crypto_skcipher_reqtfm (req); +const struct geode_aes_tfm_ctx *tctx =crypto_skcipher_ctx (tfm); +struct skcipher_walk walk; +unsigned int nbytes; +int err; -if (nbytes %AES_BLOCK_SIZE ) -return -EINVAL ; +if (unlikely (tctx->keylen !=AES_KEYSIZE_128 )) { +struct skcipher_request *subreq =skcipher_request_ctx (req); -if (unlikely (op->keylen !=AES_KEYSIZE_128 )) -return fallback_blk_dec (desc, dst, src, nbytes); + *subreq = *req; +skcipher_request_set_tfm (subreq, tctx->fallback.skcipher); +if (dir ==AES_DIR_DECRYPT ) +return crypto_skcipher_decrypt (subreq); +else +return crypto_skcipher_encrypt (subreq); + } -blkcipher_walk_init (&walk, dst, src, nbytes); - err =blkcipher_walk_virt (desc, &walk); + err =skcipher_walk_virt (&walk, req, false); -while ((nbytes = walk.nbytes)) { - op->src = walk.src.virt.addr, - op->dst = walk.dst.virt.addr; - op->mode =AES_MODE_ECB ; - op->len = nbytes - (nbytes %AES_BLOCK_SIZE ); - op->dir =AES_DIR_DECRYPT ; - - ret =geode_aes_crypt (op); - nbytes -= ret; - err =blkcipher_walk_done (desc, &walk, nbytes); +while ((nbytes = walk.nbytes) !=0 ) { +geode_aes_crypt (tctx, walk.src.virt.addr, walk.dst.virt.addr, +round_down (nbytes,AES_BLOCK_SIZE ), + walk.iv, mode, dir); + err =skcipher_walk_done (&walk, nbytes %AES_BLOCK_SIZE ); }return err; } -static int -geode_ecb_encrypt (struct blkcipher_desc *desc, -struct scatterlist *dst,struct scatterlist *src, -unsigned int nbytes) -{ -struct geode_aes_op *op =crypto_blkcipher_ctx (desc->tfm); -struct blkcipher_walk walk; -int err, ret; - -if (nbytes %AES_BLOCK_SIZE ) -return -EINVAL ; - -if (unlikely (op->keylen !=AES_KEYSIZE_128 )) -return fallback_blk_enc (desc, dst, src, nbytes); - -blkcipher_walk_init (&walk, dst, src, nbytes); - err =blkcipher_walk_virt (desc, &walk); - -while ((nbytes = walk.nbytes)) { - op->src = walk.src.virt.addr, - op->dst = walk.dst.virt.addr; - op->mode =AES_MODE_ECB ; - op->len = nbytes - (nbytes %AES_BLOCK_SIZE ); - op->dir =AES_DIR_ENCRYPT ; - - ret =geode_aes_crypt (op); - nbytes -= ret; - ret =blkcipher_walk_done (desc, &walk, nbytes); - } +static int geode_cbc_encrypt (struct skcipher_request *req) +{ +return geode_skcipher_crypt (req,AES_MODE_CBC ,AES_DIR_ENCRYPT ); +} -return err; +static int geode_cbc_decrypt (struct skcipher_request *req) +{ +return geode_skcipher_crypt (req,AES_MODE_CBC ,AES_DIR_DECRYPT ); } -static struct crypto_alg geode_ecb_alg = { - .cra_name ="ecb(aes)" , - .cra_driver_name ="ecb-aes-geode" , - .cra_priority =400 , - .cra_flags =CRYPTO_ALG_TYPE_BLKCIPHER | -CRYPTO_ALG_KERN_DRIVER_ONLY | -CRYPTO_ALG_NEED_FALLBACK , - .cra_init = fallback_init_blk, - .cra_exit = fallback_exit_blk, - .cra_blocksize =AES_BLOCK_SIZE , - .cra_ctxsize =sizeof (struct geode_aes_op ), - .cra_alignmask =15 , - .cra_type = &crypto_blkcipher_type, - .cra_module =THIS_MODULE , - .cra_u = { - .blkcipher = { - .min_keysize =AES_MIN_KEY_SIZE , - .max_keysize =AES_MAX_KEY_SIZE , - .setkey = geode_setkey_blk, - .encrypt = geode_ecb_encrypt, - .decrypt = geode_ecb_decrypt, - } - } +static int geode_ecb_encrypt (struct skcipher_request *req) +{ +return geode_skcipher_crypt (req,AES_MODE_ECB ,AES_DIR_ENCRYPT ); +} + +static int geode_ecb_decrypt (struct skcipher_request *req) +{ +return geode_skcipher_crypt (req,AES_MODE_ECB ,AES_DIR_DECRYPT ); +} + +static struct skcipher_alg geode_skcipher_algs[] = { + { + .base.cra_name ="cbc(aes)" , + .base.cra_driver_name ="cbc-aes-geode" , + .base.cra_priority =400 , + .base.cra_flags =CRYPTO_ALG_KERN_DRIVER_ONLY | +CRYPTO_ALG_NEED_FALLBACK , + .base.cra_blocksize =AES_BLOCK_SIZE , + .base.cra_ctxsize =sizeof (struct geode_aes_tfm_ctx ), + .base.cra_alignmask =15 , + .base.cra_module =THIS_MODULE , + .init = geode_init_skcipher, + .exit = geode_exit_skcipher, + .setkey = geode_setkey_skcipher, + .encrypt = geode_cbc_encrypt, + .decrypt = geode_cbc_decrypt, + .min_keysize =AES_MIN_KEY_SIZE , + .max_keysize =AES_MAX_KEY_SIZE , + .ivsize =AES_BLOCK_SIZE , + }, { + .base.cra_name ="ecb(aes)" , + .base.cra_driver_name ="ecb-aes-geode" , + .base.cra_priority =400 , + .base.cra_flags =CRYPTO_ALG_KERN_DRIVER_ONLY | +CRYPTO_ALG_NEED_FALLBACK , + .base.cra_blocksize =AES_BLOCK_SIZE , + .base.cra_ctxsize =sizeof (struct geode_aes_tfm_ctx ), + .base.cra_alignmask =15 , + .base.cra_module =THIS_MODULE , + .init = geode_init_skcipher, + .exit = geode_exit_skcipher, + .setkey = geode_setkey_skcipher, + .encrypt = geode_ecb_encrypt, + .decrypt = geode_ecb_decrypt, + .min_keysize =AES_MIN_KEY_SIZE , + .max_keysize =AES_MAX_KEY_SIZE , + }, };static void geode_aes_remove (struct pci_dev *dev) {crypto_unregister_alg (&geode_alg); -crypto_unregister_alg (&geode_ecb_alg); -crypto_unregister_alg (&geode_cbc_alg); +crypto_unregister_skciphers (geode_skcipher_algs, +ARRAY_SIZE (geode_skcipher_algs));pci_iounmap (dev, _iobase); _iobase =NULL ;
@@ -547,20 +407,14 @@ static int geode_aes_probe(struct pci_deif (ret) goto eiomap; - ret =crypto_register_alg (&geode_ecb_alg); + ret =crypto_register_skciphers (geode_skcipher_algs, +ARRAY_SIZE (geode_skcipher_algs));if (ret) goto ealg; - ret =crypto_register_alg (&geode_cbc_alg); -if (ret) - goto eecb; -dev_notice (&dev->dev,"GEODE AES engine enabled.\n" );return 0 ; - eecb: -crypto_unregister_alg (&geode_ecb_alg); - ealg:crypto_unregister_alg (&geode_alg);
drivers/crypto/geode-aes.h +2 -13
@@ -46,21 +46,10 @@#define AES_OP_TIMEOUT 0x50000 -struct geode_aes_op { - -void *src; -void *dst; - -u32 mode; -u32 dir; -u32 flags; -int len; - +struct geode_aes_tfm_ctx {u8 key[AES_KEYSIZE_128 ]; -u8 *iv; -union { -struct crypto_sync_skcipher *blk; +struct crypto_skcipher *skcipher;struct crypto_cipher *cip; } fallback;u32 keylen;
Greg Kroah-Hartman
maintainerPATCH 106/203 nfsd: v4 support requires CRYPTO_SHA256
In reply to Greg Kroah-HartmanFrom: Scott Mayhew <[email protected]>
commit a2e2f2dc77a18d2b0f450fb7fcb4871c9f697822 upstream.
The new nfsdcld client tracking operations use sha256 to compute hashes of the kerberos principals, so make sure CRYPTO_SHA256 is enabled.
--- fs/nfsd/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/nfsd/Kconfig +1 -1
@@ -73,7 +73,7 @@ config NFSD_V4 select NFSD_V3 select FS_POSIX_ACL select SUNRPC_GSS - select CRYPTO + select CRYPTO_SHA256 select GRACE_PERIOD help This option enables support in your system's NFS server for
Greg Kroah-Hartman
maintainerPATCH 108/203 NFSv4.x: Drop the slot if nfs4_delegreturn_prepare waits for layoutreturn
In reply to Greg Kroah-HartmanFrom: Trond Myklebust <[email protected]>
commit 5326de9e94bedcf7366e7e7625d4deb8c1f1ca8a upstream.
If nfs4_delegreturn_prepare needs to wait for a layoutreturn to complete then make sure we drop the sequence slot if we hold it.
--- fs/nfs/nfs4proc.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
fs/nfs/nfs4proc.c +3 -1
@@ -6252,8 +6252,10 @@ static void nfs4_delegreturn_prepare(str d_data = (struct nfs4_delegreturndata *)data; -if (!d_data->lr.roc &&nfs4_wait_on_layoutreturn (d_data->inode, task)) +if (!d_data->lr.roc &&nfs4_wait_on_layoutreturn (d_data->inode, task)) { +nfs4_sequence_done (task, &d_data->res.seq_res);return ; + } lo = d_data->args.lr_args ? d_data->args.lr_args->layout :NULL ;if (lo && !pnfs_layout_is_valid (lo)) {
Greg Kroah-Hartman
maintainerPATCH 109/203 iio: imu: st_lsm6dsx: fix gyro gain definitions for LSM9DS1
In reply to Greg Kroah-HartmanFrom: Lorenzo Bianconi <[email protected]>
commit 1b3751017e09f0857bc38f9b1be08dce38f3d92c upstream.
Fix typos in gyro gain definitions for LSM9DS1 sensor
--- drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
drivers/iio/imu/st_lsm6dsx/st_lsm6dsx_core.c +4 -3
@@ -152,9 +152,10 @@ static const struct st_lsm6dsx_settings .addr = 0x10, .mask = GENMASK(4, 3), }, - .fs_avl[0] = { IIO_DEGREE_TO_RAD(245), 0x0 }, - .fs_avl[1] = { IIO_DEGREE_TO_RAD(500), 0x1 }, - .fs_avl[2] = { IIO_DEGREE_TO_RAD(2000), 0x3 }, + + .fs_avl[0] = { IIO_DEGREE_TO_RAD(8750), 0x0 }, + .fs_avl[1] = { IIO_DEGREE_TO_RAD(17500), 0x1 }, + .fs_avl[2] = { IIO_DEGREE_TO_RAD(70000), 0x3 }, .fs_len = 3, }, },
Greg Kroah-Hartman
maintainerPATCH 120/203 pinctrl: sh-pfc: Fix PINMUX_IPSR_PHYS() to set GPSR
In reply to Greg Kroah-HartmanFrom: Keiya Nobuta <[email protected]>
commit d30710b8cce3a581c170d69002e311cc18ed47d3 upstream.
This patch allows PINMUX_IPSR_PHYS() to set bits in GPSR. When assigning function to pin, GPSR should be set to peripheral function.
For example when using SCL3, GPSR2 bit7 (PWM1_A pin) should be set to peripheral function.
--- drivers/pinctrl/sh-pfc/sh_pfc.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pinctrl/sh-pfc/sh_pfc.h +2 -2
@@ -422,12 +422,12 @@ extern const struct sh_pfc_soc_info shx3/* * Describe a pinmux configuration in which a pin is physically multiplexed * with other pins. -* - ipsr: IPSR field (unused, for documentation purposes only) +* - ipsr: IPSR field * - fn: Function name * - psel: Physical multiplexing selector */ #define PINMUX_IPSR_PHYS (ipsr, fn, psel) \ - PINMUX_DATA(fn##_MARK, FN_##psel) + PINMUX_DATA(fn##_MARK, FN_##psel, FN_##ipsr)/* * Describe a pinmux configuration for a single-function pin with GPIO
Greg Kroah-Hartman
maintainerPATCH 130/203 af_unix: add compat_ioctl support
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 5f6beb9e0f633f3cc845cdd67973c506372931b4 upstream.
The af_unix protocol family has a custom ioctl command (inexplicibly based on SIOCPROTOPRIVATE), but never had a compat_ioctl handler for 32-bit applications.
Since all commands are compatible here, add a trivial wrapper that performs the compat_ptr() conversion for SIOCOUTQ/SIOCINQ. SIOCUNIXFILE does not use the argument, but it doesn't hurt to also use compat_ptr() here.
--- net/unix/af_unix.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+)
net/unix/af_unix.c +19 -0
@@ -646,6 +646,9 @@ static __poll_t unix_poll(struct file *,static __poll_t unix_dgram_poll (struct file *,struct socket *,poll_table *);static int unix_ioctl (struct socket *,unsigned int ,unsigned long ); +#ifdef CONFIG_COMPAT +static int unix_compat_ioctl (struct socket *sock,unsigned int cmd,unsigned long arg); +#endif static int unix_shutdown (struct socket *,int );static int unix_stream_sendmsg (struct socket *,struct msghdr *,size_t );static int unix_stream_recvmsg (struct socket *,struct msghdr *,size_t ,int );
@@ -687,6 +690,9 @@ static const struct proto_ops unix_strea .getname = unix_getname, .poll = unix_poll, .ioctl = unix_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = unix_compat_ioctl, +#endif .listen = unix_listen, .shutdown = unix_shutdown, .setsockopt = sock_no_setsockopt,
@@ -710,6 +716,9 @@ static const struct proto_ops unix_dgram .getname = unix_getname, .poll = unix_dgram_poll, .ioctl = unix_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = unix_compat_ioctl, +#endif .listen = sock_no_listen, .shutdown = unix_shutdown, .setsockopt = sock_no_setsockopt,
@@ -732,6 +741,9 @@ static const struct proto_ops unix_seqpa .getname = unix_getname, .poll = unix_dgram_poll, .ioctl = unix_ioctl, +#ifdef CONFIG_COMPAT + .compat_ioctl = unix_compat_ioctl, +#endif .listen = unix_listen, .shutdown = unix_shutdown, .setsockopt = sock_no_setsockopt,
@@ -2582,6 +2594,13 @@ static int unix_ioctl(struct socket *socreturn err; } +#ifdef CONFIG_COMPAT +static int unix_compat_ioctl (struct socket *sock,unsigned int cmd,unsigned long arg) +{ +return unix_ioctl (sock, cmd, (unsigned long )compat_ptr (arg)); +} +#endif +static __poll_t unix_poll (struct file *file,struct socket *sock,poll_table *wait) {struct sock *sk = sock->sk;
Greg Kroah-Hartman
maintainerPATCH 132/203 PCI: aardvark: Use LTSSM state to build link training flag
In reply to Greg Kroah-HartmanFrom: Remi Pommarel <[email protected]>
commit 364b3f1ff8f096d45f042a9c85daf7a1fc78413e upstream.
Aardvark's PCI_EXP_LNKSTA_LT flag in its link status register is not implemented and does not reflect the actual link training state (the flag is always set to 0). In order to support link re-training feature this flag has to be emulated. The Link Training and Status State Machine (LTSSM) flag in Aardvark LMI config register could be used as a link training indicator. Indeed if the LTSSM is in L0 or upper state then link training has completed (see [1]).
Unfortunately because after asking a link retraining it takes a while for the LTSSM state to become less than 0x10 (due to L0s to recovery state transition delays), LTSSM can still be in L0 while link training has not finished yet. So this waits for link to be in recovery or lesser state before returning after asking for a link retrain.
[1] "PCI Express Base Specification", REV. 4.0
PCI Express, February 19 2014, Table 4-14
--- drivers/pci/controller/pci-aardvark.c | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-)
drivers/pci/controller/pci-aardvark.c +28 -1
@@ -180,6 +180,8 @@#define LINK_WAIT_MAX_RETRIES 10#define LINK_WAIT_USLEEP_MIN 90000#define LINK_WAIT_USLEEP_MAX 100000 +#define RETRAIN_WAIT_MAX_RETRIES 10 +#define RETRAIN_WAIT_USLEEP_US 2000#define MSI_IRQ_NUM 32
@@ -239,6 +241,17 @@ static int advk_pcie_wait_for_link(strucreturn -ETIMEDOUT ; } +static void advk_pcie_wait_for_retrain (struct advk_pcie *pcie) +{ +size_t retries; + +for (retries =0 ; retries <RETRAIN_WAIT_MAX_RETRIES ; ++retries) { +if (!advk_pcie_link_up (pcie)) +break ; +udelay (RETRAIN_WAIT_USLEEP_US ); + } +} +static void advk_pcie_setup_hw (struct advk_pcie *pcie) {u32 reg;
@@ -426,11 +439,20 @@ advk_pci_bridge_emul_pcie_conf_read(strureturn PCI_BRIDGE_EMUL_HANDLED ; } +case PCI_EXP_LNKCTL : { +/* u32 contains both PCI_EXP_LNKCTL and PCI_EXP_LNKSTA */ +u32 val =advk_readl (pcie,PCIE_CORE_PCIEXP_CAP + reg) & + ~(PCI_EXP_LNKSTA_LT <<16 ); +if (!advk_pcie_link_up (pcie)) + val |= (PCI_EXP_LNKSTA_LT <<16 ); + *value = val; +return PCI_BRIDGE_EMUL_HANDLED ; + } +case PCI_CAP_LIST_ID :case PCI_EXP_DEVCAP :case PCI_EXP_DEVCTL :case PCI_EXP_LNKCAP : -case PCI_EXP_LNKCTL : *value =advk_readl (pcie,PCIE_CORE_PCIEXP_CAP + reg);return PCI_BRIDGE_EMUL_HANDLED ;default :
@@ -447,8 +469,13 @@ advk_pci_bridge_emul_pcie_conf_write(strswitch (reg) {case PCI_EXP_DEVCTL : +advk_writel (pcie, new,PCIE_CORE_PCIEXP_CAP + reg); +break ; +case PCI_EXP_LNKCTL :advk_writel (pcie, new,PCIE_CORE_PCIEXP_CAP + reg); +if (new &PCI_EXP_LNKCTL_RL ) +advk_pcie_wait_for_retrain (pcie);break ;case PCI_EXP_RTCTL :
Greg Kroah-Hartman
maintainerPATCH 133/203 PCI: aardvark: Fix PCI_EXP_RTCTL register configuration
In reply to Greg Kroah-HartmanFrom: Remi Pommarel <[email protected]>
commit c0f05a6ab52535c1bf5f43272eede3e11c5701a5 upstream.
PCI_EXP_RTCTL is used to activate PME interrupt only, so writing into it should not modify other interrupts' mask. The ISR mask polarity was also inverted, when PCI_EXP_RTCTL_PMEIE is set PCIE_MSG_PM_PME_MASK mask bit should actually be cleared.
--- drivers/pci/controller/pci-aardvark.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-)
drivers/pci/controller/pci-aardvark.c +9 -4
@@ -428,7 +428,7 @@ advk_pci_bridge_emul_pcie_conf_read(strucase PCI_EXP_RTCTL : {u32 val =advk_readl (pcie,PCIE_ISR0_MASK_REG ); - *value = (val &PCIE_MSG_PM_PME_MASK ) ?PCI_EXP_RTCTL_PMEIE :0 ; + *value = (val &PCIE_MSG_PM_PME_MASK ) ?0 :PCI_EXP_RTCTL_PMEIE ;return PCI_BRIDGE_EMUL_HANDLED ; }
@@ -478,10 +478,15 @@ advk_pci_bridge_emul_pcie_conf_write(stradvk_pcie_wait_for_retrain (pcie);break ; -case PCI_EXP_RTCTL : - new = (new &PCI_EXP_RTCTL_PMEIE ) <<3 ; -advk_writel (pcie, new,PCIE_ISR0_MASK_REG ); +case PCI_EXP_RTCTL : { +/* Only mask/unmask PME interrupt */ +u32 val =advk_readl (pcie,PCIE_ISR0_MASK_REG ) & + ~PCIE_MSG_PM_PME_MASK ; +if ((new &PCI_EXP_RTCTL_PMEIE ) ==0 ) + val |=PCIE_MSG_PM_PME_MASK ; +advk_writel (pcie, val,PCIE_ISR0_MASK_REG );break ; + }case PCI_EXP_RTSTA : new = (new &PCI_EXP_RTSTA_PME ) >>9 ;
Greg Kroah-Hartman
maintainerPATCH 134/203 PCI: dwc: Fix find_next_bit() usage
In reply to Greg Kroah-HartmanFrom: Niklas Cassel <[email protected]>
commit 1137e61dcb99f7f8b54e77ed83f68b5b485a3e34 upstream.
find_next_bit() takes a parameter of size long, and performs arithmetic that assumes that the argument is of size long.
Therefore we cannot pass a u32, since this will cause find_next_bit() to read outside the stack buffer and will produce the following print:
BUG: KASAN: stack-out-of-bounds in find_next_bit+0x38/0xb0
--- drivers/pci/controller/dwc/pcie-designware-host.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-)
drivers/pci/controller/dwc/pcie-designware-host.c +6 -5
@@ -78,7 +78,8 @@ static struct msi_domain_info dw_pcie_msirqreturn_t dw_handle_msi_irq (struct pcie_port *pp) {int i, pos, irq; -u32 val, num_ctrls; +unsigned long val; +u32 status, num_ctrls;irqreturn_t ret =IRQ_NONE ; num_ctrls = pp->num_vectors /MAX_MSI_IRQS_PER_CTRL ;
@@ -86,14 +87,14 @@ irqreturn_t dw_handle_msi_irq(struct pcifor (i =0 ; i < num_ctrls; i++) {dw_pcie_rd_own_conf (pp,PCIE_MSI_INTR0_STATUS + (i *MSI_REG_CTRL_BLOCK_SIZE ), -4 , &val); -if (!val) +4 , &status); +if (!status)continue ; ret =IRQ_HANDLED ; + val = status; pos =0 ; -while ((pos =find_next_bit ((unsigned long *) &val, -MAX_MSI_IRQS_PER_CTRL , +while ((pos =find_next_bit (&val,MAX_MSI_IRQS_PER_CTRL , pos)) !=MAX_MSI_IRQS_PER_CTRL ) { irq = irq_find_mapping(pp->irq_domain, (i * MAX_MSI_IRQS_PER_CTRL) +
Greg Kroah-Hartman
maintainerPATCH 135/203 PCI: Fix missing bridge dma_ranges resource list cleanup
In reply to Greg Kroah-HartmanFrom: Rob Herring <[email protected]>
commit 7608158df3ed87a5c938c4a0b91f5b11101a9be1 upstream.
Commit e80a91ad302b ("PCI: Add dma_ranges window list") added a dma_ranges resource list, but failed to correctly free the list when devm_pci_alloc_host_bridge() is used.
Only the iproc host bridge driver is using the dma_ranges list.
--- drivers/pci/probe.c | 1 + 1 file changed, 1 insertion(+)
drivers/pci/probe.c +1 -0
@@ -572,6 +572,7 @@ static void devm_pci_release_host_bridge bridge->release_fn (bridge);pci_free_resource_list (&bridge->windows); +pci_free_resource_list (&bridge->dma_ranges); }static void pci_release_host_bridge_dev (struct device *dev)
Greg Kroah-Hartman
maintainerPATCH 122/203 pinctrl: lewisburg: Update pin list according to v1.1v6
In reply to Greg Kroah-HartmanFrom: Andy Shevchenko <[email protected]>
commit e66ff71fd0dba36a53f91f39e4da6c7b84764f2e upstream.
Version 1.1v6 of pin list has some changes in pin names for Intel Lewisburg.
Update the driver accordingly.
Note, it reveals the bug in the driver that misses two pins in GPP_L and has rather two extra ones. That's why the ordering of some groups is changed.
--- drivers/pinctrl/intel/pinctrl-lewisburg.c | 171 +++++++++++++++--------------- 1 file changed, 86 insertions(+), 85 deletions(-)
drivers/pinctrl/intel/pinctrl-lewisburg.c +86 -85
@@ -33,6 +33,7 @@ .npins = ((e) - (s) + 1), \ } +/* Lewisburg */ static const struct pinctrl_pin_desc lbg_pins[] = {/* GPP_A */ PINCTRL_PIN (0 ,"RCINB" ),
@@ -72,7 +73,7 @@ static const struct pinctrl_pin_desc lbgPINCTRL_PIN (33 ,"SRCCLKREQB_4" ),PINCTRL_PIN (34 ,"SRCCLKREQB_5" ),PINCTRL_PIN (35 ,"GPP_B_11" ), -PINCTRL_PIN (36 ,"GLB_RST_WARN_N" ), +PINCTRL_PIN (36 ,"SLP_S0B" ),PINCTRL_PIN (37 ,"PLTRSTB" ),PINCTRL_PIN (38 ,"SPKR" ), PINCTRL_PIN(39, "GPP_B_15"),
@@ -185,96 +186,96 @@ static const struct pinctrl_pin_desc lbgPINCTRL_PIN (141 ,"GBE_PCI_DIS" ),PINCTRL_PIN (142 ,"GBE_LAN_DIS" ),PINCTRL_PIN (143 ,"GPP_I_10" ), -PINCTRL_PIN (144 ,"GPIO_RCOMP_3P3" ),/* GPP_J */ -PINCTRL_PIN (145 ,"GBE_LED_0_0" ), -PINCTRL_PIN (146 ,"GBE_LED_0_1" ), -PINCTRL_PIN (147 ,"GBE_LED_1_0" ), -PINCTRL_PIN (148 ,"GBE_LED_1_1" ), -PINCTRL_PIN (149 ,"GBE_LED_2_0" ), -PINCTRL_PIN (150 ,"GBE_LED_2_1" ), -PINCTRL_PIN (151 ,"GBE_LED_3_0" ), -PINCTRL_PIN (152 ,"GBE_LED_3_1" ), -PINCTRL_PIN (153 ,"GBE_SCL_0" ), -PINCTRL_PIN (154 ,"GBE_SDA_0" ), -PINCTRL_PIN (155 ,"GBE_SCL_1" ), -PINCTRL_PIN (156 ,"GBE_SDA_1" ), -PINCTRL_PIN (157 ,"GBE_SCL_2" ), -PINCTRL_PIN (158 ,"GBE_SDA_2" ), -PINCTRL_PIN (159 ,"GBE_SCL_3" ), -PINCTRL_PIN (160 ,"GBE_SDA_3" ), -PINCTRL_PIN (161 ,"GBE_SDP_0_0" ), -PINCTRL_PIN (162 ,"GBE_SDP_0_1" ), -PINCTRL_PIN (163 ,"GBE_SDP_1_0" ), -PINCTRL_PIN (164 ,"GBE_SDP_1_1" ), -PINCTRL_PIN (165 ,"GBE_SDP_2_0" ), -PINCTRL_PIN (166 ,"GBE_SDP_2_1" ), -PINCTRL_PIN (167 ,"GBE_SDP_3_0" ), -PINCTRL_PIN (168 ,"GBE_SDP_3_1" ), +PINCTRL_PIN (144 ,"GBE_LED_0_0" ), +PINCTRL_PIN (145 ,"GBE_LED_0_1" ), +PINCTRL_PIN (146 ,"GBE_LED_1_0" ), +PINCTRL_PIN (147 ,"GBE_LED_1_1" ), +PINCTRL_PIN (148 ,"GBE_LED_2_0" ), +PINCTRL_PIN (149 ,"GBE_LED_2_1" ), +PINCTRL_PIN (150 ,"GBE_LED_3_0" ), +PINCTRL_PIN (151 ,"GBE_LED_3_1" ), +PINCTRL_PIN (152 ,"GBE_SCL_0" ), +PINCTRL_PIN (153 ,"GBE_SDA_0" ), +PINCTRL_PIN (154 ,"GBE_SCL_1" ), +PINCTRL_PIN (155 ,"GBE_SDA_1" ), +PINCTRL_PIN (156 ,"GBE_SCL_2" ), +PINCTRL_PIN (157 ,"GBE_SDA_2" ), +PINCTRL_PIN (158 ,"GBE_SCL_3" ), +PINCTRL_PIN (159 ,"GBE_SDA_3" ), +PINCTRL_PIN (160 ,"GBE_SDP_0_0" ), +PINCTRL_PIN (161 ,"GBE_SDP_0_1" ), +PINCTRL_PIN (162 ,"GBE_SDP_1_0" ), +PINCTRL_PIN (163 ,"GBE_SDP_1_1" ), +PINCTRL_PIN (164 ,"GBE_SDP_2_0" ), +PINCTRL_PIN (165 ,"GBE_SDP_2_1" ), +PINCTRL_PIN (166 ,"GBE_SDP_3_0" ), +PINCTRL_PIN (167 ,"GBE_SDP_3_1" ),/* GPP_K */ -PINCTRL_PIN (169 ,"GBE_RMIICLK" ), -PINCTRL_PIN (170 ,"GBE_RMII_TXD_0" ), -PINCTRL_PIN (171 ,"GBE_RMII_TXD_1" ), +PINCTRL_PIN (168 ,"GBE_RMIICLK" ), +PINCTRL_PIN (169 ,"GBE_RMII_RXD_0" ), +PINCTRL_PIN (170 ,"GBE_RMII_RXD_1" ), +PINCTRL_PIN (171 ,"GBE_RMII_CRS_DV" ),PINCTRL_PIN (172 ,"GBE_RMII_TX_EN" ), -PINCTRL_PIN (173 ,"GBE_RMII_CRS_DV" ), -PINCTRL_PIN (174 ,"GBE_RMII_RXD_0" ), -PINCTRL_PIN (175 ,"GBE_RMII_RXD_1" ), -PINCTRL_PIN (176 ,"GBE_RMII_RX_ER" ), -PINCTRL_PIN (177 ,"GBE_RMII_ARBIN" ), -PINCTRL_PIN (178 ,"GBE_RMII_ARB_OUT" ), -PINCTRL_PIN (179 ,"PE_RST_N" ), -PINCTRL_PIN (180 ,"GPIO_RCOMP_1P8_3P3" ), +PINCTRL_PIN (173 ,"GBE_RMII_TXD_0" ), +PINCTRL_PIN (174 ,"GBE_RMII_TXD_1" ), +PINCTRL_PIN (175 ,"GBE_RMII_RX_ER" ), +PINCTRL_PIN (176 ,"GBE_RMII_ARBIN" ), +PINCTRL_PIN (177 ,"GBE_RMII_ARB_OUT" ), +PINCTRL_PIN (178 ,"PE_RST_N" ),/* GPP_G */ -PINCTRL_PIN (181 ,"FAN_TACH_0" ), -PINCTRL_PIN (182 ,"FAN_TACH_1" ), -PINCTRL_PIN (183 ,"FAN_TACH_2" ), -PINCTRL_PIN (184 ,"FAN_TACH_3" ), -PINCTRL_PIN (185 ,"FAN_TACH_4" ), -PINCTRL_PIN (186 ,"FAN_TACH_5" ), -PINCTRL_PIN (187 ,"FAN_TACH_6" ), -PINCTRL_PIN (188 ,"FAN_TACH_7" ), -PINCTRL_PIN (189 ,"FAN_PWM_0" ), -PINCTRL_PIN (190 ,"FAN_PWM_1" ), -PINCTRL_PIN (191 ,"FAN_PWM_2" ), -PINCTRL_PIN (192 ,"FAN_PWM_3" ), -PINCTRL_PIN (193 ,"GSXDOUT" ), -PINCTRL_PIN (194 ,"GSXSLOAD" ), -PINCTRL_PIN (195 ,"GSXDIN" ), -PINCTRL_PIN (196 ,"GSXSRESETB" ), -PINCTRL_PIN (197 ,"GSXCLK" ), -PINCTRL_PIN (198 ,"ADR_COMPLETE" ), -PINCTRL_PIN (199 ,"NMIB" ), -PINCTRL_PIN (200 ,"SMIB" ), -PINCTRL_PIN (201 ,"SSATA_DEVSLP_0" ), -PINCTRL_PIN (202 ,"SSATA_DEVSLP_1" ), -PINCTRL_PIN (203 ,"SSATA_DEVSLP_2" ), -PINCTRL_PIN (204 ,"SSATAXPCIE0_SSATAGP0" ), +PINCTRL_PIN (179 ,"FAN_TACH_0" ), +PINCTRL_PIN (180 ,"FAN_TACH_1" ), +PINCTRL_PIN (181 ,"FAN_TACH_2" ), +PINCTRL_PIN (182 ,"FAN_TACH_3" ), +PINCTRL_PIN (183 ,"FAN_TACH_4" ), +PINCTRL_PIN (184 ,"FAN_TACH_5" ), +PINCTRL_PIN (185 ,"FAN_TACH_6" ), +PINCTRL_PIN (186 ,"FAN_TACH_7" ), +PINCTRL_PIN (187 ,"FAN_PWM_0" ), +PINCTRL_PIN (188 ,"FAN_PWM_1" ), +PINCTRL_PIN (189 ,"FAN_PWM_2" ), +PINCTRL_PIN (190 ,"FAN_PWM_3" ), +PINCTRL_PIN (191 ,"GSXDOUT" ), +PINCTRL_PIN (192 ,"GSXSLOAD" ), +PINCTRL_PIN (193 ,"GSXDIN" ), +PINCTRL_PIN (194 ,"GSXSRESETB" ), +PINCTRL_PIN (195 ,"GSXCLK" ), +PINCTRL_PIN (196 ,"ADR_COMPLETE" ), +PINCTRL_PIN (197 ,"NMIB" ), +PINCTRL_PIN (198 ,"SMIB" ), +PINCTRL_PIN (199 ,"SSATA_DEVSLP_0" ), +PINCTRL_PIN (200 ,"SSATA_DEVSLP_1" ), +PINCTRL_PIN (201 ,"SSATA_DEVSLP_2" ), +PINCTRL_PIN (202 ,"SSATAXPCIE0_SSATAGP0" ),/* GPP_H */ -PINCTRL_PIN (205 ,"SRCCLKREQB_6" ), -PINCTRL_PIN (206 ,"SRCCLKREQB_7" ), -PINCTRL_PIN (207 ,"SRCCLKREQB_8" ), -PINCTRL_PIN (208 ,"SRCCLKREQB_9" ), -PINCTRL_PIN (209 ,"SRCCLKREQB_10" ), -PINCTRL_PIN (210 ,"SRCCLKREQB_11" ), -PINCTRL_PIN (211 ,"SRCCLKREQB_12" ), -PINCTRL_PIN (212 ,"SRCCLKREQB_13" ), -PINCTRL_PIN (213 ,"SRCCLKREQB_14" ), -PINCTRL_PIN (214 ,"SRCCLKREQB_15" ), -PINCTRL_PIN (215 ,"SML2CLK" ), -PINCTRL_PIN (216 ,"SML2DATA" ), -PINCTRL_PIN (217 ,"SML2ALERTB" ), -PINCTRL_PIN (218 ,"SML3CLK" ), -PINCTRL_PIN (219 ,"SML3DATA" ), -PINCTRL_PIN (220 ,"SML3ALERTB" ), -PINCTRL_PIN (221 ,"SML4CLK" ), -PINCTRL_PIN (222 ,"SML4DATA" ), -PINCTRL_PIN (223 ,"SML4ALERTB" ), -PINCTRL_PIN (224 ,"SSATAXPCIE1_SSATAGP1" ), -PINCTRL_PIN (225 ,"SSATAXPCIE2_SSATAGP2" ), -PINCTRL_PIN (226 ,"SSATAXPCIE3_SSATAGP3" ), -PINCTRL_PIN (227 ,"SSATAXPCIE4_SSATAGP4" ), -PINCTRL_PIN (228 ,"SSATAXPCIE5_SSATAGP5" ), +PINCTRL_PIN (203 ,"SRCCLKREQB_6" ), +PINCTRL_PIN (204 ,"SRCCLKREQB_7" ), +PINCTRL_PIN (205 ,"SRCCLKREQB_8" ), +PINCTRL_PIN (206 ,"SRCCLKREQB_9" ), +PINCTRL_PIN (207 ,"SRCCLKREQB_10" ), +PINCTRL_PIN (208 ,"SRCCLKREQB_11" ), +PINCTRL_PIN (209 ,"SRCCLKREQB_12" ), +PINCTRL_PIN (210 ,"SRCCLKREQB_13" ), +PINCTRL_PIN (211 ,"SRCCLKREQB_14" ), +PINCTRL_PIN (212 ,"SRCCLKREQB_15" ), +PINCTRL_PIN (213 ,"SML2CLK" ), +PINCTRL_PIN (214 ,"SML2DATA" ), +PINCTRL_PIN (215 ,"SML2ALERTB" ), +PINCTRL_PIN (216 ,"SML3CLK" ), +PINCTRL_PIN (217 ,"SML3DATA" ), +PINCTRL_PIN (218 ,"SML3ALERTB" ), +PINCTRL_PIN (219 ,"SML4CLK" ), +PINCTRL_PIN (220 ,"SML4DATA" ), +PINCTRL_PIN (221 ,"SML4ALERTB" ), +PINCTRL_PIN (222 ,"SSATAXPCIE1_SSATAGP1" ), +PINCTRL_PIN (223 ,"SSATAXPCIE2_SSATAGP2" ), +PINCTRL_PIN (224 ,"SSATAXPCIE3_SSATAGP3" ), +PINCTRL_PIN (225 ,"SSATAXPCIE4_SSATAGP4" ), +PINCTRL_PIN (226 ,"SSATAXPCIE5_SSATAGP5" ),/* GPP_L */ +PINCTRL_PIN (227 ,"GPP_L_0" ), +PINCTRL_PIN (228 ,"EC_CSME_INTR_OUT" ),PINCTRL_PIN (229 ,"VISA2CH0_D0" ),PINCTRL_PIN (230 ,"VISA2CH0_D1" ), PINCTRL_PIN(231, "VISA2CH0_D2"),
Greg Kroah-Hartman
maintainerPATCH 124/203 Revert "drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper."
In reply to Greg Kroah-HartmanFrom: Greg Kroah-Hartman <[email protected]>
This reverts commit e6733ec8948475c4b62574e452135dc629294d75 which is commit 29cf12394c0565d7eb1685bf0c1b4749aa6a8b66 upstream.
Alistair writes:
After updating to 5.4.7 we noticed that virtio_gpu's wait ioctl stopped working correctly.
It looks like 29cf12394c05 ("drm/virtio: switch virtio_gpu_wait_ioctl() to gem helper.") was picked up automatically, but it depends on 889165ad6190 ("drm/virtio: pass gem reservation object to ttm init") from earlier in Gerd's series in Linus's tree, which was not picked up.
--- drivers/gpu/drm/virtio/virtgpu_ioctl.c | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-)
drivers/gpu/drm/virtio/virtgpu_ioctl.c +12 -16
@@ -463,29 +463,25 @@ out: }static int virtio_gpu_wait_ioctl (struct drm_device *dev,void *data, -struct drm_file *file) +struct drm_file *file) {struct drm_virtgpu_3d_wait *args = data; -struct drm_gem_object *obj; -long timeout =15 *HZ ; +struct drm_gem_object *gobj =NULL ; +struct virtio_gpu_object *qobj =NULL ;int ret; +bool nowait = false; - obj =drm_gem_object_lookup (file, args->handle); -if (obj ==NULL ) + gobj =drm_gem_object_lookup (file, args->handle); +if (gobj ==NULL )return -ENOENT ; -if (args->flags &VIRTGPU_WAIT_NOWAIT ) { - ret =dma_resv_test_signaled_rcu (obj->resv, true); - }else { - ret =dma_resv_wait_timeout_rcu (obj->resv, true, true, - timeout); - } -if (ret ==0 ) - ret = -EBUSY ; -else if (ret >0 ) - ret =0 ; + qobj =gem_to_virtio_gpu_obj (gobj); -drm_gem_object_put_unlocked (obj); +if (args->flags &VIRTGPU_WAIT_NOWAIT ) + nowait = true; + ret =virtio_gpu_object_wait (qobj, nowait); + +drm_gem_object_put_unlocked (gobj);return ret; }
Greg Kroah-Hartman
maintainerPATCH 125/203 drm/amdgpu: cleanup creating BOs at fixed location (v2)
In reply to Greg Kroah-HartmanFrom: Christian König <[email protected]>
commit de7b45babd9be25138ff5e4a0c34eefffbb226ff upstream.
The placement is something TTM/BO internal and the RAS code should avoid touching that directly.
Add a helper to create a BO at a fixed location and use that instead.
v2: squash in fixes (Alex)
--- drivers/gpu/drm/amd/amdgpu/amdgpu_object.c | 61 ++++++++++++++++++++ drivers/gpu/drm/amd/amdgpu/amdgpu_object.h | 3 + drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c | 85 ++--------------------------- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 82 ++++----------------------- 4 files changed, 83 insertions(+), 148 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_object.c +61 -0
@@ -343,6 +343,67 @@ int amdgpu_bo_create_kernel(struct amdgp }/** +* amdgpu_bo_create_kernel_at - create BO for kernel use at specific location +* +* @adev: amdgpu device object +* @offset: offset of the BO +* @size: size of the BO +* @domain: where to place it +* @bo_ptr: used to initialize BOs in structures +* @cpu_addr: optional CPU address mapping +* +* Creates a kernel BO at a specific offset in the address space of the domain. +* +* Returns: +* 0 on success, negative error code otherwise. +*/ +int amdgpu_bo_create_kernel_at (struct amdgpu_device *adev, +uint64_t offset,uint64_t size,uint32_t domain, +struct amdgpu_bo **bo_ptr,void **cpu_addr) +{ +struct ttm_operation_ctx ctx = { false, false }; +unsigned int i; +int r; + + offset &=PAGE_MASK ; + size =ALIGN (size,PAGE_SIZE ); + + r =amdgpu_bo_create_reserved (adev, size,PAGE_SIZE , domain, bo_ptr, +NULL ,NULL ); +if (r) +return r; + +/* +* Remove the original mem node and create a new one at the request +* position. +*/ +for (i =0 ; i < (*bo_ptr)->placement.num_placement; ++i) { + (*bo_ptr)->placements[i].fpfn = offset >>PAGE_SHIFT ; + (*bo_ptr)->placements[i].lpfn = (offset + size) >>PAGE_SHIFT ; + } + +ttm_bo_mem_put (&(*bo_ptr)->tbo, &(*bo_ptr)->tbo.mem); + r =ttm_bo_mem_space (&(*bo_ptr)->tbo, &(*bo_ptr)->placement, + &(*bo_ptr)->tbo.mem, &ctx); +if (r) + goto error; + +if (cpu_addr) { + r =amdgpu_bo_kmap (*bo_ptr, cpu_addr); +if (r) + goto error; + } + +amdgpu_bo_unreserve (*bo_ptr); +return 0 ; + +error: +amdgpu_bo_unreserve (*bo_ptr); +amdgpu_bo_unref (bo_ptr); +return r; +} + +/** * amdgpu_bo_free_kernel - free BO for kernel use * * @bo: amdgpu BO to free
drivers/gpu/drm/amd/amdgpu/amdgpu_object.h +3 -0
@@ -237,6 +237,9 @@ int amdgpu_bo_create_kernel(struct amdgp unsigned long size, int align, u32 domain, struct amdgpu_bo **bo_ptr, u64 *gpu_addr, void **cpu_addr); +int amdgpu_bo_create_kernel_at (struct amdgpu_device *adev, +uint64_t offset,uint64_t size,uint32_t domain, +struct amdgpu_bo **bo_ptr,void **cpu_addr);void amdgpu_bo_free_kernel (struct amdgpu_bo **bo,u64 *gpu_addr,void **cpu_addr);int amdgpu_bo_kmap (struct amdgpu_bo *bo,void **ptr);
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +6 -79
119 lines not on this page · raw message
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +13 -69
94 lines not on this page · raw message
Greg Kroah-Hartman
maintainerPATCH 126/203 drm/amdgpu/discovery: reserve discovery data at the top of VRAM
In reply to Greg Kroah-HartmanFrom: Xiaojie Yuan <[email protected]>
commit 5f6a556f98de425fcb7928456839a06f02156633 upstream.
IP Discovery data is TMR fenced by the latest PSP BL, so we need to reserve this region.
Tested on navi10/12/14 with VBIOS integrated with latest PSP BL.
v2: use DISCOVERY_TMR_SIZE macro as bo size
use amdgpu_bo_create_kernel_at() to allocate bo
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 1 + drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c | 4 ++-- drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.h | 2 ++ drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 17 +++++++++++++++++ drivers/gpu/drm/amd/include/discovery.h | 1 - 5 files changed, 22 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -0
@@ -813,6 +813,7 @@ struct amdgpu_device {uint8_t *bios;uint32_t bios_size;struct amdgpu_bo *stolen_vga_memory; +struct amdgpu_bo *discovery_memory;uint32_t bios_scratch_reg_offset;uint32_t bios_scratch[AMDGPU_BIOS_NUM_SCRATCH ];
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +2 -2
@@ -136,7 +136,7 @@ static int amdgpu_discovery_read_binary( {uint32_t *p = (uint32_t *)binary;uint64_t vram_size = (uint64_t )RREG32 (mmRCC_CONFIG_MEMSIZE) <<20 ; -uint64_t pos = vram_size -BINARY_MAX_SIZE ; +uint64_t pos = vram_size -DISCOVERY_TMR_SIZE ;unsigned long flags;while (pos < vram_size) {
@@ -179,7 +179,7 @@ int amdgpu_discovery_init(struct amdgpu_uint16_t checksum;int r; - adev->discovery =kzalloc (BINARY_MAX_SIZE ,GFP_KERNEL ); + adev->discovery =kzalloc (DISCOVERY_TMR_SIZE ,GFP_KERNEL );if (!adev->discovery)return -ENOMEM ;
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.h +2 -0
@@ -24,6 +24,8 @@#ifndef __AMDGPU_DISCOVERY__#define __AMDGPU_DISCOVERY__ +#define DISCOVERY_TMR_SIZE (64 << 10) +int amdgpu_discovery_init (struct amdgpu_device *adev);void amdgpu_discovery_fini (struct amdgpu_device *adev);int amdgpu_discovery_reg_base_init (struct amdgpu_device *adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +17 -0
@@ -1730,6 +1730,20 @@ int amdgpu_ttm_init(struct amdgpu_device NULL, &stolen_vga_buf);if (r)return r; + +/* +* reserve one TMR (64K) memory at the top of VRAM which holds +* IP Discovery data and is protected by PSP. +*/ + r =amdgpu_bo_create_kernel_at (adev, + adev->gmc.real_vram_size -DISCOVERY_TMR_SIZE , +DISCOVERY_TMR_SIZE , +AMDGPU_GEM_DOMAIN_VRAM , + &adev->discovery_memory, +NULL ); +if (r) +return r; +DRM_INFO ("amdgpu: %uM of VRAM memory ready\n" , (unsigned ) (adev->gmc.real_vram_size / (1024 *1024 )));
@@ -1794,6 +1808,9 @@ void amdgpu_ttm_late_init(struct amdgpu_void *stolen_vga_buf;/* return the VGA stolen memory (if any) back to VRAM */ amdgpu_bo_free_kernel (&adev->stolen_vga_memory,NULL , &stolen_vga_buf); + +/* return the IP Discovery TMR memory back to VRAM */ +amdgpu_bo_free_kernel (&adev->discovery_memory,NULL ,NULL ); }/**
drivers/gpu/drm/amd/include/discovery.h +0 -1
@@ -25,7 +25,6 @@#define _DISCOVERY_H_#define PSP_HEADER_SIZE 256 -#define BINARY_MAX_SIZE (64 << 10)#define BINARY_SIGNATURE 0x28211407#define DISCOVERY_TABLE_SIGNATURE 0x53445049
Greg Kroah-Hartman
maintainerPATCH 127/203 scsi: sd: enable compat ioctls for sed-opal
In reply to Greg Kroah-HartmanFrom: Arnd Bergmann <[email protected]>
commit 142b2ac82e31c174936c5719fa12ae28f51a55b7 upstream.
The sed_ioctl() function is written to be compatible between 32-bit and 64-bit processes, however compat mode is only wired up for nvme, not for sd.
Add the missing call to sed_ioctl() in sd_compat_ioctl().
--- drivers/scsi/sd.c | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-)
drivers/scsi/sd.c +12 -2
@@ -1694,20 +1694,30 @@ static void sd_rescan(struct device *devstatic int sd_compat_ioctl (struct block_device *bdev,fmode_t mode,unsigned int cmd,unsigned long arg) { -struct scsi_device *sdev =scsi_disk (bdev->bd_disk)->device; +struct gendisk *disk = bdev->bd_disk; +struct scsi_disk *sdkp =scsi_disk (disk); +struct scsi_device *sdev = sdkp->device; +void __user *p =compat_ptr (arg);int error; + error =scsi_verify_blk_ioctl (bdev, cmd); +if (error <0 ) +return error; + error =scsi_ioctl_block_when_processing_errors (sdev, cmd, (mode &FMODE_NDELAY ) !=0 );if (error)return error; + +if (is_sed_ioctl (cmd)) +return sed_ioctl (sdkp->opal_dev, cmd, p);/* * Let the static ioctl translation table take care of it. */ if (!sdev->host->hostt->compat_ioctl)return -ENOIOCTLCMD ; -return sdev->host->hostt->compat_ioctl (sdev, cmd, (void __user *)arg); +return sdev->host->hostt->compat_ioctl (sdev, cmd, p); }#endif
Greg Kroah-Hartman
maintainerPATCH 138/203 PCI/PTM: Remove spurious "d" from granularity message
In reply to Greg Kroah-HartmanFrom: Bjorn Helgaas <[email protected]>
commit 127a7709495db52a41012deaebbb7afc231dad91 upstream.
The granularity message has an extra "d":
pci 0000:02:00.0: PTM enabled, 4dns granularity
Remove the "d" so the message is simply "PTM enabled, 4ns granularity".
--- drivers/pci/pcie/ptm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pci/pcie/ptm.c +1 -1
@@ -21,7 +21,7 @@ static void pci_ptm_info(struct pci_devsnprintf (clock_desc,sizeof (clock_desc),">254ns" );break ;default : -snprintf (clock_desc,sizeof (clock_desc),"%udns" , +snprintf (clock_desc,sizeof (clock_desc),"%uns" , dev->ptm_granularity);break ; }
Greg Kroah-Hartman
maintainerPATCH 119/203 pinctl: ti: iodelay: fix error checking on pinctrl_count_index_with_args call
In reply to Greg Kroah-HartmanFrom: Colin Ian King <[email protected]>
commit 5ff8aca906f3a7a7db79fad92f2a4401107ef50d upstream.
The call to pinctrl_count_index_with_args checks for a -EINVAL return however this function calls pinctrl_get_list_and_count and this can return -ENOENT. Rather than check for a specific error, fix this by checking for any error return to catch the -ENOENT case.
Addresses-Coverity: ("Improper use of negative")
--- drivers/pinctrl/ti/pinctrl-ti-iodelay.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/pinctrl/ti/pinctrl-ti-iodelay.c +1 -1
@@ -496,7 +496,7 @@ static int ti_iodelay_dt_node_to_map(strreturn -EINVAL ; rows =pinctrl_count_index_with_args (np, name); -if (rows == -EINVAL ) +if (rows <0 )return rows; *map =devm_kzalloc (iod->dev,sizeof (**map),GFP_KERNEL );
Greg Kroah-Hartman
maintainerPATCH 150/203 media: rcar-vin: Fix incorrect return statement in rvin_try_format()
In reply to Greg Kroah-HartmanFrom: Niklas Söderlund <[email protected]>
commit a0862a40364e2f87109317e31c51c9d7bc89e33f upstream.
While refactoring code the return statement became corrupted, fix it by returning the correct return code.
--- drivers/media/platform/rcar-vin/rcar-v4l2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/platform/rcar-vin/rcar-v4l2.c +2 -1
@@ -208,6 +208,7 @@ static int rvin_try_format(struct rvin_d ret =v4l2_subdev_call (sd, pad, set_fmt, pad_cfg, &format);if (ret <0 && ret != -ENOIOCTLCMD ) goto done; + ret =0 ;v4l2_fill_pix_format (pix, &format.format);
@@ -242,7 +243,7 @@ static int rvin_try_format(struct rvin_d done:v4l2_subdev_free_pad_config (pad_cfg); -return 0 ; +return ret; } static int rvin_querycap(struct file *file, void *priv,
Greg Kroah-Hartman
maintainerPATCH 147/203 media: ov6650: Fix some format attributes not under control
In reply to Greg Kroah-HartmanFrom: Janusz Krzysztofik <[email protected]>
commit 1c6a2b63095154bbf9e8f38d79487a728331bf65 upstream.
User arguments passed to .get/set_fmt() pad operation callbacks may contain unsupported values. The driver takes control over frame size and pixel code as well as colorspace and field attributes but has never cared for remainig format attributes, i.e., ycbcr_enc, quantization and xfer_func, introduced by commit 11ff030c7365 ("[media]
v4l2-mediabus: improve colorspace support"). Fix it.
Set up a static v4l2_mbus_framefmt structure with attributes initialized to reasonable defaults and use it for updating content of user provided arguments. In case of V4L2_SUBDEV_FORMAT_ACTIVE, postpone frame size update, now performed from inside ov6650_s_fmt() helper, util the user argument is first updated in ov6650_set_fmt() with default frame format content. For V4L2_SUBDEV_FORMAT_TRY, don't copy all attributes to pad config, only those handled by the driver, then fill the response with the default frame format updated with resulting pad config format code and frame size.
--- drivers/media/i2c/ov6650.c | 51 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 39 insertions(+), 12 deletions(-)
drivers/media/i2c/ov6650.c +39 -12
@@ -213,6 +213,17 @@ static u32 ov6650_codes[] = { MEDIA_BUS_FMT_Y8_1X8, }; +static const struct v4l2_mbus_framefmt ov6650_def_fmt = { + .width =W_CIF , + .height =H_CIF , + .code =MEDIA_BUS_FMT_SBGGR8_1X8 , + .colorspace =V4L2_COLORSPACE_SRGB , + .field =V4L2_FIELD_NONE , + .ycbcr_enc =V4L2_YCBCR_ENC_DEFAULT , + .quantization =V4L2_QUANTIZATION_DEFAULT , + .xfer_func =V4L2_XFER_FUNC_DEFAULT , +}; +/* read a register */ static int ov6650_reg_read (struct i2c_client *client,u8 reg,u8 *val) {
@@ -513,11 +524,13 @@ static int ov6650_get_fmt(struct v4l2_suif (format->pad)return -EINVAL ; +/* initialize response with default media bus frame format */ + *mf = ov6650_def_fmt; + +/* update media bus format code and frame size */ mf->width = priv->rect.width >> priv->half_scale; mf->height = priv->rect.height >> priv->half_scale; mf->code = priv->code; - mf->colorspace =V4L2_COLORSPACE_SRGB ; - mf->field =V4L2_FIELD_NONE ;return 0 ; }
@@ -656,10 +669,6 @@ static int ov6650_s_fmt(struct v4l2_subdif (!ret) priv->code = code; -if (!ret) { - mf->width = priv->rect.width >> half_scale; - mf->height = priv->rect.height >> half_scale; - }return ret; }
@@ -678,9 +687,6 @@ static int ov6650_set_fmt(struct v4l2_suv4l_bound_align_image (&mf->width,2 ,W_CIF ,1 , &mf->height,2 ,H_CIF ,1 ,0 ); - mf->field =V4L2_FIELD_NONE ; - mf->colorspace =V4L2_COLORSPACE_SRGB ; -switch (mf->code) {case MEDIA_BUS_FMT_Y10_1X10 : mf->code =MEDIA_BUS_FMT_Y8_1X8 ;
@@ -698,10 +704,31 @@ static int ov6650_set_fmt(struct v4l2_subreak ; } -if (format->which ==V4L2_SUBDEV_FORMAT_ACTIVE ) -return ov6650_s_fmt (sd, mf); - cfg->try_fmt = *mf; +if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { +/* store media bus format code and frame size in pad config */ + cfg->try_fmt.width = mf->width; + cfg->try_fmt.height = mf->height; + cfg->try_fmt.code = mf->code; + +/* return default mbus frame format updated with pad config */ + *mf = ov6650_def_fmt; + mf->width = cfg->try_fmt.width; + mf->height = cfg->try_fmt.height; + mf->code = cfg->try_fmt.code; + + }else { +/* apply new media bus format code and frame size */ +int ret =ov6650_s_fmt (sd, mf); +if (ret) +return ret; + +/* return default format updated with active size and code */ + *mf = ov6650_def_fmt; + mf->width = priv->rect.width >> priv->half_scale; + mf->height = priv->rect.height >> priv->half_scale; + mf->code = priv->code; + }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 148/203 media: ov6650: Fix .get_fmt() V4L2_SUBDEV_FORMAT_TRY support
In reply to Greg Kroah-HartmanFrom: Janusz Krzysztofik <[email protected]>
commit 39034bb0c26b76a2c3abc54aa28c185f18b40c2f upstream.
Commit da298c6d98d5 ("[media] v4l2: replace video op g_mbus_fmt by pad op get_fmt") converted a former ov6650_g_fmt() video operation callback to an ov6650_get_fmt() pad operation callback. However, the converted function disregards a format->which flag that pad operations should obey and always returns active frame format settings.
That can be fixed by always responding to V4L2_SUBDEV_FORMAT_TRY with -EINVAL, or providing the response from a pad config argument, likely updated by a former user call to V4L2_SUBDEV_FORMAT_TRY .set_fmt(). Since implementation of the latter is trivial, go for it.
--- drivers/media/i2c/ov6650.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/media/i2c/ov6650.c +9 -3
@@ -528,10 +528,16 @@ static int ov6650_get_fmt(struct v4l2_su *mf = ov6650_def_fmt;/* update media bus format code and frame size */ - mf->width = priv->rect.width >> priv->half_scale; - mf->height = priv->rect.height >> priv->half_scale; - mf->code = priv->code; +if (format->which ==V4L2_SUBDEV_FORMAT_TRY ) { + mf->width = cfg->try_fmt.width; + mf->height = cfg->try_fmt.height; + mf->code = cfg->try_fmt.code; + }else { + mf->width = priv->rect.width >> priv->half_scale; + mf->height = priv->rect.height >> priv->half_scale; + mf->code = priv->code; + }return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 152/203 media: v4l: cadence: Fix how unsued lanes are handled in csi2rx_start()
In reply to Greg Kroah-HartmanFrom: Christophe JAILLET <[email protected]>
commit 2eca8e4c1df4864b937752c3aa2f7925114f4806 upstream.
The 2nd parameter of 'find_first_zero_bit()' is a number of bits, not of bytes. So use 'csi2rx->max_lanes' instead of 'sizeof(lanes_used)'.
--- drivers/media/platform/cadence/cdns-csi2rx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/cadence/cdns-csi2rx.c +1 -1
@@ -129,7 +129,7 @@ static int csi2rx_start(struct csi2rx_pr*/ for (i = csi2rx->num_lanes; i < csi2rx->max_lanes; i++) {unsigned int idx =find_first_zero_bit (&lanes_used, -sizeof (lanes_used)); + csi2rx->max_lanes);set_bit (idx, &lanes_used); reg |=CSI2RX_STATIC_CFG_DLANE_MAP (i, i +1 ); }
Greg Kroah-Hartman
maintainerPATCH 149/203 media: ov6650: Fix default format not applied on device probe
In reply to Greg Kroah-HartmanFrom: Janusz Krzysztofik <[email protected]>
commit 5439fa9263cb293e41168bc03711ec18c4f11cba upstream.
It is not clear what pixel format is actually configured in hardware on reset. MEDIA_BUS_FMT_YUYV8_2X8, assumed on device probe since the driver was intiially submitted, is for sure not the one.
Fix it by explicitly applying a known, driver default frame format just after initial device reset.
--- drivers/media/i2c/ov6650.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/media/i2c/ov6650.c +5 -2
@@ -877,6 +877,11 @@ static int ov6650_video_probe(struct v4l ret =ov6650_reset (client);if (!ret) ret =ov6650_prog_dflt (client); +if (!ret) { +struct v4l2_mbus_framefmt mf = ov6650_def_fmt; + + ret =ov6650_s_fmt (sd, &mf); + }if (!ret) ret =v4l2_ctrl_handler_setup (&priv->hdl);
@@ -1031,8 +1036,6 @@ static int ov6650_probe(struct i2c_clien priv->rect.top =DEF_VSTRT <<1 ; priv->rect.width =W_CIF ; priv->rect.height =H_CIF ; - priv->half_scale = false; - priv->code =MEDIA_BUS_FMT_YUYV8_2X8 ;/* Hardware default frame interval */ priv->tpf.numerator =GET_CLKRC_DIV (DEF_CLKRC );
Greg Kroah-Hartman
maintainerPATCH 155/203 media: cedrus: Use correct H264 8x8 scaling list
In reply to Greg Kroah-HartmanFrom: Jonas Karlman <[email protected]>
commit a6b8feae7c88343212686120740cf7551dd16e08 upstream.
Documentation now defines the expected order of scaling lists, change to use correct indices.
--- drivers/staging/media/sunxi/cedrus/cedrus_h264.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/staging/media/sunxi/cedrus/cedrus_h264.c +2 -2
@@ -244,8 +244,8 @@ static void cedrus_write_scaling_lists(s sizeof(scaling->scaling_list_8x8[0]));cedrus_h264_write_sram (dev, CEDRUS_SRAM_H264_SCALING_LIST_8x8_1, - scaling->scaling_list_8x8[3 ], -sizeof (scaling->scaling_list_8x8[3 ])); + scaling->scaling_list_8x8[1 ], +sizeof (scaling->scaling_list_8x8[1 ])); cedrus_h264_write_sram(dev, CEDRUS_SRAM_H264_SCALING_LIST_4x4, scaling->scaling_list_4x4,
Greg Kroah-Hartman
maintainerPATCH 154/203 media: coda: fix deadlock between decoder picture run and start command
In reply to Greg Kroah-HartmanFrom: Philipp Zabel <[email protected]>
commit a3fd80198de6ab98a205cf7fb148d88e9e1c44bb upstream.
The BIT decoder picture run temporarily locks the bitstream mutex while the coda device mutex is locked, to refill the bitstream ring buffer. Consequently, the decoder start command, which locks both mutexes when flushing the bitstream ring buffer, must lock the coda device mutex first as well, to avoid an ABBA deadlock.
--- drivers/media/platform/coda/coda-common.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/media/platform/coda/coda-common.c +2 -2
@@ -1084,16 +1084,16 @@ static int coda_decoder_cmd(struct fileswitch (dc->cmd) {case V4L2_DEC_CMD_START : -mutex_lock (&ctx->bitstream_mutex);mutex_lock (&dev->coda_mutex); +mutex_lock (&ctx->bitstream_mutex);coda_bitstream_flush (ctx); -mutex_unlock (&dev->coda_mutex); dst_vq =v4l2_m2m_get_vq (ctx->fh.m2m_ctx,V4L2_BUF_TYPE_VIDEO_CAPTURE );vb2_clear_last_buffer_dequeued (dst_vq); ctx->bit_stream_param &= ~CODA_BIT_STREAM_END_FLAG ;coda_fill_bitstream (ctx,NULL );mutex_unlock (&ctx->bitstream_mutex); +mutex_unlock (&dev->coda_mutex);break ;case V4L2_DEC_CMD_STOP : stream_end = false;
Greg Kroah-Hartman
maintainerPATCH 140/203 MIPS: PCI: remember nasid changed by set interrupt affinity
In reply to Greg Kroah-HartmanFrom: Thomas Bogendoerfer <[email protected]>
commit 37640adbefd66491cb8083a438f7bf366ac09bc7 upstream.
When changing interrupt affinity remember the possible changed nasid, otherwise an interrupt deactivate/activate sequence will incorrectly setup interrupt.
--- arch/mips/pci/pci-xtalk-bridge.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
arch/mips/pci/pci-xtalk-bridge.c +2 -3
@@ -279,16 +279,15 @@ static int bridge_set_affinity(struct irstruct bridge_irq_chip_data *data = d->chip_data;int bit = d->parent_data->hwirq;int pin = d->hwirq; -nasid_t nasid;int ret, cpu; ret =irq_chip_set_affinity_parent (d, mask, force);if (ret >=0 ) { cpu =cpumask_first_and (mask, cpu_online_mask); - nasid =COMPACT_TO_NASID_NODEID (cpu_to_node (cpu)); + data->nnasid =COMPACT_TO_NASID_NODEID (cpu_to_node (cpu));bridge_write (data->bc, b_int_addr[pin].addr, (((data->bc->intr_addr >>30 ) &0x30000 ) | - bit | (nasid <<8 ))); + bit | (data->nasid <<8 )));bridge_read (data->bc, b_wid_tflush); }return ret;
Greg Kroah-Hartman
maintainerPATCH 153/203 media: exynos4-is: Fix recursive locking in isp_video_release()
In reply to Greg Kroah-HartmanFrom: Seung-Woo Kim <[email protected]>
commit 704c6c80fb471d1bb0ef0d61a94617d1d55743cd upstream.
Quoted 1 line
From
isp_video_release(),&isp->video_lockis held and subsequent
vb2_fop_release() tries to lock vdev->lock which is same with the previous one. Replace vb2_fop_release() with _vb2_fop_release() to fix the recursive locking.
--- drivers/media/platform/exynos4-is/fimc-isp-video.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/media/platform/exynos4-is/fimc-isp-video.c +1 -1
@@ -313,7 +313,7 @@ static int isp_video_release(struct file ivc->streaming =0 ; } -vb2_fop_release (file); +_vb2_fop_release (file,NULL );if (v4l2_fh_is_singular_file (file)) {fimc_pipeline_call (&ivc->ve, close);
Greg Kroah-Hartman
maintainerPATCH 146/203 media: ov6650: Fix incorrect use of JPEG colorspace
In reply to Greg Kroah-HartmanFrom: Janusz Krzysztofik <[email protected]>
commit 12500731895ef09afc5b66b86b76c0884fb9c7bf upstream.
Since its initial submission, the driver selects V4L2_COLORSPACE_JPEG for supported formats other than V4L2_MBUS_FMT_SBGGR8_1X8. According to v4l2-compliance test program, V4L2_COLORSPACE_JPEG applies exclusively to V4L2_PIX_FMT_JPEG. Since the sensor does not support JPEG format, fix it to always select V4L2_COLORSPACE_SRGB.
--- drivers/media/i2c/ov6650.c | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-)
drivers/media/i2c/ov6650.c +2 -11
@@ -201,7 +201,6 @@ struct ov6650 {unsigned long pclk_max;/* from resolution and format */ struct v4l2_fract tpf;/* as requested with s_frame_interval */ u32 code; -enum v4l2_colorspace colorspace; };
@@ -517,7 +516,7 @@ static int ov6650_get_fmt(struct v4l2_su mf->width = priv->rect.width >> priv->half_scale; mf->height = priv->rect.height >> priv->half_scale; mf->code = priv->code; - mf->colorspace = priv->colorspace; + mf->colorspace =V4L2_COLORSPACE_SRGB ; mf->field =V4L2_FIELD_NONE ;return 0 ;
@@ -624,11 +623,6 @@ static int ov6650_s_fmt(struct v4l2_subd priv->pclk_max =8000000 ; } -if (code ==MEDIA_BUS_FMT_SBGGR8_1X8 ) - priv->colorspace =V4L2_COLORSPACE_SRGB ; -else if (code !=0 ) - priv->colorspace =V4L2_COLORSPACE_JPEG ; -if (half_scale) {dev_dbg (&client->dev,"max resolution: QCIF\n" ); coma_set |=COMA_QCIF ;
@@ -663,7 +657,6 @@ static int ov6650_s_fmt(struct v4l2_subd priv->code = code;if (!ret) { - mf->colorspace = priv->colorspace; mf->width = priv->rect.width >> half_scale; mf->height = priv->rect.height >> half_scale; }
@@ -686,6 +679,7 @@ static int ov6650_set_fmt(struct v4l2_su &mf->height, 2, H_CIF, 1, 0); mf->field =V4L2_FIELD_NONE ; + mf->colorspace =V4L2_COLORSPACE_SRGB ;switch (mf->code) {case MEDIA_BUS_FMT_Y10_1X10 :
@@ -696,13 +690,11 @@ static int ov6650_set_fmt(struct v4l2_sucase MEDIA_BUS_FMT_YUYV8_2X8 :case MEDIA_BUS_FMT_VYUY8_2X8 :case MEDIA_BUS_FMT_UYVY8_2X8 : - mf->colorspace =V4L2_COLORSPACE_JPEG ;break ;default : mf->code =MEDIA_BUS_FMT_SBGGR8_1X8 ;/* fall through */ case MEDIA_BUS_FMT_SBGGR8_1X8 : - mf->colorspace =V4L2_COLORSPACE_SRGB ;break ; }
@@ -1008,7 +1000,6 @@ static int ov6650_probe(struct i2c_clien priv->rect.height =H_CIF ; priv->half_scale = false; priv->code =MEDIA_BUS_FMT_YUYV8_2X8 ; - priv->colorspace =V4L2_COLORSPACE_JPEG ;/* Hardware default frame interval */ priv->tpf.numerator =GET_CLKRC_DIV (DEF_CLKRC );
Greg Kroah-Hartman
maintainerPATCH 139/203 powerpc/powernv: Disable native PCIe port management
In reply to Greg Kroah-HartmanFrom: Oliver O'Halloran <[email protected]>
commit 9d72dcef891030545f39ad386a30cf91df517fb2 upstream.
On PowerNV the PCIe topology is (currently) managed by the powernv platform code in Linux in cooperation with the platform firmware. Linux's native PCIe port service drivers operate independently of both and this can cause problems.
The main issue is that the portbus driver will conflict with the platform specific hotplug driver (pnv_php) over ownership of the MSI used to notify the host when a hotplug event occurs. The portbus driver claims this MSI on behalf of the individual port services because the same interrupt is used for hotplug events, PMEs (on root ports), and link bandwidth change notifications. The portbus driver will always claim the interrupt even if the individual port service drivers, such as pciehp, are compiled out.
The second, bigger, problem is that the hotplug port service driver fundamentally does not work on PowerNV. The platform assumes that all PCI devices have a corresponding arch-specific handle derived from the DT node for the device (pci_dn) and without one the platform will not allow a PCI device to be enabled. This problem is largely due to historical baggage, but it can't be resolved without significant re-factoring of the platform PCI support.
We can fix these problems in the interim by setting the "pcie_ports_disabled" flag during platform initialisation. The flag indicates the platform owns the PCIe ports which stops the portbus driver from being registered.
This does have the side effect of disabling all port services drivers that is: AER, PME, BW notifications, hotplug, and DPC. However, this is not a huge disadvantage on PowerNV since these services are either unused or handled through other means.
--- arch/powerpc/platforms/powernv/pci.c | 17 +++++++++++++++++ 1 file changed, 17 insertions(+)
arch/powerpc/platforms/powernv/pci.c +17 -0
@@ -945,6 +945,23 @@ void __init pnv_pci_init(void)if (!firmware_has_feature (FW_FEATURE_OPAL ))return ; +#ifdef CONFIG_PCIEPORTBUS +/* +* On PowerNV PCIe devices are (currently) managed in cooperation +* with firmware. This isn't *strictly* required, but there's enough +* assumptions baked into both firmware and the platform code that +* it's unwise to allow the portbus services to be used. +* +* We need to fix this eventually, but for now set this flag to disable +* the portbus driver. The AER service isn't required since that AER +* events are handled via EEH. The pciehp hotplug driver can't work +* without kernel changes (and portbus binding breaks pnv_php). The +* other services also require some thinking about how we're going +* to integrate them. +*/ + pcie_ports_disabled = true; +#endif +/* Look for IODA IO-Hubs. */ for_each_compatible_node (np,NULL ,"ibm,ioda-hub" ) {pnv_pci_init_ioda_hub (np);
Greg Kroah-Hartman
maintainerPATCH 157/203 media: aspeed-video: Fix memory leaks in aspeed_video_probe
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
commit c3df30a01da4955e04fa068c503cd784b31dad92 upstream.
In the implementation of aspeed_video_probe() the allocated memory for video should be released if either devm_ioremap_resource() or aspeed_video_init() or aspeed_video_setup_video() fails. Replace kzalloc() with devm_kzalloc to avoid explicit release for video.
--- drivers/media/platform/aspeed-video.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/media/platform/aspeed-video.c +2 -1
@@ -1658,7 +1658,8 @@ static int aspeed_video_probe(struct pla {int rc;struct resource *res; -struct aspeed_video *video =kzalloc (sizeof (*video),GFP_KERNEL ); +struct aspeed_video *video = +devm_kzalloc (&pdev->dev,sizeof (*video),GFP_KERNEL );if (!video)return -ENOMEM ;
Greg Kroah-Hartman
maintainerPATCH 143/203 tty: serial: imx: use the sg count from dma_map_sg
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
commit 596fd8dffb745afcebc0ec6968e17fe29f02044c upstream.
The dmaengine_prep_slave_sg needs to use sg count returned by dma_map_sg, not use sport->dma_tx_nents, because the return value of dma_map_sg is not always same with "nents".
--- drivers/tty/serial/imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/tty/serial/imx.c +1 -1
@@ -619,7 +619,7 @@ static void imx_uart_dma_tx(struct imx_pdev_err (dev,"DMA mapping error for TX.\n" );return ; } - desc =dmaengine_prep_slave_sg (chan, sgl, sport->dma_tx_nents, + desc =dmaengine_prep_slave_sg (chan, sgl, ret,DMA_MEM_TO_DEV ,DMA_PREP_INTERRUPT );if (!desc) { dma_unmap_sg(dev, sgl, sport->dma_tx_nents,
Greg Kroah-Hartman
maintainerPATCH 137/203 tools: PCI: Fix fd leakage
In reply to Greg Kroah-HartmanFrom: Hewenliang <[email protected]>
commit 3c379a59b4795d7279d38c623e74b9790345a32b upstream.
We should close fd before the return of run_test.
--- tools/pci/pcitest.c | 1 + 1 file changed, 1 insertion(+)
tools/pci/pcitest.c +1 -0
@@ -129,6 +129,7 @@ static int run_test(struct pci_test *tes }fflush (stdout); +close (fd);return (ret <0 ) ? ret :1 - ret;/* return 0 if test succeeded */ }
Greg Kroah-Hartman
maintainerPATCH 172/203 iwlwifi: mvm: consider ieee80211 station max amsdu value
In reply to Greg Kroah-HartmanFrom: Mordechay Goodstein <[email protected]>
commit ee4cce9b9d6421d037ffc002536b918fd7f4aff3 upstream.
debugfs amsdu_len sets only the max_amsdu_len for ieee80211 station so take it into consideration while getting max amsdu
--- drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c | 8 +++++++- drivers/net/wireless/intel/iwlwifi/mvm/tx.c | 7 ++++++- 2 files changed, 13 insertions(+), 2 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/rs-fw.c +7 -1
@@ -350,7 +350,13 @@ void iwl_mvm_tlc_update_notif(struct iwlu16 size =le32_to_cpu (notif->amsdu_size);int i; -if (WARN_ON (sta->max_amsdu_len < size)) +/* +* In debug sta->max_amsdu_len < size +* so also check with orig_amsdu_len which holds the original +* data before debugfs changed the value +*/ +if (WARN_ON (sta->max_amsdu_len < size && + mvmsta->orig_amsdu_len < size)) goto out; mvmsta->amsdu_enabled =le32_to_cpu (notif->amsdu_enabled);
drivers/net/wireless/intel/iwlwifi/mvm/tx.c +6 -1
@@ -935,7 +935,12 @@ static int iwl_mvm_tx_tso(struct iwl_mvm !(mvmsta->amsdu_enabled & BIT(tid)))return iwl_mvm_tx_tso_segment (skb,1 , netdev_flags, mpdus_skb); - max_amsdu_len =iwl_mvm_max_amsdu_size (mvm, sta, tid); +/* +* Take the min of ieee80211 station and mvm station +*/ + max_amsdu_len = + min_t(unsigned int, sta->max_amsdu_len, +iwl_mvm_max_amsdu_size (mvm, sta, tid));/* * Limit A-MSDU in A-MPDU to 4095 bytes when VHT is not
Greg Kroah-Hartman
maintainerPATCH 174/203 iwlwifi: mvm: fix support for single antenna diversity
In reply to Greg Kroah-HartmanFrom: Luca Coelho <[email protected]>
commit bb99ff9baa02beb9216c86678999342197c849cc upstream.
When the single antenna diversity support was sent upstream, only some definitions were sent, due to a bad revert.
Fix this by adding the actual code.
--- drivers/net/wireless/intel/iwlwifi/mvm/fw.c | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-)
drivers/net/wireless/intel/iwlwifi/mvm/fw.c +16 -4
@@ -514,6 +514,18 @@ static int iwl_send_phy_cfg_cmd(struct istruct iwl_phy_cfg_cmd phy_cfg_cmd;enum iwl_ucode_type ucode_type = mvm->fwrt.cur_fw_img; +if (iwl_mvm_has_unified_ucode (mvm) && + !mvm->trans->cfg->tx_with_siso_diversity) { +return 0 ; + }else if (mvm->trans->cfg->tx_with_siso_diversity) { +/* +* TODO: currently we don't set the antenna but letting the NIC +* to decide which antenna to use. This should come from BIOS. +*/ + phy_cfg_cmd.phy_cfg = +cpu_to_le32 (FW_PHY_CFG_CHAIN_SAD_ENABLED ); + } +/* Set parameters */ phy_cfg_cmd.phy_cfg =cpu_to_le32 (iwl_mvm_get_phy_config (mvm));
@@ -1344,12 +1356,12 @@ int iwl_mvm_up(struct iwl_mvm *mvm) ret =iwl_send_phy_db_data (mvm->phy_db);if (ret) goto error; - - ret =iwl_send_phy_cfg_cmd (mvm); -if (ret) - goto error; } + ret =iwl_send_phy_cfg_cmd (mvm); +if (ret) + goto error; + ret =iwl_mvm_send_bt_init_conf (mvm);if (ret) goto error;
Greg Kroah-Hartman
maintainerPATCH 175/203 sch_cake: Add missing NLA policy entry TCA_CAKE_SPLIT_GSO
In reply to Greg Kroah-HartmanFrom: Victorien Molle <[email protected]>
commit b3c424eb6a1a3c485de64619418a471dee6ce849 upstream.
This field has never been checked since introduction in mainline kernel
--- net/sched/sch_cake.c | 1 + 1 file changed, 1 insertion(+)
net/sched/sch_cake.c +1 -0
@@ -2184,6 +2184,7 @@ static const struct nla_policy cake_poli [TCA_CAKE_MPU] = { .type = NLA_U32 }, [TCA_CAKE_INGRESS] = { .type = NLA_U32 }, [TCA_CAKE_ACK_FILTER] = { .type = NLA_U32 }, + [TCA_CAKE_SPLIT_GSO] = { .type = NLA_U32 }, [TCA_CAKE_FWMARK] = { .type = NLA_U32 }, };
Greg Kroah-Hartman
maintainerPATCH 166/203 mtd: spi-nor: fix silent truncation in spi_nor_read()
In reply to Greg Kroah-HartmanFrom: Sergei Shtylyov <[email protected]>
commit a719a75a7761e4139dd099330d9fe3589d844f9b upstream.
spi_nor_read() assigns the result of 'ssize_t spi_nor_read_data()' to the 'int ret' variable, while 'ssize_t' is a 64-bit type and *int* is a 32-bit type on the 64-bit machines. This silent truncation isn't really valid, so fix up the variable's type.
--- drivers/mtd/spi-nor/spi-nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/spi-nor.c +1 -1
@@ -2544,7 +2544,7 @@ static int spi_nor_read(struct mtd_info size_t *retlen, u_char *buf) { struct spi_nor *nor = mtd_to_spi_nor(mtd); -int ret; +ssize_t ret;dev_dbg (nor->dev,"from 0x%08x, len %zd\n" , (u32 )from, len);
Greg Kroah-Hartman
maintainerPATCH 170/203 spi: rspi: Use platform_get_irq_byname_optional() for optional irqs
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
commit 2de860b4a7a0bd5a4b5bd3bff0e6a615495df4ba upstream.
As platform_get_irq_byname() now prints an error when the interrupt does not exist, scary warnings may be printed for optional interrupts:
renesas_spi e6b10000.spi: IRQ rx not found
renesas_spi e6b10000.spi: IRQ mux not found
Fix this by calling platform_get_irq_byname_optional() instead. Remove the no longer needed printing of platform_get_irq errors, as the remaining calls to platform_get_irq() and platform_get_irq_byname() take care of that.
--- drivers/spi/spi-rspi.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/spi/spi-rspi.c +2 -6
@@ -1257,9 +1257,9 @@ static int rspi_probe(struct platform_de ctlr->flags = ops->flags; ctlr->dev.of_node = pdev->dev.of_node; - ret =platform_get_irq_byname (pdev,"rx" ); + ret =platform_get_irq_byname_optional (pdev,"rx" );if (ret <0 ) { - ret =platform_get_irq_byname (pdev,"mux" ); + ret =platform_get_irq_byname_optional (pdev,"mux" );if (ret <0 ) ret =platform_get_irq (pdev,0 );if (ret >=0 )
@@ -1270,10 +1270,6 @@ static int rspi_probe(struct platform_deif (ret >=0 ) rspi->tx_irq = ret; } -if (ret <0 ) { -dev_err (&pdev->dev,"platform_get_irq error\n" ); - goto error2; - }if (rspi->rx_irq == rspi->tx_irq) {/* Single multiplexed interrupt */
Greg Kroah-Hartman
maintainerPATCH 178/203 rtc: msm6242: Fix reading of 10-hour digit
In reply to Greg Kroah-HartmanFrom: Kars de Jong <[email protected]>
commit e34494c8df0cd96fc432efae121db3212c46ae48 upstream.
The driver was reading the wrong register as the 10-hour digit due to a misplaced ')'. It was in fact reading the 1-second digit register due to this bug.
Also remove the use of a magic number for the hour mask and use the define for it which was already present.
--- drivers/rtc/rtc-msm6242.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/rtc/rtc-msm6242.c +2 -1
@@ -133,7 +133,8 @@ static int msm6242_read_time(struct devimsm6242_read (priv,MSM6242_SECOND1 ); tm->tm_min =msm6242_read (priv,MSM6242_MINUTE10 ) *10 +msm6242_read (priv,MSM6242_MINUTE1 ); - tm->tm_hour = (msm6242_read (priv,MSM6242_HOUR10 &3 )) *10 + + tm->tm_hour = (msm6242_read (priv,MSM6242_HOUR10 ) & +MSM6242_HOUR10_HR_MASK ) *10 +msm6242_read (priv,MSM6242_HOUR1 ); tm->tm_mday =msm6242_read (priv,MSM6242_DAY10 ) *10 +msm6242_read (priv,MSM6242_DAY1 );
Greg Kroah-Hartman
maintainerPATCH 171/203 spi: lpspi: fix memory leak in fsl_lpspi_probe
In reply to Greg Kroah-HartmanFrom: Navid Emamdoost <[email protected]>
commit 057b8945f78f76d0b04eeb5c27cd9225e5e7ad86 upstream.
In fsl_lpspi_probe an SPI controller is allocated either via spi_alloc_slave or spi_alloc_master. In all but one error cases this controller is put by going to error handling code. This commit fixes the case when pm_runtime_get_sync fails and it should go to the error handling path.
--- drivers/spi/spi-fsl-lpspi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-fsl-lpspi.c +1 -1
@@ -938,7 +938,7 @@ static int fsl_lpspi_probe(struct platfo ret =pm_runtime_get_sync (fsl_lpspi->dev);if (ret <0 ) {dev_err (fsl_lpspi->dev,"failed to enable clock\n" ); -return ret; + goto out_controller_put; } temp =readl (fsl_lpspi->base +IMX7ULP_PARAM );
Greg Kroah-Hartman
maintainerPATCH 181/203 gpio: mpc8xxx: Add platform device to gpiochip->parent
In reply to Greg Kroah-HartmanFrom: Johnson CH Chen (陳昭勳) <[email protected]>
[ Upstream commit 322f6a3182d42df18059a89c53b09d33919f755e ]
Dear Linus Walleij,
In old kernels, some APIs still try to use parent->of_node from struct gpio_chip, and it could be resulted in kernel panic because parent is NULL. Adding platform device to gpiochip->parent can fix this problem.
--- drivers/gpio/gpio-mpc8xxx.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpio/gpio-mpc8xxx.c +1 -0
@@ -346,6 +346,7 @@ static int mpc8xxx_probe(struct platform_device *pdev)return -ENOMEM ; gc = &mpc8xxx_gc->gc; + gc->parent = &pdev->dev;if (of_property_read_bool (np,"little-endian" )) { ret = bgpio_init(gc, &pdev->dev, 4,
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 158/203 media: hantro: Set H264 FIELDPIC_FLAG_E flag correctly
In reply to Greg Kroah-HartmanFrom: Jonas Karlman <[email protected]>
commit a2cbf80a842add9663522bf898cf13cb2ac4e423 upstream.
The FIELDPIC_FLAG_E bit should be set when field_pic_flag exists in stream, it is currently set based on field_pic_flag of current frame. The PIC_FIELDMODE_E bit is correctly set based on the field_pic_flag.
Fix this by setting the FIELDPIC_FLAG_E bit when frame_mbs_only is not set.
--- drivers/staging/media/hantro/hantro_g1_h264_dec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/hantro/hantro_g1_h264_dec.c +1 -1
@@ -63,7 +63,7 @@ static void set_params(struct hantro_ctx/* always use the matrix sent from userspace */ reg |=G1_REG_DEC_CTRL2_TYPE1_QUANT_E ; -if (slices[0 ].flags &V4L2_H264_SLICE_FLAG_FIELD_PIC ) +if (!(sps->flags &V4L2_H264_SPS_FLAG_FRAME_MBS_ONLY )) reg |=G1_REG_DEC_CTRL2_FIELDPIC_FLAG_E ;vdpu_write_relaxed (vpu, reg,G1_REG_DEC_CTRL2 );
Greg Kroah-Hartman
maintainerPATCH 160/203 iommu/mediatek: Add a new tlb_lock for tlb_flush
In reply to Greg Kroah-HartmanFrom: Yong Wu <[email protected]>
commit da3cc91b8db403728cde03c8a95cba268d8cbf1b upstream.
The commit 4d689b619445 ("iommu/io-pgtable-arm-v7s: Convert to IOMMU API TLB sync") help move the tlb_sync of unmap from v7s into the iommu framework. It helps add a new function "mtk_iommu_iotlb_sync", But it lacked the lock, then it will cause the variable "tlb_flush_active" may be changed unexpectedly, we could see this warning log randomly:
mtk-iommu 10205000.iommu: Partial TLB flush timed out, falling back to full flush
The HW requires tlb_flush/tlb_sync in pairs strictly, this patch adds a new tlb_lock for tlb operations to fix this issue.
--- drivers/iommu/mtk_iommu.c | 23 ++++++++++++++++++++++- drivers/iommu/mtk_iommu.h | 1 + 2 files changed, 23 insertions(+), 1 deletion(-)
drivers/iommu/mtk_iommu.c +22 -1
@@ -219,22 +219,37 @@ static void mtk_iommu_tlb_sync(void *coostatic void mtk_iommu_tlb_flush_walk (unsigned long iova,size_t size,size_t granule,void *cookie) { +struct mtk_iommu_data *data = cookie; +unsigned long flags; + +spin_lock_irqsave (&data->tlb_lock, flags);mtk_iommu_tlb_add_flush_nosync (iova, size, granule, false, cookie);mtk_iommu_tlb_sync (cookie); +spin_unlock_irqrestore (&data->tlb_lock, flags); }static void mtk_iommu_tlb_flush_leaf (unsigned long iova,size_t size,size_t granule,void *cookie) { +struct mtk_iommu_data *data = cookie; +unsigned long flags; + +spin_lock_irqsave (&data->tlb_lock, flags);mtk_iommu_tlb_add_flush_nosync (iova, size, granule, true, cookie);mtk_iommu_tlb_sync (cookie); +spin_unlock_irqrestore (&data->tlb_lock, flags); }static void mtk_iommu_tlb_flush_page_nosync (struct iommu_iotlb_gather *gather,unsigned long iova,size_t granule,void *cookie) { +struct mtk_iommu_data *data = cookie; +unsigned long flags; + +spin_lock_irqsave (&data->tlb_lock, flags);mtk_iommu_tlb_add_flush_nosync (iova, granule, granule, true, cookie); +spin_unlock_irqrestore (&data->tlb_lock, flags); }static const struct iommu_flush_ops mtk_iommu_flush_ops = {
@@ -453,7 +468,12 @@ static void mtk_iommu_flush_iotlb_all(ststatic void mtk_iommu_iotlb_sync (struct iommu_domain *domain,struct iommu_iotlb_gather *gather) { -mtk_iommu_tlb_sync (mtk_iommu_get_m4u_data ()); +struct mtk_iommu_data *data =mtk_iommu_get_m4u_data (); +unsigned long flags; + +spin_lock_irqsave (&data->tlb_lock, flags); +mtk_iommu_tlb_sync (data); +spin_unlock_irqrestore (&data->tlb_lock, flags); } static phys_addr_t mtk_iommu_iova_to_phys(struct iommu_domain *domain,
@@ -733,6 +753,7 @@ static int mtk_iommu_probe(struct platfoif (ret)return ret; +spin_lock_init (&data->tlb_lock);list_add_tail (&data->list, &m4ulist);if (!iommu_present (&platform_bus_type))
drivers/iommu/mtk_iommu.h +1 -0
@@ -58,6 +58,7 @@ struct mtk_iommu_data {struct iommu_group *m4u_group;bool enable_4GB;bool tlb_flush_active; +spinlock_t tlb_lock;/* lock for tlb range flush */ struct iommu_device iommu;const struct mtk_iommu_plat_data *plat_data;
Greg Kroah-Hartman
maintainerPATCH 161/203 memory: mtk-smi: Add PM suspend and resume ops
In reply to Greg Kroah-HartmanFrom: Yong Wu <[email protected]>
commit fb03082a54acd66c61535edfefe96b2ff88ce7e2 upstream.
In the commit 4f0a1a1ae351 ("memory: mtk-smi: Invoke pm runtime_callback to enable clocks"), we use pm_runtime callback to enable/disable the smi larb clocks. It will cause the larb's clock may not be disabled when suspend. That is because device_prepare will call pm_runtime_get_noresume which will keep the larb's PM runtime status still is active when suspend, then it won't enter our pm_runtime suspend callback to disable the corresponding clocks.
This patch adds suspend pm_ops to force disable the clocks, Use "LATE" to make sure it disable the larb's clocks after the multimedia devices.
--- drivers/memory/mtk-smi.c | 4 ++++ 1 file changed, 4 insertions(+)
drivers/memory/mtk-smi.c +4 -0
@@ -366,6 +366,8 @@ static int __maybe_unused mtk_smi_larb_sstatic const struct dev_pm_ops smi_larb_pm_ops = { SET_RUNTIME_PM_OPS(mtk_smi_larb_suspend, mtk_smi_larb_resume, NULL) +SET_LATE_SYSTEM_SLEEP_PM_OPS (pm_runtime_force_suspend, + pm_runtime_force_resume) };static struct platform_driver mtk_smi_larb_driver = {
@@ -507,6 +509,8 @@ static int __maybe_unused mtk_smi_commonstatic const struct dev_pm_ops smi_common_pm_ops = { SET_RUNTIME_PM_OPS(mtk_smi_common_suspend, mtk_smi_common_resume, NULL) +SET_LATE_SYSTEM_SLEEP_PM_OPS (pm_runtime_force_suspend, + pm_runtime_force_resume) };static struct platform_driver mtk_smi_common_driver = {
Greg Kroah-Hartman
maintainerPATCH 176/203 f2fs: fix potential overflow
In reply to Greg Kroah-HartmanFrom: Chao Yu <[email protected]>
commit 1f0d5c911b64165c9754139a26c8c2fad352c132 upstream.
We expect 64-bit calculation result from below statement, however in 32-bit machine, looped left shift operation on pgoff_t type variable may cause overflow issue, fix it by forcing type cast.
page->index << PAGE_SHIFT;
--- fs/f2fs/data.c | 2 +- fs/f2fs/file.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
fs/f2fs/data.c +1 -1
@@ -2098,7 +2098,7 @@ static int __write_data_page(struct pageloff_t i_size =i_size_read (inode);const pgoff_t end_index = ((unsigned long long ) i_size) >>PAGE_SHIFT ; -loff_t psize = (page->index +1 ) <<PAGE_SHIFT ; +loff_t psize = (loff_t)(page->index +1 ) <<PAGE_SHIFT ;unsigned offset =0 ;bool need_balance_fs = false;int err =0 ;
fs/f2fs/file.c +1 -1
@@ -1139,7 +1139,7 @@ static int __clone_blkaddrs(struct inode } dn.ofs_in_node++; i++; - new_size = (dst + i) <<PAGE_SHIFT ; + new_size = (loff_t)(dst + i) <<PAGE_SHIFT ;if (dst_inode->i_size < new_size)f2fs_i_size_write (dst_inode, new_size); }while (--ilen && (do_replace[i] || blkaddr[i] ==NULL_ADDR ));
Greg Kroah-Hartman
maintainerPATCH 177/203 NFSD fixing possible null pointer derefering in copy offload
In reply to Greg Kroah-HartmanFrom: Olga Kornievskaia <[email protected]>
commit 18f428d4e2f7eff162d80b2b21689496c4e82afd upstream.
Static checker revealed possible error path leading to possible NULL pointer dereferencing.
--- fs/nfsd/nfs4proc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
fs/nfsd/nfs4proc.c +2 -1
@@ -1298,7 +1298,8 @@ nfsd4_copy(struct svc_rqst *rqstp, struc out:return status; out_err: -cleanup_async_copy (async_copy); +if (async_copy) +cleanup_async_copy (async_copy); goto out; }
Greg Kroah-Hartman
maintainerPATCH 179/203 rtc: brcmstb-waketimer: add missed clk_disable_unprepare
In reply to Greg Kroah-HartmanFrom: Chuhong Yuan <[email protected]>
commit 94303f8930ed78aea0f189b703c9d79fff9555d7 upstream.
This driver forgets to disable and unprepare clock when remove. Add a call to clk_disable_unprepare to fix it.
--- drivers/rtc/rtc-brcmstb-waketimer.c | 1 + 1 file changed, 1 insertion(+)
drivers/rtc/rtc-brcmstb-waketimer.c +1 -0
@@ -277,6 +277,7 @@ static int brcmstb_waketmr_remove(structstruct brcmstb_waketmr *timer =dev_get_drvdata (&pdev->dev);unregister_reboot_notifier (&timer->reboot_notifier); +clk_disable_unprepare (timer->clk);return 0 ; }
Greg Kroah-Hartman
maintainerPATCH 193/203 rxrpc: Dont take call->user_mutex in rxrpc_new_incoming_call()
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
[ Upstream commit 13b7955a0252e15265386b229b814152f109b234 ]
Standard kernel mutexes cannot be used in any way from interrupt or softirq context, so the user_mutex which manages access to a call cannot be a mutex since on a new call the mutex must start off locked and be unlocked within the softirq handler to prevent userspace interfering with a call we're setting up.
Commit a0855d24fc22d49cdc25664fb224caee16998683 ("locking/mutex: Complain upon mutex API misuse in IRQ contexts") causes big warnings to be splashed in dmesg for each a new call that comes in from the server. Whilst it *seems* like it should be okay, since the accept path uses trylock, there are issues with PI boosting and marking the wrong task as the owner.
Fix this by not taking the mutex in the softirq path at all. It's not obvious that there should be any need for it as the state is set before the first notification is generated for the new call.
There's also no particular reason why the link-assessing ping should be triggered inside the mutex. It's not actually transmitted there anyway, but rather it has to be deferred to a workqueue.
Further, I don't think that there's any particular reason that the socket notification needs to be done from within rx->incoming_lock, so the amount of time that lock is held can be shortened too and the ping prepared before the new call notification is sent.
--- net/rxrpc/call_accept.c | 20 +++----------------- 1 file changed, 3 insertions(+), 17 deletions(-)
net/rxrpc/call_accept.c +3 -17
@@ -381,18 +381,6 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local,trace_rxrpc_receive (call, rxrpc_receive_incoming, sp->hdr.serial, sp->hdr.seq); -/* Lock the call to prevent rxrpc_kernel_send/recv_data() and -* sendmsg()/recvmsg() inconveniently stealing the mutex once the -* notification is generated. -* -* The BUG should never happen because the kernel should be well -* behaved enough not to access the call before the first notification -* event and userspace is prevented from doing so until the state is -* appropriate. -*/ -if (!mutex_trylock (&call->user_mutex)) -BUG (); -/* Make the call live. */ rxrpc_incoming_call (rx, call, skb); conn = call->conn;
@@ -433,6 +421,9 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local,BUG (); }spin_unlock (&conn->state_lock); +spin_unlock (&rx->incoming_lock); + +rxrpc_send_ping (call, skb);if (call->state ==RXRPC_CALL_SERVER_ACCEPTING )rxrpc_notify_socket (call);
@@ -444,11 +435,6 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local,*/ rxrpc_put_call (call, rxrpc_call_put); -spin_unlock (&rx->incoming_lock); - -rxrpc_send_ping (call, skb); -mutex_unlock (&call->user_mutex); -_leave (" = %p{%d}" , call, call->debug_id);return call;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 162/203 Revert "ubifs: Fix memory leak bug in alloc_ubifs_info() error path"
In reply to Greg Kroah-HartmanFrom: Richard Weinberger <[email protected]>
commit 91cbf01178c37086b32148c53e24b04cb77557cf upstream.
This reverts commit 9163e0184bd7d5f779934d34581843f699ad2ffd.
At the point when ubifs_fill_super() runs, we have already a reference to the super block. So upon deactivate_locked_super() c will get free()'ed via ->kill_sb().
--- fs/ubifs/super.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
fs/ubifs/super.c +1 -3
@@ -2267,10 +2267,8 @@ static struct dentry *ubifs_mount(struct } }else { err =ubifs_fill_super (sb, data, flags &SB_SILENT ?1 :0 ); -if (err) { -kfree (c); +if (err) goto out_deact; - }/* We do not support atime */ sb->s_flags |=SB_ACTIVE ;if (IS_ENABLED (CONFIG_UBIFS_ATIME_SUPPORT ))
Greg Kroah-Hartman
maintainerPATCH 200/203 kbuild/deb-pkg: annotate libelf-dev dependency as :native
In reply to Greg Kroah-HartmanFrom: Ard Biesheuvel <[email protected]>
[ Upstream commit 8ffdc54b6f4cd718a45802e645bb853e3a46a078 ]
Cross compiling the x86 kernel on a non-x86 build machine produces the following error when CONFIG_UNWINDER_ORC is enabled, regardless of whether libelf-dev is installed or not.
dpkg-checkbuilddeps: error: Unmet build dependencies: libelf-dev
dpkg-buildpackage: warning: build dependencies/conflicts unsatisfied; aborting
dpkg-buildpackage: warning: (Use -d flag to override.)
Since this is a build time dependency for a build tool, we need to depend on the native version of libelf-dev so add the appropriate annotation.
--- scripts/package/mkdebian | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/package/mkdebian +1 -1
@@ -136,7 +136,7 @@ mkdir -p debian/source/ echo "1.0" > debian/source/format echo $debarch > debian/arch -extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev)" +extra_build_depends=", $(if_enabled_echo CONFIG_UNWINDER_ORC libelf-dev:native)" extra_build_depends="$extra_build_depends, $(if_enabled_echo CONFIG_SYSTEM_TRUSTED_KEYRING libssl-dev:native)" # Generate a simple changelog template
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 195/203 dmaengine: k3dma: Avoid null pointer traversal
In reply to Greg Kroah-HartmanFrom: John Stultz <[email protected]>
[ Upstream commit 2f42e05b942fe2fbfb9bbc6e34e1dd8c3ce4f3a4 ]
In some cases we seem to submit two transactions in a row, which causes us to lose track of the first. If we then cancel the request, we may still get an interrupt, which traverses a null ds_run value.
So try to avoid starting a new transaction if the ds_run value is set.
While this patch avoids the null pointer crash, I've had some reports of the k3dma driver still getting confused, which suggests the ds_run/ds_done value handling still isn't quite right. However, I've not run into an issue recently with it so I think this patch is worth pushing upstream to avoid the crash.
--- drivers/dma/k3dma.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-)
drivers/dma/k3dma.c +9 -3
@@ -229,9 +229,11 @@ static irqreturn_t k3_dma_int_handler(int irq, void *dev_id) c = p->vchan;if (c && (tc1 &BIT (i))) {spin_lock_irqsave (&c->vc.lock, flags); -vchan_cookie_complete (&p->ds_run->vd); - p->ds_done = p->ds_run; - p->ds_run =NULL ; +if (p->ds_run !=NULL ) { +vchan_cookie_complete (&p->ds_run->vd); + p->ds_done = p->ds_run; + p->ds_run =NULL ; + }spin_unlock_irqrestore (&c->vc.lock, flags); }if (c && (tc2 &BIT (i))) {
@@ -271,6 +273,10 @@ static int k3_dma_start_txd(struct k3_dma_chan *c)if (BIT (c->phy->idx) &k3_dma_get_chan_stat (d))return -EAGAIN ; +/* Avoid losing track of ds_run if a transaction is in flight */ +if (c->phy->ds_run) +return -EAGAIN ; +if (vd) {struct k3_dma_desc_sw *ds = container_of(vd, struct k3_dma_desc_sw, vd);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 202/203 hexagon: work around compiler crash
In reply to Greg Kroah-HartmanFrom: Nick Desaulniers <[email protected]>
[ Upstream commit 63e80314ab7cf4783526d2e44ee57a90514911c9 ]
Clang cannot translate the string "r30" into a valid register yet.
--- arch/hexagon/kernel/stacktrace.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-)
arch/hexagon/kernel/stacktrace.c +1 -3
@@ -11,8 +11,6 @@#include <linux/thread_info.h> #include <linux/module.h> -registerunsigned long current_frame_pointer asm("r30" ); -struct stackframe {unsigned long fp;unsigned long rets;
@@ -30,7 +28,7 @@ void save_stack_trace(struct stack_trace *trace) low = (unsigned long )task_stack_page (current); high = low +THREAD_SIZE ; - fp = current_frame_pointer; + fp = (unsigned long )__builtin_frame_address (0 );while (fp >= low && fp <= (high -sizeof (*frame))) { frame = (struct stackframe *)fp;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 196/203 s390/qeth: lock the card while changing its hsuid
In reply to Greg Kroah-HartmanFrom: Julian Wiedmann <[email protected]>
[ Upstream commit 5b6c7b55cfe26224b0f41b1c226d3534c542787f ]
qeth_l3_dev_hsuid_store() initially checks the card state, but doesn't take the conf_mutex to ensure that the card stays in this state while being reconfigured.
Rework the code to take this lock, and drop a redundant state check in a helper function.
--- drivers/s390/net/qeth_core_main.c | 5 ---- drivers/s390/net/qeth_l3_sys.c | 40 +++++++++++++++++++++---------- 2 files changed, 28 insertions(+), 17 deletions(-)
drivers/s390/net/qeth_core_main.c +0 -5
@@ -3378,11 +3378,6 @@ int qeth_configure_cq(struct qeth_card *card, enum qeth_cq cq) goto out; } -if (card->state !=CARD_STATE_DOWN ) { - rc =-1 ; - goto out; - } -qeth_free_qdio_queues (card); card->options.cq = cq; rc =0 ;
drivers/s390/net/qeth_l3_sys.c +28 -12
@@ -270,24 +270,36 @@ static ssize_t qeth_l3_dev_hsuid_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct qeth_card *card = dev_get_drvdata(dev); +int rc =0 ;char *tmp; -int rc;if (!card)return -EINVAL ;if (!IS_IQD (card))return -EPERM ; -if (card->state !=CARD_STATE_DOWN ) -return -EPERM ; -if (card->options.sniffer) -return -EPERM ; -if (card->options.cq ==QETH_CQ_NOTAVAILABLE ) -return -EPERM ; + +mutex_lock (&card->conf_mutex); +if (card->state !=CARD_STATE_DOWN ) { + rc = -EPERM ; + goto out; + } + +if (card->options.sniffer) { + rc = -EPERM ; + goto out; + } + +if (card->options.cq ==QETH_CQ_NOTAVAILABLE ) { + rc = -EPERM ; + goto out; + } tmp =strsep ((char **)&buf,"\n" ); -if (strlen (tmp) >8 ) -return -EINVAL ; +if (strlen (tmp) >8 ) { + rc = -EINVAL ; + goto out; + }if (card->options.hsuid[0 ])/* delete old ip address */
@@ -298,11 +310,13 @@ static ssize_t qeth_l3_dev_hsuid_store(struct device *dev, card->options.hsuid[0 ] ='\0' ;memcpy (card->dev->perm_addr, card->options.hsuid,9 );qeth_configure_cq (card,QETH_CQ_DISABLED ); -return count; + goto out; } -if (qeth_configure_cq (card,QETH_CQ_ENABLED )) -return -EPERM ; +if (qeth_configure_cq (card,QETH_CQ_ENABLED )) { + rc = -EPERM ; + goto out; + }snprintf (card->options.hsuid,sizeof (card->options.hsuid),"%-8s" , tmp);
@@ -311,6 +325,8 @@ static ssize_t qeth_l3_dev_hsuid_store(struct device *dev, rc =qeth_l3_modify_hsuid (card, true); +out: +mutex_unlock (&card->conf_mutex);return rc ? rc : count; }
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 197/203 ioat: ioat_alloc_ring() failure handling.
In reply to Greg Kroah-HartmanFrom: [email protected] <[email protected]>
[ Upstream commit b0b5ce1010ffc50015eaec72b0028aaae3f526bb ]
If dma_alloc_coherent() returns NULL in ioat_alloc_ring(), ring allocation must not proceed.
Until now, if the first call to dma_alloc_coherent() in ioat_alloc_ring() returned NULL, the processing could proceed, failing with NULL-pointer dereferencing further down the line.
--- drivers/dma/ioat/dma.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/dma/ioat/dma.c +2 -1
@@ -377,10 +377,11 @@ ioat_alloc_ring(struct dma_chan *c, int order, gfp_t flags) descs->virt =dma_alloc_coherent (to_dev (ioat_chan),SZ_2M , &descs->hw, flags); -if (!descs->virt && (i >0 )) { +if (!descs->virt) {int idx;for (idx =0 ; idx < i; idx++) { + descs = &ioat_chan->descs[idx];dma_free_coherent (to_dev (ioat_chan),SZ_2M , descs->virt, descs->hw); descs->virt =NULL ;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 199/203 media: intel-ipu3: Align struct ipu3_uapi_awb_fr_config_s to 32 bytes
In reply to Greg Kroah-HartmanFrom: Sakari Ailus <[email protected]>
[ Upstream commit ce644cf3fa06504c2c71ab1b794160d54aaccbc0 ]
A struct that needs to be aligned to 32 bytes has a size of 28. Increase the size to 32.
This makes elements of arrays of this struct aligned to 32 as well, and other structs where members are aligned to 32 mixing ipu3_uapi_awb_fr_config_s as well as other types.
--- drivers/staging/media/ipu3/include/intel-ipu3.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/staging/media/ipu3/include/intel-ipu3.h +1 -1
@@ -449,7 +449,7 @@ struct ipu3_uapi_awb_fr_config_s {__u16 reserved1;__u32 bayer_sign;__u8 bayer_nf; -__u8 reserved2[3 ]; +__u8 reserved2[7 ]; } __attribute__((aligned(32))) __packed;/**
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 142/203 MIPS: SGI-IP27: Fix crash, when CPUs are disabled via nr_cpus parameter
In reply to Greg Kroah-HartmanFrom: Thomas Bogendoerfer <[email protected]>
commit e3d765a941f6130fd94e47b2064cfee71f4cbadd upstream.
If number of CPUs are limited by the kernel commandline parameter nr_cpus assignment of interrupts accourding to numa rules might not be possibe. As a fallback use one of the online CPUs as interrupt destination.
--- arch/mips/sgi-ip27/ip27-irq.c | 4 ++++ 1 file changed, 4 insertions(+)
arch/mips/sgi-ip27/ip27-irq.c +4 -0
@@ -73,6 +73,9 @@ static void setup_hub_mask(struct hub_irint cpu; cpu =cpumask_first_and (mask, cpu_online_mask); +if (cpu >= nr_cpu_ids) + cpu =cpumask_any (cpu_online_mask); + nasid =COMPACT_TO_NASID_NODEID (cpu_to_node (cpu)); hd->cpu = cpu;if (!cputoslice (cpu)) {
@@ -139,6 +142,7 @@ static int hub_domain_alloc(struct irq_d/* use CPU connected to nearest hub */ hub =hub_data (NASID_TO_COMPACT_NODEID (info->nasid));setup_hub_mask (hd, &hub->h_cpus); + info->nasid =cpu_to_node (hd->cpu);/* Make sure it's not already pending when we connect it. */ REMOTE_HUB_CLR_INTR (info->nasid, swlevel);
Greg Kroah-Hartman
maintainerPATCH 191/203 drm/arm/mali: make malidp_mw_connector_helper_funcs static
In reply to Greg Kroah-HartmanFrom: Ben Dooks (Codethink) <[email protected]>
[ Upstream commit ac2917b01992c098b8d4e6837115e3ca347fdd90 ]
The malidp_mw_connector_helper_funcs is not referenced by name outside of the file it is in, so make it static to avoid the following warning:
drivers/gpu/drm/arm/malidp_mw.c:59:41: warning: symbol 'malidp_mw_connector_helper_funcs' was not declared. Should it be static?
--- drivers/gpu/drm/arm/malidp_mw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/arm/malidp_mw.c +1 -1
@@ -56,7 +56,7 @@ malidp_mw_connector_mode_valid(struct drm_connector *connector,return MODE_OK ; } -const struct drm_connector_helper_funcs malidp_mw_connector_helper_funcs = { +static const struct drm_connector_helper_funcs malidp_mw_connector_helper_funcs = { .get_modes = malidp_mw_connector_get_modes, .mode_valid = malidp_mw_connector_mode_valid, };
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 183/203 scsi: target/iblock: Fix protection error with blocks greater than 512B
In reply to Greg Kroah-HartmanFrom: Israel Rukshin <[email protected]>
[ Upstream commit e4dc9a4c31fe10d1751c542702afc85be8a5c56a ]
The sector size of the block layer is 512 bytes, but integrity interval size might be different (in case of 4K block size of the media). At the initiator side the virtual start sector is the one that was originally submitted by the block layer (512 bytes) for the Reftag usage. The initiator converts the Reftag to integrity interval units and sends it to the target. So the target virtual start sector should be calculated at integrity interval units. prepare_fn() and complete_fn() don't remap correctly the Reftag when using incorrect units of the virtual start sector, which leads to the following protection error at the device:
"blk_update_request: protection error, dev sdb, sector 2048 op 0x0:(READ) flags 0x10000 phys_seg 1 prio class 0"
To fix that, set the seed in integrity interval units.
--- drivers/target/target_core_iblock.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/target/target_core_iblock.c +3 -1
@@ -646,7 +646,9 @@ iblock_alloc_bip(struct se_cmd *cmd, struct bio *bio, } bip->bip_iter.bi_size =bio_integrity_bytes (bi,bio_sectors (bio)); -bip_set_seed (bip, bio->bi_iter.bi_sector); +/* virtual start sector must be in integrity interval units */ +bip_set_seed (bip, bio->bi_iter.bi_sector >> + (bi->interval_exp -SECTOR_SHIFT ));pr_debug ("IBLOCK BIP Size: %u Sector: %llu\n" , bip->bip_iter.bi_size, (unsigned long long )bip->bip_iter.bi_sector);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 141/203 MIPS: Loongson: Fix return value of loongson_hwmon_init
In reply to Greg Kroah-HartmanFrom: Tiezhu Yang <[email protected]>
commit dece3c2a320b0a6d891da6ff774ab763969b6860 upstream.
When call function hwmon_device_register failed, use the actual return value instead of always -ENOMEM.
--- drivers/platform/mips/cpu_hwmon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/platform/mips/cpu_hwmon.c +1 -1
@@ -161,7 +161,7 @@ static int __init loongson_hwmon_init(vo cpu_hwmon_dev =hwmon_device_register (NULL );if (IS_ERR (cpu_hwmon_dev)) { - ret = -ENOMEM ; + ret =PTR_ERR (cpu_hwmon_dev);pr_err ("hwmon_device_register fail!\n" ); goto fail_hwmon_device_register; }
Greg Kroah-Hartman
maintainerPATCH 192/203 rxrpc: Unlock new call in rxrpc_new_incoming_call() rather than the caller
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
[ Upstream commit f33121cbe91973a08e68e4bde8c3f7e6e4e351c1 ]
Move the unlock and the ping transmission for a new incoming call into rxrpc_new_incoming_call() rather than doing it in the caller. This makes it clearer to see what's going on.
--- net/rxrpc/call_accept.c | 36 ++++++++++++++++++++++++++++-------- net/rxrpc/input.c | 18 ------------------ 2 files changed, 28 insertions(+), 26 deletions(-)
net/rxrpc/call_accept.c +28 -8
@@ -239,6 +239,22 @@ void rxrpc_discard_prealloc(struct rxrpc_sock *rx)kfree (b); } +/* +* Ping the other end to fill our RTT cache and to retrieve the rwind +* and MTU parameters. +*/ +static void rxrpc_send_ping (struct rxrpc_call *call,struct sk_buff *skb) +{ +struct rxrpc_skb_priv *sp =rxrpc_skb (skb); +ktime_t now = skb->tstamp; + +if (call->peer->rtt_usage <3 || +ktime_before (ktime_add_ms (call->peer->rtt_last_req,1000 ), now)) +rxrpc_propose_ACK (call,RXRPC_ACK_PING , sp->hdr.serial, + true, true, + rxrpc_propose_ack_ping_for_params); +} +/* * Allocate a new incoming call from the prealloc pool, along with a connection * and a peer as necessary.
@@ -346,9 +362,7 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local, sp->hdr.seq, RX_INVALID_OPERATION, ESHUTDOWN); skb->mark =RXRPC_SKB_MARK_REJECT_ABORT ; skb->priority =RX_INVALID_OPERATION ; -_leave (" = NULL [close]" ); - call =NULL ; - goto out; + goto no_call; }/* The peer, connection and call may all have sprung into existence due
@@ -361,9 +375,7 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local, call =rxrpc_alloc_incoming_call (rx, local, peer, conn, skb);if (!call) { skb->mark =RXRPC_SKB_MARK_REJECT_BUSY ; -_leave (" = NULL [busy]" ); - call =NULL ; - goto out; + goto no_call; } trace_rxrpc_receive(call, rxrpc_receive_incoming,
@@ -432,10 +444,18 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local,*/ rxrpc_put_call (call, rxrpc_call_put); -_leave (" = %p{%d}" , call, call->debug_id); -out:spin_unlock (&rx->incoming_lock); + +rxrpc_send_ping (call, skb); +mutex_unlock (&call->user_mutex); + +_leave (" = %p{%d}" , call, call->debug_id);return call; + +no_call: +spin_unlock (&rx->incoming_lock); +_leave (" = NULL [%u]" , skb->mark); +return NULL ; }/*
net/rxrpc/input.c +0 -18
@@ -192,22 +192,6 @@ send_extra_data: goto out_no_clear_ca; } -/* -* Ping the other end to fill our RTT cache and to retrieve the rwind -* and MTU parameters. -*/ -static void rxrpc_send_ping (struct rxrpc_call *call,struct sk_buff *skb) -{ -struct rxrpc_skb_priv *sp =rxrpc_skb (skb); -ktime_t now = skb->tstamp; - -if (call->peer->rtt_usage <3 || -ktime_before (ktime_add_ms (call->peer->rtt_last_req,1000 ), now)) -rxrpc_propose_ACK (call,RXRPC_ACK_PING , sp->hdr.serial, - true, true, - rxrpc_propose_ack_ping_for_params); -} -/* * Apply a hard ACK by advancing the Tx window. */
@@ -1396,8 +1380,6 @@ int rxrpc_input_packet(struct sock *udp_sk, struct sk_buff *skb) call =rxrpc_new_incoming_call (local, rx, skb);if (!call) goto reject_packet; -rxrpc_send_ping (call, skb); -mutex_unlock (&call->user_mutex); }/* Process a call packet; this either discards or passes on the ref
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 203/203 ocfs2: call journal flush to mark journal as empty after journal recovery when mount
In reply to Greg Kroah-HartmanFrom: Kai Li <[email protected]>
[ Upstream commit 397eac17f86f404f5ba31d8c3e39ec3124b39fd3 ]
If journal is dirty when mount, it will be replayed but jbd2 sb log tail cannot be updated to mark a new start because journal->j_flag has already been set with JBD2_ABORT first in journal_init_common.
When a new transaction is committed, it will be recored in block 1 first(journal->j_tail is set to 1 in journal_reset). If emergency restart happens again before journal super block is updated unfortunately, the new recorded trans will not be replayed in the next mount.
The following steps describe this procedure in detail.
1. mount and touch some files
2. these transactions are committed to journal area but not checkpointed
3. emergency restart
4. mount again and its journals are replayed
5. journal super block's first s_start is 1, but its s_seq is not updated
6. touch a new file and its trans is committed but not checkpointed
7. emergency restart again
8. mount and journal is dirty, but trans committed in 6 will not be replayed.
This exception happens easily when this lun is used by only one node. If it is used by multi-nodes, other node will replay its journal and its journal super block will be updated after recovery like what this patch does.
ocfs2_recover_node->ocfs2_replay_journal.
The following jbd2 journal can be generated by touching a new file after journal is replayed, and seq 15 is the first valid commit, but first seq is 13 in journal super block.
logdump:
Block 0: Journal Superblock
Seq: 0 Type: 4 (JBD2_SUPERBLOCK_V2)
Blocksize: 4096 Total Blocks: 32768 First Block: 1
First Commit ID: 13 Start Log Blknum: 1
Error: 0
Feature Compat: 0
Feature Incompat: 2 block64
Feature RO compat: 0
Journal UUID: 4ED3822C54294467A4F8E87D2BA4BC36
FS Share Cnt: 1 Dynamic Superblk Blknum: 0
Per Txn Block Limit Journal: 0 Data: 0
Block 1: Journal Commit Block
Seq: 14 Type: 2 (JBD2_COMMIT_BLOCK)
Block 2: Journal Descriptor
Seq: 15 Type: 1 (JBD2_DESCRIPTOR_BLOCK)
No. Blocknum Flags
0. 587 none
UUID: 00000000000000000000000000000000
1. 8257792 JBD2_FLAG_SAME_UUID 2. 619 JBD2_FLAG_SAME_UUID 3. 24772864 JBD2_FLAG_SAME_UUID 4. 8257802 JBD2_FLAG_SAME_UUID 5. 513 JBD2_FLAG_SAME_UUID JBD2_FLAG_LAST_TAG ... Block 7: Inode Inode: 8257802 Mode: 0640 Generation: 57157641 (0x3682809) FS Generation: 2839773110 (0xa9437fb6) CRC32: 00000000 ECC: 0000 Type: Regular Attr: 0x0 Flags: Valid Dynamic Features: (0x1) InlineData User: 0 (root) Group: 0 (root) Size: 7 Links: 1 Clusters: 0 ctime: 0x5de5d870 0x11104c61 -- Tue Dec 3 11:37:20.286280801 2019 atime: 0x5de5d870 0x113181a1 -- Tue Dec 3 11:37:20.288457121 2019 mtime: 0x5de5d870 0x11104c61 -- Tue Dec 3 11:37:20.286280801 2019
dtime: 0x0 -- Thu Jan 1 08:00:00 1970
...
Block 9: Journal Commit Block
Seq: 15 Type: 2 (JBD2_COMMIT_BLOCK)
The following is journal recovery log when recovering the upper jbd2 journal when mount again.
syslog:
ocfs2: File system on device (252,1) was not unmounted cleanly, recovering it. fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 0 fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 1 fs/jbd2/recovery.c:(do_one_pass, 449): Starting recovery pass 2 fs/jbd2/recovery.c:(jbd2_journal_recover, 278): JBD2: recovery, exit status 0, recovered transactions 13 to 13
Due to first commit seq 13 recorded in journal super is not consistent with the value recorded in block 1(seq is 14), journal recovery will be terminated before seq 15 even though it is an unbroken commit, inode 8257802 is a new file and it will be lost.
--- fs/ocfs2/journal.c | 8 ++++++++ 1 file changed, 8 insertions(+)
fs/ocfs2/journal.c +8 -0
@@ -1066,6 +1066,14 @@ int ocfs2_journal_load(struct ocfs2_journal *journal, int local, int replayed)ocfs2_clear_journal_error (osb->sb, journal->j_journal, osb->slot_num); +if (replayed) { +jbd2_journal_lock_updates (journal->j_journal); + status =jbd2_journal_flush (journal->j_journal); +jbd2_journal_unlock_updates (journal->j_journal); +if (status <0 ) +mlog_errno (status); + } + status =ocfs2_journal_toggle_dirty (osb,1 , replayed);if (status <0 ) {mlog_errno (status);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 185/203 rseq/selftests: Turn off timeout setting
In reply to Greg Kroah-HartmanFrom: Mathieu Desnoyers <[email protected]>
[ Upstream commit af9cb29c5488381083b0b5ccdfb3cd931063384a ]
As the rseq selftests can run for a long period of time, disable the timeout that the general selftests have.
--- tools/testing/selftests/rseq/settings | 1 + 1 file changed, 1 insertion(+) create mode 100644 tools/testing/selftests/rseq/settings
tools/testing/selftests/rseq/settings new file +1 -0
@@ -0,0 +1 @@ +timeout=0
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 190/203 MIPS: Prevent link failure with kcov instrumentation
In reply to Greg Kroah-HartmanFrom: Jouni Hogander <[email protected]>
[ Upstream commit a4a3893114a41e365274d5fab5d9ff5acc235ff0 ]
__sanitizer_cov_trace_pc() is not linked in and causing link failure if KCOV_INSTRUMENT is enabled. Fix this by disabling instrumentation for compressed image.
--- arch/mips/boot/compressed/Makefile | 3 +++ 1 file changed, 3 insertions(+)
arch/mips/boot/compressed/Makefile +3 -0
@@ -29,6 +29,9 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS) -D__ASSEMBLY__ \ -DBOOT_HEAP_SIZE=$(BOOT_HEAP_SIZE) \ -DKERNEL_ENTRY=$(VMLINUX_ENTRY_ADDRESS) +# Prevents link failures: __sanitizer_cov_trace_pc() is not linked in. +KCOV_INSTRUMENT := n + # decompressor objects (linked with vmlinuz) vmlinuzobjs-y := $(obj)/head.o $(obj)/decompress.o $(obj)/string.o
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 189/203 tomoyo: Suppress RCU warning at list_for_each_entry_rcu().
In reply to Greg Kroah-HartmanFrom: Tetsuo Handa <[email protected]>
[ Upstream commit 6bd5ce6089b561f5392460bfb654dea89356ab1b ]
John Garry has reported that allmodconfig kernel on arm64 causes flood of "RCU-list traversed in non-reader section!!" warning. I don't know what change caused this warning, but this warning is safe because TOMOYO uses SRCU lock instead. Let's suppress this warning by explicitly telling that the caller is holding SRCU lock.
--- security/tomoyo/common.c | 9 ++++++--- security/tomoyo/domain.c | 15 ++++++++++----- security/tomoyo/group.c | 9 ++++++--- security/tomoyo/util.c | 6 ++++-- 4 files changed, 26 insertions(+), 13 deletions(-)
security/tomoyo/common.c +6 -3
@@ -951,7 +951,8 @@ static bool tomoyo_manager(void) exe =tomoyo_get_exe ();if (!exe)return false; -list_for_each_entry_rcu (ptr, &tomoyo_kernel_namespace.policy_list[TOMOYO_ID_MANAGER ], head.list) { +list_for_each_entry_rcu (ptr, &tomoyo_kernel_namespace.policy_list[TOMOYO_ID_MANAGER ], head.list, +srcu_read_lock_held (&tomoyo_ss)) {if (!ptr->head.is_deleted && (!tomoyo_pathcmp (domainname, ptr->manager) || !strcmp (exe, ptr->manager->name))) {
@@ -1095,7 +1096,8 @@ static int tomoyo_delete_domain(char *domainname)if (mutex_lock_interruptible (&tomoyo_policy_lock))return -EINTR ;/* Is there an active domain? */ -list_for_each_entry_rcu (domain, &tomoyo_domain_list, list) { +list_for_each_entry_rcu (domain, &tomoyo_domain_list, list, +srcu_read_lock_held (&tomoyo_ss)) {/* Never delete tomoyo_kernel_domain */ if (domain == &tomoyo_kernel_domain)continue ;
@@ -2778,7 +2780,8 @@ void tomoyo_check_profile(void) tomoyo_policy_loaded = true;pr_info ("TOMOYO: 2.6.0\n" ); -list_for_each_entry_rcu (domain, &tomoyo_domain_list, list) { +list_for_each_entry_rcu (domain, &tomoyo_domain_list, list, +srcu_read_lock_held (&tomoyo_ss)) {const u8 profile = domain->profile;struct tomoyo_policy_namespace *ns = domain->ns;
security/tomoyo/domain.c +10 -5
@@ -41,7 +41,8 @@ int tomoyo_update_policy(struct tomoyo_acl_head *new_entry, const int size,if (mutex_lock_interruptible (&tomoyo_policy_lock))return -ENOMEM ; -list_for_each_entry_rcu (entry, list, list) { +list_for_each_entry_rcu (entry, list, list, +srcu_read_lock_held (&tomoyo_ss)) {if (entry->is_deleted ==TOMOYO_GC_IN_PROGRESS )continue ;if (!check_duplicate (entry, new_entry))
@@ -119,7 +120,8 @@ int tomoyo_update_domain(struct tomoyo_acl_info *new_entry, const int size, }if (mutex_lock_interruptible (&tomoyo_policy_lock)) goto out; -list_for_each_entry_rcu (entry, list, list) { +list_for_each_entry_rcu (entry, list, list, +srcu_read_lock_held (&tomoyo_ss)) {if (entry->is_deleted ==TOMOYO_GC_IN_PROGRESS )continue ; if (!tomoyo_same_acl_head(entry, new_entry) ||
@@ -166,7 +168,8 @@ void tomoyo_check_acl(struct tomoyo_request_info *r,u16 i =0 ; retry: -list_for_each_entry_rcu (ptr, list, list) { +list_for_each_entry_rcu (ptr, list, list, +srcu_read_lock_held (&tomoyo_ss)) {if (ptr->is_deleted || ptr->type != r->param_type)continue ;if (!check_entry (r, ptr))
@@ -298,7 +301,8 @@ static inline bool tomoyo_scan_transition {const struct tomoyo_transition_control *ptr; -list_for_each_entry_rcu (ptr, list, head.list) { +list_for_each_entry_rcu (ptr, list, head.list, +srcu_read_lock_held (&tomoyo_ss)) {if (ptr->head.is_deleted || ptr->type != type)continue ;if (ptr->domainname) {
@@ -735,7 +739,8 @@ retry:/* Check 'aggregator' directive. */ candidate = &exename; -list_for_each_entry_rcu (ptr, list, head.list) { +list_for_each_entry_rcu (ptr, list, head.list, +srcu_read_lock_held (&tomoyo_ss)) {if (ptr->head.is_deleted || !tomoyo_path_matches_pattern (&exename, ptr->original_name))
security/tomoyo/group.c +6 -3
@@ -133,7 +133,8 @@ tomoyo_path_matches_group(const struct tomoyo_path_info *pathname, {struct tomoyo_path_group *member; -list_for_each_entry_rcu (member, &group->member_list, head.list) { +list_for_each_entry_rcu (member, &group->member_list, head.list, +srcu_read_lock_held (&tomoyo_ss)) {if (member->head.is_deleted)continue ;if (!tomoyo_path_matches_pattern (pathname, member->member_name))
@@ -161,7 +162,8 @@ bool tomoyo_number_matches_group(const unsigned long min,struct tomoyo_number_group *member;bool matched = false; -list_for_each_entry_rcu (member, &group->member_list, head.list) { +list_for_each_entry_rcu (member, &group->member_list, head.list, +srcu_read_lock_held (&tomoyo_ss)) {if (member->head.is_deleted)continue ; if (min > member->number.values[1] ||
@@ -191,7 +193,8 @@ bool tomoyo_address_matches_group(const bool is_ipv6, const __be32 *address,bool matched = false;const u8 size = is_ipv6 ?16 :4 ; -list_for_each_entry_rcu (member, &group->member_list, head.list) { +list_for_each_entry_rcu (member, &group->member_list, head.list, +srcu_read_lock_held (&tomoyo_ss)) {if (member->head.is_deleted)continue ;if (member->address.is_ipv6 != is_ipv6)
security/tomoyo/util.c +4 -2
@@ -594,7 +594,8 @@ struct tomoyo_domain_info *tomoyo_find_domain(const char *domainname) name.name = domainname;tomoyo_fill_path_info (&name); -list_for_each_entry_rcu (domain, &tomoyo_domain_list, list) { +list_for_each_entry_rcu (domain, &tomoyo_domain_list, list, +srcu_read_lock_held (&tomoyo_ss)) {if (!domain->is_deleted && !tomoyo_pathcmp (&name, domain->domainname))return domain;
@@ -1028,7 +1029,8 @@ bool tomoyo_domain_quota_is_ok(struct tomoyo_request_info *r)return false;if (!domain)return true; -list_for_each_entry_rcu (ptr, &domain->acl_info_list, list) { +list_for_each_entry_rcu (ptr, &domain->acl_info_list, list, +srcu_read_lock_held (&tomoyo_ss)) {u16 perm;u8 i;
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 188/203 mips: Fix gettimeofday() in the vdso library
In reply to Greg Kroah-HartmanFrom: Vincenzo Frascino <[email protected]>
[ Upstream commit 7d2aa4bb90f5f6f1b8de8848c26042403f2d7bf9 ]
The libc provides a discovery mechanism for vDSO library and its symbols. When a symbol is not exposed by the vDSOs the libc falls back on the system calls.
With the introduction of the unified vDSO library on mips this behavior is not honored anymore by the kernel in the case of gettimeofday().
The issue has been noticed and reported due to a dhclient failure on the CI20 board:
root@letux:~# dhclient ../../../../lib/isc/unix/time.c:200: Operation not permitted root@letux:~#
Restore the original behavior fixing gettimeofday() in the vDSO library.
--- arch/mips/include/asm/vdso/gettimeofday.h | 13 ------------- arch/mips/vdso/vgettimeofday.c | 20 ++++++++++++++++++++ 2 files changed, 20 insertions(+), 13 deletions(-)
arch/mips/include/asm/vdso/gettimeofday.h +0 -13
@@ -26,8 +26,6 @@#define __VDSO_USE_SYSCALL ULLONG_MAX -#ifdef CONFIG_MIPS_CLOCK_VSYSCALL -static __always_inline long gettimeofday_fallback (struct __kernel_old_timeval *_tv,struct timezone *_tz)
@@ -48,17 +46,6 @@ static __always_inline long gettimeofday_fallback(return error ? -ret : ret; } -#else - -static __always_inline long gettimeofday_fallback ( -struct __kernel_old_timeval *_tv, -struct timezone *_tz) -{ -return -1 ; -} - -#endif -static __always_inline long clock_gettime_fallback (clockid_t _clkid,struct __kernel_timespec *_ts)
arch/mips/vdso/vgettimeofday.c +20 -0
@@ -17,12 +17,22 @@ int __vdso_clock_gettime(clockid_t clock,return __cvdso_clock_gettime32 (clock, ts); } +#ifdef CONFIG_MIPS_CLOCK_VSYSCALL + +/* +* This is behind the ifdef so that we don't provide the symbol when there's no +* possibility of there being a usable clocksource, because there's nothing we +* can do without it. When libc fails the symbol lookup it should fall back on +* the standard syscall path. +*/ int __vdso_gettimeofday (struct __kernel_old_timeval *tv,struct timezone *tz) {return __cvdso_gettimeofday (tv, tz); } +#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */ +int __vdso_clock_getres (clockid_t clock_id,struct old_timespec32 *res) {
@@ -43,12 +53,22 @@ int __vdso_clock_gettime(clockid_t clock,return __cvdso_clock_gettime (clock, ts); } +#ifdef CONFIG_MIPS_CLOCK_VSYSCALL + +/* +* This is behind the ifdef so that we don't provide the symbol when there's no +* possibility of there being a usable clocksource, because there's nothing we +* can do without it. When libc fails the symbol lookup it should fall back on +* the standard syscall path. +*/ int __vdso_gettimeofday (struct __kernel_old_timeval *tv,struct timezone *tz) {return __cvdso_gettimeofday (tv, tz); } +#endif /* CONFIG_MIPS_CLOCK_VSYSCALL */ +int __vdso_clock_getres (clockid_t clock_id,struct __kernel_timespec *res) {
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 187/203 mips: cacheinfo: report shared CPU map
In reply to Greg Kroah-HartmanFrom: Vladimir Kondratiev <[email protected]>
[ Upstream commit 3b1313eb32c499d46dc4c3e896d19d9564c879c4 ]
Report L1 caches as shared per core; L2 - per cluster.
This fixes "perf" that went crazy if shared_cpu_map attribute not reported on sysfs, in form of
/sys/devices/system/cpu/cpu*/cache/index*/shared_cpu_list /sys/devices/system/cpu/cpu*/cache/index*/shared_cpu_map
--- arch/mips/kernel/cacheinfo.c | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-)
arch/mips/kernel/cacheinfo.c +26 -1
@@ -50,6 +50,25 @@ static int __init_cache_level(unsigned int cpu)return 0 ; } +static void fill_cpumask_siblings (int cpu,cpumask_t *cpu_map) +{ +int cpu1; + +for_each_possible_cpu (cpu1) +if (cpus_are_siblings (cpu, cpu1)) +cpumask_set_cpu (cpu1, cpu_map); +} + +static void fill_cpumask_cluster (int cpu,cpumask_t *cpu_map) +{ +int cpu1; +int cluster =cpu_cluster (&cpu_data[cpu]); + +for_each_possible_cpu (cpu1) +if (cpu_cluster (&cpu_data[cpu1]) == cluster) +cpumask_set_cpu (cpu1, cpu_map); +} +static int __populate_cache_leaves (unsigned int cpu) {struct cpuinfo_mips *c = ¤t_cpu_data;
@@ -57,14 +76,20 @@ static int __populate_cache_leaves(unsigned int cpu)struct cacheinfo *this_leaf = this_cpu_ci->info_list;if (c->icache.waysize) { +/* L1 caches are per core */ +fill_cpumask_siblings (cpu, &this_leaf->shared_cpu_map);populate_cache (dcache, this_leaf,1 ,CACHE_TYPE_DATA ); +fill_cpumask_siblings (cpu, &this_leaf->shared_cpu_map);populate_cache (icache, this_leaf,1 ,CACHE_TYPE_INST ); }else {populate_cache (dcache, this_leaf,1 ,CACHE_TYPE_UNIFIED ); } -if (c->scache.waysize) +if (c->scache.waysize) { +/* L2 cache is per cluster */ +fill_cpumask_cluster (cpu, &this_leaf->shared_cpu_map);populate_cache (scache, this_leaf,2 ,CACHE_TYPE_UNIFIED ); + }if (c->tcache.waysize)populate_cache (tcache, this_leaf,3 ,CACHE_TYPE_UNIFIED );
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 186/203 riscv: export flush_icache_all to modules
In reply to Greg Kroah-HartmanFrom: Olof Johansson <[email protected]>
[ Upstream commit 1833e327a5ea1d1f356fbf6ded0760c9ff4b0594 ]
This is needed by LKDTM (crash dump test module), it calls flush_icache_range(), which on RISC-V turns into flush_icache_all(). On other architectures, the actual implementation is exported, so follow that precedence and export it here too.
Fixes build of CONFIG_LKDTM that fails with:
ERROR: "flush_icache_all" [drivers/misc/lkdtm/lkdtm.ko] undefined!
--- arch/riscv/mm/cacheflush.c | 1 + 1 file changed, 1 insertion(+)
arch/riscv/mm/cacheflush.c +1 -0
@@ -14,6 +14,7 @@ void flush_icache_all(void) {sbi_remote_fence_i (NULL ); } +EXPORT_SYMBOL (flush_icache_all);/* * Performs an icache flush for the given MM context. RISC-V has no direct
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 201/203 hexagon: parenthesize registers in asm predicates
In reply to Greg Kroah-HartmanFrom: Nick Desaulniers <[email protected]>
[ Upstream commit 780a0cfda9006a9a22d6473c2d4c527f5c68eb2e ]
Hexagon requires that register predicates in assembly be parenthesized.
--- arch/hexagon/include/asm/atomic.h | 8 ++++---- arch/hexagon/include/asm/bitops.h | 8 ++++---- arch/hexagon/include/asm/cmpxchg.h | 2 +- arch/hexagon/include/asm/futex.h | 6 +++--- arch/hexagon/include/asm/spinlock.h | 20 ++++++++++---------- arch/hexagon/kernel/vm_entry.S | 2 +- 6 files changed, 23 insertions(+), 23 deletions(-)
arch/hexagon/include/asm/atomic.h +4 -4
@@ -91,7 +91,7 @@ static inline void atomic_##op(int i, atomic_t *v) \"1: %0 = memw_locked(%1);\n" \ " %0 = "#op "(%0,%2);\n" \ " memw_locked(%1,P3)=%0;\n" \ - " if !P3 jump 1b;\n" \ + " if (!P3) jump 1b;\n" \ : "=&r" (output) \ : "r" (&v->counter), "r" (i) \ : "memory", "p3" \
@@ -107,7 +107,7 @@ static inline int atomic_##op##_return(int i, atomic_t *v) \"1: %0 = memw_locked(%1);\n" \ " %0 = "#op "(%0,%2);\n" \ " memw_locked(%1,P3)=%0;\n" \ - " if !P3 jump 1b;\n" \ + " if (!P3) jump 1b;\n" \ : "=&r" (output) \ : "r" (&v->counter), "r" (i) \ : "memory", "p3" \
@@ -124,7 +124,7 @@ static inline int atomic_fetch_##op(int i, atomic_t *v) \"1: %0 = memw_locked(%2);\n" \ " %1 = "#op "(%0,%3);\n" \ " memw_locked(%2,P3)=%1;\n" \ - " if !P3 jump 1b;\n" \ + " if (!P3) jump 1b;\n" \ : "=&r" (output), "=&r" (val) \ : "r" (&v->counter), "r" (i) \ : "memory", "p3" \
@@ -173,7 +173,7 @@ static inline int atomic_fetch_add_unless(atomic_t *v, int a, int u)" }" " memw_locked(%2, p3) = %1;" " {" -" if !p3 jump 1b;" +" if (!p3) jump 1b;" " }" "2:" : "=&r" (__oldval), "=&r" (tmp)
arch/hexagon/include/asm/bitops.h +4 -4
@@ -38,7 +38,7 @@ static inline int test_and_clear_bit(int nr, volatile void *addr)"1: R12 = memw_locked(R10);\n" " { P0 = tstbit(R12,R11); R12 = clrbit(R12,R11); }\n" " memw_locked(R10,P1) = R12;\n" -" {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n" +" {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n" : "=&r" (oldval) : "r" (addr), "r" (nr) : "r10", "r11", "r12", "p0", "p1", "memory"
@@ -62,7 +62,7 @@ static inline int test_and_set_bit(int nr, volatile void *addr)"1: R12 = memw_locked(R10);\n" " { P0 = tstbit(R12,R11); R12 = setbit(R12,R11); }\n" " memw_locked(R10,P1) = R12;\n" -" {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n" +" {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n" : "=&r" (oldval) : "r" (addr), "r" (nr) : "r10", "r11", "r12", "p0", "p1", "memory"
@@ -88,7 +88,7 @@ static inline int test_and_change_bit(int nr, volatile void *addr)"1: R12 = memw_locked(R10);\n" " { P0 = tstbit(R12,R11); R12 = togglebit(R12,R11); }\n" " memw_locked(R10,P1) = R12;\n" -" {if !P1 jump 1b; %0 = mux(P0,#1,#0);}\n" +" {if (!P1) jump 1b; %0 = mux(P0,#1,#0);}\n" : "=&r" (oldval) : "r" (addr), "r" (nr) : "r10", "r11", "r12", "p0", "p1", "memory"
@@ -223,7 +223,7 @@ static inline int ffs(int x)int r; asm("{ P0 = cmp.eq(%1,#0); %0 = ct0(%1);}\n" -"{ if P0 %0 = #0; if !P0 %0 = add(%0,#1);}\n" +"{ if (P0) %0 = #0; if (!P0) %0 = add(%0,#1);}\n" :"=&r" (r) :"r" (x) :"p0" );
arch/hexagon/include/asm/cmpxchg.h +1 -1
@@ -30,7 +30,7 @@ static inline unsigned long __xchg(unsigned long x, volatile void *ptr, __asm__ __volatile__ ("1: %0 = memw_locked(%1);\n" /* load into retval */ " memw_locked(%1,P0) = %2;\n" /* store into memory */ -" if !P0 jump 1b;\n" +" if (!P0) jump 1b;\n" :"=&r" (retval) :"r" (ptr),"r" (x) : "memory", "p0"
arch/hexagon/include/asm/futex.h +3 -3
@@ -16,7 +16,7 @@/* For example: %1 = %4 */ \ insn \"2: memw_locked(%3,p2) = %1;\n" \ -" if !p2 jump 1b;\n" \ +" if (!p2) jump 1b;\n" \" %1 = #0;\n" \"3:\n" \".section .fixup,\"ax\"\n" \
@@ -84,10 +84,10 @@ futex_atomic_cmpxchg_inatomic(u32 *uval, u32 __user *uaddr, u32 oldval,"1: %1 = memw_locked(%3)\n" " {\n" " p2 = cmp.eq(%1,%4)\n" -" if !p2.new jump:NT 3f\n" +" if (!p2.new) jump:NT 3f\n" " }\n" "2: memw_locked(%3,p2) = %5\n" -" if !p2 jump 1b\n" +" if (!p2) jump 1b\n" "3:\n" ".section .fixup,\"ax\"\n" "4: %0 = #%6\n"
arch/hexagon/include/asm/spinlock.h +10 -10
@@ -30,9 +30,9 @@ static inline void arch_read_lock(arch_rwlock_t *lock) __asm__ __volatile__("1: R6 = memw_locked(%0);\n" " { P3 = cmp.ge(R6,#0); R6 = add(R6,#1);}\n" -" { if !P3 jump 1b; }\n" +" { if (!P3) jump 1b; }\n" " memw_locked(%0,P3) = R6;\n" -" { if !P3 jump 1b; }\n" +" { if (!P3) jump 1b; }\n" : :"r" (&lock->lock) : "memory", "r6", "p3"
@@ -46,7 +46,7 @@ static inline void arch_read_unlock(arch_rwlock_t *lock) "1: R6 = memw_locked(%0);\n" " R6 = add(R6,#-1);\n" " memw_locked(%0,P3) = R6\n" - " if !P3 jump 1b;\n" + " if (!P3) jump 1b;\n" : : "r" (&lock->lock) : "memory", "r6", "p3"
@@ -61,7 +61,7 @@ static inline int arch_read_trylock(arch_rwlock_t *lock) __asm__ __volatile__(" R6 = memw_locked(%1);\n" " { %0 = #0; P3 = cmp.ge(R6,#0); R6 = add(R6,#1);}\n" -" { if !P3 jump 1f; }\n" +" { if (!P3) jump 1f; }\n" " memw_locked(%1,P3) = R6;\n" " { %0 = P3 }\n" "1:\n"
@@ -78,9 +78,9 @@ static inline void arch_write_lock(arch_rwlock_t *lock) __asm__ __volatile__("1: R6 = memw_locked(%0)\n" " { P3 = cmp.eq(R6,#0); R6 = #-1;}\n" -" { if !P3 jump 1b; }\n" +" { if (!P3) jump 1b; }\n" " memw_locked(%0,P3) = R6;\n" -" { if !P3 jump 1b; }\n" +" { if (!P3) jump 1b; }\n" : :"r" (&lock->lock) : "memory", "r6", "p3"
@@ -94,7 +94,7 @@ static inline int arch_write_trylock(arch_rwlock_t *lock) __asm__ __volatile__(" R6 = memw_locked(%1)\n" " { %0 = #0; P3 = cmp.eq(R6,#0); R6 = #-1;}\n" -" { if !P3 jump 1f; }\n" +" { if (!P3) jump 1f; }\n" " memw_locked(%1,P3) = R6;\n" " %0 = P3;\n" "1:\n"
@@ -117,9 +117,9 @@ static inline void arch_spin_lock(arch_spinlock_t *lock) __asm__ __volatile__("1: R6 = memw_locked(%0);\n" " P3 = cmp.eq(R6,#0);\n" -" { if !P3 jump 1b; R6 = #1; }\n" +" { if (!P3) jump 1b; R6 = #1; }\n" " memw_locked(%0,P3) = R6;\n" -" { if !P3 jump 1b; }\n" +" { if (!P3) jump 1b; }\n" : :"r" (&lock->lock) : "memory", "r6", "p3"
@@ -139,7 +139,7 @@ static inline unsigned int arch_spin_trylock(arch_spinlock_t *lock) __asm__ __volatile__(" R6 = memw_locked(%1);\n" " P3 = cmp.eq(R6,#0);\n" -" { if !P3 jump 1f; R6 = #1; %0 = #0; }\n" +" { if (!P3) jump 1f; R6 = #1; %0 = #0; }\n" " memw_locked(%1,P3) = R6;\n" " %0 = P3;\n" "1:\n"
arch/hexagon/kernel/vm_entry.S +1 -1
@@ -369,7 +369,7 @@ ret_from_fork: R26.L = #LO(do_work_pending); R0 = #VM_INT_DISABLE; } - if P0 jump check_work_pending + if (P0) jump check_work_pending { R0 = R25; callr R24
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 163/203 ubifs: Fixed missed le64_to_cpu() in journal
In reply to Greg Kroah-HartmanFrom: Ben Dooks (Codethink) <[email protected]>
commit df22b5b3ecc6233e33bd27f67f14c0cd1b5a5897 upstream.
In the ubifs_jnl_write_inode() functon, it calls ubifs_iget() with xent->inum. The xent->inum is __le64, but the ubifs_iget() takes native cpu endian.
I think that this should be changed to passing le64_to_cpu(xent->inum) to fix the following sparse warning:
fs/ubifs/journal.c:902:58: warning: incorrect type in argument 2 (different base types)fs/ubifs/journal.c:902:58: expected unsigned long inumfs/ubifs/journal.c:902:58: got restricted __le64 [usertype] inum
--- fs/ubifs/journal.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
fs/ubifs/journal.c +1 -1
@@ -899,7 +899,7 @@ int ubifs_jnl_write_inode(struct ubifs_ifname_name (&nm) = xent->name;fname_len (&nm) =le16_to_cpu (xent->nlen); - xino =ubifs_iget (c->vfs_sb, xent->inum); + xino =ubifs_iget (c->vfs_sb,le64_to_cpu (xent->inum));if (IS_ERR (xino)) { err =PTR_ERR (xino); ubifs_err(c, "dead directory entry '%s', error %d",
Greg Kroah-Hartman
maintainerPATCH 198/203 drm/amdgpu: enable gfxoff for raven1 refresh
In reply to Greg Kroah-HartmanFrom: changzhu <[email protected]>
[ Upstream commit e0c63812352298efbce2a71483c1dab627d0c288 ]
When smu version is larger than 0x41e2b, it will load raven_kicker_rlc.bin.To enable gfxoff for raven_kicker_rlc.bin,it needs to avoid adev->pm.pp_feature &= ~PP_GFXOFF_MASK when it loads raven_kicker_rlc.bin.
--- drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-)
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +4 -11
@@ -1038,17 +1038,10 @@ static void gfx_v9_0_check_if_need_gfxoff(struct amdgpu_device *adev)case CHIP_VEGA20 :break ;case CHIP_RAVEN : -/* Disable GFXOFF on original raven. There are combinations -* of sbios and platforms that are not stable. -*/ -if (!(adev->rev_id >=0x8 || adev->pdev->device ==0x15d8 )) - adev->pm.pp_feature &= ~PP_GFXOFF_MASK ; -else if (!(adev->rev_id >=0x8 || adev->pdev->device ==0x15d8 ) - &&((adev->gfx.rlc_fw_version !=106 && - adev->gfx.rlc_fw_version <531 ) || - (adev->gfx.rlc_fw_version ==53815 ) || - (adev->gfx.rlc_feature_version <1 ) || - !adev->gfx.rlc.is_rlc_v2_1)) +if (!(adev->rev_id >=0x8 || + adev->pdev->device ==0x15d8 ) && + (adev->pm.fw_version <0x41e2b ||/* not raven1 fresh */ + !adev->gfx.rlc.is_rlc_v2_1))/* without rlc save restore ucodes */ adev->pm.pp_feature &= ~PP_GFXOFF_MASK ;if (adev->pm.pp_feature &PP_GFXOFF_MASK )
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 182/203 scsi: libcxgbi: fix NULL pointer dereference in cxgbi_device_destroy()
In reply to Greg Kroah-HartmanFrom: Varun Prakash <[email protected]>
[ Upstream commit 71482fde704efdd8c3abe0faf34d922c61e8d76b ]
If cxgb4i_ddp_init() fails then cdev->cdev2ppm will be NULL, so add a check for NULL pointer before dereferencing it.
--- drivers/scsi/cxgbi/libcxgbi.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/scsi/cxgbi/libcxgbi.c +2 -1
@@ -121,7 +121,8 @@ static inline void cxgbi_device_destroy(struct cxgbi_device *cdev) "cdev 0x%p, p# %u.\n", cdev, cdev->nports);cxgbi_hbas_remove (cdev);cxgbi_device_portmap_cleanup (cdev); -cxgbi_ppm_release (cdev->cdev2ppm (cdev)); +if (cdev->cdev2ppm) +cxgbi_ppm_release (cdev->cdev2ppm (cdev));if (cdev->pmap.max_connect)cxgbi_free_big_mem (cdev->pmap.port_csk);kfree (cdev);
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 194/203 rxrpc: Fix missing security check on incoming calls
In reply to Greg Kroah-HartmanFrom: David Howells <[email protected]>
[ Upstream commit 063c60d39180cec7c9317f5acfc3071f8fecd705 ]
Fix rxrpc_new_incoming_call() to check that we have a suitable service key available for the combination of service ID and security class of a new incoming call - and to reject calls for which we don't.
This causes an assertion like the following to appear:
rxrpc: Assertion failed - 6(0x6) == 12(0xc) is false kernel BUG at net/rxrpc/call_object.c:456!
Where call->state is RXRPC_CALL_SERVER_SECURING (6) rather than RXRPC_CALL_COMPLETE (12).
--- net/rxrpc/ar-internal.h | 10 ++++-- net/rxrpc/call_accept.c | 14 ++++++-- net/rxrpc/conn_event.c | 16 +-------- net/rxrpc/conn_service.c | 4 +++ net/rxrpc/rxkad.c | 5 +-- net/rxrpc/security.c | 70 +++++++++++++++++++--------------------- 6 files changed, 59 insertions(+), 60 deletions(-)
net/rxrpc/ar-internal.h +7 -3
@@ -209,6 +209,7 @@ struct rxrpc_skb_priv {struct rxrpc_security {const char *name;/* name of this service */ u8 security_index;/* security type provided */ +u32 no_key_abort;/* Abort code indicating no key */ /* Initialise a security service */ int (*init)(void );
@@ -977,8 +978,9 @@ static inline void rxrpc_reduce_conn_timer(struct rxrpc_connection *conn,struct rxrpc_connection *rxrpc_find_service_conn_rcu (struct rxrpc_peer *,struct sk_buff *);struct rxrpc_connection *rxrpc_prealloc_service_connection (struct rxrpc_net *,gfp_t ); -void rxrpc_new_incoming_connection (struct rxrpc_sock *, -struct rxrpc_connection *,struct sk_buff *); +void rxrpc_new_incoming_connection (struct rxrpc_sock *,struct rxrpc_connection *, +const struct rxrpc_security *,struct key *, +struct sk_buff *);void rxrpc_unpublish_service_conn (struct rxrpc_connection *);/*
@@ -1103,7 +1105,9 @@ extern const struct rxrpc_security rxkad;int __init rxrpc_init_security (void );void rxrpc_exit_security (void );int rxrpc_init_client_conn_security (struct rxrpc_connection *); -int rxrpc_init_server_conn_security (struct rxrpc_connection *); +bool rxrpc_look_up_server_security (struct rxrpc_local *,struct rxrpc_sock *, +const struct rxrpc_security **,struct key **, +struct sk_buff *);/* * sendmsg.c
net/rxrpc/call_accept.c +11 -3
@@ -263,6 +263,8 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(struct rxrpc_sock *rx,struct rxrpc_local *local, struct rxrpc_peer *peer, struct rxrpc_connection *conn, + const struct rxrpc_security *sec, + struct key *key, struct sk_buff *skb) { struct rxrpc_backlog *b = rx->backlog;
@@ -310,7 +312,7 @@ static struct rxrpc_call *rxrpc_alloc_incoming_call(struct rxrpc_sock *rx, conn->params.local =rxrpc_get_local (local); conn->params.peer = peer;rxrpc_see_connection (conn); -rxrpc_new_incoming_connection (rx, conn, skb); +rxrpc_new_incoming_connection (rx, conn, sec, key, skb); }else {rxrpc_get_connection (conn); }
@@ -349,9 +351,11 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local, struct sk_buff *skb) {struct rxrpc_skb_priv *sp =rxrpc_skb (skb); +const struct rxrpc_security *sec =NULL ;struct rxrpc_connection *conn;struct rxrpc_peer *peer =NULL ; -struct rxrpc_call *call; +struct rxrpc_call *call =NULL ; +struct key *key =NULL ;_enter ("" );
@@ -372,7 +376,11 @@ struct rxrpc_call *rxrpc_new_incoming_call(struct rxrpc_local *local,*/ conn =rxrpc_find_connection_rcu (local, skb, &peer); - call =rxrpc_alloc_incoming_call (rx, local, peer, conn, skb); +if (!conn && !rxrpc_look_up_server_security (local, rx, &sec, &key, skb)) + goto no_call; + + call =rxrpc_alloc_incoming_call (rx, local, peer, conn, sec, key, skb); +key_put (key);if (!call) { skb->mark =RXRPC_SKB_MARK_REJECT_BUSY ; goto no_call;
net/rxrpc/conn_event.c +1 -15
@@ -376,21 +376,7 @@ static void rxrpc_secure_connection(struct rxrpc_connection *conn)_enter ("{%d}" , conn->debug_id);ASSERT (conn->security_ix !=0 ); - -if (!conn->params.key) { -_debug ("set up security" ); - ret =rxrpc_init_server_conn_security (conn); -switch (ret) { -case 0 : -break ; -case -ENOENT : - abort_code =RX_CALL_DEAD ; - goto abort; -default : - abort_code =RXKADNOAUTH ; - goto abort; - } - } +ASSERT (conn->server_key);if (conn->security->issue_challenge (conn) <0 ) { abort_code =RX_CALL_DEAD ;
net/rxrpc/conn_service.c +4 -0
@@ -148,6 +148,8 @@ struct rxrpc_connection *rxrpc_prealloc_service_connection(struct rxrpc_net *rxn*/ void rxrpc_new_incoming_connection (struct rxrpc_sock *rx,struct rxrpc_connection *conn, +const struct rxrpc_security *sec, +struct key *key,struct sk_buff *skb) {struct rxrpc_skb_priv *sp =rxrpc_skb (skb);
@@ -160,6 +162,8 @@ void rxrpc_new_incoming_connection(struct rxrpc_sock *rx, conn->service_id = sp->hdr.serviceId; conn->security_ix = sp->hdr.securityIndex; conn->out_clientflag =0 ; + conn->security = sec; + conn->server_key =key_get (key);if (conn->security_ix) conn->state =RXRPC_CONN_SERVICE_UNSECURED ;else
net/rxrpc/rxkad.c +3 -2
@@ -648,9 +648,9 @@ static int rxkad_issue_challenge(struct rxrpc_connection *conn)u32 serial;int ret; -_enter ("{%d,%x}" , conn->debug_id,key_serial (conn->params.key)); +_enter ("{%d,%x}" , conn->debug_id,key_serial (conn->server_key)); - ret =key_validate (conn->params.key); + ret =key_validate (conn->server_key);if (ret <0 )return ret;
@@ -1293,6 +1293,7 @@ static void rxkad_exit(void)const struct rxrpc_security rxkad = { .name ="rxkad" , .security_index =RXRPC_SECURITY_RXKAD , + .no_key_abort =RXKADUNKNOWNKEY , .init = rxkad_init, .exit = rxkad_exit, .init_connection_security = rxkad_init_connection_security,
net/rxrpc/security.c +33 -37
95 lines not on this page · raw message
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 180/203 rtc: bd70528: Add MODULE ALIAS to autoload module
In reply to Greg Kroah-HartmanFrom: Matti Vaittinen <[email protected]>
commit c3e12e66b14a043daac6b3d0559df80b9ed7679c upstream.
The bd70528 RTC driver is probed by MFD driver. Add MODULE_ALIAS in order to allow udev to load the module when MFD sub-device cell for RTC is added.
I'm not sure if this is a bugfix or feature addition but I guess fixes tag won't harm in this case.
--- drivers/rtc/rtc-bd70528.c | 1 + 1 file changed, 1 insertion(+)
drivers/rtc/rtc-bd70528.c +1 -0
@@ -491,3 +491,4 @@ module_platform_driver(bd70528_rtc);MODULE_AUTHOR ("Matti Vaittinen <[email protected]>" );MODULE_DESCRIPTION ("BD70528 RTC driver" );MODULE_LICENSE ("GPL" ); +MODULE_ALIAS ("platofrm:bd70528-rtc" );
Greg Kroah-Hartman
maintainerPATCH 184/203 selftests: firmware: Fix it to do root uid check and skip
In reply to Greg Kroah-HartmanFrom: Shuah Khan <[email protected]>
[ Upstream commit c65e41538b04e0d64a673828745a00cb68a24371 ]
firmware attempts to load test modules that require root access and fail. Fix it to check for root uid and exit with skip code instead.
Before this fix:
selftests: firmware: fw_run_tests.sh
modprobe: ERROR: could not insert 'test_firmware': Operation not permitted You must have the following enabled in your kernel:CONFIG_TEST_FIRMWARE=yCONFIG_FW_LOADER=yCONFIG_FW_LOADER_USER_HELPER=yCONFIG_IKCONFIG=yCONFIG_IKCONFIG_PROC=y
not ok 1 selftests: firmware: fw_run_tests.sh # SKIP
With this fix:
selftests: firmware: fw_run_tests.sh
skip all tests: must be run as root
not ok 1 selftests: firmware: fw_run_tests.sh # SKIP
--- tools/testing/selftests/firmware/fw_lib.sh | 6 ++++++ 1 file changed, 6 insertions(+)
tools/testing/selftests/firmware/fw_lib.sh +6 -0
@@ -34,6 +34,12 @@ test_modprobe() check_mods() { + local uid=$(id -u) + if [ $uid -ne 0 ]; then + echo "skip all tests: must be run as root" >&2 + exit $ksft_skip + fi + trap "test_modprobe" EXIT if [ ! -d $DIR ]; then modprobe test_firmware
Signature · 1 line
2.20.1
Greg Kroah-Hartman
maintainerPATCH 156/203 media: hantro: Do not reorder H264 scaling list
In reply to Greg Kroah-HartmanFrom: Jonas Karlman <[email protected]>
commit e17f08e3166635d2eaa6a894afeb28ca651ddd35 upstream.
Scaling list supplied from userspace should be in matrix order and can be used without applying the inverse scanning process.
The HW also only support 8x8 scaling list for the Y component, indices 0 and 1 in the scaling list supplied from userspace.
Remove reordering and write the scaling matrix in an order expected by the VPU, also only allocate memory for the two 8x8 lists supported.
--- drivers/staging/media/hantro/hantro_h264.c | 51 ++++++----------------------- 1 file changed, 12 insertions(+), 39 deletions(-)
drivers/staging/media/hantro/hantro_h264.c +12 -39
@@ -20,7 +20,7 @@/* Size with u32 units. */ #define CABAC_INIT_BUFFER_SIZE (460 * 2)#define POC_BUFFER_SIZE 34 -#define SCALING_LIST_SIZE (6 * 16 + 6 * 64) +#define SCALING_LIST_SIZE (6 * 16 + 2 * 64)#define POC_CMP (p0, p1) ((p0) < (p1) ? -1 : 1)
@@ -194,23 +194,6 @@ static const u32 h264_cabac_table[] = { 0x1f0c2517, 0x1f261440 }; -/* -* NOTE: The scaling lists are in zig-zag order, apply inverse scanning process -* to get the values in matrix order. In addition, the hardware requires bytes -* swapped within each subsequent 4 bytes. Both arrays below include both -* transformations. -*/ -static const u32 zig_zag_4x4[] = { -3 ,2 ,7 ,11 ,6 ,1 ,0 ,5 ,10 ,15 ,14 ,9 ,4 ,8 ,13 ,12 -}; - -static const u32 zig_zag_8x8[] = { -3 ,2 ,11 ,19 ,10 ,1 ,0 ,9 ,18 ,27 ,35 ,26 ,17 ,8 ,7 ,6 , -15 ,16 ,25 ,34 ,43 ,51 ,42 ,33 ,24 ,23 ,14 ,5 ,4 ,13 ,22 ,31 , -32 ,41 ,50 ,59 ,58 ,49 ,40 ,39 ,30 ,21 ,12 ,20 ,29 ,38 ,47 ,48 , -57 ,56 ,55 ,46 ,37 ,28 ,36 ,45 ,54 ,63 ,62 ,53 ,44 ,52 ,61 ,60 -}; -static void reorder_scaling_list (struct hantro_ctx *ctx) {
@@ -218,33 +201,23 @@ reorder_scaling_list(struct hantro_ctx *const struct v4l2_ctrl_h264_scaling_matrix *scaling = ctrls->scaling;const size_t num_list_4x4 =ARRAY_SIZE (scaling->scaling_list_4x4);const size_t list_len_4x4 =ARRAY_SIZE (scaling->scaling_list_4x4[0 ]); -const size_t num_list_8x8 =ARRAY_SIZE (scaling->scaling_list_8x8);const size_t list_len_8x8 =ARRAY_SIZE (scaling->scaling_list_8x8[0 ]);struct hantro_h264_dec_priv_tbl *tbl = ctx->h264_dec.priv.cpu; -u8 *dst = tbl->scaling_list; -const u8 *src; +u32 *dst = (u32 *)tbl->scaling_list; +const u32 *src;int i, j; -BUILD_BUG_ON (ARRAY_SIZE (zig_zag_4x4) != list_len_4x4); -BUILD_BUG_ON (ARRAY_SIZE (zig_zag_8x8) != list_len_8x8); -BUILD_BUG_ON (ARRAY_SIZE (tbl->scaling_list) != - num_list_4x4 * list_len_4x4 + - num_list_8x8 * list_len_8x8); - - src = &scaling->scaling_list_4x4[0 ][0 ]; -for (i =0 ; i < num_list_4x4; ++i) { -for (j =0 ; j < list_len_4x4; ++j) - dst[zig_zag_4x4[j]] = src[j]; - src += list_len_4x4; - dst += list_len_4x4; +for (i =0 ; i < num_list_4x4; i++) { + src = (u32 *)&scaling->scaling_list_4x4[i]; +for (j =0 ; j < list_len_4x4 /4 ; j++) + *dst++ =swab32 (src[j]); } - src = &scaling->scaling_list_8x8[0 ][0 ]; -for (i =0 ; i < num_list_8x8; ++i) { -for (j =0 ; j < list_len_8x8; ++j) - dst[zig_zag_8x8[j]] = src[j]; - src += list_len_8x8; - dst += list_len_8x8; +/* Only Intra/Inter Y lists */ +for (i =0 ; i <2 ; i++) { + src = (u32 *)&scaling->scaling_list_8x8[i]; +for (j =0 ; j < list_len_8x8 /4 ; j++) + *dst++ =swab32 (src[j]); } }
Greg Kroah-Hartman
maintainerPATCH 165/203 spi: sprd: Fix the incorrect SPI register
In reply to Greg Kroah-HartmanFrom: Huanpeng Xin <[email protected]>
commit 5e9c5236b7b86779b53b762f7e66240c3f18314b upstream.
The original code used an incorrect SPI register to initialize the SPI controller in sprd_spi_init_hw(), thus fix it.
--- drivers/spi/spi-sprd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/spi/spi-sprd.c +1 -1
@@ -674,7 +674,7 @@ static void sprd_spi_init_hw(struct sprdu16 word_delay, interval;u32 val; - val =readl_relaxed (ss->base +SPRD_SPI_CTL7 ); + val =readl_relaxed (ss->base +SPRD_SPI_CTL0 ); val &= ~(SPRD_SPI_SCK_REV |SPRD_SPI_NG_TX |SPRD_SPI_NG_RX );/* Set default chip selection, clock phase and clock polarity */ val |= ss->hw_mode &SPI_CPHA ?SPRD_SPI_NG_RX :SPRD_SPI_NG_TX ;
Greg Kroah-Hartman
maintainerPATCH 164/203 ubifs: do_kill_orphans: Fix a memory leak bug
In reply to Greg Kroah-HartmanFrom: Zhihao Cheng <[email protected]>
commit 10256f000932f12596dc043cf880ecf488a32510 upstream.
If there are more than one valid snod on the sleb->nodes list, do_kill_orphans will malloc ino more than once without releasing previous ino's memory. Finally, it will trigger memory leak.
--- fs/ubifs/orphan.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-)
fs/ubifs/orphan.c +10 -7
@@ -631,12 +631,17 @@ static int do_kill_orphans(struct ubifs_ino_t inum;int i, n, err, first =1 ; + ino =kmalloc (UBIFS_MAX_INO_NODE_SZ ,GFP_NOFS ); +if (!ino) +return -ENOMEM ; +list_for_each_entry (snod, &sleb->nodes, list) {if (snod->type !=UBIFS_ORPH_NODE ) {ubifs_err (c,"invalid node type %d in orphan area at %d:%d" , snod->type, sleb->lnum, snod->offs);ubifs_dump_node (c, snod->node); -return -EINVAL ; + err = -EINVAL ; + goto out_free; } orph = snod->node;
@@ -663,20 +668,18 @@ static int do_kill_orphans(struct ubifs_ubifs_err (c,"out of order commit number %llu in orphan node at %d:%d" , cmt_no, sleb->lnum, snod->offs);ubifs_dump_node (c, snod->node); -return -EINVAL ; + err = -EINVAL ; + goto out_free; }dbg_rcvry ("out of date LEB %d" , sleb->lnum); *outofdate =1 ; -return 0 ; + err =0 ; + goto out_free; }if (first) first =0 ; - ino =kmalloc (UBIFS_MAX_INO_NODE_SZ ,GFP_NOFS ); -if (!ino) -return -ENOMEM ; - n = (le32_to_cpu (orph->ch.len) -UBIFS_ORPH_NODE_SZ ) >>3 ;for (i =0 ; i < n; i++) {union ubifs_key key1, key2;
Greg Kroah-Hartman
maintainerPATCH 159/203 iommu/mediatek: Correct the flush_iotlb_all callback
In reply to Greg Kroah-HartmanFrom: Yong Wu <[email protected]>
commit 2009122f1d83dd8375572661961eab1e7e86bffe upstream.
Use the correct tlb_flush_all instead of the original one.
--- drivers/iommu/mtk_iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/iommu/mtk_iommu.c +1 -1
@@ -447,7 +447,7 @@ static size_t mtk_iommu_unmap(struct iomstatic void mtk_iommu_flush_iotlb_all (struct iommu_domain *domain) { -mtk_iommu_tlb_sync (mtk_iommu_get_m4u_data ()); +mtk_iommu_tlb_flush_all (mtk_iommu_get_m4u_data ()); } static void mtk_iommu_iotlb_sync(struct iommu_domain *domain,
Greg Kroah-Hartman
maintainerPATCH 173/203 rtlwifi: Remove unnecessary NULL check in rtl_regd_init
In reply to Greg Kroah-HartmanFrom: Nathan Chancellor <[email protected]>
commit 091c6e9c083f7ebaff00b37ad13562d51464d175 upstream.
When building with Clang + -Wtautological-pointer-compare:
drivers/net/wireless/realtek/rtlwifi/regd.c:389:33: warning: comparison of address of 'rtlpriv->regd' equal to a null pointer is always false [-Wtautological-pointer-compare]
if (wiphy == NULL || &rtlpriv->regd == NULL)
~~~~~~~~~^~~~ ~~~~1 warning generated.
The address of an array member is never NULL unless it is the first struct member so remove the unnecessary check. This was addressed in the staging version of the driver in commit f986978b32b3 ("Staging:
rtlwifi: remove unnecessary NULL check").
While we are here, fix the following checkpatch warning:
CHECK: Comparison to NULL could be written "!wiphy" 35: FILE: drivers/net/wireless/realtek/rtlwifi/regd.c:389:
+ if (wiphy == NULL)
--- drivers/net/wireless/realtek/rtlwifi/regd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/wireless/realtek/rtlwifi/regd.c +1 -1
@@ -386,7 +386,7 @@ int rtl_regd_init(struct ieee80211_hw *hstruct wiphy *wiphy = hw->wiphy;struct country_code_to_enum_rd *country =NULL ; -if (wiphy ==NULL || &rtlpriv->regd ==NULL ) +if (!wiphy)return -EINVAL ;/* init country_code from efuse channel plan */
Greg Kroah-Hartman
maintainerPATCH 145/203 ARM: 8943/1: Fix topology setup in case of CPU hotplug for CONFIG_SCHED_MC
In reply to Greg Kroah-HartmanFrom: Dietmar Eggemann <[email protected]>
commit ff98a5f624d2910de050f1fc7f2a32769da86b51 upstream.
Commit ca74b316df96 ("arm: Use common cpu_topology structure and functions.") changed cpu_coregroup_mask() from the ARM32 specific implementation in arch/arm/include/asm/topology.h to the one shared with ARM64 and RISCV in drivers/base/arch_topology.c.
Currently on ARM32 (TC2 w/ CONFIG_SCHED_MC) the task scheduler setup code (w/ CONFIG_SCHED_DEBUG) shows this during CPU hotplug:
ERROR: groups don't span domain->span
It happens to CPUs of the cluster of the CPU which gets hot-plugged out on scheduler domain MC.
Turns out that the shared cpu_coregroup_mask() requires that the hot-plugged CPU is removed from the core_sibling mask via remove_cpu_topology(). Otherwise the 'is core_sibling subset of cpumask_of_node()' doesn't work. In this case the task scheduler has to deal with cpumask_of_node instead of core_sibling which is wrong on scheduler domain MC.
e.g. CPU3 hot-plugged out on TC2 [cluster0: 0,3-4 cluster1: 1-2]:
cpu_coregroup_mask(): CPU3 cpumask_of_node=0-2,4 core_sibling=0,3-4
^
should be:
cpu_coregroup_mask(): CPU3 cpumask_of_node=0-2,4 core_sibling=0,4
Add remove_cpu_topology() to __cpu_disable() to remove the CPU from the topology masks in case of a CPU hotplug out operation.
At the same time tweak store_cpu_topology() slightly so it will call update_siblings_masks() in case of CPU hotplug in operation via secondary_start_kernel()->smp_store_cpu_info().
This aligns the ARM32 implementation with the ARM64 one.
Guarding remove_cpu_topology() with CONFIG_GENERIC_ARCH_TOPOLOGY is necessary since some Arm32 defconfigs (aspeed_g5_defconfig, milbeaut_m10v_defconfig, spear13xx_defconfig) specify an explicit
# CONFIG_ARM_CPU_TOPOLOGY is not set
w/ ./arch/arm/Kconfig: select GENERIC_ARCH_TOPOLOGY if ARM_CPU_TOPOLOGY
--- arch/arm/kernel/smp.c | 4 ++++ arch/arm/kernel/topology.c | 10 +++++----- 2 files changed, 9 insertions(+), 5 deletions(-)
arch/arm/kernel/smp.c +4 -0
@@ -240,6 +240,10 @@ int __cpu_disable(void)if (ret)return ret; +#ifdef CONFIG_GENERIC_ARCH_TOPOLOGY +remove_cpu_topology (cpu); +#endif +/* * Take this CPU offline. Once we clear this, we can't return, * and we must not schedule until we're ready to give up the cpu.
arch/arm/kernel/topology.c +5 -5
@@ -196,9 +196,8 @@ void store_cpu_topology(unsigned int cpustruct cpu_topology *cpuid_topo = &cpu_topology[cpuid];unsigned int mpidr; -/* If the cpu topology has been already set, just return */ -if (cpuid_topo->core_id !=-1 ) -return ; +if (cpuid_topo->package_id !=-1 ) + goto topology_populated; mpidr =read_cpuid_mpidr ();
@@ -231,14 +230,15 @@ void store_cpu_topology(unsigned int cpu cpuid_topo->package_id =-1 ; } -update_siblings_masks (cpuid); -update_cpu_capacity (cpuid);pr_info ("CPU%u: thread %d, cpu %d, socket %d, mpidr %x\n" , cpuid, cpu_topology[cpuid].thread_id, cpu_topology[cpuid].core_id, cpu_topology[cpuid].package_id, mpidr); + +topology_populated: +update_siblings_masks (cpuid); }static inline int cpu_corepower_flags (void )
Greg Kroah-Hartman
maintainerPATCH 169/203 spi: atmel: fix handling of cs_change set on non-last xfer
In reply to Greg Kroah-HartmanFrom: Mans Rullgard <[email protected]>
commit fed8d8c7a6dc2a76d7764842853d81c770b0788e upstream.
The driver does the wrong thing when cs_change is set on a non-last xfer in a message. When cs_change is set, the driver deactivates the CS and leaves it off until a later xfer again has cs_change set whereas it should be briefly toggling CS off and on again.
This patch brings the behaviour of the driver back in line with the documentation and common sense. The delay of 10 us is the same as is used by the default spi_transfer_one_message() function in spi.c.
--- drivers/spi/spi-atmel.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-)
drivers/spi/spi-atmel.c +3 -7
@@ -302,7 +302,6 @@ struct atmel_spi {bool use_cs_gpios;bool keep_cs; -bool cs_active;u32 fifo_size; };
@@ -1374,11 +1373,9 @@ static int atmel_spi_one_transfer(struct &msg->transfers)) { as->keep_cs = true; }else { - as->cs_active = !as->cs_active; -if (as->cs_active) -cs_activate (as, msg->spi); -else -cs_deactivate (as, msg->spi); +cs_deactivate (as, msg->spi); +udelay (10 ); +cs_activate (as, msg->spi); } }
@@ -1401,7 +1398,6 @@ static int atmel_spi_transfer_one_messagatmel_spi_lock (as);cs_activate (as, spi); - as->cs_active = true; as->keep_cs = false; msg->status =0 ;
Greg Kroah-Hartman
maintainerPATCH 167/203 mtd: spi-nor: fix silent truncation in spi_nor_read_raw()
In reply to Greg Kroah-HartmanFrom: Sergei Shtylyov <[email protected]>
commit 3d63ee5deb466fd66ed6ffb164a87ce36425cf36 upstream.
spi_nor_read_raw() assigns the result of 'ssize_t spi_nor_read_data()' to the 'int ret' variable, while 'ssize_t' is a 64-bit type and *int* is a 32-bit type on the 64-bit machines. This silent truncation isn't really valid, so fix up the variable's type.
--- drivers/mtd/spi-nor/spi-nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/spi-nor/spi-nor.c +1 -1
@@ -2865,7 +2865,7 @@ static int spi_nor_hwcaps_pp2cmd(u32 hwc*/ static int spi_nor_read_raw (struct spi_nor *nor,u32 addr,size_t len,u8 *buf) { -int ret; +ssize_t ret;while (len) { ret =spi_nor_read_data (nor, addr, len, buf);
Greg Kroah-Hartman
maintainerPATCH 144/203 tty: serial: pch_uart: correct usage of dma_unmap_sg
In reply to Greg Kroah-HartmanFrom: Peng Fan <[email protected]>
commit 74887542fdcc92ad06a48c0cca17cdf09fc8aa00 upstream.
Per Documentation/DMA-API-HOWTO.txt,
To unmap a scatterlist, just call:
dma_unmap_sg(dev, sglist, nents, direction);
.. note::
The 'nents' argument to the dma_unmap_sg call must be the _same_ one you passed into the dma_map_sg call, it should _NOT_ be the 'count' value _returned_ from the dma_map_sg call.
However in the driver, priv->nent is directly assigned with value returned from dma_map_sg, and dma_unmap_sg use priv->nent for unmap, this breaks the API usage.
So introduce a new entry orig_nent to remember 'nents'.
--- drivers/tty/serial/pch_uart.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/tty/serial/pch_uart.c +4 -1
@@ -233,6 +233,7 @@ struct eg20t_port {struct dma_chan *chan_rx;struct scatterlist *sg_tx_p;int nent; +int orig_nent;struct scatterlist sg_rx;int tx_dma_use;void *rx_buf_virt;
@@ -787,9 +788,10 @@ static void pch_dma_tx_complete(void *ar } xmit->tail &=UART_XMIT_SIZE -1 ;async_tx_ack (priv->desc_tx); -dma_unmap_sg (port->dev, sg, priv->nent,DMA_TO_DEVICE ); +dma_unmap_sg (port->dev, sg, priv->orig_nent,DMA_TO_DEVICE ); priv->tx_dma_use =0 ; priv->nent =0 ; + priv->orig_nent =0 ;kfree (priv->sg_tx_p);pch_uart_hal_enable_interrupt (priv,PCH_UART_HAL_TX_INT ); }
@@ -1010,6 +1012,7 @@ static unsigned int dma_handle_tx(structdev_err (priv->port.dev,"%s:dma_map_sg Failed\n" , __func__);return 0 ; } + priv->orig_nent = num; priv->nent = nent;for (i =0 ; i < nent; i++, sg++) {
Greg Kroah-Hartman
maintainerPATCH 151/203 media: hantro: h264: Fix the frame_num wraparound case
In reply to Greg Kroah-HartmanFrom: Boris Brezillon <[email protected]>
commit 9db5f87f6723678a7e7e5e3165439c5c4378edbb upstream.
Step '8.2.4.1 Decoding process for picture numbers' was missing in the reflist creation logic, leading to invalid P reflists when a ->frame_num wraparound happens.
--- drivers/staging/media/hantro/hantro_h264.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-)
drivers/staging/media/hantro/hantro_h264.c +21 -1
@@ -271,6 +271,7 @@ struct hantro_h264_reflist_builder {const struct v4l2_h264_dpb_entry *dpb;s32 pocs[HANTRO_H264_DPB_SIZE ];u8 unordered_reflist[HANTRO_H264_DPB_SIZE ]; +int frame_nums[HANTRO_H264_DPB_SIZE ];s32 curpoc;u8 num_valid; };
@@ -294,13 +295,20 @@ static void init_reflist_builder(struct hantro_ctx *ctx, struct hantro_h264_reflist_builder *b) { + const struct v4l2_ctrl_h264_slice_params *slice_params;const struct v4l2_ctrl_h264_decode_params *dec_param; +const struct v4l2_ctrl_h264_sps *sps;struct vb2_v4l2_buffer *buf =hantro_get_dst_buf (ctx);const struct v4l2_h264_dpb_entry *dpb = ctx->h264_dec.dpb;struct vb2_queue *cap_q = &ctx->fh.m2m_ctx->cap_q_ctx.q; +int cur_frame_num, max_frame_num;unsigned int i; dec_param = ctx->h264_dec.ctrls.decode; + slice_params = &ctx->h264_dec.ctrls.slices[0 ]; + sps = ctx->h264_dec.ctrls.sps; + max_frame_num =1 << (sps->log2_max_frame_num_minus4 +4 ); + cur_frame_num = slice_params->frame_num;memset (b,0 ,sizeof (*b)); b->dpb = dpb;
@@ -318,6 +326,18 @@ init_reflist_builder(struct hantro_ctx *continue ; buf =to_vb2_v4l2_buffer (vb2_get_buffer (cap_q, buf_idx)); + +/* +* Handle frame_num wraparound as described in section +* '8.2.4.1 Decoding process for picture numbers' of the spec. +* TODO: This logic will have to be adjusted when we start +* supporting interlaced content. +*/ +if (dpb[i].frame_num > cur_frame_num) + b->frame_nums[i] = (int )dpb[i].frame_num - max_frame_num; +else + b->frame_nums[i] = dpb[i].frame_num; + b->pocs[i] =get_poc (buf->field, dpb[i].top_field_order_cnt, dpb[i].bottom_field_order_cnt); b->unordered_reflist[b->num_valid] = i;
@@ -353,7 +373,7 @@ static int p_ref_list_cmp(const void *pt* ascending order. */ if (!(a->flags &V4L2_H264_DPB_ENTRY_FLAG_LONG_TERM )) -return b->frame_num - a->frame_num; +return builder->frame_nums[idxb] - builder->frame_nums[idxa];return a->pic_num - b->pic_num; }
Greg Kroah-Hartman
maintainerPATCH 128/203 arm64: dts: apq8096-db820c: Increase load on l21 for SDCARD
In reply to Greg Kroah-HartmanFrom: Loic Poulain <[email protected]>
commit e38161bd325ea541ef2f258d8e28281077dde524 upstream.
In the same way as for msm8974-hammerhead, l21 load, used for SDCARD VMMC, needs to be increased in order to prevent any voltage drop issues (due to limited current) happening with some SDCARDS or during specific operations (e.g. write).
--- arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi | 2 ++ 1 file changed, 2 insertions(+)
arch/arm64/boot/dts/qcom/apq8096-db820c.dtsi +2 -0
@@ -623,6 +623,8 @@ l21 { regulator-min-microvolt = <2950000>; regulator-max-microvolt = <2950000>; + regulator-allow-set-load; + regulator-system-load = <200000>; }; l22 { regulator-min-microvolt = <3300000>;
Greg Kroah-Hartman
maintainerPATCH 123/203 PCI: pciehp: Do not disable interrupt twice on suspend
In reply to Greg Kroah-HartmanFrom: Mika Westerberg <[email protected]>
commit 75fcc0ce72e5cea2e357cdde858216c5bad40442 upstream.
We try to keep PCIe hotplug ports runtime suspended when entering system suspend. Because the PCIe portdrv sets the DPM_FLAG_NEVER_SKIP flag, the PM core always calls system suspend/resume hooks even if the device is left runtime suspended. Since PCIe hotplug driver re-used the same function for both runtime suspend and system suspend, it ended up disabling hotplug interrupt twice and the second time following was printed:
pciehp 0000:03:01.0:pcie204: pcie_do_write_cmd: no response from device
Prevent this from happening by checking whether the device is already runtime suspended when the system suspend hook is called.
--- drivers/pci/hotplug/pciehp_core.c | 25 +++++++++++++++++++++++-- 1 file changed, 23 insertions(+), 2 deletions(-)
drivers/pci/hotplug/pciehp_core.c +23 -2
@@ -253,7 +253,7 @@ static bool pme_is_native(struct pcie_dereturn pcie_ports_native || host->native_pme; } -static int pciehp_suspend (struct pcie_device *dev) +static void pciehp_disable_interrupt (struct pcie_device *dev) {/* * Disable hotplug interrupt so that it does not trigger
@@ -261,7 +261,19 @@ static int pciehp_suspend(struct pcie_de*/ if (pme_is_native (dev))pcie_disable_interrupt (get_service_data (dev)); +} +#ifdef CONFIG_PM_SLEEP +static int pciehp_suspend (struct pcie_device *dev) +{ +/* +* If the port is already runtime suspended we can keep it that +* way. +*/ +if (dev_pm_smart_suspend_and_suspended (&dev->port->dev)) +return 0 ; + +pciehp_disable_interrupt (dev);return 0 ; }
@@ -279,6 +291,7 @@ static int pciehp_resume_noirq(struct pc return 0; } +#endif static int pciehp_resume (struct pcie_device *dev) {
@@ -292,6 +305,12 @@ static int pciehp_resume(struct pcie_devreturn 0 ; } +static int pciehp_runtime_suspend (struct pcie_device *dev) +{ +pciehp_disable_interrupt (dev); +return 0 ; +} +static int pciehp_runtime_resume (struct pcie_device *dev) {struct controller *ctrl =get_service_data (dev);
@@ -318,10 +337,12 @@ static struct pcie_port_service_driver h .remove = pciehp_remove,#ifdef CONFIG_PM +#ifdef CONFIG_PM_SLEEP .suspend = pciehp_suspend, .resume_noirq = pciehp_resume_noirq, .resume = pciehp_resume, - .runtime_suspend = pciehp_suspend, +#endif + .runtime_suspend = pciehp_runtime_suspend, .runtime_resume = pciehp_runtime_resume, #endif /* PM */ };
Greg Kroah-Hartman
maintainerPATCH 136/203 PCI/PM: Clear PCIe PME Status even for legacy power management
In reply to Greg Kroah-HartmanFrom: Bjorn Helgaas <[email protected]>
commit ec6a75ef8e33fe33f963b916fd902c52a0be33ff upstream.
Previously, pci_pm_resume_noirq() cleared the PME Status bit in the Root Status register only if the device had no driver or the driver did not implement legacy power management. It should clear PME Status regardless of what sort of power management the driver supports, so do this before checking for legacy power management.
This affects Root Ports and Root Complex Event Collectors, for which the usual driver is the PCIe portdrv, which implements new power management, so this change is just on principle, not to fix any actual defects.
--- drivers/pci/pci-driver.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/pci/pci-driver.c +1 -2
@@ -941,12 +941,11 @@ static int pci_pm_resume_noirq(struct depci_pm_default_resume_early (pci_dev);pci_fixup_device (pci_fixup_resume_early, pci_dev); +pcie_pme_root_status_cleanup (pci_dev);if (pci_has_legacy_pm_support (pci_dev))return pci_legacy_resume_early (dev); -pcie_pme_root_status_cleanup (pci_dev); -if (drv && drv->pm && drv->pm->resume_noirq) error = drv->pm->resume_noirq (dev);
Greg Kroah-Hartman
maintainerPATCH 121/203 pinctrl: sh-pfc: Do not use platform_get_irq() to count interrupts
In reply to Greg Kroah-HartmanFrom: Geert Uytterhoeven <[email protected]>
commit ad7fe1a1a35994a201497443b5140bf54b074cca upstream.
As platform_get_irq() now prints an error when the interrupt does not exist, counting interrupts by looping until failure causes the printing of scary messages like:
sh-pfc e6060000.pin-controller: IRQ index 0 not found
Fix this by using the platform_irq_count() helper instead.
--- drivers/pinctrl/sh-pfc/core.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-)
drivers/pinctrl/sh-pfc/core.c +6 -10
@@ -29,12 +29,12 @@static int sh_pfc_map_resources (struct sh_pfc *pfc,struct platform_device *pdev) { -unsigned int num_windows, num_irqs;struct sh_pfc_window *windows;unsigned int *irqs =NULL ; +unsigned int num_windows;struct resource *res;unsigned int i; -int irq; +int num_irqs;/* Count the MEM and IRQ resources. */ for (num_windows =0 ;; num_windows++) {
@@ -42,17 +42,13 @@ static int sh_pfc_map_resources(struct sif (!res)break ; } -for (num_irqs =0 ;; num_irqs++) { - irq =platform_get_irq (pdev, num_irqs); -if (irq == -EPROBE_DEFER ) -return irq; -if (irq <0 ) -break ; - } -if (num_windows ==0 )return -EINVAL ; + num_irqs =platform_irq_count (pdev); +if (num_irqs <0 ) +return num_irqs; +/* Allocate memory windows and IRQs arrays. */ windows =devm_kcalloc (pfc->dev, num_windows,sizeof (*windows),GFP_KERNEL );