From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qk1-f170.google.com (mail-qk1-f170.google.com [209.85.222.170]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4C8EC3480 for ; Fri, 6 Aug 2021 22:33:51 +0000 (UTC) Received: by mail-qk1-f170.google.com with SMTP id 14so11614572qkc.4 for ; Fri, 06 Aug 2021 15:33:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:to:cc:from:subject:message-id:date:user-agent:mime-version :content-language:content-transfer-encoding; bh=BtBuE0qm1JVAvz5cI51mwR+Aw6HvlPFvZ5RuHOJzs04=; b=NVpHAsz2VjnsnY58JUU2Ow3jI4TFCFYJge5UekVZZwvhNQsuke37sYiieLqPAuLtx7 04ovDDuyrKKUIXjA6Xxvlwiy99sIyvVhv/6I/XZYMw0d0jnRMgBBz6bhIZvHfCV0MiGw 1p9fK243MN+dh3HB+UadWMAhOn3eVjqj3+Ecoo1wjJBtwmYzzLnwfXogokDUM0nmSIXv rId0Gk/r8EDBjpfZIjy2T8Nr1kaYx2XqHbxIlGTIrqiKQM53oIJS/gnmUYYlrI14pd41 hHG1nbuIT/04qVX0hnP7isyUG1PUMqWuxq14UBhIzxZk3jPamXJIGqHd8o87Vt6dQGt0 W4Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:to:cc:from:subject:message-id:date :user-agent:mime-version:content-language:content-transfer-encoding; bh=BtBuE0qm1JVAvz5cI51mwR+Aw6HvlPFvZ5RuHOJzs04=; b=uV+II+FNkT7ecZ3hHjCt+7iPpOIQ2nM3EgdELQps/KCJIuUvkina2onD4zFmBLDW+s iguaYIomTWEX7Q34CKdSLVX4O4svNr9TN/T3kvxzsKVjQ4o1Y+xYfhu/RksaARoKzt8c xwrVRtfCgWCpfFN3d49N1AIf4//aPFXdRCBDohA+e7HLVOMtObkcYvy+FpqpDMSjoo5g Q/moZ4sB/tWdhfVJQAjrMxsONWvn/mvazhycp6wpaXMDd6kZWj24xmycaY5FsGqF/48s 9cYWNyZHygZDqn7J1maC4eiCUxXe0DrrKh+D2wiHgPwhhblWMEYO9HxMM/c3zgayQ7ho f2GQ== X-Gm-Message-State: AOAM532JLq0c5p2zo42J6ERAoX6sXmKj4xa4ratU8WUZ5sAv2eLXzY78 9DfQ4GODlFoY3IMkPwIhelA= X-Google-Smtp-Source: ABdhPJz8UiaoyXh4bkbkKrONGmOjlkdW2IHiv0cIPGx0+gDBiU1uLInDf2TB0pK5p4qZCayXOKXabQ== X-Received: by 2002:a37:ace:: with SMTP id 197mr3679741qkk.448.1628289230258; Fri, 06 Aug 2021 15:33:50 -0700 (PDT) Received: from server.roeck-us.net ([2600:1700:e321:62f0:329c:23ff:fee3:9d7c]) by smtp.gmail.com with ESMTPSA id h140sm2789261qke.112.2021.08.06.15.33.48 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 06 Aug 2021 15:33:49 -0700 (PDT) Sender: Guenter Roeck To: regressions@lists.linux.dev Cc: stable , Greg Kroah-Hartman , Frank Wunderlich , Peter Hess , Mark Brown From: Guenter Roeck Subject: regression [fixed]: SPI interface on systems with Mediatek CPU broken Message-ID: Date: Fri, 6 Aug 2021 15:33:47 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 Precedence: bulk X-Mailing-List: regressions@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit [ submitted for reference. The problem has now been fixed in the upstream kernel ] Affected upstream kernel releases: v5.14-rc3, v5.14-rc4 Various stable releases with the problematic commit are also affected. The SPI interface on systems with various Mediatek CPUs is not operational. The problem affects all Chromebooks with Mediatek CPU since those Chromebooks use the SPI interface to connect to the Embedded Controller. Bisect suggests that commit 3a70dd2d050 ("spi: mediatek: fix fifo rx mode") introduced the problem. The problem was fixed with upstream commit 0d5c3954b35e ("spi: mediatek: Fix fifo transfer"). Detailed problem description from commit 0d5c3954b35e: Commit 3a70dd2d0503 ("spi: mediatek: fix fifo rx mode") claims that fifo RX mode was never handled, and adds the presumably missing code to the FIFO transfer function. However, the claim that receive data was not handled is incorrect. It was handled as part of interrupt handling after the transfer was complete. The code added with the above mentioned commit reads data from the receive FIFO before the transfer is started, which is wrong. This results in an actual transfer error on a Hayato Chromebook. Remove the code trying to handle receive data before the transfer is started to fix the problem. Guenter