From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S938945AbcIERYU (ORCPT ); Mon, 5 Sep 2016 13:24:20 -0400 Received: from mail.pqgruber.com ([178.189.19.235]:50293 "EHLO mail.pqgruber.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934010AbcIERYQ (ORCPT ); Mon, 5 Sep 2016 13:24:16 -0400 Date: Mon, 5 Sep 2016 19:24:05 +0200 From: Clemens Gruber To: Peter Chen Cc: linux-usb@vger.kernel.org, Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: chipidea: udc: kernel panic in isr_setup_status_phase Message-ID: <20160905172405.GA2114@archie.localdomain> References: <20160823003630.GA3052@archie.localdomain> <20160824081102.GA27233@shlinux2> <20160825234740.GA12850@archie.localdomain> <20160826172151.GA21360@b29397-desktop> <20160828181502.GA7785@archie.localdomain> <20160829102402.GA3736@b29397-desktop> <20160830172045.GA2634@archie.localdomain> <20160902015552.GE11262@shlinux2> <20160902164243.GA4549@archie.localdomain> <20160905031022.GC24593@b29397-desktop> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160905031022.GC24593@b29397-desktop> User-Agent: Mutt/1.7.0 (2016-08-17) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Sep 05, 2016 at 11:10:22AM +0800, Peter Chen wrote: > How about below, it will set halt for device, and host will get stall > from the device. > > diff --git a/drivers/usb/chipidea/udc.c b/drivers/usb/chipidea/udc.c > index 0f692fc..3c46ccb 100644 > --- a/drivers/usb/chipidea/udc.c > +++ b/drivers/usb/chipidea/udc.c > @@ -946,6 +946,11 @@ static int isr_setup_status_phase(struct ci_hdrc *ci) > int retval; > struct ci_hw_ep *hwep; > > + if (!ci->status) { > + WARN_ON(1); > + return -EPIPE; > + } > + > hwep = (ci->ep0_dir == TX) ? ci->ep0out : ci->ep0in; > ci->status->context = ci; > ci->status->complete = isr_setup_status_complete; > Returning -EPIPE works! I would however suggest to only warn once, as this otherwise floods the kernel log. I'll send a patch shortly, also adding a comment for people experiencing a similar hardware problem. Thank you very much for your help, Peter! Regards, Clemens