Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp21740pxb; Fri, 15 Jan 2021 04:55:57 -0800 (PST) X-Google-Smtp-Source: ABdhPJwx7vE5A3WsxGnvnJet5PCqbnd0Kd0VUACLCynvmJIB1FfysVanCPmhVNDhYfvv38HbMapO X-Received: by 2002:a17:906:351a:: with SMTP id r26mr8317895eja.409.1610715357695; Fri, 15 Jan 2021 04:55:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610715357; cv=none; d=google.com; s=arc-20160816; b=nzvmjkRzl/4cZ7apd8EcYXf9VobfmJKQ+MZpd8vgUCiutV9+SF23exT0MJ96saQD34 g9B4mLiqBWp1kke3E17WFVoeV72s51KC5h6LM3ushFwnSBwKZoT/L0FGQWpQWydRC2GC 59Os/zR6VanahlCrh1k3iuXZefefeV/u6bo8osAuqscVCDiSUZPSli+SRt044nsHSnpD vWDY6RQqclOF7pt0CSwFQy44opFdy5jYorNxiFu+wIqhxM+IXLuhQ/QWqjOMB0vnHmYq KtbLQYfjWpfRV6onissOJ6XPpzXWI8INWLlL21aGek0uR143yvHfdtVjUMNb/yqXN09l Bo5g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=DR8zQQi/0oohEE7jpsHDqS/kldffHFm762z4qrHsBYU=; b=FdY0H/4oQeeiIB+mM9eea7QOG6SnhQgR0JP2Ew8iyWCD1YWHqeL9d/xmh9iVBSXu5x YuTY0beTZ1MPrnN9xaKszBDxAkrSlYPXA3ppilaDFqdo8thWFFdd37pCLswmCecmi8wU Hfhgso+3PUAQaQxvkkwpzIzAzppHRIpa8KXFQLJE+UDIMNWvSiF282DbAwCvqNB2VYvl YwfH5zuCGUA8Vm5qvauLWCUAhnOkmFiHipBlylGNjoxvSWbrxW9i0GbWM8JVouRTVJGj Za7l8lAUh6hgFGbDwt7RhTxlV+FTC8QfjLGa4bMjqTAYXHflHggq0VnbsEeZozohhPRG gZBQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kYHRTL06; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 88si3803449ede.335.2021.01.15.04.55.34; Fri, 15 Jan 2021 04:55:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=kYHRTL06; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387655AbhAOMfZ (ORCPT + 99 others); Fri, 15 Jan 2021 07:35:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:42222 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387621AbhAOMfM (ORCPT ); Fri, 15 Jan 2021 07:35:12 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id AF363221FA; Fri, 15 Jan 2021 12:34:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610714072; bh=BBgb+EzVSy9WxI43W5rBRkyiuIU4rJHI/+N66qL+4ok=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=kYHRTL068B1VsyEKd5pJgTzf9omaFEMJUygAyxhI0Lzn/ycZTaSD/BXExZNp8AzKi NttdW4gLY+4lg8ZsyGN8dMY4c651TVkvBPEyeD1gImnud0Hpu41AteUUqLu4aWGry7 PKyp3sqKIbgcQ/YACqdTppfqCFcEeYSqy/QrBRB8= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Ulf Hansson , Andreas Kemnade , Tony Lindgren Subject: [PATCH 5.4 33/62] ARM: OMAP2+: omap_device: fix idling of devices during probe Date: Fri, 15 Jan 2021 13:27:55 +0100 Message-Id: <20210115122000.001600417@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121958.391610178@linuxfoundation.org> References: <20210115121958.391610178@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Andreas Kemnade commit ec76c2eea903947202098090bbe07a739b5246e9 upstream. On the GTA04A5 od->_driver_status was not set to BUS_NOTIFY_BIND_DRIVER during probe of the second mmc used for wifi. Therefore omap_device_late_idle idled the device during probing causing oopses when accessing the registers. It was not set because od->_state was set to OMAP_DEVICE_STATE_IDLE in the notifier callback. Therefore set od->_driver_status also in that case. This came apparent after commit 21b2cec61c04 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4") causing this oops: omap_hsmmc 480b4000.mmc: omap_device_late_idle: enabled but no driver. Idling 8<--- cut here --- Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0b402c ... (omap_hsmmc_set_bus_width) from [] (omap_hsmmc_set_ios+0x11c/0x258) (omap_hsmmc_set_ios) from [] (mmc_power_up.part.8+0x3c/0xd0) (mmc_power_up.part.8) from [] (mmc_start_host+0x88/0x9c) (mmc_start_host) from [] (mmc_add_host+0x58/0x84) (mmc_add_host) from [] (omap_hsmmc_probe+0x5fc/0x8c0) (omap_hsmmc_probe) from [] (platform_drv_probe+0x48/0x98) (platform_drv_probe) from [] (really_probe+0x1dc/0x3b4) Fixes: 04abaf07f6d5 ("ARM: OMAP2+: omap_device: Sync omap_device and pm_runtime after probe defer") Fixes: 21b2cec61c04 ("mmc: Set PROBE_PREFER_ASYNCHRONOUS for drivers that existed in v4.4") Acked-by: Ulf Hansson Signed-off-by: Andreas Kemnade [tony@atomide.com: left out extra parens, trimmed description stack trace] Signed-off-by: Tony Lindgren Signed-off-by: Greg Kroah-Hartman --- arch/arm/mach-omap2/omap_device.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) --- a/arch/arm/mach-omap2/omap_device.c +++ b/arch/arm/mach-omap2/omap_device.c @@ -234,10 +234,12 @@ static int _omap_device_notifier_call(st break; case BUS_NOTIFY_BIND_DRIVER: od = to_omap_device(pdev); - if (od && (od->_state == OMAP_DEVICE_STATE_ENABLED) && - pm_runtime_status_suspended(dev)) { + if (od) { od->_driver_status = BUS_NOTIFY_BIND_DRIVER; - pm_runtime_set_active(dev); + if (od->_state == OMAP_DEVICE_STATE_ENABLED && + pm_runtime_status_suspended(dev)) { + pm_runtime_set_active(dev); + } } break; case BUS_NOTIFY_ADD_DEVICE: