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=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE, SPF_PASS,URIBL_BLOCKED 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 95C67C388F7 for ; Sun, 25 Oct 2020 17:18:50 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 26342208A9 for ; Sun, 25 Oct 2020 17:18:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="wyfdnZTG" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 26342208A9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+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=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=oCo5Iz7DsZXOpZ4YPOHS5YDd41bs5wfApaOoRvcx+3E=; b=wyfdnZTGvBxx6wCTWdyoM94hw lU6n1ZUWqr6fRZ7lJ3yy9sWHW1/MZ9Qqh8f5CDkhCusP3+kIS8FwsUhUJB0mPL+PZJbYOkjd87XPA jfGB8N8MqmyK158Djsuwj7crCbO2sZQctKBPyRzT6unhKXSQ184U0UeoKhycOCJc8tBYywl1VHfCb JzgogGp0bZb43WQMCTIuaPeNIWW2zg+PdfUUXWdqNZi5cxDDgvUZ7jcwHjBNg5xObcfK+1sbrXmSu kM9rIIhK/y/WFqA+xxYy+kek84xCheWlNXBfFkyAt4borFksNF2eyIGaBDWeFecORbHUNCEpOa1Lt IMaBDnqLg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kWjcv-0008H0-Ep; Sun, 25 Oct 2020 17:16:17 +0000 Received: from mail-lj1-f194.google.com ([209.85.208.194]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kWjcr-0008GF-Si for linux-arm-kernel@lists.infradead.org; Sun, 25 Oct 2020 17:16:14 +0000 Received: by mail-lj1-f194.google.com with SMTP id m16so7252385ljo.6 for ; Sun, 25 Oct 2020 10:16:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=PMXldS4frrwc3ZqG31YTvYd9N3hWa1nWp8tHb7QPcuo=; b=o8NM3utY6jQBRLX+r6rI0Ds/Pgan5EfWSRTasVIPDOQHAo6/qS4HscbomK0xF+C4Hr 3V0+2+bsk5vgrB8TuNE1DYra6QffUu+oNlBKEHglyH8CXL1JXodleJmxhJaiyX8gQ1+v zBACeCRoqCiT0XQo+rwi2OHJRcYrr5rmRUJ8BmDe+hxM5M167pMdI0ivU7P21b28ZivW XsJN4BZHCc7+/CU+GzFx75e9VuGS7KNhrRvLqVU4zwq8T8lWmWVgYN0odPLgzd7QM4e2 JwcBnKOrdp11DuXwU9VkRpfdqFdT2+HjJevU3xzstcQp3xumScYbVKluAjQaf4cXa8ao BjSw== X-Gm-Message-State: AOAM532Rk0PVIKtfCUv5z6IGXWmDYT4iVoUsxJ/TC5O2Jts6AbqZaJis WHoNFz93hnbc+ArtsaRo0Fc= X-Google-Smtp-Source: ABdhPJxXubjA+MMwIxWygGmgjStosuhUXTqdl0C1uXV6556piPV6UdgHcGYW5JHodk1O0FLDjxTXBg== X-Received: by 2002:a2e:9955:: with SMTP id r21mr4069846ljj.124.1603646171409; Sun, 25 Oct 2020 10:16:11 -0700 (PDT) Received: from xi.terra (c-beaee455.07-184-6d6c6d4.bbcust.telenor.se. [85.228.174.190]) by smtp.gmail.com with ESMTPSA id y21sm789025lfk.49.2020.10.25.10.16.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 25 Oct 2020 10:16:10 -0700 (PDT) Received: from johan by xi.terra with local (Exim 4.93.0.4) (envelope-from ) id 1kWjcr-0004lp-Dw; Sun, 25 Oct 2020 18:16:14 +0100 Date: Sun, 25 Oct 2020 18:16:13 +0100 From: Johan Hovold To: Thomas Gleixner Subject: Re: [patch V2 04/13] USB: serial: digi_acceleport: Remove in_interrupt() usage Message-ID: <20201025171613.GT26280@localhost> References: <20201019100629.419020859@linutronix.de> <20201019101110.019266389@linutronix.de> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20201019101110.019266389@linutronix.de> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201025_131614_038270_7DC3DEC2 X-CRM114-Status: GOOD ( 25.44 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Felipe Balbi , Thomas Winischhofer , Mathias Nyman , Peter Zijlstra , Greg Kroah-Hartman , Sebastian Andrzej Siewior , linux-usb@vger.kernel.org, Johan Hovold , Krzysztof Kozlowski , LKML , linux-samsung-soc@vger.kernel.org, Kukjin Kim , Valentina Manea , Duncan Sands , "Ahmed S. Darwish" , Alan Stern , linux-omap@vger.kernel.org, Shuah Khan , linux-arm-kernel@lists.infradead.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Oct 19, 2020 at 12:06:33PM +0200, Thomas Gleixner wrote: > From: Ahmed S. Darwish > > The usage of in_interrupt() in drivers is phased out and Linus clearly > requested that code which changes behaviour depending on context should > either be separated or the context be conveyed in an argument passed by the > caller, which usually knows the context. > > The debug printk() in digi_write() prints in_interrupt() as context > information. TTY writes happen always in preemptible task context and > console writes can happen from almost any context, so in_interrupt() is not > really helpful. The above statement is not correct, TTY writes can and do happen from other contexts, including soft IRQ (e.g. PPP). > Aside of that issuing a printk() from a console->write() callback is not a > really brilliant idea for obvious reasons. True, but we don't need to sprinkle conditionals for the benefit of people trying to debug USB serial drivers using a USB serial console. They get what they deserve. ;) > Remove the in_interrupt() printout and make the printk() depend on tty. > > Signed-off-by: Ahmed S. Darwish > Signed-off-by: Sebastian Andrzej Siewior > Signed-off-by: Thomas Gleixner > Cc: Johan Hovold > Cc: Greg Kroah-Hartman > Cc: linux-usb@vger.kernel.org > > --- > drivers/usb/serial/digi_acceleport.c | 7 ++++--- > 1 file changed, 4 insertions(+), 3 deletions(-) > > --- a/drivers/usb/serial/digi_acceleport.c > +++ b/drivers/usb/serial/digi_acceleport.c > @@ -911,9 +911,10 @@ static int digi_write(struct tty_struct > unsigned char *data = port->write_urb->transfer_buffer; > unsigned long flags = 0; > > - dev_dbg(&port->dev, > - "digi_write: TOP: port=%d, count=%d, in_interrupt=%ld\n", > - priv->dp_port_num, count, in_interrupt()); > + if (tty) { > + dev_dbg(&port->dev, "digi_write: TOP: port=%d, count=%d\n", > + priv->dp_port_num, count); > + } So just drop the in_interrupt() here. Also note that we already have another unconditional dev_dbg() at the end of this function. > > /* copy user data (which can sleep) before getting spin lock */ > count = min(count, port->bulk_out_size-2); > Johan _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel