From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 543DBC2D0BF for ; Tue, 10 Dec 2019 11:45:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 275252073D for ; Tue, 10 Dec 2019 11:45:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1575978320; bh=18nrtHIx1G6i/KI8dkiVAH8jOgkas2xP9dpgAUp5+Y8=; h=From:To:Cc:Subject:In-Reply-To:References:Date:List-ID:From; b=CRtJEHq1BIITRx8KJNq966YsgYxdjhMucwzKPgdiitbmGN288mImAngzoHK+FOxX/ Y66aMnzozIuU7sGLUVn21AdkexhMVbzDpBT5MFN3SUC9lAal5rrMarbApPC0J+EVo6 qmZ2QcFmNgrlpht40sPTN2JGokfakxScvWGUZaOo= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727486AbfLJLpT (ORCPT ); Tue, 10 Dec 2019 06:45:19 -0500 Received: from mail-lf1-f50.google.com ([209.85.167.50]:43278 "EHLO mail-lf1-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727295AbfLJLpP (ORCPT ); Tue, 10 Dec 2019 06:45:15 -0500 Received: by mail-lf1-f50.google.com with SMTP id 9so13442220lfq.10 for ; Tue, 10 Dec 2019 03:45:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:in-reply-to:references:date:message-id :mime-version; bh=O8YFI9ZrqH4e0oIKw4V/GECqRBDRWFzJ0oL1cBNncqo=; b=DloFO4NonMTCQNIdTlqsD4MRa2T8kIflQrvnrlb2JWciylyzjVkRXfqK5CjWkND65a aXel6VyhIU1PBK1qYLN0SKk8HLAC1gjovqSuwMpxa8RSfZZZHeLyTmGdE3x8lhUE4D+p 62r57zHB2gRpMdrMGa8v2GlxQcEptAge8EW2kD4Pi5KbyH4ILCY1seEJu7dPVvTCMDcs ljE1ON21heknDtglmZEJCUlKzKZyM5fH1ZZyrrZhCBMmP3CMvbRcKDmVmIze+OcWdXhq XyAWsxlkw4qz1AC1N8XLUAWahT5QPE0Dwyr/N5soW0mgzOXmDQffN6r/uVtZT3ljniA4 Foww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:in-reply-to:references :date:message-id:mime-version; bh=O8YFI9ZrqH4e0oIKw4V/GECqRBDRWFzJ0oL1cBNncqo=; b=JhLhWc66v8RBdvcyB+0GTxPlaPLAXtREs3F7lAg+CM2qH1cA3WNscne9HWF5b654sJ fFVqZrgd01bzYLOuniOiDS9cNn0UVAI1zFVan3KxksrYKxm/rJh9VahpvXYcCFT2jTnv YHaAnMF6goDmp7FDIaCsgvYjFaP/vh0S3zLE3xgk6BgXhif17Pzass58RDd2KjMvtrqQ Mh+6CI7ziVADph9EKTSXj4t09nmTthlwCfJA5Jprzuz1gBI+Hk1o9bxTLBCryCJpXl9S QqFw29ZTKkgEGNmfGs/UhUvzaQnGx/qNW7+6txhksAebcvgniyTvqrNG7tm7knvVJHpw rfnQ== X-Gm-Message-State: APjAAAXHSfjlCrc8AlQyLLAe7/pNXHSJZE1uM4vnxNMSVf91FVaQo/ho ocqNRMxppkl7bAf09XEi301D7T6MV/8= X-Google-Smtp-Source: APXvYqzX7jj7jn6vW7hHuxvhUdUanZIXJ6mhjRXRqUvAPelf1rVSzTGVpmxfQN/kfbtBbiR9LGWFHA== X-Received: by 2002:a19:f519:: with SMTP id j25mr18911046lfb.41.1575978314410; Tue, 10 Dec 2019 03:45:14 -0800 (PST) Received: from saruman (88-113-215-33.elisa-laajakaista.fi. [88.113.215.33]) by smtp.gmail.com with ESMTPSA id h18sm1596408ljk.94.2019.12.10.03.45.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2019 03:45:13 -0800 (PST) From: Felipe Balbi To: Sriharsha Allenki , gregkh@linuxfoundation.org, linux-usb@vger.kernel.org Cc: jackp@codeaurora.org, mgautam@codeaurora.org Subject: Re: [PATCH] usb: dwc3: Do not process request if HWO is set for its TRB In-Reply-To: <4c34d724-6a45-dc21-2d10-337f358015ce@codeaurora.org> References: <1574946055-3788-1-git-send-email-sallenki@codeaurora.org> <1575270714-29994-1-git-send-email-sallenki@codeaurora.org> <87tv6jch61.fsf@gmail.com> <0101016ec6294c21-99711286-dbda-4d62-b8c7-e9f28e99b261-000000@us-west-2.amazonses.com> <871rtla8xd.fsf@gmail.com> <4c34d724-6a45-dc21-2d10-337f358015ce@codeaurora.org> Date: Tue, 10 Dec 2019 13:46:04 +0200 Message-ID: <878snkl7yb.fsf@gmail.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Hi, Sriharsha Allenki writes: >>>> what problem you actually found? Preferrably with tracepoint data >>>> showing the fault. >>> Test case here involves f_fs driver in AIO mode and we see ~8 TRBs in >>> the queue with HWO set and UPDATE_XFER done. In the failure case I see >>> thatas part of processingthe interrupt generated by the core for the >>> completion of the first TRB, the driver isgoing ahead and giving >> we shouldn't get completion interrupt for the first TRB, only the >> last. Care to share tracepoint data? > > We have seen the issue only once and we do not have any tracepoint > data for it. But with the internal logging we have in our downstream code, > I see a race between dequeue from the function driver, and the giveback > as part of the completion (XferInProgress). Which other changes do you have in your downstream code? Could this problem be caused by some of the changes in your downstream tree? > A request (say Request-1) is dequeued before we could notify it's > completion to the gadget driver. Because of this, as part of handling > the completion event for the Request-1 we gaveback the next > request(Request-2) in the queue which is yet to be processed by the > core leading to the mentioned SMMU fault. I really need to see tracepoint of this happening. Every list modification happens with locks held. > Normally, the core should not process the TRBs once a request > has been dequeued because of the stop_active_transfer as part of > dequeue, but I see a timeout when issuing the end transfer command > during dequeue because of which core is still processing the TRBs > in the queue. Ok, so that's the real problem. End Transfer times out. Are you fixing the wrong thing? Please, collect trace point data with UPSTREAM kernel. You can't report a bug on a downstream kernel without reproducing it in the upstream; otherwise we will be running in circles here. -- balbi