public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Liviu Dudau <liviu@dudau.co.uk>
To: "Bjørn Mork" <bjorn@mork.no>
Cc: Chandrashekar Devegowda <chandrashekar.devegowda@intel.com>,
	Haijun Liu <haijun.liu@mediatek.com>,
	Chiranjeevi Rapolu <chiranjeevi.rapolu@linux.intel.com>,
	M Chetan Kumar <m.chetan.kumar@linux.intel.com>,
	Ricardo Martinez <ricardo.martinez@linux.intel.com>,
	Loic Poulain <loic.poulain@linaro.org>,
	Sergey Ryazanov <ryazanov.s.a@gmail.com>,
	Johannes Berg <johannes@sipsolutions.net>,
	"David S. Miller" <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: net: wwan: t7xx: BUG: Unaligned access when loading mtk_t7xx module
Date: Fri, 22 Mar 2024 12:25:19 +0000	[thread overview]
Message-ID: <Zf14r4UPwQss9L4d@bart.dudau.co.uk> (raw)
In-Reply-To: <87il1ezdbd.fsf@miraculix.mork.no>

On Fri, Mar 22, 2024 at 01:00:22PM +0100, Bjørn Mork wrote:
> Liviu Dudau <liviu@dudau.co.uk> writes:
> 
> >  I had a
> > go at guessing that UL registers are at 0x8 and 0x48 offsets and DL
> > registers are at 0x0478 and 0x04b8, but while that fixes the alignment
> > exception, I now get a "CLDMA{0,1} queue 0 is not empty" message.
> 
> I don't think you can assume the register offsets are wrong.  It looks
> more like the device doesn't care about alignment.

Sorry, I should clarify: the offsets are wrong when you're trying to do
a 64bit read over PCIe for a MEM64 area. Accessed addresses are expected
to be multiples of 8 bytes. t7xx_cldma_hw_set_start_addr() uses the offset
for the low register for calculating the address for the write, which is
not 64bit aligned for the UL block.

> 
> But given that the driver includes <linux/io-64-nonatomic-lo-hi.h>, you
> can probably replace those unaligned 64bit accesses with two nonatomic
> 32bit accesses.
>

I've tried your suggestion and things seem to progress further, thanks for
that! I'm getting some errors on not being able to transition from D3hot
to D0, but I guess it might be something to do with the PCIe-to-M.2 adaptor
that I'm using. Will continue my investigation into the setup and report
back with a patch to replace the register accesses with the lo_hi variants.

Best regards,
Liviu

> 
> Bjørn

-- 
Everyone who uses computers frequently has had, from time to time,
a mad desire to attack the precocious abacus with an axe.
       	   	      	     	  -- John D. Clark, Ignition!

      reply	other threads:[~2024-03-22 12:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-21 16:51 net: wwan: t7xx: BUG: Unaligned access when loading mtk_t7xx module Liviu Dudau
2024-03-22 12:00 ` Bjørn Mork
2024-03-22 12:25   ` Liviu Dudau [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Zf14r4UPwQss9L4d@bart.dudau.co.uk \
    --to=liviu@dudau.co.uk \
    --cc=bjorn@mork.no \
    --cc=chandrashekar.devegowda@intel.com \
    --cc=chiranjeevi.rapolu@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=haijun.liu@mediatek.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=loic.poulain@linaro.org \
    --cc=m.chetan.kumar@linux.intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=ricardo.martinez@linux.intel.com \
    --cc=ryazanov.s.a@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox