* minor device type updates
@ 2014-07-18 15:17 Christoph Hellwig
2014-07-18 15:17 ` [PATCH 1/3] scsi: update scsi_device_types Christoph Hellwig
` (2 more replies)
0 siblings, 3 replies; 10+ messages in thread
From: Christoph Hellwig @ 2014-07-18 15:17 UTC (permalink / raw)
To: linux-scsi; +Cc: Hannes Reinecke
Two trivial patches extracted from Hannes' ZBC series, and one cleanup
in response to my review of it.
^ permalink raw reply [flat|nested] 10+ messages in thread
* [PATCH 1/3] scsi: update scsi_device_types
2014-07-18 15:17 minor device type updates Christoph Hellwig
@ 2014-07-18 15:17 ` Christoph Hellwig
2014-07-21 5:59 ` Hannes Reinecke
2014-07-22 3:37 ` Martin K. Petersen
2014-07-18 15:17 ` [PATCH 2/3] scsi: add a symbolic name for the ZBC device type Christoph Hellwig
2014-07-18 15:17 ` [PATCH 3/3] scsi: move the writeable from struct scsi_device to struct scsi_cd Christoph Hellwig
2 siblings, 2 replies; 10+ messages in thread
From: Christoph Hellwig @ 2014-07-18 15:17 UTC (permalink / raw)
To: linux-scsi; +Cc: Hannes Reinecke
Add two new device types, most importantly the zoned block device
one.
Split from an earlier patch by Hannes Reinecke.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/scsi/scsi.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
index 013709f..33318f5 100644
--- a/drivers/scsi/scsi.c
+++ b/drivers/scsi/scsi.c
@@ -122,6 +122,8 @@ static const char *const scsi_device_types[] = {
"Bridge controller",
"Object storage ",
"Automation/Drive ",
+ "Security Manager ",
+ "Direct-Access-ZBC",
};
/**
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 2/3] scsi: add a symbolic name for the ZBC device type
2014-07-18 15:17 minor device type updates Christoph Hellwig
2014-07-18 15:17 ` [PATCH 1/3] scsi: update scsi_device_types Christoph Hellwig
@ 2014-07-18 15:17 ` Christoph Hellwig
2014-07-21 5:59 ` Hannes Reinecke
2014-07-22 3:34 ` Martin K. Petersen
2014-07-18 15:17 ` [PATCH 3/3] scsi: move the writeable from struct scsi_device to struct scsi_cd Christoph Hellwig
2 siblings, 2 replies; 10+ messages in thread
From: Christoph Hellwig @ 2014-07-18 15:17 UTC (permalink / raw)
To: linux-scsi; +Cc: Hannes Reinecke
Make sure we have a symbolic name for the ZBC type available,
so that e.g. patch for a SATA to translate ZAC commands can
make use of it.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
include/scsi/scsi.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 91e2e42..e6df23c 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -332,6 +332,7 @@ static inline int scsi_status_is_good(int status)
#define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
#define TYPE_RBC 0x0e
#define TYPE_OSD 0x11
+#define TYPE_ZBC 0x14
#define TYPE_NO_LUN 0x7f
/* SCSI protocols; these are taken from SPC-3 section 7.5 */
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* [PATCH 3/3] scsi: move the writeable from struct scsi_device to struct scsi_cd
2014-07-18 15:17 minor device type updates Christoph Hellwig
2014-07-18 15:17 ` [PATCH 1/3] scsi: update scsi_device_types Christoph Hellwig
2014-07-18 15:17 ` [PATCH 2/3] scsi: add a symbolic name for the ZBC device type Christoph Hellwig
@ 2014-07-18 15:17 ` Christoph Hellwig
2014-07-21 6:00 ` Hannes Reinecke
2014-07-22 3:38 ` Martin K. Petersen
2 siblings, 2 replies; 10+ messages in thread
From: Christoph Hellwig @ 2014-07-18 15:17 UTC (permalink / raw)
To: linux-scsi; +Cc: Hannes Reinecke
We currently set the field in common code based on the device type,
but then only use it in the cdrom driver which also overrides the
value previously set in the generic code.
Just leave this entirely to the CDROM driver to make everyones life
simpler.
Signed-off-by: Christoph Hellwig <hch@lst.de>
---
drivers/scsi/scsi_scan.c | 24 ------------------------
drivers/scsi/sd.c | 3 ---
drivers/scsi/sr.c | 4 ++--
drivers/scsi/sr.h | 1 +
include/scsi/scsi_device.h | 1 -
5 files changed, 3 insertions(+), 30 deletions(-)
diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
index b91cfaf..a5a0bde 100644
--- a/drivers/scsi/scsi_scan.c
+++ b/drivers/scsi/scsi_scan.c
@@ -807,30 +807,6 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
sdev->removable = (inq_result[1] & 0x80) >> 7;
}
- switch (sdev->type) {
- case TYPE_RBC:
- case TYPE_TAPE:
- case TYPE_DISK:
- case TYPE_PRINTER:
- case TYPE_MOD:
- case TYPE_PROCESSOR:
- case TYPE_SCANNER:
- case TYPE_MEDIUM_CHANGER:
- case TYPE_ENCLOSURE:
- case TYPE_COMM:
- case TYPE_RAID:
- case TYPE_OSD:
- sdev->writeable = 1;
- break;
- case TYPE_ROM:
- case TYPE_WORM:
- sdev->writeable = 0;
- break;
- default:
- sdev_printk(KERN_INFO, sdev, "unknown device type %d\n",
- sdev->type);
- }
-
if (sdev->type == TYPE_RBC || sdev->type == TYPE_ROM) {
/* RBC and MMC devices can return SCSI-3 compliance and yet
* still not support REPORT LUNS, so make them act as
diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
index 3663e38..377a520 100644
--- a/drivers/scsi/sd.c
+++ b/drivers/scsi/sd.c
@@ -992,9 +992,6 @@ static int sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt)
}
}
if (rq_data_dir(rq) == WRITE) {
- if (!sdp->writeable) {
- goto out;
- }
SCpnt->cmnd[0] = WRITE_6;
if (blk_integrity_rq(rq))
diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
index cce4771..7eeb936 100644
--- a/drivers/scsi/sr.c
+++ b/drivers/scsi/sr.c
@@ -435,7 +435,7 @@ static int sr_init_command(struct scsi_cmnd *SCpnt)
}
if (rq_data_dir(rq) == WRITE) {
- if (!cd->device->writeable)
+ if (!cd->writeable)
goto out;
SCpnt->cmnd[0] = WRITE_10;
cd->cdi.media_written = 1;
@@ -927,7 +927,7 @@ static void get_capabilities(struct scsi_cd *cd)
*/
if ((cd->cdi.mask & (CDC_DVD_RAM | CDC_MRW_W | CDC_RAM | CDC_CD_RW)) !=
(CDC_DVD_RAM | CDC_MRW_W | CDC_RAM | CDC_CD_RW)) {
- cd->device->writeable = 1;
+ cd->writeable = 1;
}
kfree(buffer);
diff --git a/drivers/scsi/sr.h b/drivers/scsi/sr.h
index 5334e98..1d1f6f4 100644
--- a/drivers/scsi/sr.h
+++ b/drivers/scsi/sr.h
@@ -36,6 +36,7 @@ typedef struct scsi_cd {
struct scsi_device *device;
unsigned int vendor; /* vendor code, see sr_vendor.c */
unsigned long ms_offset; /* for reading multisession-CD's */
+ unsigned writeable : 1;
unsigned use:1; /* is this device still supportable */
unsigned xa_flag:1; /* CD has XA sectors ? */
unsigned readcd_known:1; /* drive supports READ_CD (0xbe) */
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index 0f853f2..b895784 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -127,7 +127,6 @@ struct scsi_device {
* pass settings from slave_alloc to scsi
* core. */
unsigned int eh_timeout; /* Error handling timeout */
- unsigned writeable:1;
unsigned removable:1;
unsigned changed:1; /* Data invalid due to media change */
unsigned busy:1; /* Used to prevent races */
--
1.9.1
^ permalink raw reply related [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] scsi: update scsi_device_types
2014-07-18 15:17 ` [PATCH 1/3] scsi: update scsi_device_types Christoph Hellwig
@ 2014-07-21 5:59 ` Hannes Reinecke
2014-07-22 3:37 ` Martin K. Petersen
1 sibling, 0 replies; 10+ messages in thread
From: Hannes Reinecke @ 2014-07-21 5:59 UTC (permalink / raw)
To: Christoph Hellwig, linux-scsi
On 07/18/2014 05:17 PM, Christoph Hellwig wrote:
> Add two new device types, most importantly the zoned block device
> one.
>
> Split from an earlier patch by Hannes Reinecke.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/scsi/scsi.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/drivers/scsi/scsi.c b/drivers/scsi/scsi.c
> index 013709f..33318f5 100644
> --- a/drivers/scsi/scsi.c
> +++ b/drivers/scsi/scsi.c
> @@ -122,6 +122,8 @@ static const char *const scsi_device_types[] = {
> "Bridge controller",
> "Object storage ",
> "Automation/Drive ",
> + "Security Manager ",
> + "Direct-Access-ZBC",
> };
>
> /**
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/3] scsi: add a symbolic name for the ZBC device type
2014-07-18 15:17 ` [PATCH 2/3] scsi: add a symbolic name for the ZBC device type Christoph Hellwig
@ 2014-07-21 5:59 ` Hannes Reinecke
2014-07-22 3:34 ` Martin K. Petersen
1 sibling, 0 replies; 10+ messages in thread
From: Hannes Reinecke @ 2014-07-21 5:59 UTC (permalink / raw)
To: Christoph Hellwig, linux-scsi
On 07/18/2014 05:17 PM, Christoph Hellwig wrote:
> Make sure we have a symbolic name for the ZBC type available,
> so that e.g. patch for a SATA to translate ZAC commands can
> make use of it.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> include/scsi/scsi.h | 1 +
> 1 file changed, 1 insertion(+)
>
> diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
> index 91e2e42..e6df23c 100644
> --- a/include/scsi/scsi.h
> +++ b/include/scsi/scsi.h
> @@ -332,6 +332,7 @@ static inline int scsi_status_is_good(int status)
> #define TYPE_ENCLOSURE 0x0d /* Enclosure Services Device */
> #define TYPE_RBC 0x0e
> #define TYPE_OSD 0x11
> +#define TYPE_ZBC 0x14
> #define TYPE_NO_LUN 0x7f
>
> /* SCSI protocols; these are taken from SPC-3 section 7.5 */
>
Reviewed-by: Hannes Reinecke <hare@Suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] scsi: move the writeable from struct scsi_device to struct scsi_cd
2014-07-18 15:17 ` [PATCH 3/3] scsi: move the writeable from struct scsi_device to struct scsi_cd Christoph Hellwig
@ 2014-07-21 6:00 ` Hannes Reinecke
2014-07-22 3:38 ` Martin K. Petersen
1 sibling, 0 replies; 10+ messages in thread
From: Hannes Reinecke @ 2014-07-21 6:00 UTC (permalink / raw)
To: Christoph Hellwig, linux-scsi
On 07/18/2014 05:17 PM, Christoph Hellwig wrote:
> We currently set the field in common code based on the device type,
> but then only use it in the cdrom driver which also overrides the
> value previously set in the generic code.
>
> Just leave this entirely to the CDROM driver to make everyones life
> simpler.
>
> Signed-off-by: Christoph Hellwig <hch@lst.de>
> ---
> drivers/scsi/scsi_scan.c | 24 ------------------------
> drivers/scsi/sd.c | 3 ---
> drivers/scsi/sr.c | 4 ++--
> drivers/scsi/sr.h | 1 +
> include/scsi/scsi_device.h | 1 -
> 5 files changed, 3 insertions(+), 30 deletions(-)
>
> diff --git a/drivers/scsi/scsi_scan.c b/drivers/scsi/scsi_scan.c
> index b91cfaf..a5a0bde 100644
> --- a/drivers/scsi/scsi_scan.c
> +++ b/drivers/scsi/scsi_scan.c
> @@ -807,30 +807,6 @@ static int scsi_add_lun(struct scsi_device *sdev, unsigned char *inq_result,
> sdev->removable = (inq_result[1] & 0x80) >> 7;
> }
>
> - switch (sdev->type) {
> - case TYPE_RBC:
> - case TYPE_TAPE:
> - case TYPE_DISK:
> - case TYPE_PRINTER:
> - case TYPE_MOD:
> - case TYPE_PROCESSOR:
> - case TYPE_SCANNER:
> - case TYPE_MEDIUM_CHANGER:
> - case TYPE_ENCLOSURE:
> - case TYPE_COMM:
> - case TYPE_RAID:
> - case TYPE_OSD:
> - sdev->writeable = 1;
> - break;
> - case TYPE_ROM:
> - case TYPE_WORM:
> - sdev->writeable = 0;
> - break;
> - default:
> - sdev_printk(KERN_INFO, sdev, "unknown device type %d\n",
> - sdev->type);
> - }
> -
> if (sdev->type == TYPE_RBC || sdev->type == TYPE_ROM) {
> /* RBC and MMC devices can return SCSI-3 compliance and yet
> * still not support REPORT LUNS, so make them act as
> diff --git a/drivers/scsi/sd.c b/drivers/scsi/sd.c
> index 3663e38..377a520 100644
> --- a/drivers/scsi/sd.c
> +++ b/drivers/scsi/sd.c
> @@ -992,9 +992,6 @@ static int sd_setup_read_write_cmnd(struct scsi_cmnd *SCpnt)
> }
> }
> if (rq_data_dir(rq) == WRITE) {
> - if (!sdp->writeable) {
> - goto out;
> - }
> SCpnt->cmnd[0] = WRITE_6;
>
> if (blk_integrity_rq(rq))
> diff --git a/drivers/scsi/sr.c b/drivers/scsi/sr.c
> index cce4771..7eeb936 100644
> --- a/drivers/scsi/sr.c
> +++ b/drivers/scsi/sr.c
> @@ -435,7 +435,7 @@ static int sr_init_command(struct scsi_cmnd *SCpnt)
> }
>
> if (rq_data_dir(rq) == WRITE) {
> - if (!cd->device->writeable)
> + if (!cd->writeable)
> goto out;
> SCpnt->cmnd[0] = WRITE_10;
> cd->cdi.media_written = 1;
> @@ -927,7 +927,7 @@ static void get_capabilities(struct scsi_cd *cd)
> */
> if ((cd->cdi.mask & (CDC_DVD_RAM | CDC_MRW_W | CDC_RAM | CDC_CD_RW)) !=
> (CDC_DVD_RAM | CDC_MRW_W | CDC_RAM | CDC_CD_RW)) {
> - cd->device->writeable = 1;
> + cd->writeable = 1;
> }
>
> kfree(buffer);
> diff --git a/drivers/scsi/sr.h b/drivers/scsi/sr.h
> index 5334e98..1d1f6f4 100644
> --- a/drivers/scsi/sr.h
> +++ b/drivers/scsi/sr.h
> @@ -36,6 +36,7 @@ typedef struct scsi_cd {
> struct scsi_device *device;
> unsigned int vendor; /* vendor code, see sr_vendor.c */
> unsigned long ms_offset; /* for reading multisession-CD's */
> + unsigned writeable : 1;
> unsigned use:1; /* is this device still supportable */
> unsigned xa_flag:1; /* CD has XA sectors ? */
> unsigned readcd_known:1; /* drive supports READ_CD (0xbe) */
> diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
> index 0f853f2..b895784 100644
> --- a/include/scsi/scsi_device.h
> +++ b/include/scsi/scsi_device.h
> @@ -127,7 +127,6 @@ struct scsi_device {
> * pass settings from slave_alloc to scsi
> * core. */
> unsigned int eh_timeout; /* Error handling timeout */
> - unsigned writeable:1;
> unsigned removable:1;
> unsigned changed:1; /* Data invalid due to media change */
> unsigned busy:1; /* Used to prevent races */
>
Reviewed-by: Hannes Reinecke <hare@suse.de>
Cheers,
Hannes
--
Dr. Hannes Reinecke zSeries & Storage
hare@suse.de +49 911 74053 688
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: J. Hawn, J. Guild, F. Imendörffer, HRB 16746 (AG Nürnberg)
--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 2/3] scsi: add a symbolic name for the ZBC device type
2014-07-18 15:17 ` [PATCH 2/3] scsi: add a symbolic name for the ZBC device type Christoph Hellwig
2014-07-21 5:59 ` Hannes Reinecke
@ 2014-07-22 3:34 ` Martin K. Petersen
1 sibling, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2014-07-22 3:34 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-scsi, Hannes Reinecke
>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:
Christoph> Make sure we have a symbolic name for the ZBC type available,
Christoph> so that e.g. patch for a SATA to translate ZAC commands can
Christoph> make use of it.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 1/3] scsi: update scsi_device_types
2014-07-18 15:17 ` [PATCH 1/3] scsi: update scsi_device_types Christoph Hellwig
2014-07-21 5:59 ` Hannes Reinecke
@ 2014-07-22 3:37 ` Martin K. Petersen
1 sibling, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2014-07-22 3:37 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-scsi, Hannes Reinecke
>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:
Christoph> Add two new device types, most importantly the zoned block
Christoph> device one.
Christoph> + "Direct-Access-ZBC",
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: [PATCH 3/3] scsi: move the writeable from struct scsi_device to struct scsi_cd
2014-07-18 15:17 ` [PATCH 3/3] scsi: move the writeable from struct scsi_device to struct scsi_cd Christoph Hellwig
2014-07-21 6:00 ` Hannes Reinecke
@ 2014-07-22 3:38 ` Martin K. Petersen
1 sibling, 0 replies; 10+ messages in thread
From: Martin K. Petersen @ 2014-07-22 3:38 UTC (permalink / raw)
To: Christoph Hellwig; +Cc: linux-scsi, Hannes Reinecke
>>>>> "Christoph" == Christoph Hellwig <hch@lst.de> writes:
Christoph> We currently set the field in common code based on the device
Christoph> type, but then only use it in the cdrom driver which also
Christoph> overrides the value previously set in the generic code.
Christoph> Just leave this entirely to the CDROM driver to make
Christoph> everyones life simpler.
Reviewed-by: Martin K. Petersen <martin.petersen@oracle.com>
--
Martin K. Petersen Oracle Linux Engineering
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2014-07-22 3:38 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-07-18 15:17 minor device type updates Christoph Hellwig
2014-07-18 15:17 ` [PATCH 1/3] scsi: update scsi_device_types Christoph Hellwig
2014-07-21 5:59 ` Hannes Reinecke
2014-07-22 3:37 ` Martin K. Petersen
2014-07-18 15:17 ` [PATCH 2/3] scsi: add a symbolic name for the ZBC device type Christoph Hellwig
2014-07-21 5:59 ` Hannes Reinecke
2014-07-22 3:34 ` Martin K. Petersen
2014-07-18 15:17 ` [PATCH 3/3] scsi: move the writeable from struct scsi_device to struct scsi_cd Christoph Hellwig
2014-07-21 6:00 ` Hannes Reinecke
2014-07-22 3:38 ` Martin K. Petersen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox