Received: by 10.192.165.148 with SMTP id m20csp757100imm; Fri, 27 Apr 2018 07:04:48 -0700 (PDT) X-Google-Smtp-Source: AB8JxZr6pYthNcaA/VdE18UHxiQFRX7StS/PDgiJZ/s6TuYwYlXNgS7CaNE9HTeMKaN+drVKPTi7 X-Received: by 2002:a65:40c9:: with SMTP id u9-v6mr2322726pgp.142.1524837888130; Fri, 27 Apr 2018 07:04:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524837888; cv=none; d=google.com; s=arc-20160816; b=OQeuYGRGpbDoNsFiylOLiFnx7jlEabV9ExQvO7Bcv3NY3wEFJh1JVrI4fKJu9PS0kN 5WeSjU6OX2dryZn5vQ+ejjvYVk/15v8Ly8rcUpAzDk4KisCdC4wNlYeB2xIRsb1xYKys 5Mxzn04K4gsLLcWcwZDnVb6/50iOraM4HyDSZIMtNMILcP9iciEQq0usuv8Rt0OzWQnw WerQYGVSr2GDIxOGzfyU2LqQMHaw5hGvpiLvWcvCI76/qy20wY+sqH6+vM8fZPrFetkq yX05XyEQGHFUqsOznjmP/i5lTIY4TLtniOCS0ZHwOlPVnHG9ogzp6r49dPNhEGl5SrnN D5dg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:message-id:date:subject:cc:to:from:dmarc-filter :arc-authentication-results; bh=MJqeyvQkJae5OahANaNLEXKNNjC3+eQFXNvCjOFpDn4=; b=0ozU12mH37CmWD02GRPHm07EUjKzDZ6ekTYpS+iFiW3OejNpn03olz1xSu76fh22B6 m0C0iPlbXXafzpQajZePkkqUyxPxy5NkAOpxQmqfTLppBj2ctOqBXgOHONPI8A2jVCND hmtU/TvrsJkxfw+WpHydYVtkesBRDZmbZQ/+x+79eRaHxc3ebb2xSj+Cq59sanE/756a CVla33hhPit3a9CxUMnbW2eiVRujqTMDk05vplt6VEdyqqb1e73V8Ph+X3ys3Hu7AJg4 2HdfEydcSb70a+eJwkbIQB1NGc5Pxz67wjyRVAwZl5jWqs2iSvCNRYfhfzfCXl1/J694 Ka0w== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r4si1187077pff.24.2018.04.27.07.04.33; Fri, 27 Apr 2018 07:04: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; 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 S933504AbeD0ODS (ORCPT + 99 others); Fri, 27 Apr 2018 10:03:18 -0400 Received: from mail.kernel.org ([198.145.29.99]:49796 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933446AbeD0ODN (ORCPT ); Fri, 27 Apr 2018 10:03:13 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id AC5AA218A0; Fri, 27 Apr 2018 14:03:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AC5AA218A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linuxfoundation.org Authentication-Results: mail.kernel.org; spf=fail smtp.mailfrom=gregkh@linuxfoundation.org From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Merlijn Wajer , Tony Lindgren , Bin Liu Subject: [PATCH 4.9 09/74] usb: musb: call pm_runtime_{get,put}_sync before reading vbus registers Date: Fri, 27 Apr 2018 15:57:59 +0200 Message-Id: <20180427135710.281185192@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180427135709.899303463@linuxfoundation.org> References: <20180427135709.899303463@linuxfoundation.org> User-Agent: quilt/0.65 X-stable: review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 4.9-stable review patch. If anyone has any objections, please let me know. ------------------ From: Merlijn Wajer commit df6b074dbe248d8c43a82131e8fd429e401841a5 upstream. Without pm_runtime_{get,put}_sync calls in place, reading vbus status via /sys causes the following error: Unhandled fault: external abort on non-linefetch (0x1028) at 0xfa0ab060 pgd = b333e822 [fa0ab060] *pgd=48011452(bad) [] (musb_default_readb) from [] (musb_vbus_show+0x58/0xe4) [] (musb_vbus_show) from [] (dev_attr_show+0x20/0x44) [] (dev_attr_show) from [] (sysfs_kf_seq_show+0x80/0xdc) [] (sysfs_kf_seq_show) from [] (seq_read+0x250/0x448) [] (seq_read) from [] (__vfs_read+0x1c/0x118) [] (__vfs_read) from [] (vfs_read+0x90/0x144) [] (vfs_read) from [] (SyS_read+0x3c/0x74) [] (SyS_read) from [] (ret_fast_syscall+0x0/0x54) Solution was suggested by Tony Lindgren . Signed-off-by: Merlijn Wajer Acked-by: Tony Lindgren Signed-off-by: Bin Liu Signed-off-by: Greg Kroah-Hartman --- drivers/usb/musb/musb_core.c | 2 ++ 1 file changed, 2 insertions(+) --- a/drivers/usb/musb/musb_core.c +++ b/drivers/usb/musb/musb_core.c @@ -1774,6 +1774,7 @@ musb_vbus_show(struct device *dev, struc int vbus; u8 devctl; + pm_runtime_get_sync(dev); spin_lock_irqsave(&musb->lock, flags); val = musb->a_wait_bcon; vbus = musb_platform_get_vbus_status(musb); @@ -1787,6 +1788,7 @@ musb_vbus_show(struct device *dev, struc vbus = 0; } spin_unlock_irqrestore(&musb->lock, flags); + pm_runtime_put_sync(dev); return sprintf(buf, "Vbus %s, timeout %lu msec\n", vbus ? "on" : "off", val);