Skip to content

Commit 7215ff5

Browse files
committed
Merge tag 'mhi-for-v6.13' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mani/mhi into char-misc-next
Manivannan writes: MHI Host ======== - Fixed typo in the comments section - Fixed the sparse warning in MHI trace by converting the inputs to native endian instead of passing little endian fields. - Used pcim_iomap_region() API to request and map the MHI BAR. This removes the usage of deprecated pcim_iomap_regions() and pcim_iomap_table() APIs. * tag 'mhi-for-v6.13' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/mani/mhi: bus: mhi: host: pci_generic: Use pcim_iomap_region() to request and map MHI BAR bus: mhi: host: Switch trace_mhi_gen_tre fields to native endian bus: mhi: host: Fix typos in the comments
2 parents 389c424 + bd23e83 commit 7215ff5

File tree

4 files changed

+19
-18
lines changed

4 files changed

+19
-18
lines changed

drivers/bus/mhi/host/boot.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ static int __mhi_download_rddm_in_panic(struct mhi_controller *mhi_cntrl)
8282
* other cores to shutdown while we're collecting RDDM buffer. After
8383
* returning from this function, we expect the device to reset.
8484
*
85-
* Normaly, we read/write pm_state only after grabbing the
85+
* Normally, we read/write pm_state only after grabbing the
8686
* pm_lock, since we're in a panic, skipping it. Also there is no
87-
* gurantee that this state change would take effect since
87+
* guarantee that this state change would take effect since
8888
* we're setting it w/o grabbing pm_lock
8989
*/
9090
mhi_cntrl->pm_state = MHI_PM_LD_ERR_FATAL_DETECT;

drivers/bus/mhi/host/internal.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ struct mhi_chan {
255255
/*
256256
* Important: When consuming, increment tre_ring first and when
257257
* releasing, decrement buf_ring first. If tre_ring has space, buf_ring
258-
* is guranteed to have space so we do not need to check both rings.
258+
* is guaranteed to have space so we do not need to check both rings.
259259
*/
260260
struct mhi_ring buf_ring;
261261
struct mhi_ring tre_ring;

drivers/bus/mhi/host/pci_generic.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -917,12 +917,12 @@ static int mhi_pci_claim(struct mhi_controller *mhi_cntrl,
917917
return err;
918918
}
919919

920-
err = pcim_iomap_regions(pdev, 1 << bar_num, pci_name(pdev));
921-
if (err) {
920+
mhi_cntrl->regs = pcim_iomap_region(pdev, 1 << bar_num, pci_name(pdev));
921+
if (IS_ERR(mhi_cntrl->regs)) {
922+
err = PTR_ERR(mhi_cntrl->regs);
922923
dev_err(&pdev->dev, "failed to map pci region: %d\n", err);
923924
return err;
924925
}
925-
mhi_cntrl->regs = pcim_iomap_table(pdev)[bar_num];
926926
mhi_cntrl->reg_len = pci_resource_len(pdev, bar_num);
927927

928928
err = dma_set_mask_and_coherent(&pdev->dev, dma_mask);

drivers/bus/mhi/host/trace.h

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#if !defined(_TRACE_EVENT_MHI_HOST_H) || defined(TRACE_HEADER_MULTI_READ)
1010
#define _TRACE_EVENT_MHI_HOST_H
1111

12+
#include <linux/byteorder/generic.h>
1213
#include <linux/tracepoint.h>
1314
#include <linux/trace_seq.h>
1415
#include "../common.h"
@@ -97,18 +98,18 @@ TRACE_EVENT(mhi_gen_tre,
9798
__string(name, mhi_cntrl->mhi_dev->name)
9899
__field(int, ch_num)
99100
__field(void *, wp)
100-
__field(__le64, tre_ptr)
101-
__field(__le32, dword0)
102-
__field(__le32, dword1)
101+
__field(uint64_t, tre_ptr)
102+
__field(uint32_t, dword0)
103+
__field(uint32_t, dword1)
103104
),
104105

105106
TP_fast_assign(
106107
__assign_str(name);
107108
__entry->ch_num = mhi_chan->chan;
108109
__entry->wp = mhi_tre;
109-
__entry->tre_ptr = mhi_tre->ptr;
110-
__entry->dword0 = mhi_tre->dword[0];
111-
__entry->dword1 = mhi_tre->dword[1];
110+
__entry->tre_ptr = le64_to_cpu(mhi_tre->ptr);
111+
__entry->dword0 = le32_to_cpu(mhi_tre->dword[0]);
112+
__entry->dword1 = le32_to_cpu(mhi_tre->dword[1]);
112113
),
113114

114115
TP_printk("%s: Chan: %d TRE: 0x%p TRE buf: 0x%llx DWORD0: 0x%08x DWORD1: 0x%08x\n",
@@ -176,19 +177,19 @@ DECLARE_EVENT_CLASS(mhi_process_event_ring,
176177

177178
TP_STRUCT__entry(
178179
__string(name, mhi_cntrl->mhi_dev->name)
179-
__field(__le32, dword0)
180-
__field(__le32, dword1)
180+
__field(uint32_t, dword0)
181+
__field(uint32_t, dword1)
181182
__field(int, state)
182-
__field(__le64, ptr)
183+
__field(uint64_t, ptr)
183184
__field(void *, rp)
184185
),
185186

186187
TP_fast_assign(
187188
__assign_str(name);
188189
__entry->rp = rp;
189-
__entry->ptr = rp->ptr;
190-
__entry->dword0 = rp->dword[0];
191-
__entry->dword1 = rp->dword[1];
190+
__entry->ptr = le64_to_cpu(rp->ptr);
191+
__entry->dword0 = le32_to_cpu(rp->dword[0]);
192+
__entry->dword1 = le32_to_cpu(rp->dword[1]);
192193
__entry->state = MHI_TRE_GET_EV_STATE(rp);
193194
),
194195

0 commit comments

Comments
 (0)