Received: by 2002:a05:6a10:f3d0:0:0:0:0 with SMTP id a16csp2706394pxv; Sun, 11 Jul 2021 23:19:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzt8YR9bZyqRMsTEU7HWxMboaSL3oqJXSwjUnjlrthlWAX9c0SR8EEEyzYdtLaDWEmtFAB/ X-Received: by 2002:a6b:1412:: with SMTP id 18mr22672043iou.33.1626070784288; Sun, 11 Jul 2021 23:19:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1626070784; cv=none; d=google.com; s=arc-20160816; b=siDF99PqMWMSWUKMziMC4xEac1sqlDu57Vo4nowKDiNbUwakMEo9elBl5++hVJhm9l UfGk334dOUADVNDy9x6lDX96R3s2epLXHEaxC+T6/dBJODU8yh90aHrwm0eIRwbEPwCn MsAFvTWPsNgPaRuE3sb9k8DSoA9UP8GsDD11+s2np/yMiKd/Ib5GNJI9Dosj4sZTM7iW p4EiNW1XTI6UISwVie5HdlMqLjfnwD1NC+bHuezinJk8ucTtpJxLixfnQ7iwSnU2yi/l 8MoW40nHyoNOFmFWlAgPh/U92hPKxlskIVPm0EsgOOJn3U+T/GzB2dx1GSVVanzyqDRD 5XzQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=7N3COHVanOoq2NqDALRISOxelpiFVKDsdjBIXAkabCI=; b=ru3VmpUUktm3KNU4yM48ba4vvhi0VF++AOiZkEk1qayCTErqHHXVOX4KumkZRAybfH EiPMx4RiO0DKcgHzh8MMfXV5cEBYdrevIo7VgdM4tll207Urlr99p7cIIEpyloUgGVTm OzxPyP+27Hcj2ZHmaeHTq3Fciiu0twuCVOhitOMT6TBdVOBs69uS6Q8GS53k7/o/zQfV zo9qPA47AUOawU5BLX/hVs2f67YV+64S4tC87I9FmSGEm8wuzEQCLjDJ4WLu8WFQItPq jYEL5LjV2ql/qZVCvuXXPuRthQpOXk0t1xLeMwSsL1rEOC3LsAKXcTti9YDjpMGeDKmR CMAw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z7si18196078iln.128.2021.07.11.23.19.32; Sun, 11 Jul 2021 23:19:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233517AbhGLGU1 (ORCPT + 99 others); Mon, 12 Jul 2021 02:20:27 -0400 Received: from mail-ej1-f44.google.com ([209.85.218.44]:35651 "EHLO mail-ej1-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233815AbhGLGTs (ORCPT ); Mon, 12 Jul 2021 02:19:48 -0400 Received: by mail-ej1-f44.google.com with SMTP id gn32so32412879ejc.2; Sun, 11 Jul 2021 23:17:00 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=7N3COHVanOoq2NqDALRISOxelpiFVKDsdjBIXAkabCI=; b=OAo/3RVfUAnbWkPURwCcEjs2YF8/+SxGNKULxzad0FpD2fd3DjTPfoF+Xn361aCB2w 5W060tDF0l9nNZVojpnI4kGq5kuzxngLpNEXBM5DIrsCtKOzEbwqSNVd4oRPUR3owJ3V mwIJ0mX+kLX9oDfVXblBSiu7X6jdlDNLiyhHv5sSZoBbMrkR8lfa4a9i2BFjd59bf/tF 6e313DhlQbXqhHzGMemvVSsRGKQeIZ2ZH+LpKVMAVBcxybDbQISbppJDzUWBKwjCOzeX 1GLJlTRT+eoLGPtjHGLmVIuVh//F9XvwN7/kzidjROwCrJW7sqbLCRzidQnE+FvxnwpA PUWw== X-Gm-Message-State: AOAM530A/ewRxHshkchKxtAnesnVHFDj9XA+qjo3zqwlitr7nH1ZdjBG Eyj6Ii9a01Tvtl6b7Bzkl6czGb+gQ+jIPQ== X-Received: by 2002:a17:907:70c6:: with SMTP id yk6mr22255241ejb.42.1626070619226; Sun, 11 Jul 2021 23:16:59 -0700 (PDT) Received: from ?IPv6:2a0b:e7c0:0:107::70f? ([2a0b:e7c0:0:107::70f]) by smtp.gmail.com with ESMTPSA id y17sm5759163ejd.16.2021.07.11.23.16.58 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 11 Jul 2021 23:16:58 -0700 (PDT) Subject: Re: [PATCH] tty: serial: jsm: hold port lock when reporting modem line changes To: Zheyu Ma , gregkh@linuxfoundation.org, rclemsmith@gmail.com Cc: linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org References: <1625925959-11086-1-git-send-email-zheyuma97@gmail.com> From: Jiri Slaby Message-ID: <014b511a-0542-d85d-e1dc-943e5463da17@kernel.org> Date: Mon, 12 Jul 2021 08:16:57 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <1625925959-11086-1-git-send-email-zheyuma97@gmail.com> Content-Type: text/plain; charset=iso-8859-2; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10. 07. 21, 16:05, Zheyu Ma wrote: > uart_handle_dcd_change() requires a port lock to be held and will emit a > warning when lockdep is enabled. Please attach an excerpt from the warning to the commit log. > Held corresponding lock to fix warnings. > > Signed-off-by: Zheyu Ma > --- > drivers/tty/serial/jsm/jsm_neo.c | 2 ++ > drivers/tty/serial/jsm/jsm_tty.c | 3 +++ > 2 files changed, 5 insertions(+) > > diff --git a/drivers/tty/serial/jsm/jsm_neo.c b/drivers/tty/serial/jsm/jsm_neo.c > index bf0e2a4cb0ce..c6f927a76c3b 100644 > --- a/drivers/tty/serial/jsm/jsm_neo.c > +++ b/drivers/tty/serial/jsm/jsm_neo.c > @@ -815,7 +815,9 @@ static void neo_parse_isr(struct jsm_board *brd, u32 port) > /* Parse any modem signal changes */ > jsm_dbg(INTR, &ch->ch_bd->pci_dev, > "MOD_STAT: sending to parse_modem_sigs\n"); > + spin_lock_irqsave(&ch->uart_port.lock, lock_flags); > neo_parse_modem(ch, readb(&ch->ch_neo_uart->msr)); > + spin_unlock_irqrestore(&ch->uart_port.lock, lock_flags); > } > } > > diff --git a/drivers/tty/serial/jsm/jsm_tty.c b/drivers/tty/serial/jsm/jsm_tty.c > index 8e42a7682c63..d74cbbbf33c6 100644 > --- a/drivers/tty/serial/jsm/jsm_tty.c > +++ b/drivers/tty/serial/jsm/jsm_tty.c > @@ -187,6 +187,7 @@ static void jsm_tty_break(struct uart_port *port, int break_state) > > static int jsm_tty_open(struct uart_port *port) > { > + unsigned long lock_flags; > struct jsm_board *brd; > struct jsm_channel *channel = > container_of(port, struct jsm_channel, uart_port); > @@ -240,6 +241,7 @@ static int jsm_tty_open(struct uart_port *port) > channel->ch_cached_lsr = 0; > channel->ch_stops_sent = 0; > > + spin_lock_irqsave(&port->lock, lock_flags); > termios = &port->state->port.tty->termios; > channel->ch_c_cflag = termios->c_cflag; > channel->ch_c_iflag = termios->c_iflag; > @@ -259,6 +261,7 @@ static int jsm_tty_open(struct uart_port *port) > jsm_carrier(channel); > > channel->ch_open_count++; > + spin_unlock_irqrestore(&port->lock, lock_flags); > > jsm_dbg(OPEN, &channel->ch_bd->pci_dev, "finish\n"); > return 0; > -- js suse labs