Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp1393444pxj; Fri, 21 May 2021 13:08:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxhnOy1Md5OYchsaVLQNkdqeJ4r3KkHCgFbN1Bp37EnqlyEqn8tZpzIe3/fIX1uLpCPttrL X-Received: by 2002:a17:907:9612:: with SMTP id gb18mr12054488ejc.408.1621627712044; Fri, 21 May 2021 13:08:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621627712; cv=none; d=google.com; s=arc-20160816; b=PWlRoCRUM840C1djRJedN9l/9OvhQ59ZU8sT/Ds8gj/LqzTWgr4N/jRYEUKpOP7ycx AfdjxFyOWJ+Me8Y4u+7/gZ8PuuEUuGIvCNh101ariAVhF52hVJo5IjAoUhpAuLtTb79B 1sS7dpJ3CSgJQ2MjzTwVcZwEqteEpRqw/tmFoKpjcL9yohuuXxuM7W5vEOW4oB3MzYZ+ iAuGyK7fhVVrzWDkGW3wBYHRVdP8OpTY4n7L+/ZrjTBcz9ePZvbsG6uOn9t1aQht6CfQ spALfIgR+OclnTMB8pVJVGCQqR2K1BKvs4Vr/iOz9ebf2Aqo49ja6a8MlR1LM/Z09pgG mbaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=TCSk6ZN1/eygnuOx0t4dy7Ax9/54pUceMCzKxdgLYDA=; b=sK4yoczqjpw3YEyh1b6fZItNqcbpFYu77NeBM8uY+wTI5yWK3ScUyMOa3zaBe48Ii7 7zdGJWbGJybHm/z8kUoa22snxob3wY7DjM1p9ryWtl3OZSzY7SV+WkzMatMzb1OIIhlX i0B4LJmp7hlikXCIm3BKvaEvApjv/T0TUTgT4pXmTCrnEhgTXATlUuwSPPZ7+dmXORZB jTYavgxrkeUHqaCGuUkaQ1BigfWke1HgZsAqSP/KZwP6hj3n8OLx6XyfsyKjTOb3wdqs yqTgpQFgtA7kNohF/Xk0MBuKBiS+L/V7QxAvHw+uS2HGAKK/cQI0x3psQyAU0JtDIKXM bDCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j8d1j97W; 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=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id b5si5946513edf.3.2021.05.21.13.08.09; Fri, 21 May 2021 13:08:32 -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; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=j8d1j97W; 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=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234224AbhEUGwn (ORCPT + 99 others); Fri, 21 May 2021 02:52:43 -0400 Received: from mail.kernel.org ([198.145.29.99]:33800 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232426AbhEUGwn (ORCPT ); Fri, 21 May 2021 02:52:43 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id ADCE3613BB; Fri, 21 May 2021 06:51:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1621579880; bh=+TlRkCWv2IP2OKDhEW+sR4mAR64PA70bKtB4aLP10Zc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=j8d1j97W11QegLjc7T5xwLpNoyeTn3bTbA4g1L7CPyFcKmgQMp9CZrgWvI6dwR1jK ifeU6OV9FXRCKQIJVx3JshqjtZcDhanD+B2+TKTeanp+WAhu9K7WCvfOL8fFfWsEy5 LfBFiK6oj0iRbHARJ+n5G4R8G8hiX+pbRZv3recc= Date: Fri, 21 May 2021 08:51:16 +0200 From: Greg KH To: Zheyu Ma Cc: cernekee@gmail.com, jirislaby@kernel.org, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] serial: rp2: use 'request_firmware' instead of 'request_firmware_nowait' Message-ID: References: <1621577323-1541-1-git-send-email-zheyuma97@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1621577323-1541-1-git-send-email-zheyuma97@gmail.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 21, 2021 at 06:08:43AM +0000, Zheyu Ma wrote: > In 'rp2_probe', the driver registers 'rp2_uart_interrupt' then calls > 'rp2_fw_cb' through 'request_firmware_nowait'. In 'rp2_fw_cb', if the > firmware don't exists, function just return without initializing ports > of 'rp2_card'. But now the interrupt handler function has been > registered, and when an interrupt comes, 'rp2_uart_interrupt' may access > those ports then causing NULL pointer dereference or other bugs. > > Because the driver does some initialization work in 'rp2_fw_cb', in > order to make the driver ready to handle interrupts, 'request_firmware' > should be used instead of asynchronous 'request_firmware_nowait'. You just now slowed down the probe function. Are you _sure_ this is ok? Do you have this hardware to test this? If so, what is the init time before and after this change? thanks, greg k-h