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=-2.3 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_MUTT autolearn=ham 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 4C9A7C48BD5 for ; Tue, 25 Jun 2019 12:27:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2B0AE213F2 for ; Tue, 25 Jun 2019 12:27:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731169AbfFYM1N (ORCPT ); Tue, 25 Jun 2019 08:27:13 -0400 Received: from verein.lst.de ([213.95.11.211]:34415 "EHLO newverein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729997AbfFYM1N (ORCPT ); Tue, 25 Jun 2019 08:27:13 -0400 Received: by newverein.lst.de (Postfix, from userid 2407) id 9D66168B05; Tue, 25 Jun 2019 14:26:41 +0200 (CEST) Date: Tue, 25 Jun 2019 14:26:41 +0200 From: Christoph Hellwig To: Mark Greer , Paul Gortmaker , Dale Farnsworth Cc: Greg Kroah-Hartman , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: DMA coherency in drivers/tty/serial/mpsc.c Message-ID: <20190625122641.GA4421@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.17 (2007-11-01) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Paul, Dale and Mark (I hope this reaches the right Mark), I've started auditing all users of DMA_ATTR_NON_CONSISTENT ot prepare for major API improvements in that area. One of the odd users is the mpsc ั•erial driver, which allocates DMA memory with the above flag, and then actually properly calls dma_cache_sync. So far, so good. But it turns out it also has "#if defined(CONFIG_PPC32) && !defined(CONFIG_NOT_COHERENT_CACHE)" ifdef blocks next to the dma_cache_sync calls that perform cache maintainance for platforms that according to the ifdef claim to be cache coherent. According to the Kconfig the driver can only build if the MV64X60 symbol is set, which is a ppc embedded 6xx SOC, which appears to be configurable as either cache coherent, or not. But according to the code in the driver at least this device always is not cache coherent. It seems like we need to always mark that platform as potentially not coherent, and then use the per-device flag to mark all device except for this one as coherent. Or did I miss anything? Maybe all this is actually dead code and can go away?