From patchwork Mon Oct 19 10:06:30 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 286965 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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, 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 71279C43457 for ; Mon, 19 Oct 2020 10:19:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 12C9A22283 for ; Mon, 19 Oct 2020 10:19:25 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="tl5wef45"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="mFdIWnSa" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729111AbgJSKSH (ORCPT ); Mon, 19 Oct 2020 06:18:07 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58696 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727524AbgJSKSG (ORCPT ); Mon, 19 Oct 2020 06:18:06 -0400 Message-Id: <20201019101109.603244207@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603102683; 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=ZKsj80ymynJu9n+vKl8hANyFjBXKxoMgZSnkilPgmtg=; b=tl5wef45fNGo5qqku0RXIq+k+/4W5Q5pAIFBbYg5gHeiLz+rmzsYUbEI3sumMndcKnV617 MFFwqK5RIs3GufNia1xUXF+YC1q1ts4jwtlb7Ua/wwMSvgy7787t31DxiRtl3cCt4/uhKK AyYnqXDkGUNL71Ex1qyWaW7moaGiflTzGR9pI75Xrvato+85LDRsR/1vSjNVORVpri1nLK kn/ZmQGgHXECgIAq45Z18bsJnOSfgf++dbm9svkITC3qP9gnqllazKhtNB2KZXVIJPxUDO oGKr0anhSRYMnEKTbl/+mqUgWEDKmzjj9foPm959CshuqF2iw/vNmXcRd1bVhg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603102683; 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=ZKsj80ymynJu9n+vKl8hANyFjBXKxoMgZSnkilPgmtg=; b=mFdIWnSa3Q+Zc90yiD08Wh2Z/poUmlh/UuAiBa7jk0GT1OVt+U/ksI8/JfrThIju7Jh6Tn sviYJm2vlKfOSvDA== Date: Mon, 19 Oct 2020 12:06:30 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , Thomas Winischhofer , Greg Kroah-Hartman , linux-usb@vger.kernel.org, stable@vger.kernel.org, "Ahmed S. Darwish" , Sebastian Andrzej Siewior , Johan Hovold , Mathias Nyman , Valentina Manea , Shuah Khan , Alan Stern , linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Felipe Balbi , Duncan Sands Subject: [patch V2 01/13] USB: sisusbvga: Make console support depend on BROKEN References: <20201019100629.419020859@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org The console part of sisusbvga is broken vs. printk(). It uses in_atomic() to detect contexts in which it cannot sleep despite the big fat comment in preempt.h which says: Do not use in_atomic() in driver code. in_atomic() does not work on kernels with CONFIG_PREEMPT_COUNT=n which means that spin/rw_lock held regions are not detected by it. There is no way to make this work by handing context information through to the driver and this only can be solved once the core printk infrastructure supports sleepable console drivers. Make it depend on BROKEN for now. Fixes: 1bbb4f2035d9 ("[PATCH] USB: sisusb[vga] update") Signed-off-by: Thomas Gleixner Cc: Thomas Winischhofer Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: stable@vger.kernel.org --- drivers/usb/misc/sisusbvga/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/misc/sisusbvga/Kconfig +++ b/drivers/usb/misc/sisusbvga/Kconfig @@ -16,7 +16,7 @@ config USB_SISUSBVGA config USB_SISUSBVGA_CON bool "Text console and mode switching support" if USB_SISUSBVGA - depends on VT + depends on VT && BROKEN select FONT_8x16 help Say Y here if you want a VGA text console via the USB dongle or From patchwork Mon Oct 19 10:06:33 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 286970 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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, 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 A1453C43467 for ; Mon, 19 Oct 2020 10:18:16 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4A1FA22276 for ; Mon, 19 Oct 2020 10:18:16 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="iwIXTF3e"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="2C+WiHFJ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729189AbgJSKSK (ORCPT ); Mon, 19 Oct 2020 06:18:10 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58756 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729074AbgJSKSJ (ORCPT ); Mon, 19 Oct 2020 06:18:09 -0400 Message-Id: <20201019101110.019266389@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603102686; 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=iwIXTF3enn1fKti5Wyc96yx4QPfU+KLydyWLL0v9XCmX93au8n+PY7KafwO6IdMWfyujqV uODhQfVFgnk8XBnleRHsnd93BKSgI1gKCozA4aXlXg8L+KUVbI9K1ugQ7bE7J5vtFv+kSC uhkRoqqLG+BL/mfNGhNdQsiqYPGaF+qubBeaXj5TEZX96E7p5w18kzSbxLDWkNEKfHxk79 RlDbTflSduUm49CPm+yZnOaAY0Ne5qKTL18u2daxeMIA+rX1k/wm1kt1WWDuUNZxO5G/j/ OSvklQqcZ0OP4b9om2XFCeqkBPn8IAAe25qYyINN0Mpm0xrQh4Me68mqQogqMg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603102686; 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=2C+WiHFJBXgPiWdy7C84FEdn66zJ0B0CnSRlJ3KIL25PgSmN+pU25mZ09jWn1ED1ug6tnA GQ4nIpFut1OqP1BQ== Date: Mon, 19 Oct 2020 12:06:33 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , "Ahmed S. Darwish" , Sebastian Andrzej Siewior , Johan Hovold , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Thomas Winischhofer , Mathias Nyman , Valentina Manea , Shuah Khan , Alan Stern , linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Felipe Balbi , Duncan Sands Subject: [patch V2 04/13] USB: serial: digi_acceleport: Remove in_interrupt() usage References: <20201019100629.419020859@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.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); From patchwork Mon Oct 19 10:06:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 286969 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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, 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 E64FBC433DF for ; Mon, 19 Oct 2020 10:18:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6641F22263 for ; Mon, 19 Oct 2020 10:18:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Ay5afY3n"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Bwy/LQ9S" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729290AbgJSKSS (ORCPT ); Mon, 19 Oct 2020 06:18:18 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58742 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729182AbgJSKSL (ORCPT ); Mon, 19 Oct 2020 06:18:11 -0400 Message-Id: <20201019101110.240285929@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603102689; 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=WngfxKCbiTKE9erlSaLbB4MmoQbLDSkUgvyXSrV+/VI=; b=Ay5afY3nWqWdPkkzJsp41vh5O+dD2nd/0fG7RPbP5DUH92jHLqP6Kx+3E+AHYac364F9Mo A2bpcoj3jwogNqL3dtlf2Szc3PgPAu6ewzrYCOYGLMss1il8aDMVLdwRhDvVduzPmijOUx bYyr58hIlLaMiCjqfoG7PA5U4avgF10+lL9DkkA4pBxuqxXEV++cJrBhuREFpO56yA46XI qaOv8WbByE5HGmV28mYtJpVk4afPWMXE2eXAgiOo7srHiNb4bX+BPVXnlTTKFTEJUEynxY NEMYP+tMNTl6fRPX9Y3Stq50xgCoi3m8zzsXrAgZ8gDIX2ivJINECVsfzcWlQg== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603102689; 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=WngfxKCbiTKE9erlSaLbB4MmoQbLDSkUgvyXSrV+/VI=; b=Bwy/LQ9S8g8N8l1iMRJCmuGn0XWiNGgBFATYWG6atDTGprcVSeTwnDFRmVJvB4kb9scCZ5 j72sHwPUxaQxxvAw== Date: Mon, 19 Oct 2020 12:06:35 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , "Ahmed S. Darwish" , Sebastian Andrzej Siewior , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Thomas Winischhofer , Johan Hovold , Mathias Nyman , Valentina Manea , Shuah Khan , Alan Stern , linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Felipe Balbi , Duncan Sands Subject: [patch V2 06/13] usb: host: isp1362: Replace in_interrupt() usage References: <20201019100629.419020859@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org isp1362_show_regs() is a debugging-only function, with no call sites. It prints the cached value of the HCuPINTENB register if in_interupt() is true, otherwise it reads the actual register content. 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. Make the conditional based on a function argument. Signed-off-by: Ahmed S. Darwish Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org --- V2: Fix silly typo --- drivers/usb/host/isp1362.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) --- a/drivers/usb/host/isp1362.h +++ b/drivers/usb/host/isp1362.h @@ -793,7 +793,8 @@ static void isp1362_write_fifo(struct is ISP1362_REG_NO(ISP1362_REG_##r), isp1362_read_reg16(d, r)); \ } -static void __attribute__((__unused__)) isp1362_show_regs(struct isp1362_hcd *isp1362_hcd) +static void __attribute__((__unused__)) +isp1362_show_regs(struct isp1362_hcd *isp1362_hcd, bool cached_inten) { isp1362_show_reg(isp1362_hcd, HCREVISION); isp1362_show_reg(isp1362_hcd, HCCONTROL); @@ -815,7 +816,7 @@ static void __attribute__((__unused__)) isp1362_show_reg(isp1362_hcd, HCXFERCTR); isp1362_show_reg(isp1362_hcd, HCuPINT); - if (in_interrupt()) + if (cached_inten) DBG(0, "%-12s[%02x]: %04x\n", "HCuPINTENB", ISP1362_REG_NO(ISP1362_REG_HCuPINTENB), isp1362_hcd->irqenb); else From patchwork Mon Oct 19 10:06:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 286967 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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, 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 22CA5C4363D for ; Mon, 19 Oct 2020 10:18:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD40522263 for ; Mon, 19 Oct 2020 10:18:58 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Z04gypyj"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="Z5dFPjXX" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729257AbgJSKSR (ORCPT ); Mon, 19 Oct 2020 06:18:17 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58846 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729223AbgJSKSP (ORCPT ); Mon, 19 Oct 2020 06:18:15 -0400 Message-Id: <20201019101110.439968251@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603102691; 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=pZhgNRr9Q1w2yx0BNLRMw7Tg8cejJvtH8+Qmxb414dc=; b=Z04gypyjQuA3FHdF1W6R95FEPIsNDsh6O76OwYyiS7v0H2e+bS2GVB1prkgzic5Cj52ogb RwUOANP1CNTUU/9s54sw/aMJqefZcEbvTyc6Cx10XoQVy+dW5CBKwAw70DcF9S5crIJoWB 1CdSOBkmUhA4bLxvwOEH4BAxkLFw1xwxVkYNUzxwsuHhQIjfvG1BB6QvnLO2djVlt6FOks ji6R2xmiPKbsOnnVqVFUz+armRoKOGAlfYkR7pXl/r0r+xyOp6IG9kFjhE2Nl/Lllk268G pvk/hsnY9j/W1EUkE7zR/L8CJIk1pOwGt7H9/HK9B77/HQAcOEf2zy2iwA5f0Q== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603102691; 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=pZhgNRr9Q1w2yx0BNLRMw7Tg8cejJvtH8+Qmxb414dc=; b=Z5dFPjXX8w9hCSdRSsg+sCd8X1Y35DrgCMy+1aehcPBP3jhDn8A56ieFgRKff9xvwJD2fX IzaKB93Zf5gurMDw== Date: Mon, 19 Oct 2020 12:06:37 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , "Ahmed S. Darwish" , Sebastian Andrzej Siewior , Alan Stern , Greg Kroah-Hartman , linux-usb@vger.kernel.org, linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Thomas Winischhofer , Johan Hovold , Mathias Nyman , Valentina Manea , Shuah Khan , Felipe Balbi , Duncan Sands Subject: [patch V2 08/13] usb: hosts: Remove in_interrupt() from comments References: <20201019100629.419020859@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Ahmed S. Darwish The usage of in_interrupt() in drivers is phased out for various reasons. Various comments use !in_interrupt() to describe calling context for probe() and remove() functions. That's wrong because the calling context has to be preemptible task context, which is not what !in_interrupt() describes. Cleanup the comments. While at it add the missing kernel doc argument descriptors. Signed-off-by: Ahmed S. Darwish Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Acked-by: Krzysztof Kozlowski Cc: Alan Stern Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Cc: linux-omap@vger.kernel.org Cc: Kukjin Kim Cc: linux-arm-kernel@lists.infradead.org Cc: linux-samsung-soc@vger.kernel.org Acked-by: Alan Stern --- V2: Split out the static change and add a missing comment --- drivers/usb/host/ehci-fsl.c | 9 ++++----- drivers/usb/host/ehci-pmcmsp.c | 11 +++++++---- drivers/usb/host/ohci-at91.c | 11 ++++++++--- drivers/usb/host/ohci-omap.c | 9 ++++++--- drivers/usb/host/ohci-pxa27x.c | 11 ++++++----- drivers/usb/host/ohci-s3c2410.c | 12 ++++++------ 6 files changed, 37 insertions(+), 26 deletions(-) --- a/drivers/usb/host/ehci-fsl.c +++ b/drivers/usb/host/ehci-fsl.c @@ -39,10 +39,10 @@ static struct hc_driver __read_mostly fs /* * fsl_ehci_drv_probe - initialize FSL-based HCDs * @pdev: USB Host Controller being probed - * Context: !in_interrupt() * - * Allocates basic resources for this USB host controller. + * Context: task context, might sleep * + * Allocates basic resources for this USB host controller. */ static int fsl_ehci_drv_probe(struct platform_device *pdev) { @@ -684,12 +684,11 @@ static const struct ehci_driver_override /** * fsl_ehci_drv_remove - shutdown processing for FSL-based HCDs * @pdev: USB Host Controller being removed - * Context: !in_interrupt() * - * Reverses the effect of usb_hcd_fsl_probe(). + * Context: task context, might sleep * + * Reverses the effect of usb_hcd_fsl_probe(). */ - static int fsl_ehci_drv_remove(struct platform_device *pdev) { struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); --- a/drivers/usb/host/ehci-pmcmsp.c +++ b/drivers/usb/host/ehci-pmcmsp.c @@ -147,12 +147,14 @@ static int usb_hcd_msp_map_regs(struct m /** * usb_hcd_msp_probe - initialize PMC MSP-based HCDs - * Context: !in_interrupt() + * @driver: Pointer to hc driver instance + * @dev: USB controller to probe + * + * Context: task context, might sleep * * Allocates basic resources for this USB host controller, and * then invokes the start() method for the HCD associated with it * through the hotplug entry's driver_data. - * */ int usb_hcd_msp_probe(const struct hc_driver *driver, struct platform_device *dev) @@ -223,8 +225,9 @@ int usb_hcd_msp_probe(const struct hc_dr /** * usb_hcd_msp_remove - shutdown processing for PMC MSP-based HCDs - * @dev: USB Host Controller being removed - * Context: !in_interrupt() + * @hcd: USB Host Controller being removed + * + * Context: task context, might sleep * * Reverses the effect of usb_hcd_msp_probe(), first invoking * the HCD's stop() method. It is always called from a thread --- a/drivers/usb/host/ohci-at91.c +++ b/drivers/usb/host/ohci-at91.c @@ -155,7 +155,10 @@ static struct regmap *at91_dt_syscon_sfr /* * usb_hcd_at91_probe - initialize AT91-based HCDs - * Context: !in_interrupt() + * @driver: Pointer to hc driver instance + * @pdev: USB controller to probe + * + * Context: task context, might sleep * * Allocates basic resources for this USB host controller, and * then invokes the start() method for the HCD associated with it @@ -246,12 +249,14 @@ static int usb_hcd_at91_probe(const stru /* * usb_hcd_at91_remove - shutdown processing for AT91-based HCDs - * Context: !in_interrupt() + * @hcd: USB controller to remove + * @pdev: Platform device required for cleanup + * + * Context: task context, might sleep * * Reverses the effect of usb_hcd_at91_probe(), first invoking * the HCD's stop() method. It is always called from a thread * context, "rmmod" or something similar. - * */ static void usb_hcd_at91_remove(struct usb_hcd *hcd, struct platform_device *pdev) --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c @@ -285,7 +285,9 @@ static int ohci_omap_reset(struct usb_hc /** * ohci_hcd_omap_probe - initialize OMAP-based HCDs - * Context: !in_interrupt() + * @pdev: USB controller to probe + * + * Context: task context, might sleep * * Allocates basic resources for this USB host controller, and * then invokes the start() method for the HCD associated with it @@ -399,8 +401,9 @@ static int ohci_hcd_omap_probe(struct pl /** * ohci_hcd_omap_remove - shutdown processing for OMAP-based HCDs - * @dev: USB Host Controller being removed - * Context: !in_interrupt() + * @pdev: USB Host Controller being removed + * + * Context: task context, might sleep * * Reverses the effect of ohci_hcd_omap_probe(), first invoking * the HCD's stop() method. It is always called from a thread --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c @@ -410,12 +410,13 @@ static int ohci_pxa_of_init(struct platf /** * ohci_hcd_pxa27x_probe - initialize pxa27x-based HCDs - * Context: !in_interrupt() + * @pdev: USB Host controller to probe + * + * Context: task context, might sleep * * Allocates basic resources for this USB host controller, and * then invokes the start() method for the HCD associated with it * through the hotplug entry's driver_data. - * */ static int ohci_hcd_pxa27x_probe(struct platform_device *pdev) { @@ -509,13 +510,13 @@ static int ohci_hcd_pxa27x_probe(struct /** * ohci_hcd_pxa27x_remove - shutdown processing for pxa27x-based HCDs - * @dev: USB Host Controller being removed - * Context: !in_interrupt() + * @pdev: USB Host Controller being removed + * + * Context: task context, might sleep * * Reverses the effect of ohci_hcd_pxa27x_probe(), first invoking * the HCD's stop() method. It is always called from a thread * context, normally "rmmod", "apmd", or something similar. - * */ static int ohci_hcd_pxa27x_remove(struct platform_device *pdev) { --- a/drivers/usb/host/ohci-s3c2410.c +++ b/drivers/usb/host/ohci-s3c2410.c @@ -324,14 +324,13 @@ static void s3c2410_hcd_oc(struct s3c241 /* * ohci_hcd_s3c2410_remove - shutdown processing for HCD * @dev: USB Host Controller being removed - * Context: !in_interrupt() + * + * Context: task context, might sleep * * Reverses the effect of ohci_hcd_3c2410_probe(), first invoking * the HCD's stop() method. It is always called from a thread * context, normally "rmmod", "apmd", or something similar. - * -*/ - + */ static int ohci_hcd_s3c2410_remove(struct platform_device *dev) { @@ -345,12 +344,13 @@ ohci_hcd_s3c2410_remove(struct platform_ /* * ohci_hcd_s3c2410_probe - initialize S3C2410-based HCDs - * Context: !in_interrupt() + * @dev: USB Host Controller to be probed + * + * Context: task context, might sleep * * Allocates basic resources for this USB host controller, and * then invokes the start() method for the HCD associated with it * through the hotplug entry's driver_data. - * */ static int ohci_hcd_s3c2410_probe(struct platform_device *dev) { From patchwork Mon Oct 19 10:06:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 286966 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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, 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 F322EC388F9 for ; Mon, 19 Oct 2020 10:19:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2E11222BA for ; Mon, 19 Oct 2020 10:19:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="JKowC+xz"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="u21yGgK+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726544AbgJSKS7 (ORCPT ); Mon, 19 Oct 2020 06:18:59 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58926 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729074AbgJSKSR (ORCPT ); Mon, 19 Oct 2020 06:18:17 -0400 Message-Id: <20201019101110.744172050@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603102695; 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=eU49tVESfPvybwx3L3Wh92XZvOJJ4zNGI0TkIeEUK1M=; b=JKowC+xz19F02CLEO24JMjrb4u0kEcj+L8t99YbWx+w5UvTUx/WsjiX23lHjEfawj8L1Ai MebzdHR9mnykV00sB05zLHuFW9/4veKDWkEkx9kzZPaz81vDGOIp1dnbjmBKpzlDo41RK0 rQdw6sMqR+l6kv313t8o5e9e2W0tlqh29gMfTPAV5RD0WA3MqD1E52hA7tRObbfCZaZpE8 2ZgdvQBM34e+Fvm3kh6wMfPTvxKazGLl/OF84W+pbbvB5RGCNTfqUorwbmPTrODOLv6ovg U6DgzsG6ChAVATvkmPznkzqWwgVurjR4EtKfILDpR9kGCbSd4sv/8wgcljhzSw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603102695; 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=eU49tVESfPvybwx3L3Wh92XZvOJJ4zNGI0TkIeEUK1M=; b=u21yGgK+RD0O07+cg6Izujgy+wcxtgbrdd1zA0ikisQUXWnsPqdAxfppXCH+m5pMKOnvD+ vbuZ3HsJP3oH0yCA== Date: Mon, 19 Oct 2020 12:06:40 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , "Ahmed S. Darwish" , Sebastian Andrzej Siewior , Felipe Balbi , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Thomas Winischhofer , Johan Hovold , Mathias Nyman , Valentina Manea , Shuah Khan , Alan Stern , linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Duncan Sands Subject: [patch V2 11/13] usb: gadget: udc: Remove in_interrupt()/in_irq() from comments References: <20201019100629.419020859@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org From: Ahmed S. Darwish The usage of in_irq()/in_interrupt() in drivers is phased out for various reasons. The context description for usb_gadget_giveback_request() is misleading as in_interupt() means: hard interrupt or soft interrupt or bottom half disabled regions. But it's also invoked from task context when endpoints are torn down. Remove it as it's more confusing than helpful. Replace also the in_irq() comment with plain text. Signed-off-by: Ahmed S. Darwish Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Felipe Balbi Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Acked-by: Alan Stern --- drivers/usb/gadget/udc/core.c | 2 -- drivers/usb/gadget/udc/dummy_hcd.c | 6 ++++-- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/drivers/usb/gadget/udc/core.c +++ b/drivers/usb/gadget/udc/core.c @@ -894,8 +894,6 @@ EXPORT_SYMBOL_GPL(usb_gadget_unmap_reque * @ep: the endpoint to be used with with the request * @req: the request being given back * - * Context: in_interrupt() - * * This is called by device controller drivers in order to return the * completed request back to the gadget layer. */ --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -1754,8 +1754,10 @@ static int handle_control_request(struct return ret_val; } -/* drive both sides of the transfers; looks like irq handlers to - * both drivers except the callbacks aren't in_irq(). +/* + * Drive both sides of the transfers; looks like irq handlers to both + * drivers except that the callbacks are invoked from soft interrupt + * context. */ static void dummy_timer(struct timer_list *t) { From patchwork Mon Oct 19 10:06:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 286968 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=-6.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, 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 1B5B3C4363A for ; Mon, 19 Oct 2020 10:18:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC40422263 for ; Mon, 19 Oct 2020 10:18:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="4lpNzGZt"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="L1BAx4Oy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729376AbgJSKSU (ORCPT ); Mon, 19 Oct 2020 06:18:20 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:58876 "EHLO galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729285AbgJSKST (ORCPT ); Mon, 19 Oct 2020 06:18:19 -0400 Message-Id: <20201019101110.944939915@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1603102697; 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=CglHTuol1LH6Rq9Arw6I3q0kZXSSc/D44FpLqZfI5WA=; b=4lpNzGZte+JbLXJ83VGLllmO8p7ZgJPUbn2pEj3AWBlV6Kr6kMkordF9yNYiD+J0YfMNXF WrlseHROLQU+l/lbqigi2qTk9VAJ5y929pArYCx8cDTQAbouSa8PoPonAE8JjMfp1PBvEa chWrp8n1QbIhLVdUVFfL5aSRuMaJZJS8TTFH9PSpLmIHnfKarImStpf087juZuVGvW9vpy d8B+uITbEjquNSdDef0bc5zON2rSBuX0oqlrKnMDzU69dISQhvYlJeHwTtqk2u140cDa/H 3fgsgfkIGUmNcjOiSHyfjChDmTDZqoKfiozdWtZ8cgBRXPi6/SvEdu54WiqWbQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1603102697; 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=CglHTuol1LH6Rq9Arw6I3q0kZXSSc/D44FpLqZfI5WA=; b=L1BAx4OybAp6bDVli4bT4V41G4OGiBnmrb1bmCjWXg2vrs6Qc4FM9XNkkoVzYxoojOoBkj 1uEPNEpJBDmssyCw== Date: Mon, 19 Oct 2020 12:06:42 +0200 From: Thomas Gleixner To: LKML Cc: Peter Zijlstra , "Ahmed S. Darwish" , Sebastian Andrzej Siewior , Duncan Sands , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Thomas Winischhofer , Johan Hovold , Mathias Nyman , Valentina Manea , Shuah Khan , Alan Stern , linux-omap@vger.kernel.org, Kukjin Kim , Krzysztof Kozlowski , linux-arm-kernel@lists.infradead.org, linux-samsung-soc@vger.kernel.org, Felipe Balbi Subject: [patch V2 13/13] usb: atm: Replace in_interrupt() usage in comment References: <20201019100629.419020859@linutronix.de> MIME-Version: 1.0 Content-transfer-encoding: 8-bit Precedence: bulk List-ID: X-Mailing-List: linux-samsung-soc@vger.kernel.org in_interrupt() is a pretty vague context description as it means: hard interrupt, soft interrupt or bottom half disabled regions. Replace the vague comment with a proper reasoning why spin_lock_irqsave() needs to be used. Signed-off-by: Ahmed S. Darwish Signed-off-by: Sebastian Andrzej Siewior Signed-off-by: Thomas Gleixner Cc: Duncan Sands Cc: Greg Kroah-Hartman Cc: linux-usb@vger.kernel.org Signed-off-by: Duncan Sands --- drivers/usb/atm/usbatm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/usb/atm/usbatm.c +++ b/drivers/usb/atm/usbatm.c @@ -249,7 +249,7 @@ static void usbatm_complete(struct urb * /* vdbg("%s: urb 0x%p, status %d, actual_length %d", __func__, urb, status, urb->actual_length); */ - /* usually in_interrupt(), but not always */ + /* Can be invoked from task context, protect against interrupts */ spin_lock_irqsave(&channel->lock, flags); /* must add to the back when receiving; doesn't matter when sending */