diff options
author | Herton Ronaldo Krzesinski <herton@mandriva.com.br> | 2010-03-19 18:37:26 -0400 |
---|---|---|
committer | James Bottomley <James.Bottomley@suse.de> | 2010-03-27 15:12:37 -0400 |
commit | cf7474451c3a3cf07811abbf2a39536d33046c36 (patch) | |
tree | 7e9336395862432e8f2146f490fbc936705ac610 /drivers | |
parent | 89162e9c21de3cb3b7e9e29d50cb7c3e88a09e2b (diff) |
[SCSI] advansys: fix regression with request_firmware change
On newer kernels users of advansys module are reporting system hang when
trying to load it without firmware files present. After looking closely
at description on https://qa.mandriva.com/show_bug.cgi?id=53220, I think
this is related to commit "[SCSI] advansys: use request_firmware". The
problem is that after switch to request_firmware, asc_dvc->err_code
isn't being set when firmware files aren't found or loading fails.
err_code is used by the driver to judge if there was a fatal error or
not, as can be seen for example on advansys_board_found, which will only
return -ENODEV when err_code is set. Because err_code isn't being set
when request_firmware fails, this is a change of behaviour of the code
before request_firmware addition, making it continue to load and it
fails later as the firmware wasn't really loaded.
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: James Bottomley <James.Bottomley@suse.de>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/scsi/advansys.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/drivers/scsi/advansys.c b/drivers/scsi/advansys.c index 22626abdb630..9201afe65609 100644 --- a/drivers/scsi/advansys.c +++ b/drivers/scsi/advansys.c | |||
@@ -4781,12 +4781,14 @@ static ushort AscInitAsc1000Driver(ASC_DVC_VAR *asc_dvc) | |||
4781 | if (err) { | 4781 | if (err) { |
4782 | printk(KERN_ERR "Failed to load image \"%s\" err %d\n", | 4782 | printk(KERN_ERR "Failed to load image \"%s\" err %d\n", |
4783 | fwname, err); | 4783 | fwname, err); |
4784 | asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM; | ||
4784 | return err; | 4785 | return err; |
4785 | } | 4786 | } |
4786 | if (fw->size < 4) { | 4787 | if (fw->size < 4) { |
4787 | printk(KERN_ERR "Bogus length %zu in image \"%s\"\n", | 4788 | printk(KERN_ERR "Bogus length %zu in image \"%s\"\n", |
4788 | fw->size, fwname); | 4789 | fw->size, fwname); |
4789 | release_firmware(fw); | 4790 | release_firmware(fw); |
4791 | asc_dvc->err_code |= ASC_IERR_MCODE_CHKSUM; | ||
4790 | return -EINVAL; | 4792 | return -EINVAL; |
4791 | } | 4793 | } |
4792 | chksum = (fw->data[3] << 24) | (fw->data[2] << 16) | | 4794 | chksum = (fw->data[3] << 24) | (fw->data[2] << 16) | |
@@ -5110,12 +5112,14 @@ static int AdvInitAsc3550Driver(ADV_DVC_VAR *asc_dvc) | |||
5110 | if (err) { | 5112 | if (err) { |
5111 | printk(KERN_ERR "Failed to load image \"%s\" err %d\n", | 5113 | printk(KERN_ERR "Failed to load image \"%s\" err %d\n", |
5112 | fwname, err); | 5114 | fwname, err); |
5115 | asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM; | ||
5113 | return err; | 5116 | return err; |
5114 | } | 5117 | } |
5115 | if (fw->size < 4) { | 5118 | if (fw->size < 4) { |
5116 | printk(KERN_ERR "Bogus length %zu in image \"%s\"\n", | 5119 | printk(KERN_ERR "Bogus length %zu in image \"%s\"\n", |
5117 | fw->size, fwname); | 5120 | fw->size, fwname); |
5118 | release_firmware(fw); | 5121 | release_firmware(fw); |
5122 | asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM; | ||
5119 | return -EINVAL; | 5123 | return -EINVAL; |
5120 | } | 5124 | } |
5121 | chksum = (fw->data[3] << 24) | (fw->data[2] << 16) | | 5125 | chksum = (fw->data[3] << 24) | (fw->data[2] << 16) | |
@@ -5624,12 +5628,14 @@ static int AdvInitAsc38C0800Driver(ADV_DVC_VAR *asc_dvc) | |||
5624 | if (err) { | 5628 | if (err) { |
5625 | printk(KERN_ERR "Failed to load image \"%s\" err %d\n", | 5629 | printk(KERN_ERR "Failed to load image \"%s\" err %d\n", |
5626 | fwname, err); | 5630 | fwname, err); |
5631 | asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM; | ||
5627 | return err; | 5632 | return err; |
5628 | } | 5633 | } |
5629 | if (fw->size < 4) { | 5634 | if (fw->size < 4) { |
5630 | printk(KERN_ERR "Bogus length %zu in image \"%s\"\n", | 5635 | printk(KERN_ERR "Bogus length %zu in image \"%s\"\n", |
5631 | fw->size, fwname); | 5636 | fw->size, fwname); |
5632 | release_firmware(fw); | 5637 | release_firmware(fw); |
5638 | asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM; | ||
5633 | return -EINVAL; | 5639 | return -EINVAL; |
5634 | } | 5640 | } |
5635 | chksum = (fw->data[3] << 24) | (fw->data[2] << 16) | | 5641 | chksum = (fw->data[3] << 24) | (fw->data[2] << 16) | |
@@ -6124,12 +6130,14 @@ static int AdvInitAsc38C1600Driver(ADV_DVC_VAR *asc_dvc) | |||
6124 | if (err) { | 6130 | if (err) { |
6125 | printk(KERN_ERR "Failed to load image \"%s\" err %d\n", | 6131 | printk(KERN_ERR "Failed to load image \"%s\" err %d\n", |
6126 | fwname, err); | 6132 | fwname, err); |
6133 | asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM; | ||
6127 | return err; | 6134 | return err; |
6128 | } | 6135 | } |
6129 | if (fw->size < 4) { | 6136 | if (fw->size < 4) { |
6130 | printk(KERN_ERR "Bogus length %zu in image \"%s\"\n", | 6137 | printk(KERN_ERR "Bogus length %zu in image \"%s\"\n", |
6131 | fw->size, fwname); | 6138 | fw->size, fwname); |
6132 | release_firmware(fw); | 6139 | release_firmware(fw); |
6140 | asc_dvc->err_code = ASC_IERR_MCODE_CHKSUM; | ||
6133 | return -EINVAL; | 6141 | return -EINVAL; |
6134 | } | 6142 | } |
6135 | chksum = (fw->data[3] << 24) | (fw->data[2] << 16) | | 6143 | chksum = (fw->data[3] << 24) | (fw->data[2] << 16) | |