Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp6134051imm; Mon, 27 Aug 2018 10:14:48 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYJ5syaWWQkAT1f0VsvqU1jlTLbGu3iRTn1x1MkgeiD5kEkovsXynr7fRo1y7To9SbK8vih X-Received: by 2002:a62:411a:: with SMTP id o26-v6mr15425880pfa.111.1535390088127; Mon, 27 Aug 2018 10:14:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1535390088; cv=none; d=google.com; s=arc-20160816; b=0gunSXO2SMioBLU3qjgpUUJ+DHRAS5cRQ5IOleJ3Xxop/qH4IPxv4hEOxj0ZzkFuCA hHVFk72dOHGQYy6G8WA6JsdUCqzU/gWFANrfYhNrzAvrUE6VtRmr3MKGF0ndWPUCRZqo FoOELq6WXLmv5mBP+e8LrzY3q1DHGiEfeEEvhVk76QEOUNUbbuYokQYcpBPHLMsWIfZy Qvr7VqFtr8ba8oY0Asw24uU3FDCyKIacnygoKDjogll3QK3wu0vrCWYPFgIffUMlN8tw xMX8zq7oIjHrP0rbN4UbeZGFuUNVJjxHQWJ2gpqs+3j2vTT5DaxlA/ZAZKDJpVZIuKOy fxZA== 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:arc-authentication-results; bh=FOduJP7uZPkSeGmomrOzf3gRax1fjxg0ERp2igguX5Q=; b=RUMLlhMeUhmkVHtRguIoqtA/78pufenLCTpsNLZEAhhU2volFK7m8n/MZdBr/GsuNB ouAvGYEQeR0vSc+veElZYPWBV1h4+vXXkV1ssclPBerq0DnPEP/mEwLessKBGR3YgQWk tg00U2ugc8nYiDxGjZgMS2gzbWIIf3k2H5bNEAqi7k02wafcQkfRLxBWyOjMRDkfkxRJ /cRS1N2biGjzQxHAxlOvxEh3XfGe80G/tY48y0g6sMKJAKyR7AIYwIcwX2nbwYfwI0J9 l83/Zk1j9rY3Pj0+6v9GykTkbP6/PZoj69Q+Jy8Io1rcSWPEFbWpvZ3nPvyVRCHTNRgy KN2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=Svrl+bBl; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a33-v6si15069473pld.269.2018.08.27.10.14.33; Mon, 27 Aug 2018 10:14:48 -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=fail header.i=@gmail.com header.s=20161025 header.b=Svrl+bBl; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727058AbeH0U7W (ORCPT + 99 others); Mon, 27 Aug 2018 16:59:22 -0400 Received: from mail-oi0-f65.google.com ([209.85.218.65]:41426 "EHLO mail-oi0-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726809AbeH0U7W (ORCPT ); Mon, 27 Aug 2018 16:59:22 -0400 Received: by mail-oi0-f65.google.com with SMTP id k12-v6so28586279oiw.8 for ; Mon, 27 Aug 2018 10:11:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=FOduJP7uZPkSeGmomrOzf3gRax1fjxg0ERp2igguX5Q=; b=Svrl+bBlLOuOXeRvskABqRWRLXE5s9qz64lHU4cd6RPs4BFLZsWkE30YeH/Kb0ZLYD 14fZkE7+3mu1ohZ+UFNnH4uzHZqeCIbUWDRqABrfbdeQv869L1UtFrmGBr4r/D2ILFTI 8qspBriPcUfSHIwqQQU5cwZjAPVVuf9zYLto2AWgmTka07qnILHY/44Hvd4lD20k/GlJ gALlBnyt7oXEeIk6XHwlaX0zUCYsIoyrzAXKDo/ep5Qm+zdAwKxPCHalFSh+1ujaGIm9 Kzt2DIl+Z9VKa1w36luD0CKLHIuW0calzhs3efPM1O1siuNWA3VPcS5qPjBUjSoBbTKD 5t7g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=FOduJP7uZPkSeGmomrOzf3gRax1fjxg0ERp2igguX5Q=; b=WLwoWf3pcyZiebX8snF6g6jrE3GuX7pidxx6kteb4SK/0zYXrlEDhjoXFOz2ApxBuN be6nqEs4BpUlnCnb7SL05p0YN0BG0rREEE5bsYNP/T5SCI2x7JJ2IrBz6ptAZCs2f2pY 8GyTtZ/wdJfI/c3mIMub6YI5nVkbQMxfSJjb50a4ZJhyPA5DCzupvlKVaVLbO7IKhPD1 trnr65+SEuvHjj+mCiCoUIat1nwdmmTiqV0Ykum24ivqg5LV4Bfmi4NhmnGHrWNyuYw+ fzSvB/esZVvhHsIjnxmuMT47Awegi8wAOWelX2m6CHcbbsLVJ3wgPYj0gIyjKlpbopX9 +1KQ== X-Gm-Message-State: APzg51Bh0u4yjVLRI0pT88TOLTe5mk3snT7syJZzVqhK+wLRD6YXjyOl +wbdwNkp4YpiLP4pyr5qjFK4qL+T X-Received: by 2002:aca:7513:: with SMTP id q19-v6mr12203953oic.13.1535389915235; Mon, 27 Aug 2018 10:11:55 -0700 (PDT) Received: from localhost (108-223-40-66.lightspeed.sntcca.sbcglobal.net. [108.223.40.66]) by smtp.gmail.com with ESMTPSA id m7-v6sm10029920oia.32.2018.08.27.10.11.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Aug 2018 10:11:54 -0700 (PDT) Date: Mon, 27 Aug 2018 10:11:52 -0700 From: Guenter Roeck To: Christoph Hellwig Cc: Linus Torvalds , Linux Kernel Mailing List Subject: Re: Linux 4.19-rc1 Message-ID: <20180827171152.GA2705@roeck-us.net> References: <20180827134459.GA16094@roeck-us.net> <20180827154641.GA17201@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180827154641.GA17201@infradead.org> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 27, 2018 at 08:46:41AM -0700, Christoph Hellwig wrote: > > sparc: > > > > WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 esp_sbus_probe+0x408/0x6e8 > > WARNING: CPU: 0 PID: 1 at ./include/linux/dma-mapping.h:516 sparc_lance_probe_one+0x428/0x4f > > > > Missing initialization of coherent_dma_mask in the respective drivers. > > > > --- > > Each platform driver instantiated through a devicetree node now generates > > the following warning: > > > > esp ffd38e00: DMA mask not set > > > > It isn't a traceback so it may fly under the radar. There is nothing the > > drivers can do about it; the message is generated by the core before the > > driver probe function is called. No idea what a correct fix might be. > > Both of these should probably be fixed by something like the patch > below: > > --- > From 6294e0e330851ee06e66ab85b348f1d92d375d7a Mon Sep 17 00:00:00 2001 > From: Christoph Hellwig > Date: Mon, 27 Aug 2018 17:23:24 +0200 > Subject: driver core: initialize a default DMA mask for platform device > > We still treat devices without a DMA mask as defaulting to 32-bits for > both mask, but a few releases ago we've started warning about such > cases, as they require special cases to work around this sloppyness. > Add a dma_mask field to struct platform_object so that we can initialize > the dma_mask pointer in struct device and initialize both masks to > 32-bits by default. Architectures can still override this in > arch_setup_pdev_archdata if needed. > > Note that the code looks a little odd with the various conditionals > because we have to support platform_device structures that are > statically allocated. > > Signed-off-by: Christoph Hellwig > --- > drivers/base/platform.c | 15 +++++++++++++-- > include/linux/platform_device.h | 1 + > 2 files changed, 14 insertions(+), 2 deletions(-) > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c > index dff82a3c2caa..baf4b06cf2d9 100644 > --- a/drivers/base/platform.c > +++ b/drivers/base/platform.c > @@ -225,6 +225,17 @@ struct platform_object { > char name[]; > }; > > +static void setup_pdev_archdata(struct platform_device *pdev) > +{ > + if (!pdev->dev.coherent_dma_mask) > + pdev->dev.coherent_dma_mask = DMA_BIT_MASK(32); > + if (!pdev->dma_mask) > + pdev->dma_mask = DMA_BIT_MASK(32); > + if (!pdev->dev.dma_mask) > + pdev->dev.dma_mask = &pdev->dma_mask; When building sparc32 images, this results in the following error. drivers/base/platform.c: In function 'setup_pdev_archdata': drivers/base/platform.c:235:22: error: assignment from incompatible pointer type [-Werror=incompatible-pointer-types] pdev->dev.dma_mask = &pdev->dma_mask; pdev->dev.dma_mask is u64 *, pdev->dma_mask is dma_addr_t which in turn is either u32 or u64 depending on the architecture. > +++ b/include/linux/platform_device.h > @@ -25,6 +25,7 @@ struct platform_device { > int id; > bool id_auto; > struct device dev; > + dma_addr_t dma_mask; ... so this will have to be u64, or the pointer in struct device would have to be fixed. However, even changing the definition to u64 does not help: The warnings are still reported. This is because setup_pdev_archdata() is not called for any of the affected devices. That is kind of interesting since it means that arch_setup_pdev_archdata() won't be called for those devices either. Guenter