mirror of
https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9.git
synced 2026-09-09 00:08:12 +08:00
Merge: mhi bus update to 7.1
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/8309 JIRA: https://redhat.atlassian.net/browse/RHEL-186474 MHI bus rebase to linux kernel upstream version v7.1 It will be used by Wireless (Wifi and WWAN) and automotive components. Depends: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/8206 Depends: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/8130 Signed-off-by: Jose Ignacio Tornos Martinez <jtornosm@redhat.com> Approved-by: Mattijs Korpershoek <mkorpershoek@redhat.com> Approved-by: Kamal Heib <kheib@redhat.com> Approved-by: CKI KWF Bot <cki-ci-bot+kwf-gitlab-com@redhat.com> Merged-by: CKI GitLab Kmaint Pipeline Bot <26919896-cki-kmaint-pipeline-bot@users.noreply.gitlab.com>
This commit is contained in:
@@ -367,7 +367,7 @@ static void mhi_ep_read_completion(struct mhi_ep_buf_info *buf_info)
|
||||
ret = mhi_ep_send_completion_event(mhi_cntrl, ring, el,
|
||||
MHI_TRE_DATA_GET_LEN(el),
|
||||
MHI_EV_CC_EOB);
|
||||
if (ret < 0) {
|
||||
if (ret) {
|
||||
dev_err(&mhi_chan->mhi_dev->dev,
|
||||
"Error sending transfer compl. event\n");
|
||||
goto err_free_tre_buf;
|
||||
@@ -383,7 +383,7 @@ static void mhi_ep_read_completion(struct mhi_ep_buf_info *buf_info)
|
||||
ret = mhi_ep_send_completion_event(mhi_cntrl, ring, el,
|
||||
MHI_TRE_DATA_GET_LEN(el),
|
||||
MHI_EV_CC_EOT);
|
||||
if (ret < 0) {
|
||||
if (ret) {
|
||||
dev_err(&mhi_chan->mhi_dev->dev,
|
||||
"Error sending transfer compl. event\n");
|
||||
goto err_free_tre_buf;
|
||||
@@ -449,7 +449,7 @@ static int mhi_ep_read_channel(struct mhi_ep_cntrl *mhi_cntrl,
|
||||
|
||||
dev_dbg(dev, "Reading %zd bytes from channel (%u)\n", tr_len, ring->ch_id);
|
||||
ret = mhi_cntrl->read_async(mhi_cntrl, &buf_info);
|
||||
if (ret < 0) {
|
||||
if (ret) {
|
||||
dev_err(&mhi_chan->mhi_dev->dev, "Error reading from channel\n");
|
||||
goto err_free_buf_addr;
|
||||
}
|
||||
@@ -494,7 +494,7 @@ static int mhi_ep_process_ch_ring(struct mhi_ep_ring *ring)
|
||||
} else {
|
||||
/* UL channel */
|
||||
ret = mhi_ep_read_channel(mhi_cntrl, ring);
|
||||
if (ret < 0) {
|
||||
if (ret) {
|
||||
dev_err(&mhi_chan->mhi_dev->dev, "Failed to read channel\n");
|
||||
return ret;
|
||||
}
|
||||
@@ -591,7 +591,7 @@ int mhi_ep_queue_skb(struct mhi_ep_device *mhi_dev, struct sk_buff *skb)
|
||||
|
||||
dev_dbg(dev, "Writing %zd bytes to channel (%u)\n", tr_len, ring->ch_id);
|
||||
ret = mhi_cntrl->write_async(mhi_cntrl, &buf_info);
|
||||
if (ret < 0) {
|
||||
if (ret) {
|
||||
dev_err(dev, "Error writing to the channel\n");
|
||||
goto err_exit;
|
||||
}
|
||||
|
||||
@@ -49,7 +49,7 @@ static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end)
|
||||
buf_info.dev_addr = &ring->ring_cache[start];
|
||||
|
||||
ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
|
||||
if (ret < 0)
|
||||
if (ret)
|
||||
return ret;
|
||||
} else {
|
||||
buf_info.size = (ring->ring_size - start) * sizeof(struct mhi_ring_element);
|
||||
@@ -57,7 +57,7 @@ static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end)
|
||||
buf_info.dev_addr = &ring->ring_cache[start];
|
||||
|
||||
ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
|
||||
if (ret < 0)
|
||||
if (ret)
|
||||
return ret;
|
||||
|
||||
if (end) {
|
||||
@@ -66,7 +66,7 @@ static int __mhi_ep_cache_ring(struct mhi_ep_ring *ring, size_t end)
|
||||
buf_info.size = end * sizeof(struct mhi_ring_element);
|
||||
|
||||
ret = mhi_cntrl->read_sync(mhi_cntrl, &buf_info);
|
||||
if (ret < 0)
|
||||
if (ret)
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -269,6 +269,13 @@ static const struct mhi_channel_config mhi_qcom_qdu100_channels[] = {
|
||||
MHI_CHANNEL_CONFIG_DL(41, "MHI_PHC", 32, 4),
|
||||
MHI_CHANNEL_CONFIG_UL(46, "IP_SW0", 256, 5),
|
||||
MHI_CHANNEL_CONFIG_DL(47, "IP_SW0", 256, 5),
|
||||
MHI_CHANNEL_CONFIG_UL(48, "IP_SW1", 256, 6),
|
||||
MHI_CHANNEL_CONFIG_DL(49, "IP_SW1", 256, 6),
|
||||
MHI_CHANNEL_CONFIG_UL(50, "IP_ETH0", 256, 7),
|
||||
MHI_CHANNEL_CONFIG_DL(51, "IP_ETH0", 256, 7),
|
||||
MHI_CHANNEL_CONFIG_UL(52, "IP_ETH1", 256, 8),
|
||||
MHI_CHANNEL_CONFIG_DL(53, "IP_ETH1", 256, 8),
|
||||
|
||||
};
|
||||
|
||||
static struct mhi_event_config mhi_qcom_qdu100_events[] = {
|
||||
@@ -284,6 +291,7 @@ static struct mhi_event_config mhi_qcom_qdu100_events[] = {
|
||||
MHI_EVENT_CONFIG_SW_DATA(5, 512),
|
||||
MHI_EVENT_CONFIG_SW_DATA(6, 512),
|
||||
MHI_EVENT_CONFIG_SW_DATA(7, 512),
|
||||
MHI_EVENT_CONFIG_SW_DATA(8, 512),
|
||||
};
|
||||
|
||||
static const struct mhi_controller_config mhi_qcom_qdu100_config = {
|
||||
@@ -423,6 +431,16 @@ static const struct mhi_pci_dev_info mhi_qcom_sdx55_info = {
|
||||
.sideband_wake = false,
|
||||
};
|
||||
|
||||
static const struct mhi_pci_dev_info mhi_qcom_sdx35_info = {
|
||||
.name = "qcom-sdx35m",
|
||||
.config = &modem_qcom_v2_mhiv_config,
|
||||
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
|
||||
.dma_data_width = 32,
|
||||
.mru_default = 32768,
|
||||
.sideband_wake = false,
|
||||
.edl_trigger = true,
|
||||
};
|
||||
|
||||
static const struct mhi_pci_dev_info mhi_qcom_sdx24_info = {
|
||||
.name = "qcom-sdx24",
|
||||
.edl = "qcom/prog_firehose_sdx24.mbn",
|
||||
@@ -804,6 +822,8 @@ static const struct mhi_channel_config mhi_telit_fn990_channels[] = {
|
||||
MHI_CHANNEL_CONFIG_DL(33, "DUN", 32, 0),
|
||||
MHI_CHANNEL_CONFIG_UL(92, "DUN2", 32, 1),
|
||||
MHI_CHANNEL_CONFIG_DL(93, "DUN2", 32, 1),
|
||||
MHI_CHANNEL_CONFIG_UL(94, "NMEA", 32, 1),
|
||||
MHI_CHANNEL_CONFIG_DL(95, "NMEA", 32, 1),
|
||||
MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0_MBIM", 128, 2),
|
||||
MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0_MBIM", 128, 3),
|
||||
};
|
||||
@@ -855,6 +875,8 @@ static const struct mhi_channel_config mhi_telit_fn920c04_channels[] = {
|
||||
MHI_CHANNEL_CONFIG_DL_FP(35, "FIREHOSE", 32, 0),
|
||||
MHI_CHANNEL_CONFIG_UL(92, "DUN2", 32, 1),
|
||||
MHI_CHANNEL_CONFIG_DL(93, "DUN2", 32, 1),
|
||||
MHI_CHANNEL_CONFIG_UL(94, "NMEA", 32, 1),
|
||||
MHI_CHANNEL_CONFIG_DL(95, "NMEA", 32, 1),
|
||||
MHI_CHANNEL_CONFIG_HW_UL(100, "IP_HW0", 128, 2),
|
||||
MHI_CHANNEL_CONFIG_HW_DL(101, "IP_HW0", 128, 3),
|
||||
};
|
||||
@@ -898,6 +920,16 @@ static const struct mhi_pci_dev_info mhi_telit_fe990b40_info = {
|
||||
.edl_trigger = true,
|
||||
};
|
||||
|
||||
static const struct mhi_pci_dev_info mhi_telit_fe912c04_info = {
|
||||
.name = "telit-fe912c04",
|
||||
.config = &modem_telit_fn920c04_config,
|
||||
.bar_num = MHI_PCI_DEFAULT_BAR_NUM,
|
||||
.dma_data_width = 32,
|
||||
.sideband_wake = false,
|
||||
.mru_default = 32768,
|
||||
.edl_trigger = true,
|
||||
};
|
||||
|
||||
static const struct mhi_pci_dev_info mhi_netprisma_lcur57_info = {
|
||||
.name = "netprisma-lcur57",
|
||||
.edl = "qcom/prog_firehose_sdx24.mbn",
|
||||
@@ -925,6 +957,11 @@ static const struct pci_device_id mhi_pci_id_table[] = {
|
||||
/* Telit FN920C04 (sdx35) */
|
||||
{PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x011a, 0x1c5d, 0x2020),
|
||||
.driver_data = (kernel_ulong_t) &mhi_telit_fn920c04_info },
|
||||
/* Telit FE912C04 (sdx35) */
|
||||
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x011a, 0x1c5d, 0x2045),
|
||||
.driver_data = (kernel_ulong_t) &mhi_telit_fe912c04_info },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x011a),
|
||||
.driver_data = (kernel_ulong_t) &mhi_qcom_sdx35_info },
|
||||
{ PCI_DEVICE(PCI_VENDOR_ID_QCOM, 0x0304),
|
||||
.driver_data = (kernel_ulong_t) &mhi_qcom_sdx24_info },
|
||||
{ PCI_DEVICE_SUB(PCI_VENDOR_ID_QCOM, 0x0306, PCI_VENDOR_ID_QCOM, 0x010c),
|
||||
@@ -1409,7 +1446,7 @@ static int mhi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id)
|
||||
goto err_unregister;
|
||||
}
|
||||
|
||||
err = mhi_sync_power_up(mhi_cntrl);
|
||||
err = mhi_async_power_up(mhi_cntrl);
|
||||
if (err) {
|
||||
dev_err(&pdev->dev, "failed to power up MHI controller\n");
|
||||
goto err_unprepare;
|
||||
@@ -1444,6 +1481,7 @@ static void mhi_pci_remove(struct pci_dev *pdev)
|
||||
struct mhi_pci_device *mhi_pdev = pci_get_drvdata(pdev);
|
||||
struct mhi_controller *mhi_cntrl = &mhi_pdev->mhi_cntrl;
|
||||
|
||||
pm_runtime_forbid(&pdev->dev);
|
||||
pci_disable_sriov(pdev);
|
||||
|
||||
if (pdev->is_physfn)
|
||||
|
||||
Reference in New Issue
Block a user