Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1111698imu; Mon, 5 Nov 2018 14:08:38 -0800 (PST) X-Google-Smtp-Source: AJdET5cCF1jvo7f899rR7kR1CdkLoUQWITD/uepHQciQmKM96qgwcN9GadA6ZBHZFBmuYwQw70Wo X-Received: by 2002:a63:7c13:: with SMTP id x19mr21353779pgc.45.1541455718292; Mon, 05 Nov 2018 14:08:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541455718; cv=none; d=google.com; s=arc-20160816; b=P4KVMGgkA1HnrkWLoLP9aqglp39AsPC62Dj1wg28YOW+n1oEX1AdwRaEmbhYMRW74K vDWkQ+kNWeIBUJZW8NMKXiKHHjtoeGblkm79Khl/zUPS0Qn87l0UtSbmeMKQFOV3UxHU Sr8/JEj5Q+piyQEF6RL6HvezZgjj/4YS70b0waZXO3yjTwIJxcuUkHddLg3x3HwiTHD2 paYne6wYT/k9qr+4hELC+AF3mSsN6UxkP6So4pninyQzFBKWzA+0JNXkPTXrjju8uDzs C0YXEGk0tRvNcynAQv7HZyEgvA5+p4pUI20qn5j6bBAjbt7Pf7el2ppLSQ1UVgWeAVgy NS2w== 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:to :from:date; bh=yRSFwgRy8QVJyXATT4cVu1NFWVM2Fu/FAztHJW8+4+k=; b=QQm+0nI1ur/mU+ERtrOJD6ZWcoCc4davFyGcshmPbJI9ep+/meCPUN2ANk3aHVDrYR 1d3szBSwat98RVteUnAE4ya3W0BdAHa4DZ11Er6DGpFC/ZumN5bSH6ttIO/NKSHdUytR iXl7qDmseXdYDYB0wOkprfdcxJuHXVHA1vCcsRAQQn1qKpg0NHnEotqgVVfBeeHDRvb5 BQ3qKGNuL7+sloGyckfCpb5OM3oo0FbGQ2zQKI8ua/cgKjZC8dhWuniObupWhxhRl5Ny xr8bJvm0/gLQ2APvSEpkCcwd03eIlwvL0PF+UU++5KeU/HaxBdsgsNWaStAK+Y7o/oIO r5iQ== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j28si11871020pgm.160.2018.11.05.14.08.22; Mon, 05 Nov 2018 14:08:38 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=iki.fi Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388123AbeKFH2Z (ORCPT + 99 others); Tue, 6 Nov 2018 02:28:25 -0500 Received: from emh03.mail.saunalahti.fi ([62.142.5.109]:36772 "EHLO emh03.mail.saunalahti.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387441AbeKFH2Y (ORCPT ); Tue, 6 Nov 2018 02:28:24 -0500 Received: from darkstar.musicnaut.iki.fi (85-76-96-200-nat.elisa-mobile.fi [85.76.96.200]) by emh03.mail.saunalahti.fi (Postfix) with ESMTP id 958314009A; Tue, 6 Nov 2018 00:06:32 +0200 (EET) Date: Tue, 6 Nov 2018 00:06:32 +0200 From: Aaro Koskinen To: Robin Murphy , Christoph Hellwig , Rob Herring , Paul Burton , linux-mips@linux-mips.org, linux-kernel@vger.kernel.org Subject: Re: [REGRESSION] OCTEON MMC driver failure with v4.19 Message-ID: <20181105220632.GA5083@darkstar.musicnaut.iki.fi> References: <20181026205423.GD3792@darkstar.musicnaut.iki.fi> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181026205423.GD3792@darkstar.musicnaut.iki.fi> 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 Hi, On Fri, Oct 26, 2018 at 11:54:23PM +0300, Aaro Koskinen wrote: > OCTEON (MIPS64) MMC driver probe fails with v4.19, because with > > commit 6c2fb2ea76361da9b420a8e23a2a19e7842cbdda > Author: Robin Murphy > Date: Mon Jul 23 23:16:09 2018 +0100 > > of/device: Set bus DMA mask as appropriate > > we now get a default 32-bit bus DMA mask, and the device itself has > 64-bit mask, so it gets rejected. > > With the current mainline, the driver is again working (probably > because of b4ebe6063204 ("dma-direct: implement complete bus_dma_mask > handling")). But I think this is just because I happen to have < 4 GB RAM, > and it probably could still fail on bigger systems..? With the below change, the MMC card probe seems to with v4.19. But it feels a bit hackish, don't you think... Is there some obvious simple fix that I'm missing? Any comments? diff --git a/arch/mips/cavium-octeon/octeon-platform.c b/arch/mips/cavium-octeon/octeon-platform.c index 807cadaf554e..31fab09fadcc 100644 --- a/arch/mips/cavium-octeon/octeon-platform.c +++ b/arch/mips/cavium-octeon/octeon-platform.c @@ -1067,8 +1067,29 @@ int __init octeon_prune_device_tree(void) return 0; } +static int octeon_device_notifier_call(struct notifier_block *nb, + unsigned long event, void *dev) +{ + struct platform_device *pdev = to_platform_device(dev); + + if (event != BUS_NOTIFY_ADD_DEVICE || + !pdev || !pdev->dev.dma_mask || !pdev->dev.of_node) + return NOTIFY_DONE; + + if (of_device_is_compatible(pdev->dev.of_node, + "cavium,octeon-6130-mmc")) + *pdev->dev.dma_mask = DMA_BIT_MASK(64); + + return NOTIFY_DONE; +} + +static struct notifier_block platform_nb = { + .notifier_call = octeon_device_notifier_call, +}; + static int __init octeon_publish_devices(void) { + bus_register_notifier(&platform_bus_type, &platform_nb); return of_platform_populate(NULL, octeon_ids, NULL, NULL); } arch_initcall(octeon_publish_devices); A.