Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp2686670ybl; Sun, 26 Jan 2020 08:23:33 -0800 (PST) X-Google-Smtp-Source: APXvYqyqBJFJRnLTghJ2sLoFvMoThQpjmvtAf4RXw0fd0pGyNP2JeNQhxzfGys0vzDiEbBuHI0/T X-Received: by 2002:aca:fcc1:: with SMTP id a184mr3745462oii.36.1580055813720; Sun, 26 Jan 2020 08:23:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580055813; cv=none; d=google.com; s=arc-20160816; b=eESPGOPsARSrHdb1Na9Ud0jjDfnozKHb1pwBzWDG4swm4lGn5V576uWRTanGeycJnY /VUIhlEnxiJIlTLR/2xUdSCPplhQr8EYdxij6hzmPPE4w7G0L7cHnxoI05NR2oR5Mosf BG6pTVGGvjeX7wQMo1Ny06nxsgHdYm1AtRMddsJBWtppw05zk7nL6XtrwPnIFaZAOG8t /sd4hx1FzKZmKSUc1abpUhsKRuiK7u4DDdd3C2wdzv8oSfsUAB47dOOEA0HnI9wB8z8n iP7AYdgF/u5DCxyXot8DMub7vziom7KCzbuTbtqFSyi5j3hUstXrrjOhJCMXZ95hB+bY 7bIg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=SSoCxVxTvJ3+BG/+7RdM+OaaCR5Y6NvxbnDQ/j00v0k=; b=Rojb4CpIh2LrobHr8OZA1jj8yBKvqKA494U8O2k21Hl6rYrjQ18TTpbjpK6JDVHdvZ Dhlq86ByQ6yn5fUwwiWbMcr1nkAQj3BwcLuuspLZQz9KKIP0KWo+ZOYvtWssQBCcALWt Zs7c+Eq9zsf0b1+8xGVjSeKVvXLakr2sEHf3fxzLN5jqH1M1KKiP3r0QhRsPFB6sNx2N YqvbbNDrZo2l/NSIBo4q03kqD4BdgPFvLqj89cCh/Bn7dARC4FnydBqbsH9Jti89p2T3 RYoCbnGQllWlFiSPdlzJbCbYAv8Qb5L6b+49E3BS+C/9to8p0d87Viu+0WIaU3+rwpc9 j8sQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=wXsKsK20; 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 u23si2033362otj.242.2020.01.26.08.23.21; Sun, 26 Jan 2020 08:23:33 -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; dkim=pass header.i=@kernel.org header.s=default header.b=wXsKsK20; 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 S1727285AbgAZQSS (ORCPT + 99 others); Sun, 26 Jan 2020 11:18:18 -0500 Received: from mail.kernel.org ([198.145.29.99]:36462 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725838AbgAZQSS (ORCPT ); Sun, 26 Jan 2020 11:18:18 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (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 4084B2071A; Sun, 26 Jan 2020 16:18:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580055496; bh=mNmzdpdlN+DRC9Hv252ix7aTt4qzHeJuRD6QcUsDtBo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=wXsKsK20OWJ+IVPj6XWepgXw1TEJFaXaMhmVCeNtxFXU1QywMkFnlTMGCLHIRLOe6 5KcdjbdIGAa01QUgBOkKkq7Rv/60/tidUtcFZ0vPLcROoCyO9yeL3wHbEFauLbDpIw DQOEBnJ4SjsAnG0ka93XA2CN3rWjH9JymgXa50AM= Date: Sun, 26 Jan 2020 17:18:12 +0100 From: Greg KH To: Saurav Girepunje Cc: b-liu@ti.com, linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, saurav.girepunje@hotmail.com Subject: Re: [PATCH] usb: musb: Fix external abort on non-linefetch Message-ID: <20200126161812.GA4085985@kroah.com> References: <20200126161156.GA20401@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200126161156.GA20401@google.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Jan 26, 2020 at 09:41:56PM +0530, Saurav Girepunje wrote: > While accessing the usb mode/vbus from sysfs. Below error came on kernel > version 4.19. > > On latest kernel vserion api name changed. Therefore API > name and backtrace API names are different. > > [ 821.908066] Backtrace: > [ 821.910695] [] (musb_default_readl [musb_hdrc]) from [] (dsps_musb_set_mode+0x38/0x12c [musb_dsps]) > [ 821.922059] [] (dsps_musb_set_mode [musb_dsps]) from [] (musb_mode_store+0xc8/0x12c [musb_hdrc]) > [ 821.933105] r7:a0010013 r6:0000000b r5:cd79d200 r4:cb634010 > [ 821.939096] [] (musb_mode_store [musb_hdrc]) from [] (dev_attr_store+0x20/0x2c) > [ 821.948593] r7:cd79d200 r6:c5abbf78 r5:00000000 r4:bf0788d4 > [ 821.954549] [] (dev_attr_store) from [] (sysfs_kf_write+0x48/0x4c) > [ 821.962859] r5:00000000 r4:c0425164 > [ 821.966620] [] (sysfs_kf_write) from [] (kernfs_fop_write+0xfc/0x1fc) > [ 821.975200] r5:00000000 r4:cd79d080 > [ 821.978966] [] (kernfs_fop_write) from [] (__vfs_write+0x34/0x120) > [ 821.987280] r10:00000000 r9:0000000b r8:00000000 r7:0000000b r6:c5abbf78 r5:c0285178 > [ 821.995493] r4:cb67a3c0 > [ 821.998160] [] (__vfs_write) from [] (vfs_write+0xa8/0x170) > [ 822.005835] r9:0000000b r8:00000000 r7:c5abbf78 r6:000def80 r5:cb67a3c0 r4:0000000b > [ 822.013969] [] (vfs_write) from [] (SyS_write+0x44/0x98) > [ 822.021371] r9:0000000b r8:000def80 r7:00000000 r6:00000000 r5:cb67a3c0 r4:cb67a3c0 > [ 822.029517] [] (SyS_write) from [] (ret_fast_syscall+0x0/0x3c) > [ 822.037467] r9:c5aba000 r8:c010daa8 r7:00000004 r6:b6f0ad58 r5:000def80 r4:0000000b > [ 822.045599] Code: e1a0c00d e92dd800 e24cb004 e0801001 (e5910000) > > Without pm_runtime_{get,put}_sync calls in place, > Similar issue come on "mode_show" and "vbus_store" also. > > fix- call pm_runtime_{get,put}_sync before reading/writing > usb mode/vbus from sysfs. > > Signed-off-by: Saurav Girepunje > --- > drivers/usb/musb/musb_core.c | 6 ++++++ > 1 file changed, 6 insertions(+) > > diff --git a/drivers/usb/musb/musb_core.c b/drivers/usb/musb/musb_core.c > index 5ebf30b..a1ca8380 100644 > --- a/drivers/usb/musb/musb_core.c > +++ b/drivers/usb/musb/musb_core.c > @@ -1723,9 +1723,11 @@ int musb_mailbox(enum musb_vbus_id_status status) > unsigned long flags; > int ret; > + pm_runtime_get_sync(dev); > spin_lock_irqsave(&musb->lock, flags); > ret = sprintf(buf, "%s\n", usb_otg_state_string(musb->xceiv->otg->state)); > spin_unlock_irqrestore(&musb->lock, flags); > + pm_runtime_put_sync(dev); > return ret; > } Always run checkpatch.pl on patches so that you do not get grumpy maintainers telling you to run checkpatch.pl on your patch :( (hint, you need a new line after the variable definitions...) greg k-h