Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp517573rwr; Thu, 20 Apr 2023 02:41:22 -0700 (PDT) X-Google-Smtp-Source: AKy350bR9jlQu7cFwAAVwzUdrPTqYGZVzDqZkAWy9lBww8xOnaIdN2iAn83QbQ//lgXLVDXVmuYi X-Received: by 2002:a17:903:22c7:b0:1a5:f:a7c7 with SMTP id y7-20020a17090322c700b001a5000fa7c7mr1201099plg.0.1681983682121; Thu, 20 Apr 2023 02:41:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1681983682; cv=none; d=google.com; s=arc-20160816; b=07gg35Xobw+/hLs3ss5K/+OR71Fd3R3IeeXYpLqoYm1nAyVgydsEzGPgKcw9GJTy9o kgOFhrI69UzKdWYK6YbUJ4J1WbiAurDse7SJMgp6sUWJgf+qlveSrQaW8DxQSH+thE0g AAiwKUTtcJvz6jTwNJN+rcL1P96gQVdE9K6reC/vMO7KHWPwA+QNIIfgNWnKvB+Ogmdo /DeIZvjpBnSuQqhprRi/L22qfxDn/RbB9ewJMpdQBf9nWmRe5EzVn/esht219Qi7LHLH 6Ioqqx+r4q2H93EuJBnaZo0gUuII42gkDbbTkp/CijnT2Vcfi/oB6UhpS0LqbD+CgdHi Sdsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Z7mekstuJseb3AL5tX4qsgFSzq5BMN4PU323SYdWvfA=; b=Q3TrHngB47xF0CCkDcH5cUlClarB3zfru8Z9zzZhaRUSsEVVnEbLaE80RCkTV14fEB xYGJXQu9NbGCzT+ww7kxg4nCYJMD/WmbcyhsjXWUIvb7220kDKO5OrnAE85eCV8Li1wr xXqd1CgncyZ8zse8HP7wtRziSVRjt7/7TT4GA5JAqYyzlO1pnC8/F+CwB/o9/geK/9hd FDAcDJwqvGHZjQUWV3pdPe6kCH0/4itk5APHg2gu2J3URnJlMyffH/QCeCMyDByxIQSG RsnL2dxXpYlURDpqCp8cyAUlOPoS+bfTGl3/s74IivA30eBs7JeCFjv9dWhuO1GbS+IA hLIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d3-20020a170903230300b001a6f93aa11asi1472170plh.497.2023.04.20.02.41.10; Thu, 20 Apr 2023 02:41:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234483AbjDTJji (ORCPT + 99 others); Thu, 20 Apr 2023 05:39:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51448 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234480AbjDTJjG (ORCPT ); Thu, 20 Apr 2023 05:39:06 -0400 Received: from twspam01.aspeedtech.com (twspam01.aspeedtech.com [211.20.114.71]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B9780EC for ; Thu, 20 Apr 2023 02:37:41 -0700 (PDT) Received: from mail.aspeedtech.com ([192.168.0.24]) by twspam01.aspeedtech.com with ESMTP id 33K9Kcq1063608; Thu, 20 Apr 2023 17:20:38 +0800 (GMT-8) (envelope-from jammy_huang@aspeedtech.com) Received: from [192.168.2.115] (192.168.2.115) by TWMBX02.aspeed.com (192.168.0.24) with Microsoft SMTP Server (TLS) id 15.0.1497.2; Thu, 20 Apr 2023 17:37:00 +0800 Message-ID: <325512ba-b468-bca0-d3ef-a1c9cf464d62@aspeedtech.com> Date: Thu, 20 Apr 2023 17:37:01 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 Subject: Re: [PATCH v2] drm/ast: Fix ARM compatibility Content-Language: en-US To: Thomas Zimmermann , CC: , , , References: <20230420080947.27226-1-jammy_huang@aspeedtech.com> <61edb9d3-11f5-42de-633d-6e6253ce021f@suse.de> From: Jammy Huang In-Reply-To: <61edb9d3-11f5-42de-633d-6e6253ce021f@suse.de> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [192.168.2.115] X-ClientProxiedBy: TWMBX02.aspeed.com (192.168.0.24) To TWMBX02.aspeed.com (192.168.0.24) X-DNSRBL: X-MAIL: twspam01.aspeedtech.com 33K9Kcq1063608 X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Thomas, Thanks for help. I will update a new patch per your comments On 2023/4/20 下午 04:57, Thomas Zimmermann wrote: > Hi > > Am 20.04.23 um 10:09 schrieb Jammy Huang: >> ARM architecture only has 'memory', so all devices are accessed by >> MMIO if possible. >> >> Signed-off-by: Jammy Huang >> --- >>   v2 changes: >>    - Use MMIO after AST2500 which enable MMIO by default. >> --- >>   drivers/gpu/drm/ast/ast_main.c | 9 +++++---- >>   1 file changed, 5 insertions(+), 4 deletions(-) >> >> diff --git a/drivers/gpu/drm/ast/ast_main.c >> b/drivers/gpu/drm/ast/ast_main.c >> index f83ce77127cb..d384e810fa4d 100644 >> --- a/drivers/gpu/drm/ast/ast_main.c >> +++ b/drivers/gpu/drm/ast/ast_main.c >> @@ -425,11 +425,12 @@ struct ast_private *ast_device_create(const >> struct drm_driver *drv, >>           return ERR_PTR(-EIO); >>         /* >> -     * If we don't have IO space at all, use MMIO now and >> -     * assume the chip has MMIO enabled by default (rev 0x20 >> -     * and higher). >> +     * After AST2500, MMIO is enabled by default, and it should be >> adapted > > By 'adapted', you mean 'adopted'? > > Apart from that: > > Reviewed-by: Thomas Zimmermann > > I also ran this patch on an AST2100, which still works as before. > > Best regards > Thomas > >> +     * to be compatible with Arm. >>        */ >> -    if (!(pci_resource_flags(pdev, 2) & IORESOURCE_IO)) { >> +    if (pdev->revision >= 0x40) { >> +        ast->ioregs = ast->regs + AST_IO_MM_OFFSET; >> +    } else if (!(pci_resource_flags(pdev, 2) & IORESOURCE_IO)) { >>           drm_info(dev, "platform has no IO space, trying MMIO\n"); >>           ast->ioregs = ast->regs + AST_IO_MM_OFFSET; >>       } >> >> base-commit: e62252bc55b6d4eddc6c2bdbf95a448180d6a08d > -- Best Regards Jammy