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=-7.0 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 3B4A6C4360F for ; Wed, 3 Apr 2019 10:05:13 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id ECE3B2147A for ; Wed, 3 Apr 2019 10:05:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Ru+NsfLX"; dkim=fail reason="signature verification failed" (1024-bit key) header.d=microchiptechnology.onmicrosoft.com header.i=@microchiptechnology.onmicrosoft.com header.b="M7x0ya0z" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org ECE3B2147A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Content-ID:In-Reply-To: References:Message-ID:Date:Subject:To:From:Reply-To:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=evaZghvnzzpLO5zcoubUndF4jfQCtSnlMpQgWKjj5m8=; b=Ru+NsfLX9OXmkT 6gLqiKon1E8sIXveuvE0uQkJCMcV+Mur1Atf0ldhLZUVkKg7d9VEkXEtHbDAyUTycp6G5XDOaQUct +gr75jemm03BrVor48mhhAgFp+PRCFJ6QVPcZmtURgj3jABYBci0dNA6XwP74fkbcz+IaIsgcuHpw w4NeAxrFuciTPurx7MVdON4SV3bJWUfbzPT7L4THZeMKvYpApzqnwAEwmEXd6qGsszEklfDOTpmc1 zoHGvOnlwQHwpMaHMrzkikI77tpKbtMnH/iDw3HWXR7mXXCCEjcCRcz0RVhEMnJzyWJTJm+vB9WGU sgi2WJNdp47EpjM5N/ww==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBclY-0000oh-Gq; Wed, 03 Apr 2019 10:05:08 +0000 Received: from esa1.microchip.iphmx.com ([68.232.147.91]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hBclU-0008QV-KI for linux-arm-kernel@lists.infradead.org; Wed, 03 Apr 2019 10:05:06 +0000 X-IronPort-AV: E=Sophos;i="5.60,304,1549954800"; d="scan'208";a="30723823" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa1.microchip.iphmx.com with ESMTP/TLS/DHE-RSA-AES256-SHA; 03 Apr 2019 03:05:02 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (10.10.215.89) by email.microchip.com (10.10.76.38) with Microsoft SMTP Server (TLS) id 14.3.352.0; Wed, 3 Apr 2019 03:05:02 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microchiptechnology.onmicrosoft.com; s=selector1-microchiptechnology-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=h4BpX9pZUZgxhoecPHl76wzUMl1IRA410YCs9pO9Cbc=; b=M7x0ya0zY1OTEYqeMSMiiN7QoGpjktNNxzlmKos+GHqFH1MXTxwhe5c2rqYFipfDZHZxf2MwlPxIZVPTniJKGFanQYbiDxSrzEPKrgnTIR6f9pPFJkE5abZvHz5xINR+8W7pqR5kmhu4J1+YdCZcERLq36AlGfRbT/A+P1hVT/Q= Received: from MWHPR11MB1662.namprd11.prod.outlook.com (10.172.55.15) by MWHPR11MB1791.namprd11.prod.outlook.com (10.175.53.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1750.20; Wed, 3 Apr 2019 10:05:00 +0000 Received: from MWHPR11MB1662.namprd11.prod.outlook.com ([fe80::65cd:b698:41:54d6]) by MWHPR11MB1662.namprd11.prod.outlook.com ([fe80::65cd:b698:41:54d6%2]) with mapi id 15.20.1750.017; Wed, 3 Apr 2019 10:05:00 +0000 From: To: Subject: Re: [PATCH 2/3] dmaengine: at_xdmac: enhance channel errors handling in tasklet Thread-Topic: [PATCH 2/3] dmaengine: at_xdmac: enhance channel errors handling in tasklet Thread-Index: AQHU6gSyTEx6kp6OEUC3zdFi9URd3Q== Date: Wed, 3 Apr 2019 10:05:00 +0000 Message-ID: <1cdc51b6-3b0b-ee17-855a-ebd3896059ba@microchip.com> References: <324b91c71a148a7694d28d9b8b4364095d9b0ebe.1549364323.git.nicolas.ferre@microchip.com> <20190211115834.GS4296@vkoul-mobl> In-Reply-To: <20190211115834.GS4296@vkoul-mobl> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0467.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:a2::23) To MWHPR11MB1662.namprd11.prod.outlook.com (2603:10b6:301:e::15) authentication-results: spf=none (sender IP is ) smtp.mailfrom=Nicolas.Ferre@microchip.com; x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [195.6.168.232] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 90fe0bfb-8ee6-4fb3-5e0a-08d6b81bd534 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600139)(711020)(4605104)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:MWHPR11MB1791; x-ms-traffictypediagnostic: MWHPR11MB1791: x-microsoft-antispam-prvs: x-forefront-prvs: 0996D1900D x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(396003)(366004)(346002)(376002)(39860400002)(199004)(189003)(31686004)(6116002)(53546011)(72206003)(446003)(5660300002)(31696002)(8676002)(6916009)(81156014)(68736007)(4326008)(81166006)(6246003)(2906002)(14454004)(6512007)(478600001)(486006)(99286004)(53936002)(105586002)(26005)(256004)(7736002)(305945005)(186003)(6486002)(14444005)(386003)(36756003)(102836004)(106356001)(6506007)(6436002)(8936002)(54906003)(229853002)(66066001)(316002)(97736004)(25786009)(71200400001)(2616005)(11346002)(52116002)(476003)(76176011)(71190400001)(3846002)(86362001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR11MB1791; H:MWHPR11MB1662.namprd11.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: microchip.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: jk8pS2TLuSV4GHvOs0eVFu3FLVM4y1TUaFEDgyqFbOsRvfr1H5xWJ0EY+SqAtp0ywtGfnh2RFWyQTVZL2k+0TW46zUw42pvLJQVmvjcG4qKQZfAEyMOFlzc0b5biKMbd2HS/iXbSzp5q0v31iMinpEa5hVDbeV+izbWRRIkeMhyao2mk7beFgnjcoSmG5zK6/Bmvluw3osBHrPyAZEwSof8OGzoQB9kZ/9HqHbq3c4heAluPOpsmKwFALPEoLAkzxUBBQmccAIplFXWL3G2uVnD5IU+oXgotf4z+ZUd+3Q3p5eTYdXx2YW8EObVkj+AimAN5V45o76VhNAjXAy8aC4CD6+Rd9HD+Wtku6IfWN9cjvd3p46aRj93LPgZ+Q4RgP1oVkZJGVQzWNI5x6jAUCHMQlDlqhOOA71qfD0ByOug= Content-ID: MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 90fe0bfb-8ee6-4fb3-5e0a-08d6b81bd534 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Apr 2019 10:05:00.3003 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 3f4057f3-b418-4d4e-ba84-d55b4e897d88 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR11MB1791 X-OriginatorOrg: microchip.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190403_030504_852041_0DF3F1B9 X-CRM114-Status: GOOD ( 18.71 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: dmaengine@vger.kernel.org, Ludovic.Desroches@microchip.com, alexandre.belloni@bootlin.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+infradead-linux-arm-kernel=archiver.kernel.org@lists.infradead.org Vinod, Thanks for your review, I'm preparing v2. On 11/02/2019 at 12:58, Vinod Koul wrote: > On 05-02-19, 12:03, Nicolas Ferre wrote: >> Complement the identification of errors with stoping the channel and >> dumping the descriptor that led to the error case. >> >> Signed-off-by: Nicolas Ferre >> --- >> drivers/dma/at_xdmac.c | 43 ++++++++++++++++++++++++++++++++++++------ >> 1 file changed, 37 insertions(+), 6 deletions(-) >> >> diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c >> index 37a269420435..ec7a29d8e448 100644 >> --- a/drivers/dma/at_xdmac.c >> +++ b/drivers/dma/at_xdmac.c >> @@ -1575,6 +1575,41 @@ static void at_xdmac_handle_cyclic(struct at_xdmac_chan *atchan) >> dmaengine_desc_get_callback_invoke(txd, NULL); >> } >> >> +static void at_xdmac_handle_error(struct at_xdmac_chan *atchan) >> +{ >> + struct at_xdmac *atxdmac = to_at_xdmac(atchan->chan.device); >> + struct at_xdmac_desc *bad_desc; >> + >> + /* >> + * The descriptor currently at the head of the active list is >> + * broked. Since we don't have any way to report errors, we'll > > You meant borked or broken... Broken > >> + * just have to scream loudly and try to carry on. > > should we carry on or abort..? Changed in: * just have to scream loudly and try to continue with other * descriptors queued (if any). >> + */ >> + if (atchan->irq_status & AT_XDMAC_CIS_RBEIS) >> + dev_err(chan2dev(&atchan->chan), "read bus error!!!"); >> + if (atchan->irq_status & AT_XDMAC_CIS_WBEIS) >> + dev_err(chan2dev(&atchan->chan), "write bus error!!!"); >> + if (atchan->irq_status & AT_XDMAC_CIS_ROIS) >> + dev_err(chan2dev(&atchan->chan), "request overflow error!!!"); >> + >> + spin_lock_bh(&atchan->lock); >> + /* Channel must be disabled first as it's not done automatically */ >> + at_xdmac_write(atxdmac, AT_XDMAC_GD, atchan->mask); >> + while (at_xdmac_read(atxdmac, AT_XDMAC_GS) & atchan->mask) >> + cpu_relax(); >> + bad_desc = list_first_entry(&atchan->xfers_list, >> + struct at_xdmac_desc, >> + xfer_node); >> + spin_unlock_bh(&atchan->lock); >> + /* Print bad descriptor's details if needed */ > > Well this is not great to look and read at, please do consider adding > empty line before comments or logical blocks.. True, indeed. >> + dev_dbg(chan2dev(&atchan->chan), >> + "%s: lld: mbr_sa=%pad, mbr_da=%pad, mbr_ubc=0x%08x\n", >> + __func__, &bad_desc->lld.mbr_sa, &bad_desc->lld.mbr_da, >> + bad_desc->lld.mbr_ubc); > > not dev_err? Well, we have the dev_err at the beginning of the function, I think it's enough: this is really debugging information that needs to be activated to track the DMA configuration bug: it's not meant for production. >> + >> + /* Then continue with usual descriptor management */ >> +} >> + >> static void at_xdmac_tasklet(unsigned long data) >> { >> struct at_xdmac_chan *atchan = (struct at_xdmac_chan *)data; >> @@ -1594,12 +1629,8 @@ static void at_xdmac_tasklet(unsigned long data) >> || (atchan->irq_status & error_mask)) { >> struct dma_async_tx_descriptor *txd; >> >> - if (atchan->irq_status & AT_XDMAC_CIS_RBEIS) >> - dev_err(chan2dev(&atchan->chan), "read bus error!!!"); >> - if (atchan->irq_status & AT_XDMAC_CIS_WBEIS) >> - dev_err(chan2dev(&atchan->chan), "write bus error!!!"); >> - if (atchan->irq_status & AT_XDMAC_CIS_ROIS) >> - dev_err(chan2dev(&atchan->chan), "request overflow error!!!"); >> + if (atchan->irq_status & error_mask) >> + at_xdmac_handle_error(atchan); >> >> spin_lock(&atchan->lock); >> desc = list_first_entry(&atchan->xfers_list, >> -- >> 2.17.1 > -- Nicolas Ferre _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel