Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753121AbbGFH1q (ORCPT ); Mon, 6 Jul 2015 03:27:46 -0400 Received: from relmlor3.renesas.com ([210.160.252.173]:62970 "EHLO relmlie2.idc.renesas.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750931AbbGFH1m convert rfc822-to-8bit (ORCPT ); Mon, 6 Jul 2015 03:27:42 -0400 X-IronPort-AV: E=Sophos;i="5.15,413,1432566000"; d="scan'208";a="190950498" From: Yoshihiro Shimoda To: Phil Edworthy CC: Kuninori Morimoto , Greg Kroah-Hartman , Felipe Balbi , Ulrich Hecht , Kishon Vijay Abraham I , "Sergei Shtylyov" , "linux-kernel@vger.kernel.org" , "linux-usb@vger.kernel.org" , "linux-sh@vger.kernel.org" , Phil Edworthy , Laurent Pinchart Subject: RE: [PATCH v3] usb: renesas_usbhs: Allow an OTG PHY driver to provide VBUS Thread-Topic: [PATCH v3] usb: renesas_usbhs: Allow an OTG PHY driver to provide VBUS Thread-Index: AQHQtLHhu8NKxL7nLkyt+fgYIBJV153ODyXw Date: Mon, 6 Jul 2015 07:27:37 +0000 Message-ID: References: <2896957.Pcl0CbmdvL@avalon> <1435832793-9999-1-git-send-email-phil.edworthy@renesas.com> In-Reply-To: <1435832793-9999-1-git-send-email-phil.edworthy@renesas.com> Accept-Language: ja-JP, en-US Content-Language: ja-JP X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: renesas.com; dkim=none (message not signed) header.d=none; x-originating-ip: [211.11.155.144] x-microsoft-exchange-diagnostics: 1;SG2PR06MB0603;5:BjWOqdRLp7DXQWxh0VgQrTkJXL1L5j2ztlMtEQZFW9bZ4GJXuqhbAVAfZnq3Zc0K2VH1KDKYr8axtH7Fm//dq3pMXP7dyk85xx4r+A6Dw45FbEbLqh0wROzjW45Ffx8a6TKMZXx/oCZTlNBJUuibTA==;24:jlFGOIvDV1wmMxJTuLT349VGx0kaeANYNYn0Pzgwjv6PhqWGD74E3JK5Wbrlg3mCJLyDcP9QXz5XyYJHLxe7teyFCukMAWjUpd/GEION8ws=;20:yi1CEu8hKkGpYsvhc13wTBt36gzzNRj7jRN+VK/vB4R5LpE6TPH+WV0bkE4i98+nw8LZhznnMxj+vodQuQvdY68aHExMcQFI1oelbeS2J3Wql1H3E71SLDITY2/rGf+ueLsPd3xT8ItEoYm2Cb3BNk36KuzRHJyRhpbvf2UqTrw= x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0603; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:; x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:SG2PR06MB0603;BCL:0;PCL:0;RULEID:;SRVR:SG2PR06MB0603; x-forefront-prvs: 06290ECA9D x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(377454003)(51704005)(92566002)(66066001)(74316001)(46102003)(77096005)(2656002)(76176999)(87936001)(54356999)(575784001)(86362001)(2900100001)(102836002)(50986999)(2950100001)(19580405001)(19580395003)(106116001)(33656002)(77156002)(5003600100002)(189998001)(62966003)(110136002)(122556002)(5001960100002)(76576001)(5002640100001)(40100003)(217873001)(4001450100001);DIR:OUT;SFP:1102;SCL:1;SRVR:SG2PR06MB0603;H:SG2PR06MB0919.apcprd06.prod.outlook.com;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:23 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-OriginatorOrg: renesas.com X-MS-Exchange-CrossTenant-originalarrivaltime: 06 Jul 2015 07:27:37.5739 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 53d82571-da19-47e4-9cb4-625a166a4a2a X-MS-Exchange-Transport-CrossTenantHeadersStamped: SG2PR06MB0603 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4541 Lines: 92 Hi Phil-san, > Sent: Thursday, July 02, 2015 7:27 PM > > These changes allow a PHY driver to trigger a VBUS interrupt and > to provide the value of VBUS. > > Signed-off-by: Phil Edworthy Thank you for the patch! However, if I tested this patch, a kernel panic happened when I did "rmmod g_mass_storage" on koelsch: root@192:~/usb# rmmod g_mass_storage Unable to handle kernel NULL pointer dereference at virtual address 00000004 pgd = eebd4bc0 [00000004] *pgd=00000000 Internal error: Oops: 205 [#1] SMP ARM Modules linked in: g_mass_storage(-) usb_f_mass_storage libcomposite CPU: 0 PID: 2496 Comm: rmmod Not tainted 4.1.0-dirty #32 Hardware name: Generic R8A7791 (Flattened Device Tree) task: eeb64ac0 ti: ee022000 task.ti: ee022000 PC is at usbhs_pkt_pop+0x1c/0x100 LR is at usbhsg_ep_dequeue+0x28/0x40 pc : [] lr : [] psr: 20000013 sp : ee023e70 ip : ee023e98 fp : ee023e94 r10: 00000000 r9 : ee022000 r8 : c00101e4 r7 : 00200200 r6 : 00100100 r5 : 00000000 r4 : eeb917f8 r3 : c036e33c r2 : 00000041 r1 : eeb917f8 r0 : 00000000 Flags: nzCv IRQs on FIQs on Mode SVC_32 ISA ARM Segment user Control: 30c5307d Table: 6ebd4bc0 DAC: fffffffd Process rmmod (pid: 2496, stack limit = 0xee022210) Stack: (0xee023e70 to 0xee024000) 3e60: ee1b1400 eeb917c0 00100100 00200200 3e80: c00101e4 ee022000 ee023eac ee023e98 c036e364 c036d924 eeb34180 eeb341c0 3ea0: ee023ecc ee023eb0 bf002f20 c036e348 eeb34180 00000001 ee1b1800 eeb341b8 3ec0: ee023eec ee023ed0 bf002fec bf002e5c ee181600 bf01d624 bed3ff0d 00000081 3ee0: ee023efc ee023ef0 bf003028 bf002f78 ee023f14 ee023f00 c036fb88 bf003018 3f00: ee181600 bf01d624 ee023f2c ee023f18 c036fc10 c036fb34 bf01d694 7f64cd30 3f20: ee023f3c ee023f30 bf0013d0 c036fbbc ee023f4c ee023f40 bf01d26c bf0013c0 3f40: ee023fa4 ee023f50 c0090bd8 bf01d248 ee023f6c 616d5f67 735f7373 61726f74 3f60: 00006567 ee023f70 c00460f4 c052a8c0 c00101e4 ee022010 ee023fb0 ee022000 3f80: ee023fac ee023f90 c00136c4 00046038 00000001 7f64cd00 00000000 ee023fa8 3fa0: c0010040 c0090adc 00000001 7f64cd00 7f64cd30 00000800 ccd5c100 ccd5c100 3fc0: 00000001 7f64cd00 bed3ff0d 00000081 7f64c008 00000000 00000002 00000800 3fe0: bed3fe0c bed3fb98 b6eeb068 b6e4f05c 60000010 7f64cd30 00000000 00000000 Backtrace: [] (usbhs_pkt_pop) from [] (usbhsg_ep_dequeue+0x28/0x40) r9:ee022000 r8:c00101e4 r7:00200200 r6:00100100 r5:eeb917c0 r4:ee1b1400 [] (usbhsg_ep_dequeue) from [] (composite_dev_cleanup+0xd0/0x11c [libcomposite]) r5:eeb341c0 r4:eeb34180 [] (composite_dev_cleanup [libcomposite]) from [] (__composite_unbind+0x80/0xa0 [libcomposite]) r7:eeb341b8 r6:ee1b1800 r5:00000001 r4:eeb34180 [] (__composite_unbind [libcomposite]) from [] (composite_unbind+0x1c/0x20 [libcomposite]) r7:00000081 r6:bed3ff0d r5:bf01d624 r4:ee181600 [] (composite_unbind [libcomposite]) from [] (usb_gadget_remove_driver+0x60/0x88) [] (usb_gadget_remove_driver) from [] (usb_gadget_unregister_driver+0x60/0xa0) r5:bf01d624 r4:ee181600 [] (usb_gadget_unregister_driver) from [] (usb_composite_unregister+0x1c/0x20 [libcomposite]) r5:7f64cd30 r4:bf01d694 [] (usb_composite_unregister [libcomposite]) from [] (msg_cleanup+0x30/0x3c [g_mass_storage]) [] (msg_cleanup [g_mass_storage]) from [] (SyS_delete_module+0x108/0x1c4) [] (SyS_delete_module) from [] (ret_fast_syscall+0x0/0x3c) r5:7f64cd00 r4:00000001 Code: e52de004 e8bd4000 e1a05000 e1a04001 (e5907004) ---[ end trace 8152e492b3f02f66 ]--- I don't know why this kernel panic happened after I applied this patch. But, if I added the following code in the mod_gadget.c, this issue disappeared: @@ -682,7 +684,8 @@ static int usbhsg_ep_dequeue(struct usb_ep *ep, struct usb_r struct usbhsg_request *ureq = usbhsg_req_to_ureq(req); struct usbhs_pipe *pipe = usbhsg_uep_to_pipe(uep); - usbhs_pkt_pop(pipe, usbhsg_ureq_to_pkt(ureq)); + if (pipe) + usbhs_pkt_pop(pipe, usbhsg_ureq_to_pkt(ureq)); usbhsg_queue_pop(uep, ureq, -ECONNRESET); return 0; Best regards, Yoshihiro Shimoda -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/