mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Baochen Qiang <quic_bqiang@quicinc.com>
To: Johannes Berg <johannes@sipsolutions.net>,
	Fabio Estevam <festevam@gmail.com>
Cc: <miriam.rachel.korenblit@intel.com>, <kvalo@kernel.org>,
	Jakub Kicinski <kuba@kernel.org>,
	linux-wireless <linux-wireless@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: iwlwifi: Regression after migrating to 6.6.32
Date: Thu, 13 Jun 2024 17:51:56 +0800	[thread overview]
Message-ID: <35750452-e362-4dfa-803a-3360a4e16cd8@quicinc.com> (raw)
In-Reply-To: <50101085cba7fc089339c96f531f797e27c632ff.camel@sipsolutions.net>



On 6/13/2024 3:40 PM, Johannes Berg wrote:
> On Thu, 2024-06-13 at 15:10 +0800, Baochen Qiang wrote:
>>
>> On 6/13/2024 3:15 AM, Fabio Estevam wrote:
>>> Hi Johannes,
>>>
>>> On Wed, Jun 12, 2024 at 4:10 PM Johannes Berg <johannes@sipsolutions.net> wrote:
>>>
>>>> Strange. Is there an IOMMU involved on this platform?
>>>
>>> IOMMU isn't available on i.MX8M as far as I know.
>> If IOMMU not present, likely the buffer is mapped by SWIOTLB.
> 
> Why? The device can do 64-bit DMA, so should be able to just access any
> page in the system. Even older devices can do 36-bit DMA, but this is a
> newer one. And if IOMMU isn't present, you have no protection anyway.
Then no idea :(

> 
>>  The iova 4215433216, aka 0xFB426800, is 2K aligned, which also supports such guessing. See definition of IO_TLB_SIZE.
> 
> Not sure that means anything though, I really would have expected a 4k
> buffer to be 4k aligned - why would you even want to map it across two
> pages?
IMO SWIOTLB manages buffers in a unit of IO_TLB_SIZE, it does not care about whether or not we are crossing page boundaries, no?

> 
> If it is SWIOTLB, shouldn't we get into this condition?
> 
>         /*
>          * Historically, swiotlb allocations >= PAGE_SIZE were guaranteed to be
>          * page-aligned in the absence of any other alignment requirements.
>          * 'alloc_align_mask' was later introduced to specify the alignment
>          * explicitly, however this is passed as zero for streaming mappings
>          * and so we preserve the old behaviour there in case any drivers are
>          * relying on it.
>          */
>         if (!alloc_align_mask && !iotlb_align_mask && alloc_size >= PAGE_SIZE)
>                 alloc_align_mask = PAGE_SIZE - 1;
> 
This is not present in 6.6.32 stable kernel.

> 
> Otherwise, not sure though how we could possibly fix this in the driver,
> we really shouldn't do dma_set_min_align_mask() since on the TX side we
> really have no alignment requirements, and swiotlb_map() uses 0 as
> alignment.
> 
> johannes

  reply	other threads:[~2024-06-13  9:52 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-11 11:46 Fabio Estevam
2024-06-11 12:52 ` Johannes Berg
2024-06-11 13:43   ` Fabio Estevam
2024-06-11 13:54     ` Johannes Berg
2024-06-11 14:32       ` Fabio Estevam
2024-06-11 14:50         ` Johannes Berg
2024-06-11 14:59           ` Fabio Estevam
2024-06-12 19:10             ` Johannes Berg
2024-06-12 19:15               ` Fabio Estevam
2024-06-13  6:58                 ` Johannes Berg
2024-06-13  7:10                 ` Baochen Qiang
2024-06-13  7:40                   ` Johannes Berg
2024-06-13  9:51                     ` Baochen Qiang [this message]
2024-06-13 10:36                       ` Johannes Berg
2024-06-13 20:15                         ` Fabio Estevam
2024-06-17 12:08                           ` Will Deacon
2024-06-17 14:08                             ` Fabio Estevam

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=35750452-e362-4dfa-803a-3360a4e16cd8@quicinc.com \
    --to=quic_bqiang@quicinc.com \
    --cc=festevam@gmail.com \
    --cc=johannes@sipsolutions.net \
    --cc=kuba@kernel.org \
    --cc=kvalo@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=miriam.rachel.korenblit@intel.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

all inboxes | Powered by JetHome®