Received: by 10.192.165.148 with SMTP id m20csp577580imm; Wed, 25 Apr 2018 04:34:44 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpV/9auEoym69o4N1/mDx6nk35Yf31ibcMK4S75JYofsZR6kJCkQz4qF+9o2Y8sb5VJaRG0 X-Received: by 10.98.205.69 with SMTP id o66mr6566269pfg.250.1524656084453; Wed, 25 Apr 2018 04:34:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524656084; cv=none; d=google.com; s=arc-20160816; b=aD0Ovkb2YbjHecc2ibFwu0B1NkU/ObgLdK4c1kUi0jV+MowCbEOGzZ4ktEZl3aA3u9 Mv9CCpCqhwBF/lb8oOBVz0nsIFA2bL/5VO5/e3tX54FPtlzqa8S0MG58Bb7O4Lu9cHAH Eet5n1k8SY9cOjmrBS7mVbq8OplqkQplDpbGmG20lLiCPR4jhMqTW3SJTUMxJI4aNYny Ryy5INlX4OrDXi8cMkS9jg7vlRf909lZRAyKs+gCB9yUgQ3axsN5T2UJtXmvhpLz/9e/ 8rchavW8I8MoAiKJlylG9fq0q8VMQF3bVd1PjoX2NjPSEvK3fx/4cXCi3C2qb4sZ8kJJ VSKQ== 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 :arc-authentication-results; bh=EL1zzEd0mN8xie/5q6uCWpytocL1ncjCrTBnEkImnHU=; b=esKJK3iwb42xqkxGfBRvTLpYTsSfkosvhlR1KwOGc8nq8QaI5+7iCieDTC6SllA6XK BZzta1+EUFVgNHcO9ifZDJ+71B3nq22ne1gRwEFgfwVVW7K4o7ZeelRE9z09s4VXRhL5 dZD/QmdYtVfELv/HF1FLfMFKeUe+qzQnhhiw8a29k3AqkV0hYYkpOH1IELjpMeUfQejf eier9yuiJyODmB9WnrVjZGO0NmPywlnGXYs/nqA1TTqrzSq8tCmTpS67pQ+OmrLqatfE hwm1ThyW0vkle9Vc0TAlycqG7I8N2ISPTrBj9f0UZ9kQfdN1GqCLw+CKgZ8LSaDy0TRK eErQ== 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 g14si8735732pgu.363.2018.04.25.04.34.30; Wed, 25 Apr 2018 04:34:44 -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 S1753489AbeDYLd3 (ORCPT + 99 others); Wed, 25 Apr 2018 07:33:29 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:51064 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752390AbeDYKhN (ORCPT ); Wed, 25 Apr 2018 06:37:13 -0400 Received: from localhost (LFbn-1-12247-202.w90-92.abo.wanadoo.fr [90.92.61.202]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id A217341C; Wed, 25 Apr 2018 10:37:12 +0000 (UTC) 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.14 013/183] usb: musb: call pm_runtime_{get,put}_sync before reading vbus registers Date: Wed, 25 Apr 2018 12:33:53 +0200 Message-Id: <20180425103243.147303287@linuxfoundation.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425103242.532713678@linuxfoundation.org> References: <20180425103242.532713678@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.14-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 @@ -1780,6 +1780,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); @@ -1793,6 +1794,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);