linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiaxun Yang <jiaxun.yang@flygoat.com>
To: Paul Burton <paulburton89@gmail.com>
Cc: "linux-mips@vger.kernel.org" <linux-mips@vger.kernel.org>,
	"chenhc@lemote.com" <chenhc@lemote.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"hch@lst.de" <hch@lst.de>
Subject: Re: [PATCH 2/2] MIPS: Loongson64: Add dma iocoherency detection support
Date: Tue, 14 Jan 2020 11:30:19 +0800	[thread overview]
Message-ID: <29582761578972619@iva4-6593cae50902.qloud-c.yandex.net> (raw)
In-Reply-To: <20200113185246.zvsahaeh36gdfsv2@pburton-laptop>



14.01.2020, 02:52, "Paul Burton" <paulburton89@gmail.com>:
> Hi Jiaxun,
>
> On Mon, Jan 13, 2020 at 10:07:05PM +0800, Jiaxun Yang wrote:
>>  diff --git a/arch/mips/include/asm/mach-loongson64/boot_param.h b/arch/mips/include/asm/mach-loongson64/boot_param.h
>>  index 8c286bedff3e..2da2be40ad81 100644
>>  --- a/arch/mips/include/asm/mach-loongson64/boot_param.h
>>  +++ b/arch/mips/include/asm/mach-loongson64/boot_param.h
>>  @@ -115,7 +115,8 @@ struct irq_source_routing_table {
>>           u64 pci_io_start_addr;
>>           u64 pci_io_end_addr;
>>           u64 pci_config_addr;
>>  - u32 dma_mask_bits;
>>  + u16 dma_mask_bits;
>>  + u16 dma_noncoherent;
>>   } __packed;
>
> This struct is generated by the firmware, right? So does this change
> require that firmware be updated along with the kernel? Or was the
> kernel's definition always incorrect/incomplete?
Hi Paul,

This define added to the firmware by 2013 but somehow never upstream.
That's what Loongson always doing.

Some versions of Loongson-3B1500 failed to maintain DMA coherent.
So they add this parameter to the firmware.
As the maximum dma_mask_bits is 64, the upper 16bit of the old u32 will always
be zero. Which means coherent DMA transformed into the new definition,
that's the expected default behavior. Thus it's safe to do so even if firmware
doesn't understand this parameter.

Thanks

>
> Thanks,
>     Paul
--
Jiaxun

  reply	other threads:[~2020-01-14  3:30 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 14:07 [PATCH 1/2] MIPS: Define pgprot_dmacoherent according to coherentio status Jiaxun Yang
2020-01-13 14:07 ` [PATCH 2/2] MIPS: Loongson64: Add dma iocoherency detection support Jiaxun Yang
2020-01-13 18:52   ` Paul Burton
2020-01-14  3:30     ` Jiaxun Yang [this message]
2020-01-13 14:58 ` [PATCH 1/2] MIPS: Define pgprot_dmacoherent according to coherentio status Christoph Hellwig
2020-01-13 15:11   ` Jiaxun Yang
2020-01-13 15:12     ` Christoph Hellwig

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=29582761578972619@iva4-6593cae50902.qloud-c.yandex.net \
    --to=jiaxun.yang@flygoat.com \
    --cc=chenhc@lemote.com \
    --cc=hch@lst.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=paulburton89@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;
as well as URLs for NNTP newsgroup(s).