Skip to content

Commit 8072911

Browse files
committed
Merge tag 'char-misc-5.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc
Pull char/misc fixes from Greg KH: "Here are some small char/misc driver fixes for 5.14-rc3. Included in here are: - MAINTAINERS file updates for two changes in different driver subsystems - mhi bus bugfixes - nds32 bugfix that resolves a reported problem All have been in linux-next with no reported problems" * tag 'char-misc-5.14-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: nds32: fix up stack guard gap MAINTAINERS: Change ACRN HSM driver maintainer MAINTAINERS: Update for VMCI driver bus: mhi: pci_generic: Fix inbound IPCR channel bus: mhi: core: Validate channel ID when processing command completions bus: mhi: pci_generic: Apply no-op for wake using sideband wake boolean
2 parents 74738c5 + c453db6 commit 8072911

4 files changed

Lines changed: 58 additions & 16 deletions

File tree

MAINTAINERS

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ F: drivers/platform/x86/wmi.c
445445
F: include/uapi/linux/wmi.h
446446

447447
ACRN HYPERVISOR SERVICE MODULE
448-
M: Shuo Liu <shuo.a.liu@intel.com>
448+
M: Fei Li <fei1.li@intel.com>
449449
L: acrn-dev@lists.projectacrn.org (subscribers-only)
450450
S: Supported
451451
W: https://projectacrn.org
@@ -19801,6 +19801,14 @@ L: netdev@vger.kernel.org
1980119801
S: Supported
1980219802
F: drivers/ptp/ptp_vmw.c
1980319803

19804+
VMWARE VMCI DRIVER
19805+
M: Jorgen Hansen <jhansen@vmware.com>
19806+
M: Vishnu Dasa <vdasa@vmware.com>
19807+
L: linux-kernel@vger.kernel.org
19808+
L: pv-drivers@vmware.com (private)
19809+
S: Maintained
19810+
F: drivers/misc/vmw_vmci/
19811+
1980419812
VMWARE VMMOUSE SUBDRIVER
1980519813
M: "VMware Graphics" <linux-graphics-maintainer@vmware.com>
1980619814
M: "VMware, Inc." <pv-drivers@vmware.com>

arch/nds32/mm/mmap.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr,
5959

6060
vma = find_vma(mm, addr);
6161
if (TASK_SIZE - len >= addr &&
62-
(!vma || addr + len <= vma->vm_start))
62+
(!vma || addr + len <= vm_start_gap(vma)))
6363
return addr;
6464
}
6565

drivers/bus/mhi/core/main.c

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -773,11 +773,18 @@ static void mhi_process_cmd_completion(struct mhi_controller *mhi_cntrl,
773773
cmd_pkt = mhi_to_virtual(mhi_ring, ptr);
774774

775775
chan = MHI_TRE_GET_CMD_CHID(cmd_pkt);
776-
mhi_chan = &mhi_cntrl->mhi_chan[chan];
777-
write_lock_bh(&mhi_chan->lock);
778-
mhi_chan->ccs = MHI_TRE_GET_EV_CODE(tre);
779-
complete(&mhi_chan->completion);
780-
write_unlock_bh(&mhi_chan->lock);
776+
777+
if (chan < mhi_cntrl->max_chan &&
778+
mhi_cntrl->mhi_chan[chan].configured) {
779+
mhi_chan = &mhi_cntrl->mhi_chan[chan];
780+
write_lock_bh(&mhi_chan->lock);
781+
mhi_chan->ccs = MHI_TRE_GET_EV_CODE(tre);
782+
complete(&mhi_chan->completion);
783+
write_unlock_bh(&mhi_chan->lock);
784+
} else {
785+
dev_err(&mhi_cntrl->mhi_dev->dev,
786+
"Completion packet for invalid channel ID: %d\n", chan);
787+
}
781788

782789
mhi_del_ring_element(mhi_cntrl, mhi_ring);
783790
}

drivers/bus/mhi/pci_generic.c

Lines changed: 36 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@
3232
* @edl: emergency download mode firmware path (if any)
3333
* @bar_num: PCI base address register to use for MHI MMIO register space
3434
* @dma_data_width: DMA transfer word size (32 or 64 bits)
35+
* @sideband_wake: Devices using dedicated sideband GPIO for wakeup instead
36+
* of inband wake support (such as sdx24)
3537
*/
3638
struct mhi_pci_dev_info {
3739
const struct mhi_controller_config *config;
@@ -40,6 +42,7 @@ struct mhi_pci_dev_info {
4042
const char *edl;
4143
unsigned int bar_num;
4244
unsigned int dma_data_width;
45+
bool sideband_wake;
4346
};
4447

4548
#define MHI_CHANNEL_CONFIG_UL(ch_num, ch_name, el_count, ev_ring) \
@@ -72,6 +75,22 @@ struct mhi_pci_dev_info {
7275
.doorbell_mode_switch = false, \
7376
}
7477

78+
#define MHI_CHANNEL_CONFIG_DL_AUTOQUEUE(ch_num, ch_name, el_count, ev_ring) \
79+
{ \
80+
.num = ch_num, \
81+
.name = ch_name, \
82+
.num_elements = el_count, \
83+
.event_ring = ev_ring, \
84+
.dir = DMA_FROM_DEVICE, \
85+
.ee_mask = BIT(MHI_EE_AMSS), \
86+
.pollcfg = 0, \
87+
.doorbell = MHI_DB_BRST_DISABLE, \
88+
.lpm_notify = false, \
89+
.offload_channel = false, \
90+
.doorbell_mode_switch = false, \
91+
.auto_queue = true, \
92+
}
93+
7594
#define MHI_EVENT_CONFIG_CTRL(ev_ring, el_count) \
7695
{ \
7796
.num_elements = el_count, \
@@ -210,7 +229,7 @@ static const struct mhi_channel_config modem_qcom_v1_mhi_channels[] = {
210229
MHI_CHANNEL_CONFIG_UL(14, "QMI", 4, 0),
211230
MHI_CHANNEL_CONFIG_DL(15, "QMI", 4, 0),
212231
MHI_CHANNEL_CONFIG_UL(20, "IPCR", 8, 0),
213-
MHI_CHANNEL_CONFIG_DL(21, "IPCR", 8, 0),
232+
MHI_CHANNEL_CONFIG_DL_AUTOQUEUE(21, "IPCR", 8, 0),
214233
MHI_CHANNEL_CONFIG_UL_FP(34, "FIREHOSE", 32, 0),
215234
MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
216235
MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 128, 2),
@@ -242,7 +261,8 @@ static const struct mhi_pci_dev_info mhi_qcom_sdx65_info = {
242261
.edl = "qcom/sdx65m/edl.mbn",
243262
.config = &modem_qcom_v1_mhiv_config,
244263
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
245-
.dma_data_width = 32
264+
.dma_data_width = 32,
265+
.sideband_wake = false,
246266
};
247267

248268
static const struct mhi_pci_dev_info mhi_qcom_sdx55_info = {
@@ -251,15 +271,17 @@ static const struct mhi_pci_dev_info mhi_qcom_sdx55_info = {
251271
.edl = "qcom/sdx55m/edl.mbn",
252272
.config = &modem_qcom_v1_mhiv_config,
253273
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
254-
.dma_data_width = 32
274+
.dma_data_width = 32,
275+
.sideband_wake = false,
255276
};
256277

257278
static const struct mhi_pci_dev_info mhi_qcom_sdx24_info = {
258279
.name = "qcom-sdx24",
259280
.edl = "qcom/prog_firehose_sdx24.mbn",
260281
.config = &modem_qcom_v1_mhiv_config,
261282
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
262-
.dma_data_width = 32
283+
.dma_data_width = 32,
284+
.sideband_wake = true,
263285
};
264286

265287
static const struct mhi_channel_config mhi_quectel_em1xx_channels[] = {
@@ -301,7 +323,8 @@ static const struct mhi_pci_dev_info mhi_quectel_em1xx_info = {
301323
.edl = "qcom/prog_firehose_sdx24.mbn",
302324
.config = &modem_quectel_em1xx_config,
303325
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
304-
.dma_data_width = 32
326+
.dma_data_width = 32,
327+
.sideband_wake = true,
305328
};
306329

307330
static const struct mhi_channel_config mhi_foxconn_sdx55_channels[] = {
@@ -339,7 +362,8 @@ static const struct mhi_pci_dev_info mhi_foxconn_sdx55_info = {
339362
.edl = "qcom/sdx55m/edl.mbn",
340363
.config = &modem_foxconn_sdx55_config,
341364
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
342-
.dma_data_width = 32
365+
.dma_data_width = 32,
366+
.sideband_wake = false,
343367
};
344368

345369
static const struct pci_device_id mhi_pci_id_table[] = {
@@ -640,9 +664,12 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
640664
mhi_cntrl->status_cb = mhi_pci_status_cb;
641665
mhi_cntrl->runtime_get = mhi_pci_runtime_get;
642666
mhi_cntrl->runtime_put = mhi_pci_runtime_put;
643-
mhi_cntrl->wake_get = mhi_pci_wake_get_nop;
644-
mhi_cntrl->wake_put = mhi_pci_wake_put_nop;
645-
mhi_cntrl->wake_toggle = mhi_pci_wake_toggle_nop;
667+
668+
if (info->sideband_wake) {
669+
mhi_cntrl->wake_get = mhi_pci_wake_get_nop;
670+
mhi_cntrl->wake_put = mhi_pci_wake_put_nop;
671+
mhi_cntrl->wake_toggle = mhi_pci_wake_toggle_nop;
672+
}
646673

647674
err = mhi_pci_claim(mhi_cntrl, info->bar_num, DMA_BIT_MASK(info->dma_data_width));
648675
if (err)

0 commit comments

Comments
 (0)