From: James Bottomley <jejb@linux.ibm.com>
To: Haoran Liu <liuhaoran14@163.com>
Cc: martin.petersen@oracle.com, linux-scsi@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] [scsi] lasi700: Add error handling in lasi700_probe
Date: Wed, 29 Nov 2023 11:14:24 -0500 [thread overview]
Message-ID: <fe077251fea010af59214049eea9681b8008852a.camel@linux.ibm.com> (raw)
In-Reply-To: <20231129145200.34596-1-liuhaoran14@163.com>
On Wed, 2023-11-29 at 06:52 -0800, Haoran Liu wrote:
> This patch introduces improved error handling for the dma_set_mask
> and ioremap calls in the lasi700_probe function within
> drivers/scsi/lasi700.c. Previously, the function did not properly
> handle the potential failure of these calls, which could lead to
> improper device initialization and unpredictable behavior.
I have to ask what the point of this is? There was once an
architecture that couldn't support 32 bit DMA masks (the altix), but
it's long gone. The structural assumption is that a 32 bit DMA mask
can always be set, so drivers with simple DMA requirements (32 or 64
bit) usually only check 64 and assume they can fallback to 32.
> Although the error addressed by this patch may not occur in the
> current environment, I still suggest implementing these error
> handling routines if the function is not highly time-sensitive. As
> the environment evolves or the code gets reused in different
> contexts, there's a possibility that these errors might occur.
> Addressing them now can prevent potential debugging efforts in the
> future, which could be quite resource-intensive.
This particular operation can never fail on the PA-RISC GSC device,
which is the only one this driver supports, so the driver currently has
no error handling because this is something that can't happen.
James
prev parent reply other threads:[~2023-11-29 16:14 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-29 14:52 [PATCH] [scsi] lasi700: Add error handling in lasi700_probe Haoran Liu
2023-11-29 16:14 ` James Bottomley [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=fe077251fea010af59214049eea9681b8008852a.camel@linux.ibm.com \
--to=jejb@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=liuhaoran14@163.com \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox