forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-01-31 f70575805708cabdedea7498aaa3f710fde4d920
kernel/drivers/scsi/mpt3sas/mpt3sas_warpdrive.c
....@@ -127,20 +127,17 @@
127127 return;
128128
129129 if (ioc->mfg_pg10_hide_flag == MFG_PAGE10_EXPOSE_ALL_DISKS) {
130
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled "
131
- "globally as drives are exposed\n", ioc->name);
130
+ ioc_info(ioc, "WarpDrive : Direct IO is disabled globally as drives are exposed\n");
132131 return;
133132 }
134133 if (mpt3sas_get_num_volumes(ioc) > 1) {
135134 _warpdrive_disable_ddio(ioc);
136
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled "
137
- "globally as number of drives > 1\n", ioc->name);
135
+ ioc_info(ioc, "WarpDrive : Direct IO is disabled globally as number of drives > 1\n");
138136 return;
139137 }
140138 if ((mpt3sas_config_get_number_pds(ioc, raid_device->handle,
141139 &num_pds)) || !num_pds) {
142
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled "
143
- "Failure in computing number of drives\n", ioc->name);
140
+ ioc_info(ioc, "WarpDrive : Direct IO is disabled Failure in computing number of drives\n");
144141 return;
145142 }
146143
....@@ -148,15 +145,13 @@
148145 sizeof(Mpi2RaidVol0PhysDisk_t));
149146 vol_pg0 = kzalloc(sz, GFP_KERNEL);
150147 if (!vol_pg0) {
151
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled "
152
- "Memory allocation failure for RVPG0\n", ioc->name);
148
+ ioc_info(ioc, "WarpDrive : Direct IO is disabled Memory allocation failure for RVPG0\n");
153149 return;
154150 }
155151
156152 if ((mpt3sas_config_get_raid_volume_pg0(ioc, &mpi_reply, vol_pg0,
157153 MPI2_RAID_VOLUME_PGAD_FORM_HANDLE, raid_device->handle, sz))) {
158
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled "
159
- "Failure in retrieving RVPG0\n", ioc->name);
154
+ ioc_info(ioc, "WarpDrive : Direct IO is disabled Failure in retrieving RVPG0\n");
160155 kfree(vol_pg0);
161156 return;
162157 }
....@@ -166,10 +161,8 @@
166161 * assumed for WARPDRIVE, disable direct I/O
167162 */
168163 if (num_pds > MPT_MAX_WARPDRIVE_PDS) {
169
- pr_warn(MPT3SAS_FMT "WarpDrive : Direct IO is disabled "
170
- "for the drive with handle(0x%04x): num_mem=%d, "
171
- "max_mem_allowed=%d\n", ioc->name, raid_device->handle,
172
- num_pds, MPT_MAX_WARPDRIVE_PDS);
164
+ ioc_warn(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x): num_mem=%d, max_mem_allowed=%d\n",
165
+ raid_device->handle, num_pds, MPT_MAX_WARPDRIVE_PDS);
173166 kfree(vol_pg0);
174167 return;
175168 }
....@@ -179,22 +172,18 @@
179172 vol_pg0->PhysDisk[count].PhysDiskNum) ||
180173 le16_to_cpu(pd_pg0.DevHandle) ==
181174 MPT3SAS_INVALID_DEVICE_HANDLE) {
182
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is "
183
- "disabled for the drive with handle(0x%04x) member"
184
- "handle retrieval failed for member number=%d\n",
185
- ioc->name, raid_device->handle,
186
- vol_pg0->PhysDisk[count].PhysDiskNum);
175
+ ioc_info(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x) member handle retrieval failed for member number=%d\n",
176
+ raid_device->handle,
177
+ vol_pg0->PhysDisk[count].PhysDiskNum);
187178 goto out_error;
188179 }
189180 /* Disable direct I/O if member drive lba exceeds 4 bytes */
190181 dev_max_lba = le64_to_cpu(pd_pg0.DeviceMaxLBA);
191182 if (dev_max_lba >> 32) {
192
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is "
193
- "disabled for the drive with handle(0x%04x) member"
194
- " handle (0x%04x) unsupported max lba 0x%016llx\n",
195
- ioc->name, raid_device->handle,
196
- le16_to_cpu(pd_pg0.DevHandle),
197
- (unsigned long long)dev_max_lba);
183
+ ioc_info(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x) member handle (0x%04x) unsupported max lba 0x%016llx\n",
184
+ raid_device->handle,
185
+ le16_to_cpu(pd_pg0.DevHandle),
186
+ (u64)dev_max_lba);
198187 goto out_error;
199188 }
200189
....@@ -206,41 +195,36 @@
206195 * not RAID0
207196 */
208197 if (raid_device->volume_type != MPI2_RAID_VOL_TYPE_RAID0) {
209
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled "
210
- "for the drive with handle(0x%04x): type=%d, "
211
- "s_sz=%uK, blk_size=%u\n", ioc->name,
212
- raid_device->handle, raid_device->volume_type,
213
- (le32_to_cpu(vol_pg0->StripeSize) *
214
- le16_to_cpu(vol_pg0->BlockSize)) / 1024,
215
- le16_to_cpu(vol_pg0->BlockSize));
198
+ ioc_info(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x): type=%d, s_sz=%uK, blk_size=%u\n",
199
+ raid_device->handle, raid_device->volume_type,
200
+ (le32_to_cpu(vol_pg0->StripeSize) *
201
+ le16_to_cpu(vol_pg0->BlockSize)) / 1024,
202
+ le16_to_cpu(vol_pg0->BlockSize));
216203 goto out_error;
217204 }
218205
219206 stripe_sz = le32_to_cpu(vol_pg0->StripeSize);
220207 stripe_exp = find_first_bit(&stripe_sz, 32);
221208 if (stripe_exp == 32) {
222
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled "
223
- "for the drive with handle(0x%04x) invalid stripe sz %uK\n",
224
- ioc->name, raid_device->handle,
225
- (le32_to_cpu(vol_pg0->StripeSize) *
226
- le16_to_cpu(vol_pg0->BlockSize)) / 1024);
209
+ ioc_info(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x) invalid stripe sz %uK\n",
210
+ raid_device->handle,
211
+ (le32_to_cpu(vol_pg0->StripeSize) *
212
+ le16_to_cpu(vol_pg0->BlockSize)) / 1024);
227213 goto out_error;
228214 }
229215 raid_device->stripe_exponent = stripe_exp;
230216 block_sz = le16_to_cpu(vol_pg0->BlockSize);
231217 block_exp = find_first_bit(&block_sz, 16);
232218 if (block_exp == 16) {
233
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is disabled "
234
- "for the drive with handle(0x%04x) invalid block sz %u\n",
235
- ioc->name, raid_device->handle,
236
- le16_to_cpu(vol_pg0->BlockSize));
219
+ ioc_info(ioc, "WarpDrive : Direct IO is disabled for the drive with handle(0x%04x) invalid block sz %u\n",
220
+ raid_device->handle, le16_to_cpu(vol_pg0->BlockSize));
237221 goto out_error;
238222 }
239223 raid_device->block_exponent = block_exp;
240224 raid_device->direct_io_enabled = 1;
241225
242
- pr_info(MPT3SAS_FMT "WarpDrive : Direct IO is Enabled for the drive"
243
- " with handle(0x%04x)\n", ioc->name, raid_device->handle);
226
+ ioc_info(ioc, "WarpDrive : Direct IO is Enabled for the drive with handle(0x%04x)\n",
227
+ raid_device->handle);
244228 /*
245229 * WARPDRIVE: Though the following fields are not used for direct IO,
246230 * stored for future purpose: