From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 85503C33CA9 for ; Tue, 14 Jan 2020 03:30:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 4D32520CC7 for ; Tue, 14 Jan 2020 03:30:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=flygoat.com header.i=@flygoat.com header.b="giDRAfeB" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729139AbgANDaY (ORCPT ); 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-mips-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mips@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