Received: by 2002:a05:6a10:2785:0:0:0:0 with SMTP id ia5csp31065pxb; Fri, 15 Jan 2021 05:09:00 -0800 (PST) X-Google-Smtp-Source: ABdhPJwjEd0ZEZo9p1ROM5bLvGoFb89JtzC3SpfeOMUW2lEMR39inoXAOJQD8ht1Ygsx5ZAGHKzP X-Received: by 2002:a05:6402:1d0f:: with SMTP id dg15mr9413703edb.1.1610716139848; Fri, 15 Jan 2021 05:08:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610716139; cv=none; d=google.com; s=arc-20160816; b=vBsaXLU/44EZWj6WTMJZtY5unJYJeKQ+JWbjc8T0zoOgEzzhzCObt1sr50cP+Pk8HB jS+QuPMuyyZjXrGxBabYZIkQVEvYBSWpVRYbDGY9kLgTvqxLM/OMp35WSTaN5pZ9l9Oi wlgu1y/E7MsDCHkrxel5s92eJvoiSr72zn4qeoSJu1bBMvF+I5vBnpiWHUagzWN1jIic UpK15eabZ7RYtoO397zdWKUb48GLSRXX3QmMuZ4/Do9HM6haWONf5zMizqxRYmr7a4yL PuWY8YL7/QGRDEIQbziARpQLM0sb0anJuKSAC0wbTRtjYIOMoEA0ZEnDp/Bws6gVxZjF kskA== 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=sJpc+3WDODgDpkKBSSv0iyBZCbKvXFk4PXOrvj0CkPY=; b=P1qp87Ly9LPcTyEdSfxLhXS+yuqTKz/rUYc4+g9nNsnAltcpdgM3BXspZOnH4uPUn4 z/WiXVdp4xAiCMRhrr7VwJ49UjpPZffdIdbNPaVu4+osg91UuzFXexwrxy3vi1/u2PhR bByq1rwvhMobib8h3hvwe19+riX2Uk302IMgZHh8RluzFNTYnlxUibxxWznMjmxO/BRj 3wSsfiGQcEMkHIs6ES5PXvF6rvxwesu6QAOjSANu22y7nPhOUnHh+WALE5a/X21+MBCF DSAARtk6qEId5TA0gFDH3XEsvNolgfkHnW3wQssVsJ66fP6LPXac6+04HErJmHMUaxF4 4laA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="XFsXr/BT"; 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 g4si4177265edn.483.2021.01.15.05.08.35; Fri, 15 Jan 2021 05:08:59 -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="XFsXr/BT"; 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 S1732643AbhAONF3 (ORCPT + 99 others); Fri, 15 Jan 2021 08:05:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:36414 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732660AbhAOMbb (ORCPT ); Fri, 15 Jan 2021 07:31:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id A7DAB235F9; Fri, 15 Jan 2021 12:31:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1610713868; bh=eLxc/JivcVOfxYy1bCgsF9Ag5XJf1/dejhZPv7KCAeE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=XFsXr/BTZdKIzNkGjOymAUWg9/8gaXwGNkqB1tjyN2uC5sU7RgR6i9zHe938uNrMc tzZ3n6N/cYt/Jqot8Pyio54qMlVr/mN4655TveL5h6RGxtjizl4uHBPcbCvC1ZmIAg +vPXu4+5jNzJDeGGQqhjWlBVK00pqCFu/wCgHbrQ= 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 4.14 14/28] ARM: OMAP2+: omap_device: fix idling of devices during probe Date: Fri, 15 Jan 2021 13:27:51 +0100 Message-Id: <20210115121957.466324353@linuxfoundation.org> X-Mailer: git-send-email 2.30.0 In-Reply-To: <20210115121956.731354372@linuxfoundation.org> References: <20210115121956.731354372@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 @@ -224,10 +224,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: