All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] bus: mhi: Fix MHI on big endian architectures
@ 2021-06-23  2:43 Paul Davey
  2021-06-23  2:43 ` [PATCH v2 1/2] bus: mhi: Fix pm_state conversion to string Paul Davey
  2021-06-23  2:43 ` [PATCH v2 2/2] bus: mhi: Fix MHI DMA structure endianness Paul Davey
  0 siblings, 2 replies; 6+ messages in thread
From: Paul Davey @ 2021-06-23  2:43 UTC (permalink / raw)
  To: Manivannan Sadhasivam
  Cc: linux-arm-msm, linux-kernel, Bhaumik Bhatt, Hemant Kumar, Paul Davey

I encountered some problems getting the MHI driver to work on an Octeon
3 platform these seem to all be related to endianness issues.  The modem
interface appears to require the DMA structures to be in little endian,
however the MHI core driver was assembling them in native endianness.

Using little endian explicitly allows the interface to function as
expected.

Changes in v2:
  - use __fls instead of find_last_bit in pm_state conversion patch as
    requested by Hemant Kumar <hemantk@codeaurora.org>

Paul Davey (2):
  bus: mhi: Fix pm_state conversion to string
  bus: mhi: Fix MHI DMA structure endianness

 drivers/bus/mhi/core/debugfs.c  |  26 +++----
 drivers/bus/mhi/core/init.c     |  43 ++++++-----
 drivers/bus/mhi/core/internal.h | 129 ++++++++++++++++----------------
 drivers/bus/mhi/core/main.c     |  36 ++++-----
 drivers/bus/mhi/core/pm.c       |   8 +-
 5 files changed, 124 insertions(+), 118 deletions(-)

-- 
2.32.0


^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: [PATCH v2 2/2] bus: mhi: Fix MHI DMA structure endianness
@ 2021-06-25 20:20 kernel test robot
  0 siblings, 0 replies; 6+ messages in thread
From: kernel test robot @ 2021-06-25 20:20 UTC (permalink / raw)
  To: kbuild

[-- Attachment #1: Type: text/plain, Size: 8921 bytes --]

CC: kbuild-all(a)lists.01.org
In-Reply-To: <20210623024327.15029-3-paul.davey@alliedtelesis.co.nz>
References: <20210623024327.15029-3-paul.davey@alliedtelesis.co.nz>
TO: Paul Davey <paul.davey@alliedtelesis.co.nz>
TO: Manivannan Sadhasivam <mani@kernel.org>
CC: linux-arm-msm(a)vger.kernel.org
CC: linux-kernel(a)vger.kernel.org
CC: Bhaumik Bhatt <bbhatt@codeaurora.org>
CC: Hemant Kumar <hemantk@codeaurora.org>
CC: Paul Davey <paul.davey@alliedtelesis.co.nz>

Hi Paul,

Thank you for the patch! Perhaps something to improve:

[auto build test WARNING on linus/master]
[also build test WARNING on v5.13-rc7 next-20210625]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch]

url:    https://github.com/0day-ci/linux/commits/Paul-Davey/bus-mhi-Fix-MHI-on-big-endian-architectures/20210623-104355
base:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 0c18f29aae7ce3dadd26d8ee3505d07cc982df75
:::::: branch date: 3 days ago
:::::: commit date: 3 days ago
config: parisc-randconfig-m031-20210625 (attached as .config)
compiler: hppa-linux-gcc (GCC) 9.3.0

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>

smatch warnings:
drivers/bus/mhi/core/debugfs.c:74 mhi_debugfs_events_show() error: '%pad' expects argument of type 'dma_addr_t*', argument 4 has type 'ullong*'
drivers/bus/mhi/core/debugfs.c:122 mhi_debugfs_channels_show() error: '%pad' expects argument of type 'dma_addr_t*', argument 5 has type 'ullong*'

vim +74 drivers/bus/mhi/core/debugfs.c

c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   37  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   38  static int mhi_debugfs_events_show(struct seq_file *m, void *d)
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   39  {
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   40  	struct mhi_controller *mhi_cntrl = m->private;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   41  	struct mhi_event *mhi_event;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   42  	struct mhi_event_ctxt *er_ctxt;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   43  	int i;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   44  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   45  	if (!mhi_is_active(mhi_cntrl)) {
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   46  		seq_puts(m, "Device not ready\n");
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   47  		return -ENODEV;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   48  	}
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   49  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   50  	er_ctxt = mhi_cntrl->mhi_ctxt->er_ctxt;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   51  	mhi_event = mhi_cntrl->mhi_event;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   52  	for (i = 0; i < mhi_cntrl->total_ev_rings;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   53  						i++, er_ctxt++, mhi_event++) {
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   54  		struct mhi_ring *ring = &mhi_event->ring;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   55  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   56  		if (mhi_event->offload_ev) {
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   57  			seq_printf(m, "Index: %d is an offload event ring\n",
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   58  				   i);
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   59  			continue;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   60  		}
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   61  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   62  		seq_printf(m, "Index: %d intmod count: %lu time: %lu",
cd182486e4578f Paul Davey    2021-06-23   63  			   i, (le32_to_cpu(er_ctxt->intmod) & EV_CTX_INTMODC_MASK) >>
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   64  			   EV_CTX_INTMODC_SHIFT,
cd182486e4578f Paul Davey    2021-06-23   65  			   (le32_to_cpu(er_ctxt->intmod) & EV_CTX_INTMODT_MASK) >>
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   66  			   EV_CTX_INTMODT_SHIFT);
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   67  
cd182486e4578f Paul Davey    2021-06-23   68  		seq_printf(m, " base: 0x%0llx len: 0x%llx", le64_to_cpu(er_ctxt->rbase),
cd182486e4578f Paul Davey    2021-06-23   69  			   le64_to_cpu(er_ctxt->rlen));
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   70  
cd182486e4578f Paul Davey    2021-06-23   71  		seq_printf(m, " rp: 0x%llx wp: 0x%llx", le64_to_cpu(er_ctxt->rp),
cd182486e4578f Paul Davey    2021-06-23   72  			   le64_to_cpu(er_ctxt->wp));
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   73  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  @74  		seq_printf(m, " local rp: 0x%pK db: 0x%pad\n", ring->rp,
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   75  			   &mhi_event->db_cfg.db_val);
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   76  	}
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   77  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   78  	return 0;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   79  }
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   80  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   81  static int mhi_debugfs_channels_show(struct seq_file *m, void *d)
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   82  {
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   83  	struct mhi_controller *mhi_cntrl = m->private;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   84  	struct mhi_chan *mhi_chan;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   85  	struct mhi_chan_ctxt *chan_ctxt;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   86  	int i;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   87  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   88  	if (!mhi_is_active(mhi_cntrl)) {
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   89  		seq_puts(m, "Device not ready\n");
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   90  		return -ENODEV;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   91  	}
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   92  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   93  	mhi_chan = mhi_cntrl->mhi_chan;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   94  	chan_ctxt = mhi_cntrl->mhi_ctxt->chan_ctxt;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   95  	for (i = 0; i < mhi_cntrl->max_chan; i++, chan_ctxt++, mhi_chan++) {
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   96  		struct mhi_ring *ring = &mhi_chan->tre_ring;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   97  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   98  		if (mhi_chan->offload_ch) {
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29   99  			seq_printf(m, "%s(%u) is an offload channel\n",
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  100  				   mhi_chan->name, mhi_chan->chan);
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  101  			continue;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  102  		}
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  103  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  104  		if (!mhi_chan->mhi_dev)
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  105  			continue;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  106  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  107  		seq_printf(m,
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  108  			   "%s(%u) state: 0x%lx brstmode: 0x%lx pollcfg: 0x%lx",
cd182486e4578f Paul Davey    2021-06-23  109  			   mhi_chan->name, mhi_chan->chan, (le32_to_cpu(chan_ctxt->chcfg) &
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  110  			   CHAN_CTX_CHSTATE_MASK) >> CHAN_CTX_CHSTATE_SHIFT,
cd182486e4578f Paul Davey    2021-06-23  111  			   (le32_to_cpu(chan_ctxt->chcfg) & CHAN_CTX_BRSTMODE_MASK) >>
cd182486e4578f Paul Davey    2021-06-23  112  			   CHAN_CTX_BRSTMODE_SHIFT, (le32_to_cpu(chan_ctxt->chcfg) &
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  113  			   CHAN_CTX_POLLCFG_MASK) >> CHAN_CTX_POLLCFG_SHIFT);
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  114  
cd182486e4578f Paul Davey    2021-06-23  115  		seq_printf(m, " type: 0x%x event ring: %u", le32_to_cpu(chan_ctxt->chtype),
cd182486e4578f Paul Davey    2021-06-23  116  			   le32_to_cpu(chan_ctxt->erindex));
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  117  
9e8c8cc44f35bb Loic Poulain  2020-09-29  118  		seq_printf(m, " base: 0x%llx len: 0x%llx rp: 0x%llx wp: 0x%llx",
cd182486e4578f Paul Davey    2021-06-23  119  			   le64_to_cpu(chan_ctxt->rbase), le64_to_cpu(chan_ctxt->rlen),
cd182486e4578f Paul Davey    2021-06-23  120  			   le64_to_cpu(chan_ctxt->rp), le64_to_cpu(chan_ctxt->wp));
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  121  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29 @122  		seq_printf(m, " local rp: 0x%pK local wp: 0x%pK db: 0x%pad\n",
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  123  			   ring->rp, ring->wp,
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  124  			   &mhi_chan->db_cfg.db_val);
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  125  	}
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  126  
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  127  	return 0;
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  128  }
c7bd825e52b3d0 Bhaumik Bhatt 2020-09-29  129  

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org

[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 25230 bytes --]

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-06-25 20:20 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-23  2:43 [PATCH v2 0/2] bus: mhi: Fix MHI on big endian architectures Paul Davey
2021-06-23  2:43 ` [PATCH v2 1/2] bus: mhi: Fix pm_state conversion to string Paul Davey
2021-06-23  2:43 ` [PATCH v2 2/2] bus: mhi: Fix MHI DMA structure endianness Paul Davey
2021-06-24  2:11   ` Bhaumik Bhatt
2021-06-24 23:12     ` Paul Davey
2021-06-25 20:20 kernel test robot

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.