Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7522417ybi; Mon, 8 Jul 2019 23:37:38 -0700 (PDT) X-Google-Smtp-Source: APXvYqwgmunADJvgpdmMtlJ2UV7L4GoRaY1/v0zQSosu2WPEHGQGAS34sGKHxNt12j0aBFMG0s49 X-Received: by 2002:a63:3387:: with SMTP id z129mr28299822pgz.177.1562654258498; Mon, 08 Jul 2019 23:37:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562654258; cv=none; d=google.com; s=arc-20160816; b=0Ylrm6dURhaIFbbVQxzvjhtwluS2kQGUdqMnu/QQm1b7gDuarl5fHKFspTeJ0T6C4s TpElL0Xzngwvb79B/mJ3usVrCCqJ0vYDq/5WcYwdeaNtwcprQyNA9E0gWP3MiDzwcCOA 4p1EAcj4r6rlMHytJwlOz/69sVIdMGVn+cIlYzrS0mVfcR+eQmAW3oP14R0bbNvQ3v5u mwa4fqtLgkLfjivRqLBB28HKhZIEQHJIerSC6xESjubnfOtRxsyWfoiEM0JXyKfP4EW5 qbJdbp+h1mgDXdop0YiMXg50aQHpHm4erDfFx2Hp9Z+dcxPmFHCz8LLXrAx9BOguWM62 Seaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:references :in-reply-to:subject:cc:to:from; bh=q+qtew2LLA/asbUnkapeNKrZvZfCfPBeFQq8Dfavf08=; b=VUUGbv5xmrjarudzxuhbAuOV1rVwfuS3yZSfabIUlrx1XmHRIHGBhd19FawMLb13rG tzvCDFzqmvYcHuTUA2FGPA6ML5IsgzDqcTY5wVHmDYOIa/qyZqZuiq4Yyod641X4ZzX+ UWtPcqEUwMWNQ/f5hFdALV2pqCJd0ORLKA8Uf9BNY/5ad88FgtEhKBoWIfnafuZCtmsu myzMnv2Meny3C4dX8zPCf6/rn5PhQgcvR91i36839bfaP+5sUBCzKrnS7XZvwqfz9tVK liglyxGG1+gMkeW11+lODjXJn0gP7FvOATi5BSGNO3FTZ/fqAqJNvmzdwR6qhw1IIMYp DoGA== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t10si20590355pgv.139.2019.07.08.23.37.23; Mon, 08 Jul 2019 23:37:38 -0700 (PDT) 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; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726165AbfGIGhC (ORCPT + 99 others); Tue, 9 Jul 2019 02:37:02 -0400 Received: from mga12.intel.com ([192.55.52.136]:22628 "EHLO mga12.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725951AbfGIGhC (ORCPT ); Tue, 9 Jul 2019 02:37:02 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by fmsmga106.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 08 Jul 2019 23:37:01 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,469,1557212400"; d="scan'208";a="165673567" Received: from pipin.fi.intel.com (HELO pipin) ([10.237.72.175]) by fmsmga008.fm.intel.com with ESMTP; 08 Jul 2019 23:36:57 -0700 From: Felipe Balbi To: Pawel Laszczak , "devicetree\@vger.kernel.org" Cc: "gregkh\@linuxfoundation.org" , "linux-usb\@vger.kernel.org" , "hdegoede\@redhat.com" , "heikki.krogerus\@linux.intel.com" , "robh+dt\@kernel.org" , "rogerq\@ti.com" , "linux-kernel\@vger.kernel.org" , "jbergsagel\@ti.com" , "nsekhar\@ti.com" , "nm\@ti.com" , Suresh Punnoose , "peter.chen\@nxp.com" , Jayshri Dajiram Pawar , Rahul Kumar Subject: RE: [PATCH v9 5/6] usb:cdns3 Add Cadence USB3 DRD Driver In-Reply-To: References: <1562324238-16655-1-git-send-email-pawell@cadence.com> <1562324238-16655-6-git-send-email-pawell@cadence.com> <87r274lmqk.fsf@linux.intel.com> <87a7dpm442.fsf@linux.intel.com> Date: Tue, 09 Jul 2019 09:36:57 +0300 Message-ID: <87pnmj67ee.fsf@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Pawel Laszczak writes: >>> IRQF_ONESHOT can be used only in threaded handled. >>> " >>> * IRQF_ONESHOT - Interrupt is not reenabled after the hardirq handler finished. >>> * Used by threaded interrupts which need to keep the >>> * irq line disabled until the threaded handler has been run. >>> " >> >>so? > > I don't understand why If I don't have threaded handler why I need IRQF_ONESHOT. > Why interrupt cannot be reenabled after hardirq handler finished ? > I do not use threaded handler so this flag seem unnecessary. Unless this has changed over the years, it was a requirement from IRQ susbystem. /* * Drivers are often written to work w/o knowledge about the * underlying irq chip implementation, so a request for a * threaded irq without a primary hard irq context handler * requires the ONESHOT flag to be set. Some irq chips like * MSI based interrupts are per se one shot safe. Check the * chip flags, so we can avoid the unmask dance at the end of * the threaded handler for those. */ if (desc->irq_data.chip->flags & IRQCHIP_ONESHOT_SAFE) new->flags &= ~IRQF_ONESHOT; >>>>> + } else { >>>>> + struct usb_request *request; >>>>> + >>>>> + if (priv_dev->eps[index]->flags & EP_WEDGE) { >>>>> + cdns3_select_ep(priv_dev, 0x00); >>>>> + return 0; >>>>> + } >>>>> + >>>>> + cdns3_dbg(priv_ep->cdns3_dev, "Clear Stalled endpoint %s\n", >>>>> + priv_ep->name); >>>> >>>>why do you need your own wrapper around dev_dbg()? This looks quite unnecessary. >>> >>> It's generic function used for adding message to trace.log. It's not wrapper to dev_dbg >>> >>> void cdns3_dbg(struct cdns3_device *priv_dev, const char *fmt, ...) >>> { >>> struct va_format vaf; >>> va_list args; >>> >>> va_start(args, fmt); >>> vaf.fmt = fmt; >>> vaf.va = &args; >>> trace_cdns3_log(priv_dev, &vaf); >>> va_end(args); >>> } >> >>oh. Don't do it like that. Add a proper trace event that actually >>decodes the information you want. These random messages will give you >>trouble in the future. I had this sort of construct in dwc3 for a while >>and it became clear that it's a bad idea. It's best to have trace events >>that decode information coming from the HW. That way your trace logs >>have a "predictable" shape/format and you can easily find problem areas. > > Ok , I will change this. > I used such solution because I didn't want to create to many trace events. > I used it only for rely used messages. If you have these messages that are *really* needed, then you should add a trace event for it. Look at the events we have on dwc3 if you need some inspiration. Could also look at the history of our trace events to figure out how things changed over time. cheers -- balbi