Skip to content

Commit e3572df

Browse files
committed
Merge tag 'char-misc-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc driver fixes from Greg KH: "Here are some small char/misc driver fixes for 5.15-rc6 for reported issues that include: - habanalabs driver fixes - mei driver fixes and new ids - fpga new device ids - MAINTAINER file updates for fpga subsystem - spi module id table additions and fixes - fastrpc locking fixes - nvmem driver fix All of these have been in linux-next for a while with no reported issues" * tag 'char-misc-5.15-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: eeprom: 93xx46: fix MODULE_DEVICE_TABLE nvmem: Fix shift-out-of-bound (UBSAN) with byte size cells mei: hbm: drop hbm responses on early shutdown mei: me: add Ice Lake-N device id. eeprom: 93xx46: Add SPI device ID table eeprom: at25: Add SPI ID table misc: HI6421V600_IRQ should depend on HAS_IOMEM misc: fastrpc: Add missing lock before accessing find_vma() cb710: avoid NULL pointer subtraction misc: gehc: Add SPI ID table MAINTAINERS: Drop outdated FPGA Manager website MAINTAINERS: Add Hao and Yilun as maintainers habanalabs: fix resetting args in wait for CS IOCTL fpga: ice40-spi: Add SPI device ID table
2 parents a563ae0 + f427527 commit e3572df

14 files changed

Lines changed: 73 additions & 25 deletions

File tree

MAINTAINERS

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7343,10 +7343,11 @@ F: include/uapi/linux/fpga-dfl.h
73437343

73447344
FPGA MANAGER FRAMEWORK
73457345
M: Moritz Fischer <mdf@kernel.org>
7346+
M: Wu Hao <hao.wu@intel.com>
7347+
M: Xu Yilun <yilun.xu@intel.com>
73467348
R: Tom Rix <trix@redhat.com>
73477349
L: linux-fpga@vger.kernel.org
73487350
S: Maintained
7349-
W: http://www.rocketboards.org
73507351
Q: http://patchwork.kernel.org/project/linux-fpga/list/
73517352
T: git git://git.kernel.org/pub/scm/linux/kernel/git/mdf/linux-fpga.git
73527353
F: Documentation/devicetree/bindings/fpga/

drivers/fpga/ice40-spi.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -192,12 +192,19 @@ static const struct of_device_id ice40_fpga_of_match[] = {
192192
};
193193
MODULE_DEVICE_TABLE(of, ice40_fpga_of_match);
194194

195+
static const struct spi_device_id ice40_fpga_spi_ids[] = {
196+
{ .name = "ice40-fpga-mgr", },
197+
{},
198+
};
199+
MODULE_DEVICE_TABLE(spi, ice40_fpga_spi_ids);
200+
195201
static struct spi_driver ice40_fpga_driver = {
196202
.probe = ice40_fpga_probe,
197203
.driver = {
198204
.name = "ice40spi",
199205
.of_match_table = of_match_ptr(ice40_fpga_of_match),
200206
},
207+
.id_table = ice40_fpga_spi_ids,
201208
};
202209

203210
module_spi_driver(ice40_fpga_driver);

drivers/misc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -224,6 +224,7 @@ config HI6421V600_IRQ
224224
tristate "HiSilicon Hi6421v600 IRQ and powerkey"
225225
depends on OF
226226
depends on SPMI
227+
depends on HAS_IOMEM
227228
select MFD_CORE
228229
select REGMAP_SPMI
229230
help

drivers/misc/cb710/sgbuf2.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ static inline bool needs_unaligned_copy(const void *ptr)
4747
#ifdef CONFIG_HAVE_EFFICIENT_UNALIGNED_ACCESS
4848
return false;
4949
#else
50-
return ((ptr - NULL) & 3) != 0;
50+
return ((uintptr_t)ptr & 3) != 0;
5151
#endif
5252
}
5353

drivers/misc/eeprom/at25.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -366,6 +366,13 @@ static const struct of_device_id at25_of_match[] = {
366366
};
367367
MODULE_DEVICE_TABLE(of, at25_of_match);
368368

369+
static const struct spi_device_id at25_spi_ids[] = {
370+
{ .name = "at25",},
371+
{ .name = "fm25",},
372+
{ }
373+
};
374+
MODULE_DEVICE_TABLE(spi, at25_spi_ids);
375+
369376
static int at25_probe(struct spi_device *spi)
370377
{
371378
struct at25_data *at25 = NULL;
@@ -491,6 +498,7 @@ static struct spi_driver at25_driver = {
491498
.dev_groups = sernum_groups,
492499
},
493500
.probe = at25_probe,
501+
.id_table = at25_spi_ids,
494502
};
495503

496504
module_spi_driver(at25_driver);

drivers/misc/eeprom/eeprom_93xx46.c

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -406,6 +406,23 @@ static const struct of_device_id eeprom_93xx46_of_table[] = {
406406
};
407407
MODULE_DEVICE_TABLE(of, eeprom_93xx46_of_table);
408408

409+
static const struct spi_device_id eeprom_93xx46_spi_ids[] = {
410+
{ .name = "eeprom-93xx46",
411+
.driver_data = (kernel_ulong_t)&at93c46_data, },
412+
{ .name = "at93c46",
413+
.driver_data = (kernel_ulong_t)&at93c46_data, },
414+
{ .name = "at93c46d",
415+
.driver_data = (kernel_ulong_t)&atmel_at93c46d_data, },
416+
{ .name = "at93c56",
417+
.driver_data = (kernel_ulong_t)&at93c56_data, },
418+
{ .name = "at93c66",
419+
.driver_data = (kernel_ulong_t)&at93c66_data, },
420+
{ .name = "93lc46b",
421+
.driver_data = (kernel_ulong_t)&microchip_93lc46b_data, },
422+
{}
423+
};
424+
MODULE_DEVICE_TABLE(spi, eeprom_93xx46_spi_ids);
425+
409426
static int eeprom_93xx46_probe_dt(struct spi_device *spi)
410427
{
411428
const struct of_device_id *of_id =
@@ -555,6 +572,7 @@ static struct spi_driver eeprom_93xx46_driver = {
555572
},
556573
.probe = eeprom_93xx46_probe,
557574
.remove = eeprom_93xx46_remove,
575+
.id_table = eeprom_93xx46_spi_ids,
558576
};
559577

560578
module_spi_driver(eeprom_93xx46_driver);

drivers/misc/fastrpc.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -814,10 +814,12 @@ static int fastrpc_get_args(u32 kernel, struct fastrpc_invoke_ctx *ctx)
814814
rpra[i].pv = (u64) ctx->args[i].ptr;
815815
pages[i].addr = ctx->maps[i]->phys;
816816

817+
mmap_read_lock(current->mm);
817818
vma = find_vma(current->mm, ctx->args[i].ptr);
818819
if (vma)
819820
pages[i].addr += ctx->args[i].ptr -
820821
vma->vm_start;
822+
mmap_read_unlock(current->mm);
821823

822824
pg_start = (ctx->args[i].ptr & PAGE_MASK) >> PAGE_SHIFT;
823825
pg_end = ((ctx->args[i].ptr + len - 1) & PAGE_MASK) >>

drivers/misc/gehc-achc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -539,6 +539,7 @@ static int gehc_achc_probe(struct spi_device *spi)
539539

540540
static const struct spi_device_id gehc_achc_id[] = {
541541
{ "ge,achc", 0 },
542+
{ "achc", 0 },
542543
{ }
543544
};
544545
MODULE_DEVICE_TABLE(spi, gehc_achc_id);

drivers/misc/habanalabs/common/command_submission.c

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,11 +2649,18 @@ static int hl_multi_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data)
26492649
free_seq_arr:
26502650
kfree(cs_seq_arr);
26512651

2652-
/* update output args */
2653-
memset(args, 0, sizeof(*args));
26542652
if (rc)
26552653
return rc;
26562654

2655+
if (mcs_data.wait_status == -ERESTARTSYS) {
2656+
dev_err_ratelimited(hdev->dev,
2657+
"user process got signal while waiting for Multi-CS\n");
2658+
return -EINTR;
2659+
}
2660+
2661+
/* update output args */
2662+
memset(args, 0, sizeof(*args));
2663+
26572664
if (mcs_data.completion_bitmap) {
26582665
args->out.status = HL_WAIT_CS_STATUS_COMPLETED;
26592666
args->out.cs_completion_map = mcs_data.completion_bitmap;
@@ -2667,8 +2674,6 @@ static int hl_multi_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data)
26672674
/* update if some CS was gone */
26682675
if (mcs_data.timestamp)
26692676
args->out.flags |= HL_WAIT_CS_STATUS_FLAG_GONE;
2670-
} else if (mcs_data.wait_status == -ERESTARTSYS) {
2671-
args->out.status = HL_WAIT_CS_STATUS_INTERRUPTED;
26722677
} else {
26732678
args->out.status = HL_WAIT_CS_STATUS_BUSY;
26742679
}
@@ -2688,16 +2693,17 @@ static int hl_cs_wait_ioctl(struct hl_fpriv *hpriv, void *data)
26882693
rc = _hl_cs_wait_ioctl(hdev, hpriv->ctx, args->in.timeout_us, seq,
26892694
&status, &timestamp);
26902695

2696+
if (rc == -ERESTARTSYS) {
2697+
dev_err_ratelimited(hdev->dev,
2698+
"user process got signal while waiting for CS handle %llu\n",
2699+
seq);
2700+
return -EINTR;
2701+
}
2702+
26912703
memset(args, 0, sizeof(*args));
26922704

26932705
if (rc) {
2694-
if (rc == -ERESTARTSYS) {
2695-
dev_err_ratelimited(hdev->dev,
2696-
"user process got signal while waiting for CS handle %llu\n",
2697-
seq);
2698-
args->out.status = HL_WAIT_CS_STATUS_INTERRUPTED;
2699-
rc = -EINTR;
2700-
} else if (rc == -ETIMEDOUT) {
2706+
if (rc == -ETIMEDOUT) {
27012707
dev_err_ratelimited(hdev->dev,
27022708
"CS %llu has timed-out while user process is waiting for it\n",
27032709
seq);
@@ -2823,7 +2829,6 @@ static int _hl_interrupt_wait_ioctl(struct hl_device *hdev, struct hl_ctx *ctx,
28232829
dev_err_ratelimited(hdev->dev,
28242830
"user process got signal while waiting for interrupt ID %d\n",
28252831
interrupt->interrupt_id);
2826-
*status = HL_WAIT_CS_STATUS_INTERRUPTED;
28272832
rc = -EINTR;
28282833
} else {
28292834
*status = CS_WAIT_STATUS_BUSY;
@@ -2878,8 +2883,6 @@ static int hl_interrupt_wait_ioctl(struct hl_fpriv *hpriv, void *data)
28782883
args->in.interrupt_timeout_us, args->in.addr,
28792884
args->in.target, interrupt_offset, &status);
28802885

2881-
memset(args, 0, sizeof(*args));
2882-
28832886
if (rc) {
28842887
if (rc != -EINTR)
28852888
dev_err_ratelimited(hdev->dev,
@@ -2888,6 +2891,8 @@ static int hl_interrupt_wait_ioctl(struct hl_fpriv *hpriv, void *data)
28882891
return rc;
28892892
}
28902893

2894+
memset(args, 0, sizeof(*args));
2895+
28912896
switch (status) {
28922897
case CS_WAIT_STATUS_COMPLETED:
28932898
args->out.status = HL_WAIT_CS_STATUS_COMPLETED;

drivers/misc/mei/hbm.c

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1298,7 +1298,8 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
12981298

12991299
if (dev->dev_state != MEI_DEV_INIT_CLIENTS ||
13001300
dev->hbm_state != MEI_HBM_STARTING) {
1301-
if (dev->dev_state == MEI_DEV_POWER_DOWN) {
1301+
if (dev->dev_state == MEI_DEV_POWER_DOWN ||
1302+
dev->dev_state == MEI_DEV_POWERING_DOWN) {
13021303
dev_dbg(dev->dev, "hbm: start: on shutdown, ignoring\n");
13031304
return 0;
13041305
}
@@ -1381,7 +1382,8 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
13811382

13821383
if (dev->dev_state != MEI_DEV_INIT_CLIENTS ||
13831384
dev->hbm_state != MEI_HBM_DR_SETUP) {
1384-
if (dev->dev_state == MEI_DEV_POWER_DOWN) {
1385+
if (dev->dev_state == MEI_DEV_POWER_DOWN ||
1386+
dev->dev_state == MEI_DEV_POWERING_DOWN) {
13851387
dev_dbg(dev->dev, "hbm: dma setup response: on shutdown, ignoring\n");
13861388
return 0;
13871389
}
@@ -1448,7 +1450,8 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
14481450

14491451
if (dev->dev_state != MEI_DEV_INIT_CLIENTS ||
14501452
dev->hbm_state != MEI_HBM_CLIENT_PROPERTIES) {
1451-
if (dev->dev_state == MEI_DEV_POWER_DOWN) {
1453+
if (dev->dev_state == MEI_DEV_POWER_DOWN ||
1454+
dev->dev_state == MEI_DEV_POWERING_DOWN) {
14521455
dev_dbg(dev->dev, "hbm: properties response: on shutdown, ignoring\n");
14531456
return 0;
14541457
}
@@ -1490,7 +1493,8 @@ int mei_hbm_dispatch(struct mei_device *dev, struct mei_msg_hdr *hdr)
14901493

14911494
if (dev->dev_state != MEI_DEV_INIT_CLIENTS ||
14921495
dev->hbm_state != MEI_HBM_ENUM_CLIENTS) {
1493-
if (dev->dev_state == MEI_DEV_POWER_DOWN) {
1496+
if (dev->dev_state == MEI_DEV_POWER_DOWN ||
1497+
dev->dev_state == MEI_DEV_POWERING_DOWN) {
14941498
dev_dbg(dev->dev, "hbm: enumeration response: on shutdown, ignoring\n");
14951499
return 0;
14961500
}

0 commit comments

Comments
 (0)