From patchwork Tue Jul 27 10:05:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 12402247 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 61D4BC432BE for ; Tue, 27 Jul 2021 10:05:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 447B161502 for ; Tue, 27 Jul 2021 10:05:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236131AbhG0KFl (ORCPT ); Tue, 27 Jul 2021 06:05:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43754 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236114AbhG0KFi (ORCPT ); Tue, 27 Jul 2021 06:05:38 -0400 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FD2DC061760 for ; Tue, 27 Jul 2021 03:05:36 -0700 (PDT) Received: by mail-wm1-x32e.google.com with SMTP id u15so3801483wmj.1 for ; Tue, 27 Jul 2021 03:05:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=nF64hrCt+iysrWcIxiwBk9hVVpCYT1t38dbYkFkUu9c=; b=CStKikPTlXNXft2gxGvH3D0Vurm1lfjh3TnXMKa7nxsBgBWXYmXtf72ubLu6ZOU83u ClVInJbfqfPSE3uNKZRGjyMYq1WmFMkWId2TbJ24Fnc/sHBckjZ6Cld0VcNSGItTjyxK AinWCsTDqhpl3rvrkp+o4qfwXhdu5HWu6//F8CVQguGIVGvPj4KVm3alENGa276DCQGa lfubIuEli/VkOEldRN9uOhMR5P0x9NvW9dArzNI7IkuwYdvTYItTvFxytYqNr9Mmo619 cnGRvhfYSClltQw/Kygad+DaDVO1KEY4QMH6FX7zhwpWLV68HrLhVfjg1JIgp62KVKLI NdXA== 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=nF64hrCt+iysrWcIxiwBk9hVVpCYT1t38dbYkFkUu9c=; b=ngKcSkf9hAVuMQnJ3nrd8VxGxff9Ifmjn1Re6Czm9FKta8nIydAd6a+S60+MZbgB6F Bqt92hz/Jv1MDl7hnQgQwNFORmYNdGRTdCT9jXvAt4+3d1h8PSgwq0Caz9UOV+pLCcJr riQo0eWpJC7sfrdTjcxL/OtqZuiWqhRvFNxqXyxjSk8F4fG62jL0z6p15MhaeQitjV2z 1PNXSRKe4oG7VJ9sIAM4i8egYu1RW5xtxz+9LifWYXDTTdGDaE6rTZv2ApxnvcfRs7Sw uNlt1bPZK9Op7smRBs3yzmdVYo1ekBDbOwrN7sG16pi07GoocrDl/UplchfJjjW2SrWh SOsQ== X-Gm-Message-State: AOAM530S96cS+ioUewTJdhNZ5olqkY3Dc5XKuN7njjeyip8wHd+ATvai ajF+B0mpZpB5uaoGLQ1BjK1nrg== X-Google-Smtp-Source: ABdhPJxaopeXdvHv8ScBCBLMZyMkJiuwF2lwSqLvIdKGnGrjC1jtZPyyjtaFgRYYOXfszmmyUhNmSw== X-Received: by 2002:a1c:7208:: with SMTP id n8mr3064975wmc.89.1627380334520; Tue, 27 Jul 2021 03:05:34 -0700 (PDT) Received: from arch-thunder.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id v5sm2813221wrd.74.2021.07.27.03.05.33 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 03:05:34 -0700 (PDT) From: Rui Miguel Silva To: Greg Kroah-Hartman , Dan Carpenter Cc: linux-usb@vger.kernel.org, Rui Miguel Silva Subject: [PATCH 1/3] usb: isp1760: remove debug message as error Date: Tue, 27 Jul 2021 11:05:14 +0100 Message-Id: <20210727100516.4190681-2-rui.silva@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210727100516.4190681-1-rui.silva@linaro.org> References: <20210727100516.4190681-1-rui.silva@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Remove debug message leftover from the boot error buffer. Signed-off-by: Rui Miguel Silva --- drivers/usb/isp1760/isp1760-hcd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c index 27168b4a4ef2..a745c4c2b773 100644 --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -733,7 +733,6 @@ static int isp1760_hc_setup(struct usb_hcd *hcd) /* Change bus pattern */ scratch = isp1760_hcd_read(hcd, HC_CHIP_ID_HIGH); - dev_err(hcd->self.controller, "Scratch test 0x%08x\n", scratch); scratch = isp1760_hcd_read(hcd, HC_SCRATCH); if (scratch != pattern) { dev_err(hcd->self.controller, "Scratch test failed. 0x%08x\n", scratch); From patchwork Tue Jul 27 10:05:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 12402245 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 506A4C4320A for ; Tue, 27 Jul 2021 10:05:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 30D9661406 for ; Tue, 27 Jul 2021 10:05:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236088AbhG0KFj (ORCPT ); Tue, 27 Jul 2021 06:05:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236121AbhG0KFi (ORCPT ); Tue, 27 Jul 2021 06:05:38 -0400 Received: from mail-wr1-x435.google.com (mail-wr1-x435.google.com [IPv6:2a00:1450:4864:20::435]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0CE55C061764 for ; Tue, 27 Jul 2021 03:05:38 -0700 (PDT) Received: by mail-wr1-x435.google.com with SMTP id b7so14498671wri.8 for ; Tue, 27 Jul 2021 03:05:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=JOagArgEWpixkvsrs3w9VqgA+Mdd1pGQqUhf0Rf7SZQ=; b=hyk43kr+3uM67W2MUwA4XTVln3qP01fL2KawL072h32O6Lj5SZ0fCb7ba2VZAKB/bh mYqORToiB5XFJHfhHrhPPpAhqxZJaBfV3W0Pwy2LaXguVwPuNRd4a+UHCAr9SPg1NhZK 5q+mdnGMnuFbVGWxtyuo546miyNlJGd/QCCztFYHzc1S7ytueW1J8exdtv2q/OKVAXPJ vBivfl88TmUZSBo+VU/ELfDayWIS8Oh6Zb0TVGdtJwJ6s0gr6iptZYx43E3MAj4lQ+uQ QjOViUspXXtAv4rpr859W07do3ZtSCfnv74xN3mIFBvVWWv7IxIYFKRhK3slJCM3qwUM bvZw== 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=JOagArgEWpixkvsrs3w9VqgA+Mdd1pGQqUhf0Rf7SZQ=; b=Yea/H2MhdA5FH4yd2gSJRArPqDd6h9ibtRigVXEMCSjvRZ+NN4uekAUiPI9e0xDQl2 ChmboVBzY/qjWqseS7USz31YFfr3CWo5w0LUsuasd0kLOc0DnS5egpAQAcx4cUVO9I8v Bg1RLMsE3GQwQQ5gyH2waR2nF/7rjv83zt97kuuE8ynxoiTYjMHAZ969p11fcW9sEJmV cxLSmfd/9zu6qPGKdIeiFHMF2g7dI7+flhN7hZbjCA6BBrJSYcGhHceA439iUptOrH/4 Zot+oLWb8dGgYhxRE/DrEvbAdbCa1GMnJAe1m0yfIh219E/TIDtjw47o0nAvtAPEjagT AGVA== X-Gm-Message-State: AOAM533xLi84/0pvDbKpA0DuzRVsdl9r8ppSHIkeHTHVbt/elYaEs/Pp H0XuoxKRFuX1SYHB++0FxrPaxPSicJvf1A== X-Google-Smtp-Source: ABdhPJzgRAj/n0LUzSMtt5BWmpiizfNx3oF4JxdlGCfPjY27Slun+44arg7RT1/wzMi/EMV3bwZu/Q== X-Received: by 2002:adf:e10c:: with SMTP id t12mr23492506wrz.36.1627380336714; Tue, 27 Jul 2021 03:05:36 -0700 (PDT) Received: from arch-thunder.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id v5sm2813221wrd.74.2021.07.27.03.05.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 03:05:36 -0700 (PDT) From: Rui Miguel Silva To: Greg Kroah-Hartman , Dan Carpenter Cc: linux-usb@vger.kernel.org, Rui Miguel Silva Subject: [PATCH 2/3] usb: isp1760: do not sleep in field register poll Date: Tue, 27 Jul 2021 11:05:15 +0100 Message-Id: <20210727100516.4190681-3-rui.silva@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210727100516.4190681-1-rui.silva@linaro.org> References: <20210727100516.4190681-1-rui.silva@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org When polling for a setup or clear of a register field we were sleeping in atomic context but using a very tight sleep interval. Since the use cases for this poll mechanism are only in setup and stop paths, and in practice this poll is not used most of the times but needs to be there to comply to hardware setup times, remove the sleep time and make the poll loop tighter. Reported-by: Dan Carpenter Signed-off-by: Rui Miguel Silva --- drivers/usb/isp1760/isp1760-hcd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c index a745c4c2b773..a018394d54f8 100644 --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -250,7 +250,7 @@ static int isp1760_hcd_set_and_wait(struct usb_hcd *hcd, u32 field, isp1760_hcd_set(hcd, field); return regmap_field_read_poll_timeout(priv->fields[field], val, - val, 10, timeout_us); + val, 0, timeout_us); } static int isp1760_hcd_set_and_wait_swap(struct usb_hcd *hcd, u32 field, @@ -262,7 +262,7 @@ static int isp1760_hcd_set_and_wait_swap(struct usb_hcd *hcd, u32 field, isp1760_hcd_set(hcd, field); return regmap_field_read_poll_timeout(priv->fields[field], val, - !val, 10, timeout_us); + !val, 0, timeout_us); } static int isp1760_hcd_clear_and_wait(struct usb_hcd *hcd, u32 field, @@ -274,7 +274,7 @@ static int isp1760_hcd_clear_and_wait(struct usb_hcd *hcd, u32 field, isp1760_hcd_clear(hcd, field); return regmap_field_read_poll_timeout(priv->fields[field], val, - !val, 10, timeout_us); + !val, 0, timeout_us); } static bool isp1760_hcd_is_set(struct usb_hcd *hcd, u32 field) From patchwork Tue Jul 27 10:05:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rui Miguel Silva X-Patchwork-Id: 12402249 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=-18.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham 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 3B9BEC4338F for ; Tue, 27 Jul 2021 10:05:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1EB5A61409 for ; Tue, 27 Jul 2021 10:05:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236155AbhG0KFm (ORCPT ); Tue, 27 Jul 2021 06:05:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43772 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236104AbhG0KFk (ORCPT ); Tue, 27 Jul 2021 06:05:40 -0400 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C5F2C061757 for ; Tue, 27 Jul 2021 03:05:40 -0700 (PDT) Received: by mail-wr1-x429.google.com with SMTP id r2so14546862wrl.1 for ; Tue, 27 Jul 2021 03:05:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=Aj50P04AHvnNUWvmjhxhomiq5h7kyJzSIwB9k4QqcrQ=; b=FQiK5B8I6cuLEdYVKKJu2fURVfzQ149zbr6uDclVhTnuJ43t+E8+iWIIETJUdwCpBQ uURHJqr7cZbZSk5GdVIN1T/drYRfq4/Qd4BwMUV5ljMayUQ81w49bHc1PuIuhHj4UXTc 3Xowzl/aMrz8cS5D6c251+A+FfQY6iJ9XL7YDKcc4xM3AJi1pqF9+DADNWZoSLr+ZFG9 7GGjzldwggT8/UrgUO0GWkhsQ7sMU/ZYl8fdhVHK3GpwzimgjWeOlKRKwg5nuA+GDJHE Q9QioJrl67ByMPdm60RuQEeXoHIf2EWsckyO6cVX9FuitJxC4dEMERrXMBB9pv7nPnc/ PqHQ== 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=Aj50P04AHvnNUWvmjhxhomiq5h7kyJzSIwB9k4QqcrQ=; b=Y8JOZ6UJbcb5JdcCkFRgo02xiU/03XrnBsWELWPIgDQj7RqNAbQ+tyReIew6Mcq9kx gKKJf/o/smbbnR/hcOGnn+93cWJfKengtSjto+jreImHdVjGO+N2DFx1ohFNkGa55VTw VliXYMZShAQj2edNCbrUwiyznrQHCXLysRQPiohwuld5rcI+4Fvv0/sTkJ/rs/s/spwp YVkoxT0t33amwWE1Ld2VudwO/cW2MYg4+5VBK0lD8EH6Ju9hZF3HqjJeAVorDB+jvlGz n4OVVKAxSzLf2a3LJT/4vHSp4paG8Lb0yRlUAn/pKYIV1cv/MpvpRtp1Fr8hzFtMkuXB SHPg== X-Gm-Message-State: AOAM531Url74Smw9gPmyWwC1KqQCxaXytX6hN0EcDU5O5blAS0q0Q34n Jse5tqQqYOEIoYGTu6pAswE+nQ== X-Google-Smtp-Source: ABdhPJwUkDDWrw1NzUGIFldmVQQ3/D0dMe8QBfy2aTUlIKiaVIVVlpvZzynJn47Z5DmE4N05RoQiWg== X-Received: by 2002:adf:ed0a:: with SMTP id a10mr15058200wro.30.1627380338637; Tue, 27 Jul 2021 03:05:38 -0700 (PDT) Received: from arch-thunder.local (a109-49-46-234.cpe.netcabo.pt. [109.49.46.234]) by smtp.gmail.com with ESMTPSA id v5sm2813221wrd.74.2021.07.27.03.05.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 27 Jul 2021 03:05:38 -0700 (PDT) From: Rui Miguel Silva To: Greg Kroah-Hartman , Dan Carpenter Cc: linux-usb@vger.kernel.org, Rui Miguel Silva Subject: [PATCH 3/3] usb: isp1760: rework cache initialization error handling Date: Tue, 27 Jul 2021 11:05:16 +0100 Message-Id: <20210727100516.4190681-4-rui.silva@linaro.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20210727100516.4190681-1-rui.silva@linaro.org> References: <20210727100516.4190681-1-rui.silva@linaro.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org If we fail to create qtd cache we were not destroying the urb_listitem, rework the error handling logic to cope with that. Signed-off-by: Rui Miguel Silva --- drivers/usb/isp1760/isp1760-hcd.c | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/drivers/usb/isp1760/isp1760-hcd.c b/drivers/usb/isp1760/isp1760-hcd.c index a018394d54f8..825be736be33 100644 --- a/drivers/usb/isp1760/isp1760-hcd.c +++ b/drivers/usb/isp1760/isp1760-hcd.c @@ -2527,17 +2527,23 @@ int __init isp1760_init_kmem_once(void) SLAB_MEM_SPREAD, NULL); if (!qtd_cachep) - return -ENOMEM; + goto destroy_urb_listitem; qh_cachep = kmem_cache_create("isp1760_qh", sizeof(struct isp1760_qh), 0, SLAB_TEMPORARY | SLAB_MEM_SPREAD, NULL); - if (!qh_cachep) { - kmem_cache_destroy(qtd_cachep); - return -ENOMEM; - } + if (!qh_cachep) + goto destroy_qtd; return 0; + +destroy_qtd: + kmem_cache_destroy(qtd_cachep); + +destroy_urb_listitem: + kmem_cache_destroy(urb_listitem_cachep); + + return -ENOMEM; } void isp1760_deinit_kmem_cache(void)