Skip to content

Commit

Permalink
Merge tag 'mhi-for-v6.13' of ssh://gitolite.kernel.org/pub/scm/linux/…
Browse files Browse the repository at this point in the history
…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
  • Loading branch information
gregkh committed Nov 8, 2024
2 parents 389c424 + bd23e83 commit 7215ff5
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 18 deletions.
4 changes: 2 additions & 2 deletions drivers/bus/mhi/host/boot.c
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,9 @@ static int __mhi_download_rddm_in_panic(struct mhi_controller *mhi_cntrl)
* other cores to shutdown while we're collecting RDDM buffer. After
* returning from this function, we expect the device to reset.
*
* Normaly, we read/write pm_state only after grabbing the
* Normally, we read/write pm_state only after grabbing the
* pm_lock, since we're in a panic, skipping it. Also there is no
* gurantee that this state change would take effect since
* guarantee that this state change would take effect since
* we're setting it w/o grabbing pm_lock
*/
mhi_cntrl->pm_state = MHI_PM_LD_ERR_FATAL_DETECT;
Expand Down
2 changes: 1 addition & 1 deletion drivers/bus/mhi/host/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ struct mhi_chan {
/*
* Important: When consuming, increment tre_ring first and when
* releasing, decrement buf_ring first. If tre_ring has space, buf_ring
* is guranteed to have space so we do not need to check both rings.
* is guaranteed to have space so we do not need to check both rings.
*/
struct mhi_ring buf_ring;
struct mhi_ring tre_ring;
Expand Down
6 changes: 3 additions & 3 deletions drivers/bus/mhi/host/pci_generic.c
Original file line number Diff line number Diff line change
Expand Up @@ -917,12 +917,12 @@ static int mhi_pci_claim(struct mhi_controller *mhi_cntrl,
return err;
}

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

err = dma_set_mask_and_coherent(&pdev->dev, dma_mask);
Expand Down
25 changes: 13 additions & 12 deletions drivers/bus/mhi/host/trace.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#if !defined(_TRACE_EVENT_MHI_HOST_H) || defined(TRACE_HEADER_MULTI_READ)
#define _TRACE_EVENT_MHI_HOST_H

#include <linux/byteorder/generic.h>
#include <linux/tracepoint.h>
#include <linux/trace_seq.h>
#include "../common.h"
Expand Down Expand Up @@ -97,18 +98,18 @@ TRACE_EVENT(mhi_gen_tre,
__string(name, mhi_cntrl->mhi_dev->name)
__field(int, ch_num)
__field(void *, wp)
__field(__le64, tre_ptr)
__field(__le32, dword0)
__field(__le32, dword1)
__field(uint64_t, tre_ptr)
__field(uint32_t, dword0)
__field(uint32_t, dword1)
),

TP_fast_assign(
__assign_str(name);
__entry->ch_num = mhi_chan->chan;
__entry->wp = mhi_tre;
__entry->tre_ptr = mhi_tre->ptr;
__entry->dword0 = mhi_tre->dword[0];
__entry->dword1 = mhi_tre->dword[1];
__entry->tre_ptr = le64_to_cpu(mhi_tre->ptr);
__entry->dword0 = le32_to_cpu(mhi_tre->dword[0]);
__entry->dword1 = le32_to_cpu(mhi_tre->dword[1]);
),

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

TP_STRUCT__entry(
__string(name, mhi_cntrl->mhi_dev->name)
__field(__le32, dword0)
__field(__le32, dword1)
__field(uint32_t, dword0)
__field(uint32_t, dword1)
__field(int, state)
__field(__le64, ptr)
__field(uint64_t, ptr)
__field(void *, rp)
),

TP_fast_assign(
__assign_str(name);
__entry->rp = rp;
__entry->ptr = rp->ptr;
__entry->dword0 = rp->dword[0];
__entry->dword1 = rp->dword[1];
__entry->ptr = le64_to_cpu(rp->ptr);
__entry->dword0 = le32_to_cpu(rp->dword[0]);
__entry->dword1 = le32_to_cpu(rp->dword[1]);
__entry->state = MHI_TRE_GET_EV_STATE(rp);
),

Expand Down

0 comments on commit 7215ff5

Please sign in to comment.