Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp2642339img; Sun, 24 Mar 2019 14:40:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqxz/AjiJGFhB53HJm/1YvQ3nrnVM8w2RCeVK1iHMfwLzQCJPL0QhKCHfA6iH14qbzh/kCmf X-Received: by 2002:a17:902:12f:: with SMTP id 44mr21885087plb.208.1553463615761; Sun, 24 Mar 2019 14:40:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553463615; cv=none; d=google.com; s=arc-20160816; b=peeD27/gYrO0uI6Rhz/ZyQ6wQeo8OXBeIBh0MM2DjyqhKKEtkW/LRx72lwX0g3El5q yAp0tlFx32ppgSG5axFAlGCKHgGFBlZyw1gCoNzqH9nrnog0s7G/76nDrQnRf8UxpyHL W2e/LDbdK+qYHybIjQNsxP07UmzVQIVRjVS7clfDywhS3dTuV7u/PgZLgsz3LzuGYOhr UxAXPycBuKrFAmuubEY4r6dgzIdi2QA6R5+pv71eaQyPrALRp+9HCq2z8KwgqGRAqMzV tUIsatavIyVNBDc/n+kWrqy/N7CgG+SaQj7Wbl9fEkoneSRtv5g2IQwnPS0J9EJ5REra Y8VQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=e6pqCkxXq/b/N9uVrwU+oMnL9SMQF4R8lo2BCTugnag=; b=Iu9Lt7RxRCLVrZpmEEMVpjwvfUVleZHHdb3QnzXZuNNIZZOK0X7U+u0eFFXNIq3zJa 9Rg2rrk4xg8Jq41N+UTAfQSKjDWjYDIvzmp4eGQ3Jce7j4Z+MT2wR3BsnXFkfEruf/ca sucEd7YDd+DACXjQqrI8u+AbMA9/WBoAJJcieMjn5kuYJC8l9GoCCGC65nMkxsibgZQG bZSlVP/59lxpNOYcDw/Vgw52XYU4t5e7M6PrVE4m9S2tPCkiui/47yiiDjsEGDRC4KXp SEH7F2SsUqX6Iof888bDoKtP4cDAcvod9aaCOAR6UtzOumyO6d9XuqWcG94v05oUW5UR ijNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=SlgMgDap; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id cy1si13156968plb.429.2019.03.24.14.39.59; Sun, 24 Mar 2019 14:40:15 -0700 (PDT) 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=@gmail.com header.s=20161025 header.b=SlgMgDap; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728912AbfCXVjV (ORCPT + 99 others); Sun, 24 Mar 2019 17:39:21 -0400 Received: from mail-wm1-f67.google.com ([209.85.128.67]:35563 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726317AbfCXVjV (ORCPT ); Sun, 24 Mar 2019 17:39:21 -0400 Received: by mail-wm1-f67.google.com with SMTP id y197so7024564wmd.0; Sun, 24 Mar 2019 14:39:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=e6pqCkxXq/b/N9uVrwU+oMnL9SMQF4R8lo2BCTugnag=; b=SlgMgDapELYq5ys358aM76isrZtUSGVhkMQ+nPYdfA+WGQkKZHBVDaqYozS8SXj/Vp 2kow+dHV3nwngqK1xliw0ASIv6iNcTebBZ2R/ulyXkjRMGmy9EuFJO7F5fGCP8K8q1A+ g/binMxje+k3JaqhRwgRDtwNSvwjm79j26XKdLWHaromf0JY+DO0MyxkoERPOpBBH+vx O1WkaeK8BleYRRt+CjCGM6YNfmdvTXm3xP5GeaP0m8aTfTy3zMUwuw1VXxr4bNqf8IqJ QJ8XT5Mcexd99vE8eyEiWJT3jndC2HgpdWdN4FFXvnxqKgjeGJ9dWvcFkWI+q76pb+5I CWlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=e6pqCkxXq/b/N9uVrwU+oMnL9SMQF4R8lo2BCTugnag=; b=X5CpyBUQ2Fiqj9xpK3llImyazdYd3qGjMf9qbIJAiYXRUcNxOagLlFtsd6MZs1MpdF fBd6RF1dpsXiuwgUzhV08TxoI6tNGEbHajKLkUFqCsvecv/eJVSPE4t9fSxWrl9yBtYn NisnBZ4DnwCdlSw2DGBDKgGskL3tL/qwzyAPoPP69xicnRHfHkqbJ6DKyfopFzFO7V/F 20/H0M4lKE8jkDtLqKKGljMWfsxJX+79REXkSmTG3ayf6ajO4M9RWLUylOn9zWgwlc8X 4VDl492PFQwNtoeJ4r50GyQVZnwqtg42YJTMWLVChuNnJzW98k6KVJsGtg64dPTAoGbl ulwg== X-Gm-Message-State: APjAAAXsoIyjmmTq3yZevMiXWvXet00PcohkqzSpVQJ32CTnLXRwr0tG O7UHHmRSf6zeg3LD4RlZtSA= X-Received: by 2002:a1c:4d:: with SMTP id 74mr9154569wma.1.1553463559228; Sun, 24 Mar 2019 14:39:19 -0700 (PDT) Received: from debian (cpc101300-bagu16-2-0-cust362.1-3.cable.virginm.net. [86.21.41.107]) by smtp.gmail.com with ESMTPSA id t14sm7119514wmi.16.2019.03.24.14.39.18 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 24 Mar 2019 14:39:18 -0700 (PDT) Date: Sun, 24 Mar 2019 21:39:16 +0000 From: Sudip Mukherjee To: Teddy Wang Cc: Bartlomiej Zolnierkiewicz , linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org, Yifeng Li Subject: Re: [PATCH 5/8] fbdev: sm712fb: fix crashes during framebuffer writes by correctly mapping VRAM. Message-ID: <20190324213916.7xfxb7itj5ooydse@debian> References: <20190316222504.27170-1-tomli@tomli.me> <20190316222504.27170-6-tomli@tomli.me> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190316222504.27170-6-tomli@tomli.me> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Teddy, On Sun, Mar 17, 2019 at 06:25:01AM +0800, Yifeng Li wrote: > On a Thinkpad s30 (Pentium III / i440MX, Lynx3DM), running fbtest or X > will crash the machine instantly, because the VRAM/framebuffer is not > mapped correctly. > > On SM712, the framebuffer starts at the beginning of address space, but > SM720's framebuffer starts at the 1 MiB offset from the beginning. However, > sm712fb fails to take this into account, as a result, writing to the > framebuffer will destroy all the registers and kill the system immediately. > Another problem is the driver assumes 8 MiB of VRAM for SM720, but some > SM720 system, such as this IBM Thinkpad, only has 4 MiB of VRAM. > > Fix this problem by removing the hardcoded VRAM size, adding a function to > query the amount of VRAM from register MCR76 on SM720, and adding proper > framebuffer offset. > > Please note that the memory map may have additional problems on Big-Endian > system, which is not available for testing by myself. But I highly suspect > that the original code is also broken on Big-Endian machines for SM720, so > at least we are not making the problem worse. More, the driver also assumed > SM710/SM712 has 4 MiB of VRAM, but it has a 2 MiB version as well, and used > in earlier laptops, such as IBM Thinkpad 240X, the driver would probably > crash on them. I've never seen one of those machines and cannot fix it, but > I have documented these problems in the comments. I only have access to SM712 and I am testing this series on it. Can you please test them on SM710, SM720 and also on big-endian machine, specially the patches from 5 to 8. -- Regards Sudip