Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp384542rwj; Thu, 22 Dec 2022 08:57:20 -0800 (PST) X-Google-Smtp-Source: AMrXdXu3WCsWjxJdb1uqtR/hw7ien6XS/EnkbbioCG424uFp860lZy5GjY29/vTKWe12ofTou5ln X-Received: by 2002:a17:906:6b18:b0:7d3:8159:f35d with SMTP id q24-20020a1709066b1800b007d38159f35dmr5096137ejr.9.1671728240617; Thu, 22 Dec 2022 08:57:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671728240; cv=none; d=google.com; s=arc-20160816; b=ipOsydzbWNn7dfQPb+zE7tr8x20ETRTOgO9e+00igGi9t4+8y+ou1H9Lhm+73OwNXh L/yLk2782ArimLg7jFABZLkdDKU3ecIii8ITCdJuDa0PLJ8yqWvKtHEFYUqj8gcPYK94 zfWGXSBV6Mvo+cG2BP0RzEM7ybDGkvvCc1fLmi3vMEJpJTlU8p0bMt8HPUjcKtP86m5N e/HO5VXyp4xyRMyzXNc+77y3fzDU51YHTt4gzZnv4b7lEquN9qGiKs/lmRdeDkd2pLkg 03Y91G4M/yzP5FcylALz3CDB4pTdjFfuj1DcnHwIc4iuRyKz58zl2EZ8hge2D6GePuOx xSYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=LkpakPPiL9ciw+0lxLCuFqwyqvoncqNdH+FujNxVEpg=; b=0DFKN7QxPIwcFZYMyy0IlGYcAwY7lIFqBlzQCEg8CeelopCkZ76K0CxVrkIb8GcKCd O3xSl+TJIAX41xVnXX1Xmj0/4wjt1bexIKv52H/eKJ+Pnsj1MviG0F1LtSa86ei7qDhT X9IYzP27kArbzjObZuUxANMQYElnD/qmW/i4YMkWTdetUS03fxZIslbX24Af9DvEoPSc CwVqIFzG0/6P5GW9lySDA71FfB0WpywWkM4vgW0D5zNNvGVnwaKPMCF/wdGRytyzLGhe 96cq/18oMUG7K1enzx9ZAvJ7gmEC4waQmZZqPCYs5Xo//0xgn7ZJAbvjklHkB5DXEi5M 65Vg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T+behxXY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d33-20020a056402402100b0047b9cd3ee7fsi1093302eda.368.2022.12.22.08.56.57; Thu, 22 Dec 2022 08:57:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=T+behxXY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229793AbiLVQ24 (ORCPT + 67 others); Thu, 22 Dec 2022 11:28:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47250 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229526AbiLVQ2y (ORCPT ); Thu, 22 Dec 2022 11:28:54 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B633A46D; Thu, 22 Dec 2022 08:28:53 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 07FAE60C17; Thu, 22 Dec 2022 16:28:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B4530C433D2; Thu, 22 Dec 2022 16:28:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1671726532; bh=quQ2OOb8SYWeKmOuvUZAVXbbPsSJZ2ipg0z5ydmhLNk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=T+behxXYqfS5N7QM8iPekCkNaFdT/IsqRvsyEDTEEbtpgv1A+iBHwxjCH5Png/qfn r+gDGvBk7+Xvpvv6tQsqrr4E0OQQN4FIEfsoNOixyOliGIDPhSgE7y0YsFG1poAcR2 XBhnHHDmkBP/BxVmWoaTXGWAIYDC5Pobcn85Iys8= Date: Thu, 22 Dec 2022 17:28:49 +0100 From: Greg Kroah-Hartman To: Herve Codina Cc: Geert Uytterhoeven , Michael Turquette , Stephen Boyd , Rob Herring , Krzysztof Kozlowski , Magnus Damm , Gareth Williams , linux-renesas-soc@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org, Thomas Petazzoni , Miquel Raynal Subject: Re: [PATCH v4 3/5] usb: gadget: udc: add Renesas RZ/N1 USBF controller support Message-ID: References: <20221213133302.218955-1-herve.codina@bootlin.com> <20221213133302.218955-4-herve.codina@bootlin.com> <20221222162438.4d06bd77@bootlin.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20221222162438.4d06bd77@bootlin.com> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Dec 22, 2022 at 04:24:38PM +0100, Herve Codina wrote: > Hi Geert, Greg, > > On Wed, 21 Dec 2022 14:07:53 +0100 > Greg Kroah-Hartman wrote: > > > On Wed, Dec 21, 2022 at 02:03:43PM +0100, Geert Uytterhoeven wrote: > > > Hi Herv?, > > > > > > On Tue, Dec 13, 2022 at 2:33 PM Herve Codina wrote: > > > > Add support for the Renesas USBF controller. > > > > This controller is an USB2.0 UDC controller available in the > > > > Renesas r9a06g032 SoC (RZ/N1 family). > > > > > > > > Signed-off-by: Herve Codina > > > > > > Thanks for your patch! > > > > > > > --- /dev/null > > > > +++ b/drivers/usb/gadget/udc/renesas_usbf.c > > > > > > > +#ifdef DEBUG > > > > +#define TRACE(_fmt, ...) trace_printk("%s: " _fmt, __func__, ##__VA_ARGS__) > > > > +#define USBF_TRACE_EP_MASK 0x0ffff /* All the 16 endpoints */ > > > > +#define TRACEEP(_ep, _fmt, ...) \ > > > > + do { \ > > > > + if ((1 << (_ep)->id) & USBF_TRACE_EP_MASK) \ > > > > + trace_printk("%s: " _fmt, __func__, ##__VA_ARGS__); \ > > > > + } while (0) > > > > +#else > > > > +#define TRACE(_fmt, ...) do { } while (0) > > > > +#define TRACEEP(_ep, _fmt, ...) do { } while (0) > > > > > > Please use "no_printk(fmt, ##__VA_ARGS__)" instead of dummy loops, > > > to avoid bad callers going unnoticed if DEBUG is not defined. > > > > Even better, do NOT define custom debug/trace macros for a single > > driver, just use the ones that the rest of the kernel uses instead > > please. > > > > thanks, > > > > greg k-h > > I would like to keep some granularity in debug messages and > also keep the function name automatically added. > I propose 3 kinds of messages: > - general ones, > - specific Endpoint0 ones, > - other Endpoints ones. All of those can work just fine using dev_dbg() today, no need to make anything special for the driver. You can turn those messages on/off with no need to ever rebuild your driver, which is the key point. > So before doing any modification in the source code, what do you > think about: > /* > * Suggested tracers: > * - no_printk: Disable tracing > * - trace_printk: Print to trace buffer > */ > #define usbf_dbg(_fmt, ...) no_printk("%s: " _fmt, __func__, ##__VA_ARGS__) > #define usbf_dbg_ep0(_fmt, ...) no_printk("%s: " _fmt, __func__, ##__VA_ARGS__) > #define usbf_dbg_epn(_fmt, ...) no_printk("%s: " _fmt, __func__, ##__VA_ARGS__) Nope, just use dev_dbg() only please. It provides MUCH more funcationality and a unified interface with the rest of the kernel. Please do not attempt to "roll your own" version of debugging macros for just a single driver. thanks, greg k-h