Skip to content

Commit d1ce8ce

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fixes from James Bottomley: "Two simple fixes: one for sparse warnings that were introduced by the merge window conversion to blist_flags_t and the other to fix dropped I/O during reset in aacraid" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: aacraid: Fix I/O drop during reset scsi: core: Use blist_flags_t consistently
2 parents 877631f + 5771cff commit d1ce8ce

File tree

6 files changed

+21
-18
lines changed

6 files changed

+21
-18
lines changed

drivers/scsi/aacraid/aacraid.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1725,6 +1725,7 @@ struct aac_dev
17251725
#define FIB_CONTEXT_FLAG_NATIVE_HBA (0x00000010)
17261726
#define FIB_CONTEXT_FLAG_NATIVE_HBA_TMF (0x00000020)
17271727
#define FIB_CONTEXT_FLAG_SCSI_CMD (0x00000040)
1728+
#define FIB_CONTEXT_FLAG_EH_RESET (0x00000080)
17281729

17291730
/*
17301731
* Define the command values

drivers/scsi/aacraid/linit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1037,7 +1037,7 @@ static int aac_eh_bus_reset(struct scsi_cmnd* cmd)
10371037
info = &aac->hba_map[bus][cid];
10381038
if (bus >= AAC_MAX_BUSES || cid >= AAC_MAX_TARGETS ||
10391039
info->devtype != AAC_DEVTYPE_NATIVE_RAW) {
1040-
fib->flags |= FIB_CONTEXT_FLAG_TIMED_OUT;
1040+
fib->flags |= FIB_CONTEXT_FLAG_EH_RESET;
10411041
cmd->SCp.phase = AAC_OWNER_ERROR_HANDLER;
10421042
}
10431043
}

drivers/scsi/scsi_devinfo.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -374,10 +374,8 @@ int scsi_dev_info_list_add_keyed(int compatible, char *vendor, char *model,
374374
model, compatible);
375375

376376
if (strflags)
377-
devinfo->flags = simple_strtoul(strflags, NULL, 0);
378-
else
379-
devinfo->flags = flags;
380-
377+
flags = (__force blist_flags_t)simple_strtoul(strflags, NULL, 0);
378+
devinfo->flags = flags;
381379
devinfo->compatible = compatible;
382380

383381
if (compatible)

drivers/scsi/scsi_scan.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -770,7 +770,7 @@ static int scsi_probe_lun(struct scsi_device *sdev, unsigned char *inq_result,
770770
* SCSI_SCAN_LUN_PRESENT: a new scsi_device was allocated and initialized
771771
**/
772772
static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
773-
int *bflags, int async)
773+
blist_flags_t *bflags, int async)
774774
{
775775
int ret;
776776

@@ -1049,14 +1049,15 @@ static unsigned char *scsi_inq_str(unsigned char *buf, unsigned char *inq,
10491049
* - SCSI_SCAN_LUN_PRESENT: a new scsi_device was allocated and initialized
10501050
**/
10511051
static int scsi_probe_and_add_lun(struct scsi_target *starget,
1052-
u64 lun, int *bflagsp,
1052+
u64 lun, blist_flags_t *bflagsp,
10531053
struct scsi_device **sdevp,
10541054
enum scsi_scan_mode rescan,
10551055
void *hostdata)
10561056
{
10571057
struct scsi_device *sdev;
10581058
unsigned char *result;
1059-
int bflags, res = SCSI_SCAN_NO_RESPONSE, result_len = 256;
1059+
blist_flags_t bflags;
1060+
int res = SCSI_SCAN_NO_RESPONSE, result_len = 256;
10601061
struct Scsi_Host *shost = dev_to_shost(starget->dev.parent);
10611062

10621063
/*
@@ -1201,7 +1202,7 @@ static int scsi_probe_and_add_lun(struct scsi_target *starget,
12011202
* Modifies sdevscan->lun.
12021203
**/
12031204
static void scsi_sequential_lun_scan(struct scsi_target *starget,
1204-
int bflags, int scsi_level,
1205+
blist_flags_t bflags, int scsi_level,
12051206
enum scsi_scan_mode rescan)
12061207
{
12071208
uint max_dev_lun;
@@ -1292,7 +1293,7 @@ static void scsi_sequential_lun_scan(struct scsi_target *starget,
12921293
* 0: scan completed (or no memory, so further scanning is futile)
12931294
* 1: could not scan with REPORT LUN
12941295
**/
1295-
static int scsi_report_lun_scan(struct scsi_target *starget, int bflags,
1296+
static int scsi_report_lun_scan(struct scsi_target *starget, blist_flags_t bflags,
12961297
enum scsi_scan_mode rescan)
12971298
{
12981299
unsigned char scsi_cmd[MAX_COMMAND_SIZE];
@@ -1538,7 +1539,7 @@ static void __scsi_scan_target(struct device *parent, unsigned int channel,
15381539
unsigned int id, u64 lun, enum scsi_scan_mode rescan)
15391540
{
15401541
struct Scsi_Host *shost = dev_to_shost(parent);
1541-
int bflags = 0;
1542+
blist_flags_t bflags = 0;
15421543
int res;
15431544
struct scsi_target *starget;
15441545

drivers/scsi/scsi_sysfs.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,8 @@ sdev_show_wwid(struct device *dev, struct device_attribute *attr,
967967
}
968968
static DEVICE_ATTR(wwid, S_IRUGO, sdev_show_wwid, NULL);
969969

970-
#define BLIST_FLAG_NAME(name) [ilog2(BLIST_##name)] = #name
970+
#define BLIST_FLAG_NAME(name) \
971+
[ilog2((__force unsigned int)BLIST_##name)] = #name
971972
static const char *const sdev_bflags_name[] = {
972973
#include "scsi_devinfo_tbl.c"
973974
};
@@ -984,7 +985,7 @@ sdev_show_blacklist(struct device *dev, struct device_attribute *attr,
984985
for (i = 0; i < sizeof(sdev->sdev_bflags) * BITS_PER_BYTE; i++) {
985986
const char *name = NULL;
986987

987-
if (!(sdev->sdev_bflags & BIT(i)))
988+
if (!(sdev->sdev_bflags & (__force blist_flags_t)BIT(i)))
988989
continue;
989990
if (i < ARRAY_SIZE(sdev_bflags_name) && sdev_bflags_name[i])
990991
name = sdev_bflags_name[i];

drivers/scsi/scsi_transport_spi.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,14 @@
5050

5151
/* Our blacklist flags */
5252
enum {
53-
SPI_BLIST_NOIUS = 0x1,
53+
SPI_BLIST_NOIUS = (__force blist_flags_t)0x1,
5454
};
5555

5656
/* blacklist table, modelled on scsi_devinfo.c */
5757
static struct {
5858
char *vendor;
5959
char *model;
60-
unsigned flags;
60+
blist_flags_t flags;
6161
} spi_static_device_list[] __initdata = {
6262
{"HP", "Ultrium 3-SCSI", SPI_BLIST_NOIUS },
6363
{"IBM", "ULTRIUM-TD3", SPI_BLIST_NOIUS },
@@ -221,9 +221,11 @@ static int spi_device_configure(struct transport_container *tc,
221221
{
222222
struct scsi_device *sdev = to_scsi_device(dev);
223223
struct scsi_target *starget = sdev->sdev_target;
224-
unsigned bflags = scsi_get_device_flags_keyed(sdev, &sdev->inquiry[8],
225-
&sdev->inquiry[16],
226-
SCSI_DEVINFO_SPI);
224+
blist_flags_t bflags;
225+
226+
bflags = scsi_get_device_flags_keyed(sdev, &sdev->inquiry[8],
227+
&sdev->inquiry[16],
228+
SCSI_DEVINFO_SPI);
227229

228230
/* Populate the target capability fields with the values
229231
* gleaned from the device inquiry */

0 commit comments

Comments
 (0)