From patchwork Wed Oct 14 14:52:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 11837949 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 1CBD61130 for ; Wed, 14 Oct 2020 15:21:00 +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 DA40922201 for ; Wed, 14 Oct 2020 15:20:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="VQzEhJiO"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="gF49Zkiq"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="fNqQVvXm" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DA40922201 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linutronix.de Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.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:MIME-Version:References:Subject:To:From:Date: Message-Id:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:List-Owner; bh=xEIlegQi+bSgJSMB0jPyIytiP4YHqddKP1w3mvrga/c=; b=VQzEhJiOWk3CaPwNfPyRExkfP 7TnV7KCpTLxNZd1ZVKPao+d2mdUu6p9UFQGI6CtOdQf+cnojpcr2o4HRrsnRbQa6m7TNp4LYCQp2Q IWxxZkSI/IrnIMyuoPirzdzfNpSe4QjFB5/8S/EvbpgxPzz+g/E3CL/Ni8tYmNPaK9XQuZrGvGct7 bVvT3viw3B9yN7c8Un6LSR3wt6L3Xz9PN4mzxFUy+hs/3Y8N4CcDDGwHcczp48BhQIvYg2A8p9NI9 ZYW86hUGIpGcN/XZSNdreIHNrfUpbPSY7eYm0xP1AnEopyncqKXnrYA0icZPXiDf40a5VslXW7nZF C3QZCE4ww==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSiYg-00058K-3T; Wed, 14 Oct 2020 15:19:18 +0000 Received: from galois.linutronix.de ([193.142.43.55]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kSiYG-0004xa-Py for linux-arm-kernel@lists.infradead.org; Wed, 14 Oct 2020 15:18:59 +0000 Message-Id: <20201014145727.480325406@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1602688731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=MXv/cC90NGLd0gAyhvd77yXM/kdP4dV075keyekfnPQ=; b=gF49ZkiqVA6Zkos7qV1tE5MFxGK11ffDoTX8KLBy8SNOMaDDNL7x1wO6IHJ/BNtFHcv5hT 0/nZJjx4SO39GW/Av+RNKSxFj0Z+OyQZCvENPKlDVZ6SuvPvYkZXPUsMOwJnK2/gfqJpij qLCP2LF8pxRywYu2LrvQq2m8s2yZLCSuHR3/Ip1GNhoHFXiye3d0YNaxy7lizSusQjT2uq 6LiyrKiKsnaid2NtGbCoqc6Vhi+BWqhCq0Eme5taaIjVekbxV4iilOadB0ENaIDyyWvQgq CKhL3GyL7KfZox86+OS14WawQaTkrspL7RbAG9T58uwOffIM0eJiZm6eV/xT9w== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1602688731; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: references:references; bh=MXv/cC90NGLd0gAyhvd77yXM/kdP4dV075keyekfnPQ=; b=fNqQVvXmjajIS9K+Wb89Ddzsv1Zt+aXUZdLwSLQWFT29BfJ4Y16PSZJISiz9hVbWbvSoSo v2uFFdzbh4ZpC7Bw== Date: Wed, 14 Oct 2020 16:52:19 +0200 From: Thomas Gleixner To: LKML Subject: [patch 04/12] USB: serial: digi_acceleport: Remove in_interrupt() usage References: <20201014145215.518912759@linutronix.de> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201014_111853_020513_A71D7609 X-CRM114-Status: GOOD ( 11.46 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [193.142.43.55 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid 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 , Valentina Manea , linux-samsung-soc@vger.kernel.org, Kukjin Kim , Alan Stern , Duncan Sands , "Ahmed S. Darwish" , linux-omap@vger.kernel.org, Shuah Khan , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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. Aside of that issuing a printk() from a console->write() callback is not a really brilliant idea for obvious reasons. 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); + } /* copy user data (which can sleep) before getting spin lock */ count = min(count, port->bulk_out_size-2);