From patchwork Mon May 6 12:55:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suwan Kim X-Patchwork-Id: 10931027 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8156592A for ; Mon, 6 May 2019 12:57:09 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6F9CE26E47 for ; Mon, 6 May 2019 12:57:09 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 630D228609; Mon, 6 May 2019 12:57:09 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17B5026E47 for ; Mon, 6 May 2019 12:57:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726201AbfEFM5E (ORCPT ); Mon, 6 May 2019 08:57:04 -0400 Received: from mail-pg1-f194.google.com ([209.85.215.194]:38494 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726063AbfEFM5D (ORCPT ); Mon, 6 May 2019 08:57:03 -0400 Received: by mail-pg1-f194.google.com with SMTP id j26so6433624pgl.5; Mon, 06 May 2019 05:57:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gzoB/vSPy7jV2JtU428m1t1ku5bTXMAWeaZM/6A39iU=; b=W4r0BE66i2CPd5/7c7uxJhGlxwXYx50xJM+iuUZu5QVKq0cKxK9cTqA9iDnUu+aeXo RsSe0/Pnp0b0Q0v+rveMzRPIMyfXd72Q3AN0VMgaiNEE74shO9fANQs9+LjtdEwww7tP 1WI22QUqPenHKQWiU9ro+gqWySQu2SnDHoHWThdaS2hEuEDdnECwYL0crgI6qFPDYIy4 GzuCo5g7tVBrJ/LDsPdAEclfIxzbBnY03KknA1AiO4BDKGsg3CCr9KagzBL2SrAdsp0s Zp6l0d7BnF6pwXiRxFkjqdS/4V51GQ1gRQ13/g8306Pe9GT9voMVtt+KeWNCHti95M3Y bNBw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=gzoB/vSPy7jV2JtU428m1t1ku5bTXMAWeaZM/6A39iU=; b=e9w5d8CGCuMlEFxuPmEImyIl2iJcfX9pPXg6IoDHyzYiAwNpcebjr2xKMp88v37Yv3 0lJoEawlKxtjNNlS9qLHJvtyRnYJAUHJ5/wuUNPtoyeqvMvFQaacSmteoZgVYoKWm6fO K8W4NmC0UUhxjr7td7PIXjtddPFPLeeDJYGQXqF5zArD5tkmGtKCaRISMAoZ+bpA54nh aBMA8SAcJ+bUdZuvJMrgQUCSXW7i5Ij2o4mizcnFBG+5x3mPdUfky6Ut0W6GiuYtWhRg x2WlPqWZvNU3XPXj26IesD7tTwj2Exhqiet6LIrv5FvkpeMLsmgEzywW/YOu12GolT4v jLgg== X-Gm-Message-State: APjAAAVxyFbe5AtmTatBpVZemu4y1+EfvKYdC1l/Om1fcG9L8jjoRKHf +65xJ6KW9FuaNwpP/+h8i00hWg6yZAo= X-Google-Smtp-Source: APXvYqylMnmETjINQ99AZRx+UbFu7b0p8HUWnziDFoYNJN5BSre2S5wBOQLcAuCFAOF+tK1ATHHE4g== X-Received: by 2002:a63:1e0c:: with SMTP id e12mr30293701pge.218.1557147423234; Mon, 06 May 2019 05:57:03 -0700 (PDT) Received: from localhost.localdomain ([125.142.23.13]) by smtp.googlemail.com with ESMTPSA id a6sm13696382pfn.181.2019.05.06.05.57.01 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2019 05:57:02 -0700 (PDT) From: Suwan Kim To: shuah@kernel.org, valentina.manea.m@gmail.com, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Suwan Kim Subject: [PATCH 1/2] usbip: Remove repeated setting of hcd->state in vhci_bus_suspend() Date: Mon, 6 May 2019 21:55:49 +0900 Message-Id: <20190506125550.7826-1-suwan.kim027@gmail.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When hcd suspends execution, hcd_bus_suspend() calls vhci_bus_suspend() which sets hcd->state as HC_STATE_SUSPENDED. But after calling vhci_bus_suspend(), hcd_bus_suspend() also sets hcd->state as HC_STATE_SUSPENDED. So, setting hcd->state in vhci_hcd_suspend() is unnecessary. Signed-off-by: Suwan Kim --- drivers/usb/usbip/vhci_hcd.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index 667d9c0ec905..e6f378d00fb6 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1238,10 +1238,6 @@ static int vhci_bus_suspend(struct usb_hcd *hcd) dev_dbg(&hcd->self.root_hub->dev, "%s\n", __func__); - spin_lock_irqsave(&vhci->lock, flags); - hcd->state = HC_STATE_SUSPENDED; - spin_unlock_irqrestore(&vhci->lock, flags); - return 0; } From patchwork Mon May 6 12:55:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Suwan Kim X-Patchwork-Id: 10931035 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CD864924 for ; Mon, 6 May 2019 12:57:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BC820285AF for ; Mon, 6 May 2019 12:57:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B0C8E28630; Mon, 6 May 2019 12:57:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5C5EB285AF for ; Mon, 6 May 2019 12:57:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbfEFM51 (ORCPT ); Mon, 6 May 2019 08:57:27 -0400 Received: from mail-pl1-f195.google.com ([209.85.214.195]:41919 "EHLO mail-pl1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726147AbfEFM51 (ORCPT ); Mon, 6 May 2019 08:57:27 -0400 Received: by mail-pl1-f195.google.com with SMTP id d9so6342970pls.8; Mon, 06 May 2019 05:57:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=+F4BP6Z6pdgPYBmGiDkA2x8IUuujt5MWxpyaN1c1LKs=; b=ci7YCJu8+XUKg2RH1l7XMjiZfMGXRlgke94KizZTcHgAu/4ILy9koavEnzpOFp6d3r bnicWCemdUKK2FDI4I7bL2+Smk55v/5HqkV3SYS8/TxVGXTjAz3rVeCNvmXV2U+8yUso xnbWkC7aO+qaROgZHWtU9/PbAkwGFxbNkUJDqPwDYVDghdWEpYy5ukkwFBV9Lgre1vlh s3H3YsGq+6nafuECKlm6LkEeVLE7YNwFibHgzGwa1mExr+kYcyy2h6n2YpDuXCy45OQd gIQv/pYHU7/d9/X7E9ancWi8L5uTFMNKWrE6L95rvMQSXjMMQ0JBpttEqkzMk3MpckWF VPtA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=+F4BP6Z6pdgPYBmGiDkA2x8IUuujt5MWxpyaN1c1LKs=; b=rJDQJpg3FZ6xf9mva4hQhTlyz8HKt4HJ6V2CCbZLc40kY6NdlyHWo1YkOsLGzVQ3+S RMJs5crlJTVX6d4/SIlksVz4x5FKVYV8Gbgo+mgntIEKBugq4XUJK0jMPkzSapeMel0I 27aBk1cPQj9JqO886Z1n+rBV5ga+WPKGp6v6A9XPwwqEjoydg6SwIGYMZsFI6qjX4/Z2 jGqK2cnENJ3l0byz0L2ZzvqzDYIgmnoisKRI1auh12M3oIUPAHZgk5NjqZ6OW0c8MDQK JUFcZTs5J5Ddu70ACgKOz36EnYO7owZy8T9I6e0vk/b013vEvU3XJKDFHaw4wcab3H9a BPJQ== X-Gm-Message-State: APjAAAWVD8bbOqBb7PvwfNsJNLgglfbPA2+AdScPeg5Aw2A1q0tAgQdG GpfomHtIV0PFLacPqNi8Ddk/Tefn05s= X-Google-Smtp-Source: APXvYqzptrCaNBB1gCCDzvNE3XVvaRMoRZesFUuCFxpdpCnucKJPfLFldDhcTXa/OCsExmHmkkUx8A== X-Received: by 2002:a17:902:9a48:: with SMTP id x8mr32230389plv.133.1557147446632; Mon, 06 May 2019 05:57:26 -0700 (PDT) Received: from localhost.localdomain ([125.142.23.13]) by smtp.googlemail.com with ESMTPSA id a6sm13696382pfn.181.2019.05.06.05.57.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 06 May 2019 05:57:26 -0700 (PDT) From: Suwan Kim To: shuah@kernel.org, valentina.manea.m@gmail.com, gregkh@linuxfoundation.org Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Suwan Kim Subject: [PATCH 2/2] usbip: Remove repeated setting of hcd->state in vhci_bus_resume() Date: Mon, 6 May 2019 21:55:50 +0900 Message-Id: <20190506125550.7826-2-suwan.kim027@gmail.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190506125550.7826-1-suwan.kim027@gmail.com> References: <20190506125550.7826-1-suwan.kim027@gmail.com> MIME-Version: 1.0 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP When hcd resumes, hcd_bus_resume() calls vhci_bus_resume() which sets hcd->state as HC_STATE_RUNNING. But after calling vhci_bus_resume(), hcd_bus_resume() also sets hcd->state as HC_STATE_RUNNING. So, setting hcd->state in vhci_hcd_resume() is unnecessary. Signed-off-by: Suwan Kim --- drivers/usb/usbip/vhci_hcd.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/usb/usbip/vhci_hcd.c b/drivers/usb/usbip/vhci_hcd.c index e6f378d00fb6..335d61676fb4 100644 --- a/drivers/usb/usbip/vhci_hcd.c +++ b/drivers/usb/usbip/vhci_hcd.c @@ -1252,8 +1252,6 @@ static int vhci_bus_resume(struct usb_hcd *hcd) spin_lock_irqsave(&vhci->lock, flags); if (!HCD_HW_ACCESSIBLE(hcd)) rc = -ESHUTDOWN; - else - hcd->state = HC_STATE_RUNNING; spin_unlock_irqrestore(&vhci->lock, flags); return rc;