Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp4736199ybl; Mon, 13 Jan 2020 19:48:27 -0800 (PST) X-Google-Smtp-Source: APXvYqxei9V0+WHgWF0j5YnzxeNZmDLgXVfB+72TJ1Q34XIODx4a40RpdD1KwDNwz2VLDSd/k/r4 X-Received: by 2002:a05:6830:ce:: with SMTP id x14mr15181921oto.289.1578973707450; Mon, 13 Jan 2020 19:48:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578973707; cv=none; d=google.com; s=arc-20160816; b=0eETvCyMdgDhA2VkRfHIqUFnwS9K9uHMXAKyyUAKpUxEC3lhBFx8+qyGB6WmOuubAn HXFZzefgTVVu5rbzZbjwEfnr9looJfVyy9Ktqv0jCRTxRk4k6bxjw/m1t+btvq3HPcYu jY2L1l4KYt9Wa4fRH6KS8Rj5w7oeEoQ5djjCNqToHhyYRl8g+CFG27ryzxA19cIeT5G6 BNOozQGLevALFu+hJ6Bh5hLpvZzDY+TWRafyZrHzn188qvv4yntdKKeUvvX33DHKb8UP C/0UlQddSrgle09VUeONWG/a6x8Iv0UMn60BzV2xM2luERbtM9/ZR1oUBkNHLVOJCJFO DqMQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:message-id:date :mime-version:subject:references:in-reply-to:cc:to:envelope-from :from:dkim-signature; bh=yTsm5oMcLHPTAmSkdzNgo7hZnZ7/5IAdpa6CtG/274w=; b=OwZY20uQNqVYz7DMxEQYW//IjXm5RQampEiOa27b4DYlD/+hMsEfWyC0EemyWVoVkW EWX5sEvcS29bEuyIQvyg0/sshy/fwoYtNeD1J2/E18KbhnWl7hjlVo/WHRcjR7kWlG+6 cBeUOFBgjyPjDr6lq0cD0+SieNePBxYXif0OF2ErgjBzZEj7okNwacdB1/6SYRN5Hm3k a5+G7mquIzjQK/oq1z5I3JahHjF2l9b6qCV6Guhe+Qs+F6HT1H4JDXIb2vG5576jHu+i acxV18B19BoJDm1k7QToaA4jXeQj5IMYV0rVyjuq7zyhJfPMUEbBEm3A+p85ot2RhME2 uV6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=giDRAfeB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z14si6710603oih.89.2020.01.13.19.48.15; Mon, 13 Jan 2020 19:48:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@flygoat.com header.s=mail header.b=giDRAfeB; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=flygoat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729472AbgANDaY (ORCPT + 99 others); Mon, 13 Jan 2020 22:30:24 -0500 Received: from forward500o.mail.yandex.net ([37.140.190.195]:35601 "EHLO forward500o.mail.yandex.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728802AbgANDaX (ORCPT ); Mon, 13 Jan 2020 22:30:23 -0500 Received: from mxback18o.mail.yandex.net (mxback18o.mail.yandex.net [IPv6:2a02:6b8:0:1a2d::69]) by forward500o.mail.yandex.net (Yandex) with ESMTP id 9554360637; Tue, 14 Jan 2020 06:30:20 +0300 (MSK) Received: from localhost (localhost [::1]) by mxback18o.mail.yandex.net (mxback/Yandex) with ESMTP id 9JPZXyJDt7-UJVWLU2i; Tue, 14 Jan 2020 06:30:19 +0300 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=flygoat.com; s=mail; t=1578972619; bh=yTsm5oMcLHPTAmSkdzNgo7hZnZ7/5IAdpa6CtG/274w=; h=Message-Id:Cc:Subject:In-Reply-To:Date:References:To:From; b=giDRAfeB9QXiDljnK2KNb1EVEJyzM/LRlKBBOaeQuYnxjYC1NycTLEyAlGb3RqQEZ ZF1yFADe6B3G4QuG2dpc394xbfJupKA2SntipcVoZ8ozkBn2vJSlCFJnLUr6TAlewg HjIqFhN+uziGgS0q6TZvMWeZbXWRx6hkQIvpq0rc= Authentication-Results: mxback18o.mail.yandex.net; dkim=pass header.i=@flygoat.com Received: by iva4-6593cae50902.qloud-c.yandex.net with HTTP; Tue, 14 Jan 2020 06:30:19 +0300 From: Jiaxun Yang Envelope-From: yjx@flygoat.com To: Paul Burton Cc: "linux-mips@vger.kernel.org" , "chenhc@lemote.com" , "linux-kernel@vger.kernel.org" , "hch@lst.de" In-Reply-To: <20200113185246.zvsahaeh36gdfsv2@pburton-laptop> References: <20200113140705.74605-1-jiaxun.yang@flygoat.com> <20200113140705.74605-2-jiaxun.yang@flygoat.com> <20200113185246.zvsahaeh36gdfsv2@pburton-laptop> Subject: Re: [PATCH 2/2] MIPS: Loongson64: Add dma iocoherency detection support MIME-Version: 1.0 X-Mailer: Yamail [ http://yandex.ru ] 5.0 Date: Tue, 14 Jan 2020 11:30:19 +0800 Message-Id: <29582761578972619@iva4-6593cae50902.qloud-c.yandex.net> Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=utf-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 14.01.2020, 02:52, "Paul Burton" : > 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