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: 486679 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp68877jas; Tue, 27 Jul 2021 03:05:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzvaVbzRawtdozGumhFL849UAKpm+RZ1xfBBG9wO8SWf5qo8JrceXYkN/bTlVXUpomv9k8d X-Received: by 2002:a17:906:f104:: with SMTP id gv4mr21333910ejb.193.1627380342815; Tue, 27 Jul 2021 03:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627380342; cv=none; d=google.com; s=arc-20160816; b=YJvo42vlfC7t1Oc7eVce+lH94QpzWNrM/WJ2DF6SiaIxO4ZUxtfJBleJuTxBiQvQOL +Et/nElZr8ebdLQw2/+bUHLaqC9fJQ9eVpQmfLmL1iBrhkBD1kVWIl/ZSIBhYjm0yao/ bLqkIVSVLZz8AcqzwAhDm/LszPoTc1cfOosHm0tXiJZtTY8YinLm2/qBj6CFKK7tQ0ut vfQ7S+JKEV0U2bRtBbNxvw2cDbt7qEkjwU8bTLwRbENeLvrXl4bjNme528H8CmAGUC3R SXZPHQRQSpwLrJwd1xbpypWjPMbPfTg+aCorEDsbIS9X4xSZdayn8zqhu9dtKEUxpiNh +mzw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=nF64hrCt+iysrWcIxiwBk9hVVpCYT1t38dbYkFkUu9c=; b=P3aE4+akMcPphbDWmr95skLq8RxmT61V95+wtSRjkkJMzEKc+MzpBrA+19/l30eI2u yuXQD/n9fBe+jPQJee1z9ps8XhY0wnKwR8nsZ5qwxHCwhVx2LBoZ4ZOmigd5IL6uB/ce rGwmatubq/nMI+u5UzPs8kCk3oGHoyskstSeeSidz2MhOz/ez8DVHy9z6bV5CQlqIvfd LxKtAUqcLM8Rdzho85Q5c2O6ozI8Q5hX3NsaIqqGFmwL/6tnRLUBNnEPjfTkPIVcgPI3 H2VNHOfLx9ggc/hg7sxBWBDbZrivoe3y2Zj0G8PCb+1xWh/u60gmCPy/PQkqJnYigdVa XKsA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CStKikPT; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc24si2497771edb.193.2021.07.27.03.05.42; Tue, 27 Jul 2021 03:05:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CStKikPT; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236131AbhG0KFl (ORCPT + 4 others); 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-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(-) -- 2.32.0 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: 486678 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp68869jas; Tue, 27 Jul 2021 03:05:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyP2A+gFIrvqEk3r+oA7NX0L85ktfJiq9Rs8ZpOLOyPa4ZHae8v3KIVau9kgPjrIHUTb6mu X-Received: by 2002:aa7:c588:: with SMTP id g8mr8951741edq.33.1627380342456; Tue, 27 Jul 2021 03:05:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627380342; cv=none; d=google.com; s=arc-20160816; b=SPI7xKmuiP9mGwdOQ+zYUzO3tIzYmKTaHHXUy32a9W6lSFbw9L6khQg+AHzgM2xMzE SLFOLn/NnnYdzAFzGcA/JbN/ug95Fu64Qu0LxCjiGW0OYvA/KAv3znaqr+tCskUI7xjD VLXKKB8+qUY8qBj3OHJErO+QMR818+q8vPsxQhMzIY89xZugscLRAAZjGrtsdLMeT8y7 nTgRIV4pJinVpZgHd4fozIV12I6zp0vS3LEWjzu9s+fajG9rllqibw73/vIdO+UemTgk Uv+UFlIJqicNGwmqon+BngvyyO7OAvZTbe4xfC05R2APaoQ8XYe2g/ryb6sS+4PAgl4m 1SCQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=JOagArgEWpixkvsrs3w9VqgA+Mdd1pGQqUhf0Rf7SZQ=; b=cdy/qM3lRXDhiSb0EYIgvM2hcQ7axUMKs5RUWqx5gSX+zwkkv1dU9IpNWJewNHaVWu 0mdTJnUaxmUvacA4em/2hoXkHE3RG36NI2Yt3UNKI0RZxAg+leQwB/ngjLzMKCT7ihmE NQBkbzcFhkf9bcuUHsbuJ214CauDtBrf4BZKuIiGDMW1iDITkdnntKdkLYCxH4z+h510 wGeRVglF3Govt0wsVwfNTm1zvlhPCWhmGepgtg5IUPuyhe5q+C6PfXelktUwtNOekwYt yw2/HChMJ9oumqn6VD0gK5uFrPkrRUAuetXRrwDAEq3NsakuPAufelPFWSKO8j7YELjo 3h5w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hyk43kr+; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc24si2497771edb.193.2021.07.27.03.05.42; Tue, 27 Jul 2021 03:05:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=hyk43kr+; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236088AbhG0KFj (ORCPT + 4 others); 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-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(-) -- 2.32.0 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: 486680 Delivered-To: patch@linaro.org Received: by 2002:a05:6638:1185:0:0:0:0 with SMTP id f5csp68895jas; Tue, 27 Jul 2021 03:05:44 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw4WUPUmEInIAClEmgD6FKVxklRjc89jnjx8XGmumkRPfMgaaJhd6O0xMIYia2lP+9qANjB X-Received: by 2002:a17:906:43c9:: with SMTP id j9mr20824858ejn.57.1627380344339; Tue, 27 Jul 2021 03:05:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1627380344; cv=none; d=google.com; s=arc-20160816; b=VGwXDssq/7COuY7tE1nP8u72TLZfIdZ6amFA5Em0Fq3IT91MGov/Yx3k2rX/KF6gBi rLVBPclx065T9ipsxYG4GOFrpDociKwDiParzeDBeD13zIxFBnqaejO2vJtB+spDI3YR 4Ss95k8gW0sjlwkJI6LUgmzzPn1aoZcZ/heEaabwrRdkwQgHDS3eWGWH4C5p3hLSAlve q+7+XjmJ2sTh5PAfZmCHJCee4zIcLluwmc5KCNobEX2cHGRIz46EhD6OdpkgzYOdu2fN 9dQos/sujRLoORZqFuARFnzFQcNHs5lghw2cHBMiCRUc1VQXJsSYl/BzA5KyJInh8BpZ XAOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Aj50P04AHvnNUWvmjhxhomiq5h7kyJzSIwB9k4QqcrQ=; b=nIsbYmzQsfWVpsIuxq14L+BvL5C/66Qi/O/1dDh9pABnAoqgbkgnSgi7oOTo1RUHgc k41Xpcmgj2rHlcqyeCHoncA/SQ4Hbp8GSF0h+KTaXGvJxyX3u0MGT0p8a2xgFC+oF0XQ aG5t4YkoaN3yZlKPD3KVL6GTBsMFg7npMTRYJHXdtwM6pFYnidgwiuw0FG7I2BtIMcnS iRuHKlgGDyZ7ENjNdweEdN1FrEjDmwx3sCXPcCuB127jtKjZwEQ9UIjT13gwr5E4t5/F kujZuw7jKMWGa152LymrmWL3BVzpr4DXPVOxMbM50a8sLOYYrKtty6LYzJlMNb/0xszT OsIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FQiK5B8I; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dc24si2497771edb.193.2021.07.27.03.05.44; Tue, 27 Jul 2021 03:05:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=FQiK5B8I; spf=pass (google.com: domain of linux-usb-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-usb-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236155AbhG0KFm (ORCPT + 4 others); 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-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(-) -- 2.32.0 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)